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.
2 lines
10 KiB
2 lines
10 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8999],{51927:function(ge,O,i){i.r(O),i.d(O,{default:function(){return ye}});var e=i(59301),F=i(20834),J=i(44e3),v=i(8591),B=i(43418),I=i(60324),k=i(46961),g={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"},C=i(76265),P=i(63144),Q=i(88289),Y=i(38391),S=i(35099),R=i(98135),K=(a,l,n)=>new Promise((m,f)=>{var p=t=>{try{u(n.next(t))}catch(s){f(s)}},d=t=>{try{u(n.throw(t))}catch(s){f(s)}},u=t=>t.done?m(t.value):Promise.resolve(t.value).then(p,d);u((n=n.apply(a,l)).next())});function W({user:a,CategoryId:l,IsShow:n,setIsShow:m,dispatch:f,init:p}){const[d,u]=(0,e.useState)();return e.createElement(B.default,{title:l?"\u65B0\u5EFA\u4E09\u7EA7\u7C7B\u76EE":"\u65B0\u5EFA\u4E8C\u7EA7\u7C7B\u76EE",width:424,onCancel:()=>{m(!1)},onOk:()=>K(this,null,function*(){if(!d){v.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,C.ZP)("/api/programas.json",{method:"post",body:{name:d,parent_id:l}})).status===0&&(v.ZP.info("\u521B\u5EFA\u6210\u529F"),m(!1),u(""),p())}),open:n},e.createElement(R.default,{value:d,onChange:t=>u(t.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var X=(0,P.connect)(({user:a})=>({user:a}))(W),q=(a,l,n)=>new Promise((m,f)=>{var p=t=>{try{u(n.next(t))}catch(s){f(s)}},d=t=>{try{u(n.throw(t))}catch(s){f(s)}},u=t=>t.done?m(t.value):Promise.resolve(t.value).then(p,d);u((n=n.apply(a,l)).next())});function ee({user:a,CategoryId:l,name:n,IsShow:m,setIsShow:f,dispatch:p,init:d}){const[u,t]=(0,e.useState)();return(0,e.useEffect)(()=>{t(n)},[n]),e.createElement(B.default,{title:"\u76EE\u5F55\u91CD\u547D\u540D",width:424,onCancel:()=>{f(!1)},onOk:()=>q(this,null,function*(){if(!u){v.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,C.ZP)(`/api/programas/${l}/rename.json`,{method:"put",body:{name:u,id:l}})).status===0&&(v.ZP.info("\u4FEE\u6539\u6210\u529F"),f(!1),t(""),d())}),open:m},e.createElement(R.default,{value:u,onChange:s=>t(s.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var te=(0,P.connect)(({user:a})=>({user:a}))(ee),D=i(3113),ne=i(31272);function le({user:a,ItemData:l,setIssee:n,dispatch:m,init:f}){var p,d,u,t;return e.createElement("div",null,e.createElement("div",{style:{textAlign:"right"}},(0,S.Ny)()&&e.createElement(D.ZP,{onClick:()=>n(!1)},"\u7F16\u8F91")),e.createElement(ne.Z,{value:l.content}),((p=l==null?void 0:l.attachment)==null?void 0:p.id)&&e.createElement("div",null,e.createElement("a",{href:(d=l==null?void 0:l.attachment)==null?void 0:d.url,target:"_self",download:(u=l==null?void 0:l.attachment)==null?void 0:u.title},e.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),e.createElement("span",{style:{color:"#000000"}},(t=l==null?void 0:l.attachment)==null?void 0:t.title))))}var ue=(0,P.connect)(({user:a})=>({user:a}))(le),ae=i(46651),oe=i(94646),re=i(84794),se=Object.defineProperty,T=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable,$=(a,l,n)=>l in a?se(a,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[l]=n,de=(a,l)=>{for(var n in l||(l={}))ce.call(l,n)&&$(a,n,l[n]);if(T)for(var n of T(l))ie.call(l,n)&&$(a,n,l[n]);return a},me=(a,l,n)=>new Promise((m,f)=>{var p=t=>{try{u(n.next(t))}catch(s){f(s)}},d=t=>{try{u(n.throw(t))}catch(s){f(s)}},u=t=>t.done?m(t.value):Promise.resolve(t.value).then(p,d);u((n=n.apply(a,l)).next())});function fe({user:a,ItemData:l,setIssee:n,CategoryId:m,dispatch:f,init:p}){let[d,u]=(0,e.useState)([]);const[t,s]=(0,e.useState)(l.content);function h(){var c;let E=[];return(c=l==null?void 0:l.attachments)==null||c.map(y=>{let j={uid:y==null?void 0:y.id,name:y.title,response:{id:y.id}};E.push(j)}),E}const x={name:"file",multiple:!0,action:k.Z.API_SERVER+"/api/attachments.json",defaultFileList:h(),onRemove(c){(0,re.y8)({id:c.uid})},onChange(c){console.log("info",c);const{status:E}=c.file;E==="removed"&&u(c.fileList),E==="done"?(u(c.fileList),v.ZP.success(`${c.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`)):E==="error"&&v.ZP.error(`${c.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)},beforeUpload:c=>{const E=c.size/1024/1024<150;return E||v.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),E}};function b(){return me(this,null,function*(){(yield(0,C.ZP)(`/api/programas/${m}/update_content.json`,{method:"put",body:{id:m,content:t,attachment_id:Z(d)}}))&&(v.ZP.info("\u63D0\u4EA4\u6210\u529F"),n(!0))})}function Z(c){let E;return c&&c.map(y=>{E=y.response.id}),E}return e.createElement("div",null,e.createElement(oe.Z,{defaultValue:t,onChange:c=>s(c)}),e.createElement(ae.default,de({},x),e.createElement(D.ZP,{className:"uploadBtn"},"\u4E0A\u4F20\u9644\u4EF6"),"(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"),e.createElement("p",{style:{marginTop:"10px"}},e.createElement(D.ZP,{style:{width:"90px"},onClick:()=>b()},"\u63D0\u4EA4"),e.createElement(D.ZP,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:()=>n(!0)},"\u53D6\u6D88")))}var pe=(0,P.connect)(({user:a})=>({user:a}))(fe),N=(a,l,n)=>new Promise((m,f)=>{var p=t=>{try{u(n.next(t))}catch(s){f(s)}},d=t=>{try{u(n.throw(t))}catch(s){f(s)}},u=t=>t.done?m(t.value):Promise.resolve(t.value).then(p,d);u((n=n.apply(a,l)).next())});const{SubMenu:Ee}=F.default,{Content:Ce,Sider:he}=J.default;function ve({user:a,dispatch:l,globalSetting:n}){var m;const[f,p]=(0,e.useState)(),[d,u]=(0,e.useState)(!1),[t,s]=(0,e.useState)();let[h,x]=(0,e.useState)();const[b,Z]=(0,e.useState)(!1),[c,E]=(0,e.useState)(""),[y,j]=(0,e.useState)(""),[G,V]=(0,e.useState)(!0);(0,e.useEffect)(()=>{A()},[]),console.log("globalSetting",n);function A(){return N(this,null,function*(){const o=yield(0,C.ZP)("/api/programas.json",{method:"get"});o&&s(o==null?void 0:o.programas)})}const M=(o,r,w)=>N(this,null,function*(){switch(o){case 1:x(r==null?void 0:r.id),u(!0);break;case 2:x(r==null?void 0:r.id),Z(!0),E(r==null?void 0:r.name);break;case 3:(yield(0,C.ZP)(`/api/programas/${r==null?void 0:r.id}/top.json`,{method:"post",body:{id:r==null?void 0:r.id}})).status===0&&A();break;case 4:_e(e.createElement("p",null,"\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u6062\u590D,",e.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),()=>N(this,null,function*(){(yield(0,C.ZP)(`/api/programas/${r==null?void 0:r.id}.json`,{method:"delete",body:{id:r==null?void 0:r.id}})).status===0&&(v.ZP.info("\u5220\u9664\u6210\u529F"),A())}));break}}),_e=(o,r)=>{B.default.confirm({centered:!0,title:"\u63D0\u793A",icon:e.createElement(Q.Z,null),content:o,okText:"\u786E\u8BA4",onOk:()=>r(),cancelText:"\u53D6\u6D88"})},L=(o,r)=>e.createElement("div",{className:g.leftMenuActions},r===1&&e.createElement("p",{className:"current",onClick:()=>M(1,o,r)},"\u65B0\u5EFA"),e.createElement("p",{className:"current",onClick:()=>M(2,o,r)},"\u91CD\u547D\u540D"),e.createElement("p",{className:"current",onClick:()=>M(3,o,r)},"\u7F6E\u9876"),e.createElement("p",{className:"current",onClick:()=>M(4,o,r)},"\u5220\u9664"));function z(){return N(this,null,function*(){const o=yield(0,C.ZP)(`/api/programas/${h}/content.json`,{method:"get",params:{id:h}});o&&j(o)})}return e.createElement("div",{style:{marginBottom:"40px"}},e.createElement("img",{style:{width:"100%"},src:k.Z.IMG_SERVER+`/${(m=n==null?void 0:n.setting)==null?void 0:m.shixun_banner_url}`}),e.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},e.createElement(he,{width:244,className:g.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},e.createElement(F.default,{mode:"inline"},t==null?void 0:t.map((o,r)=>{var w,U;return(o==null?void 0:o.children.length)>0?e.createElement(Ee,{title:e.createElement("span",{className:"font16"},e.createElement("span",null,o.name),!(0,S.Ny)()&&e.createElement("span",null),(0,S.Ny)()&&e.createElement(I.Z,{placement:"right",content:()=>L(o,1),trigger:"hover"},e.createElement("span",{className:["iconfont icon-sandian",g.actions].join(" ")})))},(w=o==null?void 0:o.children)==null?void 0:w.map((_,xe)=>{var H;return e.createElement(F.default.Item,{className:(H=g)==null?void 0:H.SubMentItem,onClick:()=>{x(_==null?void 0:_.id),h=_==null?void 0:_.id,z()}},e.createElement("span",{style:{flex:"1"}},_==null?void 0:_.name),(0,S.Ny)()&&e.createElement(I.Z,{placement:"right",content:()=>L(_,2),trigger:"hover"},e.createElement("span",{className:["iconfont icon-sandian",g.actions].join(" ")})))})):e.createElement(F.default.Item,{className:(U=g)==null?void 0:U.SubMentItem,onClick:()=>{x(o==null?void 0:o.id),h=o==null?void 0:o.id,z()}},e.createElement("span",{style:{flex:"1"}},o==null?void 0:o.name),(0,S.Ny)()&&e.createElement(I.Z,{placement:"right",content:()=>L(o,1),trigger:"hover"},e.createElement("span",{className:["iconfont icon-sandian",g.actions].join(" ")})))}),e.createElement(F.default.Item,{onClick:()=>{x(""),h="",u(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:e.createElement(Y.Z,{style:{color:"#0152d9",fontSize:"16px"}})},"\u65B0\u589E\u4E8C\u7EA7\u7C7B\u76EE"))),e.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},G&&e.createElement(ue,{ItemData:y,setIssee:V}),G===!1&&e.createElement(pe,{ItemData:y,setIssee:V,CategoryId:h}))),e.createElement(X,{CategoryId:h,IsShow:d,setIsShow:u,init:A}),e.createElement(te,{CategoryId:h,name:c,IsShow:b,setIsShow:Z,init:A}))}var ye=(0,P.connect)(({user:a,globalSetting:l})=>({user:a,globalSetting:l}))(ve)}}]);
|