import{b as M,ah as f,J as C,o as E,c as I,p as t,q as a,P as i,x as r,n as l,aj as N,c8 as V,e_ as x,S as R,l as v,k as S,j as q,m as B,D as P}from"./index.8d733f79.js";import T from"./addAppMenu.47948612.js";import"./el-progress.ee3fa77d.js";import"./el-input-number.60463ef8.js";import"./index.28f6da25.js";const j={style:{height:"100%",display:"flex","flex-direction":"column"}},G={__name:"appMenu",setup(A,{expose:h}){const{t:_,locale:F}=M(),{proxy:c}=P(),m=f({total:0,tableData:[],columns:[{prop:"title",label:"menuName",width:200},{prop:"path",label:"url",width:300},{prop:"sort",label:"menuSort"},{prop:"hidden",label:"isVisible",formatter:e=>e.hidden?"\u4E0D\u663E\u793A":"\u663E\u793A"},{label:"action",type:"action",width:180,fixed:"right"}]}),o=f({title:""});C.session.getJSON("userInfo").deployType;async function n(){const e=await V(o);m.tableData=e.data}const y=()=>{o.title="",n()},g=()=>{c.$refs.addMenuDialogRef.showDialog()},b=e=>{c.$refs.addMenuDialogRef.showDialog(e)},D=e=>{c.$modal.confirm(_("confirmDelete")).then(()=>{x(e.menuId).then(d=>{R.success(d.msg),n()})}).catch(()=>{})};return h({getList:n}),(e,d)=>{const s=v,p=S,k=q,$=B;return E(),I("div",j,[t($,{ref:"formRef",model:l(o),inline:!0,"label-width":"68px"},{default:a(()=>[t(p,null,{default:a(()=>[t(s,{type:"primary",onClick:g},{default:a(()=>[i(r(e.$t("addMenu")),1)]),_:1})]),_:1}),t(p,{label:e.$t("menuName")},{default:a(()=>[t(k,{modelValue:l(o).title,"onUpdate:modelValue":d[0]||(d[0]=u=>l(o).title=u),placeholder:e.$t("menuNameP"),maxlength:"10",style:{width:"236px"}},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(p,null,{default:a(()=>[t(s,{type:"primary",onClick:n},{default:a(()=>[i(r(e.$t("query")),1)]),_:1}),t(s,{onClick:y},{default:a(()=>[i(r(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),t(l(N),{class:"f-h",columns:l(m).columns,tableData:l(m).tableData,pagination:!1},{action:a(({scope:u})=>[t(s,{link:"",type:"primary",onClick:w=>b(u.row)},{default:a(()=>[i(r(e.$t("edit")),1)]),_:2},1032,["onClick"]),t(s,{link:"",type:"danger",onClick:w=>D(u.row)},{default:a(()=>[i(r(e.$t("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["columns","tableData"]),t(T,{ref:"addMenuDialogRef",onRefresh:n},null,512)])}}};export{G as default};
