1 |
- import w from"./popupForm-B8t4Qvkh.js";import{d as v,b as k,T as x}from"./baTable-MdxYOkAk.js";import{T as z}from"./index-K8IR974I.js";import{p as B}from"./index-XALue448.js";import{a1 as F,a6 as I,_ as T}from"./index-EwE51S_X.js";import{d as q,a2 as E,a as P,av as A,o as K,K as r,aq as L,e as i,f as C,i as u,u as t,y as m,C as h,j as l,L as c,t as D,am as O}from"./vue-A59npLRR.js";import"./echarts-cxb9vJr1.js";const R={class:"default-main"},M={class:"ba-table-box"},N={class:"mlr-12"},S={class:"table-header-operate-text"},G=q({name:"routine/attachment",__name:"index",setup(U){const{t:e}=E(),b=P(),f=v(["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 k(new F("/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,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",showOverflowTooltip:!0,operatorPlaceholder:e("Fuzzy query")},{label:e("utils.preview"),prop:"suffix",align:"center",renderFormatter: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:f,operator:!1}],defaultOrder:{prop:"last_upload_time",order:"desc"}});return A("baTable",o),K(()=>{var n;o.table.ref=b.value,o.mount(),(n=o.getIndex())==null||n.then(()=>{o.initSort()})}),(n,p)=>{const d=r("el-alert"),s=r("Icon"),a=r("el-button"),_=r("el-tooltip"),y=r("el-popconfirm"),g=L("blur");return i(),C("div",R,[u("div",M,[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"])):h("",!0),l(z,{buttons:["refresh","edit","comSearch","quickSearch","columnDisplay"],"quick-search-placeholder":t(e)("Quick search placeholder",{fields:t(e)("utils.Original name")})},{default:c(()=>[t(I)("del")?(i(),m(y,{key:0,onConfirm:p[0]||(p[0]=V=>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",N,[l(_,{content:t(e)("Delete selected row"),placement:"top"},{default:c(()=>[O((i(),m(a,{disabled:!(t(o).table.selection.length>0),class:"table-header-operate",type:"danger"},{default:c(()=>[l(s,{color:"#ffffff",name:"fa fa-trash"}),u("span",S,D(t(e)("Delete")),1)]),_:1},8,["disabled"])),[[g]])]),_:1},8,["content"])])]),_:1},8,["confirm-button-text","cancel-button-text","title","disabled"])):h("",!0)]),_:1},8,["quick-search-placeholder"]),l(x,{ref_key:"tableRef",ref:b},null,512),l(w)])])}}}),Y=T(G,[["__scopeId","data-v-2a86eeff"]]);export{Y as default};
|