bk-magic-vue 2.4.13-beta.1 → 2.4.13

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.
@@ -11895,6 +11895,11 @@ th.bk-table-column-selection .cell, th.bk-table-column-expand .cell, td.bk-table
11895
11895
  background-color:#eef6fe;
11896
11896
  color:#3a84ff;
11897
11897
  }
11898
+ .bk-transfer .source-list .content li.is-disabled, .bk-transfer .target-list .content li.is-disabled{
11899
+ cursor:not-allowed;
11900
+ color:#c4c6cc;
11901
+ background-color:#fff;
11902
+ }
11898
11903
  .bk-transfer .source-list .content li .content-text, .bk-transfer .target-list .content li .content-text{
11899
11904
  -webkit-box-flex:1;
11900
11905
  -ms-flex:1;
@@ -31378,6 +31378,9 @@
31378
31378
  return !this.isSelectAllItems && !this.isEmpty;
31379
31379
  },
31380
31380
  isSelectAllItems: function isSelectAllItems() {
31381
+ if (this.options.length < 1) {
31382
+ return false;
31383
+ }
31381
31384
  return Array.prototype.every.call(this.options, function (option) {
31382
31385
  return option.isSelected;
31383
31386
  });
@@ -45520,7 +45523,7 @@
45520
45523
  sortDataList: function sortDataList(list, key, sortList) {
45521
45524
  var arr = sortList;
45522
45525
  return list.sort(function (a, b) {
45523
- return arr.indexOf(a[key]) - arr.indexOf(b[key]) >= 0;
45526
+ return arr.indexOf(a[key]) - arr.indexOf(b[key]);
45524
45527
  });
45525
45528
  },
45526
45529
  removeFromDataList: function removeFromDataList(removeItem) {
@@ -45535,6 +45538,7 @@
45535
45538
  var displayDataList = this.displayDataList;
45536
45539
  var hasSelectedList = this.hasSelectedList;
45537
45540
  displayDataList.forEach(function (transferItem) {
45541
+ if (transferItem.disabled) return;
45538
45542
  hasSelectedList.push(transferItem);
45539
45543
  _this6.removeFromDataList(transferItem);
45540
45544
  });
@@ -45552,10 +45556,13 @@
45552
45556
  },
45553
45557
  allToLeft: function allToLeft() {
45554
45558
  this.rightHoverIndex = -1;
45555
- var hasSelectedList = this.hasSelectedList;
45559
+ var hasSelectedList = this.hasSelectedList.filter(function (i) {
45560
+ return !i.disabled;
45561
+ });
45556
45562
  var dataList = this.dataList;
45557
45563
  while (hasSelectedList.length) {
45558
45564
  var transferItem = hasSelectedList.shift();
45565
+ this.hasSelectedList.splice(this.hasSelectedList.indexOf(transferItem), 1);
45559
45566
  dataList.push(transferItem);
45560
45567
  if (this.sortList.length === this.sourceList.length) {
45561
45568
  this.dataList = _toConsumableArray(this.sortDataList(dataList, this.sortCode, this.sortList));
@@ -45570,7 +45577,8 @@
45570
45577
  this.$emit('change', this.dataList, this.hasSelectedList, list);
45571
45578
  }
45572
45579
  },
45573
- leftClick: function leftClick(index) {
45580
+ leftClick: function leftClick(index, item) {
45581
+ if (item.disabled) return;
45574
45582
  this.leftHoverIndex = -1;
45575
45583
  var transferItem = this.displayDataList[index];
45576
45584
  var hasSelectedList = this.hasSelectedList;
@@ -45588,7 +45596,8 @@
45588
45596
  this.$emit('change', this.dataList, this.hasSelectedList, list);
45589
45597
  }
45590
45598
  },
45591
- rightClick: function rightClick(index) {
45599
+ rightClick: function rightClick(index, item) {
45600
+ if (item.disabled) return;
45592
45601
  this.rightHoverIndex = -1;
45593
45602
  var transferItem = this.hasSelectedList.splice(index, 1)[0];
45594
45603
  var dataList = this.dataList;
@@ -45670,12 +45679,13 @@
45670
45679
  }, _vm._l(_vm.displayDataList, function (item, index) {
45671
45680
  return _c('li', {
45672
45681
  key: index,
45682
+ class: [item.disabled ? 'is-disabled' : ''],
45673
45683
  on: {
45674
45684
  "click": function click($event) {
45675
45685
  $event.stopPropagation();
45676
45686
  $event.preventDefault();
45677
45687
 
45678
- _vm.leftClick(index);
45688
+ _vm.leftClick(index, item);
45679
45689
  },
45680
45690
  "mouseover": function mouseover($event) {
45681
45691
  $event.stopPropagation();
@@ -45701,12 +45711,12 @@
45701
45711
  attrs: {
45702
45712
  "title": item[_vm.displayCode]
45703
45713
  }
45704
- }, [_vm._v(_vm._s(item[_vm.displayCode]))]), _c('span', {
45714
+ }, [_vm._v(_vm._s(item[_vm.displayCode]))]), !item.disabled ? _c('span', {
45705
45715
  staticClass: "icon-wrapper",
45706
45716
  class: [index === _vm.leftHoverIndex ? 'hover' : '']
45707
45717
  }, [_c('i', {
45708
45718
  staticClass: "bk-icon icon-arrows-right"
45709
- })])], null, item)], 2);
45719
+ })]) : _vm._e()], null, item)], 2);
45710
45720
  }), 0)] : [_vm.slot['left-empty-content'] ? _c('div', [_vm._t("left-empty-content")], 2) : _c('div', {
45711
45721
  staticClass: "empty"
45712
45722
  }, [_vm._v("\n " + _vm._s(_vm.emptyContent[0] ? _vm.emptyContent[0] : _vm.t('bk.transfer.emptyContent')) + "\n ")])]], 2), _c('div', {
@@ -45732,12 +45742,13 @@
45732
45742
  }, _vm._l(_vm.hasSelectedList, function (item, index) {
45733
45743
  return _c('li', {
45734
45744
  key: index,
45745
+ class: [item.disabled ? 'is-disabled' : ''],
45735
45746
  on: {
45736
45747
  "click": function click($event) {
45737
45748
  $event.stopPropagation();
45738
45749
  $event.preventDefault();
45739
45750
 
45740
- _vm.rightClick(index);
45751
+ _vm.rightClick(index, item);
45741
45752
  },
45742
45753
  "mouseover": function mouseover($event) {
45743
45754
  $event.stopPropagation();
@@ -45763,12 +45774,12 @@
45763
45774
  attrs: {
45764
45775
  "title": item[_vm.displayCode]
45765
45776
  }
45766
- }, [_vm._v(_vm._s(item[_vm.displayCode]))]), _c('span', {
45777
+ }, [_vm._v(_vm._s(item[_vm.displayCode]))]), !item.disabled ? _c('span', {
45767
45778
  staticClass: "icon-wrapper",
45768
45779
  class: [index === _vm.rightHoverIndex ? 'hover' : '']
45769
45780
  }, [_c('i', {
45770
45781
  staticClass: "bk-icon icon-close"
45771
- })])], null, item)], 2);
45782
+ })]) : _vm._e()], null, item)], 2);
45772
45783
  }), 0)] : [_vm.slot['right-empty-content'] ? _c('div', [_vm._t("right-empty-content")], 2) : _c('div', {
45773
45784
  staticClass: "empty"
45774
45785
  }, [_vm._v("\n " + _vm._s(_vm.emptyContent[1] ? _vm.emptyContent[1] : _vm.t('bk.transfer.emptySelected')) + "\n ")])]], 2)]);