index-a4a3b020.js 3.9 KB

1
  1. import v from"./popupForm-cf2b697d.js";import{b as z,T as k,a as x}from"./index-434d719f.js";import{r as B}from"./controllerUrls-941681c3.js";import{f as F,ai as q,a4 as I,a2 as E,_ as P}from"./index-ba596ae9.js";import{p as T}from"./index-7e56a0fa.js";import{h,y as A,B as K,p as i,l as L,o as u,k as t,M as m,a4 as _,q as r,N as c,a6 as M,V as N,t as l,as as R,a7 as C}from"./vue-a39e6937.js";const S={class:"default-main"},D={class:"ba-table-box"},G={class:"mlr-12"},O={class:"table-header-operate-text"},V=h({name:"routine/attachment"}),U=h({...V,setup(H){const{t:e}=F(),b=A(),f=q(["edit","delete"]);f[1].popconfirm.title=e("routine.attachment.Files and records will be deleted at the same time Are you sure?");const o=new z(new I(B),{column:[{type:"selection",align:"center",operator:!1},{label:e("id"),prop:"id",align:"center",operator:"LIKE",operatorPlaceholder:e("Fuzzy query"),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,p,d)=>{const s=parseFloat(d),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","show-overflow-tooltip":!0,operatorPlaceholder:e("Fuzzy query")},{label:e("utils.preview"),prop:"suffix",align:"center",renderFormatter:T,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","show-overflow-tooltip":!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:"lastuploadtime",align:"center",render:"datetime",operator:"RANGE",width:160,sortable:"custom"},{label:e("operate"),align:"center",width:"100",render:"buttons",buttons:f,operator:!1}],defaultOrder:{prop:"lastuploadtime",order:"desc"}});return R("baTable",o),K(()=>{var n;o.table.ref=b.value,o.mount(),(n=o.getIndex())==null||n.then(()=>{o.initSort()})}),(n,p)=>{const d=l("el-alert"),s=l("Icon"),a=l("el-button"),y=l("el-tooltip"),g=l("el-popconfirm"),w=C("blur");return i(),L("div",S,[u("div",D,[t(o).table.remark?(i(),m(d,{key:0,class:"ba-table-alert",title:t(o).table.remark,type:"info","show-icon":""},null,8,["title"])):_("",!0),r(k,{buttons:["refresh","edit","comSearch","quickSearch","columnDisplay"],"quick-search-placeholder":t(e)("quick Search Placeholder",{fields:t(e)("utils.Original name")})},{default:c(()=>[t(E)("del")?(i(),m(g,{key:0,onConfirm:p[0]||(p[0]=$=>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(()=>[u("div",G,[r(y,{content:t(e)("Delete selected row"),placement:"top"},{default:c(()=>[M((i(),m(a,{disabled:!(t(o).table.selection.length>0),class:"table-header-operate",type:"danger"},{default:c(()=>[r(s,{color:"#ffffff",name:"fa fa-trash"}),u("span",O,N(t(e)("delete")),1)]),_:1},8,["disabled"])),[[w]])]),_:1},8,["content"])])]),_:1},8,["confirm-button-text","cancel-button-text","title","disabled"])):_("",!0)]),_:1},8,["quick-search-placeholder"]),r(x,{ref_key:"tableRef",ref:b},null,512),r(v)])])}}});const Z=P(U,[["__scopeId","data-v-c1228a22"]]);export{Z as default};