bk-magic-vue 2.5.9-beta.32 → 2.5.9-beta.34

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.
@@ -33486,8 +33486,53 @@
33486
33486
  pinyin.patchDict(patcher56L);
33487
33487
  }
33488
33488
 
33489
+ var meta$1 = _meta.onFreeze;
33490
+ _objectSap('freeze', function ($freeze) {
33491
+ return function freeze(it) {
33492
+ return $freeze && _isObject(it) ? $freeze(meta$1(it)) : it;
33493
+ };
33494
+ });
33495
+
33496
+ var freeze = _core.Object.freeze;
33497
+
33498
+ var freeze$1 = freeze;
33499
+
33500
+ var RenderSlot = {
33501
+ props: {
33502
+ data: Object,
33503
+ height: {
33504
+ type: Number,
33505
+ default: 0
33506
+ },
33507
+ top: {
33508
+ type: Number,
33509
+ default: 0
33510
+ },
33511
+ left: {
33512
+ type: Number,
33513
+ default: 0
33514
+ },
33515
+ renderItem: Function
33516
+ },
33517
+ created: function created() {
33518
+ this.style = {
33519
+ height: "".concat(this.height, "px"),
33520
+ top: "".concat(this.top, "px"),
33521
+ left: "".concat(this.left, "px")
33522
+ };
33523
+ },
33524
+ render: function render(h) {
33525
+ return h('li', {
33526
+ style: this.style
33527
+ }, this.renderItem(this.data));
33528
+ }
33529
+ };
33530
+
33489
33531
  var script$K = {
33490
33532
  name: 'bk-virtual-scroll',
33533
+ components: {
33534
+ RenderSlot: RenderSlot
33535
+ },
33491
33536
  props: {
33492
33537
  itemHeight: {
33493
33538
  type: Number,
@@ -33550,6 +33595,9 @@
33550
33595
  deep: true
33551
33596
  }
33552
33597
  },
33598
+ created: function created() {
33599
+ this.calcList = throttle(30, this.calcData);
33600
+ },
33553
33601
  mounted: function mounted() {
33554
33602
  this.initStatus();
33555
33603
  this.initEvent();
@@ -33588,6 +33636,14 @@
33588
33636
  });
33589
33637
  }
33590
33638
  },
33639
+ renderItem: function renderItem(data) {
33640
+ if (this.$scopedSlots && this.$scopedSlots.default) {
33641
+ return this.$scopedSlots.default({
33642
+ data: data
33643
+ });
33644
+ }
33645
+ return null;
33646
+ },
33591
33647
  resize: function resize(event) {
33592
33648
  var _this = this;
33593
33649
  this.slowExec(function () {
@@ -33674,7 +33730,7 @@
33674
33730
  };
33675
33731
  this.calcList(postData);
33676
33732
  },
33677
- calcList: function calcList(_ref) {
33733
+ calcData: function calcData(_ref) {
33678
33734
  var totalScrollHeight = _ref.totalScrollHeight,
33679
33735
  itemHeight = _ref.itemHeight,
33680
33736
  itemNumber = _ref.itemNumber,
@@ -33705,20 +33761,22 @@
33705
33761
  }
33706
33762
  }
33707
33763
  totalScrollHeight = totalScrollHeight - nums * 500000;
33708
- this.indexList = indexList;
33709
- this.listData = listData;
33764
+ this.indexList = freeze$1(indexList);
33765
+ this.listData = freeze$1(listData);
33710
33766
  this.totalScrollHeight = totalScrollHeight;
33711
- var firstIndexObj = this.indexList[0] || {};
33712
- var lastIndexObj = this.indexList[this.indexList.length - 1] || {};
33767
+ var firstIndexObj = indexList[0] || {};
33768
+ var lastIndexObj = indexList[indexList.length - 1] || {};
33713
33769
  this.downPreDefault = lastIndexObj.value + 1 < this.totalNumber;
33714
33770
  this.upPreDefault = firstIndexObj.value > 1;
33715
33771
  this.isScrolling = false;
33716
- this.$emit('change', listData.map(function (x) {
33717
- return x.value;
33718
- }));
33772
+ if (this.$listeners.change) {
33773
+ this.$emit('change', listData.map(function (x) {
33774
+ return x.value;
33775
+ }));
33776
+ }
33719
33777
  },
33720
33778
  addListData: function addListData(list) {
33721
- this.allListData = this.allListData.concat(list);
33779
+ this.allListData = freeze$1([].concat(_toConsumableArray(this.allListData), _toConsumableArray(list)));
33722
33780
  var number = this.totalNumber + list.length;
33723
33781
  var lastIndexData = this.indexList[this.indexList.length - 1] || {
33724
33782
  value: 0
@@ -33731,7 +33789,7 @@
33731
33789
  this.resize();
33732
33790
  },
33733
33791
  setListData: function setListData(list) {
33734
- this.allListData = list;
33792
+ this.allListData = freeze$1(list);
33735
33793
  this.freshDataNoScroll(list.length);
33736
33794
  this.resize();
33737
33795
  },
@@ -33860,7 +33918,7 @@
33860
33918
  var _vm = this;
33861
33919
  var _h = _vm.$createElement;
33862
33920
  var _c = _vm._self._c || _h;
33863
- return _c('section', {
33921
+ return _c('div', {
33864
33922
  ref: "scrollHome",
33865
33923
  staticClass: "bk-scroll-home",
33866
33924
  class: _vm.extCls,
@@ -33868,7 +33926,7 @@
33868
33926
  "mousewheel": _vm.handleWheel,
33869
33927
  "DOMMouseScroll": _vm.handleWheel
33870
33928
  }
33871
- }, [_c('main', {
33929
+ }, [_c('div', {
33872
33930
  staticClass: "bk-scroll-main"
33873
33931
  }, [_vm.showIndex ? _c('ul', {
33874
33932
  staticClass: "bk-scroll-index bk-scroll",
@@ -33900,18 +33958,18 @@
33900
33958
  left: _vm.mainLeft + "px"
33901
33959
  }
33902
33960
  }, _vm._l(_vm.listData, function (item) {
33903
- return _c('li', {
33961
+ return _c('RenderSlot', {
33904
33962
  key: item.top,
33905
33963
  staticClass: "bk-scroll-item",
33906
- style: {
33907
- height: _vm.itemHeight + "px",
33908
- top: item.top + "px",
33909
- left: -_vm.bottomScrollDis * (_vm.itemWidth - _vm.mainWidth) / (_vm.mainWidth - _vm.bottomScrollWidth) + "px"
33964
+ attrs: {
33965
+ "data": item.value,
33966
+ "height": _vm.itemHeight,
33967
+ "top": item.top,
33968
+ "render-item": _vm.renderItem,
33969
+ "left": -_vm.bottomScrollDis * (_vm.itemWidth - _vm.mainWidth) / (_vm.mainWidth - _vm.bottomScrollWidth)
33910
33970
  }
33911
- }, [_vm._t("default", null, {
33912
- "data": item.value
33913
- })], 2);
33914
- }), 0)]), _c('canvas', {
33971
+ });
33972
+ }), 1)]), _c('canvas', {
33915
33973
  ref: "minNav",
33916
33974
  staticClass: "bk-min-nav",
33917
33975
  style: "height: " + _vm.visHeight + "px;"
@@ -54774,11 +54832,12 @@
54774
54832
  key: "recalculateLinkLine",
54775
54833
  value: function recalculateLinkLine() {
54776
54834
  if (this.tree.hasLine) {
54777
- var needsCalculateNodes = this.tree.needsCalculateNodes;
54835
+ var needsCalculateNodes = _toConsumableArray(this.tree.needsCalculateNodes);
54778
54836
  if (needsCalculateNodes.includes(this)) {
54779
54837
  return false;
54780
54838
  }
54781
54839
  needsCalculateNodes.push(this);
54840
+ this.tree.needsCalculateNodes = freeze$1(needsCalculateNodes);
54782
54841
  this.parent && this.parent.recalculateLinkLine();
54783
54842
  }
54784
54843
  }
@@ -55028,7 +55087,6 @@
55028
55087
  data: function data() {
55029
55088
  return {
55030
55089
  nodes: [],
55031
- map: {},
55032
55090
  selected: this.defaultSelectedNode,
55033
55091
  needsCalculateNodes: [],
55034
55092
  calculateTimer: null,
@@ -55082,26 +55140,58 @@
55082
55140
  data: function data(value) {
55083
55141
  this.setData(value);
55084
55142
  },
55085
- hasLine: function hasLine(_hasLine) {
55086
- var _this$needsCalculateN;
55087
- _hasLine && (_this$needsCalculateN = this.needsCalculateNodes).push.apply(_this$needsCalculateN, _toConsumableArray(this.visibleNodes));
55143
+ hasLine: {
55144
+ handler: function handler() {
55145
+ if (this.hasLine) {
55146
+ this.needsCalculateNodes = freeze$1([].concat(_toConsumableArray(this.needsCalculateNodes), _toConsumableArray(this.visibleNodes)));
55147
+ }
55148
+ },
55149
+ immediate: true
55088
55150
  }
55089
55151
  },
55152
+ created: function created() {
55153
+ this.map = {};
55154
+ },
55090
55155
  mounted: function mounted() {
55091
55156
  this.setData(this.data);
55092
55157
  },
55093
55158
  methods: {
55094
55159
  setData: function setData(data) {
55095
- var _this$needsCalculateN2;
55096
55160
  var nodes = [];
55097
55161
  var map = {};
55098
55162
  this.recurrenceNodes(data, null, nodes, map);
55099
- this.nodes = nodes;
55163
+ this.nodes = freeze$1(nodes);
55100
55164
  this.map = map;
55101
55165
  this.initNodeState();
55102
55166
  this.setVirtualScrollList();
55103
55167
  this.registryOptions(this.nodes);
55104
- this.hasLine && (_this$needsCalculateN2 = this.needsCalculateNodes).push.apply(_this$needsCalculateN2, _toConsumableArray(this.visibleNodes));
55168
+ },
55169
+ initNodeState: function initNodeState() {
55170
+ var _this = this;
55171
+ if (!this.defaultExpandAll) {
55172
+ var defaultExpandedNodes = _toConsumableArray(this.defaultExpandedNodes);
55173
+ if (this.defaultSelectedNode) {
55174
+ defaultExpandedNodes.push(this.defaultSelectedNode);
55175
+ }
55176
+ defaultExpandedNodes.forEach(function (id) {
55177
+ var node = _this.getNodeById(id);
55178
+ if (node) {
55179
+ node.expanded = true;
55180
+ }
55181
+ });
55182
+ }
55183
+ this.defaultCheckedNodes.forEach(function (id) {
55184
+ var node = _this.getNodeById(id);
55185
+ if (node) {
55186
+ node.checked = true;
55187
+ }
55188
+ });
55189
+ this.defaultDisabledNodes.forEach(function (id) {
55190
+ var node = _this.getNodeById(id);
55191
+ if (node) {
55192
+ node.disabled = true;
55193
+ }
55194
+ });
55105
55195
  },
55106
55196
  registryOptions: function registryOptions(nodes) {
55107
55197
  var parent = this.$parent.$parent || this.$root;
@@ -55120,61 +55210,28 @@
55120
55210
  }
55121
55211
  },
55122
55212
  recurrenceNodes: function recurrenceNodes(data, parent, nodes, map) {
55123
- var _this = this;
55124
- data.forEach(function (datum, index) {
55213
+ var _this2 = this;
55214
+ data.forEach(function (datum) {
55125
55215
  var node = new TreeNode(datum, {
55126
55216
  level: parent ? parent.level + 1 : 0,
55127
55217
  parent: parent,
55128
55218
  index: nodes.length
55129
- }, _this);
55219
+ }, _this2);
55130
55220
  if (parent) {
55131
55221
  node.childIndex = parent.children.length;
55132
55222
  parent.children.push(node);
55133
55223
  }
55134
55224
  nodes.push(node);
55135
55225
  map[node.id] = node;
55136
- var children = datum[_this.nodeOptions.childrenKey];
55226
+ var children = datum[_this2.nodeOptions.childrenKey];
55137
55227
  if (isArray$1(children) && children.length) {
55138
- _this.recurrenceNodes(children, node, nodes, map);
55228
+ _this2.recurrenceNodes(children, node, nodes, map);
55139
55229
  }
55140
55230
  });
55141
55231
  },
55142
55232
  getNodeById: function getNodeById(id) {
55143
55233
  return this.map[id];
55144
55234
  },
55145
- initNodeState: function initNodeState() {
55146
- !this.defaultExpandAll && this.initDefaultExpanded();
55147
- this.initDefaultChecked();
55148
- this.initDefaultDisabled();
55149
- },
55150
- initDefaultExpanded: function initDefaultExpanded() {
55151
- var _this2 = this;
55152
- var defaultExpandedNodes = this.defaultSelectedNode !== null ? [].concat(_toConsumableArray(this.defaultExpandedNodes), [this.defaultSelectedNode]) : this.defaultExpandedNodes;
55153
- defaultExpandedNodes.forEach(function (id) {
55154
- var node = _this2.getNodeById(id);
55155
- if (node) {
55156
- node.expanded = true;
55157
- }
55158
- });
55159
- },
55160
- initDefaultChecked: function initDefaultChecked() {
55161
- var _this3 = this;
55162
- this.defaultCheckedNodes.forEach(function (id) {
55163
- var node = _this3.getNodeById(id);
55164
- if (node) {
55165
- node.checked = true;
55166
- }
55167
- });
55168
- },
55169
- initDefaultDisabled: function initDefaultDisabled() {
55170
- var _this4 = this;
55171
- this.defaultDisabledNodes.forEach(function (id) {
55172
- var node = _this4.getNodeById(id);
55173
- if (node) {
55174
- node.disabled = true;
55175
- }
55176
- });
55177
- },
55178
55235
  addNode: function addNode(nodeData, parentId) {
55179
55236
  var trailing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
55180
55237
  var options = _typeof(parentId) === 'object' ? parentId : {
@@ -55196,10 +55253,10 @@
55196
55253
  return this.addChildNode(data, mergeOptions);
55197
55254
  },
55198
55255
  addRootNode: function addRootNode(data, _ref) {
55199
- var _this5 = this,
55200
- _this$nodes;
55256
+ var _this3 = this;
55201
55257
  var trailing = _ref.trailing;
55202
- var rootNodes = this.nodes.filter(function (node) {
55258
+ var lastNodes = _toConsumableArray(this.nodes);
55259
+ var rootNodes = lastNodes.filter(function (node) {
55203
55260
  return node.level === 0;
55204
55261
  });
55205
55262
  var offset = typeof trailing === 'number' ? Math.min(trailing, rootNodes.length) : trailing ? rootNodes.length : 0;
@@ -55214,21 +55271,21 @@
55214
55271
  return new TreeNode(datum, {
55215
55272
  level: 0,
55216
55273
  parent: null
55217
- }, _this5);
55274
+ }, _this3);
55218
55275
  });
55219
55276
  nodes.forEach(function (node) {
55220
- _this5.$set(_this5.map, node.id, node);
55277
+ _this3.map[node.id] = node;
55221
55278
  });
55222
- (_this$nodes = this.nodes).splice.apply(_this$nodes, [insertIndex, 0].concat(_toConsumableArray(nodes)));
55223
- this.nodes.slice(insertIndex).forEach(function (node, index) {
55279
+ lastNodes.splice.apply(lastNodes, [insertIndex, 0].concat(_toConsumableArray(nodes)));
55280
+ lastNodes.slice(insertIndex).forEach(function (node, index) {
55224
55281
  node.index = insertIndex + index;
55225
55282
  });
55283
+ this.nodes = freeze$1(lastNodes);
55226
55284
  this.setVirtualScrollList();
55227
55285
  return nodes;
55228
55286
  },
55229
55287
  addChildNode: function addChildNode(data, options) {
55230
- var _this6 = this,
55231
- _this$nodes2;
55288
+ var _this4 = this;
55232
55289
  var parentId = options.parentId,
55233
55290
  trailing = options.trailing;
55234
55291
  var parent = this.getNodeById(parentId);
@@ -55251,26 +55308,28 @@
55251
55308
  return new TreeNode(datum, {
55252
55309
  level: parent.level + 1,
55253
55310
  parent: parent
55254
- }, _this6);
55311
+ }, _this4);
55255
55312
  });
55256
55313
  parent.appendChild(nodes, offset, options);
55257
55314
  nodes.forEach(function (node) {
55258
- _this6.$set(_this6.map, node.id, node);
55315
+ _this4.map[node.id] = node;
55259
55316
  });
55260
- (_this$nodes2 = this.nodes).splice.apply(_this$nodes2, [insertIndex, 0].concat(_toConsumableArray(nodes)));
55261
- this.nodes.slice(insertIndex).forEach(function (node, index) {
55317
+ var lastNodes = _toConsumableArray(this.nodes);
55318
+ lastNodes.splice.apply(lastNodes, [insertIndex, 0].concat(_toConsumableArray(nodes)));
55319
+ lastNodes.slice(insertIndex).forEach(function (node, index) {
55262
55320
  node.index = insertIndex + index;
55263
55321
  });
55322
+ this.nodes = freeze$1(lastNodes);
55264
55323
  this.setVirtualScrollList();
55265
55324
  return nodes;
55266
55325
  },
55267
55326
  removeNode: function removeNode(nodeId) {
55268
- var _this7 = this;
55327
+ var _this5 = this;
55269
55328
  try {
55270
55329
  var ids = convertToArray(nodeId);
55271
55330
  var nodes = [];
55272
55331
  ids.forEach(function (id) {
55273
- var node = _this7.getNodeById(id);
55332
+ var node = _this5.getNodeById(id);
55274
55333
  if (node) {
55275
55334
  nodes.push(node);
55276
55335
  }
@@ -55280,7 +55339,7 @@
55280
55339
  });
55281
55340
  nodes.forEach(function (node) {
55282
55341
  var removeNodes = [node].concat(_toConsumableArray(node.descendants));
55283
- _this7.nodes.splice(node.index, removeNodes.length);
55342
+ _this5.nodes.splice(node.index, removeNodes.length);
55284
55343
  if (node.parent) {
55285
55344
  node.parent.removeChild(node);
55286
55345
  }
@@ -55288,16 +55347,18 @@
55288
55347
  var minChangedIndex = Math.min.apply(Math, _toConsumableArray(nodes.map(function (node) {
55289
55348
  return node.index;
55290
55349
  })));
55291
- this.nodes.slice(minChangedIndex).forEach(function (node, index) {
55350
+ var lastNodes = _toConsumableArray(this.nodes);
55351
+ lastNodes.slice(minChangedIndex).forEach(function (node, index) {
55292
55352
  node.index = minChangedIndex + index;
55293
55353
  });
55354
+ this.nodes = freeze$1(lastNodes);
55294
55355
  this.setVirtualScrollList();
55295
55356
  } catch (e) {
55296
55357
  console.warn(e.message);
55297
55358
  }
55298
55359
  },
55299
55360
  setSelected: function setSelected(nodeId) {
55300
- var _this8 = this;
55361
+ var _this6 = this;
55301
55362
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55302
55363
  return _asyncToGenerator( _regeneratorRuntime().mark(function _callee() {
55303
55364
  var mergeOptions, node, response;
@@ -55305,7 +55366,7 @@
55305
55366
  while (1) switch (_context.prev = _context.next) {
55306
55367
  case 0:
55307
55368
  _context.prev = 0;
55308
- if (!(!_this8.selectable || nodeId === _this8.selected)) {
55369
+ if (!(!_this6.selectable || nodeId === _this6.selected)) {
55309
55370
  _context.next = 3;
55310
55371
  break;
55311
55372
  }
@@ -55315,13 +55376,13 @@
55315
55376
  emitEvent: false,
55316
55377
  beforeSelect: true
55317
55378
  }, options);
55318
- node = _this8.getNodeById(nodeId);
55319
- if (!(mergeOptions.beforeSelect && typeof _this8.beforeSelect === 'function')) {
55379
+ node = _this6.getNodeById(nodeId);
55380
+ if (!(mergeOptions.beforeSelect && typeof _this6.beforeSelect === 'function')) {
55320
55381
  _context.next = 11;
55321
55382
  break;
55322
55383
  }
55323
55384
  _context.next = 8;
55324
- return _this8.beforeSelect(node);
55385
+ return _this6.beforeSelect(node);
55325
55386
  case 8:
55326
55387
  response = _context.sent;
55327
55388
  if (response) {
@@ -55330,9 +55391,9 @@
55330
55391
  }
55331
55392
  return _context.abrupt("return", false);
55332
55393
  case 11:
55333
- _this8.selected = nodeId;
55394
+ _this6.selected = nodeId;
55334
55395
  if (mergeOptions.emitEvent) {
55335
- _this8.$emit('select-change', node);
55396
+ _this6.$emit('select-change', node);
55336
55397
  }
55337
55398
  _context.next = 18;
55338
55399
  break;
@@ -55364,10 +55425,10 @@
55364
55425
  }
55365
55426
  },
55366
55427
  setChecked: function setChecked(nodeId) {
55367
- var _this9 = this;
55428
+ var _this7 = this;
55368
55429
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55369
55430
  return _asyncToGenerator( _regeneratorRuntime().mark(function _callee2() {
55370
- var isMultiple, ids, mergeOptions, nodes, response;
55431
+ var isMultiple, ids, mergeOptions, nodes, response, lastNodes;
55371
55432
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
55372
55433
  while (1) switch (_context2.prev = _context2.next) {
55373
55434
  case 0:
@@ -55375,7 +55436,7 @@
55375
55436
  isMultiple = isArray$1(nodeId);
55376
55437
  ids = isMultiple ? nodeId : [nodeId];
55377
55438
  if (!ids.length) {
55378
- _context2.next = 14;
55439
+ _context2.next = 16;
55379
55440
  break;
55380
55441
  }
55381
55442
  mergeOptions = _objectSpread({
@@ -55384,14 +55445,14 @@
55384
55445
  checked: true
55385
55446
  }, options);
55386
55447
  nodes = ids.map(function (id) {
55387
- return _this9.getNodeById(id);
55448
+ return _this7.getNodeById(id);
55388
55449
  });
55389
- if (!(mergeOptions.beforeCheck && typeof _this9.beforeCheck === 'function')) {
55450
+ if (!(mergeOptions.beforeCheck && typeof _this7.beforeCheck === 'function')) {
55390
55451
  _context2.next = 12;
55391
55452
  break;
55392
55453
  }
55393
55454
  _context2.next = 9;
55394
- return _this9.beforeCheck(nodes.length > 1 ? nodes : nodes[0], mergeOptions.checked);
55455
+ return _this7.beforeCheck(nodes.length > 1 ? nodes : nodes[0], mergeOptions.checked);
55395
55456
  case 9:
55396
55457
  response = _context2.sent;
55397
55458
  if (response) {
@@ -55405,21 +55466,23 @@
55405
55466
  });
55406
55467
  if (mergeOptions.emitEvent) {
55407
55468
  setTimeout(function () {
55408
- _this9.$emit('check-change', _this9.checked, isMultiple ? nodes : nodes[0]);
55469
+ _this7.$emit('check-change', _this7.checked, isMultiple ? nodes : nodes[0]);
55409
55470
  }, 0);
55410
55471
  }
55411
- case 14:
55412
- _context2.next = 19;
55413
- break;
55472
+ lastNodes = _toConsumableArray(_this7.nodes);
55473
+ _this7.nodes = freeze$1(lastNodes);
55414
55474
  case 16:
55415
- _context2.prev = 16;
55475
+ _context2.next = 21;
55476
+ break;
55477
+ case 18:
55478
+ _context2.prev = 18;
55416
55479
  _context2.t0 = _context2["catch"](0);
55417
55480
  console.warn(_context2.t0.message);
55418
- case 19:
55481
+ case 21:
55419
55482
  case "end":
55420
55483
  return _context2.stop();
55421
55484
  }
55422
- }, _callee2, null, [[0, 16]]);
55485
+ }, _callee2, null, [[0, 18]]);
55423
55486
  }))();
55424
55487
  },
55425
55488
  setExpanded: function setExpanded(nodeId) {
@@ -55438,13 +55501,14 @@
55438
55501
  if (mergeOptions.emitEvent) {
55439
55502
  this.$emit('expand-change', node);
55440
55503
  }
55504
+ this.nodes = freeze$1(_toConsumableArray(this.nodes));
55441
55505
  this.setVirtualScrollList();
55442
55506
  } catch (e) {
55443
55507
  console.warn(e.message);
55444
55508
  }
55445
55509
  },
55446
55510
  setDisabled: function setDisabled(nodeId) {
55447
- var _this10 = this;
55511
+ var _this8 = this;
55448
55512
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55449
55513
  try {
55450
55514
  var mergeOptions = _objectSpread({
@@ -55453,7 +55517,7 @@
55453
55517
  }, options);
55454
55518
  var ids = convertToArray(nodeId);
55455
55519
  var nodes = ids.map(function (id) {
55456
- return _this10.getNodeById(id);
55520
+ return _this8.getNodeById(id);
55457
55521
  }).filter(function (node) {
55458
55522
  return !!node;
55459
55523
  });
@@ -55463,12 +55527,13 @@
55463
55527
  if (mergeOptions.emitEvent) {
55464
55528
  this.$emit('disable-change', nodes.length > 1 ? nodes : nodes[0]);
55465
55529
  }
55530
+ this.nodes = freeze$1(_toConsumableArray(this.nodes));
55466
55531
  } catch (e) {
55467
55532
  console.warn(e.message);
55468
55533
  }
55469
55534
  },
55470
55535
  setDisableCheck: function setDisableCheck(nodeId) {
55471
- var _this11 = this;
55536
+ var _this9 = this;
55472
55537
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
55473
55538
  try {
55474
55539
  var mergeOptions = _objectSpread({
@@ -55477,7 +55542,7 @@
55477
55542
  }, options);
55478
55543
  var ids = convertToArray(nodeId);
55479
55544
  var nodes = ids.map(function (id) {
55480
- return _this11.getNodeById(id);
55545
+ return _this9.getNodeById(id);
55481
55546
  }).filter(function (node) {
55482
55547
  return !!node;
55483
55548
  });
@@ -55487,59 +55552,62 @@
55487
55552
  if (mergeOptions.emitEvent) {
55488
55553
  this.$emit('disable-check-change', nodes.length > 1 ? nodes : nodes[0]);
55489
55554
  }
55555
+ this.nodes = freeze$1(_toConsumableArray(this.nodes));
55490
55556
  } catch (e) {
55491
55557
  console.warn(e.message);
55492
55558
  }
55493
55559
  },
55494
55560
  handleCalculateLine: function handleCalculateLine() {
55495
- var _this12 = this;
55561
+ var _this10 = this;
55562
+ var calculateNodeLine = function calculateNodeLine(node) {
55563
+ var children = node.children,
55564
+ isLeaf = node.isLeaf,
55565
+ expanded = node.expanded;
55566
+ if (isLeaf || !expanded) {
55567
+ node.line = 0;
55568
+ return;
55569
+ }
55570
+ var visibleChildren = children.filter(function (child) {
55571
+ return child.visible;
55572
+ });
55573
+ if (!visibleChildren.length) {
55574
+ node.line = 0;
55575
+ return;
55576
+ }
55577
+ var firstChild = visibleChildren[0];
55578
+ var firstChildElement = _this10.$el.querySelector("#".concat(firstChild.uid));
55579
+ var lastChild = visibleChildren[visibleChildren.length - 1];
55580
+ var lastChildElement = _this10.$el.querySelector("#".concat(lastChild.uid));
55581
+ node.line = lastChildElement.getBoundingClientRect().bottom - firstChildElement.getBoundingClientRect().top;
55582
+ };
55496
55583
  this.calculateTimer && clearTimeout(this.calculateTimer);
55497
55584
  if (this.needsCalculateNodes.length) {
55498
55585
  this.calculateTimer = setTimeout(function () {
55499
- _this12.needsCalculateNodes.forEach(function (node) {
55500
- _this12.calculateNodeLine(node);
55586
+ _this10.needsCalculateNodes.forEach(function (node) {
55587
+ calculateNodeLine(node);
55501
55588
  });
55502
- _this12.needsCalculateNodes.splice(0);
55589
+ _this10.needsCalculateNodes.splice(0);
55590
+ _this10.nodes = freeze$1(_toConsumableArray(_this10.nodes));
55503
55591
  }, 0);
55504
55592
  } else {
55505
55593
  this.calculateTimer = null;
55506
55594
  }
55507
55595
  },
55508
- calculateNodeLine: function calculateNodeLine(node) {
55509
- var children = node.children,
55510
- isLeaf = node.isLeaf,
55511
- expanded = node.expanded;
55512
- if (isLeaf || !expanded) {
55513
- node.line = 0;
55514
- return;
55515
- }
55516
- var visibleChildren = children.filter(function (child) {
55517
- return child.visible;
55518
- });
55519
- if (!visibleChildren.length) {
55520
- node.line = 0;
55521
- return;
55522
- }
55523
- var firstChild = visibleChildren[0];
55524
- var firstChildElement = this.$el.querySelector("#".concat(firstChild.uid));
55525
- var lastChild = visibleChildren[visibleChildren.length - 1];
55526
- var lastChildElement = this.$el.querySelector("#".concat(lastChild.uid));
55527
- node.line = lastChildElement.getBoundingClientRect().bottom - firstChildElement.getBoundingClientRect().top;
55528
- },
55529
55596
  defaultFilterMethod: function defaultFilterMethod(keyword, node) {
55530
55597
  return String(node.name).toLowerCase().indexOf(keyword) > -1;
55531
55598
  },
55532
55599
  filter: function filter() {
55533
- var _this13 = this;
55600
+ var _this11 = this;
55534
55601
  var keyword = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
55602
+ var lastNodes = _toConsumableArray(this.nodes);
55535
55603
  var matchedNodes = [];
55536
55604
  var filterMethod = this.filterMethod || this.defaultFilterMethod;
55537
55605
  if (keyword === '') {
55538
55606
  this.inSearch = false;
55539
- this.nodes.forEach(function (node) {
55607
+ lastNodes.forEach(function (node) {
55540
55608
  node.setState('matched', true);
55541
55609
  node.recalculateLinkLine();
55542
- if (_this13.checkOnlyAvailableStrictly) {
55610
+ if (_this11.checkOnlyAvailableStrictly) {
55543
55611
  node.setState('checked', false);
55544
55612
  }
55545
55613
  matchedNodes.push(node);
@@ -55547,10 +55615,10 @@
55547
55615
  } else {
55548
55616
  this.inSearch = true;
55549
55617
  var convertKeyword = this.filterMethod ? keyword : String(keyword).toLowerCase();
55550
- this.nodes.forEach(function (node) {
55618
+ lastNodes.forEach(function (node) {
55551
55619
  var matched = filterMethod(convertKeyword, node);
55552
55620
  node.setState('matched', matched);
55553
- if (_this13.checkOnlyAvailableStrictly) {
55621
+ if (_this11.checkOnlyAvailableStrictly) {
55554
55622
  node.setState('checked', false);
55555
55623
  }
55556
55624
  if (matched) {
@@ -55561,6 +55629,7 @@
55561
55629
  });
55562
55630
  }
55563
55631
  this.isSearchEmpty = matchedNodes.length === 0;
55632
+ this.nodes = freeze$1(lastNodes);
55564
55633
  this.setVirtualScrollList();
55565
55634
  return matchedNodes;
55566
55635
  },
@@ -55603,14 +55672,14 @@
55603
55672
  });
55604
55673
  },
55605
55674
  setVirtualScrollList: function setVirtualScrollList() {
55606
- var _this14 = this;
55675
+ var _this12 = this;
55607
55676
  if (!this.height) return;
55608
55677
  if (!this.$refs.virtualScroll) {
55609
55678
  console.warn('virtual dom is not ready');
55610
55679
  return;
55611
55680
  }
55612
55681
  this.$nextTick(function () {
55613
- _this14.$refs.virtualScroll.setListData(_this14.visibleNodes);
55682
+ _this12.$refs.virtualScroll.setListData(_this12.visibleNodes);
55614
55683
  });
55615
55684
  },
55616
55685
  resize: function resize() {
@@ -55623,15 +55692,14 @@
55623
55692
  var __vue_script__$1j = script$1j;
55624
55693
  /* template */
55625
55694
  var __vue_render__$1l = function __vue_render__() {
55695
+ var _obj;
55626
55696
  var _vm = this;
55627
55697
  var _h = _vm.$createElement;
55628
55698
  var _c = _vm._self._c || _h;
55629
55699
  return _c('div', {
55630
- class: ['bk-big-tree', _vm.extCls, {
55631
- 'with-virtual-scroll': !!_vm.height
55632
- }, {
55633
- 'bk-big-tree--small': _vm.size === 'small'
55634
- }],
55700
+ class: (_obj = {
55701
+ 'bk-big-tree': true
55702
+ }, _obj[_vm.extCls] = true, _obj['with-virtual-scroll'] = !!_vm.height, _obj['bk-big-tree--small'] = _vm.size === 'small', _obj),
55635
55703
  style: {
55636
55704
  height: _vm.treeHeight
55637
55705
  }
@@ -59688,17 +59756,6 @@
59688
59756
 
59689
59757
  setInstaller(__vue_component__$1B);
59690
59758
 
59691
- var meta$1 = _meta.onFreeze;
59692
- _objectSap('freeze', function ($freeze) {
59693
- return function freeze(it) {
59694
- return $freeze && _isObject(it) ? $freeze(meta$1(it)) : it;
59695
- };
59696
- });
59697
-
59698
- var freeze = _core.Object.freeze;
59699
-
59700
- var freeze$1 = freeze;
59701
-
59702
59759
  var script$1z = {
59703
59760
  name: 'bk-resize-layout',
59704
59761
  props: {