|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[21265],{520:function(e,n,t){t.d(n,{Z:function(){return m}});var s=t(79800),a=t.n(s),i=t(59301),c=t(54416),r=t(3113),o=t(44539),l=t(65041),u=t(14834),d=t(37712),m=function(){var e=(0,i.useState)(""),n=a()(e,2),t=n[0],s=n[1],m=(0,i.useState)(0),p=a()(m,2),f=p[0],x=p[1],h=(0,i.useRef)("");function j(e){27==e.keyCode&&h.current&&g()}function g(){document.body.style.overflow="auto",s("")}(0,i.useEffect)((function(){return c.Z.subscribe("preview-image",(function(e){s(e),document.body.style.overflow="hidden"}))}),[]),(0,i.useEffect)((function(){return document.addEventListener("keydown",j),function(){document.removeEventListener("keydown",j)}}),[]),(0,i.useEffect)((function(){h.current=t}),[t]);var y=(0,i.useRef)(),v=(0,i.useRef)();return(0,d.jsx)(i.Fragment,{children:t?(0,d.jsxs)("div",{className:"image-preview-container",ref:y,onClick:function(e){e.nativeEvent.target!==y.current&&e.nativeEvent.target!==v.current||g()},children:[(0,d.jsxs)("div",{className:"button-group",children:[(0,d.jsxs)(r.ZP,{onClick:function(){x(f+90)},children:["旋转",(0,d.jsx)(o.Z,{})]}),(0,d.jsxs)(r.ZP,{href:t,children:["下载",(0,d.jsx)(l.Z,{})]}),(0,d.jsxs)(r.ZP,{onClick:g,children:["关闭",(0,d.jsx)(u.Z,{})]})]}),(0,d.jsx)("div",{className:"preview-wrp-group",ref:v,children:(0,d.jsx)("img",{className:"image-preview",src:t,alt:"预览大图",style:{transform:"rotate(".concat(f,"deg)")}})})]}):null})}},44206:function(e,n,t){t.r(n),t.d(n,{default:function(){return V}});var s=t(7557),a=t.n(s),i=t(41498),c=t.n(i),r=t(82242),o=t.n(r),l=t(79800),u=t.n(l),d=t(59301),m=t(96707),p=t(6848),f=t(8591),x=t(98135),h=t(3113),j=t(56511),g=t(28103),y=t(53864),v=t(26683),b=t(44132),k=t(43418),Z=t(51836),L=t(37712),_=(0,m.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var n=e.classroomList,t=e.dispatch,s=(0,m.useParams)();return s.id=s.coursesId,(0,L.jsx)(k.Z,{centered:!0,title:"提示",open:"删除"===n.actionTabs.key,okText:"确定",cancelText:"取消",onOk:c()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.ZP)("/api/courses/".concat(s.id,"/delete_informs.json"),{method:"delete",body:{inform_id:n.actionTabs.selectArrs}});case 2:0===e.sent.status&&(f.ZP.success("删除成功"),t({type:"classroomList/setActionTabs",payload:{}}),t({type:"classroomList/getAnnouncementList",payload:o()({},s)}),t({type:"classroomList/getClassroomLeftMenus",payload:{id:s.coursesId}}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){t({type:"classroomList/setActionTabs",payload:{}})},children:(0,L.jsx)("p",{children:"是否确认删除?"})})})),w=t(22845),C=t(97972),N=t(22961),P="bg___kC6GY",A="containerTitle___viXsQ",S="titleRightMenu___uPdNX",T="listItem___VLyCT",E="listItemTitle___mgzQl",z="info___WcBsl",I="actionButton___j1EZ1",R=t(520),G=t(54416),M=t(76279),V=(0,m.connect)((function(e){var n=e.classroomList,t=e.announcement,s=e.loading;return{classroomList:n,globalSetting:e.globalSetting,announcement:t,loading:s.effects}}))((function(e){var n=e.classroomList,t=(e.globalSetting,e.loading),s=e.dispatch,i=(0,d.useState)(o()({},(0,m.useParams)())),r=u()(i,2),l=r[0],k=r[1],Z=n.detailAnnouncementList,V=(0,d.useState)(-1),B=u()(V,2),J=B[0],O=B[1],Q=(0,d.useState)(!1),X=u()(Q,2),D=X[0],F=X[1],H=(0,d.useState)(!1),U=u()(H,2),W=U[0],Y=U[1],q=(0,d.useState)({name:"",description:""}),K=u()(q,2),$=K[0],ee=K[1];(0,d.useRef)();l.id=l.coursesId,(0,d.useEffect)((function(){k(o()({},l)),s({type:"classroomList/getAnnouncementList",payload:o()({},l)})}),[n.name]),(0,d.useEffect)((function(){"目录重命名成功"===n.actionTabs.key&&s({type:"classroomList/getAnnouncementList",payload:o()({},l)})}),[n.actionTabs.key]);var ne=function(){var e=c()(a()().mark((function e(n,t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="up"===e.t0?3:"down"===e.t0?6:"del"===e.t0?9:"edit"===e.t0?11:15;break;case 3:return e.next=5,s({type:"announcement/informUp",payload:o()({inform_id:n.id},l)});case 5:return e.abrupt("break",15);case 6:return e.next=8,s({type:"announcement/informDown",payload:o()({inform_id:n.id},l)});case 8:return e.abrupt("break",15);case 9:return s({type:"classroomList/setActionTabs",payload:{key:"删除",selectArrs:n.id}}),e.abrupt("break",15);case 11:return $.name=n.name,$.description=n.description,O(n.key),e.abrupt("break",15);case 15:"down"!==t&&"up"!==t||s({type:"classroomList/getAnnouncementList",payload:o()({},l)});case 16:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),te=function(e,n){return e.key=n,(0,L.jsx)("section",{children:(0,N.GJ)()&&(0,L.jsxs)("aside",{children:[0!==n&&(0,L.jsx)(p.Z,{placement:"bottom",title:"上移",children:(0,L.jsx)("span",{className:"iconfont c-blue ml30 icon-shangyi_Hover",onClick:function(){ne(e,"up")}})}),n<Z.informs.length-1&&(0,L.jsx)(p.Z,{placement:"bottom",title:"下移",children:(0,L.jsx)("span",{className:"iconfont c-blue ml30 icon-xiayi_moren",onClick:function(){ne(e,"down")}})}),(0,L.jsx)(p.Z,{placement:"bottom",title:"删除",children:(0,L.jsx)("span",{className:"iconfont c-blue current ml30 icon-shanchu",onClick:function(){ne(e,"del")}})}),(0,L.jsx)(p.Z,{placement:"bottom",title:"编辑",children:(0,L.jsx)("span",{className:"iconfont c-blue current ml30 icon-bianjishijuan3x",onClick:function(){ne(e,"edit")}})})]})})},se=function(){var e=c()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==$.name){e.next=4;break}f.ZP.error("请输入标题"),e.next=14;break;case 4:if(""!==$.description){e.next=8;break}f.ZP.error("请输入内容"),e.next=14;break;case 8:return Y(!0),e.next=11,(0,C.An)(o()(o()({},l),$));case 11:n=e.sent,Y(!1),0===n.status&&((0,M.L9)(["教学课堂","公告栏","发布公告"]),f.ZP.success("发布成功"),F(!1),ee({name:"",description:""}),s({type:"classroomList/getAnnouncementList",payload:o()({},l)}),s({type:"classroomList/getClassroomLeftMenus",payload:{id:l.coursesId}}));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=function(){var e=c()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==$.name){e.next=4;break}f.ZP.error("请输入标题"),e.next=12;break;case 4:if(""!==$.description){e.next=8;break}f.ZP.error("请输入内容"),e.next=12;break;case 8:return e.next=10,(0,C.my)(o()(o()(o()({},l),$),{},{inform_id:n.id}));case 10:0===e.sent.status&&(f.ZP.success("更新成功"),O(-1),s({type:"classroomList/getAnnouncementList",payload:o()({},l)}));case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ie=function(e){var n=e.target,t=n.nodeName,s=n.src;"IMG"===t&&(G.Z.publish("preview-image",s),console.log("src:",s))};return(0,L.jsxs)("section",{children:[(0,L.jsx)("aside",{className:P,children:(0,L.jsxs)("div",{className:A,children:[(0,L.jsx)("div",{className:"font16",children:(null==Z?void 0:Z.main_category_name)||"通知公告"}),(0,L.jsx)("div",{className:S,children:(0,N.GJ)()&&(0,L.jsx)("span",{className:"c-blue current",onClick:function(){F(!0)},children:"新建"})})]})}),(0,L.jsxs)("aside",{className:"bg-white pl30 pr30 pt30",children:[D&&(0,L.jsxs)("div",{className:"pb30",children:[(0,L.jsx)(x.Z,{maxLength:60,onChange:function(e){$.name=e.target.value,ee(o()({},$))},suffix:(0,L.jsxs)("span",{children:[$.name.length,"/60"]}),size:"middle",placeholder:"请在此输入标题,最多60个字符"}),(0,L.jsx)("div",{className:"mt15",children:(0,L.jsx)(v.Z,{watch:!0,onChange:function(e){$.description=e},placeholder:"请在此输入内容,最多5000个字符"})}),(0,L.jsxs)("div",{className:I,children:[(0,L.jsx)(h.ZP,{type:"primary",onClick:function(){ee({name:"",description:""}),F(!1)},ghost:!0,size:"middle",children:"取消"}),(0,L.jsx)(h.ZP,{loading:W,type:"primary",onClick:function(){return se()},size:"middle",children:"提交"})]})]}),(0,L.jsxs)(j.Z,{loading:t["classroomList/getAttachmentList"],active:!0,avatar:{size:40},paragraph:{rows:5},className:"mt30",children:[0===Z.informs_count&&!D&&(0,L.jsx)("div",{className:"pb30",children:(0,L.jsx)(w.Z,{})}),Z.informs&&Z.informs.map((function(e,n){return(0,L.jsxs)("div",{className:T,children:[J===n&&(0,L.jsxs)("div",{children:[(0,L.jsx)(x.Z,{max:60,onChange:function(e){$.name=e.target.value,ee(o()({},$))},suffix:(0,L.jsxs)("span",{children:[$.name.length,"/60"]}),defaultValue:e.name,size:"middle",placeholder:"请在此输入标题,最多60个字符"}),(0,L.jsx)("div",{className:"mt15",children:(0,L.jsx)(v.Z,{watch:!0,onChange:function(e){$.description=e},placeholder:"请在此输入内容,最多5000个字符",defaultValue:e.description})}),(0,L.jsxs)("div",{className:I,children:[(0,L.jsx)(h.ZP,{type:"primary",onClick:function(){return O(-1)},ghost:!0,size:"middle",children:"取消"}),(0,L.jsx)(h.ZP,{type:"primary",onClick:function(){return ae(e)},size:"middle",children:"提交"})]})]}),J!==n&&(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{className:E,children:[(0,L.jsx)("div",{className:"font20 c-black bold",children:e.name}),!D&&te(e,n)]}),(0,L.jsx)("div",{onClick:ie,className:z,children:(0,L.jsx)(b.Z,{value:e.description})})]}),(0,L.jsx)(g.Z,{})]},n)})),(0,L.jsx)("aside",{className:"tc mb50 mt30",children:(0,L.jsx)(y.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,n){l.page=e,k(o()({},l)),s({type:"classroomList/getAnnouncementList",payload:o()({},l)})},defaultCurrent:1,current:l.page||1,total:Z.polls&&Z.polls.exercises_all_counts})})]})]}),(0,L.jsx)(_,{}),(0,L.jsx)(R.Z,{})]})}))}}]); |