var M=Object.defineProperty,F=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var _=(i,e,o)=>e in i?M(i,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[e]=o,U=(i,e)=>{for(var o in e||(e={}))R.call(e,o)&&_(i,o,e[o]);if(w)for(var o of w(e))B.call(e,o)&&_(i,o,e[o]);return i},C=(i,e)=>F(i,N(e));var T=(i,e,o)=>new Promise((m,u)=>{var d=s=>{try{a(o.next(s))}catch(p){u(p)}},f=s=>{try{a(o.throw(s))}catch(p){u(p)}},a=s=>s.done?m(s.value):Promise.resolve(s.value).then(d,f);a((o=o.apply(i,e)).next())});import{d as k,e as x,U as I,a2 as P,a3 as V,k as n,af as l,u as g,G as S}from"./vue-vendor-CxLCUzY4.js";import{u as j}from"./index-gyz1IdHU.js";import{h as v,aY as E,b3 as G,bZ as H,u as K}from"./index-Cy4uayzW.js";import{Q as L}from"./componentMap-0iK4HQBq.js";import A from"./BasicTable-CgafrQwz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.js";import"./injectionKey-DPVn4AgL.js";const D=[{title:"文件名称",dataIndex:"fileName",width:120},{title:"文件地址",dataIndex:"url",width:100}],Q=[{label:"文件名称",field:"fileName",component:"Input",colProps:{span:6}},{label:"文件地址",field:"url",component:"Input",colProps:{span:6}}];const W="/sys/oss/file/upload",X="/sys/upload/uploadMinio",Y=i=>v.get({url:"/sys/oss/file/list",params:i}),Z=(i,e)=>v.delete({url:"/sys/oss/file/delete",params:i},{joinParamsToUrl:!0}).then(()=>{e()}),q=k({name:"system-ossfile"}),Je=k(C(U({},q),{setup(i){const{createMessage:e}=K(),o=E(),m={"X-Access-Token":G()},[u,{reload:d}]=j({api:Y,rowKey:"id",columns:D,formConfig:{labelWidth:120,schemas:Q,autoSubmitOnEnter:!0},striped:!0,useSearchForm:!0,showTableSetting:!0,clickToRowSelect:!1,bordered:!0,showIndexColumn:!1,tableSetting:{fullScreen:!0},beforeFetch:t=>Object.assign({column:"createTime",order:"desc"},t),actionColumn:{width:80,title:"操作",dataIndex:"action",slots:{customRender:"action"},fixed:void 0}}),f=x(()=>`${o.uploadUrl}${W}`),a=x(()=>`${o.uploadUrl}${X}`);function s(t){if(t&&t.url){let r=encodeURIComponent(H(t.url)),c=`${o.viewUrl}?url=`+r;window.open(c,"_blank")}}function p(t){return T(this,null,function*(){yield Z({id:t.id},d)})}function b(t){var r=t.type;if(r==="image"){if(r.indexOf("image")<0)return e.warning("请上传图片"),!1}else if(r==="file"&&r.indexOf("image")>=0)return e.warning("请上传文件"),!1;return!0}function h(t){t.file.status==="done"?t.file.response.success?(d(),e.success(`${t.file.name} 上传成功!`)):e.error(`${t.file.response.message}`):t.file.status==="error"&&e.error(`${t.file.response.message}`)}function $(t){return[{label:"预览",onClick:s.bind(null,t)},{label:"删除",popConfirm:{title:"是否确认删除",confirm:p.bind(null,t)}}]}return(t,r)=>{const c=I("a-button"),y=I("a-upload");return P(),V("div",null,[n(g(A),{onRegister:g(u)},{tableTitle:l(()=>[n(y,{name:"file",showUploadList:!1,action:f.value,headers:m,beforeUpload:b,onChange:h},{default:l(()=>[n(c,{type:"primary",preIcon:"ant-design:upload-outlined"},{default:l(()=>r[0]||(r[0]=[S("OSS文件上传")])),_:1})]),_:1},8,["action"]),n(y,{name:"file",showUploadList:!1,action:a.value,headers:m,beforeUpload:b,onChange:h},{default:l(()=>[n(c,{type:"primary",preIcon:"ant-design:upload-outlined"},{default:l(()=>r[1]||(r[1]=[S("MINIO文件上传")])),_:1})]),_:1},8,["action"])]),action:l(({record:O})=>[n(g(L),{actions:$(O)},null,8,["actions"])]),_:1},8,["onRegister"])])}}}));export{Je as default};
