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
15 KiB
2 lines
15 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4711],{53128:function(z,I,u){u.d(I,{Z:function(){return H}});var c=u(59301),b=u(8591),D=u(98135),A={codeBox:"codeBox___WpkVl"},w=u(92310),v=u.n(w),P=Object.defineProperty,S=(C,e,t)=>e in C?P(C,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):C[e]=t,l=(C,e,t)=>S(C,typeof e!="symbol"?e+"":e,t),K=(C,e,t)=>new Promise((i,d)=>{var m=o=>{try{a(t.next(o))}catch(r){d(r)}},R=o=>{try{a(t.throw(o))}catch(r){d(r)}},a=o=>o.done?i(o.value):Promise.resolve(o.value).then(m,R);a((t=t.apply(C,e)).next())});class W extends c.Component{constructor(e){super(e),l(this,"canvas"),l(this,"randomNum",(t,i)=>Math.floor(Math.random()*(i-t)+t)),l(this,"drawPic",()=>{this.randomCode()}),l(this,"reloadPic",()=>{this.drawPic()}),l(this,"changeCode",t=>{console.log(t.target.value,222),this.setState({value:t.target.value,showError:!1})}),l(this,"onVerify",()=>{let t;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(t=!0,b.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(t=!0,b.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(t=!1),this.setState({showError:t}),t}),this.canvas=c.createRef(),this.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1}}componentDidMount(){this.drawPic()}randomColor(e,t){const i=this.randomNum(e,t),d=this.randomNum(e,t),m=this.randomNum(e,t);return`rgb(${i}, ${d}, ${m})`}drawText(e,t,i){e.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const d=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);e.font=d+"px SimHei";const m=10,R=(this.state.contentWidth-40)/(this.state.code.length-1);let a=m;i>0&&(a=m+i*R);let o=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);d>40&&(o=40);const r=this.randomNum(-10,10);e.translate(a,o),e.rotate(r*Math.PI/180),e.fillText(t,0,0),e.rotate(-r*Math.PI/180),e.translate(-a,-o)}drawLine(e){for(let t=0;t<1;t++)e.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),e.beginPath(),e.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.stroke()}drawDot(e){for(let t=0;t<100;t++)e.fillStyle=this.randomColor(0,255),e.beginPath(),e.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),e.fill()}randomCode(){let e="";const t="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let i=0;i<this.state.codeLength;i++){const d=Math.floor(Math.random()*57);e+=t[d]}this.setState({code:e},()=>{const d=this.canvas.current.getContext("2d");d.textBaseline="bottom",d.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),d.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let m=0;m<this.state.code.length;m++)this.drawText(d,this.state.code[m],m);this.drawLine(d),this.drawDot(d)})}render(){const{className:e,width:t=300}=this.props;return c.createElement("div",{className:v()(A.codeBox,e),style:{width:t}},c.createElement("aside",null,c.createElement(D.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),c.createElement("div",null,c.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),c.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const k=(C,e)=>{let t;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,e),React.createElement(W,{ref:i=>t=i})),onOk:()=>K(void 0,null,function*(){if(t.onVerify())return Promise.reject();C()})})};var H=W},59418:function(z,I,u){var c=u(59301),b=u(6848);const D=({value:A,visible:w=!0,children:v})=>{const P={\u672A\u53D1\u5E03:"\u4F5C\u4E1A\u5C1A\u672A\u53D1\u5E03",\u672A\u5F00\u59CB:"\u4F5C\u4E1A\u5DF2\u53D1\u5E03\uFF0C\u5C1A\u672A\u5230\u8FBE\u5F00\u59CB\u4F5C\u4E1A\u65F6\u95F4",\u63D0\u4EA4\u4E2D:"\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u6240\u6709\u8003\u751F\u53EF\u63D0\u4EA4\u4F5C\u4E1A",\u8865\u4EA4\u4E2D:"\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u6240\u6709\u5B66\u751F\u53EF\u8865\u4EA4\u4F5C\u4E1A",\u8FDB\u884C\u4E2D:"\u4F5C\u4E1A\u8FDB\u884C\u4E2D\uFF0C\u90E8\u5206\u73ED\u7EA7\u6B63\u5728\u4F5C\u4E1A\u63D0\u4EA4\u4E2D/\u8865\u4EA4\u4E2D",\u5DF2\u622A\u6B62:"\u5230\u8FBE\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\uFF0C\u4F5C\u4E1A\u5DF2\u7ED3\u675F",\u5DF2\u7ED3\u675F:"\u8BFE\u5802\u5DF2\u7ED3\u675F"};return c.createElement(c.Fragment,null,w?c.createElement(b.Z,{placement:"topLeft",title:P[A]},c.createElement("span",null,v)):v)};I.Z=D},72067:function(z,I,u){var c=u(59301),b=u(46651),D=u(78241),A=u(43418),w=u(8591),v=u(14491),P=u(98135),S=u(95237),l=u(43604),K=u(94001),W=u(84291),k=u(58250),H=u(90967),C=u(11466),e=u(32609),t=u(66750),i=u(58029),d=u(99232),m=u.n(d),R=u(89424),a=u(59301),o=Object.defineProperty,r=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,L=(n,h,F)=>h in n?o(n,h,{enumerable:!0,configurable:!0,writable:!0,value:F}):n[h]=F,Z=(n,h)=>{for(var F in h||(h={}))E.call(h,F)&&L(n,F,h[F]);if(r)for(var F of r(h))V.call(h,F)&&L(n,F,h[F]);return n},T=(n,h,F)=>new Promise((N,s)=>{var g=_=>{try{O(F.next(_))}catch(x){s(x)}},f=_=>{try{O(F.throw(_))}catch(x){s(x)}},O=_=>_.done?N(_.value):Promise.resolve(_.value).then(g,f);O((F=F.apply(n,h)).next())});const{Dragger:y}=b.default,B=({classroomList:n,dispatch:h,onOk:F})=>{const N=(0,k.useParams)(),[s]=D.default.useForm(),[g,f]=(0,c.useState)(),[O,_]=(0,c.useState)(!1),x={height:100,onRemove:()=>{f("")},accept:".xls,.xlsx",maxCount:1,multiple:!1,beforeUpload:p=>T(void 0,null,function*(){return f(p),!1})};return(0,c.useEffect)(()=>{s.setFieldsValue({publish_time:m()(m()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm")),end_time:m()(m()(new Date((0,R.qd)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))})},[n.actionTabs.key==="\u5BFC\u5165\u5916\u90E8\u6210\u7EE9"]),a.createElement(A.default,{centered:!0,title:"\u5BFC\u5165\u5916\u90E8\u6210\u7EE9",open:n.actionTabs.key==="\u5BFC\u5165\u5916\u90E8\u6210\u7EE9",okText:"\u786E\u5B9A",width:750,destroyOnClose:!0,cancelText:"\u53D6\u6D88",okButtonProps:{loading:O},onOk:()=>T(void 0,null,function*(){s.submit()}),onCancel:()=>{s.resetFields(),h({type:"classroomList/setActionTabs",payload:{}})}},a.createElement(D.default,{form:s,colon:!1,onFinish:p=>T(void 0,null,function*(){var U,j,$;if(!(g!=null&&g.size)){w.ZP.info("\u8BF7\u4E0A\u4F20\u6587\u4EF6");return}_(!0);let M=new FormData;M.append("name",p.name),M.append("type",n.actionTabs.type),M.append("category_id",(N==null?void 0:N.categoryId)||null),n.actionTabs.type==="exercise"?(M.append("time",p.time||""),M.append("total_score",p.total_score)):M.append("description",p.description||""),M.append("publish_time",m()(p.publish_time).format("YYYY-MM-DD HH:mm")),M.append("end_time",m()(p.end_time).format("YYYY-MM-DD HH:mm")),M.append("file",g);let Y=yield(0,t.ZP)(`/api/courses/${N.coursesId}/export_external_score_homework.json`,{method:"post",body:M},!0);_(!1),(Y==null?void 0:Y.status)===0&&(s.resetFields(),h({type:"classroomList/setActionTabs",payload:{}}),F(),((j=(U=Y==null?void 0:Y.data)==null?void 0:U.fail)==null?void 0:j.length)>0&&A.default.confirm({title:"\u5BFC\u5165\u5931\u8D25",closable:!0,icon:null,width:610,content:a.createElement(v.default,{pagination:!1,dataSource:($=Y==null?void 0:Y.data)==null?void 0:$.fail,scroll:{y:400},columns:[{title:"\u59D3\u540D",align:"left",dataIndex:"name"},{title:"\u5B66\u53F7/\u624B\u673A\u53F7/\u90AE\u7BB1",align:"left",dataIndex:"student_id"},{title:"\u5BFC\u5165\u5931\u8D25\u539F\u56E0",align:"left",dataIndex:"message"}]}),okText:"\u4E0B\u8F7D\u5BFC\u5165\u5931\u8D25\u6587\u4EF6",cancelText:"\u53D6\u6D88",onOk:()=>{(0,R.FH)("",C.Z.API_SERVER+`/api/courses/get_external_score_fail_data.xlsx?type=${n.actionTabs.type}`)}}))})},a.createElement(D.default.Item,{label:n.actionTabs.type!=="exercise"?"\u4F5C\u4E1A":"\u8BD5\u5377\u540D\u79F0",labelCol:{span:3},name:"name",rules:[{required:!0,message:`\u8BF7\u8F93\u5165${n.actionTabs.type!=="exercise"?"\u4F5C\u4E1A":"\u8BD5\u5377"}\u540D\u79F0`}]},a.createElement(P.default,{showCount:!0,placeholder:`\u8BF7\u8F93\u5165${n.actionTabs.type!=="exercise"?"\u4F5C\u4E1A":"\u8BD5\u5377"}\u540D\u79F0`,maxLength:60})),n.actionTabs.type!=="exercise"&&a.createElement(D.default.Item,{label:"\u4F5C\u4E1A\u63CF\u8FF0",labelCol:{span:3},name:"description"},a.createElement(H.Z,{watch:!0})),n.actionTabs.type==="exercise"&&a.createElement(S.Z,{style:{marginLeft:6}},a.createElement(l.Z,{span:12},a.createElement(D.default.Item,{label:"\u8BD5\u5377\u603B\u5206",name:"total_score",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u603B\u5206"},{pattern:/^(?:[1-9]\d*(?:\.\d+)?|0\.\d*[1-9]\d*)$/,message:"\u8BD5\u5377\u603B\u5206\u5FC5\u987B\u4E3A\u6B63\u6570"}]},a.createElement(P.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u603B\u5206",style:{width:256},addonAfter:"\u5206"}))),a.createElement(l.Z,{span:12},a.createElement(D.default.Item,{label:"\u7B54\u9898\u65F6\u957F",labelCol:{span:6},name:"time"},a.createElement(K.Z,{style:{width:"100%"},addonAfter:"\u5206\u949F",placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F"})))),a.createElement(S.Z,{style:{marginLeft:6,marginBottom:12}},a.createElement(l.Z,{span:12},a.createElement(D.default.Item,{label:"\u5F00\u59CB\u65F6\u95F4",name:"publish_time",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4"}]},a.createElement(W.default,{placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},style:{width:256},disabledDate:p=>(0,i.Q8)(p),disabledTime:p=>(0,i.d0)(p),allowClear:!1,format:"YYYY-MM-DD HH:mm"}))),a.createElement(l.Z,{span:12},a.createElement(D.default.Item,{label:"\u7ED3\u675F\u65F6\u95F4",labelCol:{span:6},name:"end_time",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"}]},a.createElement(W.default,{placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},style:{width:"100%"},disabledDate:p=>(0,i.Q8)(p,"",s.getFieldValue("publish_time")),disabledTime:p=>(0,i.d0)(p,s.getFieldValue("publish_time")),allowClear:!1,format:"YYYY-MM-DD HH:mm"})))),a.createElement(D.default.Item,{style:{marginBottom:0},label:a.createElement("div",null,a.createElement("span",{style:{color:"#ff4d4f",marginRight:5,fontFamily:"SimSun,sans-serif"}},"*"),a.createElement("span",null,"\u5BFC\u5165\u6587\u4EF6")),labelCol:{span:3},rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u540D\u79F0"}]},a.createElement("div",null,a.createElement("a",{download:"\u6A21\u7248.xlsx",className:e.Z.downloadbutton,href:C.Z.API_SERVER+`/api/courses/down_external_score_template.json?type=${n.actionTabs.type}`},"\u4E0B\u8F7D\u6A21\u7248\u8868\u683C"),a.createElement("span",{style:{marginLeft:10,color:"#999999"}},"\uFF08\u6839\u636E\u63D0\u793A\u4FE1\u606F\u5B8C\u5584\u8868\u683C\u5185\u5BB9\uFF09")),a.createElement(D.default.Item,{style:{marginBottom:0}},a.createElement(y,Z({},x),a.createElement("a",{className:e.Z.downloadbutton,style:{width:96}},"\u9009\u62E9\u6587\u4EF6"),a.createElement("br",null),a.createElement("span",{style:{color:"#999999"}},"\u4E0B\u8F7D\u6A21\u677F\u5E76\u5B8C\u5584\u4FE1\u606F\u540E\uFF0C\u53EF\u5C06\u6587\u4EF6\u62D6\u66F3\u81F3\u6B64\u5904\u4E0A\u4F20\u3002\u652F\u6301\u683C\u5F0F\uFF1A.xls\u3001.xlsx"))))))};I.Z=(0,k.connect)(({classroomList:n})=>({classroomList:n}))(B)},38302:function(z,I,u){u.d(I,{Z:function(){return a}});var c=u(59301),b=u(43418),D=u(56511),A=u(95237),w=u(6848),v={wrap:"wrap___KDoq2",tip:"tip___WEJuX",listWrap:"listWrap___IJDX4",li:"li___r5con",nameWrap:"nameWrap___PUyEz",name:"name___xuUMY",tag:"tag___l5CW2"},P=u(89831),S=u(58250),l=u(59301),K=Object.defineProperty,W=Object.defineProperties,k=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable,t=(o,r,E)=>r in o?K(o,r,{enumerable:!0,configurable:!0,writable:!0,value:E}):o[r]=E,i=(o,r)=>{for(var E in r||(r={}))C.call(r,E)&&t(o,E,r[E]);if(H)for(var E of H(r))e.call(r,E)&&t(o,E,r[E]);return o},d=(o,r)=>W(o,k(r)),m=(o,r,E)=>new Promise((V,L)=>{var Z=B=>{try{y(E.next(B))}catch(n){L(n)}},T=B=>{try{y(E.throw(B))}catch(n){L(n)}},y=B=>B.done?V(B.value):Promise.resolve(B.value).then(Z,T);y((E=E.apply(o,r)).next())}),a=({type:o=1,data:r,visible:E,callback:V,onCancel:L})=>{var Z,T;const[y,B]=(0,c.useState)([]),n=(0,S.useSelector)(s=>s.loading);(0,c.useEffect)(()=>{B(r)},[JSON.stringify(r)]);const h=(s,g)=>{const f=(_,x,p)=>{const U=Array.from(_),[j]=U.splice(x,1);return U.splice(p,0,j),U};if(!s.destination)return;const O=f(g,s.source.index,s.destination.index);B(O)},F=s=>{let g={};return o===1&&(g={\u672A\u53D1\u5E03:{background:"rgba(198,206,214,0.2)",color:"#C6CED6"},\u672A\u5F00\u59CB:{background:"rgba(22,93,255,0.2)",color:"#165DFF"},\u63D0\u4EA4\u4E2D:{background:"rgba(0,177,135,0.2)",color:"#00B187"},\u5DF2\u622A\u6B62:{background:"rgba(229,51,51,0.2)",color:"#E53333"}}[s]),o===2&&(g={\u672A\u53D1\u5E03:{background:"rgba(198,206,214,0.2)",color:"#C6CED6"},\u9884\u53D1\u5E03:{background:"rgba(22,93,255,0.2)",color:"#165DFF"},\u5DF2\u53D1\u5E03:{background:"rgba(0,177,135,0.2)",color:"#00B187"}}[s]),l.createElement("div",{className:v.tag,style:i({},g)},s)},N=()=>m(void 0,null,function*(){V(y.map(s=>s.task_id))});return l.createElement(b.default,{centered:!0,destroyOnClose:!0,open:E,onCancel:L,onOk:N,confirmLoading:(Z=n==null?void 0:n.effects)==null?void 0:Z["classroomList/updateTaskPosition"],okText:"\u4FDD\u5B58",title:"\u8C03\u6574\u6392\u5E8F",width:850},l.createElement("div",{className:v.wrap},l.createElement("div",{className:v.tip},l.createElement("i",{className:"iconfont icon-tishi9 font14 mr10"}),l.createElement("span",null,"\u63D0\u793A\uFF1A\u8BF7\u5728\u5217\u8868\u4E2D\u957F\u6309\u9F20\u6807\u5DE6\u952E\uFF0C\u8FDB\u884C\u62D6\u653E\u6392\u5E8F\u3002\u5B8C\u6210\u6392\u5E8F\u540E\u8BF7\u70B9\u51FB\u201C\u4FDD\u5B58\u201D")),l.createElement(D.Z,{loading:(T=n==null?void 0:n.effects)==null?void 0:T["classroomList/getAllTaskList"],active:!0,className:"mt20",paragraph:{rows:5}},l.createElement(P.Z5,{onDragEnd:s=>h(s,y)},l.createElement(P.bK,{droppableId:"droppable"},(s,g)=>l.createElement("div",d(i({ref:s.innerRef},s.droppableProps),{className:v.listWrap}),y.map((f,O)=>l.createElement(P._l,{key:f.task_id,draggableId:f.task_id.toString(),index:O},(_,x)=>l.createElement("div",d(i(i({ref:_.innerRef},_.draggableProps),_.dragHandleProps),{className:v.li}),l.createElement(A.Z,{align:"middle"},l.createElement("div",{className:v.nameWrap},l.createElement(w.Z,{title:f==null?void 0:f.task_name},l.createElement("div",{className:v.name},f==null?void 0:f.task_name))),F(f==null?void 0:f.status)),l.createElement(A.Z,{align:"middle",className:"font12 mt10"},l.createElement("span",{className:"mr30 c-grey-666"},"\u7BA1\u7406\u5458",l.createElement("span",{className:"ml5 c-black"},(f==null?void 0:f.user_name)||"--")))))),s.placeholder))))))}}}]);
|