import{g as t,a5 as o,a2 as e,n as i,a as s,c as r,K as n,X as a,o as l,p as m,w as f,q as p,t as d,C as h,Q as g,y as c,v as u,B as j}from"./index-P0fyQ2Em.js";import{_ as L}from"./u-select.B1D-PP_I.js";import{r as w}from"./uni-app.es.DOtS5Ldl.js";import{F as I}from"./flowBefore.-kiV42CS.js";import{g as v}from"./visualDev.B0fuvtpd.js";import{c as x}from"./flowEngine.Ke7vpfzj.js";import{c as b}from"./form.D2PjL320.js";import{f as y}from"./flowBtn.BSp3ZwA5.js";import{R as C}from"./index.9Bg6bWZE.js";import{_ as T}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-popup.CXrq2y3n.js";import"./u-icon.wXcRZHbn.js";import"./index.BEyjEu29.js";import"./index.D5H39cMc.js";import"./u-divider.BoeCb7vx.js";import"./u-line.D-FzmOwL.js";import"./u-upload.Btn0UtQx.js";import"./uni-icons.RJ8Vh9KU.js";import"./u-input.Cp2bygnN.js";import"./emitter.DrjJCwnj.js";import"./index.C9raOSI0.js";import"./u-search.CSVnMmHg.js";import"./u-checkbox.Cy_cnskM.js";import"./u-checkbox-group.zSC_g3m3.js";import"./u-radio-group.CbnO1TOv.js";import"./index.BuZ8YmVY.js";import"./resources.DEPsJg7u.js";import"./u-button.Chh1-6a-.js";import"./mp-html.DI6DI7Ml.js";import"./u-form.B1LWETT2.js";import"./u-tabs.DEel8MQB.js";import"./u-badge.CWPuZ-w1.js";import"./index.DsvBnwWf.js";import"./base.DOXur1tF.js";import"./index.Du-JSu8j.js";import"./index.PS-rWSqI.js";import"./index.BMdHwtjY.js";import"./u-loading.D5Tc00lz.js";import"./index.CIb_-r5F.js";import"./u-tag.BmeG4z_q.js";import"./ly-tree.DZ8MU_HY.js";import"./index.vGVmWABQ.js";import"./index.BLChm46K.js";import"./lsj-upload.CSOZr0lY.js";import"./index.-5h2Pj7y.js";import"./index.D2KRRdBj.js";import"./u-avatar.q3DpmfEb.js";import"./index.lbbLqjbF.js";import"./index.DgjoBC2V.js";import"./u-action-sheet.C0QG6n24.js";import"./index.D-SsN0gl.js";import"./order.BZyuCWTy.js";import"./index.BoqsLhBg.js";import"./u-time-line.q7UXLQNV.js";import"./uni-popup.BLLVDysl.js";import"./useDefineSetting.DqFEhsPu.js";import"./index.Dfxlsegv.js";import"./emoji.DwmieXKz.js";import"./u-subsection.B-kRzElF.js";import"./u-image.RNxpLaRU.js";import"./u-cell-group.C7i7cw4u.js";import"./document.CzYQ9UiF.js";t("sysConfigInfo");const k=T({components:{childForm:b,flowBtn:y,RecordTimeList:C},data:()=>({dataLogList:[],dataLog:!1,childFormKey:+new Date,formLoding:!1,loading:!1,taskInfo:{},btnInfo:[],show:!1,config:{},formData:{},properties:{},btnLoading:!1,commentList:[],title:"",selectflowUrgent:{extra:"0",label:"普通",value:1},showFlowUrgent:!1,defaultValue:[0],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"}],actionList:[],hasComment:!1,progressList:[],rightBtnList:[]}),computed:{baseURL(){return this.define.baseURL},getShowExtraPanel(){var t,o;return this.dataLog&&(null==(o=null==(t=this.config)?void 0:t.formData)?void 0:o.id)||"-1"!=this.config.opType&&!this.loading}},onUnload(){o("comment")},onShow(){e("comment",(t=>{this.commentList=[],this.current=0,this.addComment(t)}))},onLoad(t){this.config=JSON.parse(this.jnpf.base64.decode(t.config)),this.$nextTick((()=>{this.getBeforeInfo(this.config)}))},methods:{addComment(t){t.taskId=this.config.id,x(t).then((t=>{this.$nextTick((()=>{this.$refs.RecordTimeList.change(1)}))}))},handleBtn(t,o={}){"comment".includes(t)&&this.goWriteComment()},goWriteComment(t){let o={taskId:this.config.id};t&&(o.replyId=t),o=encodeURIComponent(JSON.stringify(o)),i({url:"/pages/workFlow/comment/index?data="+o})},getBeforeInfo(){let t=this.config;this.formData.flowId=t.flowId,this.loading=!0;const o={flowId:t.flowId,opType:2==t.opType?3:t.opType};"-1"!=t.opType&&"0"!=t.opType&&(o.operatorId=t.operatorId),I((null==t?void 0:t.taskId)||(null==t?void 0:t.id)||0,o).then((o=>{this.flowInfo=o.data.flowInfo||{},this.properties=o.data.nodeProperties||{},this.formInfo=o.data.formInfo||{},this.taskInfo=o.data.taskInfo||{},this.btnInfo=o.data.btnInfo||[],this.progressList=o.data.progressList||[],t.formOperates=o.data.formOperates||[],t.formType=this.formInfo.type;const e="-1"==t.opType?this.flowInfo.fullName:this.taskInfo.fullName;t.fullName=e,this.title=this.flowInfo.fullName,this.thisStep=this.taskInfo.thisStep||"",0!==t.status&&3!==t.status&&(this.title=this.thisStep?t.fullName+"/"+this.thisStep:t.fullName),t.type=this.flowInfo.type,t.draftData=o.data.draftData||null,t.formData=o.data.formData||{};let i=t.formData.id;t.formEnCode=this.formInfo.enCode,this.recordList=(o.data.recordList||[]).reverse(),t.formConf=this.formInfo.formData,t.formConf&&(this.dataLog=JSON.parse(t.formConf).dataLog,this.dataLog&&this.getOnlineLog(i)),this.hasComment=this.flowInfo.flowNodes.global.hasComment,this.formLoding=!0,s({title:"revoke"===this.config.formEnCode?`${this.flowInfo.fullName}撤销申请`:this.flowInfo.fullName}),t.formRecords&&t.title&&s({title:t.title}),this.flowUrgent=this.taskInfo.flowUrgent||1;this.selectflowUrgent=(()=>{var t={value:this.flowUrgent,extra:"0",label:"普通"};return this.flowUrgentList.forEach(((o,e)=>{o.value==this.flowUrgent&&(t.extra=e,t.label=o.label)})),t})(),"-1"!=t.opType&&"3"!=t.opType&&(t.readonly=!0),t.formOperates=[],0==t.opType?this.properties&&this.properties&&this.properties.formOperates&&(t.formOperates=this.properties.formOperates||[]):t.formOperates=o.data.formOperates||[],setTimeout((()=>{this.$nextTick((()=>{this.$refs.child&&this.$refs.child.$refs.form?this.$refs.child.$refs.form.init(t):r({title:"暂无此流程表单",icon:"none",complete:()=>{setTimeout((()=>{n()}),1500)}})}))}),100),this.loading=!1,this.config=t}))},getOnlineLog(t){let o=this.formInfo.id;v(o,t).then((t=>{let o=t.data.list||[];this.dataLogList=[...o].reverse()}))},initBtnList(){const t=[];this.properties,this.btnInfo,this.hasComment&&"-1"!=this.config.opType&&this.rightBtnList.length&&t.push({id:"comment",text:"评论"}),this.actionList=t},handleShowSelect(){"-1"==this.config.opType&&(this.showFlowUrgent=!0)},seltConfirm(t){this.flowUrgent=t[0].value,this.selectflowUrgent=t[0],this.defaultValue=[this.flowUrgentList.findIndex((o=>o.value===t[0].value))]}}},[["render",function(t,o,e,i,s,r){const n=a("childForm"),I=a("RecordTimeList"),v=p,x=a("flowBtn"),b=w(l("u-select"),L);return d(),m(v,{class:"flowBefore-v"},{default:f((()=>{var e,i,a;return[h("div",{class:"flow-urgent-value",style:g({"background-color":s.flowUrgentList[s.selectflowUrgent.extra].bgColor}),onClick:o[0]||(o[0]=(...t)=>r.handleShowSelect&&r.handleShowSelect(...t))},[h("span",{style:g({color:s.flowUrgentList[s.selectflowUrgent.extra].color})},c(s.selectflowUrgent.label),5)],4),u(v,{class:"flowBefore-box"},{default:f((()=>[u(v,{class:"scroll-v","scroll-y":""},{default:f((()=>{var t,o;return[s.loading?j("",!0):(d(),m(n,{ref:"child",config:s.config,key:s.childFormKey},null,8,["config"])),s.loading?j("",!0):(d(),m(I,{key:1,progressList:s.progressList,taskInfo:s.taskInfo,commentList:s.commentList,taskId:s.config.id,ref:"RecordTimeList",onHandleReply:r.goWriteComment,hasComment:s.hasComment,dataLog:s.dataLog,opType:s.config.opType,formID:null==(o=null==(t=s.config)?void 0:t.formData)?void 0:o.id,dataLogList:s.dataLogList},null,8,["progressList","taskInfo","commentList","taskId","onHandleReply","hasComment","dataLog","opType","formID","dataLogList"]))]})),_:1})])),_:1}),s.formLoding?(d(),m(x,{key:0,actionList:s.actionList,btnInfo:s.btnInfo,opType:s.config.opType,hideSaveBtn:s.config.hideSaveBtn,onHandleBtn:r.handleBtn,btnLoading:s.btnLoading,rightBtnList:s.rightBtnList,saveBtnText:s.properties.saveBtnText,hasComment:s.hasComment,hasSignFor:null==(a=null==(i=null==(e=t.flowInfo)?void 0:e.flowNodes)?void 0:i.global)?void 0:a.hasSignFor},null,8,["actionList","btnInfo","opType","hideSaveBtn","onHandleBtn","btnLoading","rightBtnList","saveBtnText","hasComment","hasSignFor"])):j("",!0),u(b,{list:s.flowUrgentList,modelValue:s.showFlowUrgent,"onUpdate:modelValue":o[1]||(o[1]=t=>s.showFlowUrgent=t),onConfirm:r.seltConfirm,"default-value":s.defaultValue},null,8,["list","modelValue","onConfirm","default-value"])]})),_:1})}],["__scopeId","data-v-6e7bac78"]]);export{k as default};