hrsass-components 1.7.66 → 1.7.68

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.66";
68
+ var version = "1.7.68";
69
69
 
70
70
  /**
71
71
  * 版本号
@@ -881,10 +881,10 @@ __$styleInject(".hr-constant-code {\n width: 100%;\n}\n.hr-constant-code.hr-con
881
881
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
882
882
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
883
883
  var HrConstantCode = {
884
- name: 'HrConstantCode',
884
+ name: "HrConstantCode",
885
885
  model: {
886
- prop: 'value',
887
- event: 'change'
886
+ prop: "value",
887
+ event: "change"
888
888
  },
889
889
  props: {
890
890
  value: {
@@ -896,7 +896,7 @@ var HrConstantCode = {
896
896
  },
897
897
  filterCode: {
898
898
  type: String,
899
- "default": ''
899
+ "default": ""
900
900
  },
901
901
  tags: {
902
902
  type: Boolean,
@@ -924,7 +924,7 @@ var HrConstantCode = {
924
924
  dataset: [],
925
925
  isCustom: false,
926
926
  labelMapping: Object.create(null),
927
- treeLabel: ''
927
+ treeLabel: ""
928
928
  };
929
929
  },
930
930
  watch: {
@@ -944,7 +944,7 @@ var HrConstantCode = {
944
944
  this.updateDataset();
945
945
  }
946
946
  },
947
- 'calcValue.value': {
947
+ "calcValue.value": {
948
948
  handler: function handler(value) {
949
949
  if (this.isTree && value !== undefined && this.finalTreeSeparator !== false) {
950
950
  this.getLabel(value);
@@ -962,6 +962,21 @@ var HrConstantCode = {
962
962
  _this.getLabel(_this.calcValue.value);
963
963
  });
964
964
  }
965
+ this.throttleGetDataset = _.throttle(function (val) {
966
+ var code = _this.code,
967
+ filterCode = _this.filterCode;
968
+ return new Promise(function (resolve) {
969
+ _this.$axios.get("/platform/code/getSubCodeSelectorDataDTO.search?typeCode=".concat(code, "&filterCode=").concat(filterCode), {
970
+ filterStr: val
971
+ }).then(function (res) {
972
+ _this.dataset = _this.dataset.concat(res.codeList || []);
973
+ _this.dataset = _.uniqWith(_this.dataset, function (a, b) {
974
+ return a.code === b.code;
975
+ });
976
+ resolve();
977
+ });
978
+ });
979
+ }, 300);
965
980
  },
966
981
  mounted: function mounted() {
967
982
  if (!this.isCustom) {
@@ -972,32 +987,32 @@ var HrConstantCode = {
972
987
  codeData: function codeData() {
973
988
  var code = this.code,
974
989
  _this$filterCode = this.filterCode,
975
- filterCode = _this$filterCode === void 0 ? '' : _this$filterCode;
990
+ filterCode = _this$filterCode === void 0 ? "" : _this$filterCode;
976
991
  var mappingKey = "".concat(code, "|").concat(filterCode);
977
992
  return this.$store.state.common.constCodes[mappingKey] || {};
978
993
  },
979
994
  type: function type() {
980
- return this.codeData.dataStructure || 'LIST';
995
+ return this.codeData.dataStructure || "LIST";
981
996
  },
982
997
  isTree: function isTree() {
983
- return this.type === 'TREE';
998
+ return this.type === "TREE";
984
999
  },
985
1000
  finalTreeSeparator: function finalTreeSeparator() {
986
1001
  var separator = this.codeData.treeSeparator || this.treeSeparator;
987
1002
  return separator;
988
1003
  },
989
1004
  isAsync: function isAsync() {
990
- return this.codeData.asyncloading === 'yes';
1005
+ return this.codeData.asyncloading === "yes";
991
1006
  },
992
1007
  calcValue: function calcValue() {
993
1008
  var value = this.value;
994
- var val_key = this.isTree ? 'value' : 'key';
1009
+ var val_key = this.isTree ? "value" : "key";
995
1010
  if (_.isArray(value)) {
996
1011
  value = value.map(function (item) {
997
1012
  var val = _defineProperty({}, val_key, item);
998
1013
  if (_.isObject(item)) {
999
1014
  var _val2;
1000
- val = (_val2 = {}, _defineProperty(_val2, val_key, item.code || ''), _defineProperty(_val2, "label", item.name), _val2);
1015
+ val = (_val2 = {}, _defineProperty(_val2, val_key, item.code || ""), _defineProperty(_val2, "label", item.name), _val2);
1001
1016
  }
1002
1017
  return val;
1003
1018
  });
@@ -1034,11 +1049,11 @@ var HrConstantCode = {
1034
1049
  if (this.isTree) {
1035
1050
  props.multiple = true;
1036
1051
  } else {
1037
- props.mode = 'multiple';
1052
+ props.mode = "multiple";
1038
1053
  }
1039
1054
  }
1040
1055
  if (this.tags && !this.isTree) {
1041
- props.mode = 'tags';
1056
+ props.mode = "tags";
1042
1057
  }
1043
1058
  // 搜索对应显示值
1044
1059
  props.showSearch = true;
@@ -1071,16 +1086,16 @@ var HrConstantCode = {
1071
1086
  }
1072
1087
  return nodeData;
1073
1088
  });
1074
- props.treeNodeFilterProp = 'label';
1089
+ props.treeNodeFilterProp = "label";
1075
1090
  props.dropdownStyle = props.dropdownStyle || {
1076
- maxHeight: '400px',
1077
- overflow: 'auto'
1091
+ maxHeight: "400px",
1092
+ overflow: "auto"
1078
1093
  };
1079
1094
  if (this.isAsync) {
1080
1095
  props.loadData = this.onLoadData;
1081
1096
  }
1082
1097
  } else {
1083
- props.optionFilterProp = 'children';
1098
+ props.optionFilterProp = "children";
1084
1099
  }
1085
1100
  if (this.readOnly) {
1086
1101
  props.disabled = true;
@@ -1095,7 +1110,7 @@ var HrConstantCode = {
1095
1110
  filterCode = this.filterCode;
1096
1111
  return new Promise(function (resolve) {
1097
1112
  var _id = treeNode.dataRef._id;
1098
- _this3.$axios.get("/platform/code/getSubCodeSelectorDataDTO.search?typeCode=".concat(code, "&filterCode=").concat(filterCode, "&parentId=").concat(_id)).then(function (res) {
1113
+ _this3.$axios.post("/platform/code/getSubCodeSelectorDataDTO.search?typeCode=".concat(code, "&filterCode=").concat(filterCode, "&parentId=").concat(_id)).then(function (res) {
1099
1114
  _this3.dataset = _this3.dataset.concat(res.codeList || []);
1100
1115
  resolve();
1101
1116
  });
@@ -1104,7 +1119,7 @@ var HrConstantCode = {
1104
1119
  getDataset: function getDataset() {
1105
1120
  var code = this.code,
1106
1121
  filterCode = this.filterCode;
1107
- this.$store.dispatch('setConstCode', {
1122
+ this.$store.dispatch("setConstCode", {
1108
1123
  code: code,
1109
1124
  filterCode: filterCode
1110
1125
  });
@@ -1115,7 +1130,7 @@ var HrConstantCode = {
1115
1130
  }
1116
1131
  var val = args[0],
1117
1132
  others = args.slice(1);
1118
- var val_key = this.isTree ? 'value' : 'key';
1133
+ var val_key = this.isTree ? "value" : "key";
1119
1134
  if (_.isArray(val)) {
1120
1135
  val = val.map(function (item) {
1121
1136
  return {
@@ -1131,11 +1146,15 @@ var HrConstantCode = {
1131
1146
  } else if (val === undefined) {
1132
1147
  val = null;
1133
1148
  }
1134
- this.$emit.apply(this, ['change', val].concat(_toConsumableArray(others)));
1149
+ this.$emit.apply(this, ["change", val].concat(_toConsumableArray(others)));
1150
+ },
1151
+ onSearch: function onSearch(value) {
1152
+ console.log("value==", value);
1153
+ this.throttleGetDataset(value);
1135
1154
  },
1136
1155
  updateDataset: function updateDataset() {
1137
1156
  this.dataset = this.codeData.codeList || [];
1138
- this.$emit('datasetChange', this.dataset);
1157
+ this.$emit("datasetChange", this.dataset);
1139
1158
  },
1140
1159
  setDataset: function setDataset() {
1141
1160
  var dataset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
@@ -1159,8 +1178,8 @@ var HrConstantCode = {
1159
1178
  } else {
1160
1179
  var name = item.name,
1161
1180
  parentCode = item.parentCode;
1162
- var separator = this.finalTreeSeparator === true ? ' ' : this.finalTreeSeparator;
1163
- while (parentCode !== '-1') {
1181
+ var separator = this.finalTreeSeparator === true ? " " : this.finalTreeSeparator;
1182
+ while (parentCode !== "-1") {
1164
1183
  var parentItem = this.dataset.find(function (item) {
1165
1184
  return item.code === parentCode;
1166
1185
  });
@@ -1168,7 +1187,7 @@ var HrConstantCode = {
1168
1187
  name = "".concat(parentItem.name).concat(separator).concat(name);
1169
1188
  parentCode = parentItem.parentCode;
1170
1189
  } else {
1171
- parentCode = '-1';
1190
+ parentCode = "-1";
1172
1191
  }
1173
1192
  }
1174
1193
  this.labelMapping[item.id] = name;
@@ -1193,11 +1212,11 @@ var HrConstantCode = {
1193
1212
  change: this.onChange
1194
1213
  }))
1195
1214
  }, [dataset.map(function (item) {
1196
- if (_this5.type === 'LIST' && item.typeCode && (item.typeCode.includes('LabelColor') || item.typeCode.includes('OrgColor'))) {
1215
+ if (_this5.type === "LIST" && item.typeCode && (item.typeCode.includes("LabelColor") || item.typeCode.includes("OrgColor"))) {
1197
1216
  var colorBlock = {
1198
- width: '16px',
1199
- height: '16px',
1200
- margin: '7px',
1217
+ width: "16px",
1218
+ height: "16px",
1219
+ margin: "7px",
1201
1220
  backgroundColor: item.value
1202
1221
  };
1203
1222
  return h(antDesignVue.Select.Option, {
@@ -1220,12 +1239,13 @@ var HrConstantCode = {
1220
1239
  }, [item.name]);
1221
1240
  }
1222
1241
  })]);
1223
- if (type === 'TREE') {
1242
+ if (type === "TREE") {
1224
1243
  Node = h(antDesignVue.TreeSelect, {
1225
1244
  props: options,
1226
1245
  "class": cls,
1227
1246
  on: _objectSpread$2({}, _objectSpread$2(_objectSpread$2({}, this.$listeners), {}, {
1228
- change: this.onChange
1247
+ change: this.onChange,
1248
+ search: this.onSearch
1229
1249
  }))
1230
1250
  });
1231
1251
  }
@@ -7902,8 +7922,9 @@ var index = {
7902
7922
  //是否显示筛选
7903
7923
  autoLoad: true,
7904
7924
  //自动加载数据
7925
+ // action: { fixed: false, width: 100 }, //操作列宽度和锁定
7905
7926
  action: {
7906
- fixed: false,
7927
+ fixed: 'right',
7907
7928
  width: 100
7908
7929
  },
7909
7930
  //操作列宽度和锁定
@@ -8212,6 +8233,7 @@ var index = {
8212
8233
  var lockLen = columnList.filter(function (o) {
8213
8234
  return o.checked != false && o.lock;
8214
8235
  }).length;
8236
+ if (action.fixed) lockLen++;
8215
8237
  if (lockLen > 0) {
8216
8238
  var paddingWidth = dataSource.length > 0 ? 17 : 0;
8217
8239
  var columns = columnList.filter(function (o) {
@@ -8237,7 +8259,7 @@ var index = {
8237
8259
  }
8238
8260
  }
8239
8261
  var tableWidth = this.$refs.tableBase ? this.$refs.tableBase.$el.clientWidth : 0;
8240
- var resultWidth = selectionWidth + width + actionWidth;
8262
+ var resultWidth = selectionWidth + width + actionWidth + widthLessColumns.length * 100;
8241
8263
  result = resultWidth > tableWidth ? resultWidth : null;
8242
8264
  }
8243
8265
  this.setState({