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