import{d as B,O as M,v as b,k as p,m as D,r as P,o as h,x as w,b as o,a as n,t as $,u as i,z as L,c as O,M as S,B as T}from"./vue.1703796278973.js";import{M as C,a0 as V,ax as A}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as c}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import N from"./ButtonAddDialog.1703796278973.js";import{I as E,M as R}from"./system.1703796278973.js";import{_ as j}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./index.170379627897337.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.1703796278973320.js";import"./default.1703796278973.js";import"./index.1703796278973299.js";import"./PermissChoose.1703796278973.js";import"./index.170379627897327.js";import"./permission.17037962789732.js";import"./comm.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const z={class:"button-mange-container"},J={class:"dialog"},q=B({__name:"ButtonMange",setup(U){const u="system/Menu",l=M(),_=b({id:l.params.id===":id"?"":l.params.id,...l.query}),g=p(""),k=p({}),m=p(!1),y=p("新增"),f=(e,t)=>{if(!_.id&&!g.value)return C.warning("请先新增菜单基本信息");console.log(3),k.value={...t},y.value=e,m.value=!0},d=p({}),a=b({columns:[{title:"编码",dataIndex:"id",key:"id",width:220},{title:"名称",dataIndex:"name",key:"name",width:300},{title:"说明",dataIndex:"description",key:"description"},{title:"操作",dataIndex:"action",key:"action",scopedSlots:!0,width:240}],tableData:[],getList:()=>{_.id&&E(_.id).then(e=>{var t;d.value=e.result,a.tableData=((t=e.result)==null?void 0:t.buttons)||[]})},clickDel:e=>{const t=d.value.buttons.filter(v=>v.id!==e.id),s={...d.value,buttons:t};R(s).then(()=>{C.success("操作成功"),a.getList()})}});return a.getList(),D(()=>l.params.id,e=>{e&&(g.value=e)}),(e,t)=>{const s=P("AIcon"),v=V,I=A;return h(),w("div",z,[o(I,{ref:"tableRef",columns:i(a).columns,model:"TABLE",dataSource:i(a).tableData,noPagination:""},{headerTitle:n(()=>[o(c,{type:"primary",hasPermission:`${u}:update`,onClick:t[0]||(t[0]=r=>f("新增",{}))},{default:n(()=>[o(s,{type:"PlusOutlined"}),$("新增 ")]),_:1},8,["hasPermission"])]),action:n(r=>[o(v,{size:16},{default:n(()=>[o(c,{type:"link",hasPermission:`${u}:update`,tooltip:{title:"编辑"},onClick:x=>f("编辑",r)},{default:n(()=>[o(s,{type:"EditOutlined"})]),_:2},1032,["hasPermission","onClick"]),o(c,{type:"link",hasPermission:`${u}:view`,tooltip:{title:"查看"},onClick:x=>f("查看",r)},{default:n(()=>[o(s,{type:"SearchOutlined"})]),_:2},1032,["hasPermission","onClick"]),o(c,{type:"link",tooltip:{title:"删除"},popConfirm:{title:"确认删除",onConfirm:()=>i(a).clickDel(r)}},{default:n(()=>[o(s,{type:"DeleteOutlined"})]),_:2},1032,["popConfirm"])]),_:2},1024)]),_:1},8,["columns","dataSource"]),L("div",J,[i(m)?(h(),O(N,{key:0,visible:i(m),"onUpdate:visible":t[1]||(t[1]=r=>S(m)?m.value=r:null),"menu-info":i(d),mode:i(y),data:i(k),onConfirm:i(a).getList},null,8,["visible","menu-info","mode","data","onConfirm"])):T("",!0)])])}}});const Tt=j(q,[["__scopeId","data-v-de0177f9"]]);export{Tt as default};
