filesbox/web/dist/p__Setting__Notice.4d1fb70b...
2024-07-26 14:10:54 +08:00

43 lines
18 KiB
JavaScript

(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[10655],{59879:function(te,S,e){"use strict";e.d(S,{Z:function(){return D}});var m=e(28991),p=e(67294),R={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},Z=R,k=e(27029),j=function(N,E){return p.createElement(k.Z,(0,m.Z)((0,m.Z)({},N),{},{ref:E,icon:Z}))};j.displayName="ReloadOutlined";var D=p.forwardRef(j)},19054:function(te,S,e){"use strict";var m=e(28991),p=e(81253),R=e(85893),Z=e(67294),k=e(47869),j=["fieldProps","request","params","proFieldProps"],D=function(E,$){var b=E.fieldProps,C=E.request,h=E.params,l=E.proFieldProps,B=(0,p.Z)(E,j);return(0,R.jsx)(k.Z,(0,m.Z)({valueType:"treeSelect",fieldProps:b,ref:$,request:C,params:h,filedConfig:{customLightMode:!0},proFieldProps:l},B))},T=Z.forwardRef(D);S.Z=T},13243:function(){},42139:function(te,S,e){"use strict";var m=e(11849),p=e(39428),R=e(3182),Z=e(57663),k=e(71577),j=e(67294),D=e(30672),T=e(85473),N=e(16894),E=e(37476),$=e(71975),b=e(1977),C=e(85893),h=l=>{var B=(0,D.YB)(),v=(0,D.v9)(ae=>ae.common),G=v.isMobile,g=l.rowKey,c=g===void 0?"":g,w=l.dragSortKey,F=l.isLoading,z=F===void 0?!1:F,M=l.columns,x=M===void 0?[]:M,P=l.data,L=P===void 0?[]:P,I=l.scroll,f=I===void 0?{x:768}:I,V=l.toolbar,s=l.toolbarTitle,d=l.toolbarAuth,K=l.toolBarRender,A=l.pagination,i=l.pageChange,_=l.rowClassName,H=l.rowSelection,ne=l.canDragSort,se=ne===void 0?!1:ne,Ee=l.handleDragSortEnd,ie=l.triggerClick,le=l.modalType,q=l.modalWidth,he=q===void 0?550:q,Me=l.title,oe=l.visible,y=l.setVisible,Y=l.modalChildren,re=l.afterClose,de=l.finish,_e=l.isSubmitLoading,De=_e===void 0?!1:_e,ue={title:Me,width:G&&le!="modal"?"100%":he,scrollToFirstError:!0,visible:oe,onVisibleChange:y,children:Y,trigger:(0,C.jsx)(k.Z,{type:"primary",icon:(0,C.jsx)(b.Z,{}),disabled:d!==void 0?!d:!1,onClick:ie,children:s||B.formatMessage({id:"common.add"})}),submitter:{submitButtonProps:{loading:De}},modalProps:{destroyOnClose:!0,maskClosable:!1,afterClose:re},drawerProps:{destroyOnClose:!0,maskClosable:!1,onClose:re,className:"selfDrawer",push:{distance:0}},onFinish:function(){var ae=(0,R.Z)((0,p.Z)().mark(function ce(me){return(0,p.Z)().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.abrupt("return",de(me));case 1:case"end":return J.stop()}},ce)}));function Pe(ce){return ae.apply(this,arguments)}return Pe}()},ee={className:"selfTable",loading:z,rowKey:c,columns:x,dataSource:L,scroll:f,rowClassName:_,rowSelection:H,pagination:A?(0,m.Z)((0,m.Z)({},A),{},{current:A==null?void 0:A.currentPage,showSizeChanger:!0}):!1,onChange:i,headerTitle:V?le==="modal"?(0,C.jsx)(E.Y,(0,m.Z)({},ue)):(0,C.jsx)($.a,(0,m.Z)({},ue)):!1,toolBarRender:K};return se&&!G?(0,C.jsx)(T.Z,(0,m.Z)((0,m.Z)({},ee),{},{size:"small",search:!1,options:!1,tableAlertRender:!1,dragSortKey:w,onDragSortEnd:Ee})):(0,C.jsx)(N.ZP,(0,m.Z)((0,m.Z)({},ee),{},{size:"small",search:!1,options:!1,tableAlertRender:!1}))};S.Z=h},74295:function(te,S,e){"use strict";var m=e(2824),p=e(67294),R=e(30672),Z=e(84587),k=e(37406),j=e(13243),D=e.n(j),T=e(85893),N=E=>{var $=E.defaultContent,b=$===void 0?"":$,C=E.getContent,h=(0,R.YB)(),l=(0,p.useState)(""),B=(0,m.Z)(l,2),v=B[0],G=B[1],g=(0,p.useState)(0),c=(0,m.Z)(g,2),w=c[0],F=c[1];function z(M){var x=M.replace(/<\/?((?!(img|video)).)*?\/?>/g,"").replace(/&nbsp;/gi,"").trim();if(x=="")return!0;var P="^[ ]+$",L=new RegExp(P);return L.test(x)}return(0,p.useEffect)(()=>{C(v,w)},[v,w]),(0,p.useEffect)(()=>{var M=z(b);G(b),F(M?0:1)},[b]),(0,T.jsx)("div",{id:"editor",className:D().editor,children:(0,T.jsx)(Z.M,{initialValue:b,init:{height:600,menubar:!1,statusbar:!1,promotion:!1,language:(0,R.Kd)(),plugins:`
lists advlist autolink emoticons link image imagetools media table preview code fullscreen
charmap print anchor searchreplace visualblocks insertdatetime media paste
`,toolbar:`
undo redo forecolor backcolor
bold italic underline strikethrough
fontselect fontsizeselect formatselect
alignleft aligncenter alignright alignjustify
bullist numlist outdent indent
emoticons link image media table preview code fullscreen
`,fontsize_formats:"12px 13px 14px 15px 16px 18px 20px 22px 24px 28px 32px 36px 48px",font_formats:"\u5FAE\u8F6F\u96C5\u9ED1=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;\u5B8B\u4F53=simsun,serif;\u4EFF\u5B8B\u4F53=FangSong,serif;\u9ED1\u4F53=SimHei,sans-serif;\u6977\u4F53=KaiTi;\u5E7C\u5706=YouYuan;\u534E\u6587\u7EC6\u9ED1=STXihei;\u534E\u6587\u4EFF\u5B8B=STFangsong;\u65B9\u6B63\u8212\u4F53=FZShuTi;\u65B9\u6B63\u59DA\u4F53=FZYaoti;\u534E\u6587\u5F69\u4E91=STCaiyun;\u534E\u6587\u7425\u73C0=STHupo;\u534E\u6587\u65B0\u9B4F=STXinwei;\u534E\u6587\u884C\u6977=STXingkai;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",toolbar_sticky:!0,image_advtab:!0,paste_data_images:!0,images_file_types:"jpg,png,jpeg",automatic_uploads:!0,content_style:`
html, body {
overflow-x: hidden;
}
body{
overflow-y: hidden;
margin: 10px;
line-height: 1;
}
img {
max-width: 100%;
height: auto;
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track-piece {
background-color: #ececed;
border-radius: 2px;
}
::-webkit-scrollbar-thumb {
background-color: #cdcdcd;
background-clip: padding-box;
border-radius: 3px;
}
`,images_upload_handler:(M,x,P)=>{var L=M.blob();if(!!L.name){var I=new FormData;I.append("file",L),I.append("busType","image"),fetch("/api/disk/upload",{method:"POST",body:I,headers:{token:(0,k.ej)("token")}}).then(f=>f.status===200?f.json():{success:!1}).then(f=>{var V=f.success,s=f.code,d=f.message;if(V){var K;x(window.location.origin+(f==null||(K=f.data)===null||K===void 0?void 0:K.previewPath))}else P(s?h.formatMessage({id:s,defaultMessage:d}):h.formatMessage({id:"explorer.upload.error"}))}).catch(function(f){P(h.formatMessage({id:"explorer.upload.error"})),console.log(f)})}},file_picker_types:"image",file_picker_callback:function(x,P,L){if(L.filetype=="image"){var I=document.querySelector(".tox-dialog-wrap");I.style.display="none",window.fileBoxApi.fileSelect({title:h.formatMessage({id:"explorer.selectImage",defaultMessage:"\u8BF7\u9009\u62E9\u56FE\u7247"}),type:"file",allowExt:"png,jpg,jpeg,xbm,tif,svgz,ico,tiff,gif,svg,webp,bmp",callback:function(V){var s,d=V.data,K=d===void 0?{}:d,A=K.selectItems,i=A===void 0?[]:A;i!=null&&i.length&&(s=i[0])!==null&&s!==void 0&&s.path&&(I.style.display="flex",x("".concat("").concat(i[0].path)))}})}}},onEditorChange:(M,x)=>{var P=z(M);G(M),F(P?0:1)}})})};S.Z=N},75465:function(te,S,e){"use strict";e.r(S);var m=e(71194),p=e(50146),R=e(49111),Z=e(19650),k=e(94233),j=e(51890),D=e(39428),T=e(3182),N=e(62350),E=e(24565),$=e(34792),b=e(48086),C=e(57663),h=e(71577),l=e(71153),B=e(60331),v=e(2824),G=e(19273),g=e(11849),c=e(67294),w=e(30672),F=e(5966),z=e(64317),M=e(19054),x=e(42139),P=e(34436),L=e(74295),I=e(4424),f=e(5171),V=e.n(f),s=e(85893),d="setting",K=A=>{var i=(0,w.YB)(),_=(0,w.I0)(),H=(0,w.v9)(a=>(0,g.Z)((0,g.Z)((0,g.Z)({},a.userManage),a[d]),{},{loading:a.loading.effects["".concat(d,"/getNoticeList")],isSubmitLoading:a.loading.effects["".concat(d,"/addNotice")]||a.loading.effects["".concat(d,"/editNotice")]})),ne=H.groupSelect,se=H.loading,Ee=se===void 0?!1:se,ie=H.isSubmitLoading,le=ie===void 0?!1:ie,q=H.page,he=H.noticeList;(0,G.Z)(A);var Me=(0,c.useState)(["authAll"]),oe=(0,v.Z)(Me,2),y=oe[0],Y=oe[1],re=(0,c.useState)(""),de=(0,v.Z)(re,2),_e=de[0],De=de[1],ue=(0,c.useState)(0),ee=(0,v.Z)(ue,2),ae=ee[0],Pe=ee[1],ce=(0,c.useState)([]),me=(0,v.Z)(ce,2),Le=me[0],J=me[1],Fe=(0,c.useState)([]),Ae=(0,v.Z)(Fe,2),ze=Ae[0],Ve=Ae[1],He=(0,c.useState)("add"),Re=(0,v.Z)(He,2),Oe=Re[0],Ze=Re[1],Ye=(0,c.useState)(!1),je=(0,v.Z)(Ye,2),Xe=je[0],be=je[1],Je=(0,c.useState)(!1),Be=(0,v.Z)(Je,2),Ke=Be[0],ye=Be[1],Qe=(0,c.useState)({}),Ue=(0,v.Z)(Qe,2),r=Ue[0],ve=Ue[1],qe=(0,c.useState)([]),We=(0,v.Z)(qe,2),ke=We[0],ea=We[1],aa=(0,c.useState)([]),we=(0,v.Z)(aa,2),ta=we[0],na=we[1],sa=[{title:i.formatMessage({id:"admin.setting.sendNoticeTime"}),dataIndex:"sendTime",width:180,render:(a,t)=>{var n;return(n=t.sendTime)===null||n===void 0?void 0:n.replace("T"," ")}},{title:i.formatMessage({id:"common.status"}),dataIndex:"status",width:130,render:a=>a==0?(0,s.jsx)(B.Z,{color:"volcano",children:i.formatMessage({id:"mack.dsh.n"})}):a==1?(0,s.jsx)(B.Z,{color:"purple",children:i.formatMessage({id:"admin.notice.done"})}):(0,s.jsx)(s.Fragment,{})},{title:i.formatMessage({id:"admin.setting.noticeTitle"}),dataIndex:"title",render:(a,t)=>(0,s.jsx)("span",{className:"limit2",title:t.title,onClick:()=>$e(t),children:t.title})},{title:i.formatMessage({id:"explorer.file.action"}),dataIndex:"option",align:"center",width:200,render:(a,t)=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.Z,{type:"link",size:"small",onClick:()=>ia(t),children:i.formatMessage({id:"common.edit"})}),(0,s.jsx)(h.Z,{type:"link",size:"small",onClick:()=>$e(t),children:i.formatMessage({id:"common.preview"})}),(0,s.jsx)(E.Z,{title:i.formatMessage({id:"common.ifDel"}),onConfirm:()=>_({type:"".concat(d,"/deleteNotice"),payload:{id:t.id},callback:()=>{b.ZP.success(i.formatMessage({id:"explorer.removeSuccess"})),Ne(),_({type:"setting/logOutClear"})}}),children:(0,s.jsx)(h.Z,{type:"link",size:"small",children:i.formatMessage({id:"common.delete"})})},"delete")]})}],Ne=()=>{_({type:"setting/getUnreadNum"})},ia=a=>{Ze("edit"),_({type:"".concat(d,"/getNoticeDetail"),payload:{id:a.id},callback:t=>{var n=t.userIds,o=n===void 0?[]:n,O=t.deptIds,u=O===void 0?[]:O,X=t.roleIds,U=X===void 0?[]:X,fe=t.deptParentLevel,_a=fe===void 0?[]:fe;ve((0,g.Z)((0,g.Z)({},a),t)),be(!0);var W=[];o!=null&&o.length&&(W=[...W,"authUser"]),u!=null&&u.length&&(W=[...W,"authGroup"]),U!=null&&U.length&&(W=[...W,"authRole"]),W.length||(W=["authAll"]),Y(W);var Ce=[...new Set(_a)],xe=[];Ce==null||Ce.map(Te=>{var Q=Te.split(",");xe=[...xe,...Q]});var Ie=[...new Set(xe)],Se=[],pe=[];Ie==null||Ie.map(Te=>{var Q=parseInt(Te);Q&&(Se=[...Se,Q],ke.includes(Q)||(pe=[...pe,Q]))}),da(pe),ea([...ke,...pe]),na(Se)}})},$e=a=>{if((a==null?void 0:a.id)==(r==null?void 0:r.id)&&r.content){ye(!0);return}_({type:"setting/previewNotice",payload:{id:a.id},callback:t=>{ve((0,g.Z)((0,g.Z)({},a),t)),ye(!0)}})},la=a=>{var t=a.current,n=a.pageSize;_({type:"".concat(d,"/update"),payload:{page:(0,g.Z)((0,g.Z)({},q),{},{currentPage:t,pageSize:n})}}),_({type:"".concat(d,"/getNoticeList")})},ge=[{label:i.formatMessage({id:"admin.plugin.authAll"}),key:"authAll"},{label:i.formatMessage({id:"admin.plugin.authUser"}),key:"authUser"},{label:i.formatMessage({id:"admin.plugin.authGroup"}),key:"authGroup"},{label:i.formatMessage({id:"admin.plugin.authRole"}),key:"authRole"}],Ge=(a,t)=>{var n=a,o=a.findIndex(O=>O===t);return o!==-1&&n.splice(o,1),Y(n),n},oa=a=>{var t,n,o,O=a==null||(t=a.target)===null||t===void 0||(n=t.innerText)===null||n===void 0?void 0:n.replace(/\s*/g,""),u=(o=ge.find(fe=>fe.label===O))===null||o===void 0?void 0:o.key;if(u=="authAll")Y([u]);else{var X=y.indexOf(u)!==-1;if(X){var U=Ge([...y],u);U.length||Y(["authAll"])}else Ge([...y,u],"authAll")}},ra=function(){var a=(0,T.Z)((0,D.Z)().mark(function t(n){var o;return(0,D.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:o=n.groupID,_({type:"userManage/getGroupSelect",payload:{parentID:o}});case 2:case"end":return u.stop()}},t)}));return function(n){return a.apply(this,arguments)}}(),da=function(){var a=(0,T.Z)((0,D.Z)().mark(function t(n){var o,O,u;return(0,D.Z)().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:o=0,O=n==null?void 0:n.length,u=()=>{O>o&&_({type:"userManage/getGroupSelect",payload:{parentID:n[o]},callback:()=>{o=o+1,u()}})},u();case 4:case"end":return U.stop()}},t)}));return function(n){return a.apply(this,arguments)}}(),ua=a=>{};return(0,c.useEffect)(()=>{_({type:"userManage/getUserList",payload:{currentPage:1,pageSize:1e4},callback:a=>{var t=[];t=a==null?void 0:a.map(n=>({label:(0,s.jsxs)(Z.Z,{size:8,align:"center",children:[(0,s.jsx)(j.C,{size:18,src:n.avatar||V(),style:{display:"block"}}),n.nickname||n.name]},n.userID),name:n.nickname||n.name,value:n.userID})),J(t)}}),_({type:"userManage/getGroupSelect"}),_({type:"role/getRoleList",callback:a=>{var t,n=a==null||(t=a.filter(o=>o.enable))===null||t===void 0?void 0:t.map(o=>{var O=P.O9.findIndex(X=>X===o.label),u=O==-1?0:O;return{label:(0,s.jsxs)(Z.Z,{size:8,align:"center",children:[(0,s.jsx)("i",{className:"roleIcon block",style:{background:o.label,border:"1px solid ".concat(P.ZY[u])}}),o.roleName]},o.roleID),name:o.roleName,value:o.roleID}});Ve(n)}})},[]),(0,c.useEffect)(()=>(_({type:"".concat(d,"/getNoticeList")}),()=>{_({type:"userManage/clear"}),_({type:"".concat(d,"/clear")})}),[]),(0,s.jsxs)("div",{className:"layoutBox",children:[(0,s.jsx)(x.Z,{rowKey:"id",isLoading:Ee,columns:sa,data:he,pagination:q,pageChange:la,search:!1,title:Oe=="add"?i.formatMessage({id:"common.add"}):i.formatMessage({id:"common.edit"}),visible:Xe,setVisible:be,isSubmitLoading:le,toolbar:!0,toolbarTitle:i.formatMessage({id:"admin.setting.sendNotice"}),modalWidth:"75vw",triggerClick:()=>{ve({}),Ze("add"),Y(["authAll"])},finish:a=>{var t=(0,g.Z)((0,g.Z)({},a),{},{id:r==null?void 0:r.id,enable:1,content:_e,userIds:y.indexOf("authUser")!==-1?a.userIds:[],deptIds:y.indexOf("authGroup")!==-1?a.deptIds:[],roleIds:y.indexOf("authRole")!==-1?a.roleIds:[]});if(console.log("---payload",t),ae==0){b.ZP.warning(i.formatMessage({id:"admin.notice.contentIsRequired"}));return}p.Z.confirm({content:i.formatMessage({id:"common.ifSubmit"}),okText:i.formatMessage({id:"common.ok"}),cancelText:i.formatMessage({id:"common.cancel"}),style:{top:200},onOk:()=>{_({type:"".concat(d,"/").concat(Oe=="add"?"addNotice":"editNotice"),payload:t,callback:()=>{b.ZP.success(i.formatMessage({id:"explorer.success"})),be(!1),Oe=="edit"&&ve({}),Ne(),_({type:"setting/logOutClear"})}})}})},modalChildren:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(F.Z,{name:"title",label:i.formatMessage({id:"admin.notice.title"}),initialValue:r==null?void 0:r.title,rules:[{required:!0,whitespace:!0,message:i.formatMessage({id:"explorer.notNull"})}],fieldProps:{maxLength:30}}),(0,s.jsx)("p",{style:{margin:"10px 0 5px"},children:i.formatMessage({id:"admin.notice.target"})}),(0,s.jsx)(h.Z.Group,{onClick:a=>oa(a),className:"sendObjBox",children:ge==null?void 0:ge.map(a=>(0,s.jsx)(h.Z,{type:y.indexOf(a.key)!==-1?"primary":"default",children:a.label},a.key))}),(0,s.jsx)(z.Z,{name:"userIds",label:i.formatMessage({id:"common.user"}),hidden:y.indexOf("authUser")==-1,options:Le,initialValue:r==null?void 0:r.userIds,fieldProps:{mode:"multiple",showArrow:!0,filterOption:(a,t)=>{var n;return((n=t==null?void 0:t.name)!==null&&n!==void 0?n:"").toLowerCase().includes(a.toLowerCase())}}}),(0,s.jsx)(M.Z,{name:"deptIds",label:i.formatMessage({id:"common.group"}),hidden:y.indexOf("authGroup")==-1,placeholder:i.formatMessage({id:"common.select"}),initialValue:r==null?void 0:r.deptIds,fieldProps:{showSearch:!0,multiple:!0,showArrow:!0,treeData:ne,loadData:ra,fieldNames:{label:"name",value:"groupID"},treeDefaultExpandedKeys:ta}}),(0,s.jsx)(z.Z,{name:"roleIds",label:i.formatMessage({id:"admin.member.role"}),hidden:y.indexOf("authRole")==-1,options:ze,initialValue:r==null?void 0:r.roleIds,fieldProps:{mode:"multiple",showArrow:!0,filterOption:(a,t)=>{var n;return((n=t==null?void 0:t.name)!==null&&n!==void 0?n:"").toLowerCase().includes(a.toLowerCase())}}}),(0,s.jsxs)("p",{style:{margin:"10px 0 0"},children:[(0,s.jsx)("span",{className:"requiredicon",children:"*"}),i.formatMessage({id:"admin.notice.content"})]}),(0,s.jsx)(L.Z,{defaultContent:r==null?void 0:r.content,getContent:(a,t)=>{De(a),Pe(t)}})]})}),Ke&&(0,s.jsx)(I.Z,{open:Ke,setOpenModel:ye,record:r})]})};S.default=K}}]);