hrsass-components 2.3.3 → 2.3.4

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.
@@ -46,13 +46,13 @@ function _interopNamespace(e) {
46
46
  var _asyncToGenerator = _interopDefault(require('@babel/runtime/helpers/asyncToGenerator'));
47
47
  var _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));
48
48
  var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
49
+ var _typeof = _interopDefault(require('@babel/runtime/helpers/typeof'));
49
50
  var _regeneratorRuntime = _interopDefault(require('@babel/runtime/regenerator'));
50
51
  var Vue = _interopDefault(require('vue'));
51
52
  var classNames = _interopDefault(require('classnames'));
52
53
  var _objectWithoutProperties = _interopDefault(require('@babel/runtime/helpers/objectWithoutProperties'));
53
54
  var antDesignVue = require('ant-design-vue');
54
55
  var lodash = require('lodash');
55
- var _typeof = _interopDefault(require('@babel/runtime/helpers/typeof'));
56
56
  var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));
57
57
  var resizeDetector = require('resize-detector');
58
58
  var moment = require('moment');
@@ -65,7 +65,7 @@ var contentStyle = _interopDefault(require('!!raw-loader!tinymce/skins/content/d
65
65
  var SvgPanZoom = _interopDefault(require('svg-pan-zoom'));
66
66
  var saveSvgAsPng = require('save-svg-as-png');
67
67
 
68
- var version = "2.3.3";
68
+ var version = "2.3.4";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -4897,7 +4897,8 @@ var TableProps = {
4897
4897
  autoLoad: VuePropTypes.bool,
4898
4898
  normalizeConfig: VuePropTypes.func,
4899
4899
  normalizeData: VuePropTypes.func,
4900
- selectedRowsList: VuePropTypes.array
4900
+ selectedRowsList: VuePropTypes.array,
4901
+ keepSelected: VuePropTypes.bool
4901
4902
  // dataSource: PropTypes.array,
4902
4903
  };
4903
4904
  var FilterProps = {
@@ -8006,9 +8007,10 @@ var HrTableBase = {
8006
8007
  },
8007
8008
  on: {
8008
8009
  "reset": function reset() {
8009
- return [_this11.setState({
8010
+ _this11.setState({
8010
8011
  selectedRows: []
8011
- })];
8012
+ });
8013
+ _this11.$emit("rowSelected", []);
8012
8014
  },
8013
8015
  "delete": function _delete(id) {
8014
8016
  var _selectedRows = Object.assign([], selectedRows);
@@ -8019,6 +8021,7 @@ var HrTableBase = {
8019
8021
  _this11.setState({
8020
8022
  selectedRows: _selectedRows
8021
8023
  });
8024
+ _this11.$emit("rowSelected", _selectedRows);
8022
8025
  },
8023
8026
  "close": function close(v) {
8024
8027
  _this11.setState({
@@ -8131,7 +8134,8 @@ var index = {
8131
8134
  },
8132
8135
  normalizeData: function normalizeData(data) {
8133
8136
  return data;
8134
- }
8137
+ },
8138
+ keepSelected: false //是否保持跨页选中
8135
8139
  }),
8136
8140
  data: function data() {
8137
8141
  return {
@@ -8212,18 +8216,32 @@ var index = {
8212
8216
  },
8213
8217
  //根据回填传的rowIds,过滤选中的行
8214
8218
  selectedRowsList: {
8215
- handler: function handler(rowIds) {
8219
+ handler: function handler(rows) {
8216
8220
  var _this2 = this;
8221
+ var rowIds = rows.map(function (item) {
8222
+ return _typeof(item) === 'object' ? item.id || item.t_0_hid : item;
8223
+ });
8217
8224
  var _selectedUpdateRows = this.dataSource.filter(function (item) {
8218
8225
  return rowIds.includes(item.t_0_hid) || rowIds.map(function (id) {
8219
8226
  return id + '';
8220
8227
  }).includes(item.id + '');
8221
8228
  });
8229
+ if (rowIds.length === 0) {
8230
+ this.selectedUpdateRows = [];
8231
+ }
8222
8232
  this.selectedUpdateRows = _selectedUpdateRows.some(function (item) {
8223
8233
  return _this2.selectedUpdateRows.find(function (selectedItem) {
8224
8234
  return selectedItem.id === item.id || selectedItem.t_0_hid === item.t_0_hid;
8225
8235
  });
8226
- }) ? this.selectedUpdateRows : this.selectedUpdateRows.concat(_selectedUpdateRows);
8236
+ }) ? _selectedUpdateRows : this.selectedUpdateRows.concat(_selectedUpdateRows);
8237
+ if (this.keepSelected) {
8238
+ var notInCurrentPageRows = rows.filter(function (item) {
8239
+ return !_this2.selectedUpdateRows.some(function (selectedItem) {
8240
+ return selectedItem.id === item.id || selectedItem.t_0_hid === item.t_0_hid;
8241
+ });
8242
+ });
8243
+ this.selectedUpdateRows = this.selectedUpdateRows.concat(notInCurrentPageRows);
8244
+ }
8227
8245
  },
8228
8246
  immediate: true
8229
8247
  }
@@ -8405,18 +8423,32 @@ var index = {
8405
8423
  sortList: sort,
8406
8424
  conditionList: [].concat(_toConsumableArray(fitlerOtehrConditionListDeepClone), _toConsumableArray(fitlerConditionListDeepClone))
8407
8425
  }).then(function (res) {
8408
- var _this6$selectedRowsLi, _this6$selectedUpdate, _this6$dataSource;
8426
+ var _this6$selectedRowsLi, _this6$selectedRowsLi2;
8409
8427
  //外部处理数据
8410
8428
  if (lodash.isFunction(normalizeData)) {
8411
8429
  res = normalizeData(res);
8412
8430
  }
8413
8431
  //处理props传入的已选中
8414
- if ((_this6 === null || _this6 === void 0 || (_this6$selectedRowsLi = _this6.selectedRowsList) === null || _this6$selectedRowsLi === void 0 ? void 0 : _this6$selectedRowsLi.length) > 0 && (_this6 === null || _this6 === void 0 || (_this6$selectedUpdate = _this6.selectedUpdateRows) === null || _this6$selectedUpdate === void 0 ? void 0 : _this6$selectedUpdate.length) == 0 && (_this6 === null || _this6 === void 0 || (_this6$dataSource = _this6.dataSource) === null || _this6$dataSource === void 0 ? void 0 : _this6$dataSource.length) == 0) {
8432
+ if ((_this6 === null || _this6 === void 0 || (_this6$selectedRowsLi = _this6.selectedRowsList) === null || _this6$selectedRowsLi === void 0 ? void 0 : _this6$selectedRowsLi.length) > 0) {
8433
+ var selectedRowIds = _this6.selectedRowsList.map(function (item) {
8434
+ return _typeof(item) === 'object' ? item.id || item.t_0_hid : item;
8435
+ });
8415
8436
  _this6.selectedUpdateRows = res.dataList.filter(function (item) {
8416
- return _this6.selectedRowsList.includes(item.t_0_hid) || (_this6.selectedRowsList || []).map(function (id) {
8437
+ return selectedRowIds.includes(item.t_0_hid) || (selectedRowIds || []).map(function (id) {
8417
8438
  return id + '';
8418
8439
  }).includes(item.id + '');
8419
8440
  });
8441
+ if (_this6.keepSelected) {
8442
+ var notInCurrentPageRows = _this6.selectedRowsList.filter(function (item) {
8443
+ return !_this6.selectedUpdateRows.some(function (selectedItem) {
8444
+ return selectedItem.id === item.id || selectedItem.t_0_hid === item.t_0_hid;
8445
+ });
8446
+ });
8447
+ _this6.selectedUpdateRows = _this6.selectedUpdateRows.concat(notInCurrentPageRows);
8448
+ }
8449
+ }
8450
+ if ((_this6 === null || _this6 === void 0 || (_this6$selectedRowsLi2 = _this6.selectedRowsList) === null || _this6$selectedRowsLi2 === void 0 ? void 0 : _this6$selectedRowsLi2.length) == 0) {
8451
+ _this6.clearSelectedRows();
8420
8452
  }
8421
8453
  _this6.setState({
8422
8454
  pagination: _objectSpread$d(_objectSpread$d({}, pagination), {}, {