test_lgq/niucloud/public/admin/assets/group-29fa58cd.js

2 lines
3.5 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{d as F,O as S,f as V,r as $,n as D,h as y,c as G,e as t,w as l,a as m,t as s,u as r,i as u,N as a,y as j,I as R,a8 as I,E as L,W as U,X as q,Y as M,$ as O,ah as W,aj as X,at as Y,a0 as A}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{n as H,o as J}from"./site-ac963391.js";const K={class:"main-container"},Q={class:"flex justify-between items-center"},Z={class:"text-[20px]"},ee={class:"mt-[16px] flex justify-end"},be=F({__name:"group",setup(te){const b=S(),_=V(),v=b.meta.title,g=$(),e=D({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{keywords:""}}),k=i=>{i&&(i.resetFields(),p())},p=(i=1)=>{e.loading=!0,e.page=i,H({page:e.page,limit:e.limit,...e.searchParam}).then(o=>{e.loading=!1,e.data=o.data.data,e.total=o.data.total}).catch(()=>{e.loading=!1})};p();const x=()=>{_.push("/admin/site/group_edit")},w=i=>{_.push({path:"/admin/site/group_edit",query:{id:i.group_id}})},C=i=>{I.confirm(a("groupDeleteTips"),a("warning"),{confirmButtonText:a("confirm"),cancelButtonText:a("cancel"),type:"warning"}).then(()=>{J(i).then(()=>{p()}).catch(()=>{})})};return(i,o)=>{const d=L,E=U,f=q,B=M,h=O,c=W,N=X,T=Y,P=A;return y(),G("div",K,[t(h,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[m("div",Q,[m("span",Z,s(r(v)),1),t(d,{type:"primary",class:"w-[100px]",onClick:x},{default:l(()=>[u(s(r(a)("addSiteGroup")),1)]),_:1})]),t(h,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:l(()=>[t(B,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:g},{default:l(()=>[t(f,{label:r(a)("groupName"),prop:"keywords"},{default:l(()=>[t(E,{modelValue:e.searchParam.keywords,"onUpdate:modelValue":o[0]||(o[0]=n=>e.searchParam.keywords=n),placeholder:r(a)("groupNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(f,null,{default:l(()=>[t(d,{type:"primary",onClick:o[1]||(o[1]=n=>p())},{default:l(()=>[u(s(r(a)("search")),1)]),_:1}),t(d,{onClick:o[2]||(o[2]=n=>k(g.value))},{default:l(()=>[u(s(r(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),m("div",null,[j((y(),R(N,{data:e.data,size:"large"},{empty:l(()=>[m("span",null,s(e.loading?"":r(a)("emptyData")),1)]),default:l(()=>[t(c,{prop:"group_name",label:r(a)("groupName")},null,8,["label"]),t(c,{prop:"group_desc",label:r(a)("remark")},null,8,["label"]),t(c,{prop:"create_time",label:r(a)("createTime")},null,8,["label"]),t(c,{prop:"group_roles",label:r(a)("operation"),align:"right",fixed:"right",width:"130"},{default:l(({row:n})=>[t(d,{type:"primary",link:"",onClick:z=>w(n)},{default:l(()=>[u(s(r(a)("edit")),1)]),_:2},1032,["onClick"]),t(d,{type:"primary",link:"",onClick:z=>C(n.group_id)},{default:l(()=>[u(s(r(a)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[P,e.loading]]),m("div",ee,[t(T,{"current-page":e.page,"onUpdate:current-page":o[3]||(o[3]=n=>e.page=n),"page-size":e.limit,"onUpdate:page-size":o[4]||(o[4]=n=>e.limit=n),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:o[5]||(o[5]=n=>p()),onCurrentChange:p},null,8,["current-page","page-size","total"])])])]),_:1})])}}});export{be as default};