index-b5be3863.js 8.2 KB

1
  1. import{d as fe,y as he,e as O,r as f,aS as ge,aT as ve,H as ye,x as W,b as be,o as c,c as A,a as l,C as p,f as t,B as o,aA as j,a2 as V,l as q,v as ke,aE as _e,A as m,G as C,E as x,aB as Ce,a0 as xe,D as N,F as we,_ as Ie,L as Ve,a6 as Ne,S as Se,J as De,M as Ue,U as ze,a7 as Pe,a8 as Te,V as Ae,W as Ke,X as Me}from"./index-24b5bd0d.js";import{_ as $e}from"./Echart.vue_vue_type_script_setup_true_lang-f8381e4c.js";import{_ as Be}from"./ContentWrap.vue_vue_type_script_setup_true_lang-1e5dab5a.js";import{_ as Ee}from"./index.vue_vue_type_script_setup_true_lang-d8bf5c47.js";import{_ as Le,S as K}from"./Descendants.vue_vue_type_script_setup_true_lang-bf72146b.js";import{D as Re}from"./index-3bb36a7e.js";import{u as Fe}from"./useMessage-6f610bbd.js";import{_ as Je}from"./_plugin-vue_export-helper-1b428a4d.js";import"./el-card-0b237923.js";import"./index-15201e14.js";import"./Dialog-23d56afa.js";const Oe={key:0,class:"search-one"},We={style:{"text-align":"right"},class:"search-input"},je={key:1,class:"search-one"},qe={style:{"text-align":"right"},class:"search-input"},Ge={style:{width:"100%",position:"relative"}},He=["src"],Xe=["onClick"],Ze=["onClick"],Qe=["onClick"],Ye={style:{display:"none"}},ea=Je(fe({name:"SharePath",__name:"index",props:{userId:{type:Number,default:0}},setup(G){const H=he(),X=O(()=>H.getMobile),w=f(!1),_=G,{wsCache:Z}=ge(),Q=Z.get(ve.USER),Y=O(()=>Q.user.id===1),M=()=>{w.value=!w.value},S=()=>{w.value=!1},d=f(1),ee=a=>{d.value=a.paneName,d.value==1?h(r):(s.userId=_.userId||1,h(s))};Fe(),ye();const I=f(!0),$=f([]);let b=f([]);const B=f(0),r=W({pageNo:1,pageSize:10,mobile:void 0,nickName:void 0,username:void 0}),ae=f(),s=W({userId:1,nickName:void 0,mobile:void 0,maxDepth:50,username:void 0}),h=async a=>{if(I.value=!0,d.value==1)try{const e=await Re.getDuserPage(a);$.value=e.list,B.value=e.total}finally{I.value=!1}else if(d.value==2)try{const e=await K.getSharePathPageTree(a);b.value=[z(e)],g.series[0].data=b.value,g={...g}}finally{I.value=!1}},E=f(),D=async(a,e,i)=>{E.value.open(a,e.userId,e.childrenCount,i)};function le(a){a.preventDefault()}const k=(a=void 0)=>{a.preventDefault(),r.pageNo=1,h(r)},U=a=>{if(a.preventDefault(),!s.nickName&&!s.mobile)return h(s),!1;(async e=>{e.userId=void 0,e.maxDepth=5;const i=await K.getTreeByNameOrMobile(e);b.value=[z(i)],g.series[0].data=b.value,g={...g}})(s)},te=()=>{r.mobile=void 0,r.nickName=void 0,r.username=void 0,k(),S()},ne=()=>{s.userId=_.userId||1,s.nickName=void 0,s.mobile=void 0,h(s),S()};let g={tooltip:{trigger:"item",triggerOn:"mousemove",formatter:function(a){return`${a.data.userName}`}},dataZoom:{type:"inside"},series:[{type:"tree",data:[],left:"2%",right:"2%",top:"8%",bottom:"20%",orient:"vertical",initialTreeDepth:1e8,expandAndCollapse:!0,label:{position:"bottom",verticalAlign:"middle",align:"center",fontSize:14,padding:10,formatter:function(a){return`${a.data.userName}`}},zoom:1,roam:!0,scaleLimit:{min:.1,max:100},leaves:{label:{position:"bottom",verticalAlign:"middle",align:"center",fontSize:14}},animationDurationUpdate:750,symbolSize:3}]};const z=a=>(a.name===null&&(a.name="\u672A\u547D\u540D\u8282\u70B9"),a.children&&a.children.length>0?(a.children=a.children.map(e=>z(e)),a.children.sort((e,i)=>e.sort-i.sort)):a.children=[],a),P=f(null),oe=a=>{P.value=a,P.value&&P.value.on("click",function(e){e.componentType==="series"&&(e.data.children.length||async function(i){if(!i.userId)return;s.userId=i.userId;let u=await K.getSharePathPageTree(s);if(u&&u.children.length>0){const v=L(b.value[0],i.userId);v&&(v.children=u.children)}}(e.data))})};function L(a,e){if(a.userId===e)return a;if(a.children&&a.children.length>0)for(let i of a.children){const u=L(i,e);if(u)return u}return null}return be(async()=>{_.userId&&(r.userId=_.userId,s.userId=_.userId),await h(r)}),(a,e)=>{const i=Ie,u=Ve,v=Ne,T=Se,re=De,ie=Ue,se=ze,R=Pe,de=Te,y=Ae,ue=Ke,ce=Ee,F=Be,pe=$e,me=Me;return c(),A(we,null,[l(d)==1?(c(),A("div",Oe,[p("div",We,[t(v,{modelValue:l(r).mobile,"onUpdate:modelValue":e[0]||(e[0]=n=>l(r).mobile=n),placeholder:"\u7528\u6237\u624B\u673A\u53F7",clearable:"",onKeyup:V(k,["enter"])},{suffix:o(()=>[t(i,{class:"mr-5px",icon:"ep:search",onClick:k,style:{cursor:"pointer"}})]),append:o(()=>[t(u,{icon:l(j),onClick:M},null,8,["icon"])]),_:1},8,["modelValue"])])])):(c(),A("div",je,[p("div",qe,[t(v,{modelValue:l(s).mobile,"onUpdate:modelValue":e[1]||(e[1]=n=>l(s).mobile=n),placeholder:"\u7528\u6237\u624B\u673A\u53F7",clearable:"",onKeyup:V(U,["enter"])},{suffix:o(()=>[t(i,{class:"mr-5px",icon:"ep:search",onClick:U,style:{cursor:"pointer"}})]),append:o(()=>[t(u,{icon:l(j),onClick:M},null,8,["icon"])]),_:1},8,["modelValue"])])])),p("div",Ge,[q(p("div",{class:"searchMore",style:_e({width:l(X)?"88.7%":"96%"})},[t(se,{class:"-mb-15px",model:l(r),ref_key:"queryFormRef",ref:ae,inline:!0,"label-width":"108px",onSubmit:Ce(le,["prevent"])},{default:o(()=>[l(d)==1?(c(),m(T,{key:0,label:"\u7528\u6237\u540D",prop:"username"},{default:o(()=>[t(v,{modelValue:l(r).username,"onUpdate:modelValue":e[2]||(e[2]=n=>l(r).username=n),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",clearable:"",onKeyup:V(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1})):(c(),m(T,{key:1,label:"\u7528\u6237\u540D",prop:"name"},{default:o(()=>[t(v,{modelValue:l(r).username,"onUpdate:modelValue":e[3]||(e[3]=n=>l(r).username=n),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",clearable:"",onKeyup:V(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1})),t(ie,null,{default:o(()=>[t(re,null,{default:o(()=>[t(T,null,{default:o(()=>[t(u,{onClick:S},{default:o(()=>e[8]||(e[8]=[C(" \u6536\u8D77 ")])),_:1}),l(d)==1?(c(),m(u,{key:0,onClick:k},{default:o(()=>[t(i,{icon:"ep:search",class:"mr-5px"}),e[9]||(e[9]=C(" \u641C\u7D22 "))]),_:1})):(c(),m(u,{key:1,onClick:U},{default:o(()=>[t(i,{icon:"ep:search",class:"mr-5px"}),e[10]||(e[10]=C(" \u641C\u7D22 "))]),_:1})),l(d)==1?(c(),m(u,{key:2,onClick:te},{default:o(()=>[t(i,{icon:"ep:refresh",class:"mr-5px"}),e[11]||(e[11]=C(" \u91CD\u7F6E "))]),_:1})):x("",!0),l(d)==2?(c(),m(u,{key:3,onClick:ne},{default:o(()=>[t(i,{icon:"ep:refresh",class:"mr-5px"}),e[12]||(e[12]=C(" \u91CD\u7F6E "))]),_:1})):x("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])],4),[[ke,l(w)]])]),l(Y)?(c(),m(de,{key:2,modelValue:l(d),"onUpdate:modelValue":e[4]||(e[4]=n=>xe(d)?d.value=n:null),onTabClick:ee,class:"parent-tabs"},{default:o(()=>[t(R,{label:"\u5217\u8868\u6A21\u5F0F",name:1}),t(R,{label:"\u6811\u72B6\u56FE",name:2})]),_:1},8,["modelValue"])):x("",!0),l(d)==1?(c(),m(F,{key:3,style:{"margin-top":"10px",padding:"10px"}},{default:o(()=>[q((c(),m(ue,{data:l($),stripe:!0,"show-overflow-tooltip":!0},{default:o(()=>[t(y,{label:"\u5934\u50CF",align:"center",prop:"ancName"},{default:o(n=>[p("span",null,[p("img",{src:n.row.avatar,style:{width:"50px",height:"50px","border-radius":"50%",border:"1px solid rgb(220, 223, 231)"}},null,8,He)])]),_:1}),t(y,{label:"\u7528\u6237\u540D",align:"center",prop:"username"}),t(y,{label:"\u7528\u6237\u624B\u673A\u53F7",align:"center",prop:"mobile"}),t(y,{label:"\u63A8\u8350\u4EBA\u7528\u6237\u540D",align:"center",prop:"ancUsername"}),t(y,{label:"\u76F4\u63A8\u4EBA\u5217\u8868",align:"center",prop:"descendantCount"},{default:o(n=>[p("span",{onClick:J=>D(1,n.row),style:{cursor:"pointer",display:"inline-block",width:"100%"}},N(n.row.descendantCount),9,Xe)]),_:1}),t(y,{label:"\u5DE6\u533A",align:"center",prop:"leftCount"},{default:o(n=>[p("span",{onClick:J=>D(2,n.row,n.row.leftChildId),style:{cursor:"pointer",display:"inline-block",width:"100%"}},N(n.row.leftCount),9,Ze)]),_:1}),t(y,{label:"\u53F3\u533A",align:"center",prop:"rightCount"},{default:o(n=>[p("span",{onClick:J=>D(3,n.row,n.row.rightChildId),style:{cursor:"pointer",display:"inline-block",width:"100%"}},N(n.row.rightCount),9,Qe)]),_:1})]),_:1},8,["data"])),[[me,l(I)]]),t(ce,{total:l(B),page:l(r).pageNo,"onUpdate:page":e[5]||(e[5]=n=>l(r).pageNo=n),limit:l(r).pageSize,"onUpdate:limit":e[6]||(e[6]=n=>l(r).pageSize=n),onPagination:e[7]||(e[7]=n=>h(l(r)))},null,8,["total","page","limit"])]),_:1})):x("",!0),l(d)==2?(c(),m(F,{key:4,style:{"margin-top":"10px",padding:"10px"}},{default:o(()=>[p("div",Ye,N(l(b)),1),t(pe,{height:650,onChartInit:oe,options:l(g)},null,8,["options"])]),_:1})):x("",!0),t(Le,{ref_key:"formRef",ref:E,onSuccess:h},null,512)],64)}}}),[["__scopeId","data-v-a2f1e646"]]);export{ea as default};