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-BN5Ac_IG.js";import{h as v,aY as E,b3 as G,bZ as H,u as K}from"./index-CYriLmQo.js";import{Q as L}from"./componentMap-7D1QIeNI.js";import A from"./BasicTable-DAfCfXmD.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./index-BkgeZpOO.js";import"./useForm-8o5KRzWo.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.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"}),ze=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{ze as default};
