Explorar el Código

fix: 分线评估保存排序问题

johnsen hace 7 meses
padre
commit
0bf56ea4b3
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/views/platform/risk/riskDetail.vue

+ 5 - 1
src/views/platform/risk/riskDetail.vue

@@ -619,7 +619,10 @@ export default {
       this.tableList = []
       this.$nextTick(() => {
         // 确保数据已更新到DOM
-        this.tableList = newData // 可结合表格自身的强制更新
+        this.tableList = newData.map((t, index) => ({
+          ...t,
+          tenant_id_: index
+        })) // 可结合表格自身的强制更新
       })
       // this.$forceUpdate()
       // const { oldIndex, newIndex } = evt
@@ -657,6 +660,7 @@ export default {
         this.userId = data[0].bian_zhi_ren_
         this.time = data[0].bian_zhi_shi_jian
         this.form.xuan_ze_feng_xian = data[0].xuan_ze_feng_xian
+        data.sort((a, b) => a.tenant_id_ - b.tenant_id_)
         this.tableList = data
         this.tableList.forEach((i) => {
           if (!Object.hasOwn(i, 'qian_zai_yuan_yin')) i.qian_zai_yuan_yin = ''