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-KOQNKxnC.js";import{h as v,aY as E,b3 as G,bZ as H,u as K}from"./index-CLZzJyTP.js";import{Q as L}from"./componentMap-DpsJvoqz.js";import A from"./BasicTable-DUJWN3yz.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./index-ByX9XNkE.js";import"./useForm-Dx3lJ3DG.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.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};
