|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[97008],{11636:function(e,t,l){l.r(t),l.d(t,{default:function(){return F}});var n=l(37205),s=l.n(n),i=l(82242),o=l.n(i),a=l(7557),c=l.n(a),r=l(41498),u=l.n(r),d=l(79800),m=l.n(d),_=l(39647),p=l.n(_),h=l(59301),f=l(8785),g=l(78241),x=l(8591),v=l(73782),b=l(88522),j=l(59028),N=l(3113),A=l(43418),C={flex_box_center:"flex_box_center___POF6Z",flex_space_between:"flex_space_between___mAeec",flex_box_vertical_center:"flex_box_vertical_center___bVrJC",flex_box_center_end:"flex_box_center_end___USZOu",flex_box_column:"flex_box_column___KRGc9",wrap:"wrap___t4yCX",bg:"bg___NmucQ",title_style:"title_style___btRf8",line:"line___z14_S",text:"text___Muyeo",fieldWrap:"fieldWrap___x_VVx",form_item:"form_item___EGomW",record_count:"record_count___cmv40",close_style:"close_style___eLHWe",xmfm:"xmfm___UFR6C",img_content:"img_content___EOfmr",dbbjt:"dbbjt___sT_QZ",sjpt_list:"sjpt_list___bLmAo",sjpt:"sjpt___Rzv48",qtdw_list:"qtdw_list___KBjVL",qtdw:"qtdw___IiJnn",footer_style:"footer_style___EJNAj",backgroundFa:"backgroundFa___a4XGg",btn_close:"btn_close___yEwPX",btn_submit:"btn_submit___DqG1K",input_search:"input_search___c0NhF",platform_list:"platform_list___uIkXf",platform_item:"platform_item___AEZJp",platform_item_active:"platform_item_active___DkYN2",img_items:"img_items___RhWee",text_items:"text_items____v4d2",select_img:"select_img___lukzx",unit_list:"unit_list___Zuhvm",unit_item:"unit_item___xqgyx",unit_item_active:"unit_item_active___ppRTX",sjtjItem:"sjtjItem___JS1Em",form_item_item:"form_item_item___2sbbM"},y=l(94334),I=l(43899),S=l(28131),w=l(92911),E=l(16644),O=l(49973),Z=l(69948),k=l(66208),R=l(37712),P=["user","newCourse","globalSetting","loading","dispatch"],F=(0,f.connect)((function(e){var t=e.user,l=e.newCourse,n=e.loading;return{user:t,newCourse:l,globalSetting:e.globalSetting,loading:n.effects}}))((function(e){e.user,e.newCourse,e.globalSetting,e.loading;var t,l,n=e.dispatch,i=(p()(e,P),g.Z.useForm()),a=m()(i,1)[0],r=(0,h.useState)({}),d=m()(r,2),_=(d[0],d[1]),F=(0,h.useState)(),V=m()(F,2),U=V[0],M=V[1],G=(0,h.useState)(),J=m()(G,2),W=J[0],D=J[1],K=(0,h.useState)(),L=m()(K,2),T=L[0],B=L[1],q=(0,h.useState)(),X=m()(q,2),Y=X[0],z=X[1],H=(0,h.useState)(!1),Q=m()(H,2),$=Q[0],ee=Q[1],te=(0,h.useState)(!1),le=m()(te,2),ne=le[0],se=le[1],ie=(0,h.useState)(""),oe=m()(ie,2),ae=oe[0],ce=oe[1],re=(0,h.useState)(),ue=m()(re,2),de=ue[0],me=ue[1],_e=(0,h.useState)(),pe=m()(_e,2),he=pe[0],fe=pe[1],ge=(0,h.useState)(),xe=m()(ge,2),ve=xe[0],be=xe[1],je=(0,f.useParams)(),Ne=(0,h.useState)([]),Ae=m()(Ne,2),Ce=Ae[0],ye=Ae[1],Ie=(0,h.useState)(""),Se=m()(Ie,2),we=Se[0],Ee=Se[1];(0,h.useEffect)((function(){return Oe(),null!=je&&je.shixunsId&&(0,O.Km)(null==je?void 0:je.shixunsId).then((function(e){if(0==(null==e?void 0:e.status)){var t,l,n,s,i,o,c,r,u,d;if(Ee(null==e||null===(t=e.case)||void 0===t?void 0:t.teacher_id),a.setFieldsValue(null==e?void 0:e.case),_(null==e?void 0:e.case),M([{id:null==e||null===(l=e.case)||void 0===l||null===(l=l.pic_url)||void 0===l?void 0:l.pic_id,test:null==e||null===(n=e.case)||void 0===n||null===(n=n.pic_url)||void 0===n?void 0:n.url}]),D([{id:null==e||null===(s=e.case)||void 0===s||null===(s=s.background_url)||void 0===s?void 0:s.background_attachment_id,test:null==e||null===(i=e.case)||void 0===i||null===(i=i.background_url)||void 0===i?void 0:i.url}]),z([null==e||null===(o=e.case)||void 0===o?void 0:o.school]),null!=e&&null!==(c=e.case)&&void 0!==c&&null!==(c=c.company)&&void 0!==c&&c.name)B([null==e||null===(d=e.case)||void 0===d?void 0:d.company]);be([{id:null==e||null===(r=e.case)||void 0===r||null===(r=r.teacher_url)||void 0===r?void 0:r.teacher_attachment_id,test:null==e||null===(u=e.case)||void 0===u||null===(u=u.teacher_url)||void 0===u?void 0:u.url}])}})),n({type:"globalSetting/footerToggle",payload:!1}),function(){n({type:"globalSetting/footerToggle",payload:!0})}}),[]);var Oe=function(){var e=u()(c()().mark((function e(){var t;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.H8)({domain_type:2});case 2:0==(t=e.sent).status&&ye((null==t?void 0:t.domains)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,R.jsxs)("div",{className:C.wrap,children:[(0,R.jsx)("div",{className:C.bg,children:(0,R.jsxs)(g.Z,{labelCol:{flex:"100px"},form:a,className:C.formWrap,scrollToFirstError:!0,colon:!1,onValuesChange:function(){_(a.getFieldsValue())},children:[(0,R.jsxs)("div",{className:C.title_style,children:[(0,R.jsx)("div",{className:C.line}),(0,R.jsxs)("div",{className:C.text,children:[null!=je&&je.shixunsId?"编辑":"新建","实践平台"]})]}),(0,R.jsxs)("div",{className:C.fieldWrap,children:[(0,R.jsx)(g.Z.Item,{className:C.form_item,label:"平台名称",colon:!1,name:"name",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,R.jsx)(v.Z,{className:C.form_item_item,placeholder:"请输入项目名称",maxLength:60,size:"large",showCount:!0})}),(0,R.jsx)(g.Z.Item,{className:C.form_item,label:"案例领域",colon:!1,name:"domain",rules:[{required:!0,message:"必填项:不能为空"}],children:(0,R.jsx)(b.Z,{size:"large",style:{width:"100%"},options:null==Ce?void 0:Ce.map((function(e){return{value:e,label:e}})),filterOption:function(e,t){var l;return-1!==(null==t||null===(l=t.label)||void 0===l||null===(l=l.toUpperCase())||void 0===l?void 0:l.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>20&&a.setFieldValue("domain",e.substring(0,20))}})}),(0,R.jsxs)(g.Z.Item,{className:C.form_item,label:"封面",colon:!1,name:"attachment_id",children:[(0,R.jsx)(j.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type;return t||(x.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var t=new FormData;t.append("file",null==e?void 0:e.file),(0,w.ZP)("".concat(y.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:t},!0).then((function(e){M([e]),a.setFieldsValue({attachment_id:e.id})}))},children:(0,R.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,R.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,R.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传图片"}),(0,R.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(支持上传jpg/png等格式文件,文件大小不能超过2M,建议使用384*214像素;如不上传,默认使用系统图片)"})]})}),(null==U?void 0:U.length)>0&&(0,R.jsxs)("div",{className:C.xmfm,children:[(0,R.jsx)("img",{src:y.Z.API_SERVER+(null===(t=U[0])||void 0===t?void 0:t.test),className:C.img_content}),(0,R.jsx)("img",{src:I,className:C.close_style,onClick:function(){M([])}})]})]}),(0,R.jsxs)(g.Z.Item,{className:C.form_item,label:"顶部背景图",colon:!1,name:"background_attachment_id",children:[(0,R.jsx)(j.Z,{action:"",accept:"image/*",withCredentials:!0,showUploadList:!1,fileList:W,beforeUpload:function(e){var t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type;return t||(x.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),Promise.reject())},customRequest:function(e){var t=new FormData;t.append("file",null==e?void 0:e.file),(0,w.ZP)("".concat(y.Z.API_SERVER,"/api/attachments.json"),{method:"post",body:t},!0).then((function(e){D([e]),a.setFieldsValue({background_attachment_id:e.id})}))},children:(0,R.jsxs)("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:[(0,R.jsx)(k.op,{style:{borderRadius:"2px"},icon:(0,R.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传文件"}),(0,R.jsx)("span",{style:{color:"#999999",pointerEvents:"none",marginLeft:20},children:"(本项非必需。如不上传,则使用系统默认图片;如上传,请选择jpg、png格式,大小不超过2M,建议尺寸1920*240像素)"})]})}),(null==W?void 0:W.length)>0&&(0,R.jsxs)("div",{className:C.dbbjt,children:[(0,R.jsx)("img",{src:y.Z.API_SERVER+(null===(l=W[0])||void 0===l?void 0:l.test),className:C.img_content}),(0,R.jsx)("img",{src:I,className:C.close_style,onClick:function(){D([])}})]})]}),(0,R.jsx)(g.Z.Item,{className:C.form_item,label:"链接",colon:!1,name:"url",children:(0,R.jsx)(v.Z,{className:C.form_item_item,placeholder:"请输入链接",size:"large"})}),(0,R.jsx)(g.Z.Item,{className:C.form_item,label:"实践平台",colon:!1,name:"company",children:(0,R.jsx)(v.Z,{className:C.form_item_item,placeholder:"请输入实践平台",maxLength:60,size:"large",showCount:!0})})]})]})}),(0,R.jsx)("div",{className:C.footer_style,children:(0,R.jsxs)("div",{className:C.backgroundFa,children:[(0,R.jsx)(N.ZP,{className:"canclebtn",onClick:function(){"list"==window.location.href.split("comeFrom=")[1]?f.history.push("/shixuns"):f.history.push("/shixuns/".concat(null==je?void 0:je.shixunsId))},children:"取消"}),(0,R.jsx)(N.ZP,{className:"confirmbtn",type:"primary",onClick:function(){(null==U?void 0:U.length)>0&&a.setFieldsValue({attachment_id:U[0].id}),(null==W?void 0:W.length)>0&&a.setFieldsValue({background_attachment_id:W[0].id}),(null==T?void 0:T.length)>0&&a.setFieldsValue({company:T[0].name}),(null==Y?void 0:Y.length)>0&&a.setFieldsValue({school:Y[0].name}),(null==ve?void 0:ve.length)>0&&a.setFieldsValue({teacher_attachment_id:ve[0].id}),a.validateFields().then((function(){null!=je&&je.shixunsId?(0,O.j3)(o()({teacher_id:we,id:null==je?void 0:je.shixunsId},a.getFieldsValue())).then((function(e){0==(null==e?void 0:e.status)&&(x.ZP.success("编辑成功"),f.history.go(-1))})):(0,O.c6)(a.getFieldsValue()).then((function(e){0==(null==e?void 0:e.status)&&(x.ZP.success("新增成功"),f.history.push("/shixuns"))}))}))},children:null!=je&&je.shixunsId?"保存编辑":"确认新建"})]})}),(0,R.jsxs)(A.Z,{centered:!0,zIndex:200,width:750,title:"选择实验平台",visible:$,onCancel:function(){ee(!1)},footer:(0,R.jsxs)("div",{className:"modal_list",children:[(0,R.jsx)("div",{className:"modal_close",onClick:function(){ee(!1)},children:"取消"}),(0,R.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var t in de)de[t].check&&e.push(de[t]);B(e),a.setFieldsValue({company:e[0].name}),ee(!1)},children:"确定"})]}),children:[(0,R.jsxs)("div",{className:C.input_search,children:[(0,R.jsx)(v.Z,{value:ae,onChange:function(e){ce(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,R.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==de?void 0:de.length)>0?(0,R.jsx)("div",{className:C.platform_list,children:de.map((function(e,t){return(0,R.jsxs)("div",{className:null!=e&&e.check?C.platform_item_active:C.platform_item,onClick:function(){de.map((function(e){e.check=!1})),de[t].check=!0,me(s()(de))},children:[(0,R.jsx)("img",{className:C.img_items,src:y.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,R.jsx)("img",{className:C.select_img,src:S})]},t)}))}):(0,R.jsx)(E.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]}),(0,R.jsxs)(A.Z,{centered:!0,zIndex:200,width:750,title:"选择牵头单位",visible:ne,onCancel:function(){se(!1)},footer:(0,R.jsxs)("div",{className:"modal_list",children:[(0,R.jsx)("div",{className:"modal_close",onClick:function(){se(!1)},children:"取消"}),(0,R.jsx)("div",{className:"modal_sumbit",onClick:function(){var e=[];for(var t in he)he[t].check&&e.push(he[t]);z(e),a.setFieldsValue({school:e[0].name}),se(!1)},children:"确定"})]}),children:[(0,R.jsxs)("div",{className:C.input_search,children:[(0,R.jsx)(v.Z,{value:ae,onChange:function(e){ce(e.target.value)},placeholder:"请输入平台名称进行搜索"}),(0,R.jsx)("i",{className:"iconfont icon-sousuo9 font14 pl10 current"})]}),(null==he?void 0:he.length)>0?(0,R.jsx)("div",{className:C.unit_list,children:he.map((function(e,t){return(0,R.jsxs)("div",{className:null!=e&&e.check?C.unit_item_active:C.unit_item,onClick:function(){he.map((function(e){e.check=!1})),he[t].check=!0,fe(s()(he))},children:[(0,R.jsx)("img",{className:C.img_items,src:y.Z.IMG_SERVER+(null==e?void 0:e.pic_url)}),(null==e?void 0:e.check)&&(0,R.jsx)("img",{className:C.select_img,src:S})]},t)}))}):(0,R.jsx)(E.Z,{customText:"暂无数据",styles:{padding:"100px 0"}})]})]})}))},88522:function(e,t,l){var n=l(92310),s=l.n(n),i=l(75440),o=l(55405),a=l(59301),c=l(53487),r=l(92343),u=l(36355),d=l(57809);const{Option:m}=d.default;function _(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const p=(e,t)=>{const{prefixCls:l,className:n,popupClassName:c,dropdownClassName:p,children:h,dataSource:f}=e,g=(0,i.Z)(h);let x;1===g.length&&(0,r.l$)(g[0])&&!_(g[0])&&([x]=g);const v=x?()=>x:void 0;let b;b=g.length&&_(g[0])?h:f?f.map((e=>{if((0,r.l$)(e))return e;switch(typeof e){case"string":return a.createElement(m,{key:e,value:e},e);case"object":{const{value:t}=e;return a.createElement(m,{key:t,value:t},e.text)}default:return}})):[];const{getPrefixCls:j}=a.useContext(u.E_),N=j("select",l);return a.createElement(d.default,Object.assign({ref:t,suffixIcon:null},(0,o.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:N,popupClassName:c||p,className:s()(`${N}-auto-complete`,n),mode:d.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:v}),b)},h=a.forwardRef(p),f=(0,c.Z)(h);h.Option=m,h._InternalPanelDoNotUseOrYouWillBeFired=f,t.Z=h},57809:function(e,t,l){var n=l(92310),s=l.n(n),i=l(77861),o=l(55405),a=l(59301),c=l(53487),r=l(62892),u=l(19080),d=l(36355),m=l(1684),_=l(93891),p=l(19716),h=l(32441),f=l(33234),g=l(14154),x=l(58582),v=l(84443),b=l(66339),j=function(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(l[n[s]]=e[n[s]])}return l};const N="SECRET_COMBOBOX_MODE_DO_NOT_USE",A=(e,t)=>{var l,{prefixCls:n,bordered:c=!0,className:A,rootClassName:C,getPopupContainer:y,popupClassName:I,dropdownClassName:S,listHeight:w=256,placement:E,listItemHeight:O=24,size:Z,disabled:k,notFoundContent:R,status:P,builtinPlacements:F,dropdownMatchSelectWidth:V,popupMatchSelectWidth:U,direction:M,style:G,allowClear:J}=e,W=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:D,getPrefixCls:K,renderEmpty:L,direction:T,virtual:B,popupMatchSelectWidth:q,popupOverflow:X,select:Y}=a.useContext(d.E_),z=K("select",n),H=K(),Q=null!=M?M:T,{compactSize:$,compactItemClassnames:ee}=(0,f.ri)(z,Q),[te,le]=(0,g.Z)(z),ne=a.useMemo((()=>{const{mode:e}=W;if("combobox"!==e)return e===N?"combobox":e}),[W.mode]),se="multiple"===ne||"tags"===ne,ie=(0,v.Z)(W.suffixIcon,W.showArrow),oe=null!==(l=null!=U?U:V)&&void 0!==l?l:q,{status:ae,hasFeedback:ce,isFormItemInput:re,feedbackIcon:ue}=a.useContext(h.aM),de=(0,u.F)(ae,P);let me;me=void 0!==R?R:"combobox"===ne?null:(null==L?void 0:L("Select"))||a.createElement(_.Z,{componentName:"Select"});const{suffixIcon:_e,itemIcon:pe,removeIcon:he,clearIcon:fe}=(0,b.Z)(Object.assign(Object.assign({},W),{multiple:se,hasFeedback:ce,feedbackIcon:ue,showSuffixIcon:ie,prefixCls:z,showArrow:W.showArrow,componentName:"Select"})),ge=!0===J?{clearIcon:fe}:J,xe=(0,o.Z)(W,["suffixIcon","itemIcon"]),ve=s()(I||S,{[`${z}-dropdown-${Q}`]:"rtl"===Q},C,le),be=(0,p.Z)((e=>{var t;return null!==(t=null!=Z?Z:$)&&void 0!==t?t:e})),je=a.useContext(m.Z),Ne=null!=k?k:je,Ae=s()({[`${z}-lg`]:"large"===be,[`${z}-sm`]:"small"===be,[`${z}-rtl`]:"rtl"===Q,[`${z}-borderless`]:!c,[`${z}-in-form-item`]:re},(0,u.Z)(z,de,ce),ee,null==Y?void 0:Y.className,A,C,le),Ce=a.useMemo((()=>void 0!==E?E:"rtl"===Q?"bottomRight":"bottomLeft"),[E,Q]),ye=(0,x.Z)(F,X);return te(a.createElement(i.ZP,Object.assign({ref:t,virtual:B,showSearch:null==Y?void 0:Y.showSearch},xe,{style:Object.assign(Object.assign({},null==Y?void 0:Y.style),G),dropdownMatchSelectWidth:oe,builtinPlacements:ye,transitionName:(0,r.m)(H,"slide-up",W.transitionName),listHeight:w,listItemHeight:O,mode:ne,prefixCls:z,placement:Ce,direction:Q,suffixIcon:_e,menuItemSelectedIcon:pe,removeIcon:he,allowClear:ge,notFoundContent:me,className:Ae,getPopupContainer:y||D,dropdownClassName:ve,disabled:Ne})))};const C=a.forwardRef(A),y=(0,c.Z)(C);C.SECRET_COMBOBOX_MODE_DO_NOT_USE=N,C.Option=i.Wx,C.OptGroup=i.Xo,C._InternalPanelDoNotUseOrYouWillBeFired=y,t.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=="}}]); |