import{C as A,D as K,w as q,F as G,K as H,G as M,b as Q,H as Z,I as z}from"./element-plus.8e273e86.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang.d6032bc4.js";import{f as O,b as W}from"./index.a39f73a6.js";import{u as X}from"./usePaging.f8c888e4.js";import{u as Y}from"./useDictOptions.19d08143.js";import{_ as ee,a as te,b as oe}from"./edit.vue_vue_type_script_setup_true_name_labelEdit_lang.6e4c5d89.js";import"./lodash.41b9567d.js";import{d as F,s as ae,r as y,Z as le,ap as ne,o as i,c as ie,U as t,L as o,u as a,R as r,M as u,K as m,a as B,j as se,Q as re,n as D}from"./@vue.76ce7aa3.js";import"./lodash-es.f52bd8b1.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.9ffef7f8.js";import"./@element-plus.73235148.js";import"./dayjs.0112e2c7.js";import"./@babel.80d29b7b.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./axios.b4cbdbc9.js";import"./jspdf.75308076.js";import"./fflate.0418c72f.js";import"./vue-router.10bd5b90.js";import"./pinia.f3529286.js";import"./css-color-function.f23177ae.js";import"./color.a6ad6672.js";import"./clone.954ba32c.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.b502f541.js";import"./vue-clipboard3.e775fc74.js";import"./clipboard.6417898a.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8d65305c.js";import"./picker.033744bc.js";import"./index.1c24829c.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.cf0d972e.js";import"./index.ba6cf828.js";import"./index.6dc3249b.js";import"./vuedraggable.1d6c5910.js";import"./vue.6c4d4a7c.js";import"./sortablejs.a0474a26.js";const me={class:"mt-4"},pe={class:"flex mt-4 justify-end"},ue=F({name:"labelLists"}),nt=F({...ue,setup(de){const d=ae(),c=y(!1),_=le({label_name:"",logo:""}),C=y([]),x=n=>{C.value=n.map(({id:e})=>e)},{dictData:V}=Y(""),{pager:p,getLists:f,resetParams:h,resetPage:L}=X({fetchFun:oe,params:_}),$=async()=>{var n;c.value=!0,await D(),(n=d.value)==null||n.open("add")},P=async n=>{var e,b;c.value=!0,await D(),(e=d.value)==null||e.open("edit"),(b=d.value)==null||b.setFormData(n)},E=async n=>{await O.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await te({id:n}),f()};return f(),(n,e)=>{const b=A,k=K,s=q,R=G,w=H,I=W,g=M,N=Q,S=Z,T=J,v=ne("perms"),U=z;return i(),ie("div",null,[t(w,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[t(R,{class:"mb-[-16px]",model:a(_),inline:""},{default:o(()=>[t(k,{label:"\u6807\u7B7E\u540D\u5B57",prop:"label_name"},{default:o(()=>[t(b,{class:"w-[280px]",modelValue:a(_).label_name,"onUpdate:modelValue":e[0]||(e[0]=l=>a(_).label_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D\u5B57"},null,8,["modelValue"])]),_:1}),t(k,null,{default:o(()=>[t(s,{type:"primary",onClick:a(L)},{default:o(()=>e[4]||(e[4]=[r("\u67E5\u8BE2")])),_:1},8,["onClick"]),t(s,{onClick:a(h)},{default:o(()=>e[5]||(e[5]=[r("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),u((i(),m(w,{class:"!border-none",shadow:"never"},{default:o(()=>[u((i(),m(s,{type:"primary",onClick:$},{icon:o(()=>[t(I,{name:"el-icon-Plus"})]),default:o(()=>[e[6]||(e[6]=r(" \u65B0\u589E "))]),_:1})),[[v,["setting.label/add"]]]),u((i(),m(s,{disabled:!a(C).length,onClick:e[1]||(e[1]=l=>E(a(C)))},{default:o(()=>e[7]||(e[7]=[r(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[v,["setting.label/delete"]]]),B("div",me,[t(S,{data:a(p).lists,onSelectionChange:x},{default:o(()=>[t(g,{type:"selection",width:"55"}),t(g,{label:"\u6807\u7B7E\u540D\u5B57",prop:"label_name","show-overflow-tooltip":""}),t(g,{label:"logo(\u56FE\u7247)",prop:"logo"},{default:o(({row:l})=>[t(N,{style:{width:"50px",height:"50px"},src:l.logo,"preview-teleported":!0},null,8,["src"])]),_:1}),t(g,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:l})=>[u((i(),m(s,{type:"primary",link:"",onClick:j=>P(l)},{default:o(()=>e[8]||(e[8]=[r(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[v,["setting.label/edit"]]]),u((i(),m(s,{type:"danger",link:"",onClick:j=>E(l.id)},{default:o(()=>e[9]||(e[9]=[r(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[v,["setting.label/delete"]]])]),_:1})]),_:1},8,["data"])]),B("div",pe,[t(T,{modelValue:a(p),"onUpdate:modelValue":e[2]||(e[2]=l=>se(p)?p.value=l:null),onChange:a(f)},null,8,["modelValue","onChange"])])]),_:1})),[[U,a(p).loading]]),a(c)?(i(),m(ee,{key:0,ref_key:"editRef",ref:d,"dict-data":a(V),onSuccess:a(f),onClose:e[3]||(e[3]=l=>c.value=!1)},null,8,["dict-data","onSuccess"])):re("",!0)])}}});export{nt as default};
