"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[11982],{38990:function(e,n,l){l.d(n,{Q:function(){return o}});var t=l(79800),i=l.n(t),a=l(59301),r=l(57809),s=l(94001),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,_=(0,a.useMemo)((function(){return d?o.Number:o.Percent}),[d]),m=(0,a.useState)(_),p=i()(m,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)(r.default,{onChange:function(e){g(e),l({type:e,inputValue:e===o.Number?5:20})},value:f||_,style:{width:100},options:d?[{label:"分值",value:o.Number}]:[{label:"百分比",value:o.Percent},{label:"分值",value:o.Number}],disabled:t}),(0,u.jsx)(s.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})}})]})}},11982:function(e,n,l){l.d(n,{Q8:function(){return L},d0:function(){return Q},w6:function(){return V}});var t=l(7557),i=l.n(t),a=l(41498),r=l.n(a),s=l(37205),u=l.n(s),o=l(82242),c=l.n(o),d=l(79800),_=l.n(d),m=l(59301),p=l(84291),f=l(57809),g=l(8591),h=l(43418),v=l(95237),x=l(43604),j=l(3113),b=l(5112),y=l(28103),w=l(24905),Z=l(6848),P=l(20360),H=l(57703),N=l(85699),k=l(99232),S=l.n(k),O=l(95888),C=l(10032),D=l(89392),Y=l(11298),A=l(73366),M=l(75102),R=l(38990),T=l(73759),I=l(37712);function V(e,n){for(var l=[],t=e;tS()(n).endOf("day"),a=e2&&void 0!==arguments[2]?arguments[2]:"group_id";return n?n.find((function(n){return n[t]===e})):null==B||null===(l=B.group_settings)||void 0===l?void 0:l.find((function(n){return n.group_id[0]===e}))},ye=((null==B?void 0:B.allow_late)||(null==B||B.anonymous_comment),(0,m.useMemo)((function(){return(null==B?void 0:B.allow_late)||(null==B?void 0:B.all_group_late)}),[B,X])),we=null==B?void 0:B.anonymous_comment,Ze=function(e){if(!e)return!1;var n=be(e,null==B?void 0:B.anonymous_comment_settings);return(null==B?void 0:B.anonymous_comment)&&n&&null!==(null==n?void 0:n.evaluation_start)};return(0,I.jsxs)("section",{className:[A.Z.form," bg-white pl30 pr30 pt10 pb20"].join(" "),children:[(0,I.jsxs)(v.Z,{children:[(0,I.jsx)(x.Z,{span:24,children:(0,I.jsxs)(v.Z,{align:"middle",children:[(0,I.jsx)(x.Z,{flex:"1"}),(0,I.jsxs)(x.Z,{children:[(0,O.GJ)()&&ne&&(0,I.jsx)(j.ZP,{type:"primary",size:"middle",ghost:!0,onClick:function(){var e,n;!(0,O.Rm)()||null!==(e=W.AssistantObject.practice)&&void 0!==e&&e.can_late||null!==(n=W.AssistantObject.practice)&&void 0!==n&&n.can_publish?le(!1):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:"编辑设置"}),!ne&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(j.ZP,{type:"primary",size:"middle",loading:ae,onClick:function(){return function(){var e,n,l;if(2!==(null==q||null===(e=q.userInfo)||void 0===e?void 0:e.user_status)){var t=JSON.parse(JSON.stringify(he));if(t.challenge_settings.filter((function(e){return!e.hide})),t.categoryId=z.categoryId,null!==(n=t.challenge_settings)&&void 0!==n&&n.every((function(e){return!e.checked})))g.ZP.warning("关卡不能全部设置为可不做");else{if(he.unified_setting||(oe=null===(l=oe)||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=B.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=oe,he.allow_late)if(he.unified_late){if(null===he.late_penalty||void 0===he.late_penalty||he.late_penalty<0||he.late_penalty>100)throw g.ZP.error("迟交扣分填写区间为0~100"),new String("迟交扣分填写区间为0~100");if(!he.late_time)throw g.ZP.error("请把截止时间填写完整"),new String("请把截止时间填写完整")}else{var i;me=null===(i=me)||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=B.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=me}je(t)}}else(0,T.Rd)()}()},children:"提交"}),(0,I.jsx)(j.ZP,{type:"primary",size:"middle",ghost:!0,className:"ml20",onClick:function(){le(!0),xe()},children:"取消"})]})]})]})}),(0,I.jsxs)("div",{children:[(0,I.jsx)("label",{children:"发布方式:"})," ",(0,I.jsxs)(b.ZP.Group,{disabled:ne||!(null!=X&&null!==(n=X.homework_status)&&void 0!==n&&n.includes("未发布"))||(0,O.Rm)()&&!(null!==(l=W.AssistantObject.practice)&&void 0!==l&&l.can_publish),value:he.unified_setting,onChange:function(e){var n;null!=X&&null!==(n=X.homework_status)&&void 0!==n&&n.includes("未发布")?(he.unified_setting=!he.unified_setting,he.unified_setting||(he.unified_late=!1,pe([{late_penalty:5}])),ve(Object.assign({},he)),!1!==he.unified_setting||""!=oe?he.unified_setting&&(ce([]),pe([{late_penalty:5}])):ce(oe.concat({}))):g.ZP.error("已发布,不能再修改统一设置")},children:[(0,I.jsx)(b.ZP,{value:!0,disabled:ne||!(null!=B&&B.manage_all_group),children:"统一发布"}),(0,I.jsx)(b.ZP,{disabled:ne||!(null!=B&&null!==(t=B.group_settings)&&void 0!==t&&t.length),value:!1,children:"分班发布"})]}),0===(null==B||null===(a=B.group_settings)||void 0===a?void 0:a.length)&&(0,I.jsx)("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:"(本课堂无分班,仅支持选择“统一发布“)"})]})]}),he.unified_setting&&(0,I.jsxs)("div",{children:[(0,I.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,I.jsx)(x.Z,{children:"发布时间:"}),(0,I.jsx)(x.Z,{className:"ml5",children:(0,I.jsx)(p.default,{disabled:ne||!(null!=X&&null!==(s=X.homework_status)&&void 0!==s&&s.includes("未发布")||null!=X&&null!==(o=X.homework_status)&&void 0!==o&&o.includes("未开始"))||(0,O.Rm)()&&!(null!==(d=W.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 L(e,null==B?void 0:B.course_end_date)},disabledTime:function(e){return Q(e)},value:he.publish_time?S()(he.publish_time):"",onChange:function(e,n){he.publish_time=n,""!=he.end_time&&he.end_time||!he.unified_setting||(he.end_time=S()(e).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),ve(Object.assign({},he))}})}),(0,I.jsx)(x.Z,{children:(0,I.jsx)("span",{className:"c-grey-c ml10",children:"(学生收到作业的时间)"})})]}),(0,I.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,I.jsx)(x.Z,{children:"截止时间:"}),(0,I.jsx)(x.Z,{className:"ml5",children:(0,I.jsx)(p.default,{style:{width:170},allowClear:!1,placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:S()((0,Y.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:(null==B?void 0:B.allow_late)&&(null==B?void 0:B.homework_status.includes("已截止"))||ne||(null==B?void 0:B.allow_late)&&S()()>=S()(null==B?void 0:B.end_time)||(0,O.Rm)()&&!(null!==(k=W.AssistantObject.practice)&&void 0!==k&&k.can_publish),disabledDate:function(e){return L(e,null==B?void 0:B.course_end_date,he.publish_time)},disabledTime:function(e){return Q(e,he.publish_time)},value:he.end_time?S()(he.end_time):"",onChange:function(e,n){he.end_time=n,ve(Object.assign({},he))}})}),(0,I.jsx)(x.Z,{children:(0,I.jsx)("span",{className:"c-grey-c ml10",children:"(学生“按时”提交作品的时间截点)"})})]})]}),!he.unified_setting&&(null===(V=oe)||void 0===V?void 0:V.length)>0&&(0,I.jsxs)(v.Z,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"},children:[(0,I.jsx)(x.Z,{span:24,children:(0,I.jsxs)(v.Z,{children:[(0,I.jsx)(x.Z,{span:10}),(0,I.jsx)(x.Z,{span:10,children:(0,I.jsxs)(v.Z,{className:"c-grey-c ml30",children:[(0,I.jsx)(x.Z,{flex:"1",children:"(学生收到作业时间)"}),(0,I.jsx)(x.Z,{flex:"1",children:"(学生“按时”提交作品时间截点)"})]})}),(0,I.jsx)(x.Z,{span:4})]})}),oe&&oe.map((function(e,n){var l,t,i,a,r,s,o,d,_,m;return(0,I.jsx)(x.Z,{span:24,children:(0,I.jsxs)(v.Z,{gutter:[8,16],children:[(0,I.jsx)(x.Z,{span:10,children:(0,I.jsxs)(v.Z,{gutter:[8,16],children:[(0,I.jsxs)(x.Z,{children:["发布规则 ",n+1]}),(0,I.jsx)(x.Z,{flex:"1",style:{maxWidth:300},children:(0,I.jsx)(f.default,{disabled:ne||!(null!=X&&null!==(l=X.homework_status)&&void 0!==l&&l.includes("未发布")&&e.id||S()()0&&(0,I.jsx)(b.ZP,{value:!1,children:"分班补交"})]})]}),null!=he&&he.unified_late?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,I.jsx)(x.Z,{children:"补交扣分:"}),(0,I.jsx)(x.Z,{className:"ml5",children:(0,I.jsx)(R.Z,{disabled:ne||we,value:{type:he.penalty_type,inputValue:he.late_penalty},onChange:function(e){var n;!(0,O.Rm)()||null!==(n=W.AssistantObject.practice)&&void 0!==n&&n.can_late?ve(c()(c()({},he),{},{late_penalty:e.inputValue,penalty_type:e.type})):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,I.jsx)(x.Z,{flex:"1",className:"ml5",children:(0,I.jsx)("span",{className:"c-grey-c ml10",children:he.penalty_type===R.Q.Number?"(补交时按照学生总成绩扣分)":"(学生成绩将扣除补交关卡分值的百分比)"})})]}),(0,I.jsxs)(v.Z,{align:"middle",className:"mt25 pl30",children:[(0,I.jsx)(x.Z,{children:"补交截止时间:"}),(0,I.jsx)(x.Z,{className:"ml5",children:(0,I.jsx)(p.default,{allowClear:!1,style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:S()((0,Y.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:ne||we,value:he.late_time?S()(he.late_time):"",disabledDate:function(e){return L(e,null==B?void 0:B.course_end_date)},onChange:function(e,n){var l;!(0,O.Rm)()||null!==(l=W.AssistantObject.practice)&&void 0!==l&&l.can_late?(he.late_time=n,ve(Object.assign({},he))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})}),(0,I.jsx)(x.Z,{children:(0,I.jsx)("span",{className:"c-grey-c ml10",children:"(学生“延时”提交作品的时间截点)"})})]})]}):me.map((function(e,n){var l;return(0,I.jsx)(x.Z,{span:24,children:(0,I.jsxs)(v.Z,{className:"mt25",children:[(0,I.jsxs)(x.Z,{style:{marginLeft:30},children:[(0,I.jsxs)("span",{children:["补交规则",n+1,":"]}),(0,I.jsx)(f.default,{disabled:ne||!(null!=X&&null!==(l=X.homework_status)&&void 0!==l&&l.includes("未发布"))&&e.id||(null==B?void 0:B.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,O.Rm)()||null!==(t=W.AssistantObject.practice)&&void 0!==t&&t.can_late?(me[n].group_name=l,me[n].group_id=e.group_id,pe(me.slice())):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")},children:B.group_settings&&B.group_settings.map((function(e){var n=me.map((function(e){return e.group_name})).flat(),l=oe.map((function(e){return e.group_name})).flat();if(null!=he&&he.unified_setting){if(!n.includes(e.group_name))return(0,I.jsx)(F,{value:e.group_name,children:e.group_name},e.id)}else if(l.includes(e.group_name)&&!n.includes(e.group_name))return(0,I.jsx)(F,{value:e.group_name,children:e.group_name},e.id)}))})]}),(0,I.jsxs)(x.Z,{className:"ml20",children:[(0,I.jsx)("span",{children:"补交扣分:"}),(0,I.jsx)(R.Z,{disabled:ne||Ze(e.id),value:{type:e.penalty_type,inputValue:e.late_penalty},onChange:function(e){var l;!(0,O.Rm)()||null!==(l=W.AssistantObject.practice)&&void 0!==l&&l.can_late?(me[n].late_penalty=e.inputValue,me[n].penalty_type=e.type,pe(u()(me))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),(0,I.jsxs)(x.Z,{className:"ml20",children:[(0,I.jsx)("span",{children:"补交截止时间:"}),(0,I.jsx)(p.default,{disabled:ne||Ze(e.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:S()((0,Y.U6)(),"HH:mm")},placeholder:"请选择截止时间",disabledDate:function(e){return L(e,null==B?void 0:B.course_end_date)},format:"YYYY-MM-DD HH:mm",value:null!=e&&e.late_time?S()(e.late_time):void 0,onChange:function(e,l){var t;!(0,O.Rm)()||null!==(t=W.AssistantObject.practice)&&void 0!==t&&t.can_late?(me[n].late_time=l,pe(u()(me))):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]}),!ne&&(0,I.jsxs)(x.Z,{className:"ml20",children:[n>0&&!e.id&&(0,I.jsx)(P.Z,{onClick:function(){var e;!(0,O.Rm)()||null!==(e=W.AssistantObject.practice)&&void 0!==e&&e.can_late?(me=me.filter((function(e,l){return n!==l})),pe(me.slice()),setTimeout((function(){return pe(me.slice())}),10)):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}}),(0,I.jsx)(H.Z,{className:"c-green ml20",onClick:function(){var e;!(0,O.Rm)()||null!==(e=W.AssistantObject.practice)&&void 0!==e&&e.can_late?pe(me.concat({penalty_type:R.Q.Percent,late_penalty:20})):g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能")}})]})]})},n)}))]})]})}))},73366: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"}}}]);