From a0cc8e02560f7e72e2efb3d4540ddcd5f82aca6e Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期四, 05 十二月 2024 17:09:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/flowable/task/myProcess/send/index.vue |   84 ++++++++++++++++++++++++++++++-----------
 1 files changed, 61 insertions(+), 23 deletions(-)

diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue
index de3b8ca..d0b86cd 100644
--- a/src/views/flowable/task/myProcess/send/index.vue
+++ b/src/views/flowable/task/myProcess/send/index.vue
@@ -9,11 +9,19 @@
         <!--琛ㄥ崟淇℃伅-->
         <el-tab-pane label="琛ㄥ崟淇℃伅" name="1">
           <!--鍒濆鍖栨祦绋嬪姞杞借〃鍗曚俊鎭�-->
-          <el-col :span="16" :offset="4">
-            <v-form-render :form-data="formRenderData" ref="vFormRef"/>
-            <div style="margin-left:15%;margin-bottom: 20px;font-size: 14px;">
-              <el-button type="primary" @click="submitForm">鎻� 浜�</el-button>
-              <el-button type="primary" @click="resetForm">閲� 缃�</el-button>
+          <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>
+
+<!--            <v-form-render :form-data="formRenderData" ref="vFormRef"/>-->
+            <div style="display: flex;justify-content: center; align-items: center; margin: 20px 0">
+              <el-button type="primary" @click="submitForm">纭骞舵彁浜�</el-button>
+              <el-button type="primary" @click="submitForm">鍗忓悓鍔炵悊</el-button>
+              <el-button type="primary" @click="submitForm">杞氦浠栦汉鍔炵悊</el-button>
+<!--              <el-button type="primary" @click="resetForm">閲� 缃�</el-button>-->
             </div>
           </el-col>
         </el-tab-pane>
@@ -54,6 +62,7 @@
   props: {},
   data() {
     return {
+      formDataList: [],
       taskId: '',
       processName: '',
       // 妯″瀷xml鏁版嵁
@@ -68,6 +77,7 @@
       deployId: "",  // 娴佺▼瀹氫箟缂栧彿
       procDefId: "",  // 娴佺▼瀹炰緥缂栧彿
       formRenderData: {},
+      formRenderDataList: [],
       variables: [], // 娴佺▼鍙橀噺鏁版嵁
       taskTitle: null,
       taskOpen: false,
@@ -80,7 +90,7 @@
       formJson: {} // 琛ㄥ崟json
     };
   },
-  created() {
+  mounted() {
     this.processName = this.$route.query && this.$route.query.processName;
     this.deployId = this.$route.query && this.$route.query.deployId;
     this.taskId = this.$route.query && this.$route.query.taskId;
@@ -101,26 +111,44 @@
     getFlowFormData(taskId) {
       const params = {taskId: taskId}
       flowTaskForm(params).then(res => {
-        if (res.data.formJson) {
-          // 鍥炴樉琛ㄥ崟
-          this.$refs.vFormRef.setFormJson(res.data.formJson);
-          this.formJson = res.data.formJson;
+        this.formDataList = res.data
+        // this.formRenderDataList = res.data.map(item => item.formJson)
+        // console.log("琛ㄥ崟鏁版嵁鍒楄〃", this.formRenderDataList)
+        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])
+              eval("that.$refs.form" +index)[0].setFormJson(formDataObj.formJsonObj.formJson);
+
+              eval("that.$refs.form" +index)[0].setFormData(formDataObj.formJsonObj);
+            })
+            this.formJson = this.formDataList[0].formJsonObj.formJson
           })
-        } else {
-          this.$nextTick(() => {
-            // 鍥炴樉鏁版嵁
-            this.$refs.vFormRef.setFormJson(res.data);
-            this.formJson = res.data;
-          })
+
         }
+        // if (res.data.formJson) {
+        //   // 鍥炴樉琛ㄥ崟
+        //   this.$refs.vFormRef.setFormJson(res.data.formJson);
+        //   this.formJson = res.data.formJson;
+        //   this.$nextTick(() => {
+        //     // 鍔犺浇琛ㄥ崟濉啓鐨勬暟鎹�
+        //     this.$refs.vFormRef.setFormData(res.data);
+        //     // this.$nextTick(() => {
+        //     //   // 琛ㄥ崟绂佺敤
+        //     //   this.$refs.vFormRef.disableForm();
+        //     // })
+        //   })
+        // } else {
+        //   this.$nextTick(() => {
+        //     // 鍥炴樉鏁版嵁
+        //     this.$refs.vFormRef.setFormJson(res.data);
+        //     this.formJson = res.data;
+        //   })
+        // }
       }).catch(res => {
+        console.log("鎶ラ敊浜嗭細", res)
         this.goBack();
       })
     },
@@ -133,7 +161,8 @@
     },
     /** 鐢宠娴佺▼琛ㄥ崟鏁版嵁鎻愪氦 */
     submitForm() {
-      this.$refs.vFormRef.getFormData().then(formData => {
+      let that = this
+      eval("that.$refs.form" +0)[0].getFormData().then(formData => {
         // 鏍规嵁褰撳墠浠诲姟鎴栬�呮祦绋嬭璁¢厤缃殑涓嬩竴姝ヨ妭鐐� todo 鏆傛椂鏈秹鍙婂埌鑰冭檻缃戝叧銆佽〃杈惧紡鍜屽鑺傜偣鎯呭喌
         getNextFlowNodeByStart({deploymentId: this.deployId, variables: formData}).then(res => {
           const data = res.data;
@@ -275,4 +304,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