import{C as j,D as A,w as G,F as Q,T as q,O as K,Q as M,R as O}from"./element-plus.d8e0827b.js";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang.b67c1046.js";import{f as z,b as H}from"./index.58242ff9.js";import{u as J}from"./usePaging.6a6670f9.js";import{u as W}from"./useDictOptions.f8f89444.js";import{e as X,a as Y}from"./goods_label.a0d3704a.js";import"./lodash.466e9fe4.js";import{_ as ee}from"./edit.vue_vue_type_script_setup_true_name_goodsLabelEdit_lang.fed8b8fc.js";import{d as F,s as oe,r as E,Z as te,ap as ae,o as s,c as le,U as e,L as o,u as t,R as r,M as p,K as m,a as y,j as ne,Q as se,n as D}from"./@vue.18505fe0.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.fbc6a400.js";import"./@element-plus.edbd5a83.js";import"./dayjs.a6528143.js";import"./@babel.16688d44.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./axios.4905d81f.js";import"./jspdf.54afd842.js";import"./fflate.fca59393.js";import"./vue-router.101084e3.js";import"./pinia.a969beab.js";import"./css-color-function.29b71fa4.js";import"./color.87d313dc.js";import"./clone.a63396d9.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.3461658b.js";import"./vue-clipboard3.c63182fd.js";import"./clipboard.dd2c63d0.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.432b2bf9.js";const ie={class:"mt-4"},re={class:"flex mt-4 justify-end"},me=F({name:"goodsLabelLists"}),We=F({...me,setup(de){const u=oe(),c=E(!1),_=te({name:""}),C=E([]),B=l=>{C.value=l.map(({id:a})=>a)},{dictData:V}=W(""),{pager:d,getLists:f,resetParams:x,resetPage:L}=J({fetchFun:Y,params:_}),$=async()=>{var l;c.value=!0,await D(),(l=u.value)==null||l.open("add")},R=async l=>{var a,v;c.value=!0,await D(),(a=u.value)==null||a.open("edit"),(v=u.value)==null||v.setFormData(l)},k=async l=>{await z.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await X({id:l}),f()};return f(),(l,a)=>{const v=j,h=A,i=G,P=Q,w=q,T=H,b=K,N=M,S=Z,g=ae("perms"),I=O;return s(),le("div",null,[e(w,{class:"!border-none mb-4",shadow:"never"},{default:o(()=>[e(P,{class:"mb-[-16px]",model:t(_),inline:""},{default:o(()=>[e(h,{label:"\u6807\u7B7E\u540D",prop:"name"},{default:o(()=>[e(v,{class:"w-[280px]",modelValue:t(_).name,"onUpdate:modelValue":a[0]||(a[0]=n=>t(_).name=n),clearable:"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1}),e(h,null,{default:o(()=>[e(i,{type:"primary",onClick:t(L)},{default:o(()=>[r("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(i,{onClick:t(x)},{default:o(()=>[r("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),p((s(),m(w,{class:"!border-none",shadow:"never"},{default:o(()=>[p((s(),m(i,{type:"primary",onClick:$},{icon:o(()=>[e(T,{name:"el-icon-Plus"})]),default:o(()=>[r(" \u65B0\u589E ")]),_:1})),[[g,["goods.goods_label/add"]]]),p((s(),m(i,{disabled:!t(C).length,onClick:a[1]||(a[1]=n=>k(t(C)))},{default:o(()=>[r(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[g,["goods.goods_label/delete"]]]),y("div",ie,[e(N,{data:t(d).lists,onSelectionChange:B},{default:o(()=>[e(b,{type:"selection",width:"55"}),e(b,{label:"ID",prop:"id","show-overflow-tooltip":""}),e(b,{label:"\u6807\u7B7E\u540D",prop:"name","show-overflow-tooltip":""}),e(b,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:o(({row:n})=>[p((s(),m(i,{type:"primary",link:"",onClick:U=>R(n)},{default:o(()=>[r(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[g,["goods.goods_label/edit"]]]),p((s(),m(i,{type:"danger",link:"",onClick:U=>k(n.id)},{default:o(()=>[r(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[g,["goods.goods_label/delete"]]])]),_:1})]),_:1},8,["data"])]),y("div",re,[e(S,{modelValue:t(d),"onUpdate:modelValue":a[2]||(a[2]=n=>ne(d)?d.value=n:null),onChange:t(f)},null,8,["modelValue","onChange"])])]),_:1})),[[I,t(d).loading]]),t(c)?(s(),m(ee,{key:0,ref_key:"editRef",ref:u,"dict-data":t(V),onSuccess:t(f),onClose:a[3]||(a[3]=n=>c.value=!1)},null,8,["dict-data","onSuccess"])):se("",!0)])}}});export{We as default};