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__Ed...

2 lines
30 KiB

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