import{d as $,r as n,a as q,a1 as G,b as J,e as c,al as O,o as p,f as d,w as l,i as f,g as r,j as Q,h as a,v as W,n as u,l as h,t as X,c as Y,p as Z,am as ee,I as te,F as ae,_ as ne}from"./index-17740f03-1778929502341v=1.0.0.js";import{u as le}from"./useTable-9e9e4bef-1778929502341v=1.0.0.js";import{g as se}from"./systemManage-e620987f-1778929502341v=1.0.0.js";import{g as oe,u as re}from"./unit-70ad741a-1778929502341v=1.0.0.js";const ie={style:{"margin-bottom":"10px",display:"flex","align-items":"center",gap:"10px"}},pe={style:{color:"#409eff"}},ce={key:0},de=$({__name:"unitSelect",props:{selectedItems:{type:Array,default:()=>[]}},emits:["update:selectedItems"],setup(b,{emit:C}){const w=b,S=C,x=n(),m=q({get:()=>w.selectedItems,set:t=>S("update:selectedItems",t)}),z=t=>{m.value=t},k=t=>(t.level_id&&t.level_id.length>0&&(t.level_ids=t.level_id.join(","),delete t.level_id),t),{tableData:I,pageable:o,searchParam:B,baseParam:g,handleSizeChange:D,handleCurrentChange:V,getTableList:N,search:_,reset:P,renderEmpty:A,loading:L,BaseCompanyAreaId:ue}=le(oe,null,null,k);re();const U=n(!0),v=n([{prop:"keyword",label:"",search:{el:"input",placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D\u540D\u79F0/\u8054\u7CFB\u4EBA/\u8054\u7CFB\u65B9\u5F0F",props:{onChange:_}}},{prop:"level_id",label:"",enum:[],fieldNames:{label:"name",value:"value"},search:{el:"select",placeholder:"\u5168\u90E8\u7EA7\u522B",props:{multiple:!0,width:200}}}]);n(null);const E=()=>{P()},R=n([]),T=n([]),y=n(""),j=async()=>{var s;let t=await ae({with_up:0});R.value=t.data;let e=(s=t==null?void 0:t.data[0])==null?void 0:s.company_area_id;T.value=[e],y.value=String(e)},F=async()=>{let e=await se({page:1,size:100,type:3});v.value[1].enum=e.data.list};return n([]),G(()=>{}),J(async()=>{await j(),F(),g.value.status=1,g.value.company_area_id=y.value,N()}),(t,e)=>{const s=c("el-table-column"),H=c("el-table"),K=c("el-pagination"),M=O("loading");return p(),d(te,null,{searchForm:l(()=>[f(r(Q,{"search-param":a(B),columns:a(v),search:a(_),reset:E},null,8,["search-param","columns","search"]),[[W,a(U)]])]),tableHeader:l(()=>[u("div",ie,[e[2]||(e[2]=u("h3",null,"\u5355\u4F4D\u7EC4\u7EC7\u9009\u62E9",-1)),e[3]||(e[3]=h(" \u5F53\u524D\u5DF2\u9009\u4E2D")),u("span",pe,X(a(m).length),1),e[4]||(e[4]=h("\u6761\u6570\u636E")),a(o).size>99?(p(),Y("span",ce,",\u5F53\u9875\u6570\u636E\u91CF\u8F83\u5927\u65F6\uFF0C\u52FE\u9009\u53EF\u80FD\u5B58\u5728\u5361\u987F\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85\u3002")):Z("v-if",!0)])]),toolButton:l(()=>e[5]||(e[5]=[])),pagination:l(()=>[r(K,{"current-page":a(o).page,"onUpdate:currentPage":e[0]||(e[0]=i=>a(o).page=i),"page-size":a(o).size,"onUpdate:pageSize":e[1]||(e[1]=i=>a(o).size=i),"page-sizes":[10,20,50,100,200,300,500],background:"",layout:"total, sizes, prev, pager, next",total:a(o).count,onSizeChange:a(D),onCurrentChange:a(V)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])]),dialog:l(()=>e[6]||(e[6]=[])),default:l(()=>[f((p(),d(H,{ref_key:"tableRef",ref:x,data:a(I),size:"small",border:"",onSelectionChange:z,"row-key":i=>i.organ_unit_id},{empty:l(()=>[(p(),d(ee(a(A))))]),default:l(()=>[r(s,{type:"selection",width:"55",align:"center","reserve-selection":!0}),r(s,{label:"\u5E8F\u53F7",type:"index",align:"center"}),r(s,{label:"\u5355\u4F4D\u7EC4\u7EC7\u540D\u79F0",prop:"name",align:"center"}),r(s,{label:"\u7EA7\u522B",prop:"level_id_str",align:"center"})]),_:1},8,["data","row-key"])),[[M,a(L)]])]),_:1})}}});const ye=ne(de,[["__scopeId","data-v-d5d6bb16"]]);export{ye as default};
