Переглянути джерело

fix: 兼容后端附件字段名为 file 或 files

xieyong 2 днів тому
батько
коміт
c71ae59a8c

+ 18 - 0
src/views/bpm/collaborative/detail.vue

@@ -326,6 +326,15 @@ export default {
     },
     open(row) {
       this.form = _.cloneDeep(row);
+      // 兼容后端附件字段名为 file 或 files
+      const adoptList = this.form?.valueJson?.blank_adopzrdd;
+      if (Array.isArray(adoptList)) {
+        adoptList.forEach((item) => {
+          if (item && item.file == null && item.files != null) {
+            item.file = item.files;
+          }
+        });
+      }
       if (this.form.id) {
         storageApi.getInfoBySourceBizNo(this.form.id).then((res) => {
           this.outgoingData = res;
@@ -487,6 +496,15 @@ export default {
         const row = rows[i];
         // 复用 open 的数据装配逻辑(同步部分)
         this.form = _.cloneDeep(row);
+        // 兼容后端附件字段名为 file 或 files
+        const adoptList = this.form?.valueJson?.blank_adopzrdd;
+        if (Array.isArray(adoptList)) {
+          adoptList.forEach((item) => {
+            if (item && item.file == null && item.files != null) {
+              item.file = item.files;
+            }
+          });
+        }
         if (this.form.id) {
           storageApi.getInfoBySourceBizNo(this.form.id).then((res) => {
             this.outgoingData = res;

+ 10 - 0
src/views/bpm/handleTask/formParser/formParserDialog.vue

@@ -301,6 +301,16 @@ export default {
       this.form = _.cloneDeep(row);
       console.log(this.form.taskDefinitionKey, 'this.form.taskDefinitionKey');
 
+      // 兼容后端附件字段名为 file 或 files
+      const adoptList = this.form?.valueJson?.blank_adopzrdd;
+      if (Array.isArray(adoptList)) {
+        adoptList.forEach((item) => {
+          if (item && item.file == null && item.files != null) {
+            item.file = item.files;
+          }
+        });
+      }
+
       this.jsonData = JSON.parse(this.form.formJson.makingJson);
       this.jsonData.config.dataSource &&
         this.jsonData.config.dataSource.forEach((item) => {