import{C as O,D as Z,w as z,F as G,T as H,O as J,b as W,Q as X,R as Y}from"./element-plus.619595c4.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang.02c63712.js";import{f as te,b as oe}from"./index.adbcc6f1.js";import{u as ae}from"./usePaging.6a6670f9.js";import{u as le}from"./useDictOptions.2130484f.js";import{a as ne,d as ie,e as se}from"./brand.e65f0c02.js";import{_ as re}from"./edit.vue_vue_type_script_setup_true_name_brandEdit_lang.d89af3ab.js";import{_ as ue}from"./detail.vue_vue_type_script_setup_true_name_brandEdit_lang.1a237a2f.js";import{d as S,s as V,r as k,Z as me,ap as de,o as s,c as pe,U as e,L as a,u as o,R as d,M as p,K as r,a as $,j as ce,Q as R,n as E}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.6ad9ae30.js";import"./axios.fbe06b45.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./lodash.0987e768.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.316b9a3d.js";import"./vue-clipboard3.f9a42727.js";import"./clipboard.bf37ca4b.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.b0c09b66.js";import"./picker.cee998d0.js";import"./index.122ff80d.js";import"./index.a062bd93.js";import"./index.f9c4a330.js";import"./vuedraggable.4bfa7ed1.js";import"./vue.3bfea163.js";import"./sortablejs.2765eebe.js";const _e={class:"mt-4"},fe={class:"flex mt-4 justify-end"},Ce=S({name:"brandLists"}),rt=S({...Ce,setup(ve){const v=V(),F=V(),b=k(!1),g=k(!1),w=me({name:"",py:"",number:"",data:"",more:"",pic:"",sort:""}),h=k([]),L=n=>{h.value=n.map(({id:t})=>t)},{dictData:y}=le(""),{pager:c,getLists:_,resetParams:P,resetPage:T}=ae({fetchFun:se,params:w}),I=async()=>{var n;b.value=!0,await E(),(n=v.value)==null||n.open("add")},N=async n=>{var t,u;b.value=!0,await E(),(t=v.value)==null||t.open("edit"),(u=v.value)==null||u.setFormData(n)},U=async n=>{var u,f;let t=await ne({id:n});g.value=!0,await E(),(u=F.value)==null||u.open("edit"),(f=F.value)==null||f.setFormData(t)},D=async n=>{await te.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ie({id:n}),_()};return _(),(n,t)=>{const u=O,f=Z,m=z,j=G,B=H,A=oe,i=J,Q=W,q=X,K=ee,C=de("perms"),M=Y;return s(),pe("div",null,[e(B,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(j,{class:"mb-[-16px]",model:o(w),inline:""},{default:a(()=>[e(f,{label:"\u54C1\u724C\u540D\u79F0",prop:"name"},{default:a(()=>[e(u,{class:"w-[280px]",modelValue:o(w).name,"onUpdate:modelValue":t[0]||(t[0]=l=>o(w).name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(f,null,{default:a(()=>[e(m,{type:"primary",onClick:o(T)},{default:a(()=>[d("\u67E5\u8BE2")]),_:1},8,["onClick"]),e(m,{onClick:o(P)},{default:a(()=>[d("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),p((s(),r(B,{class:"!border-none",shadow:"never"},{default:a(()=>[p((s(),r(m,{type:"primary",onClick:I},{icon:a(()=>[e(A,{name:"el-icon-Plus"})]),default:a(()=>[d(" \u65B0\u589E ")]),_:1})),[[C,["goods.brand/add"]]]),p((s(),r(m,{disabled:!o(h).length,onClick:t[1]||(t[1]=l=>D(o(h)))},{default:a(()=>[d(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[C,["goods.brand/delete"]]]),$("div",_e,[e(q,{data:o(c).lists,onSelectionChange:L},{default:a(()=>[e(i,{type:"selection",width:"55"}),e(i,{label:"ID",prop:"id",width:"55"}),e(i,{label:"\u54C1\u724C\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(i,{label:"\u54C1\u724C\u7F16\u53F7",prop:"number","show-overflow-tooltip":""}),e(i,{label:"\u5907\u6CE8\u4FE1\u606F",prop:"data","show-overflow-tooltip":""}),e(i,{label:"\u6269\u5C55\u4FE1\u606F",prop:"more","show-overflow-tooltip":""}),e(i,{label:"\u56FE\u7247",prop:"pic"},{default:a(({row:l})=>[e(Q,{style:{width:"50px",height:"50px"},src:l.pic},null,8,["src"])]),_:1}),e(i,{label:"\u6392\u5E8F",prop:"sort","show-overflow-tooltip":""}),e(i,{label:"\u64CD\u4F5C",width:"170",fixed:"right"},{default:a(({row:l})=>[p((s(),r(m,{type:"primary",link:"",onClick:x=>N(l)},{default:a(()=>[d(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[C,["goods.brand/edit"]]]),p((s(),r(m,{type:"danger",link:"",onClick:x=>D(l.id)},{default:a(()=>[d(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[C,["goods.brand/delete"]]]),p((s(),r(m,{link:"",onClick:x=>U(l.id)},{default:a(()=>[d(" \u8BE6\u60C5 ")]),_:2},1032,["onClick"])),[[C,["goods.brand/delete"]]])]),_:1})]),_:1},8,["data"])]),$("div",fe,[e(K,{modelValue:o(c),"onUpdate:modelValue":t[2]||(t[2]=l=>ce(c)?c.value=l:null),onChange:o(_)},null,8,["modelValue","onChange"])])]),_:1})),[[M,o(c).loading]]),o(b)?(s(),r(re,{key:0,ref_key:"editRef",ref:v,"dict-data":o(y),onSuccess:o(_),onClose:t[3]||(t[3]=l=>b.value=!1)},null,8,["dict-data","onSuccess"])):R("",!0),o(g)?(s(),r(ue,{key:1,ref_key:"detailRef",ref:F,"dict-data":o(y),onSuccess:o(_),onClose:t[4]||(t[4]=l=>g.value=!1)},null,8,["dict-data","onSuccess"])):R("",!0)])}}});export{rt as default};