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-LwlFn7Y4.js";import{h as v,aY as E,b3 as G,bZ as H,u as K}from"./index-B_2CoVdl.js";import{Q as L}from"./componentMap-CzCGDP7x.js";import A from"./BasicTable-Clbg3fHx.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./index-ARbUvvsq.js";import"./useForm-CcjrODHR.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
