import{aJ as e,c as t,a as o,K as i,X as s,o as r,t as a,p as n,w as l,C as f,Q as m,y as d,v as p,B as c,D as u,E as h,F as g,q as _,x as y,g as j,s as w}from"./index-P0fyQ2Em.js";import{_ as I}from"./index.BEyjEu29.js";import{r as b}from"./uni-app.es.DOtS5Ldl.js";import{_ as v}from"./u-select.B1D-PP_I.js";import{_ as x}from"./u-icon.wXcRZHbn.js";import{_ as k}from"./u-search.CSVnMmHg.js";import{_ as C}from"./u-avatar.q3DpmfEb.js";import{_ as L}from"./index.BuZ8YmVY.js";import{_ as S}from"./uni-popup.BLLVDysl.js";import{F}from"./flowBefore.-kiV42CS.js";import{c as T}from"./form.D2PjL320.js";import{R as U}from"./index.9Bg6bWZE.js";import{E as D}from"./ErrorForm.0zUEzmhG.js";import{M as E}from"./mescroll-mixins.C2YUWJKd.js";import{_ as V}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{a as P,b as $}from"./visualDev.B0fuvtpd.js";import"./index.D5H39cMc.js";import"./u-popup.CXrq2y3n.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-checkbox.Cy_cnskM.js";import"./u-checkbox-group.zSC_g3m3.js";import"./u-radio-group.CbnO1TOv.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"./index.lbbLqjbF.js";import"./index.DgjoBC2V.js";import"./u-action-sheet.C0QG6n24.js";import"./index.D-SsN0gl.js";import"./resources.DEPsJg7u.js";import"./order.BZyuCWTy.js";import"./u-time-line.q7UXLQNV.js";import"./useDefineSetting.DqFEhsPu.js";import"./index.Dfxlsegv.js";import"./flowEngine.Ke7vpfzj.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";const O=V({name:"scanForm",components:{FlowForm:V({mixins:[E],components:{childForm:T,ErrorForm:D,RecordTimeList:U},data:()=>({childFormKey:+new Date,signUserIdList:[],keyword:"",formLoding:!1,loading:!1,taskInfo:{},btnInfo:[],nodeList:[],show:!1,config:{},formData:{},recordList:[],properties:{},flowStatus:"",commentList:[],processId:"",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"}],hasComment:!1,progressList:[]}),computed:{baseURL(){return this.define.baseURL},getShowExtraPanel(){return"-1"!=this.config.opType&&!this.loading}},methods:{init(e){this.config=e,this.config.origin="scan",this.processId=this.config.id,this.getBeforeInfo(this.config)},handlePreviewImage(o){e({urls:[o],current:o,success:()=>{},fail:()=>{t({title:"预览图片失败",icon:"none"})}})},getBeforeInfo(){let e=this.config;this.formData.flowId=e.flowId,this.loading=!0;const s={flowId:e.flowId,opType:2==e.opType?3:e.opType};"-1"!=e.opType&&"0"!=e.opType&&(s.operatorId=e.operatorId),F((null==e?void 0:e.taskId)||(null==e?void 0:e.id)||0,s).then((s=>{this.flowInfo=s.data.flowInfo||{},this.formInfo=s.data.formInfo||{},this.taskInfo=s.data.taskInfo||{},this.btnInfo=s.data.btnInfo||[],this.progressList=s.data.progressList||[],e.formOperates=s.data.formOperates||[],e.formType=this.formInfo.type;const r="-1"==e.opType?this.flowInfo.fullName:this.taskInfo.fullName;e.fullName=r,this.title=this.flowInfo.fullName,this.thisStep=this.taskInfo.thisStep||"",0!==e.status&&3!==e.status&&(this.title=this.thisStep?e.fullName+"/"+this.thisStep:e.fullName),e.type=this.flowInfo.type,e.draftData=s.data.draftData||null,e.formData=s.data.formData||{},e.formEnCode=this.formInfo.enCode,this.nodeList=s.data.nodeList||[],this.properties=s.data.nodeProperties||{},this.recordList=(s.data.recordList||[]).reverse(),e.formConf=this.formInfo.formData,this.hasComment=this.flowInfo.flowNodes.global.hasComment,this.loading=!1,this.formLoding=!0,o({title:this.flowInfo.fullName}),e.formRecords&&e.title&&o({title:e.title}),this.flowUrgent=this.taskInfo.flowUrgent||1;this.selectflowUrgent=(()=>{var e={value:this.flowUrgent,extra:"0",label:"普通"};return this.flowUrgentList.forEach(((t,o)=>{t.value==this.flowUrgent&&(e.extra=o,e.label=t.label)})),e})(),"-1"!=e.opType&&"3"!=e.opType&&(e.readonly=!0),e.formOperates=[],0==e.opType?this.properties&&this.properties&&this.properties.formOperates&&(e.formOperates=this.properties.formOperates||[]):e.formOperates=s.data.formOperates||[],setTimeout((()=>{this.$nextTick((()=>{this.$refs.child&&this.$refs.child.$refs.form?this.$refs.child.$refs.form.init(e):t({title:"暂无此流程表单",icon:"none",complete:()=>{setTimeout((()=>{i()}),1500)}})}))}),100),this.config=e}))}}},[["render",function(e,t,o,i,j,w){const I=s("childForm"),F=s("ErrorForm"),T=s("RecordTimeList"),U=_,D=b(r("u-select"),v),E=b(r("u-icon"),x),V=b(r("u-search"),k),P=b(r("u-avatar"),C),$=b(r("JnpfEmpty"),L),O=b(r("uni-popup"),S);return a(),n(U,{class:"flowBefore-v"},{default:l((()=>[f("div",{class:"flow-urgent-value",style:m({"background-color":j.flowUrgentList[j.selectflowUrgent.extra].bgColor}),onClick:t[0]||(t[0]=(...t)=>e.handleShowSelect&&e.handleShowSelect(...t))},[f("span",{style:m({color:j.flowUrgentList[j.selectflowUrgent.extra].color})},d(j.selectflowUrgent.label),5)],4),p(U,{class:"flowBefore-box"},{default:l((()=>[p(U,{class:"scroll-v","scroll-y":""},{default:l((()=>[j.loading?c("",!0):(a(),n(I,{ref:"child",config:j.config,onEventReceiver:e.eventReceiver,onSetBtnLoad:e.setBtnLoad,key:j.childFormKey},null,8,["config","onEventReceiver","onSetBtnLoad"])),p(F,{onSubmitErrorForm:e.submitErrorForm,ref:"ErrorForm"},null,8,["onSubmitErrorForm"]),w.getShowExtraPanel?(a(),n(T,{key:1,progressList:j.progressList,taskInfo:j.taskInfo,commentList:j.commentList,taskId:0==j.config.opType?j.config.id:j.config.taskId,ref:"RecordTimeList",hasComment:j.hasComment},null,8,["progressList","taskInfo","commentList","taskId","hasComment"])):c("",!0)])),_:1})])),_:1}),p(D,{list:j.flowUrgentList,modelValue:j.showFlowUrgent,"onUpdate:modelValue":t[1]||(t[1]=e=>j.showFlowUrgent=e),onConfirm:e.seltConfirm,"default-value":j.defaultValue},null,8,["list","modelValue","onConfirm","default-value"]),p(O,{mode:"bottom",ref:"reduceApprover","background-color":"#fff"},{default:l((()=>[p(U,{class:"approverContent"},{default:l((()=>[p(U,{class:"notice-warp"},{default:l((()=>[p(U,{class:"u-flex close-icon"},{default:l((()=>[p(E,{name:"close",size:"32",onClick:e.hideReduceApprover,color:"#93969c"},null,8,["onClick"])])),_:1}),p(U,{class:"search-box"},{default:l((()=>[p(V,{placeholder:e.$t("app.apply.pleaseKeyword"),modelValue:j.keyword,"onUpdate:modelValue":t[2]||(t[2]=e=>j.keyword=e),height:"72","show-action":!1,onChange:e.getAddSignUserList,"bg-color":"#f0f2f6",shape:"square"},null,8,["placeholder","modelValue","onChange"])])),_:1})])),_:1}),p(U,{class:"popup"},{default:l((()=>[j.signUserIdList.length?(a(!0),u(g,{key:0},h(j.signUserIdList,((t,o)=>(a(),n(U,{key:o,class:"list-box"},{default:l((()=>[p(U,{class:"u-flex item"},{default:l((()=>[p(U,{class:"u-flex",style:{flex:"1"}},{default:l((()=>[p(P,{src:e.define.baseURL+t.headIcon},null,8,["src"]),p(U,{class:"u-m-l-10"},{default:l((()=>[p(U,null,{default:l((()=>[y(d(t.fullName),1)])),_:2},1024),p(U,null,{default:l((()=>[y(d(t.organize),1)])),_:2},1024)])),_:2},1024)])),_:2},1024),p(U,{class:"",onClick:o=>e.deleteReduce(t.id)},{default:l((()=>[p(E,{name:"trash",size:"32",color:"#93969c"})])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)))),128)):(a(),n($,{key:1}))])),_:1})])),_:1})])),_:1},512)])),_:1})}],["__scopeId","data-v-0644f3ec"]])},data:()=>({webType:"",showPage:!1,origin:"",id:"",config:{},formConf:{},key:+new Date,isAdd:!1,userInfo:{}}),onLoad(e){this.userInfo=j("userInfo")||{},this.config=JSON.parse(e.config),this.initData()},methods:{initData(){if(this.showPage=!1,2==this.config.mt)this.getConfigData();else{this.isAdd=!0;let e={flowId:this.config.fid,id:this.config.pid,formType:2,opType:this.config.opt,taskId:this.config.ftid};this.showPage=!0,this.$nextTick((()=>{this.$refs.flowForm.init(e)}))}},getConfigData(){P(this.config.mid).then((e=>{if(200!==e.code||!e.data)return void t({title:"暂无此页面",icon:"none",complete:()=>{setTimeout((()=>{i()}),1500)}});this.formConf=JSON.parse(e.data.formData),o({title:e.data.fullName});let s={modelId:this.config.mid,id:this.config.id,type:this.config.mt};w("dynamicModelExtra",s),$(this.config.mid,this.config.id).then((e=>{if(!e.data.data)return;let t=JSON.parse(e.data.data);this.fillFormData(this.formConf,t),this.$nextTick((()=>{this.showPage=!0,this.key=+new Date}))}))}))},fillFormData(e,t){const o=e=>{var i,s;for(let r=0;r[f.showPage?(a(),u(g,{key:0},[2==f.config.mt?(a(),n(p,{key:0,class:"jnpf-wrap jnpf-wrap-form"},{default:l((()=>[(a(),n(d,{formConf:f.formConf,ref:"dynamicForm",onSubmit:e.sumbitForm,key:f.key},null,8,["formConf","onSubmit"]))])),_:1})):(a(),n(h,{key:1,ref:"flowForm"},null,512))],64)):c("",!0)])),_:1})}],["__scopeId","data-v-ee9a1bbf"]]);export{O as default};