314507
|
1 |
import{d as q,Q as A,J as B,r as d,A as E,b as G,a1 as I,o as i,c as J,k as e,B as l,a as t,a2 as C,O as n,P as S,g as u,dF as L,F as O,dG as Q,dH as W,a7 as X,S as Z,T as j,U as $,V as ee,W as ae,X as le,ao as te,Y as re,Z as oe}from"./index-CHTXMeh8.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_lang-Cenk7Bi3.js";import{E as ie}from"./el-image-B_ZoGYtG.js";import{_ as ne}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BjvrLlUT.js";import{d as se}from"./formatTime-DG99nHw2.js";import{_ as de}from"./FileForm.vue_vue_type_script_setup_true_lang-CjrfbzUn.js";import"./index-DVe591HI.js";import"./el-card-Bdk9qx7q.js";import"./Dialog.vue_vue_type_style_index_0_lang-DH0TiLYN.js";const ue=q({name:"InfraFile",__name:"index",setup(me){const w=A(),{t:T}=B(),y=d(!0),_=d(0),b=d([]),r=E({pageNo:1,pageSize:10,name:void 0,type:void 0,path:void 0,createTime:[]}),v=d(),s=async()=>{y.value=!0;try{const h=await Q(r);b.value=h.list,_.value=h.total}finally{y.value=!1}},m=()=>{r.pageNo=1,s()},z=()=>{v.value.resetFields(),m()},k=d(),F=()=>{k.value.open()};return G(()=>{s()}),(h,o)=>{const x=X,c=Z,Y=j,g=$,f=ee,D=ae,V=ne,p=le,H=ie,U=te,N=re,P=pe,R=I("hasPermi"),K=oe;return i(),J(O,null,[e(V,null,{default:l(()=>[e(D,{class:"-mb-15px",model:t(r),ref_key:"queryFormRef",ref:v,inline:!0,"label-width":"68px"},{default:l(()=>[e(c,{label:"\u6587\u4EF6\u8DEF\u5F84",prop:"path"},{default:l(()=>[e(x,{modelValue:t(r).path,"onUpdate:modelValue":o[0]||(o[0]=a=>t(r).path=a),placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u8DEF\u5F84",clearable:"",onKeyup:C(m,["enter"])},null,8,["modelValue"])]),_:1}),e(c,{label:"\u6587\u4EF6\u7C7B\u578B",prop:"type",width:"80"},{default:l(()=>[e(x,{modelValue:t(r).type,"onUpdate:modelValue":o[1]||(o[1]=a=>t(r).type=a),placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u7C7B\u578B",clearable:"",onKeyup:C(m,["enter"])},null,8,["modelValue"])]),_:1}),e(c,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:l(()=>[e(Y,{modelValue:t(r).createTime,"onUpdate:modelValue":o[2]||(o[2]=a=>t(r).createTime=a),"value-format":"YYYY-MM-DD HH:mm:ss",type:"daterange","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F","default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")]},null,8,["modelValue","default-time"])]),_:1}),e(c,null,{default:l(()=>[e(f,{onClick:m},{default:l(()=>[e(g,{icon:"ep:search",class:"mr-5px"}),n(" \u641C\u7D22")]),_:1}),e(f,{onClick:z},{default:l(()=>[e(g,{icon:"ep:refresh",class:"mr-5px"}),n(" \u91CD\u7F6E")]),_:1}),e(f,{type:"primary",plain:"",onClick:F},{default:l(()=>[e(g,{icon:"ep:upload",class:"mr-5px"}),n(" \u4E0A\u4F20\u6587\u4EF6 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(V,null,{default:l(()=>[S((i(),u(N,{data:t(b)},{default:l(()=>[e(p,{label:"\u6587\u4EF6\u540D",align:"center",prop:"name","show-overflow-tooltip":!0}),e(p,{label:"\u6587\u4EF6\u8DEF\u5F84",align:"center",prop:"path","show-overflow-tooltip":!0}),e(p,{label:"URL",align:"center",prop:"url","show-overflow-tooltip":!0}),e(p,{label:"\u6587\u4EF6\u5927\u5C0F",align:"center",prop:"size",width:"120",formatter:t(L)},null,8,["formatter"]),e(p,{label:"\u6587\u4EF6\u7C7B\u578B",align:"center",prop:"type",width:"180px"}),e(p,{label:"\u6587\u4EF6\u5185\u5BB9",align:"center",prop:"url",width:"110px"},{default:l(({row:a})=>[a.type.includes("image")?(i(),u(H,{key:0,class:"h-80px w-80px",lazy:"",src:a.url,"preview-src-list":[a.url],"preview-teleported":"",fit:"cover"},null,8,["src","preview-src-list"])):a.type.includes("pdf")?(i(),u(U,{key:1,type:"primary",href:a.url,underline:!1,target:"_blank"},{default:l(()=>[n("\u9884\u89C8")]),_:2},1032,["href"])):(i(),u(U,{key:2,type:"primary",download:"",href:a.url,underline:!1,target:"_blank"},{default:l(()=>[n("\u4E0B\u8F7D")]),_:2},1032,["href"]))]),_:1}),e(p,{label:"\u4E0A\u4F20\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:t(se)},null,8,["formatter"]),e(p,{label:"\u64CD\u4F5C",align:"center"},{default:l(a=>[S((i(),u(f,{link:"",type:"danger",onClick:ce=>(async M=>{try{await w.delConfirm(),await W(M),w.success(T("common.delSuccess")),await s()}catch{}})(a.row.id)},{default:l(()=>[n(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[R,["infra:file:delete"]]])]),_:1})]),_:1},8,["data"])),[[K,t(y)]]),e(P,{total:t(_),page:t(r).pageNo,"onUpdate:page":o[3]||(o[3]=a=>t(r).pageNo=a),limit:t(r).pageSize,"onUpdate:limit":o[4]||(o[4]=a=>t(r).pageSize=a),onPagination:s},null,8,["total","page","limit"])]),_:1}),e(de,{ref_key:"formRef",ref:k,onSuccess:s},null,512)],64)}}});export{ue as default}; |