import{_ as e,p as a,r as t,q as s,t as l,u as r,v as o,a as n,c,w as u,x as i,i as d,y as m,z as v,A as p,d as f,B as g,C as _,D as h,F as y,E as w,G as k,S as x,k as I,e as b,H as T,J as C,K as N,L as S,M as U,$ as z,N as P,P as j,f as D}from"./index-BlslIQWi.js";import{_ as F}from"./uni-segmented-control.KGtN7YAa.js";import{_ as L}from"./noData.BO1MxwPV.js";import{t as $}from"./task.Dg1bij4e.js";import{g as M,a as A}from"./ProcessUtil.Cpq6blAo.js";const E=e({__name:"ProcessSelect",setup(e){const E=a((()=>{const e=["待我处理","已处理的","我发起的","抄送我的"];return e[B.value]+=`-${K.value.total}`,e})),H=a((()=>w().windowHeight-40)),q=t({current:0,old:0}),B=t(0),G=t("more"),J=t({pageSize:10,pageNo:1,code:""}),K=t({pages:1,size:10,total:0,records:[]});function R(e){switch(B.value){case 0:return{text:"待处理",type:"warning"};case 1:return A(e);case 2:case 3:return M(e.result)}}function O(e){B.value=e.currentIndex,J.value.pageNo=1,V(),q.value.current=q.value.old,k((()=>{q.value.current=0}))}function Q(e){q.value.old=e.detail.scrollTop}function V(){G.value="loading",function(){switch(B.value){case 0:return $.getUserTodoList(J.value);case 1:return $.getIdoList(J.value);case 2:return $.getUserSubmittedList(J.value);case 3:return $.getCcMeList(J.value)}}().then((e=>{i(),K.value.total=e.data.total,1===J.value.pageNo&&(K.value.records.length=0),K.value.records.push(...e.data.records),G.value=J.value.pageNo*J.value.pageSize<K.value.total?"more":"noMore"})).catch((e=>{i()}))}function W(){J.value.pageNo++,V()}return s((e=>{V()})),l((()=>{V()})),(e,a)=>{const t=r(o("uni-segmented-control"),F),s=d,l=D,i=r(o("uni-tag"),m),w=r(o("uni-icons"),v),k=r(o("uni-load-more"),p),$=x,M=I;return n(),c(s,{class:"content"},{default:u((()=>[f(s,{class:"nav-type"},{default:u((()=>[f(t,{current:B.value,values:E.value,onClickItem:O,styleType:"text",activeColor:"#4C87F3"},null,8,["current","values"])])),_:1}),f(s,{class:"datas"},{default:u((()=>[K.value.records.length>0?(n(),c($,{key:0,class:"scrool-more","refresher-threshold":0,onScrolltolower:W,"scroll-top":q.value.current,onScroll:Q,enablePullDownRefresh:"",onScrolltoupper:()=>{},"show-scrollbar":!0,style:g({height:H.value+"px"}),"scroll-y":"true","scroll-with-animation":"true"},{default:u((()=>[(n(!0),_(y,null,h(K.value.records,((e,a)=>(n(),c(s,{class:"process-item",key:e.instanceId+a,onClick:a=>function(e){j({url:`/pages/instance/instancePreview?instanceId=${e.instanceId}&nodeId=${e.nodeId}`})}(e)},{default:u((()=>[f(s,null,{default:u((()=>[f(l,null,{default:u((()=>[b(T((e.owner||e.staterUser).name)+"提交的 "+T(e.processDefName),1)])),_:2},1024),f(i,{class:"process-item-status",circle:"true",text:R(e).text,type:R(e).type,inverted:""},null,8,["text","type"])])),_:2},1024),f(s,{class:"form-content"},{default:u((()=>[(n(!0),_(y,null,h(e.formAbstracts||[],(e=>(n(),c(s,{key:e.id},{default:u((()=>[f(l,{style:{color:"#b5b5b5"}},{default:u((()=>[b(T(e.name)+": ",1)])),_:2},1024),f(l,{class:"over-tip"},{default:u((()=>[b(T(C(N)(e)),1)])),_:2},1024)])),_:2},1024)))),128))])),_:2},1024),f(s,{class:"process-item-footer"},{default:u((()=>[f(S,{name:(e.owner||e.staterUser).name,src:(e.owner||e.staterUser).avatar,size:30},null,8,["name","src"]),f(l,null,{default:u((()=>[b("在 "+T((e.createTime||e.startTime).substring(0,16))+" 提交 ",1)])),_:2},1024),f(s,{onClick:U((a=>function(e){z("selectProcess",{id:e.instanceId,name:e.processDefName,startUser:e.owner||e.staterUser,createTime:e.createTime||e.startTime}),setTimeout((()=>P()),100)}(e)),["stop"])},{default:u((()=>[f(w,{color:"#5976EF",type:"checkbox",size:"18"}),f(l,null,{default:u((()=>[b("选择")])),_:1})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["onClick"])))),128)),f(k,{status:G.value,mode:"scaleToFill",showIcon:!1},null,8,["status"])])),_:1},8,["scroll-top","style"])):(n(),c(M,{key:1,class:"nodata",src:L,mode:"aspectFit"}))])),_:1})])),_:1})}}},[["__scopeId","data-v-9485c865"]]);export{E as default};
