2 lines
7.4 KiB
JavaScript
Raw Normal View History

2025-06-02 21:34:56 +08:00
var e=Object.defineProperty,l=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,n=(l,a,t)=>a in l?e(l,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[a]=t;import{C as o,d as i,r as u,O as p,S as r,z as d,D as c,j as f,H as s,c as m,o as g,F as y,e as b,R as v,w as h,l as w,k as _,m as k,h as U,$ as T,B as C,I as S,J as j,a0 as V,a1 as $}from"./index-C-c3zR6K.js";import{g as x,C as P,l as N,d as O,a as z}from"./ChunkUpload-BZu19gg6.js";const R={class:"app-container"},I=o({name:"Info"}),D=Object.assign(I,{setup(e){const{proxy:o}=i(),I=u([]),D=u(!0),K=u(!0),L=u([]),q=u(!0),F=u(!0),M=u(0),E=u(!1),B=p({queryParams:{pageNum:1,pageSize:10,fileName:null,filePath:null,storageType:null,fileType:null,fileSize:null,md5:null}}),{queryParams:A}=r(B);function H(){D.value=!0,N(A.value).then((e=>{I.value=e.rows,M.value=e.total,D.value=!1}))}function J(){A.value.pageNum=1,H()}function Q(){o.resetForm("queryRef"),J()}function G(e){L.value=e.map((e=>e.fileId)),q.value=1!=e.length,F.value=!e.length}function W(e){const l=e.fileId||L.value;o.$modal.confirm('是否确认删除文件信息编号为"'+l+'"的数据项?').then((function(){return O(l)})).then((()=>{H(),o.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function X(){o.download("file/info/export",((e,o)=>{for(var i in o||(o={}))a.call(o,i)&&n(e,i,o[i]);if(l)for(var i of l(o))t.call(o,i)&&n(e,i,o[i]);return e})({},A.value),`info_${(new Date).getTime()}.xlsx`)}function Y(e){return"minio"===e.storageType||e.storageType,"MASTER"}const Z=u(!1),ee=p({clientKey:"",uploadType:"image"}),le=u({}),ae=d((()=>Object.entries(le.value).flatMap((([e,l])=>l.map((l=>({type:e,client:l,value:`${e}:${l}`,label:`${e} - ${l}`}))))))),te=d((()=>{if(!ee.clientKey)return"";const[e,l]=ee.clientKey.split(":");return`/prod-api/file/${e}/${l}/upload`}));function ne(){Z.value=!1,H()}function oe(e){H()}function ie(e){z({storageType:e.storageType,clientName:Y(e),filePath:e.filePath}).then((l=>{if(!l)return;const a=new Blob([l],{type:"application/octet-stream"}),t=document.createElement("a");t.href=window.URL.createObjectURL(a),t.download=e.fileName||"download",t.click(),window.URL.revokeObjectURL(t.href)}))}return c((()=>{H(),x().then((e=>{if(200===e.code&&e.data){le.value=e.data;const l=Object.entries(e.data).flatMap((([e,l])=>l.map((l=>`${e}:${l}`))));l.length>0&&(ee.clientKey=l[0])}}))})),(e,l)=>{const a=f("el-input"),t=f("el-form-item"),n=f("el-button"),o=f("el-form"),i=f("el-col"),u=f("right-toolbar"),p=f("el-row"),r=f("el-table-column"),d=f("el-table"),c=f("pagination"),x=f("el-radio"),N=f("el-radio-group"),O=f("el-option"),z=f("el-select"),L=f("el-dialog"),q=s("hasPermi"),B=s("loading");return g(),m("div",R,[y(b(o,{model:_(A),ref:"queryRef",inline:!0,"label-width":"100px"},{default:h((()=>[b(t,{label:"原始文件名",prop:"fileName"},{default:h((()=>[b(a,{modelValue:_(A).fileName,"onUpdate:modelValue":l[0]||(l[0]=e=>_(A).fileName=e),placeholder:"请输入原始文件名",clearable:"",onKeyup:w(J,["enter"])},null,8,["modelValue"])])),_:1}),b(t,null,{default:h((()=>[b(n,{type:"primary",icon:"Search",onClick:J},{default:h((()=>l[10]||(l[10]=[k("搜索")]))),_:1}),b(n,{icon:"Refresh",onClick:Q},{default:h((()=>l[11]||(l[11]=[k("重置")]))),_:1})])),_:1})])),_:1},8,["model"]),[[v,K.value]]),b(p,{gutter:10,class:"mb8"},{default:h((()=>[b(i,{span:1.5},{default:h((()=>[y((g(),U(n,{type:"danger",plain:"",icon:"Delete",disabled:F.value,onClick:W},{default:h((()=>l[12]||(l[12]=[k("删除")]))),_:1},8,["disabled"])),[[q,["file:info:remove"]]])])),_:1}),b(i,{span:1.5},{default:h((()=>[y((g(),U(n,{type:"warning",plain:"",icon:"Download",onClick:X},{default:h((()=>l[13]||(l[13]=[k("导出")]))),_:1})),[[q,["file:info:export"]]])])),_:1}),b(i,{span:1.5},{default:h((()=>[b(n,{type:"primary",plain:"",icon:"Upload",onClick:l[1]||(l[1]=e=>Z.value=!0)},{default:h((()=>l[14]||(l[14]=[k("上传")]))),_:1})])),_:1}),b(i,{span:1.5},{default:h((()=>[b(n,{type:"success",plain:"",icon:"Upload",onClick:l[2]||(l[2]=e=>E.value=!0)},{default:h((()=>l[15]||(l[15]=[k("<EFBFBD>