import{M as t,F as e,q as s,c as o,w as i,i as l,o as a,b as r,d as n,t as c,v as u,I as h,J as m,K as p,H as f,L as d,f as g}from"./index-BAHUfTdj.js";import{_ as w}from"./u-tabs.vyIcTFH2.js";import{r as y}from"./uni-app.es.xRkvtvIM.js";import{_ as k}from"./u-search.ErqQwnA3.js";import{_ as C}from"./mescroll-body.DiKp_GPS.js";import{_ as j}from"./index.CIzsddj2.js";import{_ as b}from"./u-picker.BgeNK4Mu.js";import{d as _,g as L}from"./entrust.Bwmm0kpP.js";import{a as x}from"./flowEngine._T4hay1f.js";import{r as N}from"./resources.DipqUmnN.js";import{M as F}from"./mescroll-mixins.D9o9BYkn.js";import{u as S}from"./base.DIv0ojSn.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-badge.T3MOojTL.js";import"./u-icon.BMdK6LYG.js";import"./u-input.Bqfg-Tyc.js";import"./emitter.DrjJCwnj.js";import"./MultSelect.8oODkgiu.js";import"./u-checkbox-group.lYTBj_Po.js";import"./u-radio-group.Bv7iS_EB.js";import"./u-popup.YSfcoALi.js";const U=S();const I=v({mixins:[F],data:()=>({selector:[],show:!1,activeFlow:{},templateList:[],downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:50,time:null},empty:{use:!0,icon:N.message.nodata,tip:"暂无数据",fixed:!1,top:"560rpx"},textNoMore:"没有更多数据"},keyword:"",category:"",current:0,categoryList:[{fullName:"全部流程"}],list:[],fullName:"",loading:!1,entrustList:[{fullName:"发起流程"},{fullName:"功能流程"}],flowCurrent:0,options:[],config:{}}),onLoad(){this.getPaymentMethodOptions(),t("refresh",(()=>{this.list=[],this.current=0,this.mescroll.resetUpScroll()}))},methods:{openPage(t){t&&e({url:t})},upCallback(t){let e={currentPage:t.num,pageSize:t.size,keyword:this.keyword,category:0==this.category?"":this.category,flowType:this.flowCurrent};this.loading=!1,_(e,{load:1==t.num}).then((e=>{let s=e.data.list||[];this.mescroll.endSuccess(s.length),1==t.num&&(this.list=[]);const o=s.map((t=>({show:!1,...t})));this.list=this.list.concat(o),this.loading=!0})).catch((()=>{this.mescroll.endErr()}))},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.mescroll.resetUpScroll()}),300)},flowChange(t){this.flowCurrent=t,this.current=0,this.list=[],this.mescroll.resetUpScroll()},change(t){this.current=t,this.fullName=this.categoryList[t].fullName,this.category=this.categoryList[t].id?this.categoryList[t].id:"",this.list=[],this.keyword="",this.mescroll.resetUpScroll()},getPaymentMethodOptions(){U.getDictionaryData({sort:"WorkFlowCategory"}).then((t=>{t.forEach((t=>{this.categoryList.push(t)}))}))},confirm(t){this.activeFlow=this.templateList[t[0]],this.Jump()},Jump(){this.config={id:"",flowId:this.activeFlow.id,opType:"-1",taskNodeId:"",fullName:this.activeFlow.fullName},L({flowId:this.activeFlow.id}).then((t=>{if(this.options=t.data.list||[],this.options.length>1)return this.$refs.select.openSelect();this.config.delegateUserList=[this.options[0].id],e({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(this.config))})}))},handelClick(t){x(t.id,"1").then((t=>{this.templateList=t.data,this.templateList.length?this.templateList.length>1?(this.show=!0,this.selector=this.templateList):(this.activeFlow=this.templateList[0],this.Jump()):this.$u.toast("流程不存在")}))},selectChange(t){if(!t.length)return this.$u.toast("请选择人员");this.config.delegateUserList=t,e({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(this.config))})}}},[["render",function(t,e,_,L,x,N){const F=y(s("u-tabs"),w),S=y(s("u-search"),k),v=l,U=g,I=y(s("mescroll-body"),C),O=y(s("JnpfSelect"),j),J=y(s("u-picker"),b);return a(),o(v,{class:"workFlow-v"},{default:i((()=>[r(F,{list:x.entrustList,current:x.flowCurrent,onChange:N.flowChange,"is-scroll":!1,name:"fullName"},null,8,["list","current","onChange"]),r(v,{class:"search-box_sticky"},{default:i((()=>[r(v,{class:"search-box"},{default:i((()=>[r(S,{placeholder:"请输入关键词搜索",modelValue:x.keyword,"onUpdate:modelValue":e[0]||(e[0]=t=>x.keyword=t),height:"72","show-action":!1,onChange:N.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["modelValue","onChange"])])),_:1}),r(F,{list:x.categoryList,current:x.current,onChange:N.change,"is-scroll":!0,name:"fullName"},null,8,["list","current","onChange"])])),_:1}),r(I,{ref:"mescrollRef",onDown:t.downCallback,down:x.downOption,sticky:!1,onUp:N.upCallback,up:x.upOption,bottombar:!1,style:{"min-height":"100%"},onInit:t.mescrollInit},{default:i((()=>[r(v,{class:"workFlow-list"},{default:i((()=>[r(v,{class:"part"},{default:i((()=>[x.list.length>=1?(a(),o(v,{key:0,class:"caption u-line-1"},{default:i((()=>[n(c(0===x.current?"全部流程":x.fullName),1)])),_:1})):u("",!0),r(v,{class:"u-flex u-flex-wrap"},{default:i((()=>[(a(!0),h(p,null,m(x.list,((t,e)=>(a(),o(v,{class:"item u-flex-col u-col-center",key:e,onClick:e=>N.handelClick(t)},{default:i((()=>[r(U,{class:f(["u-font-40 item-icon",t.icon]),style:d({background:t.iconBackground||"#008cff"})},null,8,["class","style"]),r(U,{class:"u-font-24 u-line-1 item-text"},{default:i((()=>[n(c(t.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})])),_:1},8,["onDown","down","onUp","up","onInit"]),r(O,{multiple:!0,ref:"select",options:x.options,onChange:N.selectChange,isForm:!1},null,8,["options","onChange"]),r(J,{mode:"selector",modelValue:x.show,"onUpdate:modelValue":e[1]||(e[1]=t=>x.show=t),"default-selector":[0],title:"请选择流程",range:x.selector,"range-key":"fullName",onConfirm:N.confirm},null,8,["modelValue","range","onConfirm"])])),_:1})}],["__scopeId","data-v-1d1e1b11"]]);export{I as default};