import{T as s,U as t,n as e,q as a,c as l,w as i,i as o,o as r,t as n,C as c,D as u,F as d,A as m,G as h,v as f,x as p,H as w,E as g}from"./index-DL8B2Mxu.js";import{_}from"./u-search.C1fh-wIV.js";import{r as k}from"./uni-app.es.BSVEa1f2.js";import{_ as b}from"./u-tag.Bs11KZVx.js";import{_ as y,a as x}from"./uni-swipe-action.C4F8GIbZ.js";import{_ as S}from"./mescroll-body.DoI4hLy1.js";import{r as C}from"./resources.DipqUmnN.js";import{M as U}from"./mescroll-mixins.DNza9FDh.js";import{F as j,D as v}from"./flowLaunch.BllHCAND.js";import{_ as T}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.CLOPtL2B.js";const I=T({mixins:[U],data:()=>({flowStatus:"",downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:10,time:null},empty:{use:!0,icon:C.message.nodata,tip:"暂无数据",fixed:!0,top:"300rpx"},textNoMore:"没有更多数据"},keyword:"",list:[],options:[{text:"删除",style:{backgroundColor:"#dd524d"}}]}),onShow(){s("refresh",(()=>{this.list=[],this.mescroll.resetUpScroll()}))},onUnload(){t("refresh")},methods:{upCallback(s){let t={currentPage:s.num,pageSize:s.size,keyword:this.keyword};j(t,{load:1==s.num}).then((t=>{this.mescroll.endSuccess(t.data.list.length),1==s.num&&(this.list=[]);const e=t.data.list.map((s=>({flowStatus:this.getFlowStatus(s.status),...s})));this.list=this.list.concat(e)})).catch((()=>{this.mescroll.endErr()}))},getFlowStatus(s){let t;switch(s){case 0:default:t=C.status.submit;break;case 1:t=C.status.review;break;case 2:t=C.status.reviewAdopt;break;case 3:t=C.status.reviewRefuse;break;case 4:case 7:t=C.status.reviewUndo;break;case 5:t=C.status.reviewStop;break;case 6:t=C.status.suspend}return t},handleClick(s){const t=this.list[s];if([1,2,3,5].includes(t.status))return this.$u.toast("流程正在审核,请勿删除"),void(this.list[s].show=!1);v(t.id).then((t=>{this.$u.toast(t.msg),this.list.splice(s,1),this.list.length||this.mescroll.resetUpScroll()}))},open(s){this.list[s].show=!0,this.list.map(((t,e)=>{s!=e&&(this.list[e].show=!1)}))},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.mescroll.resetUpScroll()}),300)},goDetail(s){let t="-1";[1,2,4,5].includes(s.status)&&(t=0);const a={id:s.id,flowId:s.flowId,opType:t,status:s.status};e({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(a))})},getLableValue(s){var t="";switch(s){case 1:default:t="普通";break;case 2:t="重要";break;case 3:t="紧急"}return t}}},[["render",function(s,t,e,C,U,j){const v=k(a("u-search"),_),T=o,I=k(a("u-tag"),b),F=w,D=g,O=k(a("uni-swipe-action-item"),y),V=k(a("uni-swipe-action"),x),z=k(a("mescroll-body"),S);return r(),l(T,{class:"flowLaunch-v"},{default:i((()=>[n(z,{ref:"mescrollRef",onInit:s.mescrollInit,onDown:s.downCallback,onUp:j.upCallback,sticky:!0,down:U.downOption,up:U.upOption},{default:i((()=>[n(T,{class:"search-box search-box_sticky"},{default:i((()=>[n(v,{placeholder:"请输入关键词搜索",modelValue:U.keyword,"onUpdate:modelValue":t[0]||(t[0]=s=>U.keyword=s),height:"72","show-action":!1,onChange:j.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["modelValue","onChange"])])),_:1}),U.list.length>0?(r(),l(T,{key:0,class:"flow-list"},{default:i((()=>[n(T,{class:"flow-list-box"},{default:i((()=>[n(V,{ref:"swipeAction"},{default:i((()=>[(r(!0),c(d,null,u(U.list,((t,e)=>(r(),l(O,{key:t.id,threshold:0,"right-options":U.options,onClick:s=>j.handleClick(e)},{default:i((()=>[n(T,{class:"item",onClick:s=>j.goDetail(t),id:"item"+e,ref_for:!0,ref:"mydom"},{default:i((()=>[n(T,{class:"item-left"},{default:i((()=>[n(T,{class:"item-left-top"},{default:i((()=>[t.delegateUser?(r(),l(T,{key:0,class:"u-m-r-8"},{default:i((()=>[n(I,{text:"委托",type:"success",size:"mini"})])),_:1})):m("",!0),n(T,{class:h(["common-lable",{"urgent-lable":2==t.flowUrgent,"important-lable":3==t.flowUrgent}])},{default:i((()=>[f(p(j.getLableValue(t.flowUrgent)),1)])),_:2},1032,["class"]),n(F,{class:"title u-font-28 u-line-1"},{default:i((()=>[f(p(t.fullName),1)])),_:2},1024)])),_:2},1024),n(F,{class:"title u-line-1 u-font-24"},{default:i((()=>[f("审批节点："),n(F,{class:"titInner"},{default:i((()=>[f(p(t.thisStep?t.thisStep:""),1)])),_:2},1024)])),_:2},1024),n(F,{class:"time title u-font-24"},{default:i((()=>[f("发起时间："),n(F,{class:"titInner"},{default:i((()=>[f(p(t.creatorTime?s.$u.timeFormat(t.creatorTime,"yyyy-mm-dd hh:MM:ss"):""),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),n(T,{class:"item-right"},{default:i((()=>[n(D,{src:t.flowStatus,mode:"widthFix",class:"item-right-img"},null,8,["src"])])),_:2},1024)])),_:2},1032,["onClick","id"])])),_:2},1032,["right-options","onClick"])))),128))])),_:1},512)])),_:1})])),_:1})):m("",!0)])),_:1},8,["onInit","onDown","onUp","down","up"])])),_:1})}],["__scopeId","data-v-bb27c9d6"]]);export{I as default};
