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
16 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],{75055:function(e,l,t){t.r(l),t.d(l,{default:function(){return se}});var n=t(37205),s=t.n(n),o=t(82242),a=t.n(o),i=t(7557),c=t.n(i),r=t(41498),u=t.n(r),d=t(79800),m=t.n(d),p=t(39647),h=t.n(p),g=t(59301),f=t(49389),_=t(78241),v=t(8591),x=t(10249),j=t(88522),N=t(54580),b=t(5112),A=t(3113),C=t(43418),y="wrap___HeK2P",I="bg____raBL",S="title_style___qY3gq",O="line___OUqEe",Z="text___V9Ft_",E="fieldWrap___pR4UB",w="form_item___q7FNm",P="close_style___MwGvu",k="xmfm___lq9HQ",R="img_content___jqYOm",F="dbbjt___dUU2F",U="footer_style___niiiI",M="backgroundFa___ghlCO",V="input_search___uH23W",G="platform_list___PMbN5",B="platform_item___aPIfB",D="platform_item_active___X42Cx",J="img_items___h1cUv",T="select_img___oQ3Du",H="unit_list___sZ0gb",K="unit_item___jVQNB",L="unit_item_active___jz6KJ",q="form_item_item___tHIHe",W=t(91689),Y=t(43899),Q=t(28131),z=t(94171),X=t(13767),$=t(54413),ee=t(940),le=t(93298),te=t(37712),ne=["user","newCourse","globalSetting","loading","dispatch"],se=(0,f.connect)((function(e){var l=e.user,t=e.newCourse,n=e.loading;return{user:l,newCourse:t,globalSetting:e.globalSetting,loading:n.effects}}))((function(e){e.user,e.newCourse,e.globalSetting,e.loading;var l,t,n=e.dispatch,o=(h()(e,ne),_.Z.useForm()),i=m()(o,1)[0],r=(0,g.useState)(),d=m()(r,2),p=d[0],se=d[1],oe=(0,g.useState)(),ae=m()(oe,2),ie=ae[0],ce=ae[1],re=(0,g.useState)(),ue=m()(re,2),de=ue[0],me=ue[1],pe=(0,g.useState)(),he=m()(pe,2),ge=he[0],fe=he[1],_e=(0,g.useState)(!1),ve=m()(_e,2),xe=ve[0],je=ve[1],Ne=(0,g.useState)(!1),be=m()(Ne,2),Ae=be[0],Ce=be[1],ye=(0,g.useState)(""),Ie=m()(ye,2),Se=Ie[0],Oe=Ie[1],Ze=(0,g.useState)(),Ee=m()(Ze,2),we=Ee[0],Pe=Ee[1],ke=(0,g.useState)(),Re=m()(ke,2),Fe=Re[0],Ue=Re[1],Me=(0,g.useState)(""),Ve=m()(Me,2),Ge=Ve[0],Be=Ve[1],De=(0,f.useParams)(),Je=(0,g.useState)([]),Te=m()(Je,2),He=Te[0],Ke=Te[1];(0,g.useEffect)((function(){return Le(),null!=De&&De.pathId?(0,$.Pt)(null==De?void 0:De.pathId).then((function(e){var l,t,n,s,o,a,c,r;0==(null==e?void 0:e.status)&&(Be(null==e||null===(l=e.core_course)||void 0===l?void 0:l.teacher_id),i.setFieldsValue(null==e?void 0:e.core_course),se([{id:null==e||null===(t=e.core_course)||void 0===t||null===(t=t.pic_url)||void 0===t?void 0:t.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}]),ce([{id:null==e||null===(s=e.core_course)||void 0===s||null===(s=s.background_url)||void 0===s?void 0:s.background_attachment_id,test:null==e||null===(o=e.core_course)||void 0===o||null===(o=o.background_url)||void 0===o?void 0:o.url}]),fe([null==e||null===(a=e.core_course)||void 0===a?void 0:a.school]),null!=e&&null!==(c=e.core_course)&&void 0!==c&&null!==(c=c.company)&&void 0!==c&&c.name&&me([null==e||null===(r=e.core_course)||void 0===r?void 0:r.company]))})):i.setFieldsValue({statistic_type:1}),n({type:"globalSetting/footerToggle",payload:!1}),function(){n({type:"globalSetting/footerToggle",payload:!0})}}),[]);var Le=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&&Ke((null==l?void 0:l.domains)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,te.jsxs)("div",{className:y,children:[(0,te.jsx)("div",{className:I,children:(0,te.jsxs)(_.Z,{labelCol:{flex:"100px"},form:i,scrollToFirstError:!0,colon:!1,children:[(0,te.jsxs)("div",{className:S,children:[(0,te.jsx)("div",{className:O}),(0,te.jsxs)("div",{className:Z,children:[null!=De&&De.pathId?"编辑":"新建","实验项目"]})]}),(0,te.jsxs)("div",{className:E,children:[(0,te.jsx)(_.Z.Item,{className:w,label:"项目名称",colon:!1,name:"name",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,te.jsx)(x.Z,{size:"large",className:q,placeholder:"请输入项目名称",maxLength:60,showCount:!0})}),(0,te.jsx)(_.Z.Item,{className:w,label:"项目领域",colon:!1,name:"domain",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,te.jsx)(j.Z,{size:"large",style:{width:"100%"},options:null==He?void 0:He.map((function(e){return{value:e,label:e}})),filterOption:function(e,l){var t;return-1!==(null==l||null===(t=l.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&i.setFieldValue("domain",e.substring(0,20))}})}),(0,te.jsxs)(_.Z.Item,{className:w,label:"项目封面",colon:!1,name:"attachment_id",children:[(0,te.jsx)(N.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||(v.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,z.ZP)("".concat(W.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){se([e]),i.setFieldsValue({attachment_id:e.id})}))},children:(0,te.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,te.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,te.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传图片"}),(0,te.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(支持上传jpg/png等格式文件文件大小不能超过2M,建议使用384*214像素;如不上传,默认使用系统图片)"})]})}),(null==p?void 0:p.length)>0&&(0,te.jsxs)("div",{className:k,children:[(0,te.jsx)("img",{src:W.Z.API_SERVER+(null===(l=p[0])||void 0===l?void 0:l.test),className:R}),(0,te.jsx)("img",{src:Y,className:P,onClick:function(){se([])}})]})]}),(0,te.jsxs)(_.Z.Item,{className:w,label:"顶部背景图",colon:!1,name:"background_attachment_id",children:[(0,te.jsx)(N.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,fileList:ie,beforeUpload:function(e){var l="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type;return l||(v.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var l=new FormData;l.append("file",null==e?void 0:e.file),(0,z.ZP)("".concat(W.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:l},!0).then((function(e){ce([e]),i.setFieldsValue({background_attachment_id:e.id})}))},children:(0,te.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,te.jsx)(ee.op,{style:{borderRadius:"2px"},icon:(0,te.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传文件"}),(0,te.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(本项非必需。如不上传,则使用系统默认图片;如上传请选择jpg、png格式大小不超过2M建议尺寸1920*240像素)"})]})}),(null==ie?void 0:ie.length)>0&&(0,te.jsxs)("div",{className:F,children:[(0,te.jsx)("img",{src:W.Z.API_SERVER+(null===(t=ie[0])||void 0===t?void 0:t.test),className:R}),(0,te.jsx)("img",{src:Y,className:P,onClick:function(){ce([])}})]})]}),(0,te.jsx)(_.Z.Item,{className:w,label:"链接",colon:!1,name:"url",children:(0,te.jsx)(x.Z,{size:"large",className:q,placeholder:"请输入链接"})}),(0,te.jsx)(_.Z.Item,{className:w,label:"实践平台",colon:!1,name:"company",children:(0,te.jsx)(x.Z,{className:q,placeholder:"请输入实践平台",maxLength:40,size:"large",showCount:!0})}),(0,te.jsx)(_.Z.Item,{className:w,label:"课程类型",colon:!1,name:"course_type",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,te.jsxs)(b.ZP.Group,{children:[(0,te.jsx)(b.ZP,{value:1,style:{marginRight:30,marginTop:8,color:"#333333"},children:"普通课程"}),(0,te.jsx)(b.ZP,{value:2,style:{marginRight:30,marginTop:8,color:"#333333"},children:"国家一流"}),(0,te.jsx)(b.ZP,{value:3,style:{marginRight:30,marginTop:8,color:"#333333"},children:"省级一流"})]})})]})]})}),(0,te.jsx)("div",{className:U,children:(0,te.jsxs)("div",{className:M,children:[(0,te.jsx)(A.ZP,{className:"canclebtn",onClick:function(){"list"==window.location.href.split("comeFrom=")[1]?f.history.push("/paths"):f.history.push("/paths/".concat(null==De?void 0:De.pathId))},children:"取消"}),(0,te.jsx)(A.ZP,{className:"confirmbtn",type:"primary",onClick:function(){(null==p?void 0:p.length)>0&&i.setFieldsValue({attachment_id:p[0].id}),(null==ie?void 0:ie.length)>0&&i.setFieldsValue({background_attachment_id:ie[0].id}),(null==de?void 0:de.length)>0&&i.setFieldsValue({company:de[0].name}),(null==ge?void 0:ge.length)>0&&i.setFieldsValue({school:ge[0].name}),i.validateFields().then((function(){null!=De&&De.pathId?(0,$.u1)(a()({teacher_id:Ge,id:null==De?void 0:De.pathId},i.getFieldsValue())).then((function(e){0==(null==e?void 0:e.status)&&(v.ZP.success("编辑成功"),f.history.go(-1))})):(0,$.E0)(i.getFieldsValue()).then((function(e){0==(null==e?void 0:e.status)&&(v.ZP.success("新增成功"),f.history.push("/paths"))}))}))},children:null!=De&&De.pathId?"保存编辑":"确认新建"})]})}),(0,te.jsxs)(C.Z,{centered:!0,zIndex:200,width:750,title:"选择实验平台",visible:xe,onCancel:function(){je(!1)},footer:(0,te.jsxs)("div",{className:"modal_list",children:[(0,te.jsx)("div",{className:"modal_close",onClick:function(){je(!1)},children:"取消"}),(0,te.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in we)we[l].check&&e.push(we[l]);me(e),i.setFieldsValue({company:e[0].name}),je(!1)},children:"确定"})]}),children:[(0,te.jsxs)("div",{className:V,children:[(0,te.jsx)(x.Z,{value:Se,onChange:function(e){Oe(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,te.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==we?void 0:we.length)>0?(0,te.jsx)("div",{className:G,children:we.map((function(e,l){return(0,te.jsxs)("div",{className:null!=e&&e.check?D:B,onClick:function(){we.map((function(e){e.check=!1})),we[l].check=!0,Pe(s()(we))},children:[(0,te.jsx)("img",{className:J,src:W.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,te.jsx)("img",{className:T,src:Q})]},l)}))}):(0,te.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]}),(0,te.jsxs)(C.Z,{centered:!0,zIndex:200,width:750,title:"选择牵头单位",visible:Ae,onCancel:function(){Ce(!1)},footer:(0,te.jsxs)("div",{className:"modal_list",children:[(0,te.jsx)("div",{className:"modal_close",onClick:function(){Ce(!1)},children:"取消"}),(0,te.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var l in Fe)Fe[l].check&&e.push(Fe[l]);fe(e),i.setFieldsValue({school:e[0].name}),Ce(!1)},children:"确定"})]}),children:[(0,te.jsxs)("div",{className:V,children:[(0,te.jsx)(x.Z,{value:Se,onChange:function(e){Oe(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,te.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==Fe?void 0:Fe.length)>0?(0,te.jsx)("div",{className:H,children:Fe.map((function(e,l){return(0,te.jsxs)("div",{className:null!=e&&e.check?L:K,onClick:function(){Fe.map((function(e){e.check=!1})),Fe[l].check=!0,Ue(s()(Fe))},children:[(0,te.jsx)("img",{className:J,src:W.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,te.jsx)("img",{className:T,src:Q})]},l)}))}):(0,te.jsx)(X.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]})]})}))},88522:function(e,l,t){var n=t(92310),s=t.n(n),o=t(11592),a=t(2738),i=t(59301),c=t(53487),r=t(92343),u=t(36355),d=t(57809);const{Option:m}=d.default;function p(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const h=(e,l)=>{const{prefixCls:t,className:n,popupClassName:c,dropdownClassName:h,children:g,dataSource:f}=e,_=(0,o.Z)(g);let v;1===_.length&&(0,r.l$)(_[0])&&!p(_[0])&&([v]=_);const x=v?()=>v:void 0;let j;j=_.length&&p(_[0])?g:f?f.map((e=>{if((0,r.l$)(e))return e;switch(typeof e){case"string":return i.createElement(m,{key:e,value:e},e);case"object":{const{value:l}=e;return i.createElement(m,{key:l,value:l},e.text)}default:return}})):[];const{getPrefixCls:N}=i.useContext(u.E_),b=N("select",t);return i.createElement(d.default,Object.assign({ref:l,suffixIcon:null},(0,a.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:b,popupClassName:c||h,className:s()(`${b}-auto-complete`,n),mode:d.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:x}),j)},g=i.forwardRef(h),f=(0,c.Z)(g);g.Option=m,g._InternalPanelDoNotUseOrYouWillBeFired=f,l.Z=g},57809:function(e,l,t){var n=t(92310),s=t.n(n),o=t(77861),a=t(2738),i=t(59301),c=t(53487),r=t(62892),u=t(19080),d=t(36355),m=t(1684),p=t(93891),h=t(19716),g=t(32441),f=t(33234),_=t(14154),v=t(58582),x=t(84443),j=t(66339),N=function(e,l){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)l.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(t[n[s]]=e[n[s]])}return t};const b="SECRET_COMBOBOX_MODE_DO_NOT_USE",A=(e,l)=>{var t,{prefixCls:n,bordered:c=!0,className:A,rootClassName:C,getPopupContainer:y,popupClassName:I,dropdownClassName:S,listHeight:O=256,placement:Z,listItemHeight:E=24,size:w,disabled:P,notFoundContent:k,status:R,builtinPlacements:F,dropdownMatchSelectWidth:U,popupMatchSelectWidth:M,direction:V,style:G,allowClear:B}=e,D=N(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:J,getPrefixCls:T,renderEmpty:H,direction:K,virtual:L,popupMatchSelectWidth:q,popupOverflow:W,select:Y}=i.useContext(d.E_),Q=T("select",n),z=T(),X=null!=V?V:K,{compactSize:$,compactItemClassnames:ee}=(0,f.ri)(Q,X),[le,te]=(0,_.Z)(Q),ne=i.useMemo((()=>{const{mode:e}=D;if("combobox"!==e)return e===b?"combobox":e}),[D.mode]),se="multiple"===ne||"tags"===ne,oe=(0,x.Z)(D.suffixIcon,D.showArrow),ae=null!==(t=null!=M?M:U)&&void 0!==t?t:q,{status:ie,hasFeedback:ce,isFormItemInput:re,feedbackIcon:ue}=i.useContext(g.aM),de=(0,u.F)(ie,R);let me;me=void 0!==k?k:"combobox"===ne?null:(null==H?void 0:H("Select"))||i.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:he,removeIcon:ge,clearIcon:fe}=(0,j.Z)(Object.assign(Object.assign({},D),{multiple:se,hasFeedback:ce,feedbackIcon:ue,showSuffixIcon:oe,prefixCls:Q,showArrow:D.showArrow,componentName:"Select"})),_e=!0===B?{clearIcon:fe}:B,ve=(0,a.Z)(D,["suffixIcon","itemIcon"]),xe=s()(I||S,{[`${Q}-dropdown-${X}`]:"rtl"===X},C,te),je=(0,h.Z)((e=>{var l;return null!==(l=null!=w?w:$)&&void 0!==l?l:e})),Ne=i.useContext(m.Z),be=null!=P?P:Ne,Ae=s()({[`${Q}-lg`]:"large"===je,[`${Q}-sm`]:"small"===je,[`${Q}-rtl`]:"rtl"===X,[`${Q}-borderless`]:!c,[`${Q}-in-form-item`]:re},(0,u.Z)(Q,de,ce),ee,null==Y?void 0:Y.className,A,C,te),Ce=i.useMemo((()=>void 0!==Z?Z:"rtl"===X?"bottomRight":"bottomLeft"),[Z,X]),ye=(0,v.Z)(F,W);return le(i.createElement(o.ZP,Object.assign({ref:l,virtual:L,showSearch:null==Y?void 0:Y.showSearch},ve,{style:Object.assign(Object.assign({},null==Y?void 0:Y.style),G),dropdownMatchSelectWidth:ae,builtinPlacements:ye,transitionName:(0,r.m)(z,"slide-up",D.transitionName),listHeight:O,listItemHeight:E,mode:ne,prefixCls:Q,placement:Ce,direction:X,suffixIcon:pe,menuItemSelectedIcon:he,removeIcon:ge,allowClear:_e,notFoundContent:me,className:Ae,getPopupContainer:y||J,dropdownClassName:xe,disabled:be})))};const C=i.forwardRef(A),y=(0,c.Z)(C);C.SECRET_COMBOBOX_MODE_DO_NOT_USE=b,C.Option=o.Wx,C.OptGroup=o.Xo,C._InternalPanelDoNotUseOrYouWillBeFired=y,l.default=C},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=="}}]);