pages-index-workFlow.D39EBZQe.js 8.04 KB
import{z as e,N as t,g as s,u as o,M as l,F as a,l as i,v as n,G as c,Q as r,R as u,d as m,w as d,i as p,o as f,e as h,f as g,I as w,J as y,K as k,t as _,x as C,h as b,H as x,L}from"./index-B0jdI5zM.js";import{_ as j}from"./u-image.CAGIuZzX.js";import{r as F}from"./uni-app.es.PVHrE9FM.js";import{_ as T}from"./u-badge.RIWWpWVZ.js";import{_ as N}from"./u-search.DRHR1Htr.js";import{_ as U}from"./u-tabs.DCWej2KY.js";import{_ as S}from"./mescroll-body.lyClDlpj.js";import{g as I,F as v,a as E}from"./flowEngine.DHYUuU75.js";import{M as D}from"./MultSelect.uxcN0Cxp.js";import{g as M}from"./apply.C5e5zMvc.js";import{r as O}from"./resources.DipqUmnN.js";import{M as P}from"./mescroll-mixins.B6ewyyrx.js";import{I as J}from"./mixin.DpHPl8jI.js";import{u as B}from"./base.Zd11-gcH.js";import{_ as R}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.CiKQQhDt.js";import"./u-checkbox-group.DpwAqpub.js";import"./emitter.DrjJCwnj.js";import"./u-radio-group.CibV8S3r.js";import"./u-popup.B-tPGo2l.js";const z=B();const V=R({mixins:[P,J],components:{MultSelect:D},data:()=>({selector:[],show:!1,activeFlow:{},templateList:[],count:0,offset:[-12,55],usualList:[],downOption:{use:!0,auto:!0},className:"",emptyImg:O.message.nodata,upOption:{page:{num:0,size:50,time:null},empty:{use:!0,icon:O.message.nodata,tip:"暂无数据",fixed:!1,top:"560rpx"},textNoMore:"没有更多数据"},keyword:"",category:"",current:0,categoryList:[],list:[],fullName:"",loading:!1,selectFlowValue:0,enCode:"",workflowEnabled:!1,pageLoading:!0}),onLoad(){e(),this.getCurrent()},onUnload(){t("updateUsualList")},onShow(){this.getCurrent()},methods:{getCurrent(){const e=s("userInfo")||{},t=o();this.keyword="",t.getCurrentUser().then((e=>{})),this.workflowEnabled=!!e.workflowEnabled,this.$nextTick((()=>{this.workflowEnabled&&(l("updateUsualList",(e=>{this.getUsualList()})),l("refresh",(()=>{this.list=[],this.current=0,this.mescroll.resetUpScroll()})),this.setFlowTodoCount(),this.getPaymentMethodOptions())}))},setFlowTodoCount(){I({flowCirculateType:[],flowDoneType:[],toBeReviewedType:[]}).then((e=>{this.count=e.data.toBeReviewed||0}))},openPage(e){e&&a({url:e})},upCallback(e){this.$nextTick((()=>{this.getUsualList()}));let t={currentPage:e.num,pageSize:e.size,keyword:this.keyword,category:0==this.category?"":this.category,flowType:0};this.loading=!1,v(t,{load:1==e.num}).then((t=>{let s=t.data.list||[];this.mescroll.endSuccess(s.length),1==e.num&&(this.list=[]);const o=s.map((e=>({show:!1,...e})));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)},change(e){this.current=e,this.fullName=this.categoryList[e].fullName,this.category=this.categoryList[e].id||"",this.list=[],this.mescroll.resetUpScroll()},getUsualList(){M(1).then((e=>{this.usualList=e.data.list.map((e=>{const t=e.objectData?JSON.parse(e.objectData):{};return{...e,...t}}))}))},getPaymentMethodOptions(){z.getDictionaryData({sort:"WorkFlowCategory"}).then((e=>{this.categoryList=[{fullName:"全部流程",id:""},...e||[]],this.pageLoading=!1,i()}))},moreApp(){a({url:"/pages/workFlow/allApp/index?categoryList="+encodeURIComponent(JSON.stringify(this.categoryList))})},confirm(e){this.activeFlow=this.templateList[e[0].index],this.Jump()},Jump(){const e={id:"",flowId:this.activeFlow.id,opType:"-1"};a({url:"/pages/workFlow/flowBefore/index?config="+this.jnpf.base64.encode(JSON.stringify(e))})},handelClick(e,t){this.enCode=e.enCode,E(e.id,"1").then((e=>{this.templateList=e.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("流程不存在")}))}}},[["render",function(e,t,s,o,l,a){const i=F(n("u-image"),j),I=b,v=p,E=F(n("u-badge"),T),D=F(n("u-search"),N),M=F(n("u-tabs"),U),O=F(n("mescroll-body"),S),P=c("MultSelect");return r((f(),m(v,{class:"workFlow-v"},{default:d((()=>[r(h(v,{class:"workFlow-nodata"},{default:d((()=>[h(v,{class:"u-flex-col",style:{"align-items":"center"}},{default:d((()=>[h(i,{width:"280rpx",height:"280rpx",src:l.emptyImg},null,8,["src"]),h(I,{class:"u-m-t-20",style:{color:"#909399"}},{default:d((()=>[g("该应用协同办公未开启")])),_:1})])),_:1})])),_:1},512),[[u,!l.workflowEnabled]]),r(h(v,{class:"search-box_sticky"},{default:d((()=>[h(v,{class:"head-tabs u-flex"},{default:d((()=>[h(v,{class:"head-tabs-item",onClick:t[0]||(t[0]=e=>a.openPage("/pages/workFlow/flowLaunch/index"))},{default:d((()=>[h(I,{class:"icon-ym icon-ym-flowLaunch-app u-m-r-4 icon-style"}),h(I,null,{default:d((()=>[g("我发起的")])),_:1})])),_:1}),h(v,{class:"head-tabs-item",onClick:t[1]||(t[1]=e=>a.openPage("/pages/workFlow/flowTodo/index"))},{default:d((()=>[h(I,{class:"icon-ym icon-ym-flowTodo-app u-m-r-4 icon-style"}),h(I,null,{default:d((()=>[g("待办事宜")])),_:1}),h(E,{type:"error",class:"badge",count:l.count,absolute:!0,offset:l.offset},null,8,["count","offset"])])),_:1}),h(v,{class:"head-tabs-item",onClick:t[2]||(t[2]=e=>a.openPage("/pages/workFlow/flowDone/index"))},{default:d((()=>[h(I,{class:"icon-ym icon-ym-flowDone-app u-m-r-4 icon-style"}),h(I,null,{default:d((()=>[g("已办事宜")])),_:1})])),_:1}),h(v,{class:"head-tabs-item",onClick:t[3]||(t[3]=e=>a.openPage("/pages/workFlow/flowCopy/index"))},{default:d((()=>[h(I,{class:"icon-ym icon-ym-flowCopy-app u-m-r-4 icon-style"}),h(I,null,{default:d((()=>[g("抄送我的")])),_:1})])),_:1}),h(v,{class:"head-tabs-item",onClick:t[4]||(t[4]=e=>a.openPage("/pages/workFlow/entrust/index"))},{default:d((()=>[h(I,{class:"icon-ym icon-ym-flowEntrust-app u-m-r-4 icon-style"}),h(I,null,{default:d((()=>[g("流程委托")])),_:1})])),_:1})])),_:1}),h(v,{class:"search-box"},{default:d((()=>[h(D,{placeholder:"请输入",modelValue:l.keyword,"onUpdate:modelValue":t[5]||(t[5]=e=>l.keyword=e),height:"72","show-action":!1,onChange:a.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["modelValue","onChange"])])),_:1})])),_:1},512),[[u,l.workflowEnabled]]),r(h(O,{ref:"mescrollRef",onDown:e.downCallback,down:l.downOption,sticky:!1,onUp:a.upCallback,up:l.upOption,bottombar:!1,style:{"min-height":"100%"},onInit:e.mescrollInit},{default:d((()=>[h(v,{class:"common-block"},{default:d((()=>[h(v,{class:"caption"},{default:d((()=>[g("常用表单")])),_:1}),h(v,{class:"u-flex u-flex-wrap"},{default:d((()=>[(f(!0),w(k,null,y(l.usualList,((e,t)=>(f(),m(v,{class:"item u-flex-col u-col-center",key:t,onClick:t=>a.handelClick(e,1)},{default:d((()=>[h(I,{class:x(["u-font-40 item-icon",e.icon]),style:L({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),h(I,{class:"u-font-24 u-line-1 item-text"},{default:d((()=>[g(_(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128)),h(v,{class:"item u-flex-col u-col-center",onClick:a.moreApp},{default:d((()=>[h(I,{class:"u-font-40 item-icon more"},{default:d((()=>[g("+")])),_:1}),h(I,{class:"u-font-24 u-line-1 item-text"},{default:d((()=>[g("添加")])),_:1})])),_:1},8,["onClick"])])),_:1})])),_:1}),h(M,{list:l.categoryList,current:l.current,onChange:a.change,"is-scroll":!0,name:"fullName"},null,8,["list","current","onChange"]),h(v,{class:"workFlow-list"},{default:d((()=>[h(v,{class:"part"},{default:d((()=>[l.list.length>=1?(f(),m(v,{key:0,class:"caption u-line-1"},{default:d((()=>[g(_(0===l.current?"全部流程":l.fullName),1)])),_:1})):C("",!0),h(v,{class:"u-flex u-flex-wrap"},{default:d((()=>[(f(!0),w(k,null,y(l.list,((e,t)=>(f(),m(v,{class:"item u-flex-col u-col-center",key:t,onClick:t=>a.handelClick(e)},{default:d((()=>[h(I,{class:x(["u-font-40 item-icon",e.icon]),style:L({background:e.iconBackground||"#008cff"})},null,8,["class","style"]),h(I,{class:"u-font-24 u-line-1 item-text"},{default:d((()=>[g(_(e.fullName),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1})])),_:1},8,["onDown","down","onUp","up","onInit"]),[[u,l.workflowEnabled]]),h(P,{show:l.show,list:l.selector,onConfirm:a.confirm,onClose:t[6]||(t[6]=e=>l.show=!1),isFlow:""},null,8,["show","list","onConfirm"])])),_:1},512)),[[u,!l.pageLoading]])}],["__scopeId","data-v-cfe4a6ac"]]);export{V as default};