vue2-client 1.19.75 → 1.19.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.19.75",
3
+ "version": "1.19.76",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1134,7 +1134,10 @@ export default {
1134
1134
  onSelectChange (currentPageSelectedKeys, currentPageSelectedRows) {
1135
1135
  // 跨页选中模式:需要合并多页数据
1136
1136
  if (this.isMultiPageSelectionEnabled) {
1137
- this.mergeMultiPageSelection(currentPageSelectedRows)
1137
+ const primaryKeyName = this.primaryKey || this.rowKey
1138
+ // 当前页所有的key
1139
+ const currentPageAllKeys = this.$refs.table.localDataSource.map(row => row[primaryKeyName])
1140
+ this.mergeMultiPageSelection(currentPageAllKeys, currentPageSelectedRows, primaryKeyName)
1138
1141
  } else {
1139
1142
  // 单页选中模式:直接使用当前页数据
1140
1143
  this.selectedRowKeys = currentPageSelectedKeys
@@ -1160,12 +1163,11 @@ export default {
1160
1163
  * - selectedRowKeys: 所有页面选中的keys
1161
1164
  * - selectedRows: 所有页面选中的行数据
1162
1165
  *
1166
+ * @param currentPageAllKeys - 当前页所有的key
1163
1167
  * @param {Array} currentPageSelectedRows - 当前页被选中的行数据
1168
+ * @param primaryKeyName - 主键字段名
1164
1169
  */
1165
- mergeMultiPageSelection (currentPageSelectedRows) {
1166
- const primaryKeyName = this.primaryKey || this.rowKey
1167
- const currentPageAllKeys = currentPageSelectedRows.map(row => row[primaryKeyName])
1168
-
1170
+ mergeMultiPageSelection (currentPageAllKeys, currentPageSelectedRows, primaryKeyName) {
1169
1171
  // 使用 Map 统一处理 keys 和 rows 的合并
1170
1172
  const rowsMap = new Map()
1171
1173
 
@@ -1251,7 +1253,9 @@ export default {
1251
1253
  if (!this.$refs.table) return
1252
1254
 
1253
1255
  // 合并跨页选中数据(复用合并逻辑)
1254
- this.mergeMultiPageSelection(currentPageSelectedRows)
1256
+ const primaryKeyName = this.primaryKey || this.rowKey
1257
+ const currentPageAllKeys = currentPageSelectedRows.map(row => row[primaryKeyName])
1258
+ this.mergeMultiPageSelection(currentPageAllKeys, currentPageSelectedRows, primaryKeyName)
1255
1259
 
1256
1260
  // 同步UI状态
1257
1261
  this.syncSelectionState(currentPageSelectedKeys, currentPageSelectedRows)