moreShopAdmin/build/admin/assets/index.d49344ad.js

2 lines
4.8 KiB
JavaScript

import{m as $,s as O,r as V,aT as X,b2 as Y,p as u,q as B,t as o,v as a,u as t,V as z,W as G,y as r,a2 as p,L as _,x as D,i as H,A as J,n as x,aW as K,aX as M,b3 as Q,b4 as Z,ae as ee,aY as oe,b5 as te,b6 as ae,b7 as le,b8 as se}from"./.pnpm.1b0299fb.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_lang.b077f234.js";import{_ as ue}from"./index.vue_vue_type_script_setup_true_lang.bbc9e61d.js";import{f as ie,b as re}from"./index.689cfa31.js";import{u as de}from"./usePaging.00aa976d.js";import{u as pe}from"./useDictOptions.e9843f63.js";import{_ as me,a as ce,b as _e}from"./edit.vue_vue_type_script_setup_true_name_categoryEdit_lang.a80479cc.js";import"./lodash.c3b66c05.js";import"./@vueuse.72d44d91.js";import"./@vue.9d708d7c.js";import"./index.6c48d0ba.js";import"./index.vue_vue_type_style_index_0_scoped_d380c88d_lang.abac7546.js";const fe={class:"mt-4"},ve={class:"flex mt-4 justify-end"},be=$({name:"categoryLists"}),Ae=$({...be,setup(we){const f=O(),v=V(!1),i=X({pid:"",cate_name:"",path:"",sort:"",pic:"",is_show:"",level:""}),C=V([]),A=n=>{C.value=n.map(({category_id:e})=>e)},{dictData:F}=pe("show_status"),{pager:m,getLists:b,resetParams:L,resetPage:P}=de({fetchFun:_e,params:i}),S=async()=>{var n;v.value=!0,await x(),(n=f.value)==null||n.open("add")},T=async n=>{var e,c;v.value=!0,await x(),(e=f.value)==null||e.open("edit"),(c=f.value)==null||c.setFormData(n)},E=async n=>{await ie.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ce({category_id:n}),b()};return b(),(n,e)=>{const c=K,w=M,k=Q,N=Z,d=ee,R=oe,h=te,U=re,s=ae,q=ue,I=le,W=ne,g=Y("perms"),j=se;return u(),B("div",null,[o(h,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[o(R,{class:"mb-[-16px]",model:t(i),inline:""},{default:a(()=>[o(w,{label:"\u7236id",prop:"pid"},{default:a(()=>[o(c,{class:"w-[280px]",modelValue:t(i).pid,"onUpdate:modelValue":e[0]||(e[0]=l=>t(i).pid=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7236id"},null,8,["modelValue"])]),_:1}),o(w,{label:"\u5206\u7C7B\u540D\u79F0",prop:"cate_name"},{default:a(()=>[o(c,{class:"w-[280px]",modelValue:t(i).cate_name,"onUpdate:modelValue":e[1]||(e[1]=l=>t(i).cate_name=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(w,{label:"\u662F\u5426\u663E\u793A",prop:"is_show"},{default:a(()=>[o(N,{class:"w-[280px]",modelValue:t(i).is_show,"onUpdate:modelValue":e[2]||(e[2]=l=>t(i).is_show=l),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A"},{default:a(()=>[o(k,{label:"\u5168\u90E8",value:""}),(u(!0),B(z,null,G(t(F).show_status,(l,y)=>(u(),r(k,{key:y,label:l.name,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(w,null,{default:a(()=>[o(d,{type:"primary",onClick:t(P)},{default:a(()=>e[6]||(e[6]=[p("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(d,{onClick:t(L)},{default:a(()=>e[7]||(e[7]=[p("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((u(),r(h,{class:"!border-none",shadow:"never"},{default:a(()=>[_((u(),r(d,{type:"primary",onClick:S},{icon:a(()=>[o(U,{name:"el-icon-Plus"})]),default:a(()=>[e[8]||(e[8]=p(" \u65B0\u589E "))]),_:1})),[[g,["setting/category/add"]]]),_((u(),r(d,{disabled:!t(C).length,onClick:e[3]||(e[3]=l=>E(t(C)))},{default:a(()=>e[9]||(e[9]=[p(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[g,["setting/category/delete"]]]),D("div",fe,[o(I,{data:t(m).lists,onSelectionChange:A},{default:a(()=>[o(s,{type:"selection",width:"55"}),o(s,{label:"id",prop:"category_id","show-overflow-tooltip":""}),o(s,{label:"\u7236id",prop:"pid","show-overflow-tooltip":""}),o(s,{label:"\u5206\u7C7B\u540D\u79F0",prop:"cate_name","show-overflow-tooltip":""}),o(s,{label:"\u8DEF\u5F84",prop:"path","show-overflow-tooltip":""}),o(s,{label:"\u6392\u5E8F",prop:"sort","show-overflow-tooltip":""}),o(s,{label:"\u56FE\u6807",prop:"pic","show-overflow-tooltip":""}),o(s,{label:"\u662F\u5426\u663E\u793A",prop:"is_show"},{default:a(({row:l})=>[o(q,{options:t(F).show_status,value:l.is_show},null,8,["options","value"])]),_:1}),o(s,{label:"\u7B49\u7EA7",prop:"level","show-overflow-tooltip":""}),o(s,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:a(({row:l})=>[_((u(),r(d,{type:"primary",link:"",onClick:y=>T(l)},{default:a(()=>e[10]||(e[10]=[p(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[g,["setting/category/edit"]]]),_((u(),r(d,{type:"danger",link:"",onClick:y=>E(l.category_id)},{default:a(()=>e[11]||(e[11]=[p(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[g,["setting/category/delete"]]])]),_:1})]),_:1},8,["data"])]),D("div",ve,[o(W,{modelValue:t(m),"onUpdate:modelValue":e[4]||(e[4]=l=>H(m)?m.value=l:null),onChange:t(b)},null,8,["modelValue","onChange"])])]),_:1})),[[j,t(m).loading]]),t(v)?(u(),r(me,{key:0,ref_key:"editRef",ref:f,"dict-data":t(F),onSuccess:t(b),onClose:e[5]||(e[5]=l=>v.value=!1)},null,8,["dict-data","onSuccess"])):J("",!0)])}}});export{Ae as default};