import{r as e,b as s,e as t,c as o,a9 as a,aX as i,n as r,h as n,w as l,z as d,o as c,i as u,a as p,W as _,N as m,aY as h,aG as f,aF as b,aZ as y,_ as v}from"./index-WeUkftbp.js";import{e as k}from"./index.D8Jasx-l.js";import{d as w}from"./index.BcUDVLb2.js";import{l as x}from"./list.Cp79hEEu.js";import{s as g}from"./selectBottomBar.CwYX7wKh.js";import{_ as j}from"./_plugin-vue_export-helper.BCo6x5W8.js";/* empty css                                                              */import"./uni-nav-bar.cBITQXNK.js";import"./uni-icons.B3nCnuXe.js";/* empty css                                                                  *//* empty css                                                                    *//* empty css                                                              */import"./uni-row.DLutFlIQ.js";import"./default-avatar.BAKNUlXW.js";import"./uni-popup.CI1Fmu1z.js";import"./uni-popup.vue_vue_type_style_index_0_scoped_90b62717_lang.BVw2wyB9.js";import"./index.d2K7R4mP.js";/* empty css                                                              */const C=j({__name:"index",setup(j){e(null);const C=s();e("");const D=e(""),S=e(!0),N=e("124rpx"),P=t([{type:1,icon:"icon-sousuo"}]);let I=t({tree:o((()=>C.state.app.frameTree)),treeData:[],optionsId:"",mode:"selector",isSelect:0,showPerson:!0,onlyOneself:!0,backNumber:1,isChecked:0,isCustomUsers:!1});a((e=>{if(e.item){let s=i(e.item);s.isShow&&"false"==s.isShow&&(S.value=!1,N.value=0),s.mode&&"multiSelector"==s.mode&&(I.mode=s.mode),s.isSelect&&(I.isSelect=s.isSelect),s.showPerson&&"false"===s.showPerson&&(I.showPerson=!1),s.onlyOneself&&"false"===s.onlyOneself&&(I.onlyOneself=!1),s.backNumber&&s.backNumber>1&&(I.backNumber=Number(s.backNumber)),s.isChecked&&1==s.isChecked&&(I.isChecked=Number(s.isChecked)),s.isCustomUsers&&"true"===s.isCustomUsers&&(I.isCustomUsers=!0),I.optionsId=s.id,$()}else $()}));const O=()=>{I.optionsId||0===I.isSelect&&h()},U=e=>{if(2===e.isUser){let s="";s=S.value?`id=${e.id}&isFirst=1&isShow=true&mode=${I.mode}&isSelect=${I.isSelect}&showPerson=${I.showPerson}&onlyOneself=${I.onlyOneself}&isChecked=${I.isChecked}`:`isShow=false&id=${e.id}`,f(s)}},$=()=>{I.optionsId?r((()=>{const e=F(I.tree,Number(I.optionsId));I.treeData=e,I.treeData[0]&&I.treeData[0].label&&(D.value=I.treeData[0].label)})):(I.treeData=I.tree,I.treeData[0]&&I.treeData[0].label&&(D.value=I.treeData[0].label))},B=()=>{if(C.commit("setIsOrgShow",!0),I.optionsId){const e=C.state.app.treeSelectBeforePage;let s=1;if(e){const t=b(),o=y(t,e,"route");s=t.length-o-1}v({delta:s})}else v({delta:I.backNumber})},z=()=>{},F=(e=[],s,t=[])=>(e.forEach((e=>{if(e.id===s&&0==e.type)return t.push(e),t;if(e.children){return F(e.children,s,t)}})),t);return(e,s)=>{const t=d;return c(),n(t,{class:"organization"},{default:l((()=>[u(t,{class:"content"},{default:l((()=>[u(t,{class:"cr-position-header"},{default:l((()=>[u(t,{class:"status_bar"}),u(p(w),{index:0,"is-border":!0,"default-title":D.value,onGoBackChange:O,"is-right":!1,"right-data":P,onHandleNarItem:z},null,8,["default-title","right-data"])])),_:1}),u(t,{class:"organization-con",style:_({paddingBottom:N.value})},{default:l((()=>[u(x,{"tree-data":p(I).treeData,"show-select":S.value,mode:p(I).mode,"is-checked":p(I).isChecked,"show-person":p(I).showPerson,"is-custom-users":p(I).isCustomUsers,"only-oneself":p(I).onlyOneself,onHandleDep:U},null,8,["tree-data","show-select","mode","is-checked","show-person","is-custom-users","only-oneself"]),p(I).treeData[0]&&0==p(I).treeData[0].user.length?(c(),n(k,{key:0,index:9,title:"暂无数据，快去添加吧！"})):m("",!0)])),_:1},8,["style"])])),_:1}),S.value?(c(),n(g,{key:0,"show-person":p(I).showPerson,"is-checked":p(I).isChecked,onHandleOk:B},null,8,["show-person","is-checked"])):m("",!0)])),_:1})}}},[["__scopeId","data-v-cc058e66"]]);export{C as default};
