From bd63da40b4f5a5130bbb73fc654e7aaa25cacce6 Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期二, 10 十二月 2024 18:11:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/flowable/task/myProcess/detail/index.vue | 70 ++++++++++++++++++++++++++-------- 1 files changed, 53 insertions(+), 17 deletions(-) diff --git a/src/views/flowable/task/myProcess/detail/index.vue b/src/views/flowable/task/myProcess/detail/index.vue index f655c72..c797cb2 100644 --- a/src/views/flowable/task/myProcess/detail/index.vue +++ b/src/views/flowable/task/myProcess/detail/index.vue @@ -2,14 +2,18 @@ <div class="app-container"> <el-card class="box-card" > <div slot="header" class="clearfix"> - <span class="el-icon-document">宸插彂浠诲姟</span> + <span class="el-icon-document">宸插畬鎴愪换鍔�</span> <el-button style="float: right;" size="mini" type="danger" @click="goBack">鍏抽棴</el-button> </div> <el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick"> <!--琛ㄥ崟淇℃伅--> <el-tab-pane label="琛ㄥ崟淇℃伅" name="1"> - <el-col :span="16" :offset="4"> - <v-form-render ref="vFormRef"/> + <el-col :span="16" :offset="4" v-if="formDataList && formDataList.length > 0"> + <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp"> + <div v-if="formDataObj.current" style="margin-bottom: 15px;color: #409eff">褰撳墠闃舵锛�<span style="color: red">{{formDataObj.beforeNodeName}}</span></div> + <div v-else style="margin-bottom: 15px;color: #409eff">鍓嶇疆闃舵锛�<span style="color: #d5904b">{{formDataObj.beforeNodeName}}</span></div> + <v-form-render :form-data="formDataObj.formJson" :ref="'form' + index"/> + </div> </el-col> </el-tab-pane> <!--娴佺▼娴佽浆璁板綍--> @@ -70,6 +74,7 @@ <script> import {flowRecord} from "@/api/flowable/finished"; import {getProcessVariables, flowXmlAndNode} from "@/api/flowable/definition"; +import {flowTaskForm, flowTaskFormDetail} from "@/api/flowable/todo"; import BpmnViewer from '@/components/Process/viewer'; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; @@ -83,12 +88,14 @@ return { // 妯″瀷xml鏁版嵁 flowData: {}, + formDataList: [], // 琛ㄥ崟鍒楄〃 activeName: '1', // 鏌ヨ鍙傛暟 queryParams: {}, // 閬僵灞� loading: true, flowRecordList: [], // 娴佺▼娴佽浆鏁版嵁 + goBackParams: {}, taskForm:{ multiple: false, comment:"", // 鎰忚鍐呭 @@ -104,6 +111,7 @@ this.taskForm.deployId = this.$route.query && this.$route.query.deployId; this.taskForm.taskId = this.$route.query && this.$route.query.taskId; this.taskForm.procInsId = this.$route.query && this.$route.query.procInsId; + this.goBackParams = this.$route.query && this.$route.query.goBackParams; // 娴佺▼浠诲姟閲嶈幏鍙栧彉閲忚〃鍗� this.processVariables( this.taskForm.taskId) this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId); @@ -144,28 +152,47 @@ processVariables(taskId) { if (taskId) { // 鎻愪氦娴佺▼鐢宠鏃跺~鍐欑殑琛ㄥ崟瀛樺叆浜嗘祦绋嬪彉閲忎腑鍚庣画浠诲姟澶勭悊鏃堕渶瑕佸睍绀� - getProcessVariables(taskId).then(res => { - this.$nextTick(() => { - // 鍥炴樉琛ㄥ崟 - this.$refs.vFormRef.setFormJson(res.data.formJson); + flowTaskFormDetail(taskId).then(res => { + this.formDataList = res.data + if (this.formDataList && this.formDataList.length > 0) { this.$nextTick(() => { - // 鍔犺浇琛ㄥ崟濉啓鐨勬暟鎹� - this.$refs.vFormRef.setFormData(res.data); - this.$nextTick(() => { - // 琛ㄥ崟绂佺敤 - this.$refs.vFormRef.disableForm(); + this.formDataList.forEach((formDataObj, index) => { + console.log("琛ㄥ崟鏁版嵁鍒楄〃", formDataObj.formJson) + let that = this + console.log(eval("that.$refs.form" + index)[0]) + if (formDataObj.formJsonObj) { + eval("that.$refs.form" + index)[0].setFormJson(formDataObj.formJsonObj.formJson); + + eval("that.$refs.form" + index)[0].setFormData(formDataObj.formJsonObj); + this.$nextTick(() => { + eval("that.$refs.form" + index)[0].disableForm(); + }) + } }) + // this.formJson = this.formDataList[0].formJsonObj.formJson }) - }) + } + // this.$nextTick(() => { + // // 鍥炴樉琛ㄥ崟 + // this.$refs.vFormRef.setFormJson(res.data.formJson); + // this.$nextTick(() => { + // // 鍔犺浇琛ㄥ崟濉啓鐨勬暟鎹� + // this.$refs.vFormRef.setFormData(res.data); + // this.$nextTick(() => { + // // 琛ㄥ崟绂佺敤 + // this.$refs.vFormRef.disableForm(); + // }) + // }) + // }) }); } }, /** 杩斿洖椤甸潰 */ goBack() { - // // 鍏抽棴褰撳墠鏍囩椤靛苟杩斿洖涓婁釜椤甸潰 - // const obj = { path: "/task/process", query: { t: Date.now()} }; - // this.$tab.closeOpenPage(obj); - this.$tab.closePage() + this.$router.push({ + path: '/projectFlow/detail', + query: this.goBackParams + }) }, } }; @@ -198,4 +225,13 @@ .my-label { background: #E1F3D8; } + +.form-warp { + padding: 20px; + margin-bottom: 20px; + box-shadow: + inset 0 -3em 3em rgba(0, 0, 0, 0.1), + 0 0 0 2px rgb(239, 239, 239), + 0.3em 0.3em 1em rgba(0, 0, 0, 0.3); +} </style> -- Gitblit v1.8.0