import{g as t,a5 as s,a2 as e,o as a,X as o,p as i,w as r,q as n,t as l,v as u,B as c}from"./index-P0fyQ2Em.js";import{_ as h}from"./u-search.CSVnMmHg.js";import{r as m}from"./uni-app.es.DOtS5Ldl.js";import{_ as d}from"./u-tabs.DEel8MQB.js";import{_ as p}from"./u-subsection.B-kRzElF.js";import{_ as f}from"./mescroll-body.CszwJbBy.js";import{r as g}from"./resources.DEPsJg7u.js";import{M as y}from"./mescroll-mixins.C2YUWJKd.js";import{g as w,a as b,f as k}from"./flowList.DDRTPvPd.js";import{_ as L}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.wXcRZHbn.js";import"./u-badge.CWPuZ-w1.js";import"./renderjs.BXp1P0Wg.js";import"./index.CIHFpOa3.js";const C={1:[{name:"全部",status:""},{name:"协办",status:"7"},{name:"退回",status:"5"},{name:"超时",status:"-2"}],2:[{name:"全部",status:""},{name:"协办",status:"7"},{name:"退回",status:"5"},{name:"超时",status:"-2"}],3:[{name:"全部",status:""},{name:"待提交",status:"0"},{name:"进行中",status:"1"},{name:"已完成",status:"2"}],4:[{name:"全部",status:""},{name:"同意",status:"1"},{name:"拒绝",status:"2"},{name:"转审",status:"3"},{name:"加签",status:"4"},{name:"退回",status:"5"}],5:[{name:"全部",status:""},{name:"已读",status:"1"},{name:"未读",status:"0"}]};const v=L({components:{flowlist:k},mixins:[y,{data:()=>({mescrollTop:206,statusList:[],tabsList:[{fullName:"在办",category:"2",key:2,enCode:"workFlow.flowDoing"},{fullName:"发起",category:null,key:3,enCode:"workFlow.flowLaunch"},{fullName:"已办",category:"3",key:4,enCode:"workFlow.flowDone"},{fullName:"抄送",category:"4",key:5,enCode:"workFlow.flowCirculate"}],current:0,subsectionIndex:0,status:"",sysConfigInfo:{},menuList:[]}),watch:{current:{handler(t){if(1==this.sysConfigInfo.flowSign&&0==t)return this.statusList=[],void(this.mescrollTop=103);this.statusList=C[this.tabsList[t].key],this.mescrollTop=161,this.category=this.tabsList[this.current].category},immediate:!0,deep:!0}},onLoad(s){this.config=(null==s?void 0:s.data)&&JSON.parse(decodeURIComponent(null==s?void 0:s.data)),this.sysConfigInfo=t("sysConfigInfo")||{},this.addTabList(),(null==s?void 0:s.data)&&this.fromPortal()},methods:{addTabList(){var s;[{key:"flowTodo",tab:{fullName:"待办",category:"1",key:1,enCode:"workFlow.flowTodo"}},{key:"flowSign",tab:{fullName:"待签",category:"0",key:0,enCode:"workFlow.flowToSign"}}].forEach((t=>{if(1===this.sysConfigInfo[t.key])return this.tabsList.unshift(t.tab)})),this.menuList=t("menuList");let e=this.menuList.filter((t=>"workFlow"===t.enCode));if(!e.length)return;let a=null==(s=e[0])?void 0:s.children;this.tabsList=this.tabsList.filter((t=>a.some((s=>s.enCode===t.enCode))))},fromPortal(){let t=this.tabsList.findIndex((t=>t.key===this.config.tabIndex)),s=this.tabsList[t];this.current=t,this.category=(null==s?void 0:s.category)||null,this.resetUpScroll()},change(t){let s=this.tabsList[t];this.current=t,this.status="",this.keyword="",this.subsectionIndex=0,this.category=(null==s?void 0:s.category)||null,this.resetUpScroll()},subsection(t){let s=this.statusList[t];this.status=s.status,this.subsectionIndex=t,this.resetUpScroll()},resetUpScroll(){this.$nextTick((()=>{this.list=[],this.mescroll.resetUpScroll()}))},upCallback(t){(this.category?w:b)({currentPage:t.num,pageSize:t.size,keyword:this.keyword,category:this.tabsList[this.current].category,status:this.status},{load:1==t.num}).then((s=>{this.mescroll.endSuccess(s.data.list.length),1==t.num&&(this.list=[]);const e=s.data.list.map((t=>({flowStatus:this.getFlowStatus(t.status),opType:this.setOpType(t.status),swipeAction:this.swipeAction(t.status),...t})));this.list=this.list.concat(e)})).catch((()=>{this.mescroll.endErr()}))},swipeAction(t){let s=!0;return 3!==this.tabsList[this.current].key||this.category||"0"!=t&&"9"!=t||(s=!1),s},setOpType(t){return 3==this.tabsList[this.current].key?"0"==t||"9"==t||"8"==t?"-1":0:0==this.tabsList[this.current].key?1:1==this.tabsList[this.current].key?2:2==this.tabsList[this.current].key?3:4==this.tabsList[this.current].key?4:5==this.tabsList[this.current].key?5:void 0}}}],data(){return{activeItemStyle:{backgroundColor:"#fff"},keyword:"",category:"0",list:[],downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:20,time:null},empty:{use:!0,icon:g.message.nodata,tip:this.$t("common.noData"),fixed:!0,top:"300rpx"},textNoMore:this.$t("app.apply.noMoreData")}}},onShow(){s("operate"),e("refresh",(()=>{this.list=[],this.mescroll.resetUpScroll()}))},onUnload(){s("refresh")},methods:{getFlowStatus(t){let s;return"0"==this.category&&(s=g.status.signfor),"1"!=this.category&&"2"!=this.category||("1"==t&&(s=g.status.circulation),"5"==t&&(s=g.status.back),"7"==t&&(s=g.status.assist),"3"==t&&(s=g.status.transfer),"6"==t&&(s=g.status.recall),"8"==t&&(s=g.status.revoking),"2"==t&&(s=g.status.addSign),"4"==t&&(s=g.status.assign),"9"==t&&(s=g.status.transfer2)),this.category||("0"==t&&(s=g.status.draft),"1"==t&&(s=g.status.doing),"2"==t&&(s=g.status.adopt),"3"==t&&(s=g.status.reject),"4"==t&&(s=g.status.cancel),"5"==t&&(s=g.status.pause),"6"==t&&(s=g.status.revoking),"7"==t&&(s=g.status.revoke),"8"==t&&(s=g.status.back),"9"==t&&(s=g.status.recall)),"3"==this.category&&("7"==t&&(s=g.status.transfer),"1"==t&&(s=g.status.agree),"0"==t&&(s=g.status.refuse),"5"==t&&(s=g.status.addSign),"3"==t&&(s=g.status.return),"18"==t&&(s=g.status.transfer2)),"4"==this.category&&("1"==t&&(s=g.status.doing),"2"==t&&(s=g.status.adopt),"3"==t&&(s=g.status.reject),"8"==t&&(s=g.status.back)),s},search(){this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout((()=>{this.list=[],this.mescroll.resetUpScroll()}),300)}}},[["render",function(t,s,e,g,y,w){const b=m(a("u-search"),h),k=n,L=m(a("u-tabs"),d),C=m(a("u-subsection"),p),v=o("flowlist"),S=m(a("mescroll-body"),f);return l(),i(k,{class:"flow-v"},{default:r((()=>[u(k,{class:"notice-warp"},{default:r((()=>[u(k,{class:"search-box"},{default:r((()=>[u(b,{placeholder:t.$t("app.apply.pleaseKeyword"),modelValue:y.keyword,"onUpdate:modelValue":s[0]||(s[0]=t=>y.keyword=t),height:"72","show-action":!1,onChange:w.search,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1}),u(k,{class:"flow-tabs"},{default:r((()=>[u(L,{ref:"tabs",list:t.tabsList,"active-color":"#0177FF","inactive-color":"#303133","font-size":"30",modelValue:t.current,"onUpdate:modelValue":s[1]||(s[1]=s=>t.current=s),name:"fullName",onChange:t.change,height:"80","is-scroll":!1},null,8,["list","modelValue","onChange"])])),_:1}),t.statusList.length?(l(),i(k,{key:0,class:"flow-status-tabs"},{default:r((()=>[u(C,{list:t.statusList,current:t.subsectionIndex,name:"name","active-color":"#2979FF","inactive-color":"#999999","bg-color":"#F2F3F7","font-size":"24",bold:!1,onChange:t.subsection},null,8,["list","current","onChange"])])),_:1})):c("",!0)])),_:1}),u(S,{ref:"mescrollRef",onInit:t.mescrollInit,onDown:t.downCallback,onUp:t.upCallback,down:y.downOption,up:y.upOption,top:t.mescrollTop},{default:r((()=>[u(v,{list:y.list,swipeAction:3!=t.current,category:y.category},null,8,["list","swipeAction","category"])])),_:1},8,["onInit","onDown","onUp","down","up","top"])])),_:1})}],["__scopeId","data-v-3455b324"]]);export{v as default};