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
12 KiB
2 lines
12 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7718],{38827:function(se,H,r){r.d(H,{Z:function(){return T}});var n=r(59301),d={flex_box_center:"flex_box_center___A3pzf",flex_space_between:"flex_space_between___JBoa5",flex_box_vertical_center:"flex_box_vertical_center___MJuIO",flex_box_center_end:"flex_box_center_end___OcjUA",flex_box_column:"flex_box_column___zSH4A",list:"list___KhJas",middle:"middle___IjlYi",row:"row___GGtIx",title:"title___o_xqf",size:"size___OVRoL",download:"download___ZLcIH",preview:"preview___gi0kI",annotation:"annotation___KVSwj"},I=r(92310),G=r.n(I),J=r(95333),W=r(67051),S=r(15826),c=r(46961),g=r(76265),P=r(35099),Z=(x,v,o)=>new Promise((C,z)=>{var B=m=>{try{h(o.next(m))}catch(b){z(b)}},A=m=>{try{h(o.throw(m))}catch(b){z(b)}},h=m=>m.done?C(m.value):Promise.resolve(m.value).then(B,A);h((o=o.apply(x,v)).next())}),T=({className:x,style:v,dataSource:o=[],authority:C=!1,callback:z,showDimensions:B=!0})=>{const[A,h]=(0,n.useState)({content:"",type:""}),[m,b]=(0,n.useState)({}),[Y,k]=(0,n.useState)(!1),[ie,K]=(0,n.useState)({title:"",visible:!1,src:"",snapshotData:{}}),X=(0,n.useRef)(),j=l=>Z(void 0,null,function*(){if(b(l),l.file_type==="txt"){const f=yield(0,g.ZP)(l.url,{method:"get",headers:{"Content-Type":"application/xml"}});X.current=f}h({type:l.file_type,content:c.Z.API_SERVER+l.url})}),q=l=>{var f;K({visible:!0,src:c.Z.API_SERVER+l.url,id:l.id,title:l.title,snapshotData:(f=l==null?void 0:l.subitem)==null?void 0:f.settings})},re=l=>Z(void 0,null,function*(){var f;h({type:l.file_type,content:c.Z.API_SERVER+((f=l==null?void 0:l.subitem)==null?void 0:f.url)})}),ee=()=>{z(),K({visible:!1})};return o!=null&&o.length?n.createElement(n.Fragment,null,n.createElement("div",{className:G()(d.list,x),style:v},o.map((l,f)=>{var te,ne,ue;return n.createElement("div",{key:f,className:d.row},n.createElement("div",{className:d.title,onClick:()=>j(l)},n.createElement("i",{className:"iconfont icon-fujian1"}),n.createElement("span",{title:l.title},l.title)),n.createElement("div",{className:d.size},l.filesize),n.createElement("div",{className:d.download,onClick:()=>{var t;(0,S.Nd)("",`${c.Z.API_SERVER}${(t=l.url)==null?void 0:t.replace("disposition=inline","")}`)}},n.createElement("i",{className:"iconfont icon-xiazai4"}),"\u4E0B\u8F7D"),!["other","download"].includes(l==null?void 0:l.file_type)&&n.createElement("div",{className:d.preview,onClick:()=>j(l)},n.createElement("i",{className:"iconfont icon-yulan"}),"\u9884\u89C8"),["image"].includes(l==null?void 0:l.file_type)&&B&&(C?n.createElement("div",{className:d.annotation,onClick:()=>q(l)},n.createElement("i",{className:"iconfont icon-pizhu"}),(te=l.subitem)!=null&&te.id?"\u4FEE\u6539\u6279\u6CE8":"\u6279\u6CE8"):((ne=l.subitem)==null?void 0:ne.id)&&n.createElement("div",{className:d.annotation,onClick:()=>re(l)},n.createElement("i",{className:"iconfont icon-chakanlaoshipizhu1"}),"\u67E5\u770B\u8001\u5E08\u6279\u6CE8")),["image"].includes(l==null?void 0:l.file_type)&&((ue=l.subitem)==null?void 0:ue.id)&&n.createElement("div",{className:d.download,style:{marginLeft:20},onClick:()=>{var t,u;(0,S.Nd)("",`${c.Z.API_SERVER}${(u=(t=l==null?void 0:l.subitem)==null?void 0:t.url)==null?void 0:u.replace("disposition=inline","")}`)}},n.createElement("i",{className:"iconfont icon-xiazai4"}),"\u4E0B\u8F7D\u6279\u6CE8\u6587\u4EF6"),["office"].includes(l==null?void 0:l.file_type)&&(0,P.eB)()&&["xlsx","docx","pptx"].includes(l==null?void 0:l.file_sub)&&B&&n.createElement("div",{className:d.annotation,onClick:()=>{k(!0),j(l)}},n.createElement("i",{className:"iconfont icon-pizhu"}),l.is_edit?"\u4FEE\u6539\u6279\u6CE8":"\u6279\u6CE8"),l.is_edit&&(0,P.dE)()&&B&&n.createElement("div",{className:d.annotation,onClick:()=>{j(l)}},n.createElement("i",{className:"iconfont icon-sousuo7"}),"\u67E5\u770B\u8001\u5E08\u6279\u6CE8"))})),n.createElement(J.Z,{close:!0,data:A==null?void 0:A.content,type:A==null?void 0:A.type,hasMask:!0,editOffice:Y?"edit":"view",monacoEditor:{value:X.current,language:"txt",onChange:()=>{},options:{readOnly:!0,fontSize:14,minimap:{enabled:!1}}},onImgDimensions:C&&B&&A.type==="image"?()=>q(m):null,onClose:()=>{z(),k(!1),h({content:"",type:""})}}),n.createElement(W.Z,{onOk:ee,onClose:()=>K({visible:!1}),data:ie})):null}},93400:function(se,H,r){r.d(H,{z:function(){return ne},Z:function(){return ue}});var n=r(59301),d=r(46651),I=r(8591),G=r(43418),J=r(3113),W=r(46961),S=r(73960),c=Object.defineProperty,g=Object.getOwnPropertySymbols,P=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable,V=(t,u,e)=>u in t?c(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,T=(t,u)=>{for(var e in u||(u={}))P.call(u,e)&&V(t,e,u[e]);if(g)for(var e of g(u))Z.call(u,e)&&V(t,e,u[e]);return t},x=(t,u,e)=>new Promise((M,E)=>{var y=s=>{try{_(e.next(s))}catch(a){E(a)}},L=s=>{try{_(e.throw(s))}catch(a){E(a)}},_=s=>s.done?M(s.value):Promise.resolve(s.value).then(y,L);_((e=e.apply(t,u)).next())});const v="\u3000\u3000";function o(t){var u=["Bytes","KB","MB","GB","TB"];if(t==0)return"0 Byte";var e=parseInt(""+Math.floor(Math.log(t)/Math.log(1024)),10);return(t/Math.pow(1024,e)).toFixed(1)+" "+u[e]}var C=({value:t=[],action:u,onChange:e,className:M,maxSize:E=150,title:y="\u6587\u4EF6\u4E0A\u4F20",accept:L=null})=>{const _={multiple:!1,fileList:t,accept:L,withCredentials:!0,beforeUpload:a=>a.size/1024/1024<E?!0:(message.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${E}MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20`),Promise.reject()),action:`${ENV.API_SERVER}/api/attachments.json`,onChange(a){var N,O,$,le;let U=[...a.fileList];if(U=U.map(D=>(D.name.indexOf(v)===-1&&(D.name=`${D.name}${v}${o(D.size)}`),T({},D))),a.file.status==="done"&&((O=(N=a.file)==null?void 0:N.response)==null?void 0:O.status)===-1){message.error((le=($=a.file)==null?void 0:$.response)==null?void 0:le.message),e([]);return}e(U)},onRemove:a=>x(void 0,null,function*(){const N=a.size/1024/1024;return a.status==="uploading"?!0:N<E&&(a.response?a.response.id:a.uid)?yield removeAttachment(a.response?a.response.id:a.id):!0})};function s(a){a.preventDefault(),a.stopPropagation()}return React.createElement("div",{className:`single-upload ${M||""}`},React.createElement(Upload,T({},_),React.createElement(Button,{type:"primary",title:t.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:t.length>0,ghost:!0},y),React.createElement("span",{onClick:s,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",E,"M)"," ")))},z=r(93737),B=r(89392),A=Object.defineProperty,h=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,Y=(t,u,e)=>u in t?A(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,k=(t,u)=>{for(var e in u||(u={}))m.call(u,e)&&Y(t,e,u[e]);if(h)for(var e of h(u))b.call(u,e)&&Y(t,e,u[e]);return t};const ie=t=>React.createElement("svg",k({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},t),React.createElement("title",null,"\u5F62\u72B6"),React.createElement("path",{d:"M10.354 3.5h-2.77v8.167H6.416V3.5H3.646L7 0l3.354 3.5ZM14 7h-1.167v5.833H1.167V7H0v7h14V7Z",fill:"#3061D0",fillRule:"nonzero"}));var K="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",X=Object.defineProperty,j=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable,ee=(t,u,e)=>u in t?X(t,u,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[u]=e,l=(t,u)=>{for(var e in u||(u={}))q.call(u,e)&&ee(t,e,u[e]);if(j)for(var e of j(u))re.call(u,e)&&ee(t,e,u[e]);return t},f=(t,u,e)=>new Promise((M,E)=>{var y=s=>{try{_(e.next(s))}catch(a){E(a)}},L=s=>{try{_(e.throw(s))}catch(a){E(a)}},_=s=>s.done?M(s.value):Promise.resolve(s.value).then(y,L);_((e=e.apply(t,u)).next())});const{Dragger:te}=d.default;function ne(t){let u=[];return t&&t.length>0&&(u=t.map(e=>({uid:e.id,id:e.id,name:e.title+v+e.filesize,url:e.url,filesize:e.filesize,status:"done",response:{id:e.id}}))),u}var ue=({value:t,onChange:u,action:e,data:M,className:E,maxSize:y=150,title:L="\u4E0A\u4F20\u9644\u4EF6",showRemoveModal:_=!1,accept:s="",additionalText:a,isDragger:N,number:O=1e3,aloneClear:$=!1,realTimeRemove:le=!0})=>{const[U,D]=(0,n.useState)(!1);let[p,ae]=(0,n.useState)(t||[]),[fe,Ee]=(0,n.useState)(1);(0,n.useEffect)(()=>{t&&(fe===1&&ae([...t]),Ee(2),O===(t==null?void 0:t.length)&&D(!0))},[t]);const ce=()=>{setTimeout(()=>{p.pop(),ae([...p])},500)},de={multiple:!0,disabled:U,accept:s,withCredentials:!0,fileList:p,beforeUpload:(i,R)=>{const w=i.size/1024/1024;return p.concat(R).length>O?(p.pop(),ae([...p]),I.ZP.error(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20${O}\u4E2A\u6587\u4EF6`),$?Promise.reject():(ce(),!1)):w<y?!0:(I.ZP.error(`\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(${y}MB).`),$?Promise.reject():(ce(),!1))},data:M,action:e||`${W.Z.API_SERVER}/api/attachments.json`,onChange(i){var R,w,Q,oe;if(i.file.status==="removed"?p=i.fileList:p=(0,B.uniqBy)([...i.fileList,...p],"uid"),i.file.status==="done"&&((w=(R=i.file)==null?void 0:R.response)==null?void 0:w.status)===-1){I.ZP.error((oe=(Q=i.file)==null?void 0:Q.response)==null?void 0:oe.message);return}p.length>=O?D(!0):D(!1),ae([...p]),p=p.map(F=>{var pe,ve;return(pe=F==null?void 0:F.response)!=null&&pe.id&&(F.url=(ve=F==null?void 0:F.response)==null?void 0:ve.url),F.name.indexOf(v)===-1&&(F.name=`${F.name}${v}${o(F.size)}`),l({},F)}),console.log("info:",i,p),u(p)},onRemove:i=>f(void 0,null,function*(){if(!le)return!0;const R=()=>f(void 0,null,function*(){if(i.response?i.response.id:i.id){let Q=yield(0,S.JZ)(i.response?i.response.id:i.uid);return Promise.resolve(Q)}else return!0});return _?new Promise((w,Q)=>{G.default.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:()=>f(void 0,null,function*(){const oe=yield R();I.ZP.success("\u5220\u9664\u6210\u529F"),w(!0)}),onCancel:()=>w(!1)})}):yield R()})};function me(i){i.preventDefault(),i.stopPropagation()}return n.createElement("div",{className:`multi-upload ${E||""}`},N&&n.createElement(te,l({},de),n.createElement("p",{className:"ant-upload-drag-icon"},n.createElement(z.Z,null)),n.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",n.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",y,"MB)"," "),a),!N&&n.createElement(d.default,l({},de),n.createElement(J.ZP,{disabled:U,className:"upload_button"},n.createElement("img",{className:"aBtn_img",src:K}),L),n.createElement("span",{onClick:me,className:"upload_text"},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",y,"MB)"," ")))}},73960:function(se,H,r){r.d(H,{$J:function(){return I},JZ:function(){return J},bN:function(){return S},jP:function(){return W},rO:function(){return G}});var n=r(76265),d=(c,g,P)=>new Promise((Z,V)=>{var T=o=>{try{v(P.next(o))}catch(C){V(C)}},x=o=>{try{v(P.throw(o))}catch(C){V(C)}},v=o=>o.done?Z(o.value):Promise.resolve(o.value).then(T,x);v((P=P.apply(c,g)).next())});function I(c){return(0,n.U2)(`libraries/${c}.json`)}function G(){return(0,n.U2)("library_tags.json")}function J(c){return d(this,null,function*(){return(yield(0,n.IV)(`attachments/${c}.json`)).status===0})}function W(c){return(0,n.v_)("libraries.json",c)}function S(c,g){return(0,n.gz)(`libraries/${c}.json`,g)}}}]);
|