import{r as n,D as J,d as Q,a as W,b as X,e as d,al as Y,o as v,f as b,w as l,i as B,g as r,h as t,v as Z,n as C,l as D,t as $,c as ee,p as I,am as ae,F as te}from"./index-17740f03-1778929502341v=1.0.0.js";import{u as ne}from"./useTable-9e9e4bef-1778929502341v=1.0.0.js";import{g as le}from"./systemManage-e620987f-1778929502341v=1.0.0.js";const oe=u=>{const i=n(!1),p=n("\u65B0\u589E\u673A\u6784"),m=n(""),h=f=>{p.value="\u65B0\u589E\u673A\u6784",o.value={cities:"",level_id:"",name:"",social_credit_code:"",contact_name:"",contact_way:"",address:"",company_area_id:f,img:"",imagesList:[],status:1},m.value="",i.value=!0,o.value},o=n({cities:"",level_id:"",name:"",social_credit_code:"",contact_name:"",contact_way:"",address:"",company_area_id:"",img:"",imagesList:[],status:1}),y=n(!1);return{dialogVisible:i,dialogTitle:p,handleAdd:h,baseform:o,baseformLoading:y,baseformCancel:()=>{i.value=!1},currenEditId:m}},se=u=>J.post("/organUnit/organUnit/listOrgan",u,{headers:{noLoading:!0}}),re={style:{"margin-bottom":"10px",display:"flex","align-items":"center",gap:"10px"}},ie={style:{color:"#409eff"}},ce={key:0},ge=Q({__name:"organSelect",props:{selectedItems:{type:Array,default:()=>[]}},emits:["update:selectedItems"],setup(u,{emit:i}){const p=u,m=i,h=n(),o=W({get:()=>p.selectedItems,set:e=>m("update:selectedItems",e)}),y=e=>{o.value=e},x=e=>(e.level_id&&e.level_id.length>0&&(e.level_ids=e.level_id.join(","),delete e.level_id),e),{tableData:f,pageable:s,searchParam:P,baseParam:w,handleSizeChange:A,handleCurrentChange:L,getTableList:E,search:z,reset:V,renderEmpty:N,loading:F,BaseCompanyAreaId:de}=ne(se,null,null,x);oe();const T=n(!0),S=n([{prop:"keyword",label:"",search:{el:"input",placeholder:"\u8BF7\u8F93\u5165\u673A\u6784\u540D\u79F0/\u8054\u7CFB\u4EBA/\u8054\u7CFB\u65B9\u5F0F",props:{onChange:z}}},{prop:"level_id",label:"",enum:[],fieldNames:{label:"name",value:"value"},search:{el:"select",placeholder:"\u5168\u90E8\u7EA7\u522B",props:{multiple:!0}}}]);n(null);const U=()=>{V()},O=n([]),R=n([]),k=n(""),j=async()=>{var g;let e=await te({with_up:0});O.value=e.data;let a=(g=e==null?void 0:e.data[0])==null?void 0:g.company_area_id;R.value=[a],k.value=String(a)},H=async()=>{let a=await le({page:1,size:100,type:3});S.value[1].enum=a.data.list};return X(async()=>{await j(),H(),w.value.status=1,w.value.company_area_id=k.value,E()}),(e,a)=>{const g=d("PaSearchForm"),_=d("el-table-column"),K=d("el-table"),M=d("el-pagination"),q=d("PaIndexPage"),G=Y("loading");return v(),b(q,null,{searchForm:l(()=>[B(r(g,{"search-param":t(P),"search-col":{xs:1,sm:2,md:2,lg:3,xl:3},columns:t(S),search:t(z),reset:U},null,8,["search-param","columns","search"]),[[Z,t(T)]])]),tableHeader:l(()=>[C("div",re,[a[2]||(a[2]=C("h3",{style:{"margin-right":"10px"}},"\u673A\u6784\u7EC4\u7EC7\u9009\u62E9",-1)),a[3]||(a[3]=D(" \u5F53\u524D\u5DF2\u9009\u4E2D")),C("span",ie,$(t(o).length),1),a[4]||(a[4]=D("\u6761\u6570\u636E")),t(s).size>99?(v(),ee("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")):I("v-if",!0)])]),toolButton:l(()=>[I(' <el-button @click="handleAddExtend" type="primary">\u65B0\u589E </el-button> ')]),pagination:l(()=>[r(M,{"current-page":t(s).page,"onUpdate:currentPage":a[0]||(a[0]=c=>t(s).page=c),"page-size":t(s).size,"onUpdate:pageSize":a[1]||(a[1]=c=>t(s).size=c),"page-sizes":[10,20,50,100,200,300,500],background:"",layout:"total, sizes, prev, pager, next",total:t(s).count,onSizeChange:t(A),onCurrentChange:t(L)},null,8,["current-page","page-size","total","onSizeChange","onCurrentChange"])]),dialog:l(()=>a[5]||(a[5]=[])),default:l(()=>[B((v(),b(K,{ref_key:"tableRef",ref:h,data:t(f),size:"small",border:"",onSelectionChange:y,"row-key":c=>c.organ_unit_id},{empty:l(()=>[(v(),b(ae(t(N))))]),default:l(()=>[r(_,{type:"selection",width:"55",align:"center","reserve-selection":!0}),r(_,{label:"\u5E8F\u53F7",type:"index",align:"center"}),r(_,{label:"\u673A\u6784\u7EC4\u7EC7\u540D\u79F0",prop:"name",align:"center"}),r(_,{label:"\u7EA7\u522B",prop:"level_id_str",align:"center"})]),_:1},8,["data","row-key"])),[[G,t(F)]])]),_:1})}}});export{ge as _};
