hrsass-components 1.7.49 → 1.7.51

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.
@@ -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 = "1.7.49";
68
+ var version = "1.7.51";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -1592,7 +1592,9 @@ var defaultLocale = {
1592
1592
  uploadBtnText: '上传文件'
1593
1593
  },
1594
1594
  HrAppendixDirectory: {
1595
- uploadBtnText: '选择文件'
1595
+ uploadBtnText: '选择文件',
1596
+ total: '共',
1597
+ items: '条'
1596
1598
  },
1597
1599
  HrAddrBookCard: {
1598
1600
  viewReportRelate: '查看汇报关系',
@@ -14022,6 +14024,10 @@ var index$h = {
14022
14024
  type: Number,
14023
14025
  "default": 10240
14024
14026
  },
14027
+ fileSizeZipLimit: {
14028
+ type: Number,
14029
+ "default": 10240
14030
+ },
14025
14031
  // 文件列表类型(可选: 文本text, 图片picture, 图片卡片picture-card)
14026
14032
  listType: {
14027
14033
  type: String,
@@ -14089,6 +14095,16 @@ var index$h = {
14089
14095
  isMainUploadFile: {
14090
14096
  type: Boolean,
14091
14097
  "default": false
14098
+ },
14099
+ pagination: {
14100
+ type: Object,
14101
+ "default": function _default() {
14102
+ return {};
14103
+ }
14104
+ },
14105
+ validateUrl: {
14106
+ type: String,
14107
+ "default": ""
14092
14108
  }
14093
14109
  },
14094
14110
  data: function data() {
@@ -14100,15 +14116,11 @@ var index$h = {
14100
14116
  // 当前文件列表
14101
14117
  fileList: [],
14102
14118
  errorFileList: [],
14103
- pagination: {
14104
- current: 1,
14105
- pageSize: 10,
14106
- total: 0,
14107
- showSizeChanger: true
14108
- },
14109
- dataSource: []
14119
+ dataSource: [],
14120
+ modifiedPagination: _objectSpread$o({}, this.pagination) // 使用扩展运算符创建一个 prop 值的副本
14110
14121
  };
14111
14122
  },
14123
+
14112
14124
  watch: {
14113
14125
  value: function value(val) {
14114
14126
  var fileIds = this.fileList.map(function (_ref) {
@@ -14223,7 +14235,7 @@ var index$h = {
14223
14235
  this.fileList = [].concat(_toConsumableArray(this.fileList), [file]);
14224
14236
  return new Promise( /*#__PURE__*/function () {
14225
14237
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) {
14226
- var name, size, types, result, num;
14238
+ var name, size, types, result, _num, _num2;
14227
14239
  return _regeneratorRuntime.wrap(function _callee$(_context) {
14228
14240
  while (1) switch (_context.prev = _context.next) {
14229
14241
  case 0:
@@ -14245,18 +14257,26 @@ var index$h = {
14245
14257
  // );
14246
14258
  _this2.errorFileList.push(name);
14247
14259
  } else {
14248
- if (_this2.fileSizeLimit > 0) {
14249
- if (_this2.fileSizeLimit * 1024 < size) {
14260
+ if (_this2.fileSizeLimit > 0 || _this2.fileSizeZipLimit > 0) {
14261
+ if (_this2.fileSizeLimit * 1024 < size && !_this2.fileTypes.includes('.zip')) {
14250
14262
  result = false;
14251
- num = _this2.fileSizeLimit / 1024;
14252
- if (num > 0) {
14253
- num = "".concat(Number(num.toFixed(2)), "MB");
14263
+ _num = _this2.fileSizeLimit / 1024;
14264
+ if (_num > 0) {
14265
+ _num = "".concat(Number(_num.toFixed(2)), "MB");
14254
14266
  } else {
14255
- num = "".concat(_this2.fileSizeLimit, "KB");
14267
+ _num = "".concat(_this2.fileSizeLimit, "KB");
14268
+ }
14269
+ } else if (_this2.fileSizeZipLimit * 1024 < size && _this2.fileTypes.includes('.zip')) {
14270
+ result = false;
14271
+ _num2 = _this2.fileSizeZipLimit / 1024;
14272
+ if (_num2 > 0) {
14273
+ _num2 = "".concat(Number(_num2.toFixed(2)), "MB");
14274
+ } else {
14275
+ _num2 = "".concat(_this2.fileSizeZipLimit, "KB");
14256
14276
  }
14257
- //this.$message.error(`${this.locale.fileSizeError} (${num})`);
14258
- _this2.errorFileList.push(name);
14259
14277
  }
14278
+ _this2.$message.error("".concat(_this2.locale.fileSizeError, " (").concat(num, ")"));
14279
+ _this2.errorFileList.push(name);
14260
14280
  }
14261
14281
  }
14262
14282
  if (!_this2.customBeforeUpload) {
@@ -14296,7 +14316,7 @@ var index$h = {
14296
14316
  var fileList = files.map(function (_ref3) {
14297
14317
  var fileId = _ref3.fileId,
14298
14318
  fileName = _ref3.fileName;
14299
- var fName = fileName.split('/');
14319
+ var fName = fileName.split("/");
14300
14320
  var name = fName[fName.length - 1]; //文件夹上传
14301
14321
  var fileObj = {
14302
14322
  uid: "".concat(fileId),
@@ -14347,7 +14367,7 @@ var index$h = {
14347
14367
  });
14348
14368
  //附件详情页,上传空文件删除不了,故排除上传为空的文件
14349
14369
  this.fileList = fileList;
14350
- console.log('fileList-components', this.fileList);
14370
+ console.log("fileList-components", this.fileList);
14351
14371
  },
14352
14372
  realRemove: function realRemove(file) {
14353
14373
  var _this5 = this;
@@ -14387,7 +14407,7 @@ var index$h = {
14387
14407
  _this5.emitChange(_value2.length > 0 ? _value2 : undefined);
14388
14408
  if (_this5.isDetailDelFile) {
14389
14409
  _this5.$axios.post("/business/emp/empinfo/empbasic/deleteAttachment.data?id=".concat(fileId)).then(function () {
14390
- _this5.$message.info('删除成功');
14410
+ _this5.$message.info("删除成功");
14391
14411
  });
14392
14412
  }
14393
14413
  } else {
@@ -14437,7 +14457,7 @@ var index$h = {
14437
14457
  validatorFile: function validatorFile(fileId) {
14438
14458
  var _this7 = this;
14439
14459
  //后端上传校验失败接口
14440
- this.$axios.post("/business/emp/empinfo/empbasic/validateAttachment.search", {
14460
+ this.$axios.post(this.validateUrl, {
14441
14461
  blobIds: fileId
14442
14462
  }).then(function (res) {
14443
14463
  res && res.map(function (item) {
@@ -14476,6 +14496,14 @@ var index$h = {
14476
14496
  });
14477
14497
  });
14478
14498
  },
14499
+ _handleTableChange: function _handleTableChange(pager) {
14500
+ var modifiedPagination = this.modifiedPagination;
14501
+ this.modifiedPagination = _objectSpread$o(_objectSpread$o({}, modifiedPagination), {}, {
14502
+ current: pager.current,
14503
+ pageSize: pager.pageSize
14504
+ });
14505
+ this.$emit("changePage", pager);
14506
+ },
14479
14507
  _renderHrAppendixDirectory: function _renderHrAppendixDirectory(locale) {
14480
14508
  var _this8 = this;
14481
14509
  var h = this.$createElement;
@@ -14516,8 +14544,8 @@ var index$h = {
14516
14544
  var dataSource = !this.isMainUploadFile ? this.fileList.filter(function (file) {
14517
14545
  return file.status === "done";
14518
14546
  }) : this.dataSource;
14519
- this.$emit('errorFileNum', this.errorFileList.length || 0);
14520
- this.$emit('save', dataSource);
14547
+ this.$emit("errorFileNum", this.errorFileList.length || 0);
14548
+ this.$emit("save", dataSource);
14521
14549
  $appendixDirectory = h("div", {
14522
14550
  "class": "hr-appendix-directory hr-appendix-directory-table hr-appendix-directory-".concat(this.imageSize)
14523
14551
  }, [(!disabled || btn) && h("header", [h("a-upload", _objectSpread$o(_objectSpread$o({}, options), {}, {
@@ -14531,7 +14559,7 @@ var index$h = {
14531
14559
  }, ["\u6821\u9A8C\u6CA1\u6709\u901A\u8FC7\u7684\u6587\u4EF6"]), h("ul", {
14532
14560
  "class": "hr-appendix-directory-error-file-ul"
14533
14561
  }, [this.errorFileList.map(function (item) {
14534
- var nameArr = item.split('/');
14562
+ var nameArr = item.split("/");
14535
14563
  var name = nameArr[nameArr.length - 1];
14536
14564
  return h("li", {
14537
14565
  "class": "hr-appendix-directory-error-file-li"
@@ -14543,7 +14571,19 @@ var index$h = {
14543
14571
  size: "small",
14544
14572
  bordered: true,
14545
14573
  dataSource: dataSource,
14546
- pagination: true
14574
+ pagination: this.modifiedPagination ? _objectSpread$o(_objectSpread$o(_objectSpread$o({}, {
14575
+ pageSizeOptions: ["10", "20", "50", "100"]
14576
+ }), this.modifiedPagination), {
14577
+ size: "small",
14578
+ showTotal: function showTotal(total) {
14579
+ return "".concat(locale.total, " ").concat(total, " ").concat(locale.items);
14580
+ }
14581
+ }) : false
14582
+ },
14583
+ on: {
14584
+ "change": function change(pagination) {
14585
+ _this8._handleTableChange(pagination);
14586
+ }
14547
14587
  }
14548
14588
  }, [h("a-table-column", {
14549
14589
  attrs: {