Ver código fonte

Merge branch 'master' of http://119.23.210.103:3000/wy/zdqy_firm_former

cfort 2 anos atrás
pai
commit
ff7cc5e07e

+ 6 - 0
src/business/platform/data/templaterender/templates/list.vue

@@ -643,6 +643,7 @@ export default {
          * 记忆选择核心方法
          */
         changePageCoreRecordData () {
+            const pkKey = this.pkKey || 'id'
             // 如果是单选,则将总选择清空
             // 如果总记忆中还没有选择的数据,那么就直接取当前页选中的数据,不需要后面一系列计算
             if (this.$utils.isEmpty(this.selectionAll)) {
@@ -672,6 +673,11 @@ export default {
                     // 如果总选择里面不包含当前页选中的数据,那么就加入到总选择集合里
                     if (selectAllIds.indexOf(pkValue) < 0) {
                         selectionAll.push(row)
+                    } else {
+                        // 如果已经存在,那么就先剔除原本的数据,再把新的数据添加进去
+                        const filSelectionAll = selectionAll.filter(item => item[pkKey] !== pkValue)
+                        selectionAll = JSON.parse(JSON.stringify(filSelectionAll))
+                        selectionAll.push(row)
                     }
                 })
             } else {