@kdcloudjs/table 1.2.0-canary.13 → 1.2.0-canary.14

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.0-canary.12
3
+ * @kdcloudjs/table v1.2.0-canary.13
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.0-canary.12
3
+ * @kdcloudjs/table v1.2.0-canary.13
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -10806,6 +10806,11 @@ function treeMode() {
10806
10806
  return pipeline.mapDataSource(processDataSource).mapColumns(processColumns);
10807
10807
 
10808
10808
  function processDataSource(input) {
10809
+ if (pipeline.isSameInputDataSource() && openKeys === pipeline.getFeatureOptions('lastOpenKeys')) {
10810
+ return pipeline.getFeatureOptions('lastTreeMode');
10811
+ }
10812
+
10813
+ pipeline.setFeatureOptions('lastOpenKeys', pipeline.getStateAtKey(stateKey));
10809
10814
  var result = [];
10810
10815
  dfs(input, 0);
10811
10816
 
@@ -10846,6 +10851,7 @@ function treeMode() {
10846
10851
  }
10847
10852
  }
10848
10853
 
10854
+ pipeline.setFeatureOptions('lastTreeMode', result);
10849
10855
  return result;
10850
10856
  }
10851
10857
 
@@ -11289,6 +11295,8 @@ var TablePipeline = /*#__PURE__*/function () {
11289
11295
 
11290
11296
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_dataSource", void 0);
11291
11297
 
11298
+ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_isSameInputDataSource", void 0);
11299
+
11292
11300
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_columns", void 0);
11293
11301
 
11294
11302
  _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_10___default()(this, "_footerDataSource", void 0);
@@ -11340,6 +11348,11 @@ var TablePipeline = /*#__PURE__*/function () {
11340
11348
  return this._snapshots[name].dataSource;
11341
11349
  }
11342
11350
  }
11351
+ }, {
11352
+ key: "isSameInputDataSource",
11353
+ value: function isSameInputDataSource() {
11354
+ return this._isSameInputDataSource;
11355
+ }
11343
11356
  }, {
11344
11357
  key: "getColumns",
11345
11358
  value: function getColumns(name) {
@@ -11390,9 +11403,12 @@ var TablePipeline = /*#__PURE__*/function () {
11390
11403
 
11391
11404
  if (this._dataSource != null || this._columns != null) {
11392
11405
  throw new Error('input 不能调用两次');
11393
- }
11406
+ } // 在 pipeline 中识别本次更新是否有数据变化
11407
+
11394
11408
 
11409
+ this._isSameInputDataSource = _input.dataSource === this.ref.current._lastInputDataSource;
11395
11410
  this._dataSource = _input.dataSource;
11411
+ this.ref.current._lastInputDataSource = _input.dataSource;
11396
11412
  this._columns = _input.columns.map(function (col) {
11397
11413
  return _objectSpread(_objectSpread({}, col), {}, {
11398
11414
  key: _this.guid()