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.8c800afc.js";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang.7b224fce.js";import{f as z,b as H}from"./index.2398c167.js";import{u as J}from"./usePaging.6a6670f9.js";import{u as W}from"./useDictOptions.080d297e.js";import{e as X,a as Y}from"./goods_label.e35119a3.js";import"./lodash.be6e4bb5.js";import{_ as ee}from"./edit.vue_vue_type_script_setup_true_name_goodsLabelEdit_lang.8b3a41a5.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 u,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.ef95d8c0.js";import"./axios.77245e3c.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.886c5f5a.js";import"./pinia.a969beab.js";import"./css-color-function.6061d63f.js";import"./color.1580a89c.js";import"./clone.4ed29f58.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.b29ee5e2.js";import"./vue-clipboard3.15c43b43.js";import"./clipboard.4a3580c9.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./index.d0a14c5a.js";const ie={class:"mt-4"},re={class:"flex mt-4 justify-end"},me=F({name:"goodsLabelLists"}),ze=F({...me,setup(de){const p=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=p.value)==null||l.open("add")},R=async l=>{var a,v;c.value=!0,await D(),(a=p.value)==null||a.open("edit"),(v=p.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}),u((s(),m(w,{class:"!border-none",shadow:"never"},{default:o(()=>[u((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"]]]),u((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})=>[u((s(),m(i,{type:"primary",link:"",onClick:U=>R(n)},{default:o(()=>[r(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[g,["goods.goods_label/edit"]]]),u((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:p,"dict-data":t(V),onSuccess:t(f),onClose:a[3]||(a[3]=n=>c.value=!1)},null,8,["dict-data","onSuccess"])):se("",!0)])}}});export{ze as default};
