You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
10 KiB
2 lines
10 KiB
|
4 months ago
|
import{d as ce,r as y,ao as x,ax as w,w as fe,G as ye,cx as be,a as r,f as K,q as B,e as o,b as e,h as l,as as ge,H as s,Y as T,c as d,a1 as ve,t as Ve,$ as m,j as F,F as P,g as Q,e0 as he,e1 as ke,e2 as we,e3 as Te,e4 as Ce,a7 as C,e5 as Ee,ae as Ue,e6 as Ae,d0 as Ne,d1 as Ie,aj as Me,an as Le,aw as Oe,ab as xe,av as Ke,b3 as Be,cz as Fe,b4 as qe,aA as De,bI as Ge,cA as Re,cB as Se,aq as Xe,ap as $e,bD as ze,ac as je,at as Pe}from"./index-e450010e.js";import{_ as Qe}from"./plus-f2947ec6.js";import{_ as He}from"./refresh-f1723430.js";import{_ as Ye}from"./search-71444aff.js";import{I as Je}from"./index-cbb5b1c9.js";var c=(v=>(v.CATALOG="CATALOG",v.MENU="MENU",v.BUTTON="BUTTON",v.EXTLINK="EXTLINK",v))(c||{});const We={class:"app-container"},Ze={class:"search"},el={class:"glm-btn-box"},ll={class:"dialog-footer"},rl=ce({name:"cmenu",inheritAttrs:!1,__name:"index",setup(v){const q=y(x),E=y(x),M=y(!1),b=w({visible:!1}),k=y([]),D=y([]),U=w({}),G=y([]),R=y([]),t=w({parentId:0,visible:1,sort:1,type:c.MENU,outside:1}),H=w({parentId:[{required:!0,message:"请选择顶级菜单",trigger:"blur"}],name:[{required:!0,message:"请输入菜单名称",trigger:"blur"}],type:[{required:!0,message:"请选择菜单类型",trigger:"blur"}],path:[{required:!0,message:"请输入路由路径",trigger:"blur"}],component:[{required:!0,message:"请输入组件完整路径",trigger:"blur"}]}),Y=y(),A=w({type:"",path:""});function g(){M.value=!0,ke(U).then(({data:u})=>{G.value=u}).then(()=>{M.value=!1})}function J(){q.value.resetFields(),g()}function W(u){Y.value=u.id}function L(u,n){we().then(({data:i})=>{R.value=[{value:0,label:"顶级菜单",children:i}]}).then(()=>{b.visible=!0,n?(b.title="编辑菜单",Te({id:n.toString()}).then(({data:i})=>{Object.assign(t,i),A.type=i.type,A.path=i.path??""})):(b.title="新增菜单",t.parentId=u)}).finally(()=>{ae()})}function Z(){t.type!==A.type?t.path="":t.path=A.path}function ee(){E.value.validate(u=>{u&&(t.id?Ce(t).then(()=>{C.success("修改成功"),N(),g()}):Ee(t).then(()=>{C.success("新增成功"),N(),g()}))})}function le(u){if(!u)return C.warning("请勾选删除项"),!1;Ue.confirm("确认删除已选中的数据项?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{Ae({id:u.toString()}).then(()=>{C.success("删除成功"),g()})}).catch(()=>C.info("已取消删除"))}function N(){b.visible=!1,te()}function te(){E.value.resetFields(),E.value.clearValidate(),t.id=void 0,t.parentId=0,t.visible=1,t.sort=1}const ae=()=>{Ne().then(({data:u})=>{console.log(" 获取app列表应用",u),k.value=u}).finally(()=>{Ie().then(({data:u})=>{console.log(" 获取app列表应用=====>",u),u.appid!=0&&(t.appKey=u.appid.toString()),t.sdatableKey=u.tableKey})})};return fe(()=>t.appKey,u=>{k&&k.value.length>0&&k.value.forEach(n=>{n.app_id==u&&(D.value=n.list)})},{deep:!0}),ye(()=>{g()}),(u,n)=>{const i=Me,p=Le,S=x,X=Oe,oe=Ye,f=xe,ne=He,se=Ke,re=Qe,V=Be,h=Fe,de=qe,ue=De,pe=Ge,_=Re,O=Se,$=Xe,z=$e,ie=ze,me=je,I=be("hasPerm"),_e=Pe;return r(),K("div",We,[B("div",Ze,[o(se,null,{default:e(()=>[o(X,{span:16},{default:e(()=>[o(S,{ref_key:"queryFormRef",ref:q,model:l(U),inline:!0},{default:e(()=>[o(p,{label:"关键字",prop:"keywords"},{default:e(()=>[o(i,{modelValue:l(U).keywords,"onUpdate:modelValue":n[0]||(n[0]=a=>l(U).keywords=a),placeholder:"菜单名称",clearable:"",onKeyup:ge(g,["enter"])},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1}),o(X,{span:8,style:{"text-align":"right"}},{default:e(()=>[o(f,{type:"primary",onClick:g},{icon:e(()=>[o(oe)]),default:e(()=>[s("搜索")]),_:1}),o(f,{onClick:J},{icon:e(()=>[o(ne)]),default:e(()=>[s(" 重置")]),_:1})]),_:1})]),_:1})]),B("div",el,[T((r(),d(f,{type:"primary",onClick:n[1]||(n[1]=a=>L(0))},{icon:e(()=>[o(re)]),default:e(()=>[s(" 新增")]),_:1})),[[I,["121646328009732096"]]])]),o(ue,{shadow:"never"},{default:e(()=>[T((r(),d(de,{data:l(G),"highlight-current-row":"","tree-props":{children:"children",hasChildren:"hasChildren"},"row-key":"id",fit:"",onRowClick:W},{default:e(()=>[o(V,{label:"菜单名称"},{default:e(a=>[o(ve,{"icon
|