import P from"./menu-tree.4d2e94a6.js";import{u as b,_ as k}from"./use-page-modal.046367d9.js";import{P as y}from"./page-content.6b548a2d.js";import{aL as i,aM as w,ah as R,bf as M,aN as q,q as S,B as r,C as x,aD as p,r as W,o as I,K as T,H as $,t as c,v as u}from"./index.10c3f8e5.js";import"./index.afc916e5.js";import"./index.1c15f518.js";import"./responseHandle.3a46a31b.js";import"./hooks.5f77ce90.js";import"./use-response-handle.23bba72b.js";const{VITE_PROXY_DOMAIN_REAL:ne,VITE_PROXY_USER_REAL:L}=w(),s=L+"/admin/",U=e=>i.request("post",`${s}menuaction`,{data:e}),Y=e=>i.request("post",`${s}menuactionadd`,{data:e}),H=e=>i.request("post",`${s}menuactionsave`,{data:e}),N=e=>i.request("post",`${s}menuactionstatus`,{data:e}),O=e=>i.request("post",`${s}menuactiondel`,{data:e}),V=[{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})=>R(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})=>q(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",minWidth:140,slot:"operation"}],f={title:"\u6309\u94AE\u8BBE\u7F6E",columns:V,notReuqiredInit:!0,apis:{httpList:U,httpDelete:O,httpAdd:Y,httpStatus:N,httpUpdate:H},powers:[]},E=[{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 z(){return E.map(e=>({label:e.name,value:e.code}))}const G={title:"\u6309\u94AE",colLayout:{span:24},itemStyle:{},formItems:[{field:"action_code",type:"select",label:"\u6309\u94AE\u540D\u79F0",labelWidth:"120px",placeholder:"\u6309\u94AE\u540D\u79F0",options:z(),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 B=(e=>(e.MENU="1",e.PAGE="2",e))(B||{});const ae=S({__name:"index",setup(e){const a=r(""),l=r(null),d=r([]),{pageModalRef:g,handleCreateData:C,handlePreviewData:F,handleUpdateData:h,handleConfrim:A,defaultInfo:_}=b({pageContentRef:l,confirmCallback:({action_code:t})=>{var o;return{menuid:u(a),action_name:(o=E.find(n=>n.code===t))==null?void 0:o.name}}});function D(t){const{menu_type:o,id:n}=t;o===B.PAGE&&(a.value=n,l.value.getPageData({id:n}))}function v(t){a.value=t,l.value.getPageData({id:t})}return x(()=>{d.value=p().getMenuActions("setBtn"),f.powers=p().getMenuActions("setBtn")}),(t,o)=>{const n=W("PagePower");return I(),T(n,{isShow:d.value.some(m=>m=="001")},{default:$(()=>[c(P,{onTreeSelectChange:D,onInitTableData:v}),c(u(y),{ref_key:"pageContentRef",ref:l,"content-config":u(f),onCreateBtnClick:u(C),onPreviewBtnClick:u(F),onUpdateBtnClick:u(h)},null,8,["content-config","onCreateBtnClick","onPreviewBtnClick","onUpdateBtnClick"]),c(u(k),{ref_key:"pageModalRef",ref:g,"modal-config":u(G),"default-info":u(_),onConfirmBtnClick:u(A)},null,8,["modal-config","default-info","onConfirmBtnClick"])]),_:1},8,["isShow"])}}});export{ae as default};
