import{u as e,r as a,c as t,bQ as s,d as r,e as i,f as o,h as n,w as l,j as d,k as p,n as c,g as m,aO as f,E as u,q as h,p as g}from"./index.286e9b79.js";import{v as b}from"./loading.c49775a6.js";import{E as v,a as j}from"./table-column.7b4f59a2.js";import"./checkbox.f06171a4.js";/* empty css            */import{_ as x}from"./tips.1f55fd6b.js";import{E as y}from"./message-box.6a8eb828.js";import"./input.31de1b37.js";import"./overlay.2c1583ac.js";import{g as _}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"./alert.e75c383f.js";import"./validator.18338d56.js";import"./index.ed3ed02e.js";import"./scroll.a50153b5.js";const k={class:"table-wrap"},w={class:"table-box"},C={class:"toolbar"},z={class:"tabs-content"},E=n("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),q=n("div",{class:"page"},null,-1),B={__name:"index",setup(B){const O=e(),T=a([]);let I=a(!1);const Q=()=>{I.value=!0,_("shop.region/index").then((e=>{I.value=!1,e.code?T.value=e.data:u.error(e.msg)})).catch((e=>{I.value=!1,u.error(e)}))};Q();const W=()=>{O.push("/shop/region/editor")},A=(e,a,t)=>{_("shop.region/index",{id:e.id}).then((e=>{e.code&&t(e.data)}))};return(e,a)=>{const B=x,D=h,F=t("Warning"),G=g,H=v,J=j,K=s("auth"),L=b;return r(),i("div",null,[o(B,{type:"warning",description:"温馨提示：在删除地区时,如果该地区下包含子地区将一同删除"}),n("div",k,[n("div",w,[n("div",C,[l((r(),d(D,{onClick:W},{default:p((()=>[c("添加")])),_:1})),[[K,["shop.region/editor"]]])]),n("div",z,[l((r(),d(J,{data:m(T),size:"large",style:{width:"100%"},"row-key":"id",lazy:"",load:A,"tree-props":{children:"children",hasChildren:"hasChildren"}},{empty:p((()=>[o(G,{size:"18",style:{position:"relative",top:"4px"}},{default:p((()=>[o(F)])),_:1}),E])),default:p((()=>[o(H,{prop:"name",label:"分类名称","header-align":"left",align:"left"}),o(H,{label:"操作","header-align":"center",align:"center",width:"110"},{default:p((e=>[l((r(),d(D,{type:"primary",size:"small",onClick:f((a=>{return t=e.row.id,void O.push({path:"/shop/region/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:p((()=>[c("编辑")])),_:2},1032,["onClick"])),[[K,["shop.region/editor"]]]),l((r(),d(D,{type:"danger",size:"small",onClick:f((a=>{return t=e.row.id,void y.confirm("您确定要删除该地区吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{_("shop.region/delete",{id:t}).then((e=>{e.code?(u.success("删除成功"),T.value=[],Q()):u.error(e.msg)}))}));var t}),["prevent"]),link:""},{default:p((()=>[c("删除")])),_:2},1032,["onClick"])),[[K,["shop.region/delete"]]])])),_:1})])),_:1},8,["data"])),[[L,m(I)]])]),q])])])}}};export{B as default};
