import{af as e,n as t,a4 as s,c as o,M as a,$ as i,U as l,A as n,o as r,d as f,w as d,E as c,V as m,t as p,e as h,B as u,C as g,D as w,F as y,H as T,G as b,i as k,I,a8 as v,f as x,a3 as C,h as L}from"./index-Bvn9PO3M.js";import{_ as S}from"./u-tabs.BJmnpx9G.js";import{r as _}from"./uni-app.es.Dfh5xEru.js";import{_ as j}from"./u-sticky.A1rB_B7Z.js";import{_ as U}from"./u-avatar.O3Cb3bnK.js";import{d as N}from"./index.BajiD5Jn.js";import{_ as D}from"./u-divider.D0oYl2y4.js";import{_ as F}from"./mescroll-body.anmwxhle.js";import{C as R,f as A,r as O,R as B,e as J,i as E,U as $,a as V}from"./emoji.B7tiQMPz.js";import{F as H,S as M,C as q,T as P,a as z,A as W,d as G}from"./flowBefore.DY7G9SqD.js";import{P as X,R as Z}from"./flowLaunch.D1vrPNF8.js";import{b as K,c as Q,d as Y}from"./flowEngine.Ds4PeusT.js";import{r as ee}from"./resources.DipqUmnN.js";import{u as te}from"./index.BSBBxDjy.js";import{c as se}from"./form.DDmh_wiz.js";import{M as oe}from"./mescroll-mixins.C4va71zV.js";import{_ as ae}from"./_plugin-vue_export-helper.BCo6x5W8.js";const ie=ae({mixins:[oe],components:{CandidateForm:R,userSelect:te,childForm:se,flowInfo:A,records:O,RecordSummary:B},data:()=>({emojiList:J,downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:20,time:null},empty:{use:!0,icon:ee.message.nodata,tip:"暂无数据",fixed:!0,top:"300rpx"},textNoMore:"没有更多数据"},isComment:!1,show:!1,config:{opType:"-1"},currentView:"",formData:{},flowTaskInfo:{},flowTaskNodeList:[],recordList:[],properties:{},endTime:0,tabIndex:0,tabBars:[{name:"表单信息",id:0},{name:"流程信息",id:1},{name:"流转记录",id:2}],tablist:[],flowStatus:"",stepIndex:0,userSelectShow:!1,btnLoading:!1,eventType:"",commentList:[],processId:"",selectShow:!1,candidateList:[],isSummary:!1,summaryType:0,tabsName:"表单信息",flowUrgent:1,flowUrgentList:[{label:"普通",color:"#409EFF",bgColor:"#e5f3fe",value:1,extra:"0"},{label:"重要",color:"#E6A23C",bgColor:"#fef6e5",value:2,extra:"1"},{label:"紧急",color:"#F56C6C",bgColor:"#fee5e5",value:3,extra:"2"}],selectflowUrgent:{extra:"0",label:"普通",value:1},flowTemplateJson:[]}),computed:{baseURL(){return this.define.baseURL}},methods:{getTabBars(){let e=this.tabBars;this.isSummary&&e.push({name:"审批汇总",id:3}),this.isComment&&e.push({name:"流程评论",id:4}),this.tablist=e},upCallback(e){let t={currentPage:e.num,pageSize:e.size,sort:"desc",sidx:"",taskId:this.processId};K(t,{load:1==e.num}).then((t=>{this.mescroll.endSuccess(t.data.list.length),1==e.num&&(this.commentList=[]);const s=t.data.list.map((e=>(e.image=JSON.parse(e.image),e.file=JSON.parse(e.file),e.text=this.replaceEmoji(e.text),e)));this.commentList=this.commentList.concat(s)})).catch((()=>{this.mescroll.endErr()}))},tabChange(e){this.tabIndex=e,this.tabsName=this.tabBars[e].name},replaceEmoji(e){if(!e)return"";let t=e.replace(/\[([^(\]|\[)]*)\]/g,(e=>"jnpfjnpf"+e+"jnpfjnpf")).split(/jnpfjnpfjnpfjnpf|jnpfjnpf/g);t=t.filter((e=>e));let s=[];for(let o=0;oE[e.replace(".","")],openReplyText(t){e({content:t,showCancel:!1,success:e=>{}})},handleReply(e,t){this.goWriteComment(e)},goWriteComment(e){let s={taskId:this.processId};e&&(s.replyId=e),s=encodeURIComponent(JSON.stringify(s)),t({url:"/pages/workFlow/comment/index?data="+s})},jumpComment(){this.goWriteComment()},addComment(e){e.taskId=this.processId,Q(e).then((e=>{this.mescroll.resetUpScroll()}))},delComment(t,s){e({title:"提示",content:"确定删除该评论?",success:e=>{e.confirm&&Y(t).then((e=>{this.commentList.splice(s,1),this.mescroll.resetUpScroll()}))}})},init(e){this.tabIndex=0,this.config=e,this.config.origin="scan",this.taskId=this.config.id,this.getBeforeInfo(this.config)},getBeforeInfo(e){this.formData.flowId=e.flowId,this.loading=!0;const t={taskNodeId:e.taskNodeId,taskOperatorId:e.taskId,flowId:e.flowId};H(e.id||0,t).then((t=>{e.formData=t.data.formData||{},this.flowTaskInfo=t.data.flowTaskInfo||{},this.flowFormInfo=t.data.flowFormInfo||{},e.formType=this.flowFormInfo.formType,this.config.formType=this.flowFormInfo.formType,this.config.formEnCode=this.flowFormInfo.enCode,this.loading=!1,this.flowTemplateInfo=t.data.flowTemplateInfo||{};const i=this.flowTemplateInfo.flowTemplateJson?JSON.parse(this.flowTemplateInfo.flowTemplateJson):null;e.flowTemplateJson=i,this.flowTemplateJson=i,this.isSummary=this.flowTemplateJson.properties.isSummary,this.isComment=this.flowTemplateJson.properties.isComment,this.getTabBars(),this.summaryType=this.flowTemplateJson.properties.summaryType,this.flowTaskNodeList=t.data.flowTaskNodeList||[],this.recordList=(t.data.flowTaskOperatorRecordList||[]).reverse();for(let e=0;e{var e={value:this.flowUrgent,extra:"0",label:"普通"};return this.flowUrgentList.forEach(((t,s)=>{t.value==this.flowUrgent&&(e.extra=s,e.label=t.label)})),e})(),this.flowTaskNodeList.length){for(let e=0;e{if(Array.isArray(e)&&e.forEach((e=>s(e))),e.nodeId===t.nodeCode)return e.id=t.id,0==t.type&&(e.state="state-past"),1==t.type&&(e.state="state-curr"),void("approver"!==t.nodeType&&"start"!==t.nodeType&&"subFlow"!==t.nodeType||(e.content=t.userName));e.conditionNodes&&Array.isArray(e.conditionNodes)&&s(e.conditionNodes),e.childNode&&s(e.childNode)};s(i)}this.flowTemplateJson=i}switch(1!=e.opType&&"-1"!=e.opType&&(e.readonly=!0),e.formOperates=[],0==e.opType?this.flowTemplateJson&&this.flowTemplateJson.properties&&this.flowTemplateJson.properties.formOperates&&(e.formOperates=this.flowTemplateJson.properties.formOperates||[]):e.formOperates=t.data.formOperates||[],this.config.status){case 0:this.flowStatus=ee.status.submit;break;case 1:default:this.flowStatus=ee.status.review;break;case 2:this.flowStatus=ee.status.reviewAdopt;break;case 3:this.flowStatus=ee.status.reviewRefuse;break;case 4:this.flowStatus=ee.status.reviewUndo;break;case 5:this.flowStatus=ee.status.reviewStop}setTimeout((()=>{this.$nextTick((()=>{this.$refs.child&&this.$refs.child.$refs.form||o({title:"暂无此流程表单",icon:"none",complete:()=>{setTimeout((()=>{a()}),1500)}})}))}),100)}))},eventLauncher(e){this.$refs.child&&this.$refs.child.$refs.form&&this.$refs.child.$refs.form.submit(e)},eventReceiver(e,t){return this.formData=e,this.eventType=t,"save"===t||"submit"===t?this.submitOrSave(t):"saveAudit"===t?this.saveAudit():"audit"===t?this.operate("audit",this.properties.auditBtnText):"reject"===t?this.operate("reject",this.properties.rejectBtnText):void 0},saveAudit(){this.btnLoading=!0,M(this.config.taskId,this.formData).then((e=>{o({title:e.msg,complete:()=>{setTimeout((()=>{this.btnLoading=!1,a()}),1500)}})})).catch((()=>{this.btnLoading=!1}))},submitCandidate(t){this.selectShow=!1,t?this.handleRequest(t):e({title:"提示",content:"您确定要提交当前流程吗?",success:e=>{this.handleRequest()}})},submitOrSave(t){if(this.formData.status="submit"===t?0:1,"save"===t)return this.handleRequest();q(0,{formData:this.formData}).then((t=>{let s=t.data;Array.isArray(s)&&s.length?(this.candidateList=t.data,this.selectShow=!0):e({title:"提示",content:"您确定要提交当前流程吗?",success:e=>{e.confirm&&this.handleRequest()}})})).catch((()=>{this.selectShow=!1}))},handleRequest(e){e&&(this.formData.candidateList=e),"save"===this.eventType&&(this.btnLoading=!0),(this.formData.id?$:V)(this.config.enCode,this.formData).then((e=>{o({title:e.msg,complete:()=>{setTimeout((()=>{this.formData.id&&i("refresh"),this.btnLoading=!1,a()}),1500)}})})).catch((()=>{this.btnLoading=!1}))},handlePress(){e({title:"提示",content:"此操作将提示该节点尽快处理",success:e=>{e.confirm&&X(this.config.id).then((e=>{this.$u.toast(e.msg)}))}})},operate(e,s){let o={eventType:e,title:"确认"+s.replace(/\s+/g,"")};"audit"!==e&&"reject"!==e||(o={...o,hasSign:this.properties.hasSign,hasFreeApprover:this.properties.hasFreeApprover,isCustomCopy:this.properties.isCustomCopy,formData:this.formData,taskId:this.config.taskId,eventType:e}),t({url:"/pages/workFlow/operate/index?config="+encodeURIComponent(JSON.stringify(o))})},handleTransfer(e){P(this.config.taskId,{freeApproverUserId:e}).then((e=>{this.toastAndBack(e.msg,!0)}))},revokeHandle(e){Z(this.config.id,{handleOpinion:e.handleOpinion}).then((e=>{this.toastAndBack(e.msg,!0)}))},recallHandle(e){z(this.config.taskId,{handleOpinion:e.handleOpinion}).then((e=>{this.toastAndBack(e.msg,!0)}))},auditHandle(e){this.handleApproval(e)},rejectHandle(e){this.handleApproval(e)},handleApproval(e){const t={...e,formData:this.formData,enCode:this.config.enCode};("audit"===e.eventType?W:G)(this.config.taskId,t).then((e=>{this.toastAndBack(e.msg,!0)}))},setBtnLoad(e){this.btnLoading=!!e},toastAndBack(e,t){o({title:e,complete:()=>{setTimeout((()=>{t&&i("refresh"),a()}),1500)}})}}},[["render",function(e,t,s,o,a,i){const R=l("childForm"),A=l("candidate-form"),O=k,B=_(n("u-tabs"),S),J=_(n("u-sticky"),j),E=I,$=l("flowInfo"),V=l("records"),H=l("RecordSummary"),M=_(n("u-avatar"),U),q=L,P=_(n("JnpfUploadImg"),N),z=_(n("u-divider"),D),W=v,G=_(n("mescroll-body"),F);return r(),f(O,{class:"flowBefore-v"},{default:d((()=>[c("div",{class:"flow-urgent-value",style:m({"background-color":a.flowUrgentList[a.selectflowUrgent.extra].bgColor}),onClick:t[0]||(t[0]=(...t)=>e.handleShowSelect&&e.handleShowSelect(...t))},[c("span",{style:m({color:a.flowUrgentList[a.selectflowUrgent.extra].color})},p(a.selectflowUrgent.label),5)],4),"-1"===a.config.opType?(r(),f(O,{key:0,class:"flowBefore-box"},{default:d((()=>[h(O,{class:"scroll-v","scroll-y":""},{default:d((()=>[h(R,{ref:"child",config:a.config,onEventReceiver:i.eventReceiver},null,8,["config","onEventReceiver"]),h(A,{modelValue:a.selectShow,"onUpdate:modelValue":t[1]||(t[1]=e=>a.selectShow=e),candidateList:a.candidateList,taskId:a.config.taskId,formData:a.formData,onSubmitCandidate:i.submitCandidate,ref:"candidateForm"},null,8,["modelValue","candidateList","taskId","formData","onSubmitCandidate"])])),_:1})])),_:1})):(r(),f(O,{key:1,class:"flowBefore-box"},{default:d((()=>[h(O,{class:"u-border-bottom"},{default:d((()=>[h(J,null,{default:d((()=>[h(B,{list:a.tablist,"is-scroll":!0,current:a.tabIndex,onChange:i.tabChange,height:"100"},null,8,["list","current","onChange"])])),_:1})])),_:1}),c("template",null,[u(h(O,null,{default:d((()=>[h(O,null,{default:d((()=>[0==a.config.opType||4==a.config.opType?(r(),f(O,{key:0,class:"flowStatus"},{default:d((()=>[h(E,{src:a.flowStatus,mode:"widthFix"},null,8,["src"])])),_:1})):w("",!0),h(R,{ref:"child",config:a.config,onEventReceiver:i.eventReceiver,onSetBtnLoad:i.setBtnLoad},null,8,["config","onEventReceiver","onSetBtnLoad"]),h(A,{modelValue:a.selectShow,"onUpdate:modelValue":t[2]||(t[2]=e=>a.selectShow=e),candidateList:a.candidateList,taskId:a.config.taskId,formData:a.formData,onSubmitCandidate:i.submitCandidate,ref:"candidateForm"},null,8,["modelValue","candidateList","taskId","formData","onSubmitCandidate"])])),_:1})])),_:1},512),[[g,"表单信息"===a.tabsName]]),"流程信息"===a.tabsName?(r(),f(O,{key:0,class:"nodeList-v"},{default:d((()=>[h($,{options:a.flowTemplateJson},null,8,["options"])])),_:1})):w("",!0),"流转记录"===a.tabsName?(r(),f(O,{key:1,class:"record-v"},{default:d((()=>[h(V,{options:a.recordList,endTime:a.endTime},null,8,["options","endTime"])])),_:1})):w("",!0),"审批汇总"===a.tabsName?(r(),f(O,{key:2,class:"record2-v"},{default:d((()=>[h(H,{processId:a.processId,ref:"recordSummary",summaryType:a.summaryType},null,8,["processId","summaryType"])])),_:1})):w("",!0),"流程评论"===a.tabsName?(r(),f(O,{key:3},{default:d((()=>[h(O,{class:"record-v"},{default:d((()=>[h(G,{ref:"mescrollRef",onInit:e.mescrollInit,onDown:e.downCallback,onUp:i.upCallback,sticky:!1,down:a.downOption,up:a.upOption,bottombar:!1},{default:d((()=>[h(O,{class:"discuss_box"},{default:d((()=>[h(W,{"scroll-y":"true",style:{height:"100%"}},{default:d((()=>[(r(!0),y(b,null,T(a.commentList,((t,s)=>(r(),f(O,{class:"u-flex-col discuss_list",key:s},{default:d((()=>[h(O,{class:"u-flex discuss_txt"},{default:d((()=>[h(O,{class:"discuss_txt_left u-flex"},{default:d((()=>[h(M,{src:i.baseURL+t.creatorUserHeadIcon},null,8,["src"]),c("span",{class:"uName"},[c("span",{class:"comment-header-color"},p(t.creatorUser),1),t.replyUser?(r(),y("span",{key:0},[c("span",{class:"replyText"},"回复"),c("span",{class:"replyText comment-content-color"},p(t.replyUser),1),c("span",{class:"replyText comment-header-color"},[c("span",{class:"icon-ym icon-ym-chat",onClick:e=>i.openReplyText(t.replyText)},null,8,["onClick"])])])):w("",!0)])])),_:2},1024)])),_:2},1024),h(O,{class:"u-flex-col discuss_content"},{default:d((()=>[h(O,{class:"msg-text"},{default:d((()=>[(r(!0),y(b,null,T(t.text,((e,t)=>(r(),f(O,{key:t},{default:d((()=>["text"==e.type?(r(),f(q,{key:0,class:"txt comment-content-color"},{default:d((()=>[x(p(e.content),1)])),_:2},1024)):w("",!0),"emjio"==e.type?(r(),f(E,{key:1,class:"msg-text-emoji",src:e.content},null,8,["src"])):w("",!0)])),_:2},1024)))),128))])),_:2},1024),2!=t.isDel?(r(),f(P,{key:0,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,disabled:"",detailed:"",align:"left"},null,8,["modelValue","onUpdate:modelValue"])):w("",!0),2!=t.isDel?(r(!0),y(b,{key:1},T(t.file,((t,s)=>(r(),f(O,{key:s,class:"jnpf-file-item u-type-primary u-flex u-line-1",onClick:s=>e.openFile(t)},{default:d((()=>[h(O,{class:"u-line-1",style:{"margin-bottom":"10rpx"}},{default:d((()=>[x(p(t.name),1)])),_:2},1024)])),_:2},1032,["onClick"])))),128)):w("",!0)])),_:2},1024),h(O,{class:"u-flex discuss_txt time_button"},{default:d((()=>[h(q,{class:"discuss_txt_left u-flex comment-creator-time"},{default:d((()=>[x(p(e.$u.timeFormat(t.creatorTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:2},1024),h(O,null,{default:d((()=>[1==t.isDel?(r(),f(q,{key:0,class:"del",onClick:C((e=>i.delComment(t.id,s)),["stop"])},{default:d((()=>[x("删除")])),_:2},1032,["onClick"])):w("",!0)])),_:2},1024)])),_:2},1024),s!=a.commentList.length-1?(r(),f(z,{key:0,"half-width":"100%","margin-top":32,"margin-bottom":32,"use-slot":!1})):w("",!0)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1},8,["onInit","onDown","onUp","down","up"])])),_:1})])),_:1})):w("",!0)])])),_:1}))])),_:1})}],["__scopeId","data-v-fca95ccc"]]);export{ie as F};