mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-20 14:22:48 +00:00
2 lines
4.6 KiB
JavaScript
2 lines
4.6 KiB
JavaScript
import{d as M,v as I,f as O,l as G,r as k,h as _,c as P,e as t,w as r,a as d,t as i,u as n,i as c,k as a,F as H,O as J,m as x,J as K,S as q,E as A,a8 as Q,a9 as W,D as X,G as Y,$ as Z,ad as ee,H as te,K as ae,a0 as le,a1 as ne,a2 as oe,L as re}from"./index-a59af0dd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css */import{b as pe,l as ie,n as se}from"./printer-0d9e5c39.js";const me={class:"main-container"},de={class:"flex justify-between items-center mb-[5px]"},ce={class:"text-lg"},ue={class:"mt-[10px]"},_e={class:"mt-[16px] flex justify-end"},Le=M({__name:"template_list",setup(fe){const E=I(),f=O(),w=E.meta.title,C=p=>{f.push({path:p})},e=G({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{template_name:"",template_type:""}}),g=k(),h=k([]);pe({}).then(p=>{p.data&&(h.value=p.data)});const s=(p=1)=>{e.loading=!0,e.page=p,ie({page:e.page,limit:e.limit,...e.searchParam}).then(l=>{e.loading=!1,e.data=l.data.data,e.total=l.data.total}).catch(()=>{e.loading=!1})};s();const V=()=>{f.push("/printer/template/add")},B=p=>{f.push("/printer/template/edit?template_id="+p.template_id)},F=p=>{q.confirm(a("printerTemplateDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{se(p).then(()=>{s()})})},N=p=>{p&&(p.resetFields(),s())};return(p,l)=>{const m=A,y=Q,z=W,$=X,b=Y,D=Z,L=ee,R=te,v=ae,u=le,S=ne,U=oe,j=re;return _(),P("div",me,[t(v,{class:"box-card !border-none",shadow:"never"},{default:r(()=>[d("div",de,[d("span",ce,i(n(w)),1),t(m,{type:"primary",onClick:V},{default:r(()=>[c(i(n(a)("addPrinterTemplate")),1)]),_:1})]),t(z,{class:"demo-tabs","model-value":"/printer/template/list",onTabChange:C},{default:r(()=>[t(y,{label:n(a)("tabPrinterManager"),name:"/printer/list"},null,8,["label"]),t(y,{label:n(a)("tabPrinterTemplate"),name:"/printer/template/list"},null,8,["label"])]),_:1}),t(v,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:r(()=>[t(R,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:g},{default:r(()=>[t(b,{label:n(a)("templateName"),prop:"template_name"},{default:r(()=>[t($,{modelValue:e.searchParam.template_name,"onUpdate:modelValue":l[0]||(l[0]=o=>e.searchParam.template_name=o),modelModifiers:{trim:!0},placeholder:n(a)("templateNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(b,{label:n(a)("templateType"),prop:"template_type"},{default:r(()=>[t(L,{modelValue:e.searchParam.template_type,"onUpdate:modelValue":l[1]||(l[1]=o=>e.searchParam.template_type=o),placeholder:n(a)("templateTypePlaceholder"),clearable:""},{default:r(()=>[(_(!0),P(H,null,J(h.value,(o,T)=>(_(),x(D,{key:p.itemkey,label:o.title,value:o.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(b,null,{default:r(()=>[t(m,{type:"primary",onClick:l[2]||(l[2]=o=>s())},{default:r(()=>[c(i(n(a)("search")),1)]),_:1}),t(m,{onClick:l[3]||(l[3]=o=>N(g.value))},{default:r(()=>[c(i(n(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),d("div",ue,[K((_(),x(S,{data:e.data,size:"large"},{empty:r(()=>[d("span",null,i(e.loading?"":n(a)("emptyData")),1)]),default:r(()=>[t(u,{prop:"template_name",label:n(a)("templateName"),"min-width":"220","show-overflow-tooltip":!0},null,8,["label"]),t(u,{prop:"template_type_name",label:n(a)("templateType"),"min-width":"180","show-overflow-tooltip":!0},null,8,["label"]),t(u,{prop:"create_time",label:n(a)("createTime"),"min-width":"120"},null,8,["label"]),t(u,{label:n(a)("operation"),fixed:"right","min-width":"120"},{default:r(({row:o})=>[t(m,{type:"primary",link:"",onClick:T=>B(o)},{default:r(()=>[c(i(n(a)("edit")),1)]),_:2},1032,["onClick"]),t(m,{type:"primary",link:"",onClick:T=>F(o.template_id)},{default:r(()=>[c(i(n(a)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[j,e.loading]]),d("div",_e,[t(U,{"current-page":e.page,"onUpdate:current-page":l[4]||(l[4]=o=>e.page=o),"page-size":e.limit,"onUpdate:page-size":l[5]||(l[5]=o=>e.limit=o),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:l[6]||(l[6]=o=>s()),onCurrentChange:s},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{Le as default};
|