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.
1 line
11 KiB
1 line
11 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8999],{2868:function(e,n,t){t.r(n),t.d(n,{default:function(){return E}});var r=t(17061),s=t.n(r),i=t(17156),o=t.n(i),a=t(27424),c=t.n(a),l=t(67294),u=t(68508),d=t(97183),f=t(2453),p=t(14446),h=t(55241),_=t(59758),x={flex_box_center:"flex_box_center___GfbI9",flex_space_between:"flex_space_between___m14JJ",flex_box_vertical_center:"flex_box_vertical_center___IKGDg",flex_box_center_end:"flex_box_center_end___JZxvM",flex_box_column:"flex_box_column___WnVa8",SubMentItem:"SubMentItem___P0LXo",MenuItem:"MenuItem___p91mQ",wrp:"wrp___kMQ4i",classroomInfo:"classroomInfo___rb1qC",title:"title___AQndp",titleLeft:"titleLeft___K7c9u",titleRight:"titleRight___BUODH",classroomUser:"classroomUser___NkYxe",headPic:"headPic___RD_it",teacherInfo:"teacherInfo___Gyj_W",classroomDesc:"classroomDesc___ng_AB",classroomDescBg:"classroomDescBg___Dz_DM",joinCouses:"joinCouses___U2D0G",bg:"bg___IcypX",leftMenus:"leftMenus___fF5qD",titleSelected:"titleSelected___Rqtd8",menuText:"menuText___jhrfq",totalCount:"totalCount___fqkbl",actions:"actions___NAYZl",task_count:"task_count___a1sYB",container:"container___djeCS",leftMenuActions:"leftMenuActions___lRhBF"},m=t(84519),v=t(88275),j=t(11475),g=t(13982),b=t(7),y=t(11486),Z=t(85893);var I=(0,v.connect)((function(e){return{user:e.user}}))((function(e){e.user;var n=e.CategoryId,t=e.IsShow,r=e.setIsShow,i=(e.dispatch,e.init),a=(0,l.useState)(),u=c()(a,2),d=u[0],h=u[1];return(0,Z.jsx)(p.Z,{title:n?"新建三级类目":"新建二级类目",width:424,onCancel:function(){r(!1)},onOk:o()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=3;break}return f.ZP.error("栏目名不能为空"),e.abrupt("return");case 3:return e.next=5,(0,m.ZP)("/api/programas.json",{method:"post",body:{name:d,parent_id:n}});case 5:0===e.sent.status&&(f.ZP.info("创建成功"),r(!1),h(""),i());case 7:case"end":return e.stop()}}),e)}))),open:t,children:(0,Z.jsx)(y.Z,{value:d,onChange:function(e){return h(e.target.value)},placeholder:"请输入不超过10个汉字的名称",maxLength:10})})}));var k=(0,v.connect)((function(e){return{user:e.user}}))((function(e){e.user;var n=e.CategoryId,t=e.name,r=e.IsShow,i=e.setIsShow,a=(e.dispatch,e.init),u=(0,l.useState)(),d=c()(u,2),h=d[0],_=d[1];return(0,l.useEffect)((function(){_(t)}),[t]),(0,Z.jsx)(p.Z,{title:"目录重命名",width:424,onCancel:function(){i(!1)},onOk:o()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h){e.next=3;break}return f.ZP.error("栏目名不能为空"),e.abrupt("return");case 3:return e.next=5,(0,m.ZP)("/api/programas/".concat(n,"/rename.json"),{method:"put",body:{name:h,id:n}});case 5:0===e.sent.status&&(f.ZP.info("修改成功"),i(!1),_(""),a());case 7:case"end":return e.stop()}}),e)}))),open:r,children:(0,Z.jsx)(y.Z,{value:h,onChange:function(e){return _(e.target.value)},placeholder:"请输入不超过10个汉字的名称",maxLength:10})})})),w=t(71577),S=t(12768);var C=(0,v.connect)((function(e){return{user:e.user}}))((function(e){e.user;var n,t,r,s,i=e.ItemData,o=e.setIssee;return e.dispatch,e.init,(0,Z.jsxs)("div",{children:[(0,Z.jsx)("div",{style:{textAlign:"right"},children:(0,b.Ny)()&&(0,Z.jsx)(w.ZP,{onClick:function(){return o(!1)},children:"编辑"})}),(0,Z.jsx)(S.Z,{value:i.content}),(null==i||null===(n=i.attachment)||void 0===n?void 0:n.id)&&(0,Z.jsx)("div",{children:(0,Z.jsxs)("a",{href:null==i||null===(t=i.attachment)||void 0===t?void 0:t.url,target:"_self",download:null==i||null===(r=i.attachment)||void 0===r?void 0:r.title,children:[(0,Z.jsx)("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),(0,Z.jsx)("span",{style:{color:"#000000"},children:null==i||null===(s=i.attachment)||void 0===s?void 0:s.title})]})})]})})),P=t(42122),N=t.n(P),M=t(92421),D=t(55373),B=t(80185);var L=(0,v.connect)((function(e){return{user:e.user}}))((function(e){e.user;var n,t,r=e.ItemData,i=e.setIssee,a=e.CategoryId,u=(e.dispatch,e.init,(0,l.useState)([])),d=c()(u,2),p=d[0],h=d[1],x=(0,l.useState)(r.content),v=c()(x,2),j=v[0],g=v[1],b={name:"file",multiple:!0,action:_.Z.API_SERVER+"/api/attachments.json",defaultFileList:(t=[],null==r||null===(n=r.attachments)||void 0===n||n.map((function(e){var n={uid:null==e?void 0:e.id,name:e.title,response:{id:e.id}};t.push(n)})),t),onRemove:function(e){(0,B.y8)({id:e.uid})},onChange:function(e){console.log("info",e);var n=e.file.status;"removed"===n&&h(e.fileList),"done"===n?(h(e.fileList),f.ZP.success("".concat(e.file.name," 文件上传成功"))):"error"===n&&f.ZP.error("".concat(e.file.name," 文件上传失败"))},beforeUpload:function(e){var n=e.size/1024/1024<150;return n||f.ZP.info("文件大小必须小于150MB"),n}};function y(){return(y=o()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.ZP)("/api/programas/".concat(a,"/update_content.json"),{method:"put",body:{id:a,content:j,attachment_id:I(p)}});case 2:e.sent&&(f.ZP.info("提交成功"),i(!0));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){var n;return e&&e.map((function(e){n=e.response.id})),n}return(0,Z.jsxs)("div",{children:[(0,Z.jsx)(D.Z,{defaultValue:j,onChange:function(e){return g(e)}}),(0,Z.jsxs)(M.Z,N()(N()({},b),{},{children:[(0,Z.jsx)(w.ZP,{className:"uploadBtn",children:"上传附件"}),"(单个文件150M以内)"]})),(0,Z.jsxs)("p",{style:{marginTop:"10px"},children:[(0,Z.jsx)(w.ZP,{style:{width:"90px"},onClick:function(){return function(){return y.apply(this,arguments)}()},children:"提交"}),(0,Z.jsx)(w.ZP,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:function(){return i(!0)},children:"取消"})]})]})})),R=u.Z.SubMenu,A=(d.Z.Content,d.Z.Sider);var E=(0,v.connect)((function(e){return{user:e.user,globalSetting:e.globalSetting}}))((function(e){e.user,e.dispatch;var n,t=e.globalSetting,r=(0,l.useState)(),i=c()(r,2),a=(i[0],i[1],(0,l.useState)(!1)),d=c()(a,2),v=d[0],y=d[1],w=(0,l.useState)(),S=c()(w,2),P=S[0],N=S[1],M=(0,l.useState)(),D=c()(M,2),B=D[0],E=D[1],T=(0,l.useState)(!1),q=c()(T,2),G=q[0],U=q[1],z=(0,l.useState)(""),O=c()(z,2),V=O[0],F=O[1],J=(0,l.useState)(""),Q=c()(J,2),Y=Q[0],H=Q[1],K=(0,l.useState)(!0),W=c()(K,2),X=W[0],$=W[1];function ee(){return ne.apply(this,arguments)}function ne(){return(ne=o()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.ZP)("/api/programas.json",{method:"get"});case 2:(n=e.sent)&&N(null==n?void 0:n.programas);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,l.useEffect)((function(){ee()}),[]),console.log("globalSetting",t);var te=function(){var e=o()(s()().mark((function e(n,t,r){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n,e.next=1===e.t0?3:2===e.t0?6:3===e.t0?10:4===e.t0?15:17;break;case 3:return E(null==t?void 0:t.id),y(!0),e.abrupt("break",17);case 6:return E(null==t?void 0:t.id),U(!0),F(null==t?void 0:t.name),e.abrupt("break",17);case 10:return e.next=12,(0,m.ZP)("/api/programas/".concat(null==t?void 0:t.id,"/top.json"),{method:"post",body:{id:null==t?void 0:t.id}});case 12:return 0===e.sent.status&&ee(),e.abrupt("break",17);case 15:return re((0,Z.jsxs)("p",{children:["删除之后不能恢复,",(0,Z.jsx)("br",{}),"是否确认删除?"]}),o()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.ZP)("/api/programas/".concat(null==t?void 0:t.id,".json"),{method:"delete",body:{id:null==t?void 0:t.id}});case 2:0===e.sent.status&&(f.ZP.info("删除成功"),ee());case 4:case"end":return e.stop()}}),e)})))),e.abrupt("break",17);case 17:case"end":return e.stop()}}),e)})));return function(n,t,r){return e.apply(this,arguments)}}(),re=function(e,n){p.Z.confirm({centered:!0,title:"提示",icon:(0,Z.jsx)(j.Z,{}),content:e,okText:"确认",onOk:function(){return n()},cancelText:"取消"})},se=function(e,n){return(0,Z.jsxs)("div",{className:x.leftMenuActions,children:[1===n&&(0,Z.jsx)("p",{className:"current",onClick:function(){return te(1,e,n)},children:"新建"}),(0,Z.jsx)("p",{className:"current",onClick:function(){return te(2,e,n)},children:"重命名"}),(0,Z.jsx)("p",{className:"current",onClick:function(){return te(3,e,n)},children:"置顶"}),(0,Z.jsx)("p",{className:"current",onClick:function(){return te(4,e,n)},children:"删除"})]})};function ie(){return oe.apply(this,arguments)}function oe(){return(oe=o()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.ZP)("/api/programas/".concat(B,"/content.json"),{method:"get",params:{id:B}});case 2:(n=e.sent)&&H(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,Z.jsxs)("div",{style:{marginBottom:"40px"},children:[(0,Z.jsx)("img",{style:{width:"100%"},src:_.Z.IMG_SERVER+"/".concat(null==t||null===(n=t.setting)||void 0===n?void 0:n.shixun_banner_url)}),(0,Z.jsxs)("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"},children:[(0,Z.jsx)(A,{width:244,className:x.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"},children:(0,Z.jsxs)(u.Z,{mode:"inline",children:[null==P?void 0:P.map((function(e,n){var t;return(null==e?void 0:e.children.length)>0?(0,Z.jsx)(R,{title:(0,Z.jsxs)("span",{className:"font16",children:[(0,Z.jsx)("span",{children:e.name}),!(0,b.Ny)()&&(0,Z.jsx)("span",{}),(0,b.Ny)()&&(0,Z.jsx)(h.Z,{placement:"right",content:function(){return se(e,1)},trigger:"hover",children:(0,Z.jsx)("span",{className:["iconfont icon-sandian",x.actions].join(" ")})})]}),children:null==e||null===(t=e.children)||void 0===t?void 0:t.map((function(e,n){return(0,Z.jsxs)(u.Z.Item,{className:null==x?void 0:x.SubMentItem,onClick:function(){E(null==e?void 0:e.id),B=null==e?void 0:e.id,ie()},children:[(0,Z.jsx)("span",{style:{flex:"1"},children:null==e?void 0:e.name}),(0,b.Ny)()&&(0,Z.jsx)(h.Z,{placement:"right",content:function(){return se(e,2)},trigger:"hover",children:(0,Z.jsx)("span",{className:["iconfont icon-sandian",x.actions].join(" ")})})]})}))}):(0,Z.jsxs)(u.Z.Item,{className:null==x?void 0:x.SubMentItem,onClick:function(){E(null==e?void 0:e.id),B=null==e?void 0:e.id,ie()},children:[(0,Z.jsx)("span",{style:{flex:"1"},children:null==e?void 0:e.name}),(0,b.Ny)()&&(0,Z.jsx)(h.Z,{placement:"right",content:function(){return se(e,1)},trigger:"hover",children:(0,Z.jsx)("span",{className:["iconfont icon-sandian",x.actions].join(" ")})})]})})),(0,Z.jsx)(u.Z.Item,{onClick:function(){E(""),B="",y(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:(0,Z.jsx)(g.Z,{style:{color:"#0152d9",fontSize:"16px"}}),children:"新增二级类目"})]})}),(0,Z.jsxs)("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"},children:[X&&(0,Z.jsx)(C,{ItemData:Y,setIssee:$}),!1===X&&(0,Z.jsx)(L,{ItemData:Y,setIssee:$,CategoryId:B})]})]}),(0,Z.jsx)(I,{CategoryId:B,IsShow:v,setIsShow:y,init:ee}),(0,Z.jsx)(k,{CategoryId:B,name:V,IsShow:G,setIsShow:U,init:ee})]})}))}}]); |