@gingkoo/pandora-metabase 1.0.41 → 1.0.42

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.
@@ -226,6 +226,7 @@ var useStore = function useStore() {
226
226
  var _columns2;
227
227
  var oldColumns,
228
228
  callback,
229
+ oldObj,
229
230
  selectId,
230
231
  _table$alias,
231
232
  alias,
@@ -243,7 +244,9 @@ var useStore = function useStore() {
243
244
  oldColumns = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : [];
244
245
  callback = _args2.length > 3 ? _args2[3] : undefined;
245
246
  // 获取之前选中的数据
247
+ oldObj = {};
246
248
  selectId = oldColumns.filter(function (v) {
249
+ oldObj[v.id] = v;
247
250
  return v.select;
248
251
  }).map(function (v) {
249
252
  return v.id;
@@ -265,9 +268,13 @@ var useStore = function useStore() {
265
268
  case 2:
266
269
  _columns = (_columns2 = columns) === null || _columns2 === void 0 ? void 0 : _columns2.map(function (v) {
267
270
  var select = selectId.includes(v.id);
268
- return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, v), {}, {
271
+ var obj = {};
272
+ if (select) {
273
+ obj = oldObj[v.id];
274
+ }
275
+ return (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, obj), v), {}, {
269
276
  select: select,
270
- fieldUuid: v.fieldUuid || (0, _helper.uuidv4)('field')
277
+ fieldUuid: obj.fieldUuid || v.fieldUuid || (0, _helper.uuidv4)('field')
271
278
  });
272
279
  });
273
280
  typeof callback === 'function' && callback(_columns);
@@ -219,6 +219,7 @@ var useStore = function useStore() {
219
219
  var _columns2;
220
220
  var oldColumns,
221
221
  callback,
222
+ oldObj,
222
223
  selectId,
223
224
  _table$alias,
224
225
  alias,
@@ -236,7 +237,9 @@ var useStore = function useStore() {
236
237
  oldColumns = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : [];
237
238
  callback = _args2.length > 3 ? _args2[3] : undefined;
238
239
  // 获取之前选中的数据
240
+ oldObj = {};
239
241
  selectId = oldColumns.filter(function (v) {
242
+ oldObj[v.id] = v;
240
243
  return v.select;
241
244
  }).map(function (v) {
242
245
  return v.id;
@@ -258,9 +261,13 @@ var useStore = function useStore() {
258
261
  case 2:
259
262
  _columns = (_columns2 = columns) === null || _columns2 === void 0 ? void 0 : _columns2.map(function (v) {
260
263
  var select = selectId.includes(v.id);
261
- return _objectSpread(_objectSpread({}, v), {}, {
264
+ var obj = {};
265
+ if (select) {
266
+ obj = oldObj[v.id];
267
+ }
268
+ return _objectSpread(_objectSpread(_objectSpread({}, obj), v), {}, {
262
269
  select: select,
263
- fieldUuid: v.fieldUuid || uuidv4('field')
270
+ fieldUuid: obj.fieldUuid || v.fieldUuid || uuidv4('field')
264
271
  });
265
272
  });
266
273
  typeof callback === 'function' && callback(_columns);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/pandora-metabase",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "",
5
5
  "main": "lib/es/index.js",
6
6
  "module": "lib/es/index.js",