import{_ as e}from"./uni-icons.B3nCnuXe.js";import{r as a,b as s,a2 as l,c as t,T as n,f as o,g as u,o as c,h as i,w as p,i as r,a as d,k as f,F as m,l as _,j as h,t as k,N as v,y,z as b,a1 as g,S as C,x as P}from"./index-WeUkftbp.js";import{_ as j,a as x}from"./uni-row.DLutFlIQ.js";import{_ as w}from"./uni-nav-bar.cBITQXNK.js";import{_ as O}from"./uni-popup.CI1Fmu1z.js";import{a as z}from"./index.d2K7R4mP.js";import{_ as N}from"./_plugin-vue_export-helper.BCo6x5W8.js";const B=N({__name:"chenkPersonnel",props:{checkPer:{type:Object,default:()=>({})},isChecked:{type:Number,default:0},showPerson:{type:Boolean,default:!0}},setup(e,{expose:P}){const N=a(null),B=s(),I=e,{checkPer:S,isChecked:R,showPerson:T}=l(I),D=t((()=>B.state.app.depCheckIds)),$=a([]),E=a([]),F=e=>{$.value.splice(e,1)},J=()=>{let e=[];$.value.length>0&&$.value.forEach((a=>{e.push(a.id)})),B.commit("setDepSelectIds",e),N.value.close()};n((()=>S),((e,a)=>{const s=Object.assign([],e.value);$.value=s}),{deep:!0,immediate:!0}),n(D,((e,a)=>{E.value=e}),{immediate:!0});return P({popupOpen:()=>{N.value.open()}}),(e,a)=>{const s=o(u("uni-nav-bar"),w),l=y,t=b,n=o(u("uni-col"),j),P=g,I=o(u("uni-row"),x),D=C,L=o(u("uni-popup"),O);return c(),i(t,null,{default:p((()=>[r(L,{ref_key:"popupRef",ref:N,type:"bottom","mask-click":!1},{default:p((()=>[r(t,{class:"check-per"},{default:p((()=>[r(s,{border:!1,title:`已选择${$.value.length}${d(T)?"人":"部门"}`,leftText:"取消",rightText:"确认",onClickLeft:a[0]||(a[0]=e=>($.value=S.value,void J())),onClickRight:a[1]||(a[1]=e=>(B.commit("setDepSelectPeople",$.value),void J()))},null,8,["title"]),r(t,{class:"pl10"},{default:p((()=>[r(D,{class:"scroll-per","scroll-y":"","scroll-top":0},{default:p((()=>[(c(!0),f(m,null,_($.value,((e,a)=>(c(),i(t,{class:"uni-indexed-list__item-content",key:e.id},{default:p((()=>[r(I,{class:"display-align"},{default:p((()=>[r(n,{span:18,class:"display-align"},{default:p((()=>[r(z,{src:e.avatar,radius:8,"auto-size":!1,width:80,height:80},null,8,["src"]),r(t,{class:"item-content-info"},{default:p((()=>[r(l,{class:"text"},{default:p((()=>[h(k(e.name),1)])),_:2},1024),e.card?(c(),i(l,{key:0,class:"caption"},{default:p((()=>[h(k(e.job?e.job.name:"--"),1)])),_:2},1024)):v("",!0)])),_:2},1024)])),_:2},1024),r(n,{span:6,class:"text-right pr10"},{default:p((()=>[1===d(R)?(c(),f(m,{key:0},[E.value.includes(Number(e.id))?v("",!0):(c(),i(P,{key:0,class:"item-button",size:"mini",onClick:e=>F(a)},{default:p((()=>[h("移除")])),_:2},1032,["onClick"]))],64)):(c(),i(P,{key:1,class:"item-button",size:"mini",onClick:e=>F(a)},{default:p((()=>[h("移除")])),_:2},1032,["onClick"]))])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1})])),_:1},512)])),_:1})}}},[["__scopeId","data-v-8efb7fdc"]]),I=N({__name:"selectBottomBar",props:{isChecked:{type:Number,default:0},showPerson:{type:Boolean,default:!0}},emits:["handleOk"],setup(v,{emit:C}){const w=v,{isChecked:O,showPerson:z}=l(w),N=a(null),I=a([]),S=s();let R=C;const T=t((()=>S.state.app.depSelectPeople)),D=()=>{N.value.popupOpen()},$=()=>{T.value.length>0?R("handleOk"):P.error("至少选择一个"+(z?"人":"部门"))};return n(T,((e,a)=>{I.value=e}),{immediate:!0,deep:!0}),(a,s)=>{const l=o(u("uni-icons"),e),t=b,n=y,v=o(u("uni-col"),j),C=g,P=o(u("uni-row"),x);return c(),i(t,{class:""},{default:p((()=>[r(t,{class:"select-content"},{default:p((()=>[r(t,{class:"plr10"},{default:p((()=>[r(P,null,{default:p((()=>[r(v,{span:18},{default:p((()=>[r(t,{class:"select-content-left"},{default:p((()=>[r(t,{class:"top",onClick:D},{default:p((()=>[h(" 已选择 "+k(I.value.length)+" "+k(d(z)?"人":"部门")+" ",1),r(l,{type:"top"})])),_:1}),r(t,{class:"bottom line1"},{default:p((()=>[(c(!0),f(m,null,_(I.value,((e,a)=>(c(),i(n,{key:e.id},{default:p((()=>[h(k(e.name)+k(I.value.length-1===a?"":"、"),1)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1}),r(v,{span:6,class:"select-content-right text-center"},{default:p((()=>[r(C,{type:"primary",size:"mini",onClick:$},{default:p((()=>[h("确定")])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(B,{ref_key:"chenkPersonnelRef",ref:N,"show-person":d(z),"is-checked":d(O),checkPer:I.value},null,8,["show-person","is-checked","checkPer"])])),_:1})}}},[["__scopeId","data-v-9b9e951a"]]);export{I as s};
