import{d as z,O as M,n as P,r as h,h as v,c as T,e as a,w as n,a as u,t as m,u as o,i as _,N as t,y as $,I as V,a8 as j,E as I,W as R,X as U,Y as S,$ as A,ah as O,aj as W,at as X,a0 as Y}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{z as q,A as G}from"./member-97cfd04b.js";import{_ as H}from"./edit-label.vue_vue_type_script_setup_true_lang-1ba9b8de.js";/* empty css */const J={class:"main-container"},K={class:"flex justify-between items-center"},Q={class:"text-[20px]"},Z={class:"mt-[10px]"},ee={class:"mt-[16px] flex justify-end"},we=z({__name:"label",setup(ae){const y=M().meta.title,e=P({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{label_name:""}}),b=h(),x=i=>{i&&(i.resetFields(),s())},s=(i=1)=>{e.loading=!0,e.page=i,q({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 p=h(null),w=()=>{p.value.setFormData(),p.value.showDialog=!0},C=i=>{p.value.setFormData(i),p.value.showDialog=!0},k=i=>{j.confirm(t("memberLabelDeleteTips"),t("warning"),{confirmButtonText:t("confirm"),cancelButtonText:t("cancel"),type:"warning"}).then(()=>{G(i).then(()=>{s()}).catch(()=>{})})};return(i,l)=>{const d=I,E=R,f=U,D=S,g=A,c=O,L=W,N=X,B=Y;return v(),T("div",J,[a(g,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[u("div",K,[u("span",Q,m(o(y)),1),a(d,{type:"primary",onClick:w},{default:n(()=>[_(m(o(t)("addMemberLabel")),1)]),_:1})]),a(g,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[a(D,{inline:!0,model:e.searchParam,ref_key:"searchFormRef",ref:b},{default:n(()=>[a(f,{label:o(t)("labelName"),prop:"label_name"},{default:n(()=>[a(E,{modelValue:e.searchParam.label_name,"onUpdate:modelValue":l[0]||(l[0]=r=>e.searchParam.label_name=r),placeholder:o(t)("labelNamePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),a(f,null,{default:n(()=>[a(d,{type:"primary",onClick:l[1]||(l[1]=r=>s())},{default:n(()=>[_(m(o(t)("search")),1)]),_:1}),a(d,{onClick:l[2]||(l[2]=r=>x(b.value))},{default:n(()=>[_(m(o(t)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),u("div",Z,[$((v(),V(L,{data:e.data,size:"large"},{empty:n(()=>[u("span",null,m(e.loading?"":o(t)("emptyData")),1)]),default:n(()=>[a(c,{prop:"label_name",label:o(t)("labelName"),"min-width":"120"},null,8,["label"]),a(c,{prop:"member_num",label:o(t)("memberNumber"),"min-width":"120"},null,8,["label"]),a(c,{prop:"memo",label:o(t)("memo"),"min-width":"120"},null,8,["label"]),a(c,{prop:"sort",label:o(t)("sort"),"min-width":"120"},null,8,["label"]),a(c,{label:o(t)("operation"),align:"right",fixed:"right",width:"130"},{default:n(({row:r})=>[a(d,{type:"primary",link:"",onClick:F=>C(r)},{default:n(()=>[_(m(o(t)("edit")),1)]),_:2},1032,["onClick"]),a(d,{type:"primary",link:"",onClick:F=>k(r.label_id)},{default:n(()=>[_(m(o(t)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[B,e.loading]]),u("div",ee,[a(N,{"current-page":e.page,"onUpdate:current-page":l[3]||(l[3]=r=>e.page=r),"page-size":e.limit,"onUpdate:page-size":l[4]||(l[4]=r=>e.limit=r),layout:"total, sizes, prev, pager, next, jumper",total:e.total,onSizeChange:l[5]||(l[5]=r=>s()),onCurrentChange:s},null,8,["current-page","page-size","total"])])]),a(H,{ref_key:"editMemberLabelDialog",ref:p,onComplete:s},null,512)]),_:1})])}}});export{we as default};