import{_ as e,p as a,r as t,q as s,Q as l,R as r,T as n,U as o,t as u,u as c,v as i,J as d,a as v,c as p,w as f,b as m,V as g,G as h,x as y,i as _,y as w,A as x,d as k,C as I,D as S,F as N,B as b,E as C,W as T,e as U,H as j,K as O,L as J,P as L,f as z,S as D,k as F,X as P}from"./index-BlslIQWi.js";import{_ as $}from"./uni-segmented-control.KGtN7YAa.js";import{_ as A}from"./noData.BO1MxwPV.js";import{t as H}from"./task.Dg1bij4e.js";import{g as M}from"./model.D9cviTiO.js";import{g as R,a as q}from"./ProcessUtil.Cpq6blAo.js";const B=e({__name:"workspace",setup(e){const B=a((()=>{const e=["待我处理","已处理的","我发起的","抄送我的"];let a=JSON.parse(JSON.stringify(Y.value));return a=a.filter((a=>e.includes(a))),a[K.value]=(a[K.value]||"")+`-${X.value.total||0}`,a})),E=a((()=>C().windowHeight-40)),G=t({current:0,old:0}),K=t(0),Q=t("more"),V=t({pageSize:10,pageNo:1,code:""}),W=t([[],[],[],[]]),X=t({pages:1,size:10,total:0,records:[]});let Y=t([]),Z=t(!0);function ee(e){let a=B.value[K.value];switch(a.indexOf("-")>=0&&(a=a.split("-")[0]),a){case"待我处理":return{text:"待处理",type:"warning"};case"已处理的":return q(e);case"我发起的":case"抄送我的":return R(e.result)}}function ae(e){K.value=e.currentIndex,V.value.pageNo=1,le(),G.value.current=G.value.old,h((()=>{G.value.current=0}))}function te(e){G.value.old=e.detail.scrollTop}function se(e){ae({currentIndex:e.target.current||e.detail.current})}function le(){Q.value="loading";try{(function(){let e=B.value[K.value];switch(console.log(B.value,K.value),e.indexOf("-")>=0&&(e=e.split("-")[0]),e){case"待我处理":return H.getUserTodoList(V.value);case"已处理的":return H.getIdoList(V.value);case"我发起的":return H.getUserSubmittedList(V.value);case"抄送我的":return H.getCcMeList(V.value)}})().then((e=>{y(),X.value.total=e.data.total,1===V.value.pageNo&&(W.value[K.value].length=0),W.value[K.value].push(...e.data.records),Q.value=V.value.pageNo*V.value.pageSize<X.value.total?"more":"noMore"})).catch((e=>{y()}))}catch(e){console.log(e)}}function re(){V.value.pageNo++,le()}return t(!1),s((e=>{l(),le(),function(){let e=JSON.parse(g("loginUser"));M({projectSn:e.sn,moduleType:7,userId:e.userId}).then((e=>{let a=e.data.result.menuList;Y.value=a.map((e=>e.name));let t=JSON.parse(JSON.stringify(Y.value));const s=["待我处理","已处理的","我发起的","抄送我的"];t=t.filter((e=>s.includes(e))),Y.value=t,W.value.length=t.length,Z.value=!1,console.log(Y.value),le()}))}()})),r("to:workspace",(e=>{ae({currentIndex:e})})),n((()=>o("to:workspace"))),u((()=>{le()})),(e,a)=>{const t=c(i("uni-segmented-control"),$),s=_,l=z,r=c(i("uni-tag"),w),n=c(i("uni-load-more"),x),o=D,u=F,g=P,h=T;return d(Y).length>0?(v(),p(s,{key:0,class:"content"},{default:f((()=>[k(s,{class:"nav-type"},{default:f((()=>[k(t,{current:K.value,values:B.value,onClickItem:ae,styleType:"text",activeColor:"#4C87F3"},null,8,["current","values"])])),_:1}),k(h,{current:K.value,duration:300,onChange:se,style:b({height:E.value+"px"})},{default:f((()=>[(v(!0),I(N,null,S(W.value,((e,a)=>(v(),p(g,{class:"datas",key:a},{default:f((()=>[e.length>0?(v(),p(o,{key:0,class:"scrool-more","refresher-threshold":0,onScrolltolower:re,"scroll-top":G.value.current,onScroll:te,enablePullDownRefresh:"",onScrolltoupper:()=>{},"show-scrollbar":!0,style:b({height:E.value+"px"}),"scroll-y":"true","scroll-with-animation":"true"},{default:f((()=>[(v(!0),I(N,null,S(e,((e,a)=>(v(),p(s,{class:"process-item",key:e.instanceId+a,onClick:a=>function(e){L({url:`/pages/instance/instancePreview?instanceId=${e.instanceId}&nodeId=${0===K.value?e.nodeId:null}`})}(e)},{default:f((()=>[k(s,null,{default:f((()=>[k(l,null,{default:f((()=>[U(j((e.owner||e.staterUser||{}).name)+"提交的 "+j(e.processDefName),1)])),_:2},1024),k(r,{class:"process-item-status",circle:"true",text:ee(e).text,type:ee(e).type,inverted:""},null,8,["text","type"])])),_:2},1024),k(s,{class:"form-content"},{default:f((()=>[(v(!0),I(N,null,S(e.formAbstracts||[],(e=>(v(),p(s,{key:e.id,class:"form-content-it"},{default:f((()=>[k(l,{style:{color:"#b5b5b5"}},{default:f((()=>[U(j(e.name)+": ",1)])),_:2},1024),k(l,{class:"over-tip"},{default:f((()=>[U(j(d(O)(e)),1)])),_:2},1024)])),_:2},1024)))),128))])),_:2},1024),k(s,{class:"process-item-footer"},{default:f((()=>[k(J,{name:(e.owner||e.staterUser).name,src:(e.owner||e.staterUser).avatar,size:30},null,8,["name","src"]),k(l,null,{default:f((()=>[U("在 "+j(e.createTime||e.startTime)+" 提交 ",1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"])))),128)),k(n,{status:Q.value,mode:"scaleToFill",showIcon:!1},null,8,["status"])])),_:2},1032,["scroll-top","style"])):(v(),p(u,{key:1,class:"nodata",src:A,mode:"widthFix"}))])),_:2},1024)))),128))])),_:1},8,["current","style"])])),_:1})):m("",!0)}}},[["__scopeId","data-v-b10ea852"]]);export{B as default};
