var z=(i,d,l)=>new Promise((c,u)=>{var h=a=>{try{p(l.next(a))}catch(s){u(s)}},g=a=>{try{p(l.throw(a))}catch(s){u(s)}},p=a=>a.done?c(a.value):Promise.resolve(a.value).then(h,g);p((l=l.apply(i,d)).next())});import{_ as J}from"./form.vue_vue_type_script_setup_true_lang-CbgKyTTd.js";import{K as Q,r,o as W,i as m,D as L,a3 as f,F as Y,b as Z,aX as N,dU as E,aa as w,a8 as ee,A as V,aC as ne}from"./index-CILjx9Al.js";import{c as te}from"./system-CJFpF1Rs.js";import{u as ae}from"./hooks-DhGDvZze.js";import"./index-Bx9KcvM0.js";import"./index-CLgPHcDw.js";import"./index-CIq9lEFX.js";function ie(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!ne(i)}function he(){const i=Q({title:""}),d=r(),l=r([]),c=r(!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"},[L(ae(n.icon),{style:{paddingTop:"1px"}})]),m("span",null,[f(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"},ie(t=u(n.menuType,!0))?t:{default:()=>[t]})}},{label:"路由路径",prop:"path"},{label:"组件路径",prop:"component",formatter:({path:n,component:e})=>N(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 p(n){n&&(n.resetFields(),a())}function a(){return z(this,null,function*(){c.value=!0;const{data:n}=yield te();let e=n;N(i.title)||(e=e.filter(t=>f(t.title).includes(i.title))),l.value=E(e),setTimeout(()=>{c.value=!1},500)})}function s(n){if(!n||!n.length)return;const e=[];for(let t=0;tL(J,{ref:d}),beforeSure:(U,{options:X})=>{const q=d.value.getRef(),B=X.props.formInline;function x(){V(`您${n}了菜单名称为${f(B.title)}的这条数据`,{type:"success"}),U(),a()}q.validate(G=>{G&&x()})}})}function K(n){V(`您删除了菜单名称为${f(n.title)}的这条数据`,{type:"success"}),a()}return W(()=>{a()}),{form:i,loading:c,columns:h,dataList:l,onSearch:a,resetForm:p,openDialog:H,handleDelete:K,handleSelectionChange:g}}export{he as useMenu};