hrsass-components 2.3.2 → 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.2";
68
+ var version = "2.3.4";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -4687,7 +4687,8 @@ var HrDynamic = {
4687
4687
  attrs: _objectSpread$9(_objectSpread$9({
4688
4688
  code: code,
4689
4689
  value: value,
4690
- placeholder: placeHolderVal
4690
+ placeholder: placeHolderVal,
4691
+ multiple: multiple
4691
4692
  }, $attrs), {}, {
4692
4693
  queryData: queryData
4693
4694
  }),
@@ -4697,7 +4698,7 @@ var HrDynamic = {
4697
4698
  },
4698
4699
  on: {
4699
4700
  change: function change(val, data) {
4700
- _this.$emit("change", val, _this);
4701
+ _this.$emit("change", val, _this, data);
4701
4702
  }
4702
4703
  }
4703
4704
  }), name === "ICONSELECT" && h("IconSelect", {
@@ -4896,7 +4897,8 @@ var TableProps = {
4896
4897
  autoLoad: VuePropTypes.bool,
4897
4898
  normalizeConfig: VuePropTypes.func,
4898
4899
  normalizeData: VuePropTypes.func,
4899
- selectedRowsList: VuePropTypes.array
4900
+ selectedRowsList: VuePropTypes.array,
4901
+ keepSelected: VuePropTypes.bool
4900
4902
  // dataSource: PropTypes.array,
4901
4903
  };
4902
4904
  var FilterProps = {
@@ -4920,7 +4922,8 @@ var ToolbarProps = {
4920
4922
  defaultShowCount: VuePropTypes.number,
4921
4923
  showFilter: VuePropTypes.bool,
4922
4924
  schemeList: VuePropTypes.array,
4923
- selectedSchemeId: VuePropTypes.any
4925
+ selectedSchemeId: VuePropTypes.any,
4926
+ showSetting: VuePropTypes.bool
4924
4927
  };
4925
4928
  var ResultProps = {
4926
4929
  prefixCls: VuePropTypes.string,
@@ -4957,12 +4960,14 @@ var TableToolbar = {
4957
4960
  //查询条件
4958
4961
  selectedRows: [],
4959
4962
  //已选中的行
4960
- locale: {},
4963
+ locale: defaultLocale.HrTable,
4961
4964
  //多语言
4962
4965
  defaultShowCount: 6,
4963
4966
  //默认展示数
4964
4967
  showFilter: true,
4965
4968
  //显示侧边过滤
4969
+ showSetting: true,
4970
+ //显示设置
4966
4971
  schemeList: [],
4967
4972
  //筛选方案
4968
4973
  selectedSchemeId: undefined //选择的方案id
@@ -5010,6 +5015,9 @@ var TableToolbar = {
5010
5015
  return this.schemeList.length > 0;
5011
5016
  }
5012
5017
  },
5018
+ mounted: function mounted() {
5019
+ this.data && this.data.length && this._initResize();
5020
+ },
5013
5021
  beforeDestroy: function beforeDestroy() {
5014
5022
  if (this.timer) {
5015
5023
  clearTimeout(this.timer);
@@ -5297,7 +5305,8 @@ var TableToolbar = {
5297
5305
  var _getOptionProps2 = getOptionProps(this),
5298
5306
  showDownload = _getOptionProps2.showDownload,
5299
5307
  locale = _getOptionProps2.locale,
5300
- showFilter = _getOptionProps2.showFilter;
5308
+ showFilter = _getOptionProps2.showFilter,
5309
+ showSetting = _getOptionProps2.showSetting;
5301
5310
  return h("div", {
5302
5311
  "class": classNames(prefixCls, cls)
5303
5312
  }, [this.renderSearch(), ($slots["default"] || dataVal.length > 0) && h(antDesignVue.Row, {
@@ -5335,7 +5344,7 @@ var TableToolbar = {
5335
5344
  _this6.$emit("filterClick");
5336
5345
  }
5337
5346
  }
5338
- }), h(antDesignVue.Icon, {
5347
+ }), showSetting && h(antDesignVue.Icon, {
5339
5348
  attrs: {
5340
5349
  type: "setting",
5341
5350
  title: locale.setting
@@ -7998,9 +8007,10 @@ var HrTableBase = {
7998
8007
  },
7999
8008
  on: {
8000
8009
  "reset": function reset() {
8001
- return [_this11.setState({
8010
+ _this11.setState({
8002
8011
  selectedRows: []
8003
- })];
8012
+ });
8013
+ _this11.$emit("rowSelected", []);
8004
8014
  },
8005
8015
  "delete": function _delete(id) {
8006
8016
  var _selectedRows = Object.assign([], selectedRows);
@@ -8011,6 +8021,7 @@ var HrTableBase = {
8011
8021
  _this11.setState({
8012
8022
  selectedRows: _selectedRows
8013
8023
  });
8024
+ _this11.$emit("rowSelected", _selectedRows);
8014
8025
  },
8015
8026
  "close": function close(v) {
8016
8027
  _this11.setState({
@@ -8123,7 +8134,8 @@ var index = {
8123
8134
  },
8124
8135
  normalizeData: function normalizeData(data) {
8125
8136
  return data;
8126
- }
8137
+ },
8138
+ keepSelected: false //是否保持跨页选中
8127
8139
  }),
8128
8140
  data: function data() {
8129
8141
  return {
@@ -8204,18 +8216,32 @@ var index = {
8204
8216
  },
8205
8217
  //根据回填传的rowIds,过滤选中的行
8206
8218
  selectedRowsList: {
8207
- handler: function handler(rowIds) {
8219
+ handler: function handler(rows) {
8208
8220
  var _this2 = this;
8221
+ var rowIds = rows.map(function (item) {
8222
+ return _typeof(item) === 'object' ? item.id || item.t_0_hid : item;
8223
+ });
8209
8224
  var _selectedUpdateRows = this.dataSource.filter(function (item) {
8210
8225
  return rowIds.includes(item.t_0_hid) || rowIds.map(function (id) {
8211
8226
  return id + '';
8212
8227
  }).includes(item.id + '');
8213
8228
  });
8229
+ if (rowIds.length === 0) {
8230
+ this.selectedUpdateRows = [];
8231
+ }
8214
8232
  this.selectedUpdateRows = _selectedUpdateRows.some(function (item) {
8215
8233
  return _this2.selectedUpdateRows.find(function (selectedItem) {
8216
8234
  return selectedItem.id === item.id || selectedItem.t_0_hid === item.t_0_hid;
8217
8235
  });
8218
- }) ? 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
+ }
8219
8245
  },
8220
8246
  immediate: true
8221
8247
  }
@@ -8397,18 +8423,32 @@ var index = {
8397
8423
  sortList: sort,
8398
8424
  conditionList: [].concat(_toConsumableArray(fitlerOtehrConditionListDeepClone), _toConsumableArray(fitlerConditionListDeepClone))
8399
8425
  }).then(function (res) {
8400
- var _this6$selectedRowsLi, _this6$selectedUpdate, _this6$dataSource;
8426
+ var _this6$selectedRowsLi, _this6$selectedRowsLi2;
8401
8427
  //外部处理数据
8402
8428
  if (lodash.isFunction(normalizeData)) {
8403
8429
  res = normalizeData(res);
8404
8430
  }
8405
8431
  //处理props传入的已选中
8406
- 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
+ });
8407
8436
  _this6.selectedUpdateRows = res.dataList.filter(function (item) {
8408
- 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) {
8409
8438
  return id + '';
8410
8439
  }).includes(item.id + '');
8411
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();
8412
8452
  }
8413
8453
  _this6.setState({
8414
8454
  pagination: _objectSpread$d(_objectSpread$d({}, pagination), {}, {
@@ -15125,6 +15165,7 @@ exports.HrSelectEmpsInput = HrSelectEmpsInput;
15125
15165
  exports.HrSetId = HrSetId;
15126
15166
  exports.HrTable = index;
15127
15167
  exports.HrTableBase = HrTableBase;
15168
+ exports.HrTableToolbar = TableToolbar;
15128
15169
  exports.HrTest = index$i;
15129
15170
  exports.HrToolbar = Toolbar;
15130
15171
  exports.HrTree = index$2;