import{u as e,r as a,c as t,bQ as s,d as o,e as d,h as i,w as r,j as l,k as n,n as p,g as c,f as u,aO as m,E as g,q as f,p as v}from"./index.286e9b79.js";import{v as h}from"./loading.c49775a6.js";import{E as b,a as j}from"./table-column.7b4f59a2.js";import"./checkbox.f06171a4.js";import{E as x}from"./switch.197584d0.js";/* empty css            */import{E as y}from"./message-box.6a8eb828.js";import"./input.31de1b37.js";import"./overlay.2c1583ac.js";import{g as w}from"./http.f588794f.js";import"./_baseIteratee.9ead53a1.js";import"./_initCloneObject.fb8fbaea.js";import"./isEqual.57d72c4a.js";import"./debounce.caafe00b.js";import"./event.776e7e11.js";import"./validator.18338d56.js";import"./index.ed3ed02e.js";import"./scroll.a50153b5.js";const _={class:"table-wrap"},k={class:"table-box"},C={class:"toolbar"},z={class:"tabs-content"},E=i("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),q=i("div",{class:"page"},null,-1),B={__name:"index",setup(B){const O=e(),T=a([]);let I=a(!1);const Q=()=>{I.value=!0,w("addons.page/index").then((e=>{I.value=!1,e.code?T.value=e.data:g.error(e.msg)})).catch((e=>{I.value=!1,g.error(e)}))};Q();const W=()=>{O.push("/addons/page/editor")},A=(e,a,t)=>{w("addons.page/index",{id:e.id}).then((e=>{e.code&&t(e.data)}))};return(e,a)=>{const B=f,D=t("Warning"),F=v,G=b,H=x,J=j,K=s("auth"),L=h;return o(),d("div",null,[i("div",_,[i("div",k,[i("div",C,[r((o(),l(B,{onClick:W},{default:n((()=>[p("添加")])),_:1})),[[K,["addons.page/editor"]]])]),i("div",z,[r((o(),l(J,{data:c(T),size:"large",style:{width:"100%"},"row-key":"id",lazy:"",load:A,"tree-props":{children:"children",hasChildren:"hasChildren"}},{empty:n((()=>[u(F,{size:"18",style:{position:"relative",top:"4px"}},{default:n((()=>[u(D)])),_:1}),E])),default:n((()=>[u(G,{prop:"title",label:"名称","header-align":"left",align:"left"}),r((o(),l(G,{label:"状态","header-align":"center",align:"center",width:"80"},{default:n((e=>[u(H,{"model-value":e.row.status,onChange:a=>((e,a)=>{let t=0==e[a]?1:0;w("addons.page/status",{id:e.id,type:a,value:t}).then((s=>{s.code&&(e[a]=t)}))})(e.row,"status"),"active-value":1,"inactive-value":0},null,8,["model-value","onChange"])])),_:1})),[[K,["addons.page/status"]]]),u(G,{label:"操作","header-align":"center",align:"center",width:"110"},{default:n((e=>[r((o(),l(B,{type:"primary",size:"small",onClick:m((a=>{return t=e.row.id,void O.push({path:"/addons/page/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:n((()=>[p("编辑")])),_:2},1032,["onClick"])),[[K,["addons.page/editor"]]]),r((o(),l(B,{type:"danger",size:"small",onClick:m((a=>{return t=e.row.id,void y.confirm("您确定要删除该分类吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{w("addons.page/delete",{id:t}).then((e=>{e.code?(g.success("删除成功"),T.value=[],Q()):g.error(e.msg)}))}));var t}),["prevent"]),link:""},{default:n((()=>[p("删除")])),_:2},1032,["onClick"])),[[K,["addons.page/delete"]]])])),_:1})])),_:1},8,["data"])),[[L,c(I)]])]),q])])])}}};export{B as default};
