import w from"./popupForm-CEJevi14.js";import{d as v,b as x,T as k,a as z}from"./index-CgMrKa77.js";import{p as B}from"./index-DMA3A9_B.js";import{x as I,a7 as T,a5 as F,_ as E}from"./index-fNs72j9w.js";import{B as q,a8 as P,o as D,I as r,X as R,C as i,D as A,G as m,u as t,O as b,W as h,H as l,P as c,_ as O,U as C,au as K}from"./vue-DweYBrEc.js";const L={class:"default-main"},M={class:"ba-table-box"},N={class:"mlr-12"},G={class:"table-header-operate-text"},S=q({name:"routine/attachment",__name:"index",setup(U){const{t:e}=I.useI18n(),f=P("tableRef"),p=v(["edit","delete"]);p[1].popconfirm={...p[1].popconfirm,title:e("routine.attachment.Files and records will be deleted at the same time Are you sure?")};const o=new x(new T("/admin/routine.Attachment/"),{column:[{type:"selection",align:"center",operator:!1},{label:e("Id"),prop:"id",align:"center",operator:"=",operatorPlaceholder:e("Id"),width:70},{label:e("utils.Breakdown"),prop:"topic",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("routine.attachment.Upload administrator"),prop:"admin.nickname",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("routine.attachment.Upload user"),prop:"user.nickname",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("utils.size"),prop:"size",align:"center",formatter:(n,d,u)=>{const s=parseFloat(u),a=Math.floor(Math.log(s)/Math.log(1024));return(s/Math.pow(1024,a)).toFixed(a<1?0:2)+" "+["B","KB","MB","GB","TB"][a]},operator:"RANGE",sortable:"custom",operatorPlaceholder:"bytes"},{label:e("utils.type"),prop:"mimetype",align:"center",operator:"LIKE",showOverflowTooltip:!0,operatorPlaceholder:e("Fuzzy query")},{label:e("utils.preview"),prop:"suffix",align:"center",formatter:B,render:"image",operator:!1},{label:e("utils.Upload (Reference) times"),prop:"quote",align:"center",width:150,operator:"RANGE",sortable:"custom"},{label:e("utils.Original name"),prop:"name",align:"center",showOverflowTooltip:!0,operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("routine.attachment.Storage mode"),prop:"storage",align:"center",width:100,operator:"LIKE",operatorPlaceholder:e("Fuzzy query")},{label:e("utils.Last upload time"),prop:"last_upload_time",align:"center",render:"datetime",operator:"RANGE",width:160,sortable:"custom"},{label:e("Operate"),align:"center",width:"100",render:"buttons",buttons:p,operator:!1}],defaultOrder:{prop:"last_upload_time",order:"desc"}});return K("baTable",o),D(()=>{var n;o.table.ref=f.value,o.mount(),(n=o.getData())==null||n.then(()=>{o.initSort()})}),(n,d)=>{const u=r("el-alert"),s=r("Icon"),a=r("el-button"),_=r("el-tooltip"),g=r("el-popconfirm"),y=R("blur");return i(),A("div",L,[m("div",M,[t(o).table.remark?(i(),b(u,{key:0,class:"ba-table-alert",title:t(o).table.remark,type:"info","show-icon":""},null,8,["title"])):h("",!0),l(k,{buttons:["refresh","edit","comSearch","quickSearch","columnDisplay"],"quick-search-placeholder":t(e)("Quick search placeholder",{fields:t(e)("utils.Original name")})},{default:c(()=>[t(F)("del")?(i(),b(g,{key:0,onConfirm:d[0]||(d[0]=H=>t(o).onTableHeaderAction("delete",{})),"confirm-button-text":t(e)("Delete"),"cancel-button-text":t(e)("Cancel"),confirmButtonType:"danger",title:t(e)("routine.attachment.Files and records will be deleted at the same time Are you sure?"),disabled:!(t(o).table.selection.length>0)},{reference:c(()=>[m("div",N,[l(_,{content:t(e)("Delete selected row"),placement:"top"},{default:c(()=>[O((i(),b(a,{disabled:!(t(o).table.selection.length>0),class:"table-header-operate",type:"danger"},{default:c(()=>[l(s,{color:"#ffffff",name:"fa fa-trash"}),m("span",G,C(t(e)("Delete")),1)]),_:1},8,["disabled"])),[[y]])]),_:1},8,["content"])])]),_:1},8,["confirm-button-text","cancel-button-text","title","disabled"])):h("",!0)]),_:1},8,["quick-search-placeholder"]),l(z,{ref_key:"tableRef",ref:f},null,512),l(w)])])}}}),X=E(S,[["__scopeId","data-v-11d61eb3"]]);export{X as default};
