From 930db666e682e92fcbd957c0ac071314cac02358 Mon Sep 17 00:00:00 2001 From: eduauto Date: Fri, 5 Jul 2024 14:32:05 +0800 Subject: [PATCH] autoUpdataFile --- p__Textbook__Detail__index.async.js | 2 +- p__Textbook__Index__index.async.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p__Textbook__Detail__index.async.js b/p__Textbook__Detail__index.async.js index e906d301b4..9d893be5ec 100644 --- a/p__Textbook__Detail__index.async.js +++ b/p__Textbook__Detail__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25713],{93370:function(e,n,t){t.d(n,{Z:function(){return v}});var a=t(82242),s=t.n(a),r=t(7557),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(84686),p=t(91203),f=t(87167),_=(t(6234),{editor_css:"editor_css___cm3Z8"}),h=t(37712),v=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,a=e.style,r=e.user,l=e.placeholder,c=2097152,f=(0,d.useRef)(null),v=(0,d.useState)(null),x=u()(v,2),b=x[0],g=x[1],j=(0,d.useState)(""),C=u()(j,2),w=C[0],Z=C[1];(0,d.useEffect)((function(){Z(n)}),[n]),(0,d.useEffect)((function(){t(w)}),[w]);var S={placeholder:l||"请输入内容...",MENU_CONF:{}};S.MENU_CONF.uploadImage={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(a=new FormData).append("file",e),t.next=4,(0,p.ZP)("/api/attachments.json",{method:"post",body:a},!0);case 4:s=t.sent,n(null==s?void 0:s.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},S.MENU_CONF.uploadVideo={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s,l,i,u,d,m,_,h,v,x,b,g,j;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.size,s=Math.ceil(a/c),t.prev=2,t.next=5,(0,p.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:s,user_id:null==r||null===(l=r.userInfo)||void 0===l?void 0:l.user_id}});case 5:if(0===(null==(u=t.sent)?void 0:u.status)){t.next=8;break}throw new Error;case 8:d=u.upload_id,f.current=new AbortController,m=[],0,_=o()().mark((function n(){var t,s,r,l;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=h*c,s=Math.min(t+c,a),r=e.slice(t,s),(l=new FormData).append("chunk",r),l.append("fileName",e.name),l.append("chunkIndex",(h+1).toString()),l.append("uploadId",d),m.push((function(){return(0,p.ZP)("/api/attachments/multipart_upload",{method:"POST",body:l,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),h=0;case 14:if(!(h0)){t.next=29;break}return t.next=27,Promise.all(g);case 27:t.sent,v+=x;case 29:t.next=22;break;case 31:return t.next=33,(0,p.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:s,uploadId:d,user_id:null==r||null===(i=r.userInfo)||void 0===i?void 0:i.user_id}});case 33:j=t.sent,n(null==j?void 0:j.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}};return(0,d.useEffect)((function(){return function(){null!=b&&(b.destroy(),g(null))}}),[b]),(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",{className:null==_?void 0:_.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,h.jsx)(m.o,{editor:b,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,h.jsx)(m.M,{defaultConfig:S,value:w,onCreated:g,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^

]+>/g,"").replace(/<[

$]+>/g,"").replace(/ /gi,"").replace(/<[^
]+>/g,"")))?Z(e.getHtml()):Z("")},mode:"default",style:s()({height:"500px",overflowY:"hidden"},a)})]})})}))},4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),s=t.n(a),r=t(41498),o=t.n(r),l=t(82242),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(78241),p=t(8591),f=t(43418),_=t(98135),h=t(88522),v=t(84291),x=t(46651),b=t(87167),g=t(91203),j=t(99232),C=t.n(j),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},Z=t(46165),S=t(44394),N=t(97650),y=t(47192),k=t(37712),I=(0,b.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,r=e.onCancel,l=e.title,c=void 0===l?"":l,b=e.coreCurriculum,j=(e.dispatch,b.CoreSubjects,m.Z.useForm()),I=u()(j,1)[0],O=(0,d.useState)(!1),P=u()(O,2),E=P[0],M=P[1],F=(0,d.useState)([]),V=u()(F,2),R=V[0],T=V[1],D=(0,d.useState)(!1),B=u()(D,2),U=B[0],L=B[1],Y=(0,d.useState)([]),W=u()(Y,2),H=W[0],$=W[1],q=(0,d.useState)([]),z=u()(q,2),A=z[0],Q=z[1];(0,d.useEffect)((function(){if(t&&G(),null!=t&&t.id){var e,n;I.setFieldsValue(i()(i()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:C()(null==t?void 0:t.publication_time)}));var a=[i()(i()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];T(a)}}),[t]);var X,G=function(){var e=o()(s()().mark((function e(){var n,t,a,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_core_subject:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&Q(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&$(null==a||null===(r=a.data)||void 0===r?void 0:r.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=o()(s()().mark((function e(n){var t,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M(!0),r=i()(i()({},n),{},{attachment_id:(null==R||null===(t=R[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(r);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(f.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){r()},confirmLoading:E,okButtonProps:{disabled:U},width:686,afterClose:function(){M(!1),T([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:Z.Z.CustomCss,children:(0,k.jsxs)(m.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:J,className:w.form,children:[(0,k.jsx)(m.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(_.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(m.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==A?void 0:A.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==H?void 0:H.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(m.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(m.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(v.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(m.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(_.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(m.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=R&&null!==(n=R[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==R||null===(X=R[0])||void 0===X||null===(X=X.response)||void 0===X?void 0:X.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(N.Z,{onClick:function(){T([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(x.Z,{fileList:R,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&L(!0),"done"===n.file.status&&L(!1),T(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){T([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(p.ZP.info("文件大小必须小于2MB"),Promise.reject()):(T([]),!0):(p.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(y.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},80946:function(e,n,t){t.r(n),t.d(n,{default:function(){return M}});var a=t(7557),s=t.n(a),r=t(82242),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(43418),p=t(8591),f=t(91203),_="wrap___ieM1S",h="editor___EZPNQ",v="btns___shpJD",x="list___LE_2Q",b="left___rPWHk",g="right___LDk76",j="title___XNk6p",C=t(34654),w=t(4090),Z=t(44394),S=t(47192),N=t(93370),y=t(46165),k=t(87167),I=t(14477),O=t(99232),P=t.n(O),E=t(37712),M=(0,k.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n,user:e.user}}))((function(e){e.globalSetting,e.dispatch;var n=e.user,t=e.virtualSpaces,a=(0,k.useParams)().id,r=(0,d.useState)("description"),l=u()(r,2),c=l[0],O=l[1],M=(0,d.useState)({}),F=u()(M,2),V=F[0],R=F[1],T=(0,d.useState)(!0),D=u()(T,2),B=(D[0],D[1]),U=(0,d.useState)(!1),L=u()(U,2),Y=L[0],W=L[1],H=(0,d.useState)(""),$=u()(H,2),q=$[0],z=$[1],A=(0,d.useState)(""),Q=u()(A,2),X=Q[0],G=Q[1],J=(0,d.useRef)(""),K=(0,d.useState)(!1),ee=u()(K,2),ne=ee[0],te=ee[1],ae=(0,d.useState)(!1),se=u()(ae,2),re=se[0],oe=se[1],le=(t.virtualSpacesDetails,V.name),ie=V.attachment,ce=V.author,ue=V.publisher,de=V.number,me=V.publication_time,pe=V.material_type;(0,d.useEffect)((function(){_e()}),[a]),(0,d.useEffect)((function(){he()}),[c]);var fe=function(e){var t;return(0,I.ES)()||(null==n||null===(t=n.userInfo)||void 0===t?void 0:t.user_id)===e},_e=function(){var e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"get"});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&R(o()({},null==n?void 0:n.data)),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i()(s()().mark((function e(){var n,t,r,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,"/show_desc.json"),{method:"get",params:{column:c}});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&(z((null==n||null===(t=n.data)||void 0===t?void 0:t[c])||""),G((null==n||null===(r=n.data)||void 0===r?void 0:r[c])||""),J.current=(null==n||null===(o=n.data)||void 0===o?void 0:o[c])||""),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=i()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"put",body:o()({material_type:String(pe)},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(_e(),p.ZP.success("编辑成功"),W(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),xe=function(){var e=i()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(!0),(n={})[c]=q,e.next=5,(0,f.ZP)("/api/core_materials/".concat(a,"/update_desc.json"),{method:"put",body:n});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(he(),p.ZP.success("编辑成功"),te(!1)),oe(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)("div",{className:_,children:[(0,E.jsx)(S.qE,{title:"教材详情",onClick:function(){return k.history.push("/textbook")},children:fe(V.user_id)&&(0,E.jsxs)("div",{className:v,children:[(0,E.jsx)("div",{onClick:function(){W(o()({},V))},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})}),(0,E.jsx)("div",{onClick:function(){var e;m.Z.confirm({title:"提示",okText:"确定删除",okButtonProps:{danger:!0},icon:!1,className:y.Z.CustomTipsModalCss,cancelText:"取消",content:(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{children:["确认删除《",le,"》吗?"]}),(0,E.jsx)("div",{className:"mt10",children:"删除后,将无法恢复,请谨慎操作"})]}),onOk:(e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"delete"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(p.ZP.success("操作成功"),k.history.push("/textbook"));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:(0,E.jsxs)("span",{className:"delete-hover",children:[" ",(0,E.jsx)("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"删除"]})})]})}),(0,E.jsxs)("div",{className:x,children:[(0,E.jsx)("div",{className:b,children:(0,E.jsx)("img",{src:Z.Z.API_SERVER+(null==ie?void 0:ie.url)})}),(0,E.jsxs)("div",{className:g,children:[(0,E.jsx)("div",{className:j,children:le}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["作者:",ce]}),(0,E.jsxs)("span",{children:["出版社:",ue]})]}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["ISBN:",de]}),(0,E.jsxs)("span",{children:["出版时间:",me?P()(me).format("YYYY-MM-DD"):"--"]})]})]})]}),(0,E.jsx)(S.YG,{value:c,onChange:function(e){O(e)},tabBarExtraContent:fe(V.user_id)&&(0,E.jsx)("div",{className:v,children:(0,E.jsx)("div",{onClick:function(){te(!0)},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})})}),dataSource:[{id:"description",name:"简介"},{id:"directory",name:"目录"},{id:"foreword",name:"前言"}]}),(0,E.jsx)("div",{className:"mt20",children:ne?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(N.Z,{defaultvalue:X,onChange:function(e){z(e)}}),(0,E.jsx)(S.QD,{confirmTitle:"保存",confirmLoading:re,confirmClick:xe,cancelClick:function(){te(!1),z(J.current)},cancelTitle:"取消",className:"mb25 mt25"})]}):(0,E.jsx)(C.Z,{className:h,value:q})}),(0,E.jsx)(w.Z,{visible:Y,title:"教材",onCancel:function(){return W(!1)},onOk:ve})]})}))},46165:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},56762:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(59301);function s(){const[,e]=a.useReducer((e=>e+1),0);return e}},57809:function(e,n,t){var a=t(92310),s=t.n(a),r=t(77861),o=t(55405),l=t(59301),i=t(53487),c=t(62892),u=t(19080),d=t(36355),m=t(1684),p=t(93891),f=t(19716),_=t(32441),h=t(33234),v=t(14154),x=t(58582),b=t(84443),g=t(66339),j=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(e);s{var t,{prefixCls:a,bordered:i=!0,className:w,rootClassName:Z,getPopupContainer:S,popupClassName:N,dropdownClassName:y,listHeight:k=256,placement:I,listItemHeight:O=24,size:P,disabled:E,notFoundContent:M,status:F,builtinPlacements:V,dropdownMatchSelectWidth:R,popupMatchSelectWidth:T,direction:D,style:B,allowClear:U}=e,L=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Y,getPrefixCls:W,renderEmpty:H,direction:$,virtual:q,popupMatchSelectWidth:z,popupOverflow:A,select:Q}=l.useContext(d.E_),X=W("select",a),G=W(),J=null!=D?D:$,{compactSize:K,compactItemClassnames:ee}=(0,h.ri)(X,J),[ne,te]=(0,v.Z)(X),ae=l.useMemo((()=>{const{mode:e}=L;if("combobox"!==e)return e===C?"combobox":e}),[L.mode]),se="multiple"===ae||"tags"===ae,re=(0,b.Z)(L.suffixIcon,L.showArrow),oe=null!==(t=null!=T?T:R)&&void 0!==t?t:z,{status:le,hasFeedback:ie,isFormItemInput:ce,feedbackIcon:ue}=l.useContext(_.aM),de=(0,u.F)(le,F);let me;me=void 0!==M?M:"combobox"===ae?null:(null==H?void 0:H("Select"))||l.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:fe,removeIcon:_e,clearIcon:he}=(0,g.Z)(Object.assign(Object.assign({},L),{multiple:se,hasFeedback:ie,feedbackIcon:ue,showSuffixIcon:re,prefixCls:X,showArrow:L.showArrow,componentName:"Select"})),ve=!0===U?{clearIcon:he}:U,xe=(0,o.Z)(L,["suffixIcon","itemIcon"]),be=s()(N||y,{[`${X}-dropdown-${J}`]:"rtl"===J},Z,te),ge=(0,f.Z)((e=>{var n;return null!==(n=null!=P?P:K)&&void 0!==n?n:e})),je=l.useContext(m.Z),Ce=null!=E?E:je,we=s()({[`${X}-lg`]:"large"===ge,[`${X}-sm`]:"small"===ge,[`${X}-rtl`]:"rtl"===J,[`${X}-borderless`]:!i,[`${X}-in-form-item`]:ce},(0,u.Z)(X,de,ie),ee,null==Q?void 0:Q.className,w,Z,te),Ze=l.useMemo((()=>void 0!==I?I:"rtl"===J?"bottomRight":"bottomLeft"),[I,J]),Se=(0,x.Z)(V,A);return ne(l.createElement(r.ZP,Object.assign({ref:n,virtual:q,showSearch:null==Q?void 0:Q.showSearch},xe,{style:Object.assign(Object.assign({},null==Q?void 0:Q.style),B),dropdownMatchSelectWidth:oe,builtinPlacements:Se,transitionName:(0,c.m)(G,"slide-up",L.transitionName),listHeight:k,listItemHeight:O,mode:ae,prefixCls:X,placement:Ze,direction:J,suffixIcon:pe,menuItemSelectedIcon:fe,removeIcon:_e,allowClear:ve,notFoundContent:me,className:we,getPopupContainer:S||Y,dropdownClassName:be,disabled:Ce})))};const Z=l.forwardRef(w),S=(0,i.Z)(Z);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=C,Z.Option=r.Wx,Z.OptGroup=r.Xo,Z._InternalPanelDoNotUseOrYouWillBeFired=S,n.default=Z}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25713],{93370:function(e,n,t){t.d(n,{Z:function(){return v}});var a=t(82242),s=t.n(a),r=t(7557),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(84686),p=t(91203),f=t(87167),_=(t(6234),{editor_css:"editor_css___cm3Z8"}),h=t(37712),v=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,a=e.style,r=e.user,l=e.placeholder,c=2097152,f=(0,d.useRef)(null),v=(0,d.useState)(null),x=u()(v,2),b=x[0],g=x[1],j=(0,d.useState)(""),C=u()(j,2),w=C[0],Z=C[1];(0,d.useEffect)((function(){Z(n)}),[n]),(0,d.useEffect)((function(){t(w)}),[w]);var S={placeholder:l||"请输入内容...",MENU_CONF:{}};S.MENU_CONF.uploadImage={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(a=new FormData).append("file",e),t.next=4,(0,p.ZP)("/api/attachments.json",{method:"post",body:a},!0);case 4:s=t.sent,n(null==s?void 0:s.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},S.MENU_CONF.uploadVideo={customUpload:function(e,n){return i()(o()().mark((function t(){var a,s,l,i,u,d,m,_,h,v,x,b,g,j;return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=e.size,s=Math.ceil(a/c),t.prev=2,t.next=5,(0,p.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:s,user_id:null==r||null===(l=r.userInfo)||void 0===l?void 0:l.user_id}});case 5:if(0===(null==(u=t.sent)?void 0:u.status)){t.next=8;break}throw new Error;case 8:d=u.upload_id,f.current=new AbortController,m=[],0,_=o()().mark((function n(){var t,s,r,l;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=h*c,s=Math.min(t+c,a),r=e.slice(t,s),(l=new FormData).append("chunk",r),l.append("fileName",e.name),l.append("chunkIndex",(h+1).toString()),l.append("uploadId",d),m.push((function(){return(0,p.ZP)("/api/attachments/multipart_upload",{method:"POST",body:l,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),h=0;case 14:if(!(h0)){t.next=29;break}return t.next=27,Promise.all(g);case 27:t.sent,v+=x;case 29:t.next=22;break;case 31:return t.next=33,(0,p.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:s,uploadId:d,user_id:null==r||null===(i=r.userInfo)||void 0===i?void 0:i.user_id}});case 33:j=t.sent,n(null==j?void 0:j.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}};return(0,d.useEffect)((function(){return function(){null!=b&&(b.destroy(),g(null))}}),[b]),(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)("div",{className:null==_?void 0:_.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,h.jsx)(m.o,{editor:b,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,h.jsx)(m.M,{defaultConfig:S,value:w,onCreated:g,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^

]+>/g,"").replace(/<[

$]+>/g,"").replace(/ /gi,"").replace(/<[^
]+>/g,"")))?Z(e.getHtml()):Z("")},mode:"default",style:s()({height:"500px",overflowY:"hidden"},a)})]})})}))},4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),s=t.n(a),r=t(41498),o=t.n(r),l=t(82242),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(78241),p=t(8591),f=t(43418),_=t(98135),h=t(88522),v=t(84291),x=t(46651),b=t(87167),g=t(91203),j=t(99232),C=t.n(j),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},Z=t(46165),S=t(44394),N=t(97650),y=t(47192),k=t(37712),I=(0,b.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,r=e.onCancel,l=e.title,c=void 0===l?"":l,b=e.coreCurriculum,j=(e.dispatch,b.CoreSubjects,m.Z.useForm()),I=u()(j,1)[0],O=(0,d.useState)(!1),P=u()(O,2),E=P[0],M=P[1],F=(0,d.useState)([]),V=u()(F,2),R=V[0],T=V[1],D=(0,d.useState)(!1),B=u()(D,2),U=B[0],L=B[1],Y=(0,d.useState)([]),W=u()(Y,2),H=W[0],$=W[1],q=(0,d.useState)([]),z=u()(q,2),A=z[0],Q=z[1];(0,d.useEffect)((function(){if(t&&G(),null!=t&&t.id){var e,n;I.setFieldsValue(i()(i()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:C()(null==t?void 0:t.publication_time)}));var a=[i()(i()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];T(a)}}),[t]);var X,G=function(){var e=o()(s()().mark((function e(){var n,t,a,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&Q(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&$(null==a||null===(r=a.data)||void 0===r?void 0:r.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=o()(s()().mark((function e(n){var t,r;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:M(!0),r=i()(i()({},n),{},{attachment_id:(null==R||null===(t=R[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(r);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(f.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){r()},confirmLoading:E,okButtonProps:{disabled:U},width:686,afterClose:function(){M(!1),T([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:Z.Z.CustomCss,children:(0,k.jsxs)(m.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:J,className:w.form,children:[(0,k.jsx)(m.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(_.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(m.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==A?void 0:A.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==H?void 0:H.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(m.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(m.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(_.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(m.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(v.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(m.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(_.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(m.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=R&&null!==(n=R[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==R||null===(X=R[0])||void 0===X||null===(X=X.response)||void 0===X?void 0:X.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(N.Z,{onClick:function(){T([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(x.Z,{fileList:R,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&L(!0),"done"===n.file.status&&L(!1),T(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){T([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(p.ZP.info("文件大小必须小于2MB"),Promise.reject()):(T([]),!0):(p.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(y.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},80946:function(e,n,t){t.r(n),t.d(n,{default:function(){return M}});var a=t(7557),s=t.n(a),r=t(82242),o=t.n(r),l=t(41498),i=t.n(l),c=t(79800),u=t.n(c),d=t(59301),m=t(43418),p=t(8591),f=t(91203),_="wrap___ieM1S",h="editor___EZPNQ",v="btns___shpJD",x="list___LE_2Q",b="left___rPWHk",g="right___LDk76",j="title___XNk6p",C=t(34654),w=t(4090),Z=t(44394),S=t(47192),N=t(93370),y=t(46165),k=t(87167),I=t(14477),O=t(99232),P=t.n(O),E=t(37712),M=(0,k.connect)((function(e){var n=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:n,user:e.user}}))((function(e){e.globalSetting,e.dispatch;var n=e.user,t=e.virtualSpaces,a=(0,k.useParams)().id,r=(0,d.useState)("description"),l=u()(r,2),c=l[0],O=l[1],M=(0,d.useState)({}),F=u()(M,2),V=F[0],R=F[1],T=(0,d.useState)(!0),D=u()(T,2),B=(D[0],D[1]),U=(0,d.useState)(!1),L=u()(U,2),Y=L[0],W=L[1],H=(0,d.useState)(""),$=u()(H,2),q=$[0],z=$[1],A=(0,d.useState)(""),Q=u()(A,2),X=Q[0],G=Q[1],J=(0,d.useRef)(""),K=(0,d.useState)(!1),ee=u()(K,2),ne=ee[0],te=ee[1],ae=(0,d.useState)(!1),se=u()(ae,2),re=se[0],oe=se[1],le=(t.virtualSpacesDetails,V.name),ie=V.attachment,ce=V.author,ue=V.publisher,de=V.number,me=V.publication_time,pe=V.material_type;(0,d.useEffect)((function(){_e()}),[a]),(0,d.useEffect)((function(){he()}),[c]);var fe=function(e){var t;return(0,I.ES)()||(null==n||null===(t=n.userInfo)||void 0===t?void 0:t.user_id)===e},_e=function(){var e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"get"});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&R(o()({},null==n?void 0:n.data)),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i()(s()().mark((function e(){var n,t,r,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(!0),e.next=3,(0,f.ZP)("/api/core_materials/".concat(a,"/show_desc.json"),{method:"get",params:{column:c}});case 3:-1!==(null==(n=e.sent)?void 0:n.status)&&(z((null==n||null===(t=n.data)||void 0===t?void 0:t[c])||""),G((null==n||null===(r=n.data)||void 0===r?void 0:r[c])||""),J.current=(null==n||null===(o=n.data)||void 0===o?void 0:o[c])||""),B(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=i()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"put",body:o()({material_type:String(pe)},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(_e(),p.ZP.success("编辑成功"),W(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),xe=function(){var e=i()(s()().mark((function e(){var n,t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return oe(!0),(n={})[c]=q,e.next=5,(0,f.ZP)("/api/core_materials/".concat(a,"/update_desc.json"),{method:"put",body:n});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(he(),p.ZP.success("编辑成功"),te(!1)),oe(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)("div",{className:_,children:[(0,E.jsx)(S.qE,{title:"教材详情",onClick:function(){return k.history.push("/textbook")},children:fe(V.user_id)&&(0,E.jsxs)("div",{className:v,children:[(0,E.jsx)("div",{onClick:function(){W(o()({},V))},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})}),(0,E.jsx)("div",{onClick:function(){var e;m.Z.confirm({title:"提示",okText:"确定删除",okButtonProps:{danger:!0},icon:!1,className:y.Z.CustomTipsModalCss,cancelText:"取消",content:(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{children:["确认删除《",le,"》吗?"]}),(0,E.jsx)("div",{className:"mt10",children:"删除后,将无法恢复,请谨慎操作"})]}),onOk:(e=i()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.ZP)("/api/core_materials/".concat(a,".json"),{method:"delete"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&(p.ZP.success("操作成功"),k.history.push("/textbook"));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:(0,E.jsxs)("span",{className:"delete-hover",children:[" ",(0,E.jsx)("i",{className:"iconfont icon-piliangshanchubeifen font14 mr5"}),"删除"]})})]})}),(0,E.jsxs)("div",{className:x,children:[(0,E.jsx)("div",{className:b,children:(0,E.jsx)("img",{src:Z.Z.API_SERVER+(null==ie?void 0:ie.url)})}),(0,E.jsxs)("div",{className:g,children:[(0,E.jsx)("div",{className:j,children:le}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["作者:",ce]}),(0,E.jsxs)("span",{children:["出版社:",ue]})]}),(0,E.jsxs)("aside",{children:[(0,E.jsxs)("span",{children:["ISBN:",de]}),(0,E.jsxs)("span",{children:["出版时间:",me?P()(me).format("YYYY-MM-DD"):"--"]})]})]})]}),(0,E.jsx)(S.YG,{value:c,onChange:function(e){O(e)},tabBarExtraContent:fe(V.user_id)&&(0,E.jsx)("div",{className:v,children:(0,E.jsx)("div",{onClick:function(){te(!0)},children:(0,E.jsxs)("span",{className:"primary-hover",children:[(0,E.jsx)("i",{className:"iconfont icon-bianji7 font14 mr5"}),"编辑"]})})}),dataSource:[{id:"description",name:"简介"},{id:"directory",name:"目录"},{id:"foreword",name:"前言"}]}),(0,E.jsx)("div",{className:"mt20",children:ne?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(N.Z,{defaultvalue:X,onChange:function(e){z(e)}}),(0,E.jsx)(S.QD,{confirmTitle:"保存",confirmLoading:re,confirmClick:xe,cancelClick:function(){te(!1),z(J.current)},cancelTitle:"取消",className:"mb25 mt25"})]}):(0,E.jsx)(C.Z,{className:h,value:q})}),(0,E.jsx)(w.Z,{visible:Y,title:"教材",onCancel:function(){return W(!1)},onOk:ve})]})}))},46165:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},56762:function(e,n,t){t.d(n,{Z:function(){return s}});var a=t(59301);function s(){const[,e]=a.useReducer((e=>e+1),0);return e}},57809:function(e,n,t){var a=t(92310),s=t.n(a),r=t(77861),o=t(55405),l=t(59301),i=t(53487),c=t(62892),u=t(19080),d=t(36355),m=t(1684),p=t(93891),f=t(19716),_=t(32441),h=t(33234),v=t(14154),x=t(58582),b=t(84443),g=t(66339),j=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(a=Object.getOwnPropertySymbols(e);s{var t,{prefixCls:a,bordered:i=!0,className:w,rootClassName:Z,getPopupContainer:S,popupClassName:N,dropdownClassName:y,listHeight:k=256,placement:I,listItemHeight:O=24,size:P,disabled:E,notFoundContent:M,status:F,builtinPlacements:V,dropdownMatchSelectWidth:R,popupMatchSelectWidth:T,direction:D,style:B,allowClear:U}=e,L=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Y,getPrefixCls:W,renderEmpty:H,direction:$,virtual:q,popupMatchSelectWidth:z,popupOverflow:A,select:Q}=l.useContext(d.E_),X=W("select",a),G=W(),J=null!=D?D:$,{compactSize:K,compactItemClassnames:ee}=(0,h.ri)(X,J),[ne,te]=(0,v.Z)(X),ae=l.useMemo((()=>{const{mode:e}=L;if("combobox"!==e)return e===C?"combobox":e}),[L.mode]),se="multiple"===ae||"tags"===ae,re=(0,b.Z)(L.suffixIcon,L.showArrow),oe=null!==(t=null!=T?T:R)&&void 0!==t?t:z,{status:le,hasFeedback:ie,isFormItemInput:ce,feedbackIcon:ue}=l.useContext(_.aM),de=(0,u.F)(le,F);let me;me=void 0!==M?M:"combobox"===ae?null:(null==H?void 0:H("Select"))||l.createElement(p.Z,{componentName:"Select"});const{suffixIcon:pe,itemIcon:fe,removeIcon:_e,clearIcon:he}=(0,g.Z)(Object.assign(Object.assign({},L),{multiple:se,hasFeedback:ie,feedbackIcon:ue,showSuffixIcon:re,prefixCls:X,showArrow:L.showArrow,componentName:"Select"})),ve=!0===U?{clearIcon:he}:U,xe=(0,o.Z)(L,["suffixIcon","itemIcon"]),be=s()(N||y,{[`${X}-dropdown-${J}`]:"rtl"===J},Z,te),ge=(0,f.Z)((e=>{var n;return null!==(n=null!=P?P:K)&&void 0!==n?n:e})),je=l.useContext(m.Z),Ce=null!=E?E:je,we=s()({[`${X}-lg`]:"large"===ge,[`${X}-sm`]:"small"===ge,[`${X}-rtl`]:"rtl"===J,[`${X}-borderless`]:!i,[`${X}-in-form-item`]:ce},(0,u.Z)(X,de,ie),ee,null==Q?void 0:Q.className,w,Z,te),Ze=l.useMemo((()=>void 0!==I?I:"rtl"===J?"bottomRight":"bottomLeft"),[I,J]),Se=(0,x.Z)(V,A);return ne(l.createElement(r.ZP,Object.assign({ref:n,virtual:q,showSearch:null==Q?void 0:Q.showSearch},xe,{style:Object.assign(Object.assign({},null==Q?void 0:Q.style),B),dropdownMatchSelectWidth:oe,builtinPlacements:Se,transitionName:(0,c.m)(G,"slide-up",L.transitionName),listHeight:k,listItemHeight:O,mode:ae,prefixCls:X,placement:Ze,direction:J,suffixIcon:pe,menuItemSelectedIcon:fe,removeIcon:_e,allowClear:ve,notFoundContent:me,className:we,getPopupContainer:S||Y,dropdownClassName:be,disabled:Ce})))};const Z=l.forwardRef(w),S=(0,i.Z)(Z);Z.SECRET_COMBOBOX_MODE_DO_NOT_USE=C,Z.Option=r.Wx,Z.OptGroup=r.Xo,Z._InternalPanelDoNotUseOrYouWillBeFired=S,n.default=Z}}]); \ No newline at end of file diff --git a/p__Textbook__Index__index.async.js b/p__Textbook__Index__index.async.js index 3d07b22957..f089f5364c 100644 --- a/p__Textbook__Index__index.async.js +++ b/p__Textbook__Index__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4350],{4090:function(e,n,t){t.d(n,{Z:function(){return I}});var i=t(7557),a=t.n(i),l=t(41498),s=t.n(l),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),_=t(78241),m=t(8591),p=t(43418),x=t(98135),h=t(88522),f=t(84291),v=t(46651),j=t(87167),g=t(91203),b=t(99232),Z=t.n(b),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},y=t(46165),S=t(44394),C=t(97650),N=t(47192),k=t(37712),I=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,i=e.onOk,l=e.onCancel,r=e.title,c=void 0===r?"":r,j=e.coreCurriculum,b=(e.dispatch,j.CoreSubjects,_.Z.useForm()),I=u()(b,1)[0],P=(0,d.useState)(!1),V=u()(P,2),M=V[0],Y=V[1],E=(0,d.useState)([]),F=u()(E,2),L=F[0],O=F[1],B=(0,d.useState)(!1),D=u()(B,2),R=D[0],q=D[1],U=(0,d.useState)([]),z=u()(U,2),W=z[0],A=z[1],T=(0,d.useState)([]),J=u()(T,2),Q=J[0],G=J[1];(0,d.useEffect)((function(){if(t&&X(),null!=t&&t.id){var e,n;I.setFieldsValue(o()(o()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:Z()(null==t?void 0:t.publication_time)}));var i=[o()(o()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];O(i)}}),[t]);var H,X=function(){var e=s()(a()().mark((function e(){var n,t,i,l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_core_subject:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&G(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(i=e.sent)?void 0:i.status)&&A(null==i||null===(l=i.data)||void 0===l?void 0:l.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=s()(a()().mark((function e(n){var t,l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Y(!0),l=o()(o()({},n),{},{attachment_id:(null==L||null===(t=L[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),i(l);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(p.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){l()},confirmLoading:M,okButtonProps:{disabled:R},width:686,afterClose:function(){Y(!1),O([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:y.Z.CustomCss,children:(0,k.jsxs)(_.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:K,className:w.form,children:[(0,k.jsx)(_.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(x.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(_.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==Q?void 0:Q.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==W?void 0:W.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(_.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(_.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(f.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(_.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(x.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(_.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=L&&null!==(n=L[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==L||null===(H=L[0])||void 0===H||null===(H=H.response)||void 0===H?void 0:H.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(C.Z,{onClick:function(){O([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(v.Z,{fileList:L,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&q(!0),"done"===n.file.status&&q(!1),O(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){O([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(m.ZP.info("文件大小必须小于2MB"),Promise.reject()):(O([]),!0):(m.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(N.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},31472:function(e,n,t){t.r(n),t.d(n,{default:function(){return z}});var i=t(37205),a=t.n(i),l=t(82242),s=t.n(l),r=t(7557),o=t.n(r),c=t(41498),u=t.n(c),d=t(79800),_=t.n(d),m=t(59301),p=t(87167),x=t(95237),h=t(43604),f=t(3113),v=t(98135),j=t(56511),g=t(6848),b=t(53864),Z="Bg___AHmvi",w="DivDownPlay___IUWWX",y="type___yDlx4",S="type_item_active___b785N",C="type_item___Bqpts",N="list___hrLrx",k="left___laOeV",I="right___oUOE7",P="title___inYm8",V="des___AgPJF",M="search___USD4q",Y="searchIcon___uL435",E=t(2006),F=t(44394),L=t(14477),O=t(91203),B=t(34654),D=t(4090),R=t(99232),q=t.n(R),U=t(37712),z=(0,p.connect)((function(e){var n=e.user,t=e.globalSetting,i=e.coreCurriculum;return{user:n,globalSetting:t,virtualSpaces:e.virtualSpaces,coreCurriculum:i}}))((function(e){var n,t,i,l=e.coreCurriculum,r=(e.dispatch,e.virtualSpaces,e.globalSetting),c=(l.CoreSubjects,(0,m.useState)({page:1,limit:10})),d=_()(c,2),R=d[0],z=d[1],W=(0,m.useState)(0),A=_()(W,2),T=A[0],J=A[1],Q=(0,m.useState)(!0),G=_()(Q,2),H=G[0],X=G[1],K=(0,m.useState)(""),$=_()(K,2),ee=$[0],ne=$[1],te=(0,m.useState)(!1),ie=_()(te,2),ae=ie[0],le=ie[1],se=(0,m.useState)([]),re=_()(se,2),oe=re[0],ce=re[1],ue=(0,m.useState)([]),de=_()(ue,2),_e=de[0],me=de[1],pe=(0,m.useState)("全部"),xe=_()(pe,2),he=xe[0],fe=xe[1],ve=(0,m.useState)([]),je=_()(ve,2),ge=je[0],be=je[1],Ze=(0,m.useState)("全部"),we=_()(Ze,2),ye=we[0],Se=we[1];(0,m.useEffect)((function(){Ce()}),[]),(0,m.useEffect)((function(){Ne(!0)}),[he,ye]);var Ce=function(){var e=u()(o()().mark((function e(){var n,t,i,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(!0),e.next=3,(0,O.ZP)("/api/core_materials/material_type_name_list.json",{method:"get"});case 3:return 0==(null==(n=e.sent)?void 0:n.status)&&be(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=7,(0,O.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get"});case 7:0==(null==(i=e.sent)?void 0:i.status)&&me(null==i||null===(a=i.data)||void 0===a?void 0:a.list),X(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=u()(o()().mark((function e(){var n,t,i,a,l=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>0&&void 0!==l[0]&&l[0],X(!0),n&&(R.page=1,z(s()({},R))),e.next=5,(0,O.ZP)("/api/core_materials/list.json",{method:"get",params:s()({material_type_name:ye,keyword:ee,core_subject_name:he},R)});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(ce((null==t||null===(i=t.data)||void 0===i?void 0:i.list)||[]),J(null==t||null===(a=t.data)||void 0===a?void 0:a.count)),X(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=u()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/core_materials.json",{method:"post",body:s()({},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(Ne(),Ce(),le(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)("section",{children:[(0,U.jsx)("div",{className:"".concat(Z),style:{width:"100%",height:168,backgroundImage:"url(".concat(F.Z.IMG_SERVER,"/").concat(null==r||null===(n=r.setting)||void 0===n?void 0:n.textbook_banner_url,")")},children:(0,U.jsxs)(x.Z,{style:{width:1200,height:"100%",margin:"0 auto"},align:"middle",justify:"space-between",wrap:!1,children:[(0,U.jsxs)(h.Z,{children:[(0,U.jsx)("div",{style:{color:"#fff",fontSize:"30px",letterSpacing:"5px",fontWeight:600},children:"核心教材"}),(0,L.Ny)()&&(0,U.jsx)(f.ZP,{className:"mt25 ".concat(w),icon:(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249"}),onClick:function(){le(!0)},children:"新建核心教材"})]}),(0,U.jsx)(v.Z.Search,{placeholder:"请输入关键字进行搜索",size:"large",className:M,value:ee,onChange:function(e){ne(e.target.value)},onSearch:function(e){ne(e)},suffix:(0,U.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Y),onClick:function(){ne(ee),z(s()(s()({},R),{},{page:1})),Ne(!0)}})})]})}),(0,U.jsxs)("div",{style:{width:1200,margin:"0 auto",background:"#fff",paddingBottom:"10px"},children:[(0,U.jsxs)("div",{style:{paddingTop:"20px"},children:[(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"课程"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(t=["全部"].concat(a()(_e)))||void 0===t?void 0:t.map((function(e,n){return(0,U.jsx)("div",{className:he==e?S:C,style:{marginBottom:"10px"},onClick:function(){fe(e)},children:e},n)}))})]}),(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"类型"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(i=["全部"].concat(a()(ge)))||void 0===i?void 0:i.map((function(e,n){return(0,U.jsx)("div",{className:ye==e?S:C,onClick:function(){Se(e)},children:e},n)}))})]})]}),(0,U.jsxs)(j.Z,{className:"mt20",loading:H,children:[!oe.length&&(0,U.jsx)(E.Z,{}),oe.map((function(e){var n=e.name,t=e.id,i=e.attachment,a=e.author,l=e.publisher,s=e.number,r=e.publication_time,o=e.description;return(0,U.jsxs)("div",{className:N,onClick:function(){return p.history.push("/textbook/detail/".concat(t))},children:[(0,U.jsx)("div",{className:k,children:(0,U.jsx)("img",{src:F.Z.API_SERVER+(null==i?void 0:i.url)})}),(0,U.jsxs)("div",{className:I,children:[(0,U.jsx)(g.Z,{title:n,children:(0,U.jsx)("div",{className:P,children:n})}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"作者:".concat(a),children:(0,U.jsxs)("span",{children:["作者:",a]})}),(0,U.jsx)(g.Z,{title:"出版社:".concat(l),children:(0,U.jsxs)("span",{children:["出版社:",l]})})]}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"ISBN:".concat(s),children:(0,U.jsxs)("span",{children:["ISBN:",s]})}),(0,U.jsx)(g.Z,{title:"出版时间:".concat(q()(r).format("YYYY-MM-DD")),children:(0,U.jsxs)("span",{children:["出版时间:",r?q()(r).format("YYYY-MM-DD"):"--"]})})]}),(0,U.jsx)("div",{className:V,children:(0,U.jsx)(B.Z,{showTextOnly:!0,showLines:3,value:o||""})})]})]},t)}))]}),(0,U.jsxs)(x.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:1200,margin:"20px auto",padding:"0 20px"},children:[(0,U.jsxs)(h.Z,{children:["共 ",(0,U.jsx)("span",{style:{color:"#165DFF"},children:T||0})," 条数据"]}),(0,U.jsx)(h.Z,{children:(0,U.jsx)(b.Z,{showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,current:R.page,pageSize:R.limit,onChange:function(e,n){R.page=e,z(s()({},R)),Ne()},total:T||0})})]}),(0,U.jsx)(D.Z,{visible:ae,title:"教材",onCancel:function(){return le(!1)},onOk:ke})]})]})}))},46165:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4350],{4090:function(e,n,t){t.d(n,{Z:function(){return I}});var a=t(7557),i=t.n(a),l=t(41498),s=t.n(l),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),_=t(78241),m=t(8591),p=t(43418),x=t(98135),h=t(88522),f=t(84291),v=t(46651),j=t(87167),g=t(91203),b=t(99232),Z=t.n(b),w={flex_box_center:"flex_box_center___QyfTI",flex_space_between:"flex_space_between___h3rrj",flex_box_vertical_center:"flex_box_vertical_center___CJQPY",flex_box_center_end:"flex_box_center_end___GyaJk",flex_box_column:"flex_box_column___Q9WpV",form:"form___In2ej",btn:"btn___CMK6g",img:"img___s_IXU",myModal:"myModal___k3vWJ"},y=t(46165),S=t(44394),C=t(97650),N=t(47192),k=t(37712),I=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n,t=e.visible,a=e.onOk,l=e.onCancel,r=e.title,c=void 0===r?"":r,j=e.coreCurriculum,b=(e.dispatch,j.CoreSubjects,_.Z.useForm()),I=u()(b,1)[0],P=(0,d.useState)(!1),V=u()(P,2),M=V[0],Y=V[1],E=(0,d.useState)([]),F=u()(E,2),L=F[0],O=F[1],B=(0,d.useState)(!1),D=u()(B,2),R=D[0],q=D[1],U=(0,d.useState)([]),z=u()(U,2),W=z[0],A=z[1],T=(0,d.useState)([]),J=u()(T,2),Q=J[0],G=J[1];(0,d.useEffect)((function(){if(t&&X(),null!=t&&t.id){var e,n;I.setFieldsValue(o()(o()({},t),{},{attachment_id:null==t||null===(e=t.attachment)||void 0===e?void 0:e.id,publication_time:Z()(null==t?void 0:t.publication_time)}));var a=[o()(o()({},null==t?void 0:t.attachment),{},{response:{id:null==t||null===(n=t.attachment)||void 0===n?void 0:n.id}})];O(a)}}),[t]);var H,X=function(){var e=s()(i()().mark((function e(){var n,t,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.ZP)("/api/core_materials/material_type_name_list.json",{method:"get",params:{has_default_type:1}});case 2:return 0==(null==(n=e.sent)?void 0:n.status)&&G(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=6,(0,g.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get",params:{has_core_subject:1}});case 6:0==(null==(a=e.sent)?void 0:a.status)&&A(null==a||null===(l=a.data)||void 0===l?void 0:l.list);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=s()(i()().mark((function e(n){var t,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Y(!0),l=o()(o()({},n),{},{attachment_id:(null==L||null===(t=L[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id)||""}),a(l);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,k.jsx)(p.Z,{className:w.myModal,title:"".concat(null!=t&&t.id?"编辑":"新建").concat(c),open:t,onOk:function(){I.submit()},centered:!0,onCancel:function(){l()},confirmLoading:M,okButtonProps:{disabled:R},width:686,afterClose:function(){Y(!1),O([]),I.resetFields()},okText:"确认",cancelText:"取消",wrapClassName:y.Z.CustomCss,children:(0,k.jsxs)(_.Z,{form:I,colon:!1,labelCol:{span:4},wrapperCol:{span:18},onFinish:K,className:w.form,children:[(0,k.jsx)(_.Z.Item,{label:"教材名称",name:"name",rules:[{required:!0,message:"请输入教材名称"},{whitespace:!0,message:"请输入教材名称"},{max:100,message:"只能输入60个字符"}],children:(0,k.jsx)(x.Z,{maxLength:100,placeholder:"请输入教材名称"})}),(0,k.jsx)(_.Z.Item,{label:"教材类型",name:"material_type_name",rules:[{required:!0,message:"请选择教材类型"}],children:(0,k.jsx)(h.Z,{options:null==Q?void 0:Q.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("material_type_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"课程",name:"core_subject_name",rules:[{required:!0,message:"请选择课程"}],children:(0,k.jsx)(h.Z,{options:null==W?void 0:W.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.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("core_subject_name",e.substring(0,20))}})}),(0,k.jsx)(_.Z.Item,{label:"作者",name:"author",rules:[{required:!0,message:"请输入作者"},{whitespace:!0,message:"请输入作者"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入作者"})}),(0,k.jsx)(_.Z.Item,{label:"出版社",name:"publisher",rules:[{whitespace:!0,message:"实践出版社"},{max:50,message:"只能输入50个字符"}],children:(0,k.jsx)(x.Z,{maxLength:50,placeholder:"请输入出版社"})}),(0,k.jsx)(_.Z.Item,{label:"出版时间",name:"publication_time",children:(0,k.jsx)(f.default,{style:{width:"100%"},placeholder:"请选择出版时间",format:"YYYY-MM-DD",allowClear:!1})}),(0,k.jsx)(_.Z.Item,{label:"ISBN",name:"number",rules:[{whitespace:!0,message:"请输入ISBN"}],children:(0,k.jsx)(x.Z,{maxLength:60,placeholder:"请输入ISBN"})}),(0,k.jsx)(_.Z.Item,{name:"attachment_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],children:(0,k.jsx)("div",{className:w.upload,children:null!=L&&null!==(n=L[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?(0,k.jsxs)("div",{className:w.img,children:[(0,k.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(null==L||null===(H=L[0])||void 0===H||null===(H=H.response)||void 0===H?void 0:H.id),alt:"avatar",style:{width:"100%"}}),(0,k.jsx)("div",{children:(0,k.jsx)(C.Z,{onClick:function(){O([]),I.setFieldsValue({attachment_id:""})},style:{fontSize:"16px",color:"red"}})})]}):(0,k.jsx)(v.Z,{fileList:L,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return n=e,I.setFieldsValue({attachment_id:""}),void(["uploading","done","removed"].includes(n.file.status)&&("uploading"===n.file.status&&q(!0),"done"===n.file.status&&q(!1),O(n.fileList),I.setFieldsValue({attachment_id:null===(t=n.fileList)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id})));var n,t},onRemove:function(e){O([])},beforeUpload:function(e){return"image/jpeg"===(n=e).type||"image/png"===n.type?n.size/1024/1024>2?(m.ZP.info("文件大小必须小于2MB"),Promise.reject()):(O([]),!0):(m.ZP.error("请上传jpg或png的图片!"),Promise.reject());var n},withCredentials:!0,accept:"image/*",children:(0,k.jsxs)(N.op,{style:{borderRadius:"2px",marginLeft:4,marginTop:3},children:[(0,k.jsx)("i",{className:"iconfont icon-shangchuantupian2 mr5"}),"上传图片"]})})})})]})})}))},31472:function(e,n,t){t.r(n),t.d(n,{default:function(){return z}});var a=t(37205),i=t.n(a),l=t(82242),s=t.n(l),r=t(7557),o=t.n(r),c=t(41498),u=t.n(c),d=t(79800),_=t.n(d),m=t(59301),p=t(87167),x=t(95237),h=t(43604),f=t(3113),v=t(98135),j=t(56511),g=t(6848),b=t(53864),Z="Bg___AHmvi",w="DivDownPlay___IUWWX",y="type___yDlx4",S="type_item_active___b785N",C="type_item___Bqpts",N="list___hrLrx",k="left___laOeV",I="right___oUOE7",P="title___inYm8",V="des___AgPJF",M="search___USD4q",Y="searchIcon___uL435",E=t(2006),F=t(44394),L=t(14477),O=t(91203),B=t(34654),D=t(4090),R=t(99232),q=t.n(R),U=t(37712),z=(0,p.connect)((function(e){var n=e.user,t=e.globalSetting,a=e.coreCurriculum;return{user:n,globalSetting:t,virtualSpaces:e.virtualSpaces,coreCurriculum:a}}))((function(e){var n,t,a,l=e.coreCurriculum,r=(e.dispatch,e.virtualSpaces,e.globalSetting),c=(l.CoreSubjects,(0,m.useState)({page:1,limit:10})),d=_()(c,2),R=d[0],z=d[1],W=(0,m.useState)(0),A=_()(W,2),T=A[0],J=A[1],Q=(0,m.useState)(!0),G=_()(Q,2),H=G[0],X=G[1],K=(0,m.useState)(""),$=_()(K,2),ee=$[0],ne=$[1],te=(0,m.useState)(!1),ae=_()(te,2),ie=ae[0],le=ae[1],se=(0,m.useState)([]),re=_()(se,2),oe=re[0],ce=re[1],ue=(0,m.useState)([]),de=_()(ue,2),_e=de[0],me=de[1],pe=(0,m.useState)("全部"),xe=_()(pe,2),he=xe[0],fe=xe[1],ve=(0,m.useState)([]),je=_()(ve,2),ge=je[0],be=je[1],Ze=(0,m.useState)("全部"),we=_()(Ze,2),ye=we[0],Se=we[1];(0,m.useEffect)((function(){Ce()}),[]),(0,m.useEffect)((function(){Ne(!0)}),[he,ye]);var Ce=function(){var e=u()(o()().mark((function e(){var n,t,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(!0),e.next=3,(0,O.ZP)("/api/core_materials/material_type_name_list.json",{method:"get"});case 3:return 0==(null==(n=e.sent)?void 0:n.status)&&be(null==n||null===(t=n.data)||void 0===t?void 0:t.list),e.next=7,(0,O.ZP)("/api/core_materials/core_subject_name_list.json",{method:"get"});case 7:0==(null==(a=e.sent)?void 0:a.status)&&me(null==a||null===(i=a.data)||void 0===i?void 0:i.list),X(!1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=u()(o()().mark((function e(){var n,t,a,i,l=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>0&&void 0!==l[0]&&l[0],X(!0),n&&(R.page=1,z(s()({},R))),e.next=5,(0,O.ZP)("/api/core_materials/list.json",{method:"get",params:s()({material_type_name:ye,keyword:ee,core_subject_name:he},R)});case 5:-1!==(null==(t=e.sent)?void 0:t.status)&&(ce((null==t||null===(a=t.data)||void 0===a?void 0:a.list)||[]),J(null==t||null===(i=t.data)||void 0===i?void 0:i.count)),X(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=u()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,O.ZP)("/api/core_materials.json",{method:"post",body:s()({},n)});case 2:-1!==(null==(t=e.sent)?void 0:t.status)&&(Ne(),Ce(),le(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,U.jsxs)("section",{children:[(0,U.jsx)("div",{className:"".concat(Z),style:{width:"100%",height:168,backgroundImage:"url(".concat(F.Z.IMG_SERVER,"/").concat(null==r||null===(n=r.setting)||void 0===n?void 0:n.textbook_banner_url,")")},children:(0,U.jsxs)(x.Z,{style:{width:1200,height:"100%",margin:"0 auto"},align:"middle",justify:"space-between",wrap:!1,children:[(0,U.jsxs)(h.Z,{children:[(0,U.jsx)("div",{style:{color:"#fff",fontSize:"30px",letterSpacing:"5px",fontWeight:600},children:"核心教材"}),(0,L.Ny)()&&(0,U.jsx)(f.ZP,{className:"mt25 ".concat(w),icon:(0,U.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249"}),onClick:function(){le(!0)},children:"新建核心教材"})]}),(0,U.jsx)(v.Z.Search,{placeholder:"请输入关键字进行搜索",size:"large",className:M,value:ee,onChange:function(e){ne(e.target.value)},onSearch:function(e){ne(e)},suffix:(0,U.jsx)("i",{className:"iconfont icon-sousuo9 font14 ".concat(Y),onClick:function(){ne(ee),z(s()(s()({},R),{},{page:1})),Ne(!0)}})})]})}),(0,U.jsxs)("div",{style:{width:1200,margin:"0 auto",background:"#fff",paddingBottom:"10px"},children:[(0,U.jsxs)("div",{style:{paddingTop:"20px"},children:[(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"课程"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(t=["全部"].concat(i()(_e)))||void 0===t?void 0:t.map((function(e,n){return(0,U.jsx)("div",{className:he==e?S:C,style:{marginBottom:"10px"},onClick:function(){fe(e)},children:e},n)}))})]}),(0,U.jsxs)("div",{className:y,children:[(0,U.jsx)("div",{style:{width:50},children:"类型"}),(0,U.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(a=["全部"].concat(i()(ge)))||void 0===a?void 0:a.map((function(e,n){return(0,U.jsx)("div",{className:ye==e?S:C,onClick:function(){Se(e)},children:e},n)}))})]})]}),(0,U.jsxs)(j.Z,{className:"mt20",loading:H,children:[!oe.length&&(0,U.jsx)(E.Z,{}),oe.map((function(e){var n=e.name,t=e.id,a=e.attachment,i=e.author,l=e.publisher,s=e.number,r=e.publication_time,o=e.description;return(0,U.jsxs)("div",{className:N,onClick:function(){return p.history.push("/textbook/detail/".concat(t))},children:[(0,U.jsx)("div",{className:k,children:(0,U.jsx)("img",{src:F.Z.API_SERVER+(null==a?void 0:a.url)})}),(0,U.jsxs)("div",{className:I,children:[(0,U.jsx)(g.Z,{title:n,children:(0,U.jsx)("div",{className:P,children:n})}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"作者:".concat(i),children:(0,U.jsxs)("span",{children:["作者:",i]})}),(0,U.jsx)(g.Z,{title:"出版社:".concat(l),children:(0,U.jsxs)("span",{children:["出版社:",l]})})]}),(0,U.jsxs)("aside",{children:[(0,U.jsx)(g.Z,{title:"ISBN:".concat(s),children:(0,U.jsxs)("span",{children:["ISBN:",s]})}),(0,U.jsx)(g.Z,{title:"出版时间:".concat(q()(r).format("YYYY-MM-DD")),children:(0,U.jsxs)("span",{children:["出版时间:",r?q()(r).format("YYYY-MM-DD"):"--"]})})]}),(0,U.jsx)("div",{className:V,children:(0,U.jsx)(B.Z,{showTextOnly:!0,showLines:3,value:o||""})})]})]},t)}))]}),(0,U.jsxs)(x.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:1200,margin:"20px auto",padding:"0 20px"},children:[(0,U.jsxs)(h.Z,{children:["共 ",(0,U.jsx)("span",{style:{color:"#165DFF"},children:T||0})," 条数据"]}),(0,U.jsx)(h.Z,{children:(0,U.jsx)(b.Z,{showSizeChanger:!1,showQuickJumper:!0,hideOnSinglePage:!0,current:R.page,pageSize:R.limit,onChange:function(e,n){R.page=e,z(s()({},R)),Ne()},total:T||0})})]}),(0,U.jsx)(D.Z,{visible:ie,title:"教材",onCancel:function(){return le(!1)},onOk:ke})]})]})}))},46165:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]); \ No newline at end of file