import{C as j,D as A,w as M,F as q,L as K,M as O,N as Q,O as Z}from"./element-plus.4a7d92a3.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang.5d4e738c.js";import{f as G,b as H}from"./index.2a036a4c.js";import{u as J}from"./usePaging.6a6670f9.js";import{u as W}from"./useDictOptions.0cdc7c2e.js";import{e as X,a as Y}from"./user_label.18150b01.js";import"./lodash.9dc701ad.js";import{_ as ee}from"./edit.vue_vue_type_script_setup_true_name_userLabelEdit_lang.aadffc55.js";import{d as y,s as te,r as g,Z as ae,ap as oe,o as s,c as le,U as e,L as t,u as a,R as r,M as d,K as u,a as w,j as ne,Q as se,n as D}from"./@vue.18505fe0.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.7347fedc.js";import"./axios.4607972f.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.bb8c34b2.js";import"./color.fbd63fe8.js";import"./clone.31a3aa2c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.0d2736b7.js";import"./vue-clipboard3.7d5a7a5d.js";import"./clipboard.860a1cea.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.66d65d7d.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.d9a16ced.js";const ie={class:"mt-4"},re={class:"flex mt-4 justify-end"},ue=y({name:"userLabelLists"}),He=y({...ue,setup(me){const p=te(),c=g(!1),_=ae({label_name:""}),k=g([]),B=l=>{k.value=l.map(({label_id:o})=>o)},{dictData:V}=W(""),{pager:m,getLists:f,resetParams:x,resetPage:L}=J({fetchFun:Y,params:_}),$=async()=>{var l;c.value=!0,await D(),(l=p.value)==null||l.open("add")},N=async l=>{var o,b;c.value=!0,await D(),(o=p.value)==null||o.open("edit"),(b=p.value)==null||b.setFormData(l)},E=async l=>{await G.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await X({label_id:l}),f()};return f(),(l,o)=>{const b=j,h=A,i=M,P=q,F=K,R=H,v=O,U=Q,S=z,C=oe("perms"),T=Z;return s(),le("div",null,[e(F,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[e(P,{class:"mb-[-16px]",model:a(_),inline:""},{default:t(()=>[e(h,{label:"\u6807\u7B7E\u540D\u79F0",prop:"label_name"},{default:t(()=>[e(b,{class:"w-[280px]",modelValue:a(_).label_name,"onUpdate:modelValue":o[0]||(o[0]=n=>a(_).label_name=n),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(h,null,{default:t(()=>[e(i,{type:"primary",onClick:a(L)},{default:t(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:a(x)},{default:t(()=>[r("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),d((s(),u(F,{class:"!border-none",shadow:"never"},{default:t(()=>[d((s(),u(i,{type:"primary",onClick:$},{icon:t(()=>[e(R,{name:"el-icon-Plus"})]),default:t(()=>[r(" \u65B0\u589E ")]),_:1})),[[C,["user_label.user_label/add"]]]),d((s(),u(i,{disabled:!a(k).length,onClick:o[1]||(o[1]=n=>E(a(k)))},{default:t(()=>[r(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[C,["user_label.user_label/delete"]]]),w("div",ie,[e(U,{data:a(m).lists,onSelectionChange:B},{default:t(()=>[e(v,{type:"selection",width:"55"}),e(v,{label:"ID",prop:"label_id",width:"100"}),e(v,{label:"\u6807\u7B7E\u540D\u79F0",prop:"label_name","show-overflow-tooltip":""}),e(v,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:t(({row:n})=>[d((s(),u(i,{type:"primary",link:"",onClick:I=>N(n)},{default:t(()=>[r(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[C,["user_label.user_label/edit"]]]),d((s(),u(i,{type:"danger",link:"",onClick:I=>E(n.label_id)},{default:t(()=>[r(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[C,["user_label.user_label/delete"]]])]),_:1})]),_:1},8,["data"])]),w("div",re,[e(S,{modelValue:a(m),"onUpdate:modelValue":o[2]||(o[2]=n=>ne(m)?m.value=n:null),onChange:a(f)},null,8,["modelValue","onChange"])])]),_:1})),[[T,a(m).loading]]),a(c)?(s(),u(ee,{key:0,ref_key:"editRef",ref:p,"dict-data":a(V),onSuccess:a(f),onClose:o[3]||(o[3]=n=>c.value=!1)},null,8,["dict-data","onSuccess"])):se("",!0)])}}});export{He as default};
