2 lines
2.7 KiB
Java
2 lines
2.7 KiB
Java
var f=(d,c,r)=>new Promise((u,n)=>{var i=a=>{try{s(r.next(a))}catch(p){n(p)}},l=a=>{try{s(r.throw(a))}catch(p){n(p)}},s=a=>a.done?u(a.value):Promise.resolve(a.value).then(i,l);s((r=r.apply(d,c)).next())});import{B as I}from"./index-Bzmv9Ie7.js";import{f as B}from"./depart.api-nbAZZHTa.js";import{aH as C,bL as R,au as w}from"./index-X7Y8jykP.js";import{e as A,h as K,y as x,z as y,A as v,r as m,K as N,C as T,F as E,Q as S,f as _,E as k,u as V,c as F}from"./vue-vendor-DNhG1Cve.js";import"./index-BzChaRPg.js";import"./bem-CTsBfXqP.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./props-Cc-8EPhZ.js";import"./fromPairs-Dx9PT-t0.js";import"./index-CfNJyBRj.js";import"./dropdown-jkliuVyN.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./useTimeout-D5AmIBZw.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./useContextMenu-BncvQCmV.js";import"./index-saD4h7VJ.js";import"./difference-CGvbIcA7.js";import"./index-C7ckZv9Z.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./useMaxLevel-DE205ncc.js";import"./eagerComputed-BTlOruLW.js";import"./index-BuONesFs.js";const $={style:{"margin-top":"10px","margin-bottom":"10px",display:"flex"}},j=A({__name:"DepartRankRelation",props:{data:{type:Object,default:()=>({})}},setup(d){const c=d,r=F(()=>{var t;return(t=c.data)==null?void 0:t.id}),u=m(),n=m(!1),i=m([]),l=m([]),s=m([]);K(r,t=>a(t),{immediate:!0});function a(t){return f(this,null,function*(){try{n.value=!0,yield B({departId:t}).then(e=>{e.success&&(i.value=e.result,s.value=g(e.result))})}finally{n.value=!1}})}function p(t){return f(this,null,function*(){t?l.value=s.value:l.value=[]})}function g(t){const e=[];return t.forEach(o=>{o.children&&Array.isArray(o.children)&&o.children.length>0&&(e.push(o.id),e.push(...g(o.children)))}),e}return(t,e)=>{const o=N("a-button"),h=R,b=C;return y(),x(b,{spinning:n.value},{default:v(()=>[i.value&&i.value.length>0?(y(),T(E,{key:0},[S("div",$,[_(o,{preIcon:"ant-design:down-outlined",onClick:e[0]||(e[0]=D=>p(!0)),type:"primary"},{default:v(()=>[...e[2]||(e[2]=[k("展开全部",-1)])]),_:1}),_(o,{preIcon:"ant-design:up-outlined",onClick:e[1]||(e[1]=D=>p(!1)),type:"primary",style:{"margin-left":"10px"}},{default:v(()=>[...e[3]||(e[3]=[k("折叠全部",-1)])]),_:1})]),_(V(I),{expandedKeys:l.value,fieldNames:{children:"children",title:"title",key:"value"},ref_key:"basicTree",ref:u,treeData:i.value,checkStrictly:!0,style:{height:"500px",overflow:"auto"}},null,8,["expandedKeys","treeData"])],64)):(y(),x(h,{key:1,description:"无岗位消息"}))]),_:1},8,["spinning"])}}}),ye=w(j,[["__scopeId","data-v-52621ce6"]]);export{ye as default};
|