var z=(i,d,l)=>new Promise((c,u)=>{var h=a=>{try{f(l.next(a))}catch(s){u(s)}},g=a=>{try{f(l.throw(a))}catch(s){u(s)}},f=a=>a.done?c(a.value):Promise.resolve(a.value).then(h,g);f((l=l.apply(i,d)).next())});import{_ as U}from"./form.vue_vue_type_script_setup_true_lang-DGgBcTFS.js";import{r as W,a as T,m as X,i as m,N as A,ad as p,F as Y,e as Z,db as V,gg as w,ai as ee,ah as ne,a0 as te,L as H,aE as ae}from"./index-D0RG78dK.js";import{f as ie}from"./system-D_erpgb2.js";import{u as le}from"./hooks-BEgHF0Pm.js";import"./index-BKgIQJko.js";import"./index-DZun9NNS.js";import"./index-BL4iWg76.js";function se(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!ae(i)}function Te(){const i=W({title:""}),d=T(),l=T([]),c=T(!0),u=(n,e=!1)=>{switch(n){case 0:return e?"菜单":"primary";case 1:return e?"iframe":"warning";case 2:return e?"外链":"danger";case 3:return e?"按钮":"info"}},h=[{label:"菜单名称",prop:"title",align:"left",cellRenderer:({row:n})=>m(Y,null,[m("span",{class:"inline-block mr-1"},[A(le(n.icon),{style:{paddingTop:"1px"}})]),m("span",null,[p(n.title)])])},{label:"菜单类型",prop:"menuType",width:100,cellRenderer:({row:n,props:e})=>{let t;return m(Z("el-tag"),{size:e.size,type:u(n.menuType),effect:"plain"},se(t=u(n.menuType,!0))?t:{default:()=>[t]})}},{label:"路由路径",prop:"path"},{label:"组件路径",prop:"component",formatter:({path:n,component:e})=>V(e)?n:e},{label:"权限标识",prop:"auths"},{label:"排序",prop:"rank",width:100},{label:"隐藏",prop:"showLink",formatter:({showLink:n})=>n?"否":"是",width:100},{label:"操作",fixed:"right",width:210,slot:"operation"}];function g(n){}function f(n){n&&(n.resetFields(),a())}function a(){return z(this,null,function*(){c.value=!0;const{data:n}=yield ie();let e=n;V(i.title)||(e=e.filter(t=>p(t.title).includes(i.title))),l.value=w(e),setTimeout(()=>{c.value=!1},500)})}function s(n){if(!n||!n.length)return;const e=[];for(let t=0;tA(U,{ref:d}),beforeSure:(E,{options:G})=>{const J=d.value.getRef(),K=G.props.formInline;function o(){H(`您${n}了菜单名称为${p(K.title)}的这条数据`,{type:"success"}),E(),a()}J.validate(Q=>{Q&&o()})}})}function B(n){H(`您删除了菜单名称为${p(n.title)}的这条数据`,{type:"success"}),a()}return X(()=>{a()}),{form:i,loading:c,columns:h,dataList:l,onSearch:a,resetForm:f,openDialog:q,handleDelete:B,handleSelectionChange:g}}export{Te as useMenu};