import{aT as U,a0 as W,ax as Q,W as X,M as P}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.1703796278973300.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 Y}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897324.js";import"./index.170379627897325.js";import"./index.170379627897326.js";import"./index.170379627897327.js";import"./index.170379627897328.js";import"./Item.1703796278973.js";import{a as Z}from"./comm.1703796278973.js";import{q as ee,d as te}from"./region.1703796278973.js";import{_ as oe}from"./index.vue_vue_type_script_setup_true_name_modifyModal_lang.17037962789733.js";import{d as B,k as e,p as ne,v as ae,V as x,a3 as se,r as C,o as _,c as L,a as n,b as a,u as t,M as le,t as ie,x as S,F as A,h as re,B as ce,z as f,G as pe,H as de}from"./vue.1703796278973.js";import{_ as me}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"./permission.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const O=r=>(pe("data-v-e0991c80"),r=r(),de(),r),ue={class:"delete_content"},_e=["src"],fe=O(()=>f("p",{class:"delete_content title"},"确认删除这条信息吗?",-1)),ye=O(()=>f("p",{class:"delete_content desc"},"删除后无法恢复,确定要删除吗?",-1)),he=B({name:"Category"}),ve=B({...he,setup(r){const c=e([]),y=e({}),p=e();e([]);const h=e({}),d=e(""),m=e(0),I=e(0),V=e(!1);let b=e(),j=e(0);e([]);const v=e(!1),g=e(!1),q=e("object"),E=e([{title:"",dataIndex:"name",search:{type:"string",componentProps:{placeholder:"请输入关键字"},defaultValue:"123123"}}]);ne(()=>{});const F=o=>{console.log(o),g.value=!0,setTimeout(()=>{g.value=!1,v.value=!1},1e3)},M=o=>{console.log(o),v.value=!1},J=o=>{let i=[];for(let l in o)i.push(l+"="+o[l]);b.value={where:i.join(" and ")},c.value=[]},K=(o,i)=>{if(!o)return[];const l=[{key:"update",text:"编辑",tooltip:{title:"编辑"},icon:"EditOutlined",onClick:async()=>{d.value="编辑区域",m.value=2,h.value=o,x(()=>{p.value.show(o)})}},{key:"add",text:"添加子分类",tooltip:{title:"添加子分类"},icon:"PlusCircleOutlined",onClick:()=>{d.value="新增子区域",m.value=0,h.value={parentId:o.parentId},x(()=>{p.value.show(o)})}},{key:"delete",text:"删除",tooltip:{title:"删除"},icon:"DeleteOutlined",popConfirm:{title:"确认删除?",okText:" 确定",cancelText:"取消",onConfirm:async()=>{(await te(o.id)).status===200?(P.success("操作成功!"),y.value.reload()):P.error("操作失败!")}}}];return j.value=l.length,l},R=ae({columns:[{title:"名称",dataIndex:"name",key:"name"},{title:"序号",dataIndex:"sortIndex",key:"sortIndex"},{title:"单位数量",dataIndex:"countInstitution",key:"countInstitution"},{title:"操作",key:"action",fixed:"right",ellipsis:!0,scopedSlots:!0}],add:async()=>{d.value="新增区域",m.value=0,I.value=3,x(()=>{p.value.show({})})},refresh:()=>{y.value.reload()}}),{add:N,columns:ge,refresh:D}=se(R);return(o,i)=>{const l=U,k=C("AIcon"),T=Y,w=W,$=Q,z=C("FullPage"),G=X,H=C("page-container");return _(),L(H,null,{default:n(()=>[a(l,{columns:t(E),onSearch:J,type:t(q)},null,8,["columns","type"]),a(z,null,{default:n(()=>[a($,{ref_key:"tableRef",ref:y,columns:t(R).columns,request:t(ee),model:"TABLE",type:"TREE",expandedRowKeys:t(c),"onUpdate:expandedRowKeys":i[0]||(i[0]=u=>le(c)?c.value=u:null),scroll:{y:550},defaultParams:{paging:!1,sorts:[{name:"sortIndex",order:"asc"},{name:"createTime",order:"desc"}]},params:t(b),loading:t(V)},{headerTitle:n(()=>[a(w,null,{default:n(()=>[a(T,{type:"primary",onClick:t(N),hasPermission:"device/Category:add"},{icon:n(()=>[a(k,{type:"PlusOutlined"})]),default:n(()=>[ie(" 新增区域 ")]),_:1},8,["onClick"])]),_:1})]),action:n(u=>[a(w,null,{default:n(()=>[(_(!0),S(A,null,re(K(u,"table"),(s,ke)=>(_(),S(A,{key:s.key},[s.key!="add"||u.level!=3?(_(),L(T,{key:0,disabled:s.disabled,popConfirm:s.popConfirm,hasPermission:"device/Category:"+s.key,tooltip:{...s.tooltip},onClick:s.onClick,type:"link",style:{padding:"0px"},danger:s.key==="delete"},{icon:n(()=>[a(k,{type:s.icon},null,8,["type"])]),_:2},1032,["disabled","popConfirm","hasPermission","tooltip","onClick","danger"])):ce("",!0)],64))),128))]),_:2},1024)]),_:1},8,["columns","request","expandedRowKeys","params","loading"])]),_:1}),a(oe,{ref_key:"modifyRef",ref:p,formData:t(h),title:t(d),isAdd:t(m),isChild:t(I),onRefresh:t(D)},null,8,["formData","title","isAdd","isChild","onRefresh"]),a(G,{visible:t(v),title:"确认删除",onOk:F,onCancel:M,confirmLoading:t(g)},{default:n(()=>[f("p",ue,[f("img",{src:t(Z)("/question-mark.png"),alt:""},null,8,_e)]),fe,ye]),_:1},8,["visible","confirmLoading"])]),_:1})}}});const _t=me(ve,[["__scopeId","data-v-e0991c80"]]);export{_t as default};