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
13 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],{94579:function(e,l,n){n.r(l),n.d(l,{default:function(){return te}});var s=n(861),t=n.n(s),i=n(42122),a=n.n(i),o=n(17061),c=n.n(o),r=n(17156),u=n.n(r),d=n(27424),m=n.n(d),h=n(70215),p=n.n(h),_=n(67294),g=n(88275),v=n(91773),f=n(2453),x=n(11486),j=n(49288),A=n(92421),N=n(78045),y=n(71577),b=n(14446),Z="wrap___HeK2P",I="bg____raBL",C="title_style___qY3gq",k="line___OUqEe",E="text___V9Ft_",S="fieldWrap___pR4UB",R="form_item___q7FNm",P="close_style___MwGvu",w="xmfm___lq9HQ",O="img_content___jqYOm",U="dbbjt___dUU2F",F="footer_style___niiiI",V="backgroundFa___ghlCO",G="input_search___uH23W",J="platform_list___PMbN5",K="platform_item___aPIfB",q="platform_item_active___X42Cx",L="img_items___h1cUv",M="select_img___oQ3Du",T="unit_list___sZ0gb",Y="unit_item___jVQNB",B="unit_item_active___jz6KJ",D="form_item_item___tHIHe",Q=n(59758),H=n(43899),z=n(28131),W=n(84519),X=n(82982),$=n(85861),ee=n(82749),le=n(98706),ne=n(85893),se=["user","newCourse","globalSetting","loading","dispatch"],te=(0,g.connect)((function(e){var l=e.user,n=e.newCourse,s=e.loading;return{user:l,newCourse:n,globalSetting:e.globalSetting,loading:s.effects}}))((function(e){e.user,e.newCourse,e.globalSetting,e.loading;var l,n,s=e.dispatch,i=(p()(e,se),v.Z.useForm()),o=m()(i,1)[0],r=(0,_.useState)(),d=m()(r,2),h=d[0],te=d[1],ie=(0,_.useState)(),ae=m()(ie,2),oe=ae[0],ce=ae[1],re=(0,_.useState)(),ue=m()(re,2),de=ue[0],me=ue[1],he=(0,_.useState)(),pe=m()(he,2),_e=pe[0],ge=pe[1],ve=(0,_.useState)(!1),fe=m()(ve,2),xe=fe[0],je=fe[1],Ae=(0,_.useState)(!1),Ne=m()(Ae,2),ye=Ne[0],be=Ne[1],Ze=(0,_.useState)(""),Ie=m()(Ze,2),Ce=Ie[0],ke=Ie[1],Ee=(0,_.useState)(),Se=m()(Ee,2),Re=Se[0],Pe=Se[1],we=(0,_.useState)(),Oe=m()(we,2),Ue=Oe[0],Fe=Oe[1],Ve=(0,_.useState)(""),Ge=m()(Ve,2),Je=Ge[0],Ke=Ge[1],qe=(0,g.useParams)(),Le=(0,_.useState)([]),Me=m()(Le,2),Te=Me[0],Ye=Me[1];(0,_.useEffect)((function(){return Be(),null!=qe&&qe.pathId?(0,$.Pt)(null==qe?void 0:qe.pathId).then((function(e){var l,n,s,t,i,a,c,r,u,d,m,h,p;0==(null==e?void 0:e.status)&&(Ke(null==e||null===(l=e.core_course)||void 0===l?void 0:l.teacher_id),o.setFieldsValue(null==e?void 0:e.core_course),te([{id:null==e||null===(n=e.core_course)||void 0===n||null===(s=n.pic_url)||void 0===s?void 0:s.pic_id,test:null==e||null===(t=e.core_course)||void 0===t||null===(i=t.pic_url)||void 0===i?void 0:i.url}]),ce([{id:null==e||null===(a=e.core_course)||void 0===a||null===(c=a.background_url)||void 0===c?void 0:c.background_attachment_id,test:null==e||null===(r=e.core_course)||void 0===r||null===(u=r.background_url)||void 0===u?void 0:u.url}]),ge([null==e||null===(d=e.core_course)||void 0===d?void 0:d.school]),null!=e&&null!==(m=e.core_course)&&void 0!==m&&null!==(h=m.company)&&void 0!==h&&h.name&&me([null==e||null===(p=e.core_course)||void 0===p?void 0:p.company]))})):o.setFieldsValue({statistic_type:1}),s({type:"globalSetting/footerToggle",payload:!1}),function(){s({type:"globalSetting/footerToggle",payload:!0})}}),[]);var Be=function(){var e=u()(c()().mark((function e(){var l;return c()().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&&Ye((null==l?void 0:l.domains)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,ne.jsxs)("div",{className:Z,children:[(0,ne.jsx)("div",{className:I,children:(0,ne.jsxs)(v.Z,{labelCol:{flex:"100px"},form:o,scrollToFirstError:!0,colon:!1,children:[(0,ne.jsxs)("div",{className:C,children:[(0,ne.jsx)("div",{className:k}),(0,ne.jsxs)("div",{className:E,children:[null!=qe&&qe.pathId?"编辑":"新建","实验项目"]})]}),(0,ne.jsxs)("div",{className:S,children:[(0,ne.jsx)(v.Z.Item,{className:R,label:"项目名称",colon:!1,name:"name",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,ne.jsx)(x.Z,{size:"large",className:D,placeholder:"请输入项目名称",maxLength:60,showCount:!0})}),(0,ne.jsx)(v.Z.Item,{className:R,label:"项目领域",colon:!1,name:"domain",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,ne.jsx)(j.Z,{size:"large",style:{width:"100%"},options:null==Te?void 0:Te.map((function(e){return{value:e,label:e}})),filterOption:function(e,l){var n,s;return-1!==(null==l||null===(n=l.label)||void 0===n||null===(s=n.toUpperCase())||void 0===s?void 0:s.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&o.setFieldValue("domain",e.substring(0,20))}})}),(0,ne.jsxs)(v.Z.Item,{className:R,label:"项目封面",colon:!1,name:"attachment_id",children:[(0,ne.jsx)(A.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,beforeUpload:function(e){var l="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type;return l||(f.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,W.ZP)("".concat(Q.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){te([e]),o.setFieldsValue({attachment_id:e.id})}))},children:(0,ne.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,ne.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,ne.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传图片"}),(0,ne.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(支持上传jpg/png等格式文件文件大小不能超过2M,建议使用384*214像素;如不上传,默认使用系统图片)"})]})}),(null==h?void 0:h.length)>0&&(0,ne.jsxs)("div",{className:w,children:[(0,ne.jsx)("img",{src:Q.Z.API_SERVER+(null===(l=h[0])||void 0===l?void 0:l.test),className:O}),(0,ne.jsx)("img",{src:H,className:P,onClick:function(){te([])}})]})]}),(0,ne.jsxs)(v.Z.Item,{className:R,label:"顶部背景图",colon:!1,name:"background_attachment_id",children:[(0,ne.jsx)(A.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,fileList:oe,beforeUpload:function(e){var l="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type;return l||(f.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,W.ZP)("".concat(Q.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){ce([e]),o.setFieldsValue({background_attachment_id:e.id})}))},children:(0,ne.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,ne.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,ne.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传文件"}),(0,ne.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(本项非必需。如不上传,则使用系统默认图片;如上传请选择jpg、png格式大小不超过2M建议尺寸1920*240像素)"})]})}),(null==oe?void 0:oe.length)>0&&(0,ne.jsxs)("div",{className:U,children:[(0,ne.jsx)("img",{src:Q.Z.API_SERVER+(null===(n=oe[0])||void 0===n?void 0:n.test),className:O}),(0,ne.jsx)("img",{src:H,className:P,onClick:function(){ce([])}})]})]}),(0,ne.jsx)(v.Z.Item,{className:R,label:"链接",colon:!1,name:"url",children:(0,ne.jsx)(x.Z,{size:"large",className:D,placeholder:"请输入链接"})}),(0,ne.jsx)(v.Z.Item,{className:R,label:"实践平台",colon:!1,name:"company",children:(0,ne.jsx)(x.Z,{className:D,placeholder:"请输入实践平台",maxLength:40,size:"large",showCount:!0})}),(0,ne.jsx)(v.Z.Item,{className:R,label:"课程类型",colon:!1,name:"course_type",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,ne.jsxs)(N.ZP.Group,{children:[(0,ne.jsx)(N.ZP,{value:1,style:{marginRight:30,marginTop:8,color:"#333333"},children:"普通课程"}),(0,ne.jsx)(N.ZP,{value:2,style:{marginRight:30,marginTop:8,color:"#333333"},children:"国家一流"}),(0,ne.jsx)(N.ZP,{value:3,style:{marginRight:30,marginTop:8,color:"#333333"},children:"省级一流"})]})})]})]})}),(0,ne.jsx)("div",{className:F,children:(0,ne.jsxs)("div",{className:V,children:[(0,ne.jsx)(y.ZP,{className:"canclebtn",onClick:function(){"list"==window.location.href.split("comeFrom=")[1]?g.history.push("/paths"):g.history.push("/paths/".concat(null==qe?void 0:qe.pathId))},children:"取消"}),(0,ne.jsx)(y.ZP,{className:"confirmbtn",type:"primary",onClick:function(){(null==h?void 0:h.length)>0&&o.setFieldsValue({attachment_id:h[0].id}),(null==oe?void 0:oe.length)>0&&o.setFieldsValue({background_attachment_id:oe[0].id}),(null==de?void 0:de.length)>0&&o.setFieldsValue({company:de[0].name}),(null==_e?void 0:_e.length)>0&&o.setFieldsValue({school:_e[0].name}),o.validateFields().then((function(){null!=qe&&qe.pathId?(0,$.u1)(a()({teacher_id:Je,id:null==qe?void 0:qe.pathId},o.getFieldsValue())).then((function(e){0==(null==e?void 0:e.status)&&(f.ZP.success("编辑成功"),g.history.go(-1))})):(0,$.E0)(o.getFieldsValue()).then((function(e){0==(null==e?void 0:e.status)&&(f.ZP.success("新增成功"),g.history.push("/paths"))}))}))},children:null!=qe&&qe.pathId?"保存编辑":"确认新建"})]})}),(0,ne.jsxs)(b.Z,{centered:!0,zIndex:200,width:750,title:"选择实验平台",visible:xe,onCancel:function(){je(!1)},footer:(0,ne.jsxs)("div",{className:"modal_list",children:[(0,ne.jsx)("div",{className:"modal_close",onClick:function(){je(!1)},children:"取消"}),(0,ne.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in Re)Re[l].check&&e.push(Re[l]);me(e),o.setFieldsValue({company:e[0].name}),je(!1)},children:"确定"})]}),children:[(0,ne.jsxs)("div",{className:G,children:[(0,ne.jsx)(x.Z,{value:Ce,onChange:function(e){ke(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,ne.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==Re?void 0:Re.length)>0?(0,ne.jsx)("div",{className:J,children:Re.map((function(e,l){return(0,ne.jsxs)("div",{className:null!=e&&e.check?q:K,onClick:function(){Re.map((function(e){e.check=!1})),Re[l].check=!0,Pe(t()(Re))},children:[(0,ne.jsx)("img",{className:L,src:Q.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,ne.jsx)("img",{className:M,src:z})]},l)}))}):(0,ne.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]}),(0,ne.jsxs)(b.Z,{centered:!0,zIndex:200,width:750,title:"选择牵头单位",visible:ye,onCancel:function(){be(!1)},footer:(0,ne.jsxs)("div",{className:"modal_list",children:[(0,ne.jsx)("div",{className:"modal_close",onClick:function(){be(!1)},children:"取消"}),(0,ne.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in Ue)Ue[l].check&&e.push(Ue[l]);ge(e),o.setFieldsValue({school:e[0].name}),be(!1)},children:"确定"})]}),children:[(0,ne.jsxs)("div",{className:G,children:[(0,ne.jsx)(x.Z,{value:Ce,onChange:function(e){ke(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,ne.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==Ue?void 0:Ue.length)>0?(0,ne.jsx)("div",{className:T,children:Ue.map((function(e,l){return(0,ne.jsxs)("div",{className:null!=e&&e.check?B:Y,onClick:function(){Ue.map((function(e){e.check=!1})),Ue[l].check=!0,Fe(t()(Ue))},children:[(0,ne.jsx)("img",{className:L,src:Q.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,ne.jsx)("img",{className:M,src:z})]},l)}))}):(0,ne.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]})]})}))},49288:function(e,l,n){var s=n(94184),t=n.n(s),i=n(37419),a=n(10366),o=n(67294),c=n(8745),r=n(96159),u=n(53124),d=n(96101);const{Option:m}=d.Z;function h(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const p=(e,l)=>{const{prefixCls:n,className:s,popupClassName:c,dropdownClassName:p,children:_,dataSource:g}=e,v=(0,i.Z)(_);let f;1===v.length&&(0,r.l$)(v[0])&&!h(v[0])&&([f]=v);const x=f?()=>f:void 0;let j;j=v.length&&h(v[0])?_:g?g.map((e=>{if((0,r.l$)(e))return e;switch(typeof e){case"string":return o.createElement(m,{key:e,value:e},e);case"object":{const{value:l}=e;return o.createElement(m,{key:l,value:l},e.text)}default:return}})):[];const{getPrefixCls:A}=o.useContext(u.E_),N=A("select",n);return o.createElement(d.Z,Object.assign({ref:l,suffixIcon:null},(0,a.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:N,popupClassName:c||p,className:t()(`${N}-auto-complete`,s),mode:d.Z.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:x}),j)},_=o.forwardRef(p),g=(0,c.Z)(_);_.Option=m,_._InternalPanelDoNotUseOrYouWillBeFired=g,l.Z=_},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=="}}]);