You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
p6tsc84h5/static/js/182.22ee7526.chunk.js

1 line
10 KiB

webpackJsonp([182],{1064:function(e,t,n){var s=n(48),l=Object.prototype.hasOwnProperty,c=Array.prototype.splice,r=Object.prototype.toString,p=function(e){return r.call(e).slice(8,-1)},a=Object.assign||function(t,n){return f(n).forEach(function(e){l.call(n,e)&&(t[e]=n[e])}),t},f="function"==typeof Object.getOwnPropertySymbols?function(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.keys(e)};function m(e){if(Array.isArray(e))return a(e.constructor(e.length),e);if("Map"===p(e))return new Map(e);if("Set"===p(e))return new Set(e);if(e&&"object"==typeof e){var t=Object.getPrototypeOf(e);return a(Object.create(t),e)}return e}function o(){var i=a({},y);return u.extend=function(e,t){i[e]=t},u.isEquals=function(e,t){return e===t},u;function u(a,o){"function"==typeof o&&(o={$apply:o}),Array.isArray(a)&&Array.isArray(o)||s(!Array.isArray(o),"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."),s("object"==typeof o&&null!==o,"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the following commands: %s.",Object.keys(i).join(", "));var c=a;return f(o).forEach(function(e){if(l.call(i,e)){var t=a===c;c=i[e](o[e],c,o,a),t&&u.isEquals(c,a)&&(c=a)}else{var n="Map"===p(a)?u(a.get(e),o[e]):u(a[e],o[e]),r="Map"===p(c)?c.get(e):c[e];u.isEquals(n,r)&&(void 0!==n||l.call(a,e))||(c===a&&(c=m(a)),"Map"===p(c)?c.set(e,n):c[e]=n)}}),c}}var y={$push:function(e,t,n){return u(t,n,"$push"),e.length?t.concat(e):t},$unshift:function(e,t,n){return u(t,n,"$unshift"),e.length?e.concat(t):t},$splice:function(e,t,n,r){var a,o;return a=t,o=n,s(Array.isArray(a),"Expected $splice target to be an array; got %s",a),b(o.$splice),e.forEach(function(e){b(e),t===r&&e.length&&(t=m(r)),c.apply(t,e)}),t},$set:function(e,t,n){var r;return r=n,s(1===Object.keys(r).length,"Cannot have more than one key in an object with $set"),e},$toggle:function(e,t){d(e,"$toggle");var n=e.length?m(t):t;return e.forEach(function(e){n[e]=!t[e]}),n},$unset:function(e,t,n,r){return d(e,"$unset"),e.forEach(function(e){Object.hasOwnProperty.call(t,e)&&(t===r&&(t=m(r)),delete t[e])}),t},$add:function(e,r,t,a){return g(r,"$add"),d(e,"$add"),"Map"===p(r)?e.forEach(function(e){var t=e[0],n=e[1];r===a&&r.get(t)!==n&&(r=m(a)),r.set(t,n)}):e.forEach(function(e){r!==a||r.has(e)||(r=m(a)),r.add(e)}),r},$remove:function(e,t,n,r){return g(t,"$remove"),d(e,"$remove"),e.forEach(function(e){t===r&&t.has(e)&&(t=m(r)),t.delete(e)}),t},$merge:function(t,n,e,r){var a,o;return a=n,s((o=t)&&"object"==typeof o,"update(): $merge expects a spec of type 'object'; got %s",o),s(a&&"object"==typeof a,"update(): $merge expects a target of type 'object'; got %s",a),f(t).forEach(function(e){t[e]!==n[e]&&(n===r&&(n=m(r)),n[e]=t[e])}),n},$apply:function(e,t){var n;return s("function"==typeof(n=e),"update(): expected spec of $apply to be a function; got %s.",n),e(t)}},i=o();function u(e,t,n){s(Array.isArray(e),"update(): expected target of %s to be an array; got %s.",n,e),d(t[n],n)}function d(e,t){s(Array.isArray(e),"update(): expected spec of %s to be an array; got %s. Did you forget to wrap your parameter in an array?",t,e)}function b(e){s(Array.isArray(e),"update(): expected spec of $splice to be an array of arrays; got %s. Did you forget to wrap your parameters in an array?",e)}function g(e,t){var n=p(e);s("Map"===n||"Set"===n,"update(): %s expects a target of type Set or Map; got %s",t,n)}e.exports=i,e.exports.default=i,e.exports.newContext=o},3016:function(e,t,n){"use strict";var r=n(165),a=(n.n(r),n(164)),o=n.n(a),c=n(0),i=n.n(c),u=n(3),s=(n.n(u),n(12)),l=(n.n(s),function(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e});function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(m,c.Component),l(m,[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this,e=this.props,n=(e.match,e.columns),t=e.tableData;return t&&t.length?i.a.createElement("table",{className:"edu-pop-table-all edu-txt-center color-grey-6 interval-td",cellspacing:"0",cellpadding:"0"},i.a.createElement("tbody",null,i.a.createElement("tr",null,n.map(function(e,t){return 0==t?i.a.createElement("td",{className:"gaugeOutfit"},i.a.createElement("span",null,n[0][0]),i.a.createElement("span",null,n[0][1])):i.a.createElement(o.a,{title:e},i.a.createElement("td",null,r.props.columnName||"目标",t))})),t.map(function(e,n){var t=e.map(function(e,t){return 0==t?i.a.createElement(o.a,{title:e},i.a.createElement("td",null,"指标点",r.props.firstColIndexArray?r.props.firstColIndexArray[n]:n+1)):i.a.createElement(o.a,{title:e?"取消支撑":"选择支撑"},i.a.createElement("td",{onClick:function(){return r.props.onCellClick(n,t,!!e)}},i.a.createElement("i",{className:"iconfont icon-gouxuan "+(e?"color-green":"color-grey-eb")+" font-16 mr5"})))});return i.a.createElement("tr",{className:"sustainLine editTd"},t)}))):""}}]),m);function m(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,e));return t.state={},t}t.a=f},4401:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n.n(r),a=n(3),c=(n.n(a),n(12)),i=n.n(c),u=n(3016),s=n(1064),l=n.n(s),p=function(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),e};function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var d=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(b,r.Component),p(b,[{key:"componentDidMount",value:function(){var t=this,e="/ec_years/"+this.props.match.params.yearId+"/requirement_support_objectives.json";i.a.get(e).then(function(e){e.data.graduation_requirements&&t.setState(Object.assign({},e.data),function(){t.init()})}).catch(function(e){})}},{key:"render",value:function(){var e=this.props,t=(e.match,e.history,e.current_user,this.state),n=t.tableData,r=t.training_subitems,a=(t.graduation_requirements,t.is_manager,r&&[["毕业要求","培养目标"]].concat(y(r.map(function(e){return e.content}))));return console.log(a,n),o.a.createElement("div",{className:"educontent requirementVsObjective",style:{background:"#fff"}},o.a.createElement("ul",{className:"clearfix padding20-30 bor-bottom-greyE backgroundFFF",style:{marginBottom:"0px"}},o.a.createElement("li",{className:"fl"},o.a.createElement("p",{className:"font-18 courseSystem"}," 毕业要求对培养目标的支撑 "),o.a.createElement("p",null,o.a.createElement("span",{className:"color-grey-9 mr10"},"用矩阵图的形式说明本专业毕业要求对培养目标的支撑关系,鼠标左键单击单元格即可"),o.a.createElement("a",{target:"_blank",href:"/forums/3531",className:"color-blue"},"查看详情"))),o.a.createElement("a",{href:"/api/ec_years/"+this.props.yearId+"/requirement_support_objectives.xlsx",target:"_blank",className:"ant-btn ant-btn-primary color-white fr mt20"},"导出矩阵")),o.a.createElement("div",{className:"padding20-30",style:{background:"#fff"}},o.a.createElement("p",{className:"clearfix mb20"},o.a.createElement("span",{className:"fl mr30"},o.a.createElement("i",{className:"iconfont icon-gouxuan color-green font-16 mr5"}),"表示支撑"),o.a.createElement("span",{className:"fl"},o.a.createElement("i",{className:"iconfont icon-gouxuan color-grey-eb font-16 mr5"}),"表示不支撑")),o.a.createElement(u.a,{columns:a,tableData:n,onCellClick:this.onCellClick})))}}]),b);function b(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b);var c=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,e));return c.init=function(){c.graduationRequirementsIdIndexMap={},c.trainingSubitemsIdIndexMap={},c.state.graduation_requirements.forEach(function(e,t){c.graduationRequirementsIdIndexMap[e.id]=t}),c.state.training_subitems.forEach(function(e,t){c.trainingSubitemsIdIndexMap[e.id]=t+1});var n=[];c.state.graduation_requirements.forEach(function(e,t){n.push([e.content].concat(y(Array(c.state.training_subitems.length))))}),c.state.requirement_support_objectives.forEach(function(e){n[c.graduationRequirementsIdIndexMap[e.graduation_requirement_id]][c.trainingSubitemsIdIndexMap[e.training_subitem_id]]=!0}),c.setState({tableData:n})},c.onCellClick=function(t,n,r){console.log(t,n,r);var e=c.state.graduation_requirements[t].id,a=c.state.training_subitems[n-1].id,o="/ec_years/"+c.props.match.params.yearId+"/requirement_support_objectives.json";(r?i.a.delete:i.a.post)(o,r?{params:{ec_graduation_requirement_id:e,ec_training_subitem_id:a}}:{ec_graduation_requirement_id:e,ec_training_subitem_id:a}).then(function(e){0==e.data.status&&(c.setState(function(e){return{tableData:l()(e.tableData,m({},t,m({},n,{$set:!r})))}}),c.props.showNotification((r?"取消":"选择")+"成功"))}).catch(function(e){})},c.state={},c}t.default=d}});