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
58 KiB
2 lines
58 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2806],{42437:function(tt,be){be.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},42295:function(tt,be,o){o.d(be,{Z:function(){return _e}});var e=o(59301),b=o(98135),Se=o(12563),Pe=o(8591),ye={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},P=o(22415);const{TextArea:fe}=b.default;class ne extends e.Component{constructor(R){super(R),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:R,onAnswerChange:xe,addChildAnswer:ve,exerciseIsPublish:ue,answers:f,activeOptionErrorIndex:C,flex:k="0 0 1000px"}=this.props;console.log("----",f);let{inputVisible:L,EditInputIndex:ae}=this.state;return e.createElement("div",{className:ye.flex},e.createElement("div",{className:`${ye.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",R+1,"):"),e.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},f==null?void 0:f.map((O,le)=>e.createElement(e.Fragment,null,ae!==le?(O==null?void 0:O.length)>0?e.createElement(Se.default,{className:"edit-tag",key:O,closable:!0,onClose:V=>{V.preventDefault(),(f==null?void 0:f.length)===1&&le===0?this.props.deleteChildAnswermain(R,le):this.props.deleteChildAnswer(R,le)}},e.createElement("span",{onDoubleClick:V=>{this.setState({EditInputIndex:le}),V.preventDefault()}},O)):e.createElement(b.default,{defaultValue:O,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:V=>{if(V.target.value.replaceAll(" ","").length<=0){Pe.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}xe(R,le,V.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):e.createElement(b.default,{defaultValue:O,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:V=>{if(V.target.value.replaceAll(" ","").length<=0){Pe.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}xe(R,le,V.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!L&&e.createElement(Se.default,{className:"site-tag-plus",onClick:()=>{ve(R),this.setState({inputVisible:!0})}},e.createElement(P.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var _e=ne},4097:function(tt,be,o){o.d(be,{Z:function(){return ue}});var e=o(59301),b=o(90967),Se=Object.defineProperty,Pe=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,P=Object.getOwnPropertySymbols,fe=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,_e=(f,C,k)=>C in f?Se(f,C,{enumerable:!0,configurable:!0,writable:!0,value:k}):f[C]=k,ie=(f,C)=>{for(var k in C||(C={}))fe.call(C,k)&&_e(f,k,C[k]);if(P)for(var k of P(C))ne.call(C,k)&&_e(f,k,C[k]);return f},R=(f,C)=>Pe(f,ye(C)),xe=(f,C,k)=>_e(f,typeof C!="symbol"?C+"":C,k);const ve="\u2581";class ue extends e.Component{constructor(){super(...arguments),xe(this,"getChCountBeforeCursor",(C,k)=>{const L=k.line;let ae=0;for(let le=0;le<L;le++)ae+=C.getLine(le).split(ve).length-1;const O=C.getLine(L).substring(0,k.ch);return ae+=O.split(ve).length-1,ae}),xe(this,"onCMBeforeChange",(C,k)=>{const L=C.getRange(k.from,k.to);let ae=0;if(k.text.forEach(O=>{ae+=O.split(ve).length-1}),L&&L.indexOf(ve)!=-1){const O=L.split(ve).length-1,le=this.getChCountBeforeCursor(C,k.from);console.log(`\u5220\u9664${O}\u4E2A\uFF0C \u4E4B\u524D\u6709${le}\u4E2A\uFF0C\u65B0\u589E${ae}\u4E2A`),this.props.deleteEmptyDisabled?k.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(le,O,ae)}else if(ae){const O=this.getChCountBeforeCursor(C,k.from);console.log(`\u65B0\u589E${ae}\u4E2A\uFF0C\u4E4B\u524D\u6709${O}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(O,0,ae)}})}render(){return e.createElement(b.Z,R(ie({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},29380:function(tt,be,o){o.r(be),o.d(be,{default:function(){return yn}});var e=o(59301),b=o(58250),Se=o(20834),Pe=o(44e3),ye=o(78241),P=o(8591),fe=o(28103),ne=o(66104),_e=o(95237),ie=o(43604),R=o(43418),xe=o(99313),ve=o(98135),ue=o(3113),f=o(11260),C=o(49397),k=o(25519),L=o(6848),ae=o(24905),O=o(94001),le=o(8939),V=o(90967),we=o(47883),i={flex_box_center:"flex_box_center___p1qG1",flex_space_between:"flex_space_between___EHoRl",flex_box_vertical_center:"flex_box_vertical_center___c0u2d",flex_box_center_end:"flex_box_center_end___ueiDD",flex_box_column:"flex_box_column___tyRHS",wrap:"wrap___ce8sS",modal:"modal___yzD47",titleWrap:"titleWrap___OBPcs",required:"required___ncxFF",title:"title___cxIaz",colorGray:"colorGray___NXXsn",choiceWrap:"choiceWrap___AhJbr",answer:"answer____f42Z",activeAnswer:"activeAnswer___BqxNg",deleteIcon:"deleteIcon___iHXv4",addIcon:"addIcon___Kb1l4",editorWrap:"editorWrap___UmeId",htmlWrap:"htmlWrap____EtjV",radio:"radio___zqqhF",color333:"color333___PUxW5",color999:"color999___Uiwst",questionType:"questionType___GcJoU",questionChoices:"questionChoices___WgikS"},nt=Object.defineProperty,$e=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,at=(u,a,t)=>a in u?nt(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,Ke=(u,a)=>{for(var t in a||(a={}))ut.call(a,t)&&at(u,t,a[t]);if($e)for(var t of $e(a))Je.call(a,t)&&at(u,t,a[t]);return u},w=(u,a)=>{var t={};for(var l in u)ut.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&$e)for(var l of $e(u))a.indexOf(l)<0&&Je.call(u,l)&&(t[l]=u[l]);return t},x=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const d=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Q=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,onRef:s=()=>{},editData:n}=t,p=w(t,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[F,N]=(0,e.useState)([]),[se,W]=(0,e.useState)(),[B,$]=(0,e.useState)([]),[T,X]=(0,e.useState)(""),[z,J]=(0,e.useState)(5),[M,H]=(0,e.useState)(!1),K=(0,b.useParams)();(0,e.useEffect)(()=>{N(["","","",""])},[]),(0,e.useEffect)(()=>{if(!(n!=null&&n.question_choices)){H(!0);return}X(n==null?void 0:n.question_title),J(parseInt(n==null?void 0:n.question_score)),N(n==null?void 0:n.question_choices.map(r=>r.choice_text));const E=[];n==null||n.standard_answer.map((r,h)=>{E.push(r-1)}),$(E)},[n]),(0,e.useImperativeHandle)(a,()=>({onSave:j,isEdit:M}));const j=()=>x(void 0,null,function*(){if(!T)return P.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const E=F.findIndex(_=>!_);if(E>-1)return P.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${d[E]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!B.length)return P.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(B.length<1)return P.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const r=F.map((_,ge)=>({choice_text:_,is_answer:B.includes(ge)?ge+1:0}));let h;n.question_id?h=yield m({type:"exercise/editExerciseQuestion",payload:{id:n.question_id,question_title:T,question_type:1,question_score:"5.0",question_choices:r.map(_=>_.choice_text),standard_answers:r.filter(_=>_.is_answer).map(_=>_.is_answer)}}):h=yield m({type:"exercise/addExerciseQuestion",payload:{categoryId:K.categoryId,question_title:T,question_type:1,question_score:"5.0",question_choices:r.map(_=>_.choice_text),standard_answers:r.filter(_=>_.is_answer).map(_=>_.is_answer)}}),h.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),H(!1),m({type:"exercise/editExercise",payload:Ke({},K)}))}),g=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],A=E=>x(void 0,null,function*(){switch(E.id){case"del":let r;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return x(this,null,function*(){yield(0,le.Fl)({id:n.question_id}),m({type:"exercise/editExercise",payload:Ke({},K)})})}});break;case"up":case"down":yield m({type:"exercise/exeriseMoveUpDown",payload:{id:n.question_id,opr:E.id}}),m({type:"exercise/editExercise",payload:Ke({},K)});break;case"edit":H(!0);break}}),c=()=>{var E;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},n.key,"\u3001\u591A\u9009\u9898"),"\uFF08",n.question_score,"\u5206\uFF09"),!n.hideAction&&g.map(function(r,h){return r.id==="up"&&n.key===1||r.id==="down"&&n.key===n.len?null:e.createElement(L.Z,{key:h,placement:"bottom",title:r.name},e.createElement("span",{onClick:()=>A(r),className:r.icon}))})),e.createElement("div",{className:"mt5"},e.createElement(we.Z,{value:n.question_title})),e.createElement("div",{className:i.questionChoices},(E=n==null?void 0:n.question_choices)==null?void 0:E.map(function(r,h){return e.createElement(_e.Z,null,e.createElement(ie.Z,null,e.createElement(ae.default,{key:h,checked:n.standard_answer.includes(h+1),disabled:!0},d[h],".")),e.createElement(ie.Z,{flex:"1"},e.createElement("span",{className:"c-black font14"},e.createElement(we.Z,{value:r.choice_text}))))})))},de=()=>e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u9898\u5E72\uFF1A")),e.createElement(V.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:T,onChange:E=>X(E)}),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u7B54\u6848\u9009\u9879\uFF1A",e.createElement("span",{className:i.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),F.map((E,r)=>e.createElement("div",{className:i.choiceWrap,key:r},e.createElement(L.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},e.createElement("div",{className:`${i.answer} ${B.includes(r)?i.activeAnswer:""}`,onClick:()=>{B.includes(r)?$(B.filter(h=>h!==r)):$([...B,r])}},d[r])),e.createElement("div",{className:i.editorWrap},se===r?e.createElement(V.Z,{id:`single-question-option-${r}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:E,onChange:h=>{F[r]=h,N(F)}}):e.createElement("div",{className:i.htmlWrap,onClick:()=>W(r)},e.createElement(we.Z,{value:E}))),r>1&&e.createElement(L.Z,{title:"\u5220\u9664"},e.createElement("i",{className:`${i.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>N(F.filter((h,_)=>_!==r))})),r<7&&r===F.length-1&&e.createElement(L.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},e.createElement("i",{className:`${i.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>N([...F,""])})))),e.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),e.createElement("p",{className:""},"\u5206\u503C\uFF1A",e.createElement(O.Z,{value:z,max:1e4,min:-1,onChange:E=>{J(E)}})," \u5206"),e.createElement("aside",{className:"tr"},n.question_id&&e.createElement(ue.ZP,{type:"default",onClick:()=>H(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>j()},"\u4FDD\u5B58")));return e.createElement("section",{className:i.wrap},!M&&c(),M&&de())};var Ae=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(Q)),me=o(5112),Fe=Object.defineProperty,oe=Object.getOwnPropertySymbols,I=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,Ie=(u,a,t)=>a in u?Fe(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,ke=(u,a)=>{for(var t in a||(a={}))I.call(a,t)&&Ie(u,t,a[t]);if(oe)for(var t of oe(a))ce.call(a,t)&&Ie(u,t,a[t]);return u},Te=(u,a)=>{var t={};for(var l in u)I.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&oe)for(var l of oe(u))a.indexOf(l)<0&&ce.call(u,l)&&(t[l]=u[l]);return t},qe=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const je=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oe=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,onRef:s=()=>{},editData:n}=t,p=Te(t,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[F,N]=(0,e.useState)([]),[se,W]=(0,e.useState)(),[B,$]=(0,e.useState)([]),[T,X]=(0,e.useState)(""),[z,J]=(0,e.useState)(0),[M,H]=(0,e.useState)(!1),K=(0,b.useParams)();(0,e.useEffect)(()=>{N(["","","",""])},[]),(0,e.useEffect)(()=>{if(!(n!=null&&n.question_choices)){H(!0);return}X(n==null?void 0:n.question_title),J(parseInt(n==null?void 0:n.question_score)),N(n==null?void 0:n.question_choices.map(r=>r.choice_text));const E=[];n==null||n.standard_answer.map((r,h)=>{E.push(r-1)}),$(E)},[n]),(0,e.useImperativeHandle)(a,()=>({onSave:j,isEdit:M}));const j=()=>qe(void 0,null,function*(){if(!T)return P.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const E=F.findIndex(_=>!_);if(E>-1)return P.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${je[E]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!B.length)return P.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(B.length<1)return P.ZP.info("\u8BF7\u9009\u62E9\u7B54\u6848"),!1;const r=F.map((_,ge)=>({choice_text:_,is_answer:B.includes(ge)?ge+1:0}));let h;n.question_id?h=yield(0,f.Kc)({id:n.question_id,question_title:T,question_type:1,question_score:z,question_choices:r.map(_=>_.choice_text),standard_answers:r.filter(_=>_.is_answer).map(_=>_.is_answer)}):h=yield(0,f.iV)({exercise_bank_id:K.topicId,question_title:T,question_type:1,question_score:"5.0",question_choices:r.map(_=>_.choice_text),standard_answers:r.filter(_=>_.is_answer).map(_=>_.is_answer)}),h.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),H(!1)),yield m({type:"polls/getExerciseBanks",payload:ke({},K)})}),g=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],A=E=>qe(void 0,null,function*(){switch(E.id){case"del":let r;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return qe(this,null,function*(){yield(0,f.x$)({pollsId:n.question_id}),m({type:"polls/getExerciseBanks",payload:ke({},K)})})}});break;case"up":case"down":yield(0,f.W)({exerciseId:n==null?void 0:n.question_id,opr:E.id}),m({type:"polls/getExerciseBanks",payload:ke({},K)});break;case"edit":H(!0);break}}),c=()=>{var E;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},n.key,"\u3001\u5355\u9009\u9898"),"\uFF08",n.question_score,"\u5206\uFF09"),!n.hideAction&&g.map(function(r,h){return r.id==="up"&&n.key===1||r.id==="down"&&n.key===n.len?null:e.createElement(L.Z,{key:h,placement:"bottom",title:r.name},e.createElement("span",{onClick:()=>A(r),className:r.icon}))})),e.createElement("div",{className:"mt5"},e.createElement(we.Z,{value:n.question_title})),e.createElement("div",{className:i.questionChoices},(E=n==null?void 0:n.question_choices)==null?void 0:E.map(function(r,h){return e.createElement(_e.Z,null,e.createElement(ie.Z,null,e.createElement(me.ZP,{key:h,checked:n.standard_answer.includes(h+1),disabled:!0},je[h],".")),e.createElement(ie.Z,{flex:"1"},e.createElement("span",{className:"c-black font14"},e.createElement(we.Z,{value:r.choice_text}))))})))},de=()=>e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u9898\u5E72\uFF1A")),e.createElement(V.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:T,onChange:E=>X(E)}),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u7B54\u6848\u9009\u9879\uFF1A",e.createElement("span",{className:i.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),F.map((E,r)=>e.createElement("div",{className:i.choiceWrap,key:r},e.createElement(L.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},e.createElement("div",{className:`${i.answer} ${B.includes(r)?i.activeAnswer:""}`,onClick:()=>{B.includes(r)?$(B.filter(h=>h!==r)):$([...B,r])}},je[r])),e.createElement("div",{className:i.editorWrap},se===r?e.createElement(V.Z,{id:`single-question-option-${r}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:E,onChange:h=>{F[r]=h,N(F)}}):e.createElement("div",{className:i.htmlWrap,onClick:()=>W(r)},e.createElement(we.Z,{value:E}))),r>1&&e.createElement(L.Z,{title:"\u5220\u9664"},e.createElement("i",{className:`${i.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>N(F.filter((h,_)=>_!==r))})),r<7&&r===F.length-1&&e.createElement(L.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},e.createElement("i",{className:`${i.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>N([...F,""])})))),e.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),e.createElement("p",{className:""},"\u5206\u503C\uFF1A",e.createElement(O.Z,{value:z,max:1e4,min:-1,onChange:E=>{J(E)}})," \u5206"),e.createElement("aside",{className:"tr"},n.question_id&&e.createElement(ue.ZP,{type:"default",onClick:()=>H(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>j()},"\u4FDD\u5B58")));return e.createElement("section",{className:i.wrap},!M&&c(),M&&de())};var Le=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(Oe)),ee=Object.defineProperty,Ee=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,lt=(u,a,t)=>a in u?ee(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,Me=(u,a)=>{for(var t in a||(a={}))G.call(a,t)&<(u,t,a[t]);if(Ee)for(var t of Ee(a))Ze.call(a,t)&<(u,t,a[t]);return u},st=(u,a)=>{var t={};for(var l in u)G.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&Ee)for(var l of Ee(u))a.indexOf(l)<0&&Ze.call(u,l)&&(t[l]=u[l]);return t},De=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const rt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ve=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,onRef:s=()=>{},editData:n}=t,p=st(t,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[F,N]=(0,e.useState)(),[se,W]=(0,e.useState)(""),[B,$]=(0,e.useState)(!1),[T,X]=(0,e.useState)(5),z=(0,b.useParams)();(0,e.useEffect)(()=>{if(!(n!=null&&n.question_choices)){$(!0);return}W(n==null?void 0:n.question_title),X(n==null?void 0:n.question_score),N(n.standard_answer[0]+"")},[n]),(0,e.useImperativeHandle)(a,()=>({onSave:J,isEdit:B}));const J=()=>De(void 0,null,function*(){if(!se)return P.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!F)return P.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;const g=[{choice_text:"\u6B63\u786E",is_answer:F==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:F==="2"?2:0}];let A;return n.question_id?A=yield(0,f.Kc)({id:n.question_id,question_title:se,question_type:2,question_score:T,question_choices:g.map(c=>c.choice_text),standard_answers:g.filter(c=>c.is_answer).map(c=>c.is_answer)}):A=yield(0,f.iV)({exercise_bank_id:z.topicId,question_title:se,question_type:2,question_score:T,question_choices:g.map(c=>c.choice_text),standard_answers:g.filter(c=>c.is_answer).map(c=>c.is_answer)}),A.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),$(!1)),m({type:"polls/getExerciseBanks",payload:Me({},z)}),{name:se,choices:g}}),M=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],H=g=>De(void 0,null,function*(){switch(g.id){case"del":let A;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return De(this,null,function*(){yield(0,f.x$)({pollsId:n.question_id}),m({type:"polls/getExerciseBanks",payload:Me({},z)})})}});break;case"up":case"down":yield(0,f.W)({exerciseId:n==null?void 0:n.question_id,opr:g.id}),m({type:"polls/getExerciseBanks",payload:Me({},z)});break;case"edit":$(!0);break}}),K=()=>{var g;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},n.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",n.question_score,"\u5206\uFF09"),!n.hideAction&&M.map(function(A,c){return A.id==="up"&&n.key===1||A.id==="down"&&n.key===n.len?null:e.createElement(L.Z,{key:c,placement:"bottom",title:A.name},e.createElement("span",{onClick:()=>H(A),className:A.icon}))})),e.createElement("div",{className:"mt5"},n.question_title),e.createElement("div",{className:i.questionChoices},(g=n==null?void 0:n.question_choices)==null?void 0:g.map(function(A,c){return e.createElement(me.ZP,{key:c,checked:n.standard_answer.includes(c+1),disabled:!0},rt[c],". ",e.createElement("span",{className:"c-black font14"},A.choice_text))})))},j=()=>e.createElement("aside",null,e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u9898\u5E72\uFF1A")),e.createElement(V.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:se,onChange:g=>W(g)}),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.required},"*"),e.createElement("span",{className:i.title},"\u7B54\u6848\u9009\u9879\uFF1A",e.createElement("span",{className:i.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),e.createElement(me.ZP.Group,{buttonStyle:"solid",value:F,onChange:g=>N(g.target.value)},e.createElement(me.ZP.Button,{value:"1",className:`${i.radio} mr40`},"\u6B63\u786E"),e.createElement(me.ZP.Button,{value:"2",className:i.radio},"\u9519\u8BEF")),e.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),e.createElement("p",{className:""},"\u5206\u503C\uFF1A",e.createElement(O.Z,{value:T,max:1e4,min:-1,onChange:g=>{X(g)}})," \u5206"),e.createElement("aside",{className:"tr"},n.question_id&&e.createElement(ue.ZP,{type:"default",onClick:()=>$(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>J()},"\u4FDD\u5B58")));return e.createElement("section",{className:i.wrap},!B&&K(),B&&j())};var it=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(Ve)),ft=o(4097),te=o(42295),Ne=o(89424),ot=Object.defineProperty,Re=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,He=(u,a,t)=>a in u?ot(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,ze=(u,a)=>{for(var t in a||(a={}))Qe.call(a,t)&&He(u,t,a[t]);if(Re)for(var t of Re(a))Xe.call(a,t)&&He(u,t,a[t]);return u},ln=(u,a)=>{var t={};for(var l in u)Qe.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&Re)for(var l of Re(u))a.indexOf(l)<0&&Xe.call(u,l)&&(t[l]=u[l]);return t},_t=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const wn=null,sn=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,editData:s}=t,n=ln(t,["problemset","globalSetting","loading","dispatch","editData"]);const[p,F]=(0,e.useState)(""),[N,se]=(0,e.useState)(""),[W,B]=(0,e.useState)([]),[$,T]=(0,e.useState)(""),[X,z]=(0,e.useState)(),[J,M]=(0,e.useState)(!1),[H,K]=(0,e.useState)(5),[j,g]=(0,e.useState)(!1),A=(0,b.useParams)();(0,e.useEffect)(()=>{if(!(s!=null&&s.question_title)){g(!0);return}F(s==null?void 0:s.question_title),z(s==null?void 0:s.is_ordered),K(s==null?void 0:s.question_score);const v=s==null?void 0:s.standard_answer.map(y=>y.answer_text);B(v)},[l.editData]),(0,e.useEffect)(()=>{M(!1)},[j]),(0,e.useImperativeHandle)(a,()=>({onSave:c,isEdit:j}));const c=()=>_t(void 0,null,function*(){let v=[],y=!1;if(W.forEach((pe,he)=>{v.push({choice_id:he+1,answer_text:[]}),pe.forEach((We,Et)=>{v[he].answer_text.push(We),(!We||!(0,Ne.eR)(We,1e4))&&(T(`${he}-${Et}`),P.ZP.info(We?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),y=!0)})}),y)return!1;let Z;return s.question_id?Z=yield(0,f.Kc)({id:s.question_id,question_title:p,question_type:3,question_score:H,is_ordered:X,standard_answers:v}):Z=yield(0,f.iV)({exercise_bank_id:A.topicId,question_title:p,question_type:3,question_score:H,is_ordered:X,standard_answers:v}),Z.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),g(!1)),m({type:"polls/getExerciseBanks",payload:ze({},A)}),{name:p,analysis:N,standard_answers:v,is_ordered:X}}),de=(v,y,Z)=>{const pe=W.slice();if(y&&pe.splice(v,y),Z&&J)for(let he=0;he<Z;he++)pe.splice(v+he,0,[""]);M(!0),B(pe)},E=(v,y,Z)=>{T("");let pe=W.slice();pe[v][y]=Z,B(pe)},r=v=>{let y=W.slice();y[v]=[...y[v],""],B(y)},h=(v,y)=>{let Z=W.slice();if(!Z[v][y]){Z[v]=Z[v].filter((pe,he)=>he!==y),B(Z);return}R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:i.modal,onOk:()=>{Z[v]=Z[v].filter((pe,he)=>he!==y),B(Z)}})},_=v=>{R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:i.modal,onOk:()=>{let y=W.slice();y=W.filter((Z,pe)=>v!==pe),B(y)}})},ge=()=>e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),e.createElement("div",null,e.createElement(ft.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:p,onChange:v=>F(v),showNullButton:!0,onPlaceholderChange:de})),e.createElement("div",{className:"mt20"},W.map((v,y)=>e.createElement(te.Z,{key:y,answers:v,index:y,is_md:!0,activeOptionErrorIndex:$,onAnswerChange:E,addChildAnswer:r,deleteChildAnswer:h,deleteChildAnswermain:_}))),e.createElement("div",{className:"mt20"},W.length>1&&e.createElement("span",null,e.createElement(ae.default,{checked:X,onChange:v=>z(v.target.checked),className:`${i.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),e.createElement("span",{className:`${i.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),e.createElement("p",{className:""},"\u5206\u503C\uFF1A",e.createElement(O.Z,{value:H,max:1e4,min:-1,onChange:v=>{K(v)}})," \u5206"),e.createElement("aside",{className:"tr"},s.question_id&&e.createElement(ue.ZP,{type:"default",onClick:()=>g(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>c()},"\u4FDD\u5B58"))),re=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],q=v=>_t(void 0,null,function*(){switch(v.id){case"del":let y;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return _t(this,null,function*(){yield(0,f.x$)({pollsId:s.question_id}),m({type:"polls/getExerciseBanks",payload:ze({},A)})})}});break;case"up":case"down":yield(0,f.W)({exerciseId:s==null?void 0:s.question_id,opr:v.id}),m({type:"polls/getExerciseBanks",payload:ze({},A)});break;case"edit":g(!0);break}}),Y=()=>{var v;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},s.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",s.question_score,"\u5206\uFF09"),!s.hideAction&&re.map(function(y,Z){return y.id==="up"&&s.key===1||y.id==="down"&&s.key===s.len?null:e.createElement(L.Z,{key:Z,placement:"bottom",title:y.name},e.createElement("span",{onClick:()=>q(y),className:y.icon}))})),e.createElement("div",{className:"mt5"},s.question_title),e.createElement("div",{className:i.questionChoices},(v=s==null?void 0:s.standard_answer)==null?void 0:v.map(function(y,Z){return e.createElement(_e.Z,null,e.createElement(ie.Z,null,"\u7B54\u6848\uFF08\u586B\u7A7A",y.choice_id,"\uFF09\uFF1A"),e.createElement(ie.Z,{flex:"1"},e.createElement(ve.default,{key:Z,checked:s.standard_answer.includes(Z),disabled:!0,value:y.answer_text})))})))};return e.createElement("section",{className:i.wrap},!j&&Y(),j&&ge())};var rn=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(sn)),on=Object.defineProperty,ct=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,bt=(u,a,t)=>a in u?on(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,vt=(u,a)=>{for(var t in a||(a={}))At.call(a,t)&&bt(u,t,a[t]);if(ct)for(var t of ct(a))Ct.call(a,t)&&bt(u,t,a[t]);return u},cn=(u,a)=>{var t={};for(var l in u)At.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&ct)for(var l of ct(u))a.indexOf(l)<0&&Ct.call(u,l)&&(t[l]=u[l]);return t},ht=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const Dn=null,dn=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,onRef:s=()=>{},editData:n}=t,p=cn(t,["problemset","globalSetting","loading","dispatch","onRef","editData"]);const[F,N]=(0,e.useState)(""),[se,W]=(0,e.useState)(""),[B,$]=(0,e.useState)(""),[T,X]=(0,e.useState)(5),[z,J]=(0,e.useState)(!1),M=(0,b.useParams)();(0,e.useEffect)(()=>{var c;if(!(n!=null&&n.question_title)){J(!0);return}N(n==null?void 0:n.question_title),$((c=n==null?void 0:n.standard_answer)==null?void 0:c[0]),X(n==null?void 0:n.question_score)},[l.editData]),(0,e.useImperativeHandle)(a,()=>({onSave:H,isEdit:z}));const H=()=>ht(void 0,null,function*(){if(!F)return P.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;let c;return n.question_id?c=yield(0,f.Kc)({id:n.question_id,question_title:F,question_type:4,question_score:T,standard_answers:[B]}):c=yield(0,f.iV)({exercise_bank_id:M.topicId,question_title:F,question_type:4,question_score:T,standard_answers:[B]}),c.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),J(!1),m({type:"polls/getExerciseBanks",payload:vt({},M)})),{name:F,answer_texts:[B],analysis:se}}),K=()=>e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u7B80\u7B54\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),e.createElement(V.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:F,onChange:c=>N(c)}),e.createElement("p",{className:i.titleWrap},e.createElement("span",{className:i.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),e.createElement(V.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:B,onChange:c=>$(c)}),e.createElement("p",{className:""},"\u5206\u503C\uFF1A",e.createElement(O.Z,{value:T,max:1e4,min:-1,onChange:c=>{X(c)}})," \u5206"),e.createElement("aside",{className:"tr"},n.question_id&&e.createElement(ue.ZP,{type:"default",onClick:()=>J(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>H()},"\u4FDD\u5B58"))),j=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],g=c=>ht(void 0,null,function*(){switch(c.id){case"del":let de;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return ht(this,null,function*(){yield(0,f.x$)({pollsId:n.question_id}),m({type:"polls/getExerciseBanks",payload:vt({},M)})})}});break;case"up":case"down":yield(0,f.W)({exerciseId:n==null?void 0:n.question_id,opr:c.id}),m({type:"polls/getExerciseBanks",payload:vt({},M)});break;case"edit":J(!0);break}}),A=()=>e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},n.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",n.question_score,"\u5206\uFF09"),!n.hideAction&&j.map(function(c,de){return c.id==="up"&&n.key===1||c.id==="down"&&n.key===n.len?null:e.createElement(L.Z,{key:de,placement:"bottom",title:c.name},e.createElement("span",{onClick:()=>g(c),className:c.icon}))})),e.createElement("div",{className:"mt5"},n.question_title),e.createElement("div",{className:i.questionChoices},e.createElement("p",null,e.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),e.createElement(we.Z,{value:B})));return e.createElement("section",{className:i.wrap},!z&&A(),z&&K())};var mn=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(dn)),En=Object.defineProperty,dt=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Nt=(u,a,t)=>a in u?En(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,Ft=(u,a)=>{for(var t in a||(a={}))wt.call(a,t)&&Nt(u,t,a[t]);if(dt)for(var t of dt(a))Dt.call(a,t)&&Nt(u,t,a[t]);return u},pn=(u,a)=>{var t={};for(var l in u)wt.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&dt)for(var l of dt(u))a.indexOf(l)<0&&Dt.call(u,l)&&(t[l]=u[l]);return t},Bt=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const Nn=null,fn=(u,a)=>{var t=u,{problemset:l,globalSetting:D,loading:U,dispatch:m,editData:s}=t,n=pn(t,["problemset","globalSetting","loading","dispatch","editData"]);const[p,F]=(0,e.useState)(""),[N,se]=(0,e.useState)(""),[W,B]=(0,e.useState)(""),[$,T]=(0,e.useState)([]),[X,z]=(0,e.useState)(""),[J,M]=(0,e.useState)(),[H,K]=(0,e.useState)(!1),[j,g]=(0,e.useState)([]),[A,c]=(0,e.useState)(!1),de=(0,b.useParams)();(0,e.useEffect)(()=>{var re;s.edit&&c(!0),F(s.shixun_name),se(s.question_title);const q=[];(re=s.shixun)==null||re.map(Y=>{q.push(Y.challenge_score)}),g(q)},[s]),(0,e.useEffect)(()=>{K(!1)},[A]),(0,e.useImperativeHandle)(a,()=>({onSave:E,isEdit:A}));const E=()=>Bt(void 0,null,function*(){let re=[];if(!1)return!1;let Y;return s.question_id?Y=yield(0,f.Kc)({id:s.question_id,question_title:N,shixun_name:p,shixun_id:s.shixun_id,question_type:5,question_scores:j}):Y=yield(0,f.iV)({exercise_bank_id:de.topicId,question_title:N,shixun_name:p,shixun_id:s.shixun_id,question_type:5,question_scores:j}),Y.status===0&&(P.ZP.success("\u4FDD\u5B58\u6210\u529F"),c(!1)),yield m({type:"polls/getExerciseBanks",payload:Ft({},de)}),{name:N,analysis:W,standard_answers:re,is_ordered:J}}),r=()=>{var re;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),e.createElement("div",{className:"mt10"},e.createElement(ve.default,{defaultValue:p,onChange:q=>{F(q.target.value)}})),e.createElement("div",{className:"mt10"},e.createElement(V.Z,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:N,onChange:q=>{se(q)}})),e.createElement("div",{className:"mt20"},(re=s.shixun)==null?void 0:re.map((q,Y)=>e.createElement(_e.Z,{gutter:[20,20]},e.createElement(ie.Z,{flex:"1"},Y+1,".",q.challenge_name),e.createElement(ie.Z,null,e.createElement(O.Z,{defaultValue:j[Y],onChange:v=>{j[Y]=v,g(j),console.log("srore:L",j[Y])}}))))),e.createElement("div",{className:"mt20"},$.length>1&&e.createElement("span",null,e.createElement(ae.default,{checked:J,onChange:q=>M(q.target.checked),className:`${i.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),e.createElement("span",{className:`${i.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),e.createElement("aside",{className:"tr"},!(s!=null&&s.edit)&&e.createElement(ue.ZP,{type:"default",onClick:()=>c(!1)},"\u53D6\u6D88"),e.createElement(ue.ZP,{className:"ml20",type:"primary",onClick:()=>E()},"\u4FDD\u5B58")))},h=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],_=re=>Bt(void 0,null,function*(){switch(re.id){case"del":let q;R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Bt(this,null,function*(){yield(0,f.x$)({pollsId:s.question_id}),m({type:"polls/getExerciseBanks",payload:Ft({},de)})})}});break;case"up":case"down":yield(0,f.W)({exerciseId:s==null?void 0:s.question_id,opr:re.id}),m({type:"polls/getExerciseBanks",payload:Ft({},de)});break;case"edit":c(!0);break}}),ge=()=>{var re;return e.createElement("aside",null,e.createElement("div",{className:i.questionType},e.createElement("div",null,e.createElement("span",{className:"font16 c-blue"},s.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",s.question_score,"\u5206\uFF09"),e.createElement("div",{className:"tr"},e.createElement(b.Link,{target:"_blank",to:`/shixuns/${s.shixun_identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),!s.hideAction&&h.map(function(q,Y){return q.id==="up"&&s.key===1||q.id==="down"&&s.key===s.len?null:e.createElement(L.Z,{key:Y,placement:"bottom",title:q.name},e.createElement("span",{onClick:()=>_(q),className:q.icon}))}))),e.createElement("div",{className:"font16"},s.shixun_name),e.createElement("div",{className:"mt30"}),(re=s.shixun)==null?void 0:re.map(function(q,Y){return e.createElement("div",{key:Y},"\u7B2C",Y+1,"\u5173 ",e.createElement("span",{className:"ml10"},q.challenge_name)," ",e.createElement("span",{className:"ml10"},q.challenge_score))}))};return e.createElement("section",{className:i.wrap},!A&&ge(),A&&r())};var _n=(0,b.connect)(({problemset:u,loading:a,globalSetting:t})=>({problemset:u,globalSetting:t,loading:a.effects}),null,null,{forwardRef:!0})((0,e.forwardRef)(fn)),Ye={flex_box_center:"flex_box_center___eWsYC",flex_space_between:"flex_space_between___RALuo",flex_box_vertical_center:"flex_box_vertical_center___f7uVp",flex_box_center_end:"flex_box_center_end___UxPR3",flex_box_column:"flex_box_column___YUFuv",bg:"bg___zWTsF",containerTitle:"containerTitle___DzTZh",containerDesc:"containerDesc___a3TiA",listItem:"listItem____nHKG",info:"info___LWlgA",title:"title___gtaI4",titleLeft:"titleLeft___Ce3h9",titleRight:"titleRight___gARIc",acitons:"acitons___MrR2u",export:"export___u_8cL"},vn=o(68975),hn=Object.defineProperty,mt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,kt=(u,a,t)=>a in u?hn(u,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[a]=t,yt=(u,a)=>{for(var t in a||(a={}))St.call(a,t)&&kt(u,t,a[t]);if(mt)for(var t of mt(a))Pt.call(a,t)&&kt(u,t,a[t]);return u},Fn=(u,a)=>{var t={};for(var l in u)St.call(u,l)&&a.indexOf(l)<0&&(t[l]=u[l]);if(u!=null&&mt)for(var l of mt(u))a.indexOf(l)<0&&Pt.call(u,l)&&(t[l]=u[l]);return t},gt=(u,a,t)=>new Promise((l,D)=>{var U=n=>{try{s(t.next(n))}catch(p){D(p)}},m=n=>{try{s(t.throw(n))}catch(p){D(p)}},s=n=>n.done?l(n.value):Promise.resolve(n.value).then(U,m);s((t=t.apply(u,a)).next())});const{SubMenu:Sn}=Se.default,{Content:Pn,Sider:kn}=Pe.default,Bn=u=>{var a=u,{polls:t,globalSetting:l,loading:D,user:U,dispatch:m}=a,s=Fn(a,["polls","globalSetting","loading","user","dispatch"]),n,p,F,N,se,W,B,$,T,X,z,J,M,H,K,j,g,A,c,de,E,r,h,_,ge,re,q,Y,v,y,Z,pe,he,We,Et,qt,Ot,Zt,It,Tt,jt,Lt,Vt,Rt,Wt,$t,Mt,Ht,Gt,Ut,Jt,Kt,Qt,Xt,zt,Yt,en;const Be=(0,b.useParams)(),qn=(0,b.useLocation)(),{userInfo:xt}=U,[pt]=ye.default.useForm(),[Ge,tn]=(0,e.useState)([]),[gn,xn]=(0,e.useState)(!1),On=[{name:"\u9009\u62E9\u9898",id:0},{name:"\u5224\u65AD\u9898",id:2},{name:"\u586B\u7A7A\u9898",id:3},{name:"\u7B80\u7B54\u9898",id:4},{name:"\u5B9E\u8BAD\u9898",id:5}],et=(0,e.useRef)();(0,e.useEffect)(()=>{var S,Ce,Ue,nn,un,an;(S=t.exerciseBanks)!=null&&S.exercise_questions&&(tn([...(Ce=t.exerciseBanks)==null?void 0:Ce.exercise_questions]),pt.setFieldsValue({exercise_name:(nn=(Ue=t.exerciseBanks)==null?void 0:Ue.exercise)==null?void 0:nn.exercise_name,exercise_description:(an=(un=t.exerciseBanks)==null?void 0:un.exercise)==null?void 0:an.exercise_description}))},[t.exerciseBanks]),(0,e.useEffect)(()=>{m({type:"polls/getExerciseBanks",payload:yt({},Be)})},[Be.categoryId]);const An=()=>gt(void 0,null,function*(){var S,Ce;yield pt.validateFields();const Ue=pt.getFieldValue();Ue.is_md=!0,Ue.topicId=(Ce=(S=t.exerciseBanks)==null?void 0:S.exercise)==null?void 0:Ce.id,xn(!1),yield(0,f.hO)(yt({},Ue)),m({type:"polls/getExerciseBanks",payload:yt({},Be)})}),Zn=S=>gt(void 0,null,function*(){const Ce=yield et==null?void 0:et.current;if(Ce!=null&&Ce.isEdit){P.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}S===5?m({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}):tn([...Ge,{question_type:S}])}),Cn=()=>{m({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[Be.topicId],object_type:"exercise"}}})},bn=function(){return Ge==null?void 0:Ge.map(function(S,Ce){if(S.key=Ce+1,S.len=Ge.length,S.question_type===0)return e.createElement("aside",null,e.createElement(Le,{ref:et,editData:S}),e.createElement(fe.Z,null));if(S.question_type===1)return e.createElement("aside",null,e.createElement(Ae,{ref:et,editData:S}),e.createElement(fe.Z,null));if(S.question_type===2)return e.createElement("aside",null,e.createElement(it,{ref:et,editData:S}),e.createElement(fe.Z,null));if(S.question_type===3)return e.createElement("aside",null,e.createElement(rn,{editData:S}),e.createElement(fe.Z,null));if(S.question_type===4)return e.createElement("aside",null,e.createElement(mn,{editData:S}),e.createElement(fe.Z,null));if(S.question_type===5)return e.createElement("aside",null,e.createElement(_n,{editData:S}),e.createElement(fe.Z,null))})};return e.createElement("section",{className:"edu-container"},e.createElement("section",{className:"animated fadeIn"},e.createElement("aside",{className:"mt10"},xt&&e.createElement(ne.Z,{separator:">"},e.createElement(ne.Z.Item,null,e.createElement(b.Link,{to:`/users/${Be.username}/${Be.topictype==="personal"?"topics":"topicbank"}/${Be.topictype}`},Be.topictype==="personal"?"\u6211\u7684\u9898\u5E93":"\u516C\u5171\u9898\u5E93")),e.createElement(ne.Z.Item,null,"\u8BE6\u60C5"))),e.createElement("aside",{className:[Ye.title,"mt20"].join(" ")},e.createElement(_e.Z,{style:{width:"100%"},align:"middle"},e.createElement(ie.Z,{flex:"1"},e.createElement("strong",{className:"font20 ml5"},(p=(n=t.exerciseBanks)==null?void 0:n.exercise)==null?void 0:p.exercise_name),e.createElement(Ne.VV,{status:[(N=(F=t.exerciseBanks)==null?void 0:F.exercise)!=null&&N.is_public?"\u516C\u5F00":"\u79C1\u6709"]})),e.createElement(ie.Z,null,e.createElement(b.Link,{className:"font16 c-light-black",to:`/users/${xt.login}/topics/${Be.topictype}`},"\u8FD4\u56DE"))))),e.createElement("section",{className:[Ye.bg,"pl30","pr30","pb30","mt20 relative"].join(" ")},e.createElement("div",{className:Ye.export},((se=t.exerciseBanks)==null?void 0:se.authorize)&&e.createElement(e.Fragment,null,e.createElement("a",{onClick:S=>{S.preventDefault(),R.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:()=>gt(void 0,null,function*(){(yield(0,C.Tv)({object_type:"normal",object_id:[Be.topicId]})).status===0&&b.history.push(`/users/${Be.username}/topics/personal`)})})}},"\u5220\u9664"),e.createElement(b.Link,{to:`/users/${xt.login}/topics/${Be.topicId}/${Be.topictype}/exercise/edit`},"\u7F16\u8F91")),e.createElement("a",{onClick:S=>{S.preventDefault(),Cn()}},"\u53D1\u9001")),e.createElement(xe.default,{className:Ye.tabs},e.createElement(xe.default.TabPane,{tab:e.createElement("span",{className:"font16 pt10 pb12"},"\u5185\u5BB9\u8BE6\u60C5"),key:"1"},e.createElement("div",{className:"c-light-black"},(B=(W=t.exerciseBanks)==null?void 0:W.exercise)==null?void 0:B.exercise_description))),gn&&e.createElement(ye.default,{layout:"vertical",form:pt},e.createElement(ye.default.Item,{name:"exercise_name",label:"\u8BD5\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},e.createElement(ve.default,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),e.createElement(ye.default.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},e.createElement(ve.default.TextArea,{rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),e.createElement(ye.default.Item,{className:"tr"},e.createElement(ue.ZP,{type:"primary",onClick:()=>{An()}},"\u4FDD\u5B58")))),e.createElement("p",{className:"mt10",style:{display:"flex"}},e.createElement("span",{className:"fl",style:{flex:"1"}},!!((T=($=t.exerciseBanks)==null?void 0:$.exercise_types)!=null&&T.q_singles)&&e.createElement("span",{className:"ml20"},"\u5355\u9009\u9898",(z=(X=t.exerciseBanks)==null?void 0:X.exercise_types)==null?void 0:z.q_singles,"\u9898\uFF0C\u5171",(M=(J=t.exerciseBanks)==null?void 0:J.exercise_types)==null?void 0:M.q_singles_scores,"\u5206"),!!((K=(H=t.exerciseBanks)==null?void 0:H.exercise_types)!=null&&K.q_doubles)&&e.createElement("span",{className:"ml20"},"\u591A\u9009\u9898",(g=(j=t.exerciseBanks)==null?void 0:j.exercise_types)==null?void 0:g.q_doubles,"\u9898\uFF0C\u5171",(c=(A=t.exerciseBanks)==null?void 0:A.exercise_types)==null?void 0:c.q_doubles_scores,"\u5206"),!!((E=(de=t.exerciseBanks)==null?void 0:de.exercise_types)!=null&&E.q_judges)&&e.createElement("span",{className:"ml20"},"\u5224\u65AD\u9898",(h=(r=t.exerciseBanks)==null?void 0:r.exercise_types)==null?void 0:h.q_judges,"\u9898\uFF0C\u5171",(ge=(_=t.exerciseBanks)==null?void 0:_.exercise_types)==null?void 0:ge.q_judges_scores,"\u5206"),!!((q=(re=t.exerciseBanks)==null?void 0:re.exercise_types)!=null&&q.q_nulls)&&e.createElement("span",{className:"ml20"},"\u586B\u7A7A\u9898",(v=(Y=t.exerciseBanks)==null?void 0:Y.exercise_types)==null?void 0:v.q_nulls,"\u9898\uFF0C\u5171",(Z=(y=t.exerciseBanks)==null?void 0:y.exercise_types)==null?void 0:Z.q_nulls_scores,"\u5206"),!!((he=(pe=t.exerciseBanks)==null?void 0:pe.exercise_types)!=null&&he.q_mains)&&e.createElement("span",{className:"ml20"},"\u7B80\u7B54\u9898",(Et=(We=t.exerciseBanks)==null?void 0:We.exercise_types)==null?void 0:Et.q_mains,"\u9898\uFF0C\u5171",(Ot=(qt=t.exerciseBanks)==null?void 0:qt.exercise_types)==null?void 0:Ot.q_mains_scores,"\u5206"),!!((It=(Zt=t.exerciseBanks)==null?void 0:Zt.exercise_types)!=null&&It.q_shixuns)&&e.createElement("span",{className:"ml20"},"\u5B9E\u8BAD\u9898",(jt=(Tt=t.exerciseBanks)==null?void 0:Tt.exercise_types)==null?void 0:jt.q_shixuns,"\u9898\uFF0C\u5171",(Vt=(Lt=t.exerciseBanks)==null?void 0:Lt.exercise_types)==null?void 0:Vt.q_shixuns_scores,"\u5206"),!!((Wt=(Rt=t.exerciseBanks)==null?void 0:Rt.exercise_types)!=null&&Wt.q_pros)&&e.createElement("span",{className:"ml20"},"\u7F16\u7A0B\u9898",(Mt=($t=t.exerciseBanks)==null?void 0:$t.exercise_types)==null?void 0:Mt.q_pros,"\u9898\uFF0C\u5171",(Gt=(Ht=t.exerciseBanks)==null?void 0:Ht.exercise_types)==null?void 0:Gt.q_pros_scores,"\u5206")),e.createElement("span",{className:"fr"},!!((Jt=(Ut=t.exerciseBanks)==null?void 0:Ut.exercise_types)!=null&&Jt.q_counts)&&e.createElement("span",null,"\u5408\u8BA1 ",e.createElement("span",{className:"color-blue"},(Qt=(Kt=t.exerciseBanks)==null?void 0:Kt.exercise_types)==null?void 0:Qt.q_counts)," \u9898\uFF0C \u5171 ",e.createElement("span",{className:`${((zt=(Xt=t.exerciseBanks)==null?void 0:Xt.exercise_types)==null?void 0:zt.q_scores)>100?"color-red font-bd":"color-orange"}`},(en=(Yt=t.exerciseBanks)==null?void 0:Yt.exercise_types)==null?void 0:en.q_scores)," \u5206"))),e.createElement("section",{className:[Ye.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},Ge!=""&&bn(),Ge==""&&e.createElement(k.Z,null)),e.createElement(vn.Z,null))};var yn=(0,b.connect)(({polls:u,loading:a,user:t,globalSetting:l})=>({polls:u,globalSetting:l,user:t,loading:a.effects}))(Bn)},68975:function(tt,be,o){o.d(be,{Z:function(){return Ke}});var e=o(59301),b=o(58250),Se=o(8591),Pe=o(43418),ye=o(99313),P=o(56511),fe=o(5112),ne={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},_e=o(89424),ie=o(40071),R=o(71418),xe=o(24905),ve=o(49397),ue=o(26724),f=o.n(ue),C=(w,x,d)=>new Promise((Q,Ae)=>{var me=I=>{try{oe(d.next(I))}catch(ce){Ae(ce)}},Fe=I=>{try{oe(d.throw(I))}catch(ce){Ae(ce)}},oe=I=>I.done?Q(I.value):Promise.resolve(I.value).then(me,Fe);oe((d=d.apply(w,x)).next())}),L=({username:w,setStages:x,stages:d,hasError:Q,setHasError:Ae})=>{const[me,Fe]=(0,e.useState)(""),[oe,I]=(0,e.useState)(1),[ce,Ie]=(0,e.useState)([]),[ke,Te]=(0,e.useState)(!1),[qe,je]=(0,e.useState)(0);(0,e.useEffect)(()=>{Oe({page:1,search:""},!0)},[]);const Oe=(ee,Ee)=>C(void 0,null,function*(){Te(!0);const G=yield(0,ve.w3)({username:w,category:"manage",page:ee.page,search:ee.search});Te(!1),Ie(Ze=>Ee?G==null?void 0:G.subjects:[...Ze,...G==null?void 0:G.subjects]),je(G==null?void 0:G.count)}),Le=(0,e.useRef)();return e.createElement("div",{className:ne.wrap},e.createElement("div",{className:"mb10"},e.createElement(ie.t7,{placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8DF5\u8BFE\u7A0B\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:me,style:{width:500},onChange:ee=>{Fe(ee),I(1),Le.current.scrollTo({behavior:"smooth",top:0}),Oe({page:1,search:ee},!0)}})),e.createElement(R.Z,{spinning:ke},e.createElement("div",{className:ne.radioWrap,ref:Le},e.createElement(f(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:()=>{I(oe+1),Oe({page:oe+1,search:me},!1)},hasMore:ce.length<qe,useWindow:!1},e.createElement(fe.ZP.Group,{value:d.subjectId,onChange:ee=>{x({subjectId:ee.target.value,stage_ids:[]}),Ae(!1)}},ce.map(ee=>{const Ee=ee.stages.map(G=>({label:G.name,value:G.id}));return e.createElement("div",{key:ee.id},e.createElement(fe.ZP,{className:ne.radio,value:ee.id},ee.name),ee.id===d.subjectId&&e.createElement("div",{className:ne.checkboxWrapper},Ee.length>0&&e.createElement(xe.default,{indeterminate:d.stage_ids.length>0&&d.stage_ids.length<Ee.length,onChange:G=>{x({subjectId:ee.id,stage_ids:G.target.checked?Ee.map(Ze=>Ze.value):[]})},checked:d.stage_ids.length===Ee.length},"\u5168\u9009"),e.createElement(xe.default.Group,{options:Ee,value:d.stage_ids,onChange:G=>x({subjectId:ee.id,stage_ids:G})})))}))))),Q&&e.createElement("div",{className:ne.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u5B9E\u8DF5\u8BFE\u7A0B\u53CA\u7AE0\u8282"))},ae=o(42437),O=o(40855),le=Object.defineProperty,V=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,nt=(w,x,d)=>x in w?le(w,x,{enumerable:!0,configurable:!0,writable:!0,value:d}):w[x]=d,$e=(w,x)=>{for(var d in x||(x={}))we.call(x,d)&&nt(w,d,x[d]);if(V)for(var d of V(x))i.call(x,d)&&nt(w,d,x[d]);return w},ut=(w,x)=>{var d={};for(var Q in w)we.call(w,Q)&&x.indexOf(Q)<0&&(d[Q]=w[Q]);if(w!=null&&V)for(var Q of V(w))x.indexOf(Q)<0&&i.call(w,Q)&&(d[Q]=w[Q]);return d},Je=(w,x,d)=>new Promise((Q,Ae)=>{var me=I=>{try{oe(d.next(I))}catch(ce){Ae(ce)}},Fe=I=>{try{oe(d.throw(I))}catch(ce){Ae(ce)}},oe=I=>I.done?Q(I.value):Promise.resolve(I.value).then(me,Fe);oe((d=d.apply(w,x)).next())});const at=w=>{var x=w,{userDetail:d,globalSetting:Q,loading:Ae,user:me,dispatch:Fe}=x,oe=ut(x,["userDetail","globalSetting","loading","user","dispatch"]),I,ce,Ie,ke,Te;const[qe,je]=(0,e.useState)("course"),[Oe,Le]=(0,e.useState)(""),[ee,Ee]=(0,e.useState)([]),[G,Ze]=(0,e.useState)(),[lt,Me]=(0,e.useState)(!1),[st,De]=(0,e.useState)(!1);(0,e.useEffect)(()=>{d.actionTabs.key==="UserDetail-SendToClass"&&rt(Oe)},[d.actionTabs.key]);const rt=te=>Je(void 0,null,function*(){Me(!0);const Ne=yield Fe({type:"userDetail/topicGetCourseList",payload:{search:te}});Ne&&Ee((Ne==null?void 0:Ne.courses)||[]),Me(!1)}),[Ve,it]=(0,e.useState)({subjectId:"",stage_ids:[]}),ft=()=>Je(void 0,null,function*(){var te,Ne,ot,Re,Qe,Xe;if(qe==="course"){if(!G){De(!0);return}const He=yield Fe({type:"userDetail/topicSendToClass",payload:$e({course_id:G},(te=d.actionTabs)==null?void 0:te.params)});if(Fe({type:"userDetail/setActionTabs",payload:{}}),He&&He.status===0){const ze={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"};(0,_e.xg)(`/classrooms/${G}/${ze[(ot=(Ne=d.actionTabs)==null?void 0:Ne.params)==null?void 0:ot.object_type]}`)}}else{if(!Ve.subjectId||!Ve.stage_ids.length){De(!0);return}(yield(0,O.nI)({id:(Qe=(Re=d.actionTabs)==null?void 0:Re.params)==null?void 0:Qe.object_id,login:(Xe=me.userInfo)==null?void 0:Xe.login},{stage_ids:Ve.stage_ids})).status===0&&(Se.ZP.success("\u53D1\u9001\u6210\u529F"),Fe({type:"userDetail/setActionTabs",payload:{}}),(0,_e.xg)(`/paths/${Ve.subjectId}`))}});return e.createElement(Pe.default,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:d.actionTabs.key==="UserDetail-SendToClass",title:"\u53D1\u9001",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Ae["userDetail/sendToClass"],width:600,afterClose:()=>{De(!1),Ee([]),it({subjectId:"",stage_ids:[]}),Le("")},onOk:ft,wrapClassName:ae.Z.CustomCss,onCancel:()=>{Fe({type:"userDetail/setActionTabs",payload:{}})}},e.createElement(ye.default,{activeKey:qe,onChange:te=>{De(!1),je(te)},items:[{label:"\u8BFE\u5802",key:"course",children:e.createElement("div",{className:ne.wrap},e.createElement("div",{className:"mb10"},e.createElement(ie.t7,{placeholder:"\u8BF7\u8F93\u5165\u8BFE\u5802\u540D\u79F0\u7684\u5173\u952E\u5B57\u8FDB\u884C\u641C\u7D22",value:Oe,style:{width:500},onChange:te=>{Le(te),rt(te)}})),e.createElement(P.Z,{active:!0,loading:lt},e.createElement("div",{className:ne.radioWrap},e.createElement(fe.ZP.Group,{value:G,onChange:te=>{Ze(te.target.value),De(!1)}},ee.map((te,Ne)=>e.createElement(fe.ZP,{className:ne.radio,value:te.course_id,key:te.course_id},te.course_name))))),((ce=(I=d.actionTabs)==null?void 0:I.params)==null?void 0:ce.object_type)!=="videos"&&e.createElement("div",{className:ne.title},"\u6E29\u99A8\u63D0\u793A\uFF1A\u9009\u62E9\u7684\u9898\u5C06\u4F1A\u53D1\u9001\u5230\u6307\u5B9A\u8BFE\u5802"),st&&e.createElement("div",{className:ne.colorFF0000},"\u8BF7\u5148\u9009\u62E9\u8BFE\u5802")),show:!0},{label:"\u5B9E\u8DF5\u8BFE\u7A0B",key:"subject",children:e.createElement(L,{username:(Ie=me.userInfo)==null?void 0:Ie.login,stages:Ve,setStages:it,hasError:st,setHasError:De}),show:((Te=(ke=d.actionTabs)==null?void 0:ke.params)==null?void 0:Te.object_type)==="videos"}].filter(te=>te.show)}))};var Ke=(0,b.connect)(({userDetail:w,loading:x,globalSetting:d,user:Q})=>({userDetail:w,globalSetting:d,loading:x.effects,user:Q}))(at)}}]);
|