import{aK as s,aL as P,ah as y,bo as M,aM as R,q,B as m,C as w,aD as p,r as x,o as S,n as W,L as f,M as B,p as I,t as r,v as u}from"./index.7a111e62.js";import L from"./menu-tree.880863ea.js";import{u as T,_ as $}from"./use-page-modal.b5ebad31.js";import{P as N}from"./page-content.ac155fae.js";import"./index.12338420.js";import"./index.3ac3c8f0.js";import"./responseHandle.6edfaed2.js";import"./hooks.f4063c52.js";import"./use-response-handle.f995d678.js";const{VITE_PROXY_DOMAIN_REAL:ie,VITE_PROXY_USER_REAL:U}=P(),i=U+"/admin/",Y=e=>s.request("post",`${i}menuaction`,{data:e}),O=e=>s.request("post",`${i}menuactionadd`,{data:e}),V=e=>s.request("post",`${i}menuactionsave`,{data:e}),H=e=>s.request("post",`${i}menuactionstatus`,{data:e}),z=e=>s.request("post",`${i}menuactiondel`,{data:e}),G=[{type:"selection",minWidth:55,align:"left",hide:({checkList:e})=>!e.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:e})=>!e.includes("\u5E8F\u53F7\u5217")},{label:"\u6309\u94AE\u540D\u79F0",prop:"action_name",minWidth:180,align:"left"},{label:"\u72B6\u6001",prop:"status",minWidth:80,cellRenderer:({row:e,props:a})=>y(M,{size:a.size,type:String(e.status)==="1"?"success":"danger"},{default:()=>e.status+""=="0"?"\u7981\u7528":"\u542F\u7528"})},{label:"\u521B\u5EFA\u65F6\u95F4",minWidth:180,prop:"createTime",formatter:({createTime:e})=>R(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",minWidth:140,slot:"operation"}],E={title:"\u6309\u94AE\u8BBE\u7F6E",columns:G,notReuqiredInit:!0,apis:{httpList:Y,httpDelete:z,httpAdd:O,httpStatus:H,httpUpdate:V},powers:[]},g=[{code:"001",name:"\u5217\u8868"},{code:"002",name:"\u6DFB\u52A0"},{code:"003",name:"\u542F\u7528"},{code:"004",name:"\u7981\u7528"},{code:"005",name:"\u4FEE\u6539"},{code:"006",name:"\u5220\u9664"},{code:"007",name:"\u8BE6\u60C5"},{code:"008",name:"\u63D0\u4EA4"},{code:"009",name:"\u590D\u5236"},{code:"010",name:"\u4E0A\u67B6"},{code:"011",name:"\u4E0B\u67B6"},{code:"012",name:"\u91CD\u7F6E\u5BC6\u7801"},{code:"013",name:"\u8BBE\u4E3A\u7BA1\u7406\u5458"},{code:"014",name:"\u53D6\u6D88\u7BA1\u7406\u5458"},{code:"015",name:"\u6A21\u677F\u4E0B\u8F7D"},{code:"016",name:"\u6570\u636E\u5BFC\u5165"},{code:"017",name:"\u9875\u9762\u5BFC\u51FA"},{code:"018",name:"\u63A5\u53E3\u5B9E\u65F6\u5BFC\u51FA"},{code:"019",name:"\u63A5\u53E3\u9884\u7EA6\u5BFC\u51FA"},{code:"999",name:"\u6279\u91CF\u8BBE\u7F6E\u91C7\u8D2D\u5355\u65E0\u9700\u5BF9\u8D26\u72B6\u6001"}];function X(){return g.map(e=>({label:e.name,value:e.code}))}const j={title:"\u53D1\u7968",colLayout:{span:24},itemStyle:{},formItems:[{field:"action_code",type:"select",label:"\u6309\u94AE\u540D\u79F0",labelWidth:"120px",placeholder:"\u6309\u94AE\u540D\u79F0",options:X(),rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6309\u94AE\u6807\u8BC6"}]},{field:"status",type:"radio",labelWidth:"120px",label:"\u6309\u94AE\u72B6\u6001",options:[{label:"\u542F\u7528",value:"1"},{label:"\u7981\u7528",value:"0"}],rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6309\u94AE\u72B6\u6001"}]}]};var h=(e=>(e.MENU="1",e.PAGE="2",e))(h||{});const K={class:"main"},J={class:"flex"},le=q({__name:"index",setup(e){const a=m(""),l=m(null),d=m([]),{pageModalRef:C,handleCreateData:F,handlePreviewData:A,handleUpdateData:_,handleConfrim:D,defaultInfo:v}=T({pageContentRef:l,confirmCallback:({action_code:t})=>{var o;return{menuid:u(a),action_name:(o=g.find(n=>n.code===t))==null?void 0:o.name}}});function b(t){const{menu_type:o,id:n}=t;o===h.PAGE&&(a.value=n,l.value.getPageData({id:n}))}function k(t){a.value=t,l.value.getPageData({id:t})}return w(()=>{d.value=p().getMenuActions("setBtn"),E.powers=p().getMenuActions("setBtn")}),(t,o)=>{const n=x("NoAuth");return S(),W("div",K,[f(I("div",J,[r(L,{onTreeSelectChange:b,onInitTableData:k}),r(u(N),{ref_key:"pageContentRef",ref:l,"content-config":u(E),onCreateBtnClick:u(F),onPreviewBtnClick:u(A),onUpdateBtnClick:u(_)},null,8,["content-config","onCreateBtnClick","onPreviewBtnClick","onUpdateBtnClick"]),r(u($),{ref_key:"pageModalRef",ref:C,"modal-config":u(j),"default-info":u(v),onConfirmBtnClick:u(D)},null,8,["modal-config","default-info","onConfirmBtnClick"])],512),[[B,d.value.some(c=>c=="001")]]),f(r(n,null,null,512),[[B,!d.value.some(c=>c=="001")]])])}}});export{le as default};
