2025-03-20 10:46:42 +08:00

2 lines
5.5 KiB
JavaScript

import{G as q,H as G,L as H,M as K,N as Q,O as Z,B as z,C as J,w as W,D as X}from"./element-plus.2acb577d.js";import{_ as Y}from"./index.vue_vue_type_script_setup_true_lang.a280d02d.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang.d978f65b.js";import{f as oe,b as te}from"./index.81df6f20.js";import{u as le}from"./usePaging.23706826.js";import{u as ae}from"./useDictOptions.4fbfb4d7.js";import{_ as se,a as ne,b as ie}from"./edit.vue_vue_type_script_setup_true_name_categoryEdit_lang.0a0206de.js";import"./lodash.6bfd3540.js";import{d as $,s as ue,r as B,Z as re,am as pe,o as i,c as D,U as o,L as l,u as t,T as me,a9 as de,K as r,R as m,M as _,a as V,i as ce,Q as _e,n as x}from"./@vue.821a47ec.js";import"./lodash-es.df44a280.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.81e2759c.js";import"./@element-plus.dabbc398.js";import"./dayjs.d2a77ee0.js";import"./axios.9e996410.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.4c04f9b6.js";import"./pinia.fefed778.js";import"./css-color-function.8ff67959.js";import"./color.bfa08e9a.js";import"./clone.660f80c4.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.dcb32030.js";import"./vue-clipboard3.e681583f.js";import"./clipboard.3ad9b20b.js";import"./echarts.42bea269.js";import"./tslib.60310f1a.js";import"./zrender.2cb48b70.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.8864a4be.js";import"./index.f292cd50.js";const fe={class:"mt-4"},ve={class:"flex mt-4 justify-end"},we=$({name:"categoryLists"}),to=$({...we,setup(be){const f=ue(),v=B(!1),u=re({pid:"",cate_name:"",path:"",sort:"",pic:"",is_show:"",level:""}),C=B([]),L=n=>{C.value=n.map(({category_id:e})=>e)},{dictData:F}=ae("show_status"),{pager:d,getLists:w,resetParams:A,resetPage:N}=le({fetchFun:ie,params:u}),P=async()=>{var n;v.value=!0,await x(),(n=f.value)==null||n.open("add")},R=async n=>{var e,c;v.value=!0,await x(),(e=f.value)==null||e.open("edit"),(c=f.value)==null||c.setFormData(n)},y=async n=>{await oe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ne({category_id:n}),w()};return w(),(n,e)=>{const c=z,b=J,k=q,S=G,p=W,T=X,h=H,U=te,s=K,I=ee,M=Q,O=Y,g=pe("perms"),j=Z;return i(),D("div",null,[o(h,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[o(T,{class:"mb-[-16px]",model:t(u),inline:""},{default:l(()=>[o(b,{label:"\u7236id",prop:"pid"},{default:l(()=>[o(c,{class:"w-[280px]",modelValue:t(u).pid,"onUpdate:modelValue":e[0]||(e[0]=a=>t(u).pid=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7236id"},null,8,["modelValue"])]),_:1}),o(b,{label:"\u5206\u7C7B\u540D\u79F0",prop:"cate_name"},{default:l(()=>[o(c,{class:"w-[280px]",modelValue:t(u).cate_name,"onUpdate:modelValue":e[1]||(e[1]=a=>t(u).cate_name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(b,{label:"\u662F\u5426\u663E\u793A",prop:"is_show"},{default:l(()=>[o(S,{class:"w-[280px]",modelValue:t(u).is_show,"onUpdate:modelValue":e[2]||(e[2]=a=>t(u).is_show=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u663E\u793A"},{default:l(()=>[o(k,{label:"\u5168\u90E8",value:""}),(i(!0),D(me,null,de(t(F).show_status,(a,E)=>(i(),r(k,{key:E,label:a.name,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(b,null,{default:l(()=>[o(p,{type:"primary",onClick:t(N)},{default:l(()=>e[6]||(e[6]=[m("\u67E5\u8BE2")])),_:1},8,["onClick"]),o(p,{onClick:t(A)},{default:l(()=>e[7]||(e[7]=[m("\u91CD\u7F6E")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((i(),r(h,{class:"!border-none",shadow:"never"},{default:l(()=>[_((i(),r(p,{type:"primary",onClick:P},{icon:l(()=>[o(U,{name:"el-icon-Plus"})]),default:l(()=>[e[8]||(e[8]=m(" \u65B0\u589E "))]),_:1})),[[g,["setting/category/add"]]]),_((i(),r(p,{disabled:!t(C).length,onClick:e[3]||(e[3]=a=>y(t(C)))},{default:l(()=>e[9]||(e[9]=[m(" \u5220\u9664 ")])),_:1},8,["disabled"])),[[g,["setting/category/delete"]]]),V("div",fe,[o(M,{data:t(d).lists,onSelectionChange:L},{default:l(()=>[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:l(({row:a})=>[o(I,{options:t(F).show_status,value:a.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:l(({row:a})=>[_((i(),r(p,{type:"primary",link:"",onClick:E=>R(a)},{default:l(()=>e[10]||(e[10]=[m(" \u7F16\u8F91 ")])),_:2},1032,["onClick"])),[[g,["setting/category/edit"]]]),_((i(),r(p,{type:"danger",link:"",onClick:E=>y(a.category_id)},{default:l(()=>e[11]||(e[11]=[m(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[g,["setting/category/delete"]]])]),_:1})]),_:1},8,["data"])]),V("div",ve,[o(O,{modelValue:t(d),"onUpdate:modelValue":e[4]||(e[4]=a=>ce(d)?d.value=a:null),onChange:t(w)},null,8,["modelValue","onChange"])])]),_:1})),[[j,t(d).loading]]),t(v)?(i(),r(se,{key:0,ref_key:"editRef",ref:f,"dict-data":t(F),onSuccess:t(w),onClose:e[5]||(e[5]=a=>v.value=!1)},null,8,["dict-data","onSuccess"])):_e("",!0)])}}});export{to as default};