import{u as $}from"./useTable-7f617eef-1779868775780v=1.0.0.js";import{u as O}from"./useHandleData-2561a95c-1779868775780v=1.0.0.js";import{a as Q,b as j,u as G,d as J}from"./department-b547eda3-1779868775780v=1.0.0.js";import K from"./organizeDepartmentForm-c98caf17-1779868775780v=1.0.0.js";import{u as W}from"./useFormEdit-42a9503c-1779868775780v=1.0.0.js";import{b as X}from"./index-0f3e2c06-1779868775780v=1.0.0.js";import{E as y}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{l as D,a as m,d as Y,ah as i,m as C,M as h,O as u,U as n,S as v,u as o,B as I,Q as Z,q as U,ay as ee,az as ae}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as te}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./addOrganize-08c738d9-1779868775780v=1.0.0.js";import"./eleValidate-dfbd5aa5-1779868775780v=1.0.0.js";import"./account-ec8d0b54-1779868775780v=1.0.0.js";import"./tabs-e9b8af2b-1779868775780v=1.0.0.js";const ne=g=>(ee("data-v-a1890313"),g=g(),ae(),g),oe=ne(()=>U("div",{class:"divider"},"\u90E8\u95E8\u4FE1\u606F",-1)),le={class:"flex mt16"},ue=D({name:"organizeEditDpart"}),re=D({...ue,setup(g){const{closeCurrent:F}=W(),{getTableList:f,pageable:p,baseParam:z,handleSizeChange:x,handleCurrentChange:k,renderEmpty:B,tableData:S}=$(Q),b=m(""),_=X(),d=m(!1),E=m("\u65B0\u589E\u90E8\u95E8"),c=m(!1),e=m({name:"",pid:"",pidName:"",accountId:"",organUnitId:"",contact:""}),N=()=>{d.value=!1},P=async a=>{c.value=!0;try{let t=j,s="\u65B0\u589E\u6210\u529F";a.organUnitId=b.value,a.departmentId?(t=G,s="\u7F16\u8F91\u6210\u529F"):delete a.departmentId;let r=await t(a);r.code!=0?y.warning(r.msg):(y.success(s),f()),d.value=!1}catch{}c.value=!1},V=()=>{E.value="\u65B0\u589E\u90E8\u95E8",e.value.name="",e.value.pid="",e.value.accountId="",e.value.organUnitId="",e.value.contact="",e.value.departmentId="",d.value=!0},q=a=>{E.value="\u7F16\u8F91\u90E8\u95E8",e.value.name=a.name,e.value.pid=a.pid?a.pid:"",e.value.accountId=Number(a.accountId)?Number(a.accountId):"",e.value.organUnitId=a.organUnitId,e.value.contact=a.contact,e.value.departmentId=a.departmentId,d.value=!0},w=async a=>{let t="\u5220\u9664\u5F53\u524D\u90E8\u95E8";await O(J,{ids:[a.departmentId]},t),f()},A=()=>{F()};return Y(()=>{_.query.organUnitId&&(b.value=_.query.organUnitId,e.value.organUnitId=_.query.organUnitId,z.value.organUnitId=_.query.organUnitId,f())}),(a,t)=>{const s=i("el-button"),r=i("el-table-column"),T=i("el-table"),M=i("el-pagination"),H=i("el-dialog"),L=i("PaIndexPage");return C(),h(L,null,{tableHeader:u(()=>[oe]),toolButton:u(()=>[n(s,{type:"primary",onClick:V},{default:u(()=>[v("\u65B0\u589E ")]),_:1})]),dialog:u(()=>[n(H,{modelValue:o(d),"onUpdate:modelValue":t[4]||(t[4]=l=>I(d)?d.value=l:null),title:o(E),"destroy-on-close":!0,width:"650px",top:"10vh"},{default:u(()=>[n(K,{value:o(e),"onUpdate:value":t[2]||(t[2]=l=>I(e)?e.value=l:null),loading:o(c),"onUpdate:loading":t[3]||(t[3]=l=>I(c)?c.value=l:null),onCancel:N,onSubmit:P},null,8,["value","loading"])]),_:1},8,["modelValue","title"])]),default:u(()=>[n(T,{data:o(S),border:"",style:{width:"100%"},"row-key":"departmentId","default-expand-all":"","tree-props":{children:"children"}},{empty:u(()=>[(C(),h(Z(o(B))))]),default:u(()=>[n(r,{type:"index",align:"center",width:"90"}),n(r,{label:"\u90E8\u95E8ID",align:"center",prop:"departmentId"}),n(r,{label:"\u90E8\u95E8\u540D\u79F0",align:"center",prop:"name"}),n(r,{label:"\u90E8\u95E8\u7BA1\u7406",align:"center",prop:"accountName"}),n(r,{label:"\u624B\u673A\u53F7",align:"center",prop:"contact"}),n(r,{label:"\u4E0A\u7EA7\u90E8\u95E8",align:"center",prop:"parentName"}),n(r,{label:"\u64CD\u4F5C",align:"center",width:"180",fixed:"right"},{default:u(l=>[n(s,{link:"",type:"primary",size:"small",onClick:R=>q(l.row)},{default:u(()=>[v(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),n(s,{link:"",type:"primary",size:"small",onClick:R=>w(l.row)},{default:u(()=>[v(" \u5220\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),U("div",le,[n(s,{onClick:A},{default:u(()=>[v("\u8FD4\u56DE")]),_:1}),n(M,{"current-page":o(p).page,"onUpdate:currentPage":t[0]||(t[0]=l=>o(p).page=l),"page-size":o(p).size,"onUpdate:pageSize":t[1]||(t[1]=l=>o(p).size=l),"page-sizes":[10,20,50,100],background:"",layout:"total, sizes, prev, pager, next",total:o(p).count,onSizeChange:o(x),onCurrentChange:o(k)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])])]),_:1})}}});const ye=te(re,[["__scopeId","data-v-a1890313"]]);export{ye as default};
