text: import{_ as e}from"./TableImg.53dad38d.js";import{f as o}from"./BasicForm.2372b7e8.js";import{u as i}from"./useTable.8df61517.js";import{g as n,d as t}from"./company.4e589c78.js";import{_ as a,c as d,s}from"./CompanyModal.2c5ab0e9.js";import{h as r}from"./index.ba319b32.js";import{b as l}from"./index.131f7f29.js";import{j as c,K as m,o as p,m as f,n as u,Q as b,Y as j}from"./vendor.686fd1d4.js";/* empty css              *//* empty css              */import"./useForm.61e11b2d.js";/* empty css              *//* empty css              *//* empty css              */import"./uuid.2b29000c.js";import"./useWindowSizeFn.d82e06bf.js";import"./onMountedOrActivated.172ad1ec.js";/* empty css              */import"./useSortable.5cefd2fe.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              */import"./index.c3ebc3c0.js";/* empty css              *//* empty css              *//* empty css              */import"./download.6c35d74f.js";import"./base64Conver.bb012c73.js";import"./index.ed23997c.js";const{createMessage:h}=r();var x=c({name:"Company",components:{BasicTable:e,TableAction:o,CompanyModal:a},setup(){const[e,{openModal:o,setModalProps:a}]=l(),[r,{reload:c}]=i({title:"列表",api:n,columns:d,formConfig:{labelWidth:120,schemas:s,showAdvancedButton:!1,showResetButton:!1,autoSubmitOnEnter:!0},expandRowByClick:!0,canColDrag:!0,pagination:!1,useSearchForm:!0,bordered:!0,showIndexColumn:!1,actionColumn:{width:120,title:"操作",dataIndex:"action",slots:{customRender:"action"},fixed:!1}});return{registerTable:r,registerModal:e,handleCreate:function(){a({title:"新增公司"}),o(!0,{isUpdate:!1})},handleEdit:function(e,i){i.stopPropagation(),a({title:"修改公司"}),o(!0,{record:e,isUpdate:!0})},handleCreateChild:function(e,i){i.stopPropagation(),a({title:"新增【"+e.cname+"】的子公司"}),e={pid:e.id},o(!0,{record:e,isUpdate:!0})},handleDelete:function(e){e.children&&e.children.length>0?h.warning("有子节点，不能删除！"):t([e.id]).then((e=>{c()}))},handleSuccess:function(){c()},doSearch:function(){c()}}}});const C=j(" 新增 ");x.render=function(e,o,i,n,t,a){const d=m("a-button"),s=m("TableAction"),r=m("BasicTable"),l=m("CompanyModal");return p(),f("div",null,[u(r,{onRegister:e.registerTable},{toolbar:b((()=>[u(d,{type:"primary",onClick:e.handleCreate},{default:b((()=>[C])),_:1},8,["onClick"])])),action:b((({record:o})=>[u(s,{actions:[{title:"添加子公司",icon:"ant-design:plus-outlined",onClick:e.handleCreateChild.bind(null,o)},{title:"修改",icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,o)},{title:"删除",icon:"ant-design:delete-outlined",color:"error",onClick:e=>{e.stopPropagation()},popConfirm:{title:"是否确认删除",confirm:e.handleDelete.bind(null,o)}}]},null,8,["actions"])])),_:1},8,["onRegister"]),u(l,{onRegister:e.registerModal,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])};export default x;
  