import{B as Ie,M as xe,r as c,aa as Se,ae as Ue,e as r,D as te,o as u,c as U,F as N,K as Fe,h as t,f as l,w as e,k as Me,G as K,H as R,l as m,p as d,ab as z,av as ne,m as f,z as P,n as y,aw as qe,v as Ke,ad as Re}from"./index.82404a61.js";import{l as oe,g as Pe,u as $e,a as De,d as Be}from"./menu.5cb391aa.js";import{I as Ee}from"./index.835a4fb3.js";import"./index.vue_vue_type_style_index_0_scoped_79fe850d_lang.831d5a3c.js";function Le(j){return Ie({url:"/system/sysModule/list",method:"get",params:j})}const Ae={class:"app-container"},Oe={class:"dialog-footer"},Qe=xe({name:"Menu"}),Je=Object.assign(Qe,{setup(j){const{proxy:_}=Ke(),{sys_show_hide:ue,sys_normal_disable:$}=_.useDict("sys_show_hide","sys_normal_disable"),D=c([]),w=c(!1),B=c(!0),F=c(!0),E=c(""),M=c([]),L=c(!1),A=c(!0),T=c(!1),G=c(null),H=c([]),de=Se({form:{},queryParams:{menuName:void 0,visible:void 0},rules:{menuName:[{required:!0,message:"\u83DC\u5355\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],orderNum:[{required:!0,message:"\u83DC\u5355\u987A\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],path:[{required:!0,message:"\u8DEF\u7531\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],moduleKey:[{required:!0,message:"\u6240\u5C5E\u83DC\u5355\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}}),{queryParams:I,form:n,rules:se}=Ue(de);function x(){B.value=!0,oe(I.value).then(s=>{D.value=_.handleTree(s.data,"menuId"),console.log(D.value),B.value=!1})}function re(){Le().then(s=>{H.value=s.data})}function J(){M.value=[],oe().then(s=>{const o={menuId:0,menuName:"\u4E3B\u7C7B\u76EE",children:[]};o.children=_.handleTree(s.data,"menuId"),M.value.push(o),console.log("\u4E0B\u62C9\u6811",M.value)})}function me(){w.value=!1,O()}function O(){n.value={menuId:void 0,parentId:0,menuName:void 0,icon:void 0,menuType:"M",orderNum:void 0,moduleKey:void 0,isFrame:"1",isCache:"0",visible:"0",status:"0"},_.resetForm("menuRef")}function W(){G.value.reset(),T.value=!0}function pe(s){n.value.icon=s,T.value=!1}function ie(s){var o=s.relatedTarget||s.srcElement||s.target||s.currentTarget,v=o.className;v!=="el-input__inner"&&(T.value=!1)}function Q(){x()}function ce(){_.resetForm("queryRef"),Q()}function X(s){O(),J(),s!=null&&s.menuId?n.value.parentId=s.menuId:n.value.parentId=0,w.value=!0,E.value="\u6DFB\u52A0\u83DC\u5355"}function fe(){A.value=!1,L.value=!L.value,Re(()=>{A.value=!0})}async function _e(s){O(),await J(),Pe(s.menuId).then(o=>{n.value=o.data,w.value=!0,E.value="\u4FEE\u6539\u83DC\u5355"})}function ye(){_.$refs.menuRef.validate(s=>{s&&(n.value.menuId!=null?$e(n.value).then(o=>{_.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),w.value=!1,x()}):De(n.value).then(o=>{_.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),w.value=!1,x()}))})}function ve(s){_.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u540D\u79F0\u4E3A"'+s.menuName+'"\u7684\u6570\u636E\u9879?').then(function(){return Be(s.menuId)}).then(()=>{x(),_.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}return x(),re(),(s,o)=>{const v=r("el-input"),p=r("el-form-item"),Y=r("el-option"),Z=r("el-select"),b=r("el-button"),ee=r("el-form"),i=r("el-col"),be=r("right-toolbar"),le=r("el-row"),h=r("el-table-column"),he=r("dict-tag"),ge=r("el-table"),Ve=r("el-tree-select"),g=r("el-radio"),S=r("el-radio-group"),we=r("search"),V=r("el-icon"),ke=r("el-popover"),Ce=r("el-input-number"),k=r("question-filled"),C=r("el-tooltip"),Ne=r("el-dialog"),q=te("hasPermi"),Te=te("loading");return u(),U("div",Ae,[N(l(ee,{model:t(I),ref:"queryRef",inline:!0},{default:e(()=>[l(p,{label:"\u83DC\u5355\u540D\u79F0",prop:"menuName"},{default:e(()=>[l(v,{modelValue:t(I).menuName,"onUpdate:modelValue":o[0]||(o[0]=a=>t(I).menuName=a),placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:Me(Q,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),l(p,{label:"\u72B6\u6001",prop:"status"},{default:e(()=>[l(Z,{modelValue:t(I).status,"onUpdate:modelValue":o[1]||(o[1]=a=>t(I).status=a),placeholder:"\u83DC\u5355\u72B6\u6001",clearable:"",style:{width:"200px"}},{default:e(()=>[(u(!0),U(K,null,R(t($),a=>(u(),m(Y,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(p,null,{default:e(()=>[l(b,{type:"primary",icon:"Search",onClick:Q},{default:e(()=>[d("\u641C\u7D22")]),_:1}),l(b,{icon:"Refresh",onClick:ce},{default:e(()=>[d("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[Fe,t(F)]]),l(le,{gutter:10,class:"mb8"},{default:e(()=>[l(i,{span:1.5},{default:e(()=>[N((u(),m(b,{type:"primary",plain:"",icon:"Plus",onClick:X},{default:e(()=>[d("\u65B0\u589E")]),_:1})),[[q,["system:menu:add"]]])]),_:1},8,["span"]),l(i,{span:1.5},{default:e(()=>[l(b,{type:"info",plain:"",icon:"Sort",onClick:fe},{default:e(()=>[d("\u5C55\u5F00/\u6298\u53E0")]),_:1})]),_:1},8,["span"]),l(be,{showSearch:t(F),"onUpdate:showSearch":o[2]||(o[2]=a=>z(F)?F.value=a:null),onQueryTable:x},null,8,["showSearch"])]),_:1}),t(A)?N((u(),m(ge,{key:0,data:t(D),"row-key":"menuId","default-expand-all":t(L),"tree-props":{children:"children",hasChildren:"hasChildren"}},{default:e(()=>[l(h,{prop:"menuName",label:"\u83DC\u5355\u540D\u79F0","show-overflow-tooltip":!0,width:"160"}),l(h,{prop:"icon",label:"\u56FE\u6807",align:"center",width:"100"},{default:e(a=>[l(t(ne),{"icon-class":a.row.icon},null,8,["icon-class"])]),_:1}),l(h,{prop:"orderNum",label:"\u6392\u5E8F",width:"60"}),l(h,{prop:"perms",label:"\u6743\u9650\u6807\u8BC6","show-overflow-tooltip":!0}),l(h,{prop:"component",label:"\u7EC4\u4EF6\u8DEF\u5F84","show-overflow-tooltip":!0}),l(h,{prop:"status",label:"\u72B6\u6001",width:"80"},{default:e(a=>[l(he,{options:t($),value:a.row.status},null,8,["options","value"])]),_:1}),l(h,{prop:"status",label:"\u662F\u5426\u7F13\u5B58",width:"80"},{default:e(a=>[f("span",null,P(a.row.isCache==1?"\u4E0D\u7F13\u5B58":"\u7F13\u5B58"),1)]),_:1}),l(h,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",width:"160",prop:"createTime"},{default:e(a=>[f("span",null,P(s.parseTime(a.row.createTime)),1)]),_:1}),l(h,{label:"\u64CD\u4F5C",align:"center",width:"210","class-name":"small-padding fixed-width"},{default:e(a=>[N((u(),m(b,{link:"",type:"primary",icon:"Edit",onClick:ae=>_e(a.row)},{default:e(()=>[d("\u4FEE\u6539")]),_:2},1032,["onClick"])),[[q,["system:menu:edit"]]]),N((u(),m(b,{link:"",type:"primary",icon:"Plus",onClick:ae=>X(a.row)},{default:e(()=>[d("\u65B0\u589E")]),_:2},1032,["onClick"])),[[q,["system:menu:add"]]]),N((u(),m(b,{link:"",type:"primary",icon:"Delete",onClick:ae=>ve(a.row)},{default:e(()=>[d("\u5220\u9664")]),_:2},1032,["onClick"])),[[q,["system:menu:remove"]]])]),_:1})]),_:1},8,["data","default-expand-all"])),[[Te,t(B)]]):y("",!0),l(Ne,{title:t(E),modelValue:t(w),"onUpdate:modelValue":o[18]||(o[18]=a=>z(w)?w.value=a:null),width:"680px","append-to-body":""},{footer:e(()=>[f("div",Oe,[l(b,{type:"primary",onClick:ye},{default:e(()=>[d("\u786E \u5B9A")]),_:1}),l(b,{onClick:me},{default:e(()=>[d("\u53D6 \u6D88")]),_:1})])]),default:e(()=>[l(ee,{ref:"menuRef",model:t(n),rules:t(se),"label-width":"100px"},{default:e(()=>[l(le,null,{default:e(()=>[l(i,{span:24},{default:e(()=>[l(p,{label:"\u4E0A\u7EA7\u83DC\u5355"},{default:e(()=>[l(Ve,{modelValue:t(n).parentId,"onUpdate:modelValue":o[3]||(o[3]=a=>t(n).parentId=a),data:t(M),props:{value:"menuId",label:"menuName",children:"children"},"value-key":"menuId",placeholder:"\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355","check-strictly":""},null,8,["modelValue","data"])]),_:1})]),_:1}),l(i,{span:24},{default:e(()=>[l(p,{label:"\u83DC\u5355\u7C7B\u578B",prop:"menuType"},{default:e(()=>[l(S,{modelValue:t(n).menuType,"onUpdate:modelValue":o[4]||(o[4]=a=>t(n).menuType=a)},{default:e(()=>[l(g,{label:"M"},{default:e(()=>[d("\u76EE\u5F55")]),_:1}),l(g,{label:"C"},{default:e(()=>[d("\u83DC\u5355")]),_:1}),l(g,{label:"F"},{default:e(()=>[d("\u6309\u94AE")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),l(i,{span:24},{default:e(()=>[l(p,{label:"\u6240\u5C5E\u83DC\u5355",prop:"moduleKey"},{default:e(()=>[l(Z,{modelValue:t(n).moduleKey,"onUpdate:modelValue":o[5]||(o[5]=a=>t(n).moduleKey=a),placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u83DC\u5355",clearable:"",style:{width:"240px"}},{default:e(()=>[(u(!0),U(K,null,R(t(H),a=>(u(),m(Y,{key:a.moduleKey,label:a.moduleName,value:a.moduleKey},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),t(n).menuType!="F"?(u(),m(i,{key:0,span:24},{default:e(()=>[l(p,{label:"\u83DC\u5355\u56FE\u6807",prop:"icon"},{default:e(()=>[l(ke,{placement:"bottom-start",width:540,visible:t(T),"onUpdate:visible":o[7]||(o[7]=a=>z(T)?T.value=a:null),trigger:"click",onShow:W},{reference:e(()=>[N((u(),m(v,{modelValue:t(n).icon,"onUpdate:modelValue":o[6]||(o[6]=a=>t(n).icon=a),placeholder:"\u70B9\u51FB\u9009\u62E9\u56FE\u6807",onBlur:W,readonly:""},{prefix:e(()=>[t(n).icon?(u(),m(t(ne),{key:0,"icon-class":t(n).icon,class:"el-input__icon",style:{height:"32px",width:"16px"}},null,8,["icon-class"])):(u(),m(V,{key:1,style:{height:"32px",width:"16px"}},{default:e(()=>[l(we)]),_:1}))]),_:1},8,["modelValue"])),[[t(qe),ie]])]),default:e(()=>[l(t(Ee),{ref_key:"iconSelectRef",ref:G,onSelected:pe},null,512)]),_:1},8,["visible"])]),_:1})]),_:1})):y("",!0),l(i,{span:12},{default:e(()=>[l(p,{label:"\u83DC\u5355\u540D\u79F0",prop:"menuName"},{default:e(()=>[l(v,{modelValue:t(n).menuName,"onUpdate:modelValue":o[8]||(o[8]=a=>t(n).menuName=a),placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1}),l(i,{span:12},{default:e(()=>[l(p,{label:"\u663E\u793A\u6392\u5E8F",prop:"orderNum"},{default:e(()=>[l(Ce,{modelValue:t(n).orderNum,"onUpdate:modelValue":o[9]||(o[9]=a=>t(n).orderNum=a),"controls-position":"right",min:0},null,8,["modelValue"])]),_:1})]),_:1}),t(n).menuType!="F"?(u(),m(i,{key:1,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:"\u9009\u62E9\u662F\u5916\u94FE\u5219\u8DEF\u7531\u5730\u5740\u9700\u8981\u4EE5`http(s)://`\u5F00\u5934",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d("\u662F\u5426\u5916\u94FE ")])]),default:e(()=>[l(S,{modelValue:t(n).isFrame,"onUpdate:modelValue":o[10]||(o[10]=a=>t(n).isFrame=a)},{default:e(()=>[l(g,{label:"0"},{default:e(()=>[d("\u662F")]),_:1}),l(g,{label:"1"},{default:e(()=>[d("\u5426")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType!="F"?(u(),m(i,{key:2,span:12},{default:e(()=>[l(p,{prop:"path"},{label:e(()=>[f("span",null,[l(C,{content:"\u8BBF\u95EE\u7684\u8DEF\u7531\u5730\u5740\uFF0C\u5982\uFF1A`user`\uFF0C\u5982\u5916\u7F51\u5730\u5740\u9700\u5185\u94FE\u8BBF\u95EE\u5219\u4EE5`http(s)://`\u5F00\u5934",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u8DEF\u7531\u5730\u5740 ")])]),default:e(()=>[l(v,{modelValue:t(n).path,"onUpdate:modelValue":o[11]||(o[11]=a=>t(n).path=a),placeholder:"\u8BF7\u8F93\u5165\u8DEF\u7531\u5730\u5740"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType=="C"?(u(),m(i,{key:3,span:12},{default:e(()=>[l(p,{prop:"component"},{label:e(()=>[f("span",null,[l(C,{content:"\u8BBF\u95EE\u7684\u7EC4\u4EF6\u8DEF\u5F84\uFF0C\u5982\uFF1A`system/user/index`\uFF0C\u9ED8\u8BA4\u5728`views`\u76EE\u5F55\u4E0B",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u7EC4\u4EF6\u8DEF\u5F84 ")])]),default:e(()=>[l(v,{modelValue:t(n).component,"onUpdate:modelValue":o[12]||(o[12]=a=>t(n).component=a),placeholder:"\u8BF7\u8F93\u5165\u7EC4\u4EF6\u8DEF\u5F84"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType!="M"?(u(),m(i,{key:4,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:"\u63A7\u5236\u5668\u4E2D\u5B9A\u4E49\u7684\u6743\u9650\u5B57\u7B26\uFF0C\u5982\uFF1A@PreAuthorize(`@ss.hasPermi('system:user:list')`)",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u6743\u9650\u5B57\u7B26 ")])]),default:e(()=>[l(v,{modelValue:t(n).perms,"onUpdate:modelValue":o[13]||(o[13]=a=>t(n).perms=a),placeholder:"\u8BF7\u8F93\u5165\u6743\u9650\u6807\u8BC6",maxlength:"100"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType=="C"?(u(),m(i,{key:5,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:'\u8BBF\u95EE\u8DEF\u7531\u7684\u9ED8\u8BA4\u4F20\u9012\u53C2\u6570\uFF0C\u5982\uFF1A`{"id": 1, "name": "ry"}`',placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u8DEF\u7531\u53C2\u6570 ")])]),default:e(()=>[l(v,{modelValue:t(n).query,"onUpdate:modelValue":o[14]||(o[14]=a=>t(n).query=a),placeholder:"\u8BF7\u8F93\u5165\u8DEF\u7531\u53C2\u6570",maxlength:"255"},null,8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType=="C"?(u(),m(i,{key:6,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:"\u9009\u62E9\u662F\u5219\u4F1A\u88AB`keep-alive`\u7F13\u5B58\uFF0C\u9700\u8981\u5339\u914D\u7EC4\u4EF6\u7684`name`\u548C\u5730\u5740\u4FDD\u6301\u4E00\u81F4",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u662F\u5426\u7F13\u5B58 ")])]),default:e(()=>[l(S,{modelValue:t(n).isCache,"onUpdate:modelValue":o[15]||(o[15]=a=>t(n).isCache=a)},{default:e(()=>[l(g,{label:"0"},{default:e(()=>[d("\u7F13\u5B58")]),_:1}),l(g,{label:"1"},{default:e(()=>[d("\u4E0D\u7F13\u5B58")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType!="F"?(u(),m(i,{key:7,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:"\u9009\u62E9\u9690\u85CF\u5219\u8DEF\u7531\u5C06\u4E0D\u4F1A\u51FA\u73B0\u5728\u4FA7\u8FB9\u680F\uFF0C\u4F46\u4ECD\u7136\u53EF\u4EE5\u8BBF\u95EE",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u663E\u793A\u72B6\u6001 ")])]),default:e(()=>[l(S,{modelValue:t(n).visible,"onUpdate:modelValue":o[16]||(o[16]=a=>t(n).visible=a)},{default:e(()=>[(u(!0),U(K,null,R(t(ue),a=>(u(),m(g,{key:a.value,label:a.value},{default:e(()=>[d(P(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0),t(n).menuType!="F"?(u(),m(i,{key:8,span:12},{default:e(()=>[l(p,null,{label:e(()=>[f("span",null,[l(C,{content:"\u9009\u62E9\u505C\u7528\u5219\u8DEF\u7531\u5C06\u4E0D\u4F1A\u51FA\u73B0\u5728\u4FA7\u8FB9\u680F\uFF0C\u4E5F\u4E0D\u80FD\u88AB\u8BBF\u95EE",placement:"top"},{default:e(()=>[l(V,null,{default:e(()=>[l(k)]),_:1})]),_:1}),d(" \u83DC\u5355\u72B6\u6001 ")])]),default:e(()=>[l(S,{modelValue:t(n).status,"onUpdate:modelValue":o[17]||(o[17]=a=>t(n).status=a)},{default:e(()=>[(u(!0),U(K,null,R(t($),a=>(u(),m(g,{key:a.value,label:a.value},{default:e(()=>[d(P(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})):y("",!0)]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});export{Je as default};