import{M as t,F as e,v as s,d as o,w as i,i as l,o as a,e as r,f as n,t as c,x as u,I as h,J as m,K as p,H as f,L as d,h as g}from"./index-CAI4HMs2.js";import{_ as w}from"./u-tabs.CSglGUEk.js";import{r as y}from"./uni-app.es.DcWMR81n.js";import{_ as k}from"./u-search.DY2nI7PC.js";import{_ as C}from"./mescroll-body.DDg_HiwD.js";import{_ as j}from"./index.BVDB-QrU.js";import{_}from"./u-picker.DKNttnuL.js";import{d as b,g as x}from"./entrust.BPKivGhe.js";import{a as L}from"./flowEngine.Ddv9_uvD.js";import{r as N}from"./resources.DipqUmnN.js";import{M as F}from"./mescroll-mixins.DcOkHqCw.js";import{u as S}from"./base.CKjQVcA4.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-badge.DRpPfP70.js";import"./u-icon.Dnq5PHPP.js";import"./u-input.DG8e3B-U.js";import"./emitter.DrjJCwnj.js";import"./MultSelect.WmEQpVRv.js";import"./u-checkbox-group.BIm70SuO.js";import"./u-radio-group.DV5cgaoK.js";import"./u-popup.Ct6BAEYD.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,b(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},x({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){L(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,b,x,L,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"),_);return a(),o(v,{class:"workFlow-v"},{default:i((()=>[r(F,{list:L.entrustList,current:L.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:L.keyword,"onUpdate:modelValue":e[0]||(e[0]=t=>L.keyword=t),height:"72","show-action":!1,onChange:N.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["modelValue","onChange"])])),_:1}),r(F,{list:L.categoryList,current:L.current,onChange:N.change,"is-scroll":!0,name:"fullName"},null,8,["list","current","onChange"])])),_:1}),r(I,{ref:"mescrollRef",onDown:t.downCallback,down:L.downOption,sticky:!1,onUp:N.upCallback,up:L.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((()=>[L.list.length>=1?(a(),o(v,{key:0,class:"caption u-line-1"},{default:i((()=>[n(c(0===L.current?"全部流程":L.fullName),1)])),_:1})):u("",!0),r(v,{class:"u-flex u-flex-wrap"},{default:i((()=>[(a(!0),h(p,null,m(L.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:L.options,onChange:N.selectChange,isForm:!1},null,8,["options","onChange"]),r(J,{mode:"selector",modelValue:L.show,"onUpdate:modelValue":e[1]||(e[1]=t=>L.show=t),"default-selector":[0],title:"请选择流程",range:L.selector,"range-key":"fullName",onConfirm:N.confirm},null,8,["modelValue","range","onConfirm"])])),_:1})}],["__scopeId","data-v-1d1e1b11"]]);export{I as default};