mirror of
https://gitee.com/myxzgzs/boyuehasfj-vue3.git
synced 2025-08-08 07:02:42 +08:00
2 lines
4.8 KiB
JavaScript
2 lines
4.8 KiB
JavaScript
![]() |
import{d as e,f as t}from"./definition-DXmD8XrJ.js";import{B as s}from"./index-DAvuUjgd.js";import{f as a}from"./process-B2SNzl0p.js";import{g as o}from"./todo-Qb_1ZJkx.js";import{F as l,a as i}from"./index-Cnjq8-TX.js";import{_ as c,c as r,e as n,w as d,j as h,f as m,m as p,h as f,i as u,o as k}from"./index-C-c3zR6K.js";import"./vue-treeselect-DOtaeHu9.js";import"./user-DdZ7lTRu.js";import"./StrUtil-C5XZ-1E2.js";import"./role-C2JHjUVp.js";const y={class:"app-container"},g={style:{display:"flex","justify-content":"center"}},I={class:"dialog-footer"};const V=c({name:"Record",components:{BpmnViewer:s,FlowUser:i,FlowRole:l},props:{},data:()=>({flowData:{},activeName:"1",queryParams:{deptId:void 0},loading:!0,deployId:"",procDefId:"",formRenderData:{},variables:[],taskTitle:null,taskOpen:!1,checkSendUser:!1,checkSendRole:!1,checkType:"",checkValues:null,formData:{},multiInstanceVars:"",formJson:{}}),created(){this.deployId=this.$route.query&&this.$route.query.deployId,this.procDefId=this.$route.query&&this.$route.query.procDefId,this.getFlowFormData(this.deployId)},methods:{handleClick(e,s){"2"===e.index&&t({deployId:this.deployId}).then((e=>{this.flowData=e.data}))},getFlowFormData(e){a({deployId:e}).then((e=>{this.$nextTick((()=>{this.$refs.vFormRef.setFormJson(e.data),this.formJson=e.data}))})).catch((e=>{this.goBack()}))},goBack(){const e={path:"/task/process",query:{t:Date.now()}};this.$tab.closeOpenPage(e)},submitForm(){this.$refs.vFormRef.getFormData().then((t=>{o({deploymentId:this.deployId,variables:t}).then((s=>{const a=s.data;if(a)if(this.formData=t,"dynamic"===a.dataType)"assignee"===a.type?(this.checkSendUser=!0,this.checkType="single"):"candidateUsers"===a.type?(this.checkSendUser=!0,this.checkType="multiple"):"candidateGroups"===a.type?this.checkSendRole=!0:(this.multiInstanceVars=a.vars,this.checkSendUser=!0,this.checkType="multiple"),this.taskOpen=!0,this.taskTitle="选择任务接收";else if(this.procDefId){const s={formJson:this.formJson};Object.assign(s,t),e(this.procDefId,s).then((e=>{this.$modal.msgSuccess(e.msg),this.goBack()}))}}))})).catch((e=>{}))},resetForm(){this.$refs.vFormRef.resetForm()},submitTask(){if(this.checkValues||!this.checkSendUser)if(this.checkValues||!this.checkSendRole){if(this.formData){const t={formJson:this.formJson};Object.assign(t,this.formData),this.multiInstanceVars?t[this.multiInstanceVars]=this.checkValues:t.approval=this.checkValues,e(this.procDefId,t).then((e=>{this.$modal.msgSuccess(e.msg),this.goBack()}))}}else this.$modal.msgError("请选择流程接收角色组!");else this.$modal.msgError("请选择任务接收!")},handleUserSelect(e){if(e)if(e instanceof Array){const t=e.map((e=>e.userId));this.multiInstanceVars?this.checkValues=t:this.checkValues=t.join(",")}else this.checkValues=e.userId},handleRoleSelect(e){if(e)if(e instanceof Array){const t=e.map((e=>e.roleId));this.checkValues=t.join(",")}else this.checkValues=e}}},[["render",function(e,t,s,a,o,l){const i=h("el-button"),c=h("v-form-render"),V=h("el-col"),b=h("el-tab-pane"),D=h("bpmn-viewer"),S=h("el-tabs"),v=h("flow-user"),F=h("flow-role"),j=h("el-dialog"),w=h("el-card");return k(),r("div",y,[n(w,{class:"box-card"},{header:d((()=>[t[4]||(t[4]=m("span",{class:"el-icon-document"},"发起任务",-1)),n(i,{style:{float:"right"},size:"small",type:"danger",onClick:l.goBack},{default:d((()=>t[3]||(t[3]=[p("关闭")]))),_:1},8,["onClick"])])),default:d((()=>[n(S,{"tab-position":"top",modelValue:o.activeName,"onUpdate:modelValue":t[0]||(t[0]=e=>o.activeName=e),onTabClick:l.handleClick},{default:d((()=>[n(b,{label:"表单信息",name:"1"},{default:d((()=>[n(V,{span:16,offset:4},{default:d((()=>[n(c,{"form-data":o.formRenderData,ref:"vFormRef"},null,8,["form-data"]),m("div",g,[n(i,{type:"primary",onClick:l.submitForm},{default:d((()=>t[5]||(t[5]=[p("提 交")]))),_:1},8,["onClick"]),n(i,{type:"primary",onClick:l.resetForm},{default:d((()=>t[6]||(t[6]=[p("重 置")]))),_:1},8,["onClick"])])])),_:1})])),_:1}),n(b,{label:"流程图",name:"2"},{default:d((()=>[n(D,{flowData:o.flowData},null,8,["flowData"])])),_:1})])),_:1}
|