You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/36524.async.js

1 line
25 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[36524],{17771:function(e,n,l){l.d(n,{Q:function(){return o}});var t=l(79800),i=l.n(t),a=l(59301),s=l(57809),r=l(26415),u=l(37712),o=function(e){return e[e.Number=1]="Number",e[e.Percent=2]="Percent",e}({});n.Z=function(e){var n=e.value,l=e.onChange,t=e.disabled,c=e.hidePercentOption,d=void 0!==c&&c,m=(0,a.useMemo)((function(){return d?o.Number:o.Percent}),[d]),_=(0,a.useState)(m),p=i()(_,2),f=p[0],g=p[1];console.log(f);var h=(0,a.useCallback)((function(e){if(f===o.Number){var n=e.replace("分","");return isNaN(parseInt(n,10))?0:n}return e.replace("%","")}),[f]);return(0,a.useEffect)((function(){g(n.type)}),[n]),(0,u.jsxs)("div",{style:{display:"inline-block"},children:[(0,u.jsx)(s.default,{onChange:function(e){g(e),l({type:e,inputValue:e===o.Number?5:20})},value:f||m,style:{width:100},options:d?[{label:"分值",value:o.Number}]:[{label:"百分比",value:o.Percent},{label:"分值",value:o.Number}],disabled:t}),(0,u.jsx)(r.Z,{disabled:t,value:n.inputValue,formatter:function(e){return n.type===o.Number?"".concat(e,"分"):"".concat(e,"%")},parser:h,max:f===o.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(e){l({type:f,inputValue:e})}})]})}},36524:function(e,n,l){l.d(n,{Q8:function(){return Q},d0:function(){return E},w6:function(){return L}});var t=l(7557),i=l.n(t),a=l(41498),s=l.n(a),r=l(37205),u=l.n(r),o=l(82242),c=l.n(o),d=l(79800),m=l.n(d),_=l(59301),p=l(84291),f=l(57809),g=l(8591),h=l(43418),v=l(95237),x=l(43604),j=l(3113),y=l(5112),b=l(28103),Z=l(24905),w=l(6848),P=l(78673),N=l(20360),H=l(57703),k=l(85699),S=l(99232),O=l.n(S),C=l(33287),D=l(27786),Y=l(89392),A=l(26795),M=l(22030),R=l(65233),T=l(17771),I=l(66822),V=l(37712);function L(e,n){for(var l=[],t=e;t<n;t++)l.push(t);return l}var Q=function(e,n,l){var t=e<O()().startOf("day"),i=e>O()(n).endOf("day"),a=e<O()(l).startOf("day");return n?l?O()()<=O()(l)?a||i:t||i:e&&t||i:l&&O()()<=O()(l)?a:t},E=function(e,n){var l=parseInt(O()(e).format("HH")),t=parseInt(O()().format("HH")),i=parseInt(O()().format("mm"));if(!e)return{disabledHours:function(){return L(0,t)},disabledMinutes:function(){return L(0,i)}};if(n){var a=parseInt(O()(n).format("HH")),s=parseInt(O()(n).format("mm"));return O()(e).isSame(O()(n),"day")?{disabledHours:function(){return L(0,a)},disabledMinutes:function(){return l<=a?L(0,s):[]}}:void 0}return O()(e).isSame(O()(),"day")?{disabledHours:function(){return L(0,t)},disabledMinutes:function(){return O()(e).isSame(O()(),"hour")&&l<=t?L(0,i):[]}}:void 0},F=p.default.RangePicker,J=f.default.Option;n.ZP=(0,R.connect)((function(e){var n=e.shixunHomeworks,l=e.classroomList,t=e.loading,i=e.user;return{shixunHomeworks:n,classroomList:l,loading:t.effects,user:i}}))((function(e){var n,l,t,a,r,o,d,S,L,G,U=e.shixunHomeworks,W=(e.loading,e.dispatch),q=e.classroomList,z=e.user,B=(0,R.useParams)(),X=U.workSetting,K=(U.workList,U.shixunWorkList,U.headerInfo),$=U.changeData,ee=(0,_.useState)(!0),ne=m()(ee,2),le=ne[0],te=ne[1],ie=(0,_.useState)(!1),ae=m()(ie,2),se=ae[0],re=ae[1],ue=(0,_.useState)([]),oe=m()(ue,2),ce=oe[0],de=oe[1],me=(0,_.useState)([]),_e=m()(me,2),pe=_e[0],fe=_e[1],ge=(0,_.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:T.Q.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,action_analysis:!1}),he=m()(ge,2),ve=he[0],xe=he[1];(0,_.useEffect)((function(){return je(),function(){de([].concat())}}),[]);var je=function(){W({type:"shixunHomeworks/getWorkSetting",payload:c()({},B)})};(0,_.useEffect)((function(){var e;null!=X&&X.course_id&&(Object.keys(ve).map((function(e){ve[e]=X[e]})),ve.allow_late&&ve.unified_late||(ve.late_penalty=20,ve.penalty_type=T.Q.Percent),ve.unified_setting||(ve.unified_late=!1,ve.unified_anonymous_comment=!1,ve.unified_anonymous_appeal=!1),ce=JSON.parse(JSON.stringify(X.group_settings.map((function(e){return c()(c()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.publish_time})))),pe=JSON.parse(JSON.stringify(X.allow_late_settings.map((function(e){return c()(c()({},e),{},{group_name:[e.group_name]})})).filter((function(e){return null!==e.late_time})))),xe(c()({},ve)),de(ce.length?u()(ce):[{}]),(null===(e=pe)||void 0===e?void 0:e.length)<=0?fe([{penalty_type:T.Q.Percent,late_penalty:20}]):fe(u()(pe)))}),[X]);var ye=function(e){var n,l;if(null!==e.total_score)if(null!=e&&e.work_efficiency&&null===e.eff_score)g.ZP.warning("效率分不能为空");else{var t=e.challenge_settings.reduce((function(e,n){return e+Number(n.challenge_score)}),0);if((null==t?void 0:t.toFixed(10))===(null===(n=e.total_score-e.eff_score)||void 0===n?void 0:n.toFixed(10))){var a={shixun_evaluation:e.shixun_evaluation,challenge_settings:e.challenge_settings},r=function(){var n=s()(i()().mark((function n(){return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return re(!0),n.next=3,(0,D.ZP)("/api/homework_commons/".concat(B.categoryId,"/publish_setting.json"),{method:"post",body:c()({},e)});case 3:0===n.sent.status&&(g.ZP.success("更新成功"),te(!0),je(),W({type:"shixunHomeworks/getShixunWorkHeadInfo",payload:c()({},B)})),re(!1);case 6:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();(0,Y.isEqual)($,a)||null!=K&&null!==(l=K.homework_status)&&void 0!==l&&l.includes("未发布")?r():h.Z.confirm({title:"更新成绩",content:"您改动了本次作业的关卡得分设置,这可能导致已完成作业的学生的成绩产生错误。点击“确定”按钮将保存最新设置并按最新设置更新全班成绩。",okText:"确认",cancelText:"取消",onOk:r})}else g.ZP.warning("效率分加关卡任务总分必须等于总分值:".concat(e.total_score,"分"))}else g.ZP.warning("总分值不能为空")},be=function(e,n){var l,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"group_id";return n?n.find((function(n){return n[t]===e})):null==X||null===(l=X.group_settings)||void 0===l?void 0:l.find((function(n){return n.group_id[0]===e}))},Ze=((null==X?void 0:X.allow_late)||(null==X||X.anonymous_comment),(0,_.useMemo)((function(){return(null==X?void 0:X.allow_late)||(null==X?void 0:X.all_group_late)}),[X,K])),we=null==X?void 0:X.anonymous_comment,Pe=function(e){if(!e)return!1;var n=be(e,null==X?void 0:X.anonymous_comment_settings);return(null==X?void 0:X.anonymous_comment)&&n&&null!==(null==n?void 0:n.evaluation_start)};return(0,V.jsxs)("section",{className:[M.Z.form," bg-white pl30 pr30 pt10 pb20"].join(" "),children:[(0,V.jsxs)(v.Z,{children:[(0,V.jsx)(x.Z,{span:24,children:(0,V.jsxs)(v.Z,{align:"middle",children:[(0,V.jsx)(x.Z,{flex:"1"}),(0,V.jsxs)(x.Z,{children:[(0,C.GJ)()&&le&&(0,V.jsx)(j.ZP,{type:"primary",size:"middle",ghost:!0,onClick:function(){var e,n;!(0,C.Rm)()||null!==(e=q.AssistantObject.practice)&&void 0!==e&&e.can_late||null!==(n=q.AssistantObject.practice)&&void 0!==n&&n.can_publish?te(!1):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"编辑设置"}),!le&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j.ZP,{type:"primary",size:"middle",loading:se,onClick:function(){return function(){var e,n,l;if(2!==(null==z||null===(e=z.userInfo)||void 0===e?void 0:e.user_status)){var t=JSON.parse(JSON.stringify(ve));if(t.challenge_settings.filter((function(e){return!e.hide})),t.categoryId=B.categoryId,null!==(n=t.challenge_settings)&&void 0!==n&&n.every((function(e){return!e.checked})))g.ZP.warning("关卡不能全部设置为可不做");else{if(ve.unified_setting||(ce=null===(l=ce)||void 0===l?void 0:l.map((function(e){var n;if(!e.publish_time||!e.end_time)throw g.ZP.error("请把发布时间填写完整"),new String("请把发布时间填写完整");if(!e.group_name)throw g.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null===(n=X.group_settings)||void 0===n?void 0:n.filter((function(n){var l;return null==e||null===(l=e.group_name)||void 0===l?void 0:l.includes(n.group_name)})).map((function(e){return e.group_id||e.id})).toString().split(","),e}))),t.group_settings=ce,ve.allow_late)if(ve.unified_late){if(null===ve.late_penalty||void 0===ve.late_penalty||ve.late_penalty<0||ve.late_penalty>100)throw g.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!ve.late_time)throw g.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整")}else{var i;pe=null===(i=pe)||void 0===i?void 0:i.map((function(e){var n;if(null===e.late_penalty||void 0===e.late_penalty||e.late_penalty<0||e.late_penalty>100)throw g.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!e.late_time)throw g.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整");if(!e.group_name)throw g.ZP.error("请选择分班名称"),new String("请选择分班名称");return e.group_name="string"==typeof(null==e?void 0:e.group_name)?[null==e?void 0:e.group_name]:null==e?void 0:e.group_name,e.group_id=null==e||null===(n=e.group_name)||void 0===n||null===(n=n.map((function(e){var n,l=null===(n=X.group_settings)||void 0===n||null===(n=n.filter((function(n){return(null==n?void 0:n.group_name)===e})))||void 0===n?void 0:n[0];return null==l?void 0:l.group_id})))||void 0===n?void 0:n.toString().split(","),e})),t.allow_late_settings=pe}ye(t)}}else(0,I.Rd)()}()},children:"提交"}),(0,V.jsx)(j.ZP,{type:"primary",size:"middle",ghost:!0,className:"ml20",onClick:function(){te(!0),je()},children:"取消"})]})]})]})}),(0,V.jsxs)("div",{children:[(0,V.jsx)("label",{children:"发布方式:"})," ",(0,V.jsxs)(y.ZP.Group,{disabled:le||!(null!=K&&null!==(n=K.homework_status)&&void 0!==n&&n.includes("未发布"))||(0,C.Rm)()&&!(null!==(l=q.AssistantObject.practice)&&void 0!==l&&l.can_publish),value:ve.unified_setting,onChange:function(e){var n;null!=K&&null!==(n=K.homework_status)&&void 0!==n&&n.includes("未发布")?(ve.unified_setting=!ve.unified_setting,ve.unified_setting||(ve.unified_late=!1,fe([{late_penalty:5}])),xe(Object.assign({},ve)),!1!==ve.unified_setting||""!=ce?ve.unified_setting&&(de([]),fe([{late_penalty:5}])):de(ce.concat({}))):g.ZP.error("已发布,不能再修改统一设置")},children:[(0,V.jsx)(y.ZP,{value:!0,disabled:le||!(null!=X&&X.manage_all_group),children:"统一发布"}),(0,V.jsx)(y.ZP,{disabled:le||!(null!=X&&null!==(t=X.group_settings)&&void 0!==t&&t.length),value:!1,children:"分班发布"})]}),0===(null==X||null===(a=X.group_settings)||void 0===a?void 0:a.length)&&(0,V.jsx)("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:"(本课堂无分班,仅支持选择“统一发布“)"})]})]}),ve.unified_setting&&(0,V.jsxs)("div",{children:[(0,V.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,V.jsx)(x.Z,{children:"发布时间:"}),(0,V.jsx)(x.Z,{className:"ml5",children:(0,V.jsx)(p.default,{disabled:le||!(null!=K&&null!==(r=K.homework_status)&&void 0!==r&&r.includes("未发布")||null!=K&&null!==(o=K.homework_status)&&void 0!==o&&o.includes("未开始"))||(0,C.Rm)()&&!(null!==(d=q.AssistantObject.practice)&&void 0!==d&&d.can_publish),style:{width:170},placeholder:"请选择发布时间",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(e){return Q(e,null==X?void 0:X.course_end_date)},disabledTime:function(e){return E(e)},value:ve.publish_time?O()(ve.publish_time):"",onChange:function(e,n){ve.publish_time=n,""!=ve.end_time&&ve.end_time||!ve.unified_setting||(ve.end_time=O()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),xe(Object.assign({},ve))}})}),(0,V.jsx)(x.Z,{children:(0,V.jsx)("span",{className:"c-grey-c ml10",children:"(学生收到作业的时间)"})})]}),(0,V.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,V.jsx)(x.Z,{children:"截止时间:"}),(0,V.jsx)(x.Z,{className:"ml5",children:(0,V.jsx)(p.default,{style:{width:170},allowClear:!1,placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:O()((0,A.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:(null==X?void 0:X.allow_late)&&(null==X?void 0:X.homework_status.includes("已截止"))||le||(null==X?void 0:X.allow_late)&&O()()>=O()(null==X?void 0:X.end_time)||(0,C.Rm)()&&!(null!==(S=q.AssistantObject.practice)&&void 0!==S&&S.can_publish),disabledDate:function(e){return Q(e,null==X?void 0:X.course_end_date,ve.publish_time)},disabledTime:function(e){return E(e,ve.publish_time)},value:ve.end_time?O()(ve.end_time):"",onChange:function(e,n){ve.end_time=n,xe(Object.assign({},ve))}})}),(0,V.jsx)(x.Z,{children:(0,V.jsx)("span",{className:"c-grey-c ml10",children:"(学生“按时”提交作品的时间截点)"})})]})]}),!ve.unified_setting&&(null===(L=ce)||void 0===L?void 0:L.length)>0&&(0,V.jsxs)(v.Z,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"},children:[(0,V.jsx)(x.Z,{span:24,children:(0,V.jsxs)(v.Z,{children:[(0,V.jsx)(x.Z,{span:10}),(0,V.jsx)(x.Z,{span:10,children:(0,V.jsxs)(v.Z,{className:"c-grey-c ml30",children:[(0,V.jsx)(x.Z,{flex:"1",children:"(学生收到作业时间)"}),(0,V.jsx)(x.Z,{flex:"1",children:"(学生“按时”提交作品时间截点)"})]})}),(0,V.jsx)(x.Z,{span:4})]})}),ce&&ce.map((function(e,n){var l,t,i,a,s,r,o,d,m,_;return(0,V.jsx)(x.Z,{span:24,children:(0,V.jsxs)(v.Z,{gutter:[8,16],children:[(0,V.jsx)(x.Z,{span:10,children:(0,V.jsxs)(v.Z,{gutter:[8,16],children:[(0,V.jsxs)(x.Z,{children:["发布规则 ",n+1]}),(0,V.jsx)(x.Z,{flex:"1",style:{maxWidth:300},children:(0,V.jsx)(f.default,{disabled:le||!(null!=K&&null!==(l=K.homework_status)&&void 0!==l&&l.includes("未发布")&&e.id||O()()<O()(null==e?void 0:e.publish_time))&&!(null==e||!e.publish_time)||(0,C.Rm)()&&!(null!==(t=q.AssistantObject.practice)&&void 0!==t&&t.can_publish),className:"ml20",mode:"multiple",style:{width:"100%"},value:e.group_name,placeholder:"请选择分班名称",onChange:function(l){var t;if(!(0,C.Rm)()||null!==(t=q.AssistantObject.practice)&&void 0!==t&&t.can_publish){ce[n].group_name=l,ce[n].group_id=e.group_id;var i=(0,Y.flattenDeep)(ce.map((function(e){return e.group_name}))),a=pe.map((function(e){var n=(null==e?void 0:e.group_name)||[];return c()(c()({},e),{},{group_name:(0,Y.remove)(n,(function(e){return i.includes(e)}))})}));fe(a),de(ce.slice())}else g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:X.group_settings&&X.group_settings.map((function(e){if(!ce.map((function(e){return e.group_name})).flat().includes(e.group_name))return(0,V.jsx)(J,{value:e.group_name,children:e.group_name},e.id)}))})})]})}),(0,V.jsx)(x.Z,{span:10,children:(0,V.jsx)("div",{className:"ml30",children:(0,V.jsx)(F,{ranges:{"此刻":[e.publish_time?O()(e.publish_time):O()(),O()()]},allowClear:!1,disabled:le||!(O()()<=O()(null===(i=be(e.id))||void 0===i?void 0:i.publish_time))&&[!0,(s=e.id,d=be(s,null==X?void 0:X.allow_late_settings,"id"),m=be(s,null==X?void 0:X.anonymous_comment_settings),_=be(s),(null==X?void 0:X.allow_late)&&d&&O()(null==d?void 0:d.late_time)<=O()()||(null==X?void 0:X.anonymous_comment)&&m&&null!==(null==m?void 0:m.evaluation_start)||null!=(null===(r=(O()(null==_?void 0:_.end_time)<=O()()&&(null==X||null===(o=X.allow_late_settings)||void 0===o?void 0:o.filter((function(e){return e.group_id.includes(s)}))))[0])||void 0===r?void 0:r.late_time))],style:{width:400},placeholder:["请选择发布时间","请选择截止时间"],disabledDate:function(e){return Q(e,null==X?void 0:X.course_end_date)},disabledTime:function(e){return E(e)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[O()((0,A.U6)(),"HH:mm"),O()((0,A.U6)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:e.publish_time&&[O()(e.publish_time),e.end_time?O()(e.end_time):void 0],onChange:function(e,l){var t;!(0,C.Rm)()||null!==(t=q.AssistantObject.practice)&&void 0!==t&&t.can_publish?(ce[n].publish_time=l[0],ce[n].end_time=l[1],de(u()(ce))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})})}),!le&&(0,V.jsxs)(x.Z,{span:4,children:[((null==e?void 0:e.publish_time)&&O()()<O()(null==e?void 0:e.publish_time)||!(null!=e&&e.publish_time))&&0!=n&&(0,V.jsx)(N.Z,{onClick:function(){var e=(0,Y.cloneDeep)(pe);console.log(e,"repairSettingsCopyrepairSettingsCopyrepairSettingsCopy"),e.forEach((function(e,l){e.group_name&&(e.group_name=e.group_name.filter((function(e){var l;return!(null!==(l=ce[n].group_name)&&void 0!==l&&l.includes(e))})))})),ce=ce.filter((function(e,l){return n!==l})),fe(e),de(ce.slice()),setTimeout((function(){return de(ce.slice())}),10)}}),ce.length<(null==X||null===(a=X.group_settings)||void 0===a?void 0:a.length)&&(0,V.jsx)(H.Z,{className:"c-green ml20",onClick:function(){var e;!(0,C.Rm)()||null!==(e=q.AssistantObject.practice)&&void 0!==e&&e.can_publish?de(ce.concat({})):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]})]})},n)}))]}),(0,V.jsx)(b.Z,{}),(0,V.jsxs)(v.Z,{children:[(0,V.jsx)(x.Z,{children:(0,V.jsx)("strong",{children:"补交设置"})}),(0,V.jsxs)(x.Z,{span:24,className:"mt15 pl30",children:[(0,V.jsx)(Z.Z,{checked:ve.allow_late,disabled:le||Ze,onChange:function(e){var n;!(0,C.Rm)()||null!==(n=q.AssistantObject.practice)&&void 0!==n&&n.can_late?(e.target.checked&&h.Z.warning({title:"开启补交提示",centered:!0,width:480,content:(0,V.jsxs)("div",{style:{padding:10,background:"#f5f6f9"},children:[(0,V.jsx)("div",{children:"1.开启补交后不可关闭,补交方式提交保存后不可修改;"}),(0,V.jsx)("div",{children:"2.补交截止时间必须晚于作业截止时间;"}),(0,V.jsx)("div",{children:"3.班级阶段进入“补交中”则不可变更作业截止时间。"})]})}),ve.allow_late=!ve.allow_late,""==pe&&fe([{late_penalty:5}]),xe(Object.assign({},ve))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:(0,V.jsx)("strong",{children:"开启补交"})}),(0,V.jsx)(w.Z,{overlayStyle:{width:380,maxWidth:380},title:(0,V.jsxs)("div",{style:{display:"flex",flexFlow:"column"},children:[(0,V.jsx)("span",{children:"补交规则说明"}),(0,V.jsx)("span",{children:"开启补交,学生只在补交时间内才通关则扣除分值,未通关不扣分;"}),(0,V.jsx)("span",{children:"学生在正常作业规定时间内通关,在补交阶段再次通关不扣分。"})]}),children:(0,V.jsx)(k.Z,{})})]})]}),(null==ve?void 0:ve.allow_late)&&(0,V.jsxs)("div",{style:{marginLeft:22},children:[(0,V.jsxs)("div",{className:"ml30 mt20",children:[(0,V.jsx)("span",{children:"补交方式:"}),(0,V.jsxs)(y.ZP.Group,{disabled:le||(null==X?void 0:X.anonymous_comment)||(null==X?void 0:X.allow_late),value:ve.unified_late,onChange:function(e){var n;!(0,C.Rm)()||null!==(n=q.AssistantObject.practice)&&void 0!==n&&n.can_late?(ve.unified_late=e.target.value,""!=pe||e.target.value||fe([{penalty_type:T.Q.Percent,late_penalty:20}]),xe(c()({},ve))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:[(null==ve?void 0:ve.unified_setting)&&(0,V.jsx)(y.ZP,{value:!0,disabled:!(null!=X&&X.manage_all_group),children:"统一补交"}),(null==X||null===(G=X.group_settings)||void 0===G?void 0:G.length)>0&&(0,V.jsx)(y.ZP,{value:!1,children:"分班补交"})]})]}),null!=ve&&ve.unified_late?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,V.jsx)(x.Z,{children:"补交扣分:"}),(0,V.jsx)(x.Z,{className:"ml5",children:(0,V.jsx)(T.Z,{disabled:le||we,value:{type:ve.penalty_type,inputValue:ve.late_penalty},onChange:function(e){var n;!(0,C.Rm)()||null!==(n=q.AssistantObject.practice)&&void 0!==n&&n.can_late?xe(c()(c()({},ve),{},{late_penalty:e.inputValue,penalty_type:e.type})):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,V.jsx)(x.Z,{flex:"1",className:"ml5",children:(0,V.jsx)("span",{className:"c-grey-c ml10",children:ve.penalty_type===T.Q.Number?"(补交时按照学生总成绩扣分)":"(学生成绩将扣除补交关卡分值的百分比)"})})]}),(0,V.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,V.jsx)(x.Z,{children:"补交截止时间:"}),(0,V.jsx)(x.Z,{className:"ml5",children:(0,V.jsx)(p.default,{allowClear:!1,style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:O()((0,A.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:le||we,value:ve.late_time?O()(ve.late_time):"",disabledDate:function(e){return Q(e,null==X?void 0:X.course_end_date)},onChange:function(e,n){var l;!(0,C.Rm)()||null!==(l=q.AssistantObject.practice)&&void 0!==l&&l.can_late?(ve.late_time=n,xe(Object.assign({},ve))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,V.jsx)(x.Z,{children:(0,V.jsx)("span",{className:"c-grey-c ml10",children:"(学生“延时”提交作品的时间截点)"})})]})]}):pe.map((function(e,n){var l;return(0,V.jsx)(x.Z,{span:24,children:(0,V.jsxs)(v.Z,{className:"mt25",children:[(0,V.jsxs)(x.Z,{style:{marginLeft:30},children:[(0,V.jsxs)("span",{children:["补交规则",n+1,""]}),(0,V.jsx)(f.default,{disabled:le||!(null!=K&&null!==(l=K.homework_status)&&void 0!==l&&l.includes("未发布"))&&e.id||(null==X?void 0:X.anonymous_comment),mode:"multiple",style:{width:306},value:"string"==typeof e.group_name?[e.group_name]:e.group_name,placeholder:"请选择分班名称",onChange:function(l){var t;!(0,C.Rm)()||null!==(t=q.AssistantObject.practice)&&void 0!==t&&t.can_late?(pe[n].group_name=l,pe[n].group_id=e.group_id,fe(pe.slice())):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:X.group_settings&&X.group_settings.map((function(e){var n=pe.map((function(e){return e.group_name})).flat(),l=ce.map((function(e){return e.group_name})).flat();if(null!=ve&&ve.unified_setting){if(!n.includes(e.group_name))return(0,V.jsx)(J,{value:e.group_name,children:e.group_name},e.id)}else if(l.includes(e.group_name)&&!n.includes(e.group_name))return(0,V.jsx)(J,{value:e.group_name,children:e.group_name},e.id)}))})]}),(0,V.jsxs)(x.Z,{className:"ml20",children:[(0,V.jsx)("span",{children:"补交扣分:"}),(0,V.jsx)(T.Z,{disabled:le||Pe(e.id),value:{type:e.penalty_type,inputValue:e.late_penalty},onChange:function(e){var l;!(0,C.Rm)()||null!==(l=q.AssistantObject.practice)&&void 0!==l&&l.can_late?(pe[n].late_penalty=e.inputValue,pe[n].penalty_type=e.type,fe(u()(pe))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),(0,V.jsxs)(x.Z,{className:"ml20",children:[(0,V.jsx)("span",{children:"补交截止时间:"}),(0,V.jsx)(p.default,{disabled:le||Pe(e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:O()((0,A.U6)(),"HH:mm")},placeholder:"请选择截止时间",disabledDate:function(e){return Q(e,null==X?void 0:X.course_end_date)},format:"YYYY-MM-DD HH:mm",value:null!=e&&e.late_time?O()(e.late_time):void 0,onChange:function(e,l){var t;!(0,C.Rm)()||null!==(t=q.AssistantObject.practice)&&void 0!==t&&t.can_late?(pe[n].late_time=l,fe(u()(pe))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),!le&&(0,V.jsxs)(x.Z,{className:"ml20",children:[n>0&&!e.id&&(0,V.jsx)(N.Z,{onClick:function(){var e;!(0,C.Rm)()||null!==(e=q.AssistantObject.practice)&&void 0!==e&&e.can_late?(pe=pe.filter((function(e,l){return n!==l})),fe(pe.slice()),setTimeout((function(){return fe(pe.slice())}),10)):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}}),(0,V.jsx)(H.Z,{className:"c-green ml20",onClick:function(){var e;!(0,C.Rm)()||null!==(e=q.AssistantObject.practice)&&void 0!==e&&e.can_late?fe(pe.concat({penalty_type:T.Q.Percent,late_penalty:20})):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]})]})},n)}))]}),(0,V.jsx)(b.Z,{}),(0,V.jsx)(v.Z,{children:(0,V.jsx)("strong",{children:"学习行为分析"})}),(0,V.jsxs)(v.Z,{align:"middle",className:M.Z.analysis,children:[(0,V.jsx)(x.Z,{children:(0,V.jsx)(P.Z,{disabled:le,checked:ve.action_analysis,onChange:function(){var e=s()(i()().mark((function e(n){var l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/homework_commons/".concat(B.categoryId,"/update_action_analysis.json"),{method:"POST",body:{status:n}});case 2:0===(null==(l=e.sent)?void 0:l.status)&&xe((function(e){return c()(c()({},e),{},{action_analysis:n})}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()})}),(0,V.jsx)(x.Z,{className:"ml10",children:ve.action_analysis?"已开启":"未开启"}),(0,V.jsx)(x.Z,{className:M.Z.tips,children:"(在学生完成作业时,使用电脑摄像头随机抓拍照片用于学习行为分析,学习行为分析结果可在学生的实训报告中进行查看)"})]})]})}))},22030:function(e,n){n.Z={flex_box_center:"flex_box_center___IBr6x",flex_space_between:"flex_space_between___n2Iz0",flex_box_vertical_center:"flex_box_vertical_center___1umwO",flex_box_center_end:"flex_box_center_end___SRZYb",flex_box_column:"flex_box_column___b90Da",form:"form___V3fAH",efficiency:"efficiency___Lmou1",analysis:"analysis___CtFBc",tips:"tips___Ga_EJ",tip:"tip___hVaw_",FormStyle:"FormStyle___Nqgvv",SubTooltip:"SubTooltip___qB_Q1",DifStyle:"DifStyle___kxYQa",DifSimple:"DifSimple___NMdPv",DifMiddle:"DifMiddle___jGqIT",DifHard:"DifHard___uxjoA"}}}]);