hrsass-components 1.7.8 → 1.7.12

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.8";
68
+ var version = "1.7.12";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -3496,12 +3496,12 @@ var HrAppendix = {
3496
3496
  type: Number,
3497
3497
  "default": 0
3498
3498
  },
3499
- //支持文件上传类型
3499
+ //支持文件上传类型,多个以逗号隔开(*.jpg,*.gif,*.zip)
3500
3500
  fileTypes: {
3501
3501
  type: String,
3502
- "default": '*'
3502
+ "default": "*"
3503
3503
  },
3504
- //限制单个文件大小
3504
+ //限制单个文件大小,单位KB
3505
3505
  fileSizeLimit: {
3506
3506
  type: Number,
3507
3507
  "default": 10240
@@ -3613,9 +3613,9 @@ var HrAppendix = {
3613
3613
  },
3614
3614
  fileTypeArr: function fileTypeArr() {
3615
3615
  if (!this.fileTypes) return [];
3616
- var fileTypes = this.fileTypes.split(',').filter(Boolean);
3616
+ var fileTypes = this.fileTypes.split(",").filter(Boolean);
3617
3617
  return fileTypes.map(function (type) {
3618
- return type.replace('.', '\\.').replace('*', '.*');
3618
+ return type.replace(".", "\\.").replace("*", ".*");
3619
3619
  });
3620
3620
  },
3621
3621
  // 值矫正
@@ -3653,7 +3653,7 @@ var HrAppendix = {
3653
3653
  });
3654
3654
 
3655
3655
  var _fileList = _.cloneDeep(cleanFileList).map(function (file) {
3656
- if (file.name === 'null') {
3656
+ if (file.name === "null") {
3657
3657
  file.name = _this.locale.uploadError;
3658
3658
  }
3659
3659
 
@@ -3695,30 +3695,42 @@ var HrAppendix = {
3695
3695
  },
3696
3696
  methods: {
3697
3697
  beforeUpload: function beforeUpload(file) {
3698
- //验证文件类型、文件大小
3699
- var name = file.name,
3700
- size = file.size;
3701
- var types = this.fileTypeArr;
3702
- var result = true;
3703
-
3704
- if (types.length) {
3705
- result = types.some(function (type) {
3706
- return new RegExp(type + '$', 'ig').test(name);
3707
- });
3708
- }
3698
+ var _this2 = this;
3709
3699
 
3710
- if (!result) {
3711
- this.$message.error("".concat(this.locale.fileTypeError, " (").concat(this.fileTypes, ")"));
3712
- } else {
3713
- if (this.fileSizeLimit > 0) {
3714
- if (this.fileSizeLimit * 1024 < size) {
3715
- result = false;
3716
- this.$message.error("".concat(this.locale.fileSizeError, " (").concat(this.fileSizeLimit, "KB)"));
3700
+ return new Promise(function (resolve, reject) {
3701
+ //验证文件类型、文件大小
3702
+ var name = file.name,
3703
+ size = file.size;
3704
+ var types = _this2.fileTypeArr;
3705
+ var result = true;
3706
+
3707
+ if (types.length) {
3708
+ result = types.some(function (type) {
3709
+ return new RegExp(type + "$", "ig").test(name);
3710
+ });
3711
+ }
3712
+
3713
+ if (!result) {
3714
+ _this2.$message.error("".concat(_this2.locale.fileTypeError, " (").concat(_this2.fileTypes, ")"));
3715
+ } else {
3716
+ if (_this2.fileSizeLimit > 0) {
3717
+ if (_this2.fileSizeLimit * 1024 < size) {
3718
+ result = false;
3719
+ var num = _this2.fileSizeLimit / 1024;
3720
+
3721
+ if (num > 0) {
3722
+ num = "".concat(Number(num.toFixed(2)), "MB");
3723
+ } else {
3724
+ num = "".concat(_this2.fileSizeLimit, "KB");
3725
+ }
3726
+
3727
+ _this2.$message.error("".concat(_this2.locale.fileSizeError, " (").concat(num, ")"));
3728
+ }
3717
3729
  }
3718
3730
  }
3719
- }
3720
3731
 
3721
- return result;
3732
+ result ? resolve(file) : reject(file);
3733
+ });
3722
3734
  },
3723
3735
  capture: function capture(dataUrl, prefix) {
3724
3736
  var reg0 = new RegExp(String.fromCharCode(0), "g");
@@ -3739,7 +3751,7 @@ var HrAppendix = {
3739
3751
  },
3740
3752
  // 通过接口根据值获取文件列表
3741
3753
  getFileList: function getFileList() {
3742
- var _this2 = this;
3754
+ var _this3 = this;
3743
3755
 
3744
3756
  var files = _.isArray(this.value) ? _.compact(this.value).join(",") : this.value;
3745
3757
 
@@ -3752,22 +3764,22 @@ var HrAppendix = {
3752
3764
  uid: "".concat(fileId),
3753
3765
  name: fileName,
3754
3766
  status: "done",
3755
- url: "".concat(_this2.fileUrl).concat(fileId)
3767
+ url: "".concat(_this3.fileUrl).concat(fileId)
3756
3768
  };
3757
3769
 
3758
- if (_this2.listType !== "text") {
3770
+ if (_this3.listType !== "text") {
3759
3771
  fileObj.type = "image";
3760
3772
  }
3761
3773
 
3762
3774
  return fileObj;
3763
3775
  });
3764
- _this2.fileList = fileList;
3776
+ _this3.fileList = fileList;
3765
3777
  });
3766
3778
  }
3767
3779
  },
3768
3780
  // 针对原上传组件的change事件做拦截, 同步fileList以及处理value
3769
3781
  change: function change(_ref3) {
3770
- var _this3 = this;
3782
+ var _this4 = this;
3771
3783
 
3772
3784
  var _ref3$file = _ref3.file,
3773
3785
  file = _ref3$file === void 0 ? {} : _ref3$file,
@@ -3798,7 +3810,7 @@ var HrAppendix = {
3798
3810
 
3799
3811
  fileList = fileList.map(function (file) {
3800
3812
  if (file.response) {
3801
- file.url = "".concat(_this3.fileUrl).concat(file.response.fileId);
3813
+ file.url = "".concat(_this4.fileUrl).concat(file.response.fileId);
3802
3814
  }
3803
3815
 
3804
3816
  return file;
@@ -3806,7 +3818,7 @@ var HrAppendix = {
3806
3818
  this.fileList = fileList;
3807
3819
  },
3808
3820
  realRemove: function realRemove(file) {
3809
- var _this4 = this;
3821
+ var _this5 = this;
3810
3822
 
3811
3823
  // 获取问卷标识(分两种情况:1.本次上传的存储在response中 2.预设值的存在uid中)
3812
3824
  var fileId = file.response && file.response.fileId || file.uid;
@@ -3829,18 +3841,18 @@ var HrAppendix = {
3829
3841
  }
3830
3842
 
3831
3843
  return new Promise(function (resolve, reject) {
3832
- _this4.$axios.get("/file.nolog?method=delete&fileId=".concat(fileId)).then(function (resp) {
3833
- _this4.fileList = _this4.fileList.filter(function (file) {
3844
+ _this5.$axios.get("/file.nolog?method=delete&fileId=".concat(fileId)).then(function (resp) {
3845
+ _this5.fileList = _this5.fileList.filter(function (file) {
3834
3846
  var fId = file.response && file.response.fileId || file.uid;
3835
3847
  return fId !== fileId;
3836
3848
  });
3837
3849
 
3838
- if (_this4.multiple) {
3839
- _this4.emitChange(_this4.value.filter(function (item) {
3850
+ if (_this5.multiple) {
3851
+ _this5.emitChange(_this5.value.filter(function (item) {
3840
3852
  return "".concat(item) !== "".concat(fileId);
3841
3853
  }));
3842
3854
  } else {
3843
- _this4.emitChange(0);
3855
+ _this5.emitChange(0);
3844
3856
  }
3845
3857
 
3846
3858
  resolve();
@@ -3851,7 +3863,7 @@ var HrAppendix = {
3851
3863
  },
3852
3864
  // 文件删除
3853
3865
  fileRemove: function fileRemove(file, locale) {
3854
- var _this5 = this;
3866
+ var _this6 = this;
3855
3867
 
3856
3868
  // 禁用或只读情况下阻止删除
3857
3869
  if (this.disabled || this.readOnly) {
@@ -3860,12 +3872,12 @@ var HrAppendix = {
3860
3872
  }
3861
3873
 
3862
3874
  return new Promise(function (resolve, reject) {
3863
- _this5.$confirm({
3875
+ _this6.$confirm({
3864
3876
  title: locale.isDeleteTip,
3865
3877
  okText: locale.confirm,
3866
3878
  cancelText: locale.cancel,
3867
3879
  onOk: function onOk() {
3868
- resolve(_this5.realRemove(file));
3880
+ resolve(_this6.realRemove(file));
3869
3881
  },
3870
3882
  onCancel: function onCancel() {
3871
3883
  reject();
@@ -3887,7 +3899,7 @@ var HrAppendix = {
3887
3899
  window.open("".concat(baseUrl, "/file.nolog?method=preview&fileId=").concat(fileId));
3888
3900
  },
3889
3901
  _renderAppendix: function _renderAppendix(locale) {
3890
- var _this6 = this;
3902
+ var _this7 = this;
3891
3903
 
3892
3904
  var h = this.$createElement;
3893
3905
  this.locale = locale;
@@ -3932,9 +3944,12 @@ var HrAppendix = {
3932
3944
  var options = _objectSpread$6({}, this.options);
3933
3945
 
3934
3946
  options.props.remove = function (file) {
3935
- return _this6.fileRemove(file, locale);
3947
+ return _this7.fileRemove(file, locale);
3936
3948
  };
3937
3949
 
3950
+ options.props.showUploadList = {
3951
+ showRemoveIcon: !disabled
3952
+ };
3938
3953
  var $appendix;
3939
3954
 
3940
3955
  if (this.listType === "text" && this.$attrs.showUploadList !== false && this.multiple) {
@@ -3953,7 +3968,7 @@ var HrAppendix = {
3953
3968
  change: function change(_ref4) {
3954
3969
  var dataUrl = _ref4.dataUrl,
3955
3970
  prefix = _ref4.prefix;
3956
- return _this6.capture(dataUrl, prefix);
3971
+ return _this7.capture(dataUrl, prefix);
3957
3972
  }
3958
3973
  }
3959
3974
  })])]), h("a-table", {
@@ -3992,7 +4007,7 @@ var HrAppendix = {
3992
4007
  },
3993
4008
  on: {
3994
4009
  click: function click() {
3995
- return _this6.preview(fileId);
4010
+ return _this7.preview(fileId);
3996
4011
  }
3997
4012
  }
3998
4013
  }), h("a-button", {
@@ -4002,17 +4017,17 @@ var HrAppendix = {
4002
4017
  },
4003
4018
  on: {
4004
4019
  click: function click() {
4005
- return _this6.downloadItem(fileId);
4020
+ return _this7.downloadItem(fileId);
4006
4021
  }
4007
4022
  }
4008
- }), _this6.readOnly ? null : h("a-button", {
4023
+ }), _this7.readOnly ? null : h("a-button", {
4009
4024
  props: {
4010
4025
  type: "link",
4011
4026
  icon: "close"
4012
4027
  },
4013
4028
  on: {
4014
4029
  click: function click() {
4015
- return _this6.fileRemove(record, locale);
4030
+ return _this7.fileRemove(record, locale);
4016
4031
  }
4017
4032
  }
4018
4033
  })]);
@@ -4030,7 +4045,7 @@ var HrAppendix = {
4030
4045
  } : {},
4031
4046
  on: {
4032
4047
  change: function change(dataUrl) {
4033
- return _this6.capture(dataUrl);
4048
+ return _this7.capture(dataUrl);
4034
4049
  }
4035
4050
  }
4036
4051
  })]), h("a-upload", options, [btn ? this.$slots["default"] || btn : null])]);
@@ -4067,6 +4082,10 @@ var HrAvatar = {
4067
4082
  type: String,
4068
4083
  "default": ''
4069
4084
  },
4085
+ ename: {
4086
+ type: String,
4087
+ "default": ''
4088
+ },
4070
4089
  // 存在于文件服务器中的图片只需传此属性
4071
4090
  fileId: {
4072
4091
  type: [String, Number],
@@ -4085,7 +4104,9 @@ var HrAvatar = {
4085
4104
  },
4086
4105
  computed: {
4087
4106
  userName: function userName() {
4088
- return this.name || this.$slots["default"];
4107
+ var isEn = this.$i18n.locale === 'en_US';
4108
+ var ename = isEn && this.ename;
4109
+ return ename || this.name || this.$slots["default"];
4089
4110
  },
4090
4111
  avatarOptions: function avatarOptions() {
4091
4112
  var props = _.cloneDeep(this.$attrs);
@@ -4827,7 +4848,8 @@ var FilterProps = {
4827
4848
  locale: VuePropTypes.object,
4828
4849
  schemeList: VuePropTypes.array,
4829
4850
  code: VuePropTypes.string,
4830
- selectedSchemeId: VuePropTypes.any
4851
+ selectedSchemeId: VuePropTypes.any,
4852
+ mask: VuePropTypes.bool
4831
4853
  };
4832
4854
  var ToolbarProps = {
4833
4855
  prefixCls: VuePropTypes.string,
@@ -4852,7 +4874,8 @@ var SettingProps = {
4852
4874
  prefixCls: VuePropTypes.string,
4853
4875
  visible: VuePropTypes.bool,
4854
4876
  data: VuePropTypes.array,
4855
- locale: VuePropTypes.object
4877
+ locale: VuePropTypes.object,
4878
+ mask: VuePropTypes.bool
4856
4879
  };
4857
4880
  var SchemeProps = {
4858
4881
  prefixCls: VuePropTypes.string,
@@ -5379,7 +5402,8 @@ var Setting = {
5379
5402
  props: initDefaultProps(SettingProps, {
5380
5403
  prefixCls: 'hr-table-base-setting',
5381
5404
  data: [],
5382
- locale: {}
5405
+ locale: {},
5406
+ mask: true
5383
5407
  }),
5384
5408
  data: function data() {
5385
5409
  return {
@@ -5436,6 +5460,8 @@ var Setting = {
5436
5460
  isCheckAll = this.isCheckAll,
5437
5461
  indeterminate = this.indeterminate;
5438
5462
  var prefixCls = props.prefixCls,
5463
+ _props$mask = props.mask,
5464
+ mask = _props$mask === void 0 ? true : _props$mask,
5439
5465
  cls = props["class"],
5440
5466
  visible = props.visible,
5441
5467
  data = props.data,
@@ -5444,7 +5470,7 @@ var Setting = {
5444
5470
  attrs: {
5445
5471
  width: '300',
5446
5472
  placement: "right",
5447
- mask: false,
5473
+ mask: mask,
5448
5474
  closable: false,
5449
5475
  visible: visible,
5450
5476
  wrapClassName: classNames(prefixCls, cls)
@@ -6591,8 +6617,9 @@ var Filter = {
6591
6617
  locale: {},
6592
6618
  schemeList: [],
6593
6619
  //方案列表
6594
- selectedSchemeId: null //选择的方案id
6595
-
6620
+ selectedSchemeId: null,
6621
+ //选择的方案id
6622
+ mask: true
6596
6623
  }),
6597
6624
  data: function data() {
6598
6625
  return {
@@ -7011,6 +7038,8 @@ var Filter = {
7011
7038
  eidtData = this.eidtData;
7012
7039
  var props = getOptionProps(this);
7013
7040
  var prefixCls = props.prefixCls,
7041
+ _props$mask = props.mask,
7042
+ mask = _props$mask === void 0 ? true : _props$mask,
7014
7043
  hasReset = props.hasReset,
7015
7044
  cls = props["class"],
7016
7045
  visible = props.visible,
@@ -7019,7 +7048,7 @@ var Filter = {
7019
7048
  attrs: {
7020
7049
  width: "300",
7021
7050
  placement: "right",
7022
- mask: false,
7051
+ mask: mask,
7023
7052
  closable: false,
7024
7053
  visible: visible,
7025
7054
  wrapClassName: "".concat(prefixCls)
@@ -8883,7 +8912,8 @@ var index = {
8883
8912
  if (id) {
8884
8913
  _this12._getSchemeList(id);
8885
8914
  } else {
8886
- _this12.selectedSchemeId = null;
8915
+ // this.selectedSchemeId = null;
8916
+ _this12._getSchemeList();
8887
8917
  }
8888
8918
  },
8889
8919
  "tempSearch": function tempSearch(tempConditionList, schemeId) {
@@ -13164,33 +13194,7 @@ var en_US = {
13164
13194
  selectAll: 'Select all',
13165
13195
  searchPlaceholder: 'Please enter keywords',
13166
13196
  loading: 'Loading'
13167
- } // Modal: {
13168
- // okText: '确定',
13169
- // cancelText: '取消',
13170
- // justOkText: '知道了',
13171
- // },
13172
- // Popconfirm: {
13173
- // cancelText: '取消',
13174
- // okText: '确定',
13175
- // },
13176
- // Transfer: {
13177
- // searchPlaceholder: '请输入搜索内容',
13178
- // itemUnit: '项',
13179
- // itemsUnit: '项',
13180
- // },
13181
- // Upload: {
13182
- // uploading: '文件上传中',
13183
- // removeFile: '删除文件',
13184
- // uploadError: '上传错误',
13185
- // previewFile: '预览文件',
13186
- // },
13187
- // Empty: {
13188
- // description: '暂无数据',
13189
- // },
13190
- // Icon: {
13191
- // icon: '图标',
13192
- // },
13193
-
13197
+ }
13194
13198
  };
13195
13199
 
13196
13200
  function ownKeys$m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -13282,6 +13286,7 @@ var index$7 = {
13282
13286
  }
13283
13287
 
13284
13288
  props.name = data.name;
13289
+ props.ename = data.ename;
13285
13290
  return {
13286
13291
  props: props
13287
13292
  };
@@ -13607,6 +13612,7 @@ var HrAddrBookCard = {
13607
13612
  fileId: data.fileId,
13608
13613
  img: data.photo,
13609
13614
  name: data.name,
13615
+ ename: data.english_name,
13610
13616
  size: size
13611
13617
  },
13612
13618
  ref: "avatar"