فهرست منبع

fix: 列表接口新增额外参数携带功能

johnsen 7 ماه پیش
والد
کامیت
47c667bb51

+ 4 - 1
src/business/platform/data/templaterender/templates/list.vue

@@ -452,7 +452,7 @@ export default {
       proInstId: '', // 编制暂存数据
       instanceId: '', // 流程查看办理详情
       taskId: '', // 流程进入当前任务
-
+      otherParams: null,
       dialogValue: {},
       dialogVisible: false,
       sefStartFlowId: '',
@@ -935,6 +935,9 @@ export default {
       responseData.datasetKey = this.dataTemplate.datasetKey
       responseData.unique = this.pkKey
       responseData['dynamic_params'] = this.dynamicParams
+      if (this.otherParams) {
+        formParams['other_params'] = JSON.stringify(this.otherParams)
+      }
       formParams['response_data'] = JSON.stringify(responseData)
       formParams['filter_condition_key'] = this.filterConditionKey
       return ActionUtils.formatParams(formParams, this.pagination, this.sorts)

+ 19 - 2
src/business/platform/form/formrender/dynamic-form/dynamic-form.vue

@@ -380,7 +380,15 @@ export default {
           }
         } else if (fieldType === 'table') {
           // 子表单
-          const data = this.value ? this.value[fieldName] : []
+          let data = []
+          if (this.value && this.value[fieldName]) {
+            this.value[fieldName].sort &&
+              this.value[fieldName].sort(
+                (a, b) =>
+                  (a.tenantId || a.tenant_id_) - (b.tenantId || b.tenant_id_)
+              )
+            data = this.value[fieldName]
+          }
           if (fieldOptions.mode === 'block') {
             if (this.$utils.isEmpty(data)) {
               this.$set(this.models, fieldName, [])
@@ -640,7 +648,16 @@ export default {
      * 设置表单字段数据
      */
     setFieldData(name, value) {
-      this.models[name] = value
+      if (Array.isArray(value)) {
+        const tem = JSON.parse(JSON.stringify(value))
+        tem.sort(
+          (a, b) => (a.tenantId || a.tenant_id_) - (b.tenantId || b.tenant_id_)
+        )
+        console.log('value===>', value)
+        this.models[name] = tem
+      } else {
+        this.models[name] = value
+      }
     },
     /**
      * 设置表单权限