var z=(i,m,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,m)).next())});import{_ as G}from"./form.vue_vue_type_script_setup_true_lang-a09XvpWO.js";import{W as J,r,o as K,i as d,D as L,ab as f,F as Q,e as U,aY as N,e2 as Z,ag as w,af as ee,X as ne,A as V,aE as te}from"./index-CuWJll_k.js";import{f as ae}from"./system-DfHdJUkg.js";import{u as ie}from"./hooks-Bqs8kxys.js";import"./index-Ce4FXPZm.js";import"./index-DURBBPVu.js";import"./index-B5FDY6wP.js";function le(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Object]"&&!te(i)}function ge(){const i=J({title:""}),m=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})=>d(Q,null,[d("span",{class:"inline-block mr-1"},[L(ie(n.icon),{style:{paddingTop:"1px"}})]),d("span",null,[f(n.title)])])},{label:"菜单类型",prop:"menuType",width:100,cellRenderer:({row:n,props:e})=>{let t;return d(U("el-tag"),{size:e.size,type:u(n.menuType),effect:"plain"},le(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 ae();let e=n;N(i.title)||(e=e.filter(t=>f(t.title).includes(i.title))),l.value=Z(e),setTimeout(()=>{c.value=!1},500)})}function s(n){if(!n||!n.length)return;const e=[];for(let t=0;tL(G,{ref:m}),beforeSure:(X,{options:Y})=>{const q=m.value.getRef(),B=Y.props.formInline;function x(){V(`您${n}了菜单名称为${f(B.title)}的这条数据`,{type:"success"}),X(),a()}q.validate(E=>{E&&x()})}})}function W(n){V(`您删除了菜单名称为${f(n.title)}的这条数据`,{type:"success"}),a()}return K(()=>{a()}),{form:i,loading:c,columns:h,dataList:l,onSearch:a,resetForm:p,openDialog:H,handleDelete:W,handleSelectionChange:g}}export{ge as useMenu};