2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
|
import{d as z,O as N,n as j,r as g,h as D,c as I,e as t,w as n,a as _,t as m,u as o,i as p,N as a,y as U,I as L,a8 as R,E as S,W as M,X as O,Y as W,$ as X,ah as Y,aj as q,at as A,a0 as G,_ as H}from"./index-4dcc0234.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 */import"./el-form-item-4ed993c7.js";/* empty css */import{b as J,d as K}from"./dict-1d5574f0.js";import{_ as Q}from"./edit.vue_vue_type_style_index_0_lang-f452bc17.js";import{_ as Z}from"./dict.vue_vue_type_style_index_0_lang-f4988652.js";/* empty css *//* empty css */const ee={class:"main-container"},te={class:"flex justify-between items-center"},ae={class:"text-[20px]"},le={class:"mt-[10px]"},oe={class:"mt-[16px] flex justify-end"},ne=z({__name:"list",setup(ie){const x=N().meta.title,e=j({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{name:"",key:""}}),y=g(),s=(r=1)=>{e.loading=!0,e.page=r,J({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 c=g(null),C=()=>{c.value.setFormData(),c.value.showDialog=!0},w=r=>{c.value.setFormData(r),c.value.showDialog=!0},h=g(null),E=r=>{h.value.setFormData(r)},P=r=>{R.confirm(a("dictDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{K(r).then(()=>{s()}).catch(()=>{})})},F=r=>{r&&(r.resetFields(),s())};return(r,l)=>{const d=S,v=M,f=O,V=W,b=X,u=Y,$=q,B=A,T=G;return D(),I("div",ee,[t(b,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[_("div",te,[_("span",ae,m(o(x)),1),t(d,{type:"primary",onClick:C},{default:n(()=>[p(m(o(a)("addDict")),1)]),_:1})]),t(b,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[t(V,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:y},{default:n(()=>[t(f,{label:o(a)("name"),prop:"name"},{default:n(()=>[t(v,{modelValue:e.searchParam.name,"onUpdate:modelValue":l[0]||(l[0]=i=>e.searchParam.name=i),placeholder:o(a)("namePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(f,{label:o(a)("key"),prop:"key"},{default:n(()=>[t(v,{modelValue:e.searchParam.key,"onUpdate:modelValue":l[1]||(l[1]=i=>e.searchParam.key=i),placeholder:o(a)("keyPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(f,null,{default:n(()=>[t(d,{type:"primary",onClick:l[2]||(l[2]=i=>s())},{default:n(()=>[p(m(o(a)("search")),1)]),_:1}),t(d,{onClick:l[3]||(l[3]=i=>F(y.value))},{default:n(()=>[p(m(o(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),_("div",le,[U((D(),L($,{data:e.data,size:"large"},{empty:n(()=>[_("span",null,m(e.loading?"":o(a)("emptyData")),1)]),default:n(()=>[t(u,{prop:"name",label:o(a)("name"),"min-width":"120"},null,8,["label"]),t(u,{prop:"key",label:o(a)("key"),"min-width":"120"},null,8,["label"]),t(u,{prop:"memo",label:o(a)("memo"),"min-width":"120"},null,8,["label"]),t(u,{prop:"create_time",label:o(a)("createTime"),"min-width":"120"},null,8,["label"]),t(u,{label:o(a)("operation"),align:"right",fixed:"right","min-width":"120"},{default:n(({row:i})=>[t(d,{type:"primary",link:"",onClick:k=>E(i)},{default:n(()=>[p(m(o(a)("dictData")),1)]),_:2},1032,["onClick"]),t(d,{type:"primary",link:"",onClick:k=>w(i)},{default:n(()=>[p(m(o(a)("edit")),1)]),_:2},1032,["onClick"]),t(d,{type:"primary",link:"",onClick:k=>P(i.id)},{default:n(()=>[p(m(o(a)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[T,e.loading]]),_("div",oe,[t(B,{"current-page":e.page,"onUpdate:current-page":l[4]||(l[4]=i=>e.page=i),"page-size":e.limit,"onUpdate:page-size":l[5]||(l[5]=i=>e.limit=i),layout:"total, sizes, prev, pager, next
|