import{C as T}from"./client-578c7487.js";import{L as V}from"./index-a6ee13d3.js";import{_ as B}from"./detail.vue_vue_type_script_name_attachDetail_setup_true_lang-8a4cf4d7.js";import{a as _}from"./element-plus-91d6d961.js";import{H as u,e as E,_ as L,i as P,ah as a,o as l,c as s,V as o,P as n,T as U,F as M,a8 as R,O as p,S as F,a as c,U as I}from"./@vue-6dabbe94.js";import{_ as $}from"./_plugin-vue_export-helper-c27b6911.js";import"./pinia-b6f74250.js";import"./vue-router-c1461dfc.js";import"./vue-i18n-b3581196.js";import"./@intlify-ea47d1db.js";import"./source-map-7d7e1c08.js";import"./vue-b1ba6f14.js";import"./js-cookie-edb2da2a.js";import"./@element-plus-64e6e14a.js";import"./nprogress-08a53ce8.js";import"./axios-4a70c6fc.js";import"./qs-c5b6dbf2.js";import"./side-channel-394f276c.js";import"./get-intrinsic-bd2830fd.js";import"./has-symbols-e8f3ca0e.js";import"./has-proto-f7d0b240.js";import"./function-bind-22e7ee79.js";import"./has-26d28e02.js";import"./call-bind-e5c1c8b0.js";import"./object-inspect-8fd4bade.js";import"./mitt-f7ef348c.js";import"./vue-grid-layout-ec2a62c3.js";import"./lodash-es-9851428c.js";import"./@vueuse-e129c873.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-f6fdf7b4.js";import"./async-validator-dee29e8b.js";import"./memoize-one-297ddbcb.js";import"./escape-html-b8998962.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-880a26aa.js";const j={class:"list-adapt-container"},q={key:0},O=["src","fit"],G={style:{padding:"14px"}},J=u({name:"attachManager"}),K=u({...J,setup(Q){const f=T(),m=E(),t=L({fit:"fill",queryParams:{},showSearch:!0,limit:3,uploadUrl:"fastcms/api/client/attachment/upload",headers:{Authorization:V.get("token")},tableData:{data:[],total:0,loading:!1,param:{pageNum:1,pageSize:10}}}),r=()=>{f.getAttachList(t.tableData.param).then(e=>{t.tableData.data=e.data.records,t.tableData.total=e.data.total})},g=()=>{r()},h=()=>{_.error("上传文件数量不能超过 "+t.limit+" 个!")},b=()=>{_.error("上传失败")};P(()=>{r()});const y=e=>{m.value.openDialog(e.id)},x=e=>{t.tableData.param.pageSize=e,r()},C=e=>{t.tableData.param.pageNum=e,r()};return(e,W)=>{const D=a("ele-Plus"),k=a("el-icon"),z=a("el-button"),v=a("el-upload"),d=a("el-card"),S=a("el-col"),N=a("el-row"),w=a("el-empty"),A=a("el-pagination");return l(),s("div",j,[o(d,{shadow:"hover"},{default:n(()=>[o(v,{class:"upload-btn",action:t.uploadUrl,name:"files",multiple:"",headers:t.headers,"show-file-list":!1,"on-success":g,"on-exceed":h,"on-error":b,limit:t.limit},{default:n(()=>[o(z,{type:"primary",size:"default"},{default:n(()=>[o(k,null,{default:n(()=>[o(D)]),_:1}),U("上传附件")]),_:1})]),_:1},8,["action","headers","limit"]),t.tableData.data.length>0?(l(),s("div",q,[o(N,{gutter:15},{default:n(()=>[(l(!0),s(M,null,R(t.tableData.data,(i,H)=>(l(),p(S,{xs:24,sm:12,md:8,lg:6,xl:4,class:"mb15",key:H,onClick:X=>y(i)},{default:n(()=>[o(d,{"body-style":{padding:"0px"}},{default:n(()=>[c("img",{src:i.path,fit:t.fit,class:"image"},null,8,O),c("div",G,[c("span",null,I(i.fileName),1)])]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})])):(l(),p(w,{key:1,description:"暂无数据"})),t.tableData.data.length>0?(l(),p(A,{key:2,style:{"text-align":"right"},background:"",onSizeChange:x,onCurrentChange:C,"page-sizes":[10,20,30],"current-page":t.tableData.param.pageNum,"page-size":t.tableData.param.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.tableData.total},null,8,["current-page","page-size","total"])):F("",!0)]),_:1}),o(B,{ref_key:"detailRef",ref:m,onReloadTable:r},null,512)])}}});const Lt=$(K,[["__scopeId","data-v-b1e9efae"]]);export{Lt as default};
