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.
NewEduCoderBuild/p__Paperlibrary__Random__Ad...

2 lines
36 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[134],{IoUt:function(re,W,m){re.exports={flex_box_center:"flex_box_center___3N1vU",flex_space_between:"flex_space_between___A7Vod",flex_box_vertical_center:"flex_box_vertical_center___34bDS",flex_box_center_end:"flex_box_center_end___3_uG-",flex_box_column:"flex_box_column___1D2by",wrap:"wrap___3HjzC",contentWrap:"contentWrap___DSAvO",tabsWrap:"tabsWrap___4HtM9",searchWrap:"searchWrap___2Zt2F",searchContent:"searchContent___3NqTR",search:"search___pLAYU",buttonWrap:"buttonWrap___2X_Df",selectBar:"selectBar___3eSji",tableWrap:"tableWrap___wwRLZ",paginationWrap:"paginationWrap___3xt0C",modal:"modal___1KOAK",gap:"gap___2B8M7",checkbox:"checkbox___dUmix",maxHeiTag:"maxHeiTag___1XHFp",buttongroup:"buttongroup___1nTQQ"}},N5Ab:function(re,W,m){re.exports={flex_box_center:"flex_box_center___1hJpS",flex_space_between:"flex_space_between___3fslx",flex_box_vertical_center:"flex_box_vertical_center___2KmoI",flex_box_center_end:"flex_box_center_end___1l8U5",flex_box_column:"flex_box_column___9pIkv",formItem:"formItem___1YUoJ"}},ueiT:function(re,W,m){"use strict";m.r(W),m.d(W,"questionType",function(){return Z}),m.d(W,"difficultType",function(){return Le});var Ve=m("y8nQ"),N=m("Vl3Y"),Xe=m("IzEo"),de=m("bx4M"),We=m("T2oS"),Re=m("W9HT"),Je=m("/zsF"),fe=m("PArb"),He=m("sPJy"),ie=m("bE4q"),ze=m("+L6B"),I=m("2/Rp"),pe=m("PpiC"),oe=m("9og8"),$e=m("miYZ"),J=m("tsqr"),_e=m("jrin"),S=m("k1fw"),z=m("fWQN"),$=m("mtLc"),Q=m("yKVA"),Y=m("879j"),Qe=m("FJo9"),me=m("L41K"),Ue=m("q1tI"),n=m.n(Ue),Ye=m("qVdP"),Pe=m("jsC+"),Ke=m("7Kak"),k=m("9yH6"),Ze=m("giR+"),se=m("fyUT"),ue=m("oBTY"),qe=m("lUTK"),ae=m("BvKs"),et=m("5NDa"),he=m("5rEg"),Ee=m("2BaD"),ve=m("55Ip"),De=function(){return n.a.createElement("div",{style:{textAlign:"right",fontSize:12,color:"#ccc",marginTop:95}},"\u5982\u8003\u5BDF\u8303\u56F4\u4E0D\u80FD\u6EE1\u8DB3\u9700\u6C42\uFF0C\u8BF7\u81EA\u884C\u8865\u5145\u8BD5\u9898\u5145\u5B9E\u8003\u5BDF\u8303\u56F4",n.a.createElement(ve.Link,{to:"/problemset",target:"_blank",style:{marginLeft:10,color:"#1890FF"}},"\u73B0\u5728\u5C31\u53BB"))},ye=De,H=m("ErOA"),Oe=m("IoUt"),ge=m.n(Oe);function le(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */le=function(){return R};var R={},x=Object.prototype,v=x.hasOwnProperty,d=typeof Symbol=="function"?Symbol:{},r=d.iterator||"@@iterator",b=d.asyncIterator||"@@asyncIterator",f=d.toStringTag||"@@toStringTag";function s(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(a,i,o){return a[i]=o}}function p(t,e,a,i){var o=e&&e.prototype instanceof D?e:D,u=Object.create(o.prototype),L=new G(i||[]);return u._invoke=function(j,A,_){var P="suspendedStart";return function(T,te){if(P==="executing")throw new Error("Generator is already running");if(P==="completed"){if(T==="throw")throw te;return ee()}for(_.method=T,_.arg=te;;){var ne=_.delegate;if(ne){var X=V(ne,_);if(X){if(X===l)continue;return X}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(P==="suspendedStart")throw P="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);P="executing";var w=y(j,A,_);if(w.type==="normal"){if(P=_.done?"completed":"suspendedYield",w.arg===l)continue;return{value:w.arg,done:_.done}}w.type==="throw"&&(P="completed",_.method="throw",_.arg=w.arg)}}}(t,a,L),u}function y(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(i){return{type:"throw",arg:i}}}R.wrap=p;var l={};function D(){}function U(){}function h(){}var c={};s(c,r,function(){return this});var E=Object.getPrototypeOf,g=E&&E(E(B([])));g&&g!==x&&v.call(g,r)&&(c=g);var O=h.prototype=D.prototype=Object.create(c);function F(t){["next","throw","return"].forEach(function(e){s(t,e,function(a){return this._invoke(e,a)})})}function C(t,e){function a(o,u,L,j){var A=y(t[o],t,u);if(A.type!=="throw"){var _=A.arg,P=_.value;return P&&typeof P=="object"&&v.call(P,"__await")?e.resolve(P.__await).then(function(T){a("next",T,L,j)},function(T){a("throw",T,L,j)}):e.resolve(P).then(function(T){_.value=T,L(_)},function(T){return a("throw",T,L,j)})}j(A.arg)}var i;this._invoke=function(o,u){function L(){return new e(function(j,A){a(o,u,j,A)})}return i=i?i.then(L,L):L()}}function V(t,e){var a=t.iterator[e.method];if(a===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),e.method==="throw"))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=y(a,t.iterator,e.arg);if(i.type==="throw")return e.method="throw",e.arg=i.arg,e.delegate=null,l;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function q(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(q,this),this.reset(!0)}function B(t){if(t){var e=t[r];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var a=-1,i=function o(){for(;++a<t.length;)if(v.call(t,a))return o.value=t[a],o.done=!1,o;return o.value=void 0,o.done=!0,o};return i.next=i}}return{next:ee}}function ee(){return{value:void 0,done:!0}}return U.prototype=h,s(O,"constructor",h),s(h,"constructor",U),U.displayName=s(h,f,"GeneratorFunction"),R.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===U||(e.displayName||e.name)==="GeneratorFunction")},R.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},R.awrap=function(t){return{__await:t}},F(C.prototype),s(C.prototype,b,function(){return this}),R.AsyncIterator=C,R.async=function(t,e,a,i,o){o===void 0&&(o=Promise);var u=new C(p(t,e,a,i),o);return R.isGeneratorFunction(e)?u:u.next().then(function(L){return L.done?L.value:u.next()})},F(O),s(O,f,"Generator"),s(O,r,function(){return this}),s(O,"toString",function(){return"[object Generator]"}),R.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function i(){for(;e.length;){var o=e.pop();if(o in t)return i.value=o,i.done=!1,i}return i.done=!0,i}},R.values=B,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!e)for(var a in this)a.charAt(0)==="t"&&v.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function i(_,P){return L.type="throw",L.arg=e,a.next=_,P&&(a.method="next",a.arg=void 0),!!P}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],L=u.completion;if(u.tryLoc==="root")return i("end");if(u.tryLoc<=this.prev){var j=v.call(u,"catchLoc"),A=v.call(u,"finallyLoc");if(j&&A){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(j){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,a){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=a&&a<=u.finallyLoc&&(u=null);var L=u?u.completion:{};return L.type=e,L.arg=a,u?(this.method="next",this.next=u.finallyLoc,l):this.complete(L)},complete:function(e,a){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&a&&(this.next=a),l},finish:function(e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),M(i),l}},catch:function(e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc===e){var o=i.completion;if(o.type==="throw"){var u=o.arg;M(i)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,i){return this.delegate={iterator:B(e),resultName:a,nextLoc:i},this.method==="next"&&(this.arg=void 0),l}},R}var xe=he.a.TextArea,Ce=ae.a.SubMenu,ce=function(x){return!x||Number.isNaN(Number(x))?"":Math.ceil(x)},je=function(R){Object(Q.a)(v,R);var x=Object(Y.a)(v);function v(){var d;Object(z.a)(this,v);for(var r=arguments.length,b=new Array(r),f=0;f<r;f++)b[f]=arguments[f];return d=x.call.apply(x,[this].concat(b)),d.state={titleLen:0,subDisciplinesList:[],allGroupList:[],selectGroupList:[]},d.subDisciplinesAdd=function(s){var p=d.props.form.getFieldValue("subDisciplines")||[];if(p.filter(function(l){return s.id===l.id}).length>0)J.b.error("\u60A8\u5DF2\u7ECF\u9009\u62E9\u8FC7\u6B64\u65B9\u5411\uFF01");else{var y=[].concat(Object(ue.a)(p),[s]);d.props.form.setFieldsValue({subDisciplines:y}),d.setState({subDisciplinesList:y})}},d.disciplinesRemove=function(s){var p=d.props.form.getFieldValue("subDisciplines")||[],y=p.filter(function(l){return l.id!==s.id});d.props.form.setFieldsValue({subDisciplines:y}),d.setState({subDisciplinesList:y})},d.handleSourceRadioChange=function(s){d.props.getdisciplines(s.target.value);var p=[];d.props.form.setFieldsValue({subDisciplines:p}),d.setState({subDisciplinesList:p})},d.handleGetGroupByDisciplines=Object(oe.a)(le().mark(function s(){var p,y,l,D,U,h,c,E=arguments;return le().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return p=E.length>0&&E[0]!==void 0?E[0]:[],console.log("xjx disciplines: ",p),y=d.state.selectGroupList,O.next=5,Object(H.a)("/api/item_banks_groups/mine.json",{method:"get"});case 5:l=O.sent,D=(l==null?void 0:l.item_banks_groups)||[],U=Object(ue.a)(new Set(D.map(function(F){return F.id}))),D=D.filter(function(F){return U.includes(F.id)}),d.setState({allGroupList:D}),h=D.map(function(F){return F.id}),c=y.filter(function(F){return h.includes(F.id)}),d.props.form.setFieldsValue({group_ids:c}),d.setState({selectGroupList:c});case 14:case"end":return O.stop()}},s)})),d.addGroup=function(s){var p=d.props.form.getFieldValue("group_ids")||[];if(p.find(function(l){return l.id===s.id})){J.b.error("\u60A8\u5DF2\u7ECF\u9009\u62E9\u8FC7\u6B64\u5206\u7EC4\uFF01");return}var y=[].concat(Object(ue.a)(p),[s]);d.props.form.setFieldsValue({group_ids:y}),d.setState({selectGroupList:y})},d.removeGroup=function(s){var p=d.props.form.getFieldValue("group_ids")||[],y=p.filter(function(l){return l.id!==s.id});d.props.form.setFieldsValue({group_ids:y}),d.setState({selectGroupList:y})},d}return Object($.a)(v,[{key:"componentDidMount",value:function(){this.handleGetGroupByDisciplines()}},{key:"render",value:function(){var r=this;if(!this.props.form)return"";var b=this.props,f=b.disciplines,s=b.form,p=s.getFieldDecorator,y=s.getFieldValue,l=this.state,D=l.subDisciplinesList,U=l.allGroupList,h=l.selectGroupList;return n.a.createElement("div",null,n.a.createElement(N.a.Item,{label:"\u8BD5\u5377\u540D\u79F0:",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"}]},n.a.createElement(he.a,{style:{height:38},placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u591A60\u5B57",suffix:this.state.titleLen+"/60",onChange:function(E){r.setState({titleLen:y("name").length})},maxLength:60})),n.a.createElement(N.a.Item,{label:"\u8003\u8BD5\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u8003\u8BD5\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},n.a.createElement("div",null,n.a.createElement(se.a,{min:1,max:9999,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u8003\u8BD5\u65F6\u957F",style:{width:150}}),n.a.createElement("span",{style:{marginLeft:8}},"\u5206\u949F"))),n.a.createElement(N.a.Item,{label:"\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},n.a.createElement(k.a.Group,{className:ge.a.buttongroup,size:"large"},n.a.createElement(k.a.Button,{style:{width:120,textAlign:"center",borderRadius:50},value:1},"\u7B80\u5355"),n.a.createElement(k.a.Button,{style:{width:120,textAlign:"center",borderRadius:50},value:2},"\u9002\u4E2D"),n.a.createElement(k.a.Button,{style:{width:120,textAlign:"center",borderRadius:50},value:3},"\u56F0\u96BE"))),n.a.createElement(N.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},n.a.createElement(xe,{rows:4,maxLength:300})),n.a.createElement(N.a.Item,{label:"\u8BD5\u9898\u6765\u6E90",name:"source",style:{width:"100%"},extra:n.a.createElement("span",{style:{color:"#999",position:"absolute",left:100,top:"-28px",fontSize:12}},"\uFF08\u4E3A\u4FDD\u8BC1\u8003\u5BDF\u51C6\u786E\u6027\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u79C1\u6709\u9898\u5E93\uFF09"),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BD5\u9898\u6765\u6E90"}],initialValue:1},n.a.createElement(k.a.Group,{style:{display:"flex",width:700,justifyContent:"space-between"},onChange:function(E){r.handleSourceRadioChange(E)}},n.a.createElement(k.a,{value:1},"\u4EC5\u79C1\u6709\u9898\u5E93"),n.a.createElement(k.a,{value:0},"\u516C\u5171\u9898\u5E93+\u79C1\u6709\u9898\u5E93"))),n.a.createElement(N.a.Item,{onChange:function(){console.log(y("subDisciplines"))},label:"\u8003\u67E5\u8303\u56F4\uFF1A",name:"subDisciplines",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8003\u67E5\u8303\u56F4"}]},n.a.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},f.map(function(c){return n.a.createElement(Pe.a,{key:"disciplines"+c.id,placement:"bottomLeft",overlay:n.a.createElement("div",null,c.sub_disciplines.length>0?c.sub_disciplines.map(function(E){var g;return n.a.createElement(ae.a,{key:E.id,mode:"vertical"},n.a.createElement(Ce,{title:E.name,popupClassName:((g=E.tag_disciplines)===null||g===void 0?void 0:g.length)>10?ge.a.maxHeiTag:""},Array.isArray(E.tag_disciplines)&&!!E.tag_disciplines.length?E.tag_disciplines.map(function(O,F){return n.a.createElement(ae.a.Item,{onClick:function(){r.subDisciplinesAdd(O)},key:O.id},n.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},O.name),n.a.createElement("span",null,O.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))}):n.a.createElement(ae.a.Item,null,"\u6682\u65E0\u6570\u636E")))}):n.a.createElement(de.a,null,"\u6682\u65E0\u6570\u636E"))},n.a.createElement(I.a,{style:{marginRight:12,marginTop:6,marginBottom:6}},c.name))}))),D.length>0?n.a.createElement("div",{style:{minHeight:150,backgroundColor:"#FAFAFA"}},n.a.createElement("div",{style:{paddingLeft:12,paddingTop:12}},"\u5DF2\u9009"),n.a.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},D.map(function(c){return n.a.createElement("div",{key:"subDisciplinesList"+c.id},n.a.createElement(I.a,{style:{margin:"12px 6px",backgroundColor:"#F6FFED"},onClick:function(){r.disciplinesRemove(c)}},c.is_default&&n.a.createElement("span",null,c.parent_name," /"),c.name,n.a.createElement(Ee.a,null)))}))):null,!!U.length&&n.a.createElement(N.a.Item,{label:"\u6240\u5C5E\u5206\u7EC4\uFF1A\uFF08\u5982\u9009\u62E9\u5206\u7EC4\uFF0C\u5219\u7CFB\u7EDF\u53D6\u60A8\u9009\u4E2D\u7684\u5206\u7EC4\u548C\u8003\u67E5\u8303\u56F4\u4E2D\u7684\u9898\u7684\u5E76\u96C6\u4F5C\u4E3A\u968F\u673A\u5BF9\u8C61\u3002\uFF09",name:"group_ids"},n.a.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},U.map(function(c){return n.a.createElement(I.a,{onClick:function(){return r.addGroup(c)},style:{marginRight:12,marginTop:6,marginBottom:6}},c.name)}))),h.length>0?n.a.createElement("div",{style:{minHeight:150,backgroundColor:"#FAFAFA"}},n.a.createElement("div",{style:{paddingLeft:12,paddingTop:12}},"\u5DF2\u9009"),n.a.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},h.map(function(c){return n.a.createElement("div",{key:c.group_id},n.a.createElement(I.a,{style:{margin:"12px 6px",backgroundColor:"#F6FFED"},onClick:function(){r.removeGroup(c)}},c.name,n.a.createElement(Ee.a,null)))}))):null,n.a.createElement(ye,null))}}]),v}(n.a.Component),Fe=je,Ae=m("N5Ab"),be=m.n(Ae),Te=function(R){Object(Q.a)(v,R);var x=Object(Y.a)(v);function v(){return Object(z.a)(this,v),x.apply(this,arguments)}return Object($.a)(v,[{key:"render",value:function(){var r=this.props.form,b=r.getFieldDecorator,f=r.getFieldsValue,s=r.setFieldsValue,p=this.props.data,y=p.item_type,l=p.items_by_item_type,D=function(g){var O=g.difficult,F=g.count;return n.a.createElement("div",{style:{marginRight:10,lineHeight:"18px"}},n.a.createElement("div",{style:{fontSize:14,textAlign:"left"}},Le[O]),n.a.createElement("div",{style:{fontSize:12,color:"#999999"}},"(\u5171 ",F," \u9898\u53EF\u9009)"))},U=f(),h=Object.keys(U).filter(function(E){return E.includes("".concat(y,"-"))&&U[E]}),c=0;return h.map(function(E){return c+=U[E],null}),n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{className:"font14"},Z[y]),ce(c)>0?n.a.createElement("span",{style:{color:"#999999",fontSize:12}},"\uFF08\u5DF2\u9009 ",ce(c)," \u9898\uFF09"):null),l.map(function(E){return n.a.createElement("div",{key:y+E.discipline_id+E.sub_discipline_id},n.a.createElement("div",{style:{fontSize:16,margin:"16px 0px",fontWeight:"500"}},E.discipline_name," / ",E.sub_discipline_name," ",E.tag_discipline_name&&"/".concat(E.tag_discipline_name)),n.a.createElement("div",{className:be.a.formItem},E.items_by_item_type_and_tag_discipline.map(function(g){return n.a.createElement(N.a.Item,{label:n.a.createElement(D,{count:g.items_count,difficult:g.difficulty}),extra:n.a.createElement("span",{className:be.a.questionTip},"\u9898"),name:"count-".concat(y,"-").concat(E.sub_discipline_id,"-").concat(g.difficulty,"-").concat(E.tag_discipline_id),colon:!1,style:{width:"30%"},initialValue:0,key:"".concat(y,"-").concat(E.sub_discipline_id,"-").concat(g.difficulty)},n.a.createElement(se.a,{min:0,max:g.items_count,formatter:ce}))})))}))}}]),v}(n.a.Component),Se=Te,tt=[{item_type:"MULTIPLE",items_by_item_type:[{sub_discipline_id:12,sub_discipline_name:"Java\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:3}]}]},{item_type:"SINGLE",items_by_item_type:[{sub_discipline_id:12,sub_discipline_name:"Java\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:10}]}]},{item_type:"JUDGMENT",items_by_item_type:[{sub_discipline_id:12,sub_discipline_name:"Java\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:2}]}]},{item_type:"PROGRAM",items_by_item_type:[{sub_discipline_id:13,sub_discipline_name:"\u4FE1\u53F7\u4E0E\u7CFB\u7EDF",discipline_id:8,discipline_name:"\u7535\u5B50\u6280\u672F",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:1}]},{sub_discipline_id:12,sub_discipline_name:"Java\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:4}]},{sub_discipline_id:26,sub_discipline_name:"Python\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:1}]},{sub_discipline_id:23,sub_discipline_name:"Java\u7A0B\u5E8F\u8BBE\u8BA1",discipline_id:7,discipline_name:"\u7A0B\u5E8F\u8BBE\u8BA1\u8BED\u8A00",items_by_item_type_and_sub_discipline:[{difficulty:1,items_count:1}]}]}],we=function(R){Object(Q.a)(v,R);var x=Object(Y.a)(v);function v(d){var r;return Object(z.a)(this,v),r=x.call(this,d),r.state={},r}return Object($.a)(v,[{key:"render",value:function(){var r=this.props.form,b=this.props.optinalData;return n.a.createElement("div",null,b.map(function(f,s){return n.a.createElement("div",{key:f.item_type},n.a.createElement(Se,{form:r,data:f}),s===b.length-1?null:n.a.createElement(fe.a,null))}),n.a.createElement(ye,null))}}]),v}(n.a.Component),Ne=we,Me=function(x){var v=x.title,d=x.score,r=x.totalCount;return n.a.createElement("div",null,v,":",d&&d>0?n.a.createElement("span",{style:{marginLeft:4,color:"#999",fontSize:12}},"(\u5171 ",d," \u5206)"):null)},Ge=function(R){Object(Q.a)(v,R);var x=Object(Y.a)(v);function v(d){var r;return Object(z.a)(this,v),r=x.call(this,d),r.state={},r}return Object($.a)(v,[{key:"render",value:function(){if(!this.props.form)return"";var r=this.props.form,b=r.getFieldDecorator,f=r.getFieldsValue,s=Object.keys(Z),p=f(),y=0;return n.a.createElement("div",null,s.map(function(l){var D=Object.keys(p).filter(function(c){return c.includes("".concat(l,"-"))&&p[c]}),U=0,h=0;return D.map(function(c){return U+=p[c],h=U*p["score-".concat(l)],null}),y+=h,D.length>0?n.a.createElement(N.a.Item,{label:n.a.createElement(Me,{title:Z[l],score:h,totalCount:U}),name:"score-".concat(l),colon:!1,key:Z[l],rules:[{required:!0,message:"\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A"}]},n.a.createElement("div",null,n.a.createElement(se.a,{min:1,max:100,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u9898\u5206\u6570\u8BBE\u7F6E",style:{width:150}}),n.a.createElement("span",{style:{marginLeft:8}},"\u5206/\u9898"))):null}),y&&y>0?n.a.createElement("div",{style:{marginTop:16}},"\u5F53\u524D\u672C\u5377\u603B\u5206",n.a.createElement("span",{style:{color:"#1890FF"}}," ",y," "),"\u5206"):null)}}]),v}(n.a.Component),Be=Ge;function K(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */K=function(){return R};var R={},x=Object.prototype,v=x.hasOwnProperty,d=typeof Symbol=="function"?Symbol:{},r=d.iterator||"@@iterator",b=d.asyncIterator||"@@asyncIterator",f=d.toStringTag||"@@toStringTag";function s(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(a,i,o){return a[i]=o}}function p(t,e,a,i){var o=e&&e.prototype instanceof D?e:D,u=Object.create(o.prototype),L=new G(i||[]);return u._invoke=function(j,A,_){var P="suspendedStart";return function(T,te){if(P==="executing")throw new Error("Generator is already running");if(P==="completed"){if(T==="throw")throw te;return ee()}for(_.method=T,_.arg=te;;){var ne=_.delegate;if(ne){var X=V(ne,_);if(X){if(X===l)continue;return X}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(P==="suspendedStart")throw P="completed",_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);P="executing";var w=y(j,A,_);if(w.type==="normal"){if(P=_.done?"completed":"suspendedYield",w.arg===l)continue;return{value:w.arg,done:_.done}}w.type==="throw"&&(P="completed",_.method="throw",_.arg=w.arg)}}}(t,a,L),u}function y(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(i){return{type:"throw",arg:i}}}R.wrap=p;var l={};function D(){}function U(){}function h(){}var c={};s(c,r,function(){return this});var E=Object.getPrototypeOf,g=E&&E(E(B([])));g&&g!==x&&v.call(g,r)&&(c=g);var O=h.prototype=D.prototype=Object.create(c);function F(t){["next","throw","return"].forEach(function(e){s(t,e,function(a){return this._invoke(e,a)})})}function C(t,e){function a(o,u,L,j){var A=y(t[o],t,u);if(A.type!=="throw"){var _=A.arg,P=_.value;return P&&typeof P=="object"&&v.call(P,"__await")?e.resolve(P.__await).then(function(T){a("next",T,L,j)},function(T){a("throw",T,L,j)}):e.resolve(P).then(function(T){_.value=T,L(_)},function(T){return a("throw",T,L,j)})}j(A.arg)}var i;this._invoke=function(o,u){function L(){return new e(function(j,A){a(o,u,j,A)})}return i=i?i.then(L,L):L()}}function V(t,e){var a=t.iterator[e.method];if(a===void 0){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=void 0,V(t,e),e.method==="throw"))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=y(a,t.iterator,e.arg);if(i.type==="throw")return e.method="throw",e.arg=i.arg,e.delegate=null,l;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function q(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(q,this),this.reset(!0)}function B(t){if(t){var e=t[r];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var a=-1,i=function o(){for(;++a<t.length;)if(v.call(t,a))return o.value=t[a],o.done=!1,o;return o.value=void 0,o.done=!0,o};return i.next=i}}return{next:ee}}function ee(){return{value:void 0,done:!0}}return U.prototype=h,s(O,"constructor",h),s(h,"constructor",U),U.displayName=s(h,f,"GeneratorFunction"),R.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===U||(e.displayName||e.name)==="GeneratorFunction")},R.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,s(t,f,"GeneratorFunction")),t.prototype=Object.create(O),t},R.awrap=function(t){return{__await:t}},F(C.prototype),s(C.prototype,b,function(){return this}),R.AsyncIterator=C,R.async=function(t,e,a,i,o){o===void 0&&(o=Promise);var u=new C(p(t,e,a,i),o);return R.isGeneratorFunction(e)?u:u.next().then(function(L){return L.done?L.value:u.next()})},F(O),s(O,f,"Generator"),s(O,r,function(){return this}),s(O,"toString",function(){return"[object Generator]"}),R.keys=function(t){var e=[];for(var a in t)e.push(a);return e.reverse(),function i(){for(;e.length;){var o=e.pop();if(o in t)return i.value=o,i.done=!1,i}return i.done=!0,i}},R.values=B,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!e)for(var a in this)a.charAt(0)==="t"&&v.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function i(_,P){return L.type="throw",L.arg=e,a.next=_,P&&(a.method="next",a.arg=void 0),!!P}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],L=u.completion;if(u.tryLoc==="root")return i("end");if(u.tryLoc<=this.prev){var j=v.call(u,"catchLoc"),A=v.call(u,"finallyLoc");if(j&&A){if(this.prev<u.catchLoc)return i(u.catchLoc,!0);if(this.prev<u.finallyLoc)return i(u.finallyLoc)}else if(j){if(this.prev<u.catchLoc)return i(u.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return i(u.finallyLoc)}}}},abrupt:function(e,a){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&v.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var u=o;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=a&&a<=u.finallyLoc&&(u=null);var L=u?u.completion:{};return L.type=e,L.arg=a,u?(this.method="next",this.next=u.finallyLoc,l):this.complete(L)},complete:function(e,a){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&a&&(this.next=a),l},finish:function(e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),M(i),l}},catch:function(e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc===e){var o=i.completion;if(o.type==="throw"){var u=o.arg;M(i)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,i){return this.delegate={iterator:B(e),resultName:a,nextLoc:i},this.method==="next"&&(this.arg=void 0),l}},R}var Ie=me.a.Step,Z={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",PROGRAM:"\u7F16\u7A0B\u9898"},Le={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},ke=function(R){Object(Q.a)(v,R);var x=Object(Y.a)(v);function v(d){var r;return Object(z.a)(this,v),r=x.call(this,d),r.getPaperData=function(){var b=window.location.href.split("/").pop();r.setState({loading:!0}),Object(H.a)("/examination_banks/".concat(b,"/edit_random_exam.json")).then(function(f){if(r.setState({loading:!1}),f.status===200){var s=f.data,p=s.contents,y=s.examination_bank,l=s.score_settings,D=s.all_sub_disciplines,U={},h={};p.map(function(g){return U=Object(S.a)(Object(S.a)({},U),{},Object(_e.a)({},"count-".concat(g.item_type,"-").concat(g.sub_discipline_id,"-").concat(g.difficulty,"-").concat(g.tag_discipline_id),g.quanlity)),null}),l.map(function(g){return h=Object(S.a)(Object(S.a)({},h),{},Object(_e.a)({},"score-".concat(g.item_type),g.score)),null});var c=Object(S.a)(Object(S.a)({},y),{},{subDisciplines:D.map(function(g){return{id:g.sub_discipline_id,name:g.sub_discipline_name}}),group_ids:groups});r.state.form.setFieldsValue(c),r.setState({formValue:c}),r.setState({countData:U,scoreData:h});var E=y.source;r.getdisciplines(E)}else J.b.error("\u83B7\u53D6\u8BD5\u5377\u4FE1\u606F\u9519\u8BEF")})},r.getdisciplines=function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,f="/api/disciplines.json";Object(H.a)(f,{params:{source:"question",public:b}}).then(function(s){(s==null?void 0:s.disciplines)&&r.setState({disciplines:s.disciplines})}).catch(function(s){console.log(s)})},r.getQuestionNumbers=function(){var b;r.setState({loading:!0});var f=r.state.form.getFieldValue("subDisciplines").map(function(p){return p.id}),s=r.state.form.getFieldValue("source");Object(H.a)("/api/examination_intelligent_settings/optional_items.json",{method:"post",body:{tag_discipline_ids:f,group_ids:(b=r.state.form.getFieldValue("group_ids"))===null||b===void 0?void 0:b.map(function(p){return p.id}),source:s===1?0:2}}).then(function(p){r.setState({loading:!1}),p.contents&&(r.setState({optinalData:p.contents}),r.state.form.setFieldsValue(Object(S.a)({},r.state.countData)))})},r.next=Object(oe.a)(K().mark(function b(){var f,s,p,y,l,D,U,h,c;return K().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(f=r.state.current+1,console.log(r.form,r.refs.form.getFieldValue()),!(r.state.current===0)){g.next=9;break}return g.next=5,r.state.form.validateFields(["name","time","difficulty","source","subDisciplines"]);case 5:r.setState({current:f}),r.getQuestionNumbers(),g.next=10;break;case 9:r.state.current===1&&r.idEdit?(r.state.form.setFieldsValue(Object(S.a)({},r.state.scoreData)),r.setState({current:f})):r.state.current===1&&(s=0,p=r.state.form.getFieldsValue(),y=p.name,l=p.difficulty,D=p.time,U=p.source,h=p.subDisciplines,c=Object(pe.a)(p,["name","difficulty","time","source","subDisciplines"]),Object.keys(c).forEach(function(O){c[O]>0&&++s}),s===0?J.b.error("\u8BF7\u586B\u5199\u9898\u578B\u6570\u91CF"):r.setState({current:f}));case 10:case"end":return g.stop()}},b)})),r.prev=function(){var b=r.state.current-1;r.setState({current:b})},r.submit=Object(oe.a)(K().mark(function b(){var f,s,p,y,l,D,U,h,c,E,g;return K().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,r.state.form.validateFields();case 2:f=r.state.form.getFieldsValue(),console.log("data:===> ",f),s=f.exam_notes,p=f.group_ids,y=f.name,l=f.difficulty,D=f.time,U=f.source,h=Object(pe.a)(f,["exam_notes","group_ids","name","difficulty","time","source"]),console.log("others: ",h),c=[],E=[],Object.keys(h).map(function(C){if(C.includes("count")){var V=C.split("-")[1],q=C.split("-")[2],M=C.split("-")[3],G=C.split("-")[4];f[C]!==0&&E.push({item_type:V,difficulty:M,sub_discipline_id:q,items_count:f[C],tag_discipline_id:G})}else if(C.includes("score")){var B=C.split("-")[1];c.push({item_type:B,score:f[C]})}return null}),g={name:y,difficulty:l,time:D,source:U,score_settings:c,contents:E,exam_notes:s,group_ids:p==null?void 0:p.map(function(C){return C.id}),sub_discipline_id:0},r.idEdit?r.updatePaper(g):r.createPaper(g);case 11:case"end":return F.stop()}},b)})),r.createPaper=function(b){r.setState({loading:!0}),Object(H.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:Object(S.a)({},b)}).then(function(f){r.setState({loading:!1}),f.status===0&&(J.b.success("\u521B\u5EFA\u6210\u529F"),r.props.history.push("/paperlibrary"))})},r.updatePaper=function(b){r.setState({loading:!0});var f=window.location.href.split("/").pop();H.a.post("/examination_banks/".concat(f,"/update_random_exam.json"),{method:"post",body:Object(S.a)({},b)}).then(function(s){r.setState({loading:!1}),s.status===0&&(J.b.success("\u7F16\u8F91\u6210\u529F"),r.props.history.push("/paperlibrary"))})},r.confirm=function(b){window.confirm("\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931")&&(b?r.props.history.push(b):r.props.history.push("/paperlibrary"))},r.state={current:0,disciplines:[],loading:!1,optinalData:[],countData:{},scoreData:{},formValue:{}},r}return Object($.a)(v,[{key:"componentDidMount",value:function(){this.setState({form:this.refs.form}),window.location.href.includes("/randompaper/edit")?(this.getPaperData(),this.idEdit=!0):this.getdisciplines()}},{key:"componentWillMount",value:function(){window.addEventListener("beforeunload",this.beforeunload)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("beforeunload",this.beforeunload)}},{key:"beforeunload",value:function(r){var b="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(r||window.event).returnValue=b,b}},{key:"render",value:function(){var r=this,b=this.state,f=b.current,s=b.disciplines,p=n.a.createElement(I.a,{onClick:function(){r.confirm()},style:{marginRight:16}},"\u8FD4\u56DE"),y=n.a.createElement(I.a,{type:"primary",onClick:function(){return r.next()}},"\u4E0B\u4E00\u6B65"),l=n.a.createElement(I.a,{onClick:function(){return r.prev()},style:{marginRight:16}},"\u4E0A\u4E00\u6B65"),D=n.a.createElement(I.a,{onClick:function(){return r.submit()},type:"primary"},"\u5B8C\u6210\u7EC4\u5377"),U=[{title:"\u57FA\u672C\u4FE1\u606F",content:n.a.createElement(Fe,{formValue:this.state.formValue,disciplines:s,getdisciplines:this.getdisciplines,form:this.state.form})},{title:"\u9898\u578B\u6570\u91CF",content:n.a.createElement(Ne,{form:this.state.form,optinalData:this.state.optinalData})},{title:"\u8D4B\u5206\u8BBE\u7F6E",content:n.a.createElement(Be,{form:this.state.form})}];return n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},n.a.createElement(ie.a,{separator:">",style:{padding:"12px 0px"}},n.a.createElement(ie.a.Item,null,n.a.createElement(ve.Link,{to:"/paperlibrary",onClick:function(c){c.preventDefault(),r.confirm("/paperlibrary")}},"\u8BD5\u5377\u5E93")),n.a.createElement(ie.a.Item,null,"\u968F\u673A\u7EC4\u5377")),n.a.createElement(N.a,{from:this.state.form,onValuesChange:function(){return r.setState({formValue:Object(S.a)({},r.state.form.getFieldsValue())})},ref:"form",name:"basic",layout:"vertical"},n.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},n.a.createElement("span",{style:{fontSize:20,fontWeight:600}},"\u968F\u673A\u7EC4\u5377")),n.a.createElement(de.a,{style:{marginTop:12}},n.a.createElement("div",{style:{display:"flex",justifyContent:"center",padding:20}},n.a.createElement(me.a,{current:f,style:{width:780}},U.map(function(h){return n.a.createElement(Ie,{key:h.title,title:h.title})}))),n.a.createElement(fe.a,null),n.a.createElement(Re.a,{spinning:this.state.loading},U.map(function(h,c){return n.a.createElement("div",{style:{display:c===f?"block":"none"},key:c,className:"pl20 pr20"},h.content)}))),n.a.createElement("div",{style:{display:"flex",marginBottom:200,marginTop:12,justifyContent:"center"}},n.a.createElement("span",{style:{fontSize:20,fontWeight:600}}),n.a.createElement("span",null,f===0?p:l,f===U.length-1?D:y))))}}]),v}(n.a.Component),nt=W.default=ke}}]);