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/p__Paths__New__index.async.js

1 line
12 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([[28982],{39178:function(e,l,s){s.r(l),s.d(l,{default:function(){return ie}});var n=s(37205),i=s.n(n),a=s(82242),t=s.n(a),c=s(7557),o=s.n(c),r=s(41498),u=s.n(r),d=s(79800),m=s.n(d),h=s(39647),_=s.n(h),p=s(59301),g=s(80608),v=s(78241),f=s(8591),x=s(24650),j=s(88522),A=s(53326),N=s(5112),b=s(3113),y=s(43418),I="wrap___HeK2P",k="bg____raBL",Z="title_style___qY3gq",R="line___OUqEe",S="text___V9Ft_",C="fieldWrap___pR4UB",E="form_item___q7FNm",F="close_style___MwGvu",P="xmfm___lq9HQ",V="img_content___jqYOm",w="dbbjt___dUU2F",U="footer_style___niiiI",O="backgroundFa___ghlCO",K="input_search___uH23W",q="platform_list___PMbN5",G="platform_item___aPIfB",J="platform_item_active___X42Cx",L="img_items___h1cUv",M="select_img___oQ3Du",Y="unit_list___sZ0gb",Q="unit_item___jVQNB",T="unit_item_active___jz6KJ",B="form_item_item___tHIHe",D=s(71681),H=s(43899),z=s(28131),W=s(49105),X=s(6638),$=s(78270),ee=s(2753),le=s(41852),se=s(37712),ne=["user","newCourse","globalSetting","loading","dispatch"],ie=(0,g.connect)((function(e){var l=e.user,s=e.newCourse,n=e.loading;return{user:l,newCourse:s,globalSetting:e.globalSetting,loading:n.effects}}))((function(e){e.user,e.newCourse,e.globalSetting,e.loading;var l,s,n=e.dispatch,a=(_()(e,ne),v.Z.useForm()),c=m()(a,1)[0],r=(0,p.useState)(),d=m()(r,2),h=d[0],ie=d[1],ae=(0,p.useState)(),te=m()(ae,2),ce=te[0],oe=te[1],re=(0,p.useState)(),ue=m()(re,2),de=ue[0],me=ue[1],he=(0,p.useState)(),_e=m()(he,2),pe=_e[0],ge=_e[1],ve=(0,p.useState)(!1),fe=m()(ve,2),xe=fe[0],je=fe[1],Ae=(0,p.useState)(!1),Ne=m()(Ae,2),be=Ne[0],ye=Ne[1],Ie=(0,p.useState)(""),ke=m()(Ie,2),Ze=ke[0],Re=ke[1],Se=(0,p.useState)(),Ce=m()(Se,2),Ee=Ce[0],Fe=Ce[1],Pe=(0,p.useState)(),Ve=m()(Pe,2),we=Ve[0],Ue=Ve[1],Oe=(0,p.useState)(""),Ke=m()(Oe,2),qe=Ke[0],Ge=Ke[1],Je=(0,g.useParams)(),Le=(0,p.useState)([]),Me=m()(Le,2),Ye=Me[0],Qe=Me[1];(0,p.useEffect)((function(){return Te(),null!=Je&&Je.pathId?(0,$.Pt)(null==Je?void 0:Je.pathId).then((function(e){var l,s,n,i,a,t,o,r;0==(null==e?void 0:e.status)&&(Ge(null==e||null===(l=e.core_course)||void 0===l?void 0:l.teacher_id),c.setFieldsValue(null==e?void 0:e.core_course),ie([{id:null==e||null===(s=e.core_course)||void 0===s||null===(s=s.pic_url)||void 0===s?void 0:s.pic_id,test:null==e||null===(n=e.core_course)||void 0===n||null===(n=n.pic_url)||void 0===n?void 0:n.url}]),oe([{id:null==e||null===(i=e.core_course)||void 0===i||null===(i=i.background_url)||void 0===i?void 0:i.background_attachment_id,test:null==e||null===(a=e.core_course)||void 0===a||null===(a=a.background_url)||void 0===a?void 0:a.url}]),ge([null==e||null===(t=e.core_course)||void 0===t?void 0:t.school]),null!=e&&null!==(o=e.core_course)&&void 0!==o&&null!==(o=o.company)&&void 0!==o&&o.name&&me([null==e||null===(r=e.core_course)||void 0===r?void 0:r.company]))})):c.setFieldsValue({statistic_type:1}),n({type:"globalSetting/footerToggle",payload:!1}),function(){n({type:"globalSetting/footerToggle",payload:!0})}}),[]);var Te=function(){var e=u()(o()().mark((function e(){var l;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,le.H8)({domain_type:1});case 2:0==(l=e.sent).status&&Qe((null==l?void 0:l.domains)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,se.jsxs)("div",{className:I,children:[(0,se.jsx)("div",{className:k,children:(0,se.jsxs)(v.Z,{labelCol:{flex:"100px"},form:c,scrollToFirstError:!0,colon:!1,children:[(0,se.jsxs)("div",{className:Z,children:[(0,se.jsx)("div",{className:R}),(0,se.jsxs)("div",{className:S,children:[null!=Je&&Je.pathId?"编辑":"新建","实验项目"]})]}),(0,se.jsxs)("div",{className:C,children:[(0,se.jsx)(v.Z.Item,{className:E,label:"项目名称",colon:!1,name:"name",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,se.jsx)(x.Z,{size:"large",className:B,placeholder:"请输入项目名称",maxLength:60,showCount:!0})}),(0,se.jsx)(v.Z.Item,{className:E,label:"项目领域",colon:!1,name:"domain",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,se.jsx)(j.Z,{size:"large",style:{width:"100%"},options:null==Ye?void 0:Ye.map((function(e){return{value:e,label:e}})),filterOption:function(e,l){var s;return-1!==(null==l||null===(s=l.label)||void 0===s||null===(s=s.toUpperCase())||void 0===s?void 0:s.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&c.setFieldValue("domain",e.substring(0,20))}})}),(0,se.jsxs)(v.Z.Item,{className:E,label:"项目封面",colon:!1,name:"attachment_id",children:[(0,se.jsx)(A.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,W.ZP)("".concat(D.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){ie([e]),c.setFieldsValue({attachment_id:e.id})}))},children:(0,se.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,se.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,se.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传图片"}),(0,se.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(支持上传jpg/png等格式文件文件大小不能超过2M,建议使用384*214像素;如不上传,默认使用系统图片)"})]})}),(null==h?void 0:h.length)>0&&(0,se.jsxs)("div",{className:P,children:[(0,se.jsx)("img",{src:D.Z.API_SERVER+(null===(l=h[0])||void 0===l?void 0:l.test),className:V}),(0,se.jsx)("img",{src:H,className:F,onClick:function(){ie([])}})]})]}),(0,se.jsxs)(v.Z.Item,{className:E,label:"顶部背景图",colon:!1,name:"background_attachment_id",children:[(0,se.jsx)(A.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,fileList:ce,customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,W.ZP)("".concat(D.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){oe([e]),c.setFieldsValue({background_attachment_id:e.id})}))},children:(0,se.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,se.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,se.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传文件"}),(0,se.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(本项非必需。如不上传,则使用系统默认图片;如上传请选择jpg、png格式大小不超过2M建议尺寸1920*240像素)"})]})}),(null==ce?void 0:ce.length)>0&&(0,se.jsxs)("div",{className:w,children:[(0,se.jsx)("img",{src:D.Z.API_SERVER+(null===(s=ce[0])||void 0===s?void 0:s.test),className:V}),(0,se.jsx)("img",{src:H,className:F,onClick:function(){oe([])}})]})]}),(0,se.jsx)(v.Z.Item,{className:E,label:"链接",colon:!1,name:"url",rules:[{pattern:new RegExp(/^[^\u4e00-\u9fa5]+$/,""),message:"不能输入中文"}],children:(0,se.jsx)(x.Z,{size:"large",className:B,placeholder:"请输入链接"})}),(0,se.jsx)(v.Z.Item,{className:E,label:"实践平台",colon:!1,name:"company",children:(0,se.jsx)(x.Z,{className:B,placeholder:"请输入实践平台",size:"large"})}),(0,se.jsx)(v.Z.Item,{className:E,label:"课程类型",colon:!1,name:"course_type",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,se.jsxs)(N.ZP.Group,{children:[(0,se.jsx)(N.ZP,{value:1,style:{marginRight:30,marginTop:8,color:"#333333"},children:"普通课程"}),(0,se.jsx)(N.ZP,{value:2,style:{marginRight:30,marginTop:8,color:"#333333"},children:"国家一流"}),(0,se.jsx)(N.ZP,{value:3,style:{marginRight:30,marginTop:8,color:"#333333"},children:"省级一流"})]})})]})]})}),(0,se.jsx)("div",{className:U,children:(0,se.jsxs)("div",{className:O,children:[(0,se.jsx)(b.ZP,{className:"canclebtn",onClick:function(){"list"==window.location.href.split("comeFrom=")[1]?g.history.push("/paths"):g.history.push("/paths/".concat(null==Je?void 0:Je.pathId))},children:"取消"}),(0,se.jsx)(b.ZP,{className:"confirmbtn",type:"primary",onClick:function(){(null==h?void 0:h.length)>0&&c.setFieldsValue({attachment_id:h[0].id}),(null==ce?void 0:ce.length)>0&&c.setFieldsValue({background_attachment_id:ce[0].id}),(null==de?void 0:de.length)>0&&c.setFieldsValue({company:de[0].name}),(null==pe?void 0:pe.length)>0&&c.setFieldsValue({school:pe[0].name}),c.validateFields().then((function(){null!=Je&&Je.pathId?(0,$.u1)(t()({teacher_id:qe,id:null==Je?void 0:Je.pathId},c.getFieldsValue())).then((function(e){0==(null==e?void 0:e.status)&&(f.ZP.success("编辑成功"),g.history.go(-1))})):(0,$.E0)(c.getFieldsValue()).then((function(e){0==(null==e?void 0:e.status)&&(f.ZP.success("新增成功"),g.history.push("/paths"))}))}))},children:null!=Je&&Je.pathId?"保存编辑":"确认新建"})]})}),(0,se.jsxs)(y.Z,{centered:!0,zIndex:200,width:750,title:"选择实验平台",visible:xe,onCancel:function(){je(!1)},footer:(0,se.jsxs)("div",{className:"modal_list",children:[(0,se.jsx)("div",{className:"modal_close",onClick:function(){je(!1)},children:"取消"}),(0,se.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in Ee)Ee[l].check&&e.push(Ee[l]);me(e),c.setFieldsValue({company:e[0].name}),je(!1)},children:"确定"})]}),children:[(0,se.jsxs)("div",{className:K,children:[(0,se.jsx)(x.Z,{value:Ze,onChange:function(e){Re(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,se.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==Ee?void 0:Ee.length)>0?(0,se.jsx)("div",{className:q,children:Ee.map((function(e,l){return(0,se.jsxs)("div",{className:null!=e&&e.check?J:G,onClick:function(){Ee.map((function(e){e.check=!1})),Ee[l].check=!0,Fe(i()(Ee))},children:[(0,se.jsx)("img",{className:L,src:D.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,se.jsx)("img",{className:M,src:z})]},l)}))}):(0,se.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]}),(0,se.jsxs)(y.Z,{centered:!0,zIndex:200,width:750,title:"选择牵头单位",visible:be,onCancel:function(){ye(!1)},footer:(0,se.jsxs)("div",{className:"modal_list",children:[(0,se.jsx)("div",{className:"modal_close",onClick:function(){ye(!1)},children:"取消"}),(0,se.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in we)we[l].check&&e.push(we[l]);ge(e),c.setFieldsValue({school:e[0].name}),ye(!1)},children:"确定"})]}),children:[(0,se.jsxs)("div",{className:K,children:[(0,se.jsx)(x.Z,{value:Ze,onChange:function(e){Re(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,se.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==we?void 0:we.length)>0?(0,se.jsx)("div",{className:Y,children:we.map((function(e,l){return(0,se.jsxs)("div",{className:null!=e&&e.check?T:Q,onClick:function(){we.map((function(e){e.check=!1})),we[l].check=!0,Ue(i()(we))},children:[(0,se.jsx)("img",{className:L,src:D.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,se.jsx)("img",{className:M,src:z})]},l)}))}):(0,se.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]})]})}))},43899:function(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAOJJREFUOE+lkrEOAUEQhr+RULmLTqcQvRfxAKJX6o5GcISKTqkXD+BB6OUKNDpZV1Gs7MbKkZA4U83+M/8/f2ZHSEQExRy0NNQEyqakIRJYX2FehpNrF5fsoS6wAPJJsUQea2iWYGUwS3yQlu79gWgNaGgYshh7Wdh9mfSuE9+gIkcYa+i6qjcaoZUins0slA8CxPe59PtPAYGJHGADVB1qGgvTKSoMLeSHIed2+yn06NuaiUqDl/TjDwaWYMIIqOHwxa7AJT3xH6vfl9PpkPE8VK/3upzU35H6AP46OUf+5cjvSj1v2525UKMAAAAASUVORK5CYII="},28131:function(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAKhJREFUOE/FktkNg0AMRMf0EEQ50EdIK5BWgD6gnGiLiJFXONoDFlZ8xN/zxseYcLPoJo9sg/LFPRidGcmyWQYKC5ht4MJ2bcLbDNRfmuAI9lYQkTiGR/XgraursRP8RIGgenL9JcyiKRjNZ6IlbOAbOMcR4aPlmYD6CI5WkHj0ODpVCo5iVIiB5ayzrhKlULbMbkxnnxobyKfJLXYS2TO79AepKf5vsAItjVcRnmIf4gAAAABJRU5ErkJggg=="}}]);