import{d as Q,z as W,J as X,Q as Y,r as d,A as Z,b as $,a1 as G,o as n,c as T,k as e,B as a,a as o,a2 as H,F as E,i as ee,a3 as ae,N as F,g as c,O as p,P as m,h as le,aF as oe,dI as N,a7 as te,S as se,$ as re,R as ne,U as pe,V as ie,W as ue,X as de,Y as ce,Z as me}from"./index-BP6bNRoi.js";import{_ as fe}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{_ as ye}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{h as _e}from"./tree-BBZY150N.js";import{j as we,k as ve}from"./index-Abw9tEaW.js";import{_ as ke}from"./MenuForm.vue_vue_type_script_setup_true_lang-B3BsOB4e.js";import"./color-DXkOL5Tu.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./Tooltip.vue_vue_type_script_setup_true_lang-DU3-PeCc.js";import"./index-BZESAUPP.js";import"./el-tree-select-pYALMRc9.js";import"./constants-CuOBQ73z.js";const he=Q({name:"SystemMenu",__name:"index",setup(be){const{wsCache:O}=W(),{t:A}=X(),w=Y(),v=d(!0),R=d([]),i=Z({name:void 0,status:void 0}),U=d(),k=d(!1),h=d(!0),f=async()=>{v.value=!0;try{const y=await we(i);R.value=_e(y)}finally{v.value=!1}},b=()=>{f()},P=()=>{U.value.resetFields(),b()},V=d(),C=(y,t,x)=>{V.value.open(y,t,x)},D=()=>{h.value=!1,k.value=!k.value,oe(()=>{h.value=!0})},j=async()=>{try{await w.confirm("\u5373\u5C06\u66F4\u65B0\u7F13\u5B58\u5237\u65B0\u6D4F\u89C8\u5668\uFF01","\u5237\u65B0\u83DC\u5355\u7F13\u5B58"),O.delete(N.USER),O.delete(N.ROLE_ROUTERS),location.reload()}catch{}};return $(()=>{f()}),(y,t)=>{const x=te,S=se,q=re,z=ne,u=pe,s=ie,B=ue,g=ye,r=de,I=fe,J=ce,_=G("hasPermi"),K=me;return n(),T(E,null,[e(g,null,{default:a(()=>[e(B,{ref_key:"queryFormRef",ref:U,inline:!0,model:o(i),class:"-mb-15px","label-width":"68px"},{default:a(()=>[e(S,{label:"\u83DC\u5355\u540D\u79F0",prop:"name"},{default:a(()=>[e(x,{modelValue:o(i).name,"onUpdate:modelValue":t[0]||(t[0]=l=>o(i).name=l),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0",onKeyup:H(b,["enter"])},null,8,["modelValue"])]),_:1}),e(S,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[e(z,{modelValue:o(i).status,"onUpdate:modelValue":t[1]||(t[1]=l=>o(i).status=l),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u83DC\u5355\u72B6\u6001"},{default:a(()=>[(n(!0),T(E,null,ee(o(ae)(o(F).COMMON_STATUS),l=>(n(),c(q,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(S,null,{default:a(()=>[e(s,{onClick:b},{default:a(()=>[e(u,{class:"mr-5px",icon:"ep:search"}),p(" \u641C\u7D22 ")]),_:1}),e(s,{onClick:P},{default:a(()=>[e(u,{class:"mr-5px",icon:"ep:refresh"}),p(" \u91CD\u7F6E ")]),_:1}),m((n(),c(s,{plain:"",type:"primary",onClick:t[2]||(t[2]=l=>C("create"))},{default:a(()=>[e(u,{class:"mr-5px",icon:"ep:plus"}),p(" \u65B0\u589E ")]),_:1})),[[_,["system:menu:create"]]]),e(s,{plain:"",type:"danger",onClick:D},{default:a(()=>[e(u,{class:"mr-5px",icon:"ep:sort"}),p(" \u5C55\u5F00/\u6298\u53E0 ")]),_:1}),e(s,{plain:"",onClick:j},{default:a(()=>[e(u,{class:"mr-5px",icon:"ep:refresh"}),p(" \u5237\u65B0\u83DC\u5355\u7F13\u5B58 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),e(g,null,{default:a(()=>[o(h)?m((n(),c(J,{key:0,data:o(R),"default-expand-all":o(k),"row-key":"id"},{default:a(()=>[e(r,{"show-overflow-tooltip":!0,label:"\u83DC\u5355\u540D\u79F0",prop:"name",width:"250"}),e(r,{align:"center",label:"\u56FE\u6807",prop:"icon",width:"100"},{default:a(l=>[e(u,{icon:l.row.icon},null,8,["icon"])]),_:1}),e(r,{label:"\u6392\u5E8F",prop:"sort",width:"60"}),e(r,{"show-overflow-tooltip":!0,label:"\u6743\u9650\u6807\u8BC6",prop:"permission"}),e(r,{"show-overflow-tooltip":!0,label:"\u7EC4\u4EF6\u8DEF\u5F84",prop:"component"}),e(r,{"show-overflow-tooltip":!0,label:"\u7EC4\u4EF6\u540D\u79F0",prop:"componentName"}),e(r,{label:"\u72B6\u6001",prop:"status",width:"80"},{default:a(l=>[e(I,{type:o(F).COMMON_STATUS,value:l.row.status},null,8,["type","value"])]),_:1}),e(r,{align:"center",label:"\u64CD\u4F5C"},{default:a(l=>[m((n(),c(s,{link:"",type:"primary",onClick:M=>C("update",l.row.id)},{default:a(()=>[p(" \u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[_,["system:menu:update"]]]),m((n(),c(s,{link:"",type:"primary",onClick:M=>C("create",void 0,l.row.id)},{default:a(()=>[p(" \u65B0\u589E ")]),_:2},1032,["onClick"])),[[_,["system:menu:create"]]]),m((n(),c(s,{link:"",type:"danger",onClick:M=>(async L=>{try{await w.delConfirm(),await ve(L),w.success(A("common.delSuccess")),await f()}catch{}})(l.row.id)},{default:a(()=>[p(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[_,["system:menu:delete"]]])]),_:1})]),_:1},8,["data","default-expand-all"])),[[K,o(v)]]):le("",!0)]),_:1}),e(ke,{ref_key:"formRef",ref:V,onSuccess:f},null,512)],64)}}});export{he as default};
|