import{C as j,D as A,w as G,F as M,L as q,M as K,N as O,O as Q}from"./element-plus.73c9e9a6.js";import{_ as Z}from"./index.vue_vue_type_script_setup_true_lang.317e431e.js";import{f as z,b as H}from"./index.bd5cd373.js";import{u as J}from"./usePaging.77fa9d39.js";import{u as W}from"./useDictOptions.3ea9a314.js";import{d as X,e as Y}from"./goods_label.0c2c9a3d.js";import"./lodash.403d4198.js";import{_ as ee}from"./edit.vue_vue_type_script_setup_true_name_goodsLabelEdit_lang.0e272446.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.663bc523.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.4b5afb22.js";import"./@element-plus.8b1118e2.js";import"./dayjs.3f38f327.js";import"./axios.18becb61.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.58fac957.js";import"./pinia.068f0ef2.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.e6143ca6.js";import"./color.d79aa98b.js";import"./clone.a63396d9.js";import"./color-convert.69e17089.js";import"./color-string.e356f5de.js";import"./color-name.e7a4e1d3.js";import"./nprogress.48cb4095.js";import"./vue-clipboard3.6d09ff6e.js";import"./clipboard.564aa4b9.js";import"./echarts.8485a033.js";import"./zrender.b2f30540.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.85e4ac8b.js";import"./index.fa58e261.js";const ie={class:"mt-4"},re={class:"flex mt-4 justify-end"},me=F({name:"goodsLabelLists"}),Qe=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")},N=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=M,w=q,R=H,b=K,S=O,T=Z,g=ae("perms"),I=Q;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:"",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(R,{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(S,{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=>N(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(T,{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{Qe as default};
