Files
weiyu/deploy/server/admin/8601.10ef1f8c.async.js

1 line
14 KiB
JavaScript
Raw Normal View History

2025-11-22 13:38:43 +08:00
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[8601],{72834:function(e,t,a){a(44194);var n=a(82770),r=a(54881),i=a(14906),o=a(31549);t.Z=function(e){var t,a,s=e.file,l=e.onDelete,d=e.showDelete,u=void 0===d||d,c=(0,i.useIntl)();return(0,o.jsxs)("div",{style:{position:"relative",width:"50px",height:"50px",border:"1px solid #f0f0f0",borderRadius:"4px",overflow:"hidden"},title:c.formatMessage({id:null!=s&&null!==(t=s.fileType)&&void 0!==t&&t.startsWith("image/")?"upload.preview.image":"upload.preview.file"}),children:[u&&(0,o.jsx)(n.ZP,{type:"text",size:"small",icon:(0,o.jsx)(r.Z,{}),onClick:function(){return l(s.uid)},style:{position:"absolute",top:0,right:0,padding:"2px",background:"rgba(255, 255, 255, 0.8)",border:"none",borderRadius:"0 4px 0 4px",zIndex:1}}),(0,o.jsx)("div",{onClick:function(){return window.open(s.fileUrl,"_blank")},style:{width:"100%",height:"100%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},children:null!=s&&null!==(a=s.fileType)&&void 0!==a&&a.startsWith("image/")?(0,o.jsx)("img",{src:null==s?void 0:s.fileUrl,alt:null==s?void 0:s.fileName,style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,o.jsx)("div",{style:{fontSize:"12px",padding:"4px",textAlign:"center",wordBreak:"break-all",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:s.fileName})}),(0,o.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"rgba(0, 0, 0, 0.5)",color:"#fff",fontSize:"10px",padding:"2px",textAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.fileName})]},s.uid)}},98601:function(e,t,a){var n=a(76711),r=a.n(n),i=a(90819),o=a.n(i),s=a(89933),l=a.n(s),d=a(45332),u=a.n(d),c=a(86222),p=a.n(c),f=a(73193),g=a.n(f),m=a(44194),v=a(42085),h=a(47944),y=a(81637),x=a(24462),w=a(86895),M=a(9404),b=a(82770),j=a(32525),k=a(96596),U=a.n(k),T=a(39497),C=a(19433),O=a(5932),S=a(72834),Z=a(14906),z=a(88769),D=a(98830),L=a(26138),N=a(41658),F=a(31549),A=y.Z.Dragger;function B(e){var t;switch(null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase()){case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"webp":return"image/webp";case"svg":return"image/svg+xml";case"pdf":return"application/pdf";case"txt":return"text/plain";case"md":return"text/markdown";case"csv":return"text/csv";case"json":return"application/json";case"zip":return"application/zip";case"mp3":return"audio/mpeg";case"wav":return"audio/wav";case"mp4":return"video/mp4";case"mov":return"video/quicktime";case"doc":return"application/msword";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"ppt":return"application/vnd.ms-powerpoint";case"pptx":return"application/vnd.openxmlformats-officedocument.presentationml.presentation";default:return}}t.Z=function(e){var t=e.type,a=e.acceptType,n=e.isModalOpen,i=e.attachments,s=e.handleSubmit,d=e.handleCancel,c=(0,Z.useIntl)(),f=(0,z.j)((function(e){return e.currentKbase})),k=(0,D.u)((function(e){return e.currentOrg})),I=(0,L.v)((function(e){return e.categorySelectOptions})),E=(0,L.v)((function(e){return e.categoryTreeOptions})),P=(0,m.useMemo)((function(){return function e(t){return t&&0!==t.length?t.filter((function(e){return e.key!==T.zBg})).map((function(t){return g()(g()({},t),{},{children:e(t.children)})})):[]}(E)}),[E]),R=function e(t){if(t&&0!==t.length){var a,n=p()(t);try{for(n.s();!(a=n.n()).done;){var r=a.value;if(null!=r&&r.key)return r.key;var i=e(r.children);if(i)return i}}catch(e){n.e(e)}finally{n.f()}}},W=(0,m.useState)([]),H=u()(W,2),Y=H[0],_=H[1],K=(0,m.useState)(!1),G=u()(K,2),J=G[0],Q=G[1],X=(0,m.useState)(""),$=u()(X,2),q=$[0],V=$[1],ee=(0,m.useState)(!1),te=u()(ee,2),ae=te[0],ne=te[1],re=(0,m.useState)({file:null,fileName:"test.pdf",fileType:"application/pdf",isAvatar:"false",kbType:t,categoryUid:t===T.n1c&&I&&I.length>0?