eoss-ui 0.4.86 → 0.4.88

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.
package/lib/data-table.js CHANGED
@@ -3459,8 +3459,8 @@ module.exports = require("vue");
3459
3459
  // ESM COMPAT FLAG
3460
3460
  __webpack_require__.r(__webpack_exports__);
3461
3461
 
3462
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=5975d010&
3463
- var mainvue_type_template_id_5975d010_render = function () {
3462
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=8d31e592&
3463
+ var mainvue_type_template_id_8d31e592_render = function () {
3464
3464
  var _vm = this
3465
3465
  var _h = _vm.$createElement
3466
3466
  var _c = _vm._self._c || _h
@@ -3796,10 +3796,10 @@ var mainvue_type_template_id_5975d010_render = function () {
3796
3796
  )
3797
3797
  }
3798
3798
  var staticRenderFns = []
3799
- mainvue_type_template_id_5975d010_render._withStripped = true
3799
+ mainvue_type_template_id_8d31e592_render._withStripped = true
3800
3800
 
3801
3801
 
3802
- // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=5975d010&
3802
+ // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=8d31e592&
3803
3803
 
3804
3804
  // EXTERNAL MODULE: ./src/config/api.js
3805
3805
  var api = __webpack_require__(1);
@@ -6530,7 +6530,12 @@ var mainvue_type_script_lang_js_components;
6530
6530
 
6531
6531
  theads: {
6532
6532
  get: function get() {
6533
- return typeof this.thead === 'string' ? this.theadData : this.thead;
6533
+ if (typeof this.thead === 'string') {
6534
+ this.theadData.length && this.setMinWidth(this.theadData);
6535
+ return this.theadData;
6536
+ }
6537
+ this.setMinWidth(this.thead);
6538
+ return this.thead;
6534
6539
  },
6535
6540
  set: function set(val) {
6536
6541
  return val;
@@ -6665,6 +6670,7 @@ var mainvue_type_script_lang_js_components;
6665
6670
  this.getOptions(this.thead);
6666
6671
  }
6667
6672
  this.immediate && this.getTableData();
6673
+ this.chekOpenTotalArea();
6668
6674
  },
6669
6675
  mounted: function mounted() {
6670
6676
  this.datas.length && this.checkSelect(this.checked);
@@ -6687,48 +6693,64 @@ var mainvue_type_script_lang_js_components;
6687
6693
  }
6688
6694
  return false;
6689
6695
  },
6690
- getOptions: function getOptions(res) {
6696
+ setMinWidth: function setMinWidth(obj) {
6691
6697
  var _this2 = this;
6692
6698
 
6699
+ obj.forEach(function (item) {
6700
+ if (item.childHead && item.childHead.length) {
6701
+ _this2.setMinWidth(item.childHead);
6702
+ } else if (item.children && item.children.length) {
6703
+ _this2.setMinWidth(item.children);
6704
+ } else if (!item.width && !item.minWidth && item.title) {
6705
+ var width = item.title.length * 14 + 20;
6706
+ if (width > 80) {
6707
+ _this2.$set(item, 'minWidth', width);
6708
+ }
6709
+ }
6710
+ });
6711
+ },
6712
+ getOptions: function getOptions(res) {
6713
+ var _this3 = this;
6714
+
6693
6715
  res.forEach(function (item) {
6694
6716
  if (item.sysCode || item.url) {
6695
6717
  var params = util["a" /* default */].extend({}, item.sysCode ? { sysAppCode: item.sysCode } : {}, item.param ? item.param : {});
6696
- var key = _this2.getRequestKey({
6697
- method: _this2.method,
6718
+ var key = _this3.getRequestKey({
6719
+ method: _this3.method,
6698
6720
  url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6699
6721
  params: params,
6700
6722
  data: {}
6701
6723
  });
6702
- if (!_this2.requests.includes(key)) {
6724
+ if (!_this3.requests.includes(key)) {
6703
6725
  util["a" /* default */].ajax({
6704
6726
  url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6705
- method: _this2.method,
6727
+ method: _this3.method,
6706
6728
  params: params,
6707
6729
  data: params
6708
6730
  }).then(function (res) {
6709
6731
  if (res.rCode === 0) {
6710
6732
  if (item.type == 'ganged') {
6711
- _this2.$set(_this2.options, item.field || item.prop, [JSON.parse(JSON.stringify(res.results))]);
6733
+ _this3.$set(_this3.options, item.field || item.prop, [JSON.parse(JSON.stringify(res.results))]);
6712
6734
  } else {
6713
- _this2.$set(_this2.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6735
+ _this3.$set(_this3.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6714
6736
  }
6715
- _this2.requests.push(key);
6737
+ _this3.requests.push(key);
6716
6738
  } else {
6717
6739
  var msg = res.msg || '系统错误,请联系管理员!';
6718
- _this2.$message.error(msg);
6740
+ _this3.$message.error(msg);
6719
6741
  }
6720
6742
  }).catch(function (err) {
6721
6743
  if (err.message && err.message !== 'canceled') {
6722
- _this2.$message.error(err.message);
6744
+ _this3.$message.error(err.message);
6723
6745
  }
6724
6746
  });
6725
6747
  }
6726
6748
  } else {
6727
6749
  if (item.childHead && item.childHead.length) {
6728
- _this2.getOptions(item.childHead);
6750
+ _this3.getOptions(item.childHead);
6729
6751
  }
6730
6752
  if (item.children && item.children.length) {
6731
- _this2.getOptions(item.children);
6753
+ _this3.getOptions(item.children);
6732
6754
  }
6733
6755
  }
6734
6756
  });
@@ -6737,7 +6759,7 @@ var mainvue_type_script_lang_js_components;
6737
6759
  return util["a" /* default */].getObjectType(item) === 'object';
6738
6760
  },
6739
6761
  chekOpenTotalArea: function chekOpenTotalArea() {
6740
- var _this3 = this;
6762
+ var _this4 = this;
6741
6763
 
6742
6764
  if (this.total || this.showSummary) {
6743
6765
  this.showTotal = true;
@@ -6746,7 +6768,7 @@ var mainvue_type_script_lang_js_components;
6746
6768
  var arr = JSON.parse(JSON.stringify(this.theads));
6747
6769
  arr.forEach(function (item) {
6748
6770
  if (item.total) {
6749
- _this3.showTotal = true;
6771
+ _this4.showTotal = true;
6750
6772
  }
6751
6773
  });
6752
6774
  },
@@ -6779,27 +6801,27 @@ var mainvue_type_script_lang_js_components;
6779
6801
  });
6780
6802
  },
6781
6803
  checkSelect: function checkSelect(newVal) {
6782
- var _this4 = this;
6804
+ var _this5 = this;
6783
6805
 
6784
6806
  this.$nextTick(function () {
6785
6807
  if (util["a" /* default */].getObjectType(newVal) === 'array') {
6786
6808
  newVal.forEach(function (row) {
6787
6809
  if (util["a" /* default */].isObject(row)) {
6788
- _this4.$refs.oaTable.toggleRowSelection(row, true);
6789
- } else _this4.datas.forEach(function (item) {
6790
- if (item[_this4.checkedKey] === row) {
6791
- _this4.$refs.oaTable.toggleRowSelection(item, true);
6810
+ _this5.$refs.oaTable.toggleRowSelection(row, true);
6811
+ } else _this5.datas.forEach(function (item) {
6812
+ if (item[_this5.checkedKey] === row) {
6813
+ _this5.$refs.oaTable.toggleRowSelection(item, true);
6792
6814
  return;
6793
6815
  }
6794
6816
  });
6795
6817
  });
6796
6818
  } else if (newVal === true) {
6797
- _this4.toggleAllSelection();
6819
+ _this5.toggleAllSelection();
6798
6820
  }
6799
6821
  });
6800
6822
  },
6801
6823
  getTheads: function getTheads() {
6802
- var _this5 = this;
6824
+ var _this6 = this;
6803
6825
 
6804
6826
  util["a" /* default */].ajax({
6805
6827
  url: this.thead,
@@ -6811,27 +6833,27 @@ var mainvue_type_script_lang_js_components;
6811
6833
  if (res.rCode === 0) {
6812
6834
  var results = res.results;
6813
6835
  if (Array.isArray(results)) {
6814
- _this5.theadData = results;
6836
+ _this6.theadData = results;
6815
6837
  } else {
6816
- _this5.theadData = results.theadData || [];
6817
- _this5.list = results.data || results.records || [];
6818
- _this5.config.totalCount = results.count || results.total || results.totalCount;
6819
- _this5.getOptions(_this5.theadData);
6838
+ _this6.theadData = results.theadData || [];
6839
+ _this6.list = results.data || results.records || [];
6840
+ _this6.config.totalCount = results.count || results.total || results.totalCount;
6841
+ _this6.getOptions(_this6.theadData);
6820
6842
  }
6821
6843
  } else {
6822
- _this5.theadData = [];
6844
+ _this6.theadData = [];
6823
6845
  var msg = res.msg || '系统错误,请联系管理员!';
6824
- _this5.$message.error(msg);
6846
+ _this6.$message.error(msg);
6825
6847
  }
6826
- _this5.$emit('success', res);
6848
+ _this6.$emit('success', res);
6827
6849
  }).catch(function (err) {
6828
6850
  if (err.message && err.message !== 'canceled') {
6829
- _this5.$message.error(err.message);
6851
+ _this6.$message.error(err.message);
6830
6852
  }
6831
6853
  });
6832
6854
  },
6833
6855
  getTableData: function getTableData(res) {
6834
- var _this6 = this;
6856
+ var _this7 = this;
6835
6857
 
6836
6858
  var where = void 0;
6837
6859
  var first = void 0;
@@ -6861,27 +6883,27 @@ var mainvue_type_script_lang_js_components;
6861
6883
  params: reqData,
6862
6884
  data: reqData
6863
6885
  }).then(function (res) {
6864
- _this6.tableLoading = false;
6886
+ _this7.tableLoading = false;
6865
6887
  if (res.rCode === 0 || res.status === 'success') {
6866
- var results = _this6.parseData !== undefined ? _this6.parseData(res.results || res.data || res) : res.results || res.data;
6867
- _this6.list = results.data || results.records || results.list || [];
6868
- _this6.config.totalCount = results.count || results.total || results.totalCount;
6869
- _this6.checked && _this6.$nextTick(function () {
6870
- _this6.checkSelect(_this6.checked);
6888
+ var results = _this7.parseData !== undefined ? _this7.parseData(res.results || res.data || res) : res.results || res.data;
6889
+ _this7.list = results.data || results.records || results.list || [];
6890
+ _this7.config.totalCount = results.count || results.total || results.totalCount;
6891
+ _this7.checked && _this7.$nextTick(function () {
6892
+ _this7.checkSelect(_this7.checked);
6871
6893
  });
6872
6894
  } else {
6873
- _this6.list = [];
6895
+ _this7.list = [];
6874
6896
  //this.tableHeight = false;
6875
6897
  var msg = res.msg || '系统错误,请联系管理员!';
6876
- _this6.$message.error(msg);
6898
+ _this7.$message.error(msg);
6877
6899
  }
6878
- _this6.$emit('success', res);
6900
+ _this7.$emit('success', res);
6879
6901
  }).catch(function (err) {
6880
6902
  //this.tableHeight = false;
6881
6903
  if (err.message && err.message !== 'canceled') {
6882
- _this6.$message.error(err.message);
6904
+ _this7.$message.error(err.message);
6883
6905
  }
6884
- _this6.tableLoading = false;
6906
+ _this7.tableLoading = false;
6885
6907
  });
6886
6908
  },
6887
6909
  selectionChange: function selectionChange(data) {
@@ -6926,7 +6948,7 @@ var mainvue_type_script_lang_js_components;
6926
6948
  this.$emit('change', data, this.datas);
6927
6949
  },
6928
6950
  handleAjax: function handleAjax(handle, row) {
6929
- var _this7 = this;
6951
+ var _this8 = this;
6930
6952
 
6931
6953
  this.changeLoading(true, handle.text + '\u4E2D...');
6932
6954
  var params = handle.param || {};
@@ -6982,9 +7004,9 @@ var mainvue_type_script_lang_js_components;
6982
7004
  method: handle.method,
6983
7005
  format: handle.format
6984
7006
  }).then(function (res) {
6985
- _this7.changeLoading(false);
7007
+ _this8.changeLoading(false);
6986
7008
  if (res.rCode === 0) {
6987
- _this7.$message({
7009
+ _this8.$message({
6988
7010
  message: handle.text + '\u6210\u529F',
6989
7011
  duration: 2000,
6990
7012
  type: 'success',
@@ -6992,17 +7014,17 @@ var mainvue_type_script_lang_js_components;
6992
7014
  var first = Object.prototype.hasOwnProperty.call(handle, 'first') ? handle.first : false;
6993
7015
  var reload = handle.reload || true;
6994
7016
  if (reload) {
6995
- _this7.reload({}, first);
7017
+ _this8.reload({}, first);
6996
7018
  }
6997
7019
  }
6998
7020
  });
6999
7021
  } else {
7000
- _this7.$message.error(res.msg || handle.text + '\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01');
7022
+ _this8.$message.error(res.msg || handle.text + '\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01');
7001
7023
  }
7002
7024
  }).catch(function (err) {
7003
- _this7.changeLoading(false);
7025
+ _this8.changeLoading(false);
7004
7026
  if (err.message && err.message !== 'canceled') {
7005
- _this7.$message.error(err.message);
7027
+ _this8.$message.error(err.message);
7006
7028
  }
7007
7029
  });
7008
7030
  },
@@ -7027,7 +7049,7 @@ var mainvue_type_script_lang_js_components;
7027
7049
  return mainvue_type_script_lang_js_extends({}, obj, item);
7028
7050
  },
7029
7051
  handleClick: function handleClick(res) {
7030
- var _this8 = this;
7052
+ var _this9 = this;
7031
7053
 
7032
7054
  var row = res.row,
7033
7055
  handle = res.handle;
@@ -7063,7 +7085,7 @@ var mainvue_type_script_lang_js_components;
7063
7085
  cancelButtonText: '取消',
7064
7086
  type: 'warning'
7065
7087
  }).then(function () {
7066
- _this8.handleAjax(handle, rows);
7088
+ _this9.handleAjax(handle, rows);
7067
7089
  }).catch(function () {});
7068
7090
  } else {
7069
7091
  this.handleAjax(handle, rows);
@@ -7256,37 +7278,41 @@ var mainvue_type_script_lang_js_components;
7256
7278
  }
7257
7279
  },
7258
7280
  resetHeight: function resetHeight(warn) {
7259
- var _this9 = this;
7281
+ var _this10 = this;
7260
7282
 
7261
7283
  this.$nextTick(function () {
7262
- if (_this9.full && !_this9.height && !_this9.maxHeight) {
7263
- var height = _this9.$el.parentNode.offsetHeight;
7284
+ if (_this10.full && !_this10.height && !_this10.maxHeight) {
7285
+ var height = _this10.$el.parentNode.offsetHeight;
7264
7286
  if (height) {
7265
- height = parseInt(util["a" /* default */].getStyle(_this9.$el.parentNode, 'height', '%'), 10);
7266
- height = (height == NaN ? 0 : height) - parseInt(util["a" /* default */].getStyle(_this9.$el.parentNode, 'padding-top'), 10) - parseInt(util["a" /* default */].getStyle(_this9.$el.parentNode, 'padding-bottom'), 10);
7267
- for (var i = 0; i < _this9.$el.parentNode.childNodes.length; i++) {
7268
- var ele = _this9.$el.parentNode.childNodes[i];
7269
- if (ele !== _this9.$el && ele.offsetHeight !== undefined) {
7287
+ height = parseInt(util["a" /* default */].getStyle(_this10.$el.parentNode, 'height', '%'), 10);
7288
+ height = (height == NaN ? 0 : height) - parseInt(util["a" /* default */].getStyle(_this10.$el.parentNode, 'padding-top'), 10) - parseInt(util["a" /* default */].getStyle(_this10.$el.parentNode, 'padding-bottom'), 10);
7289
+ for (var i = 0; i < _this10.$el.parentNode.childNodes.length; i++) {
7290
+ var ele = _this10.$el.parentNode.childNodes[i];
7291
+ if (ele !== _this10.$el && ele.offsetHeight !== undefined) {
7270
7292
  height = height - ele.offsetHeight - parseInt(util["a" /* default */].getStyle(ele, 'margin-top'), 10) - parseInt(util["a" /* default */].getStyle(ele, 'margin-bottom'), 10);
7271
7293
  }
7272
7294
  }
7273
- height -= _this9.showToolbar ? 45 : 0;
7274
- height -= _this9.page === false ? 0 : 46;
7275
- height -= _this9.title ? _this9.$refs.title.offsetHeight : 0;
7276
- height -= parseInt(util["a" /* default */].getStyle(_this9.$refs.esTableContent, 'padding-top'), 10);
7277
- height -= parseInt(util["a" /* default */].getStyle(_this9.$refs.esTableContent, 'padding-bottom'), 10);
7278
- var emptyText = _this9.$refs.esTableContent.querySelector('.el-table__empty-text');
7295
+ height -= _this10.showToolbar ? 45 : 0;
7296
+ height -= _this10.page === false ? 0 : 46;
7297
+ height -= _this10.title ? _this10.$refs.title.offsetHeight : 0;
7298
+ height -= parseInt(util["a" /* default */].getStyle(_this10.$refs.esTableContent, 'padding-top'), 10);
7299
+ height -= parseInt(util["a" /* default */].getStyle(_this10.$refs.esTableContent, 'padding-bottom'), 10);
7300
+ var emptyText = _this10.$refs.esTableContent.querySelector('.el-table__empty-text');
7279
7301
  var eht = 0;
7280
7302
  if (emptyText) {
7281
7303
  eht = emptyText.offsetHeight;
7282
- var thead = _this9.$refs.esTableContent.querySelector('.el-table__header');
7304
+ var thead = _this10.$refs.esTableContent.querySelector('.el-table__header');
7283
7305
  thead && (eht += thead.offsetHeight);
7284
7306
  }
7285
7307
  if (height > 1 && height - eht > 1) {
7286
- _this9.tableHeight = height;
7308
+ _this10.tableHeight = height;
7287
7309
  } else {
7288
- console.warn(_this9.$el.parentNode, '\u83B7\u53D6\u4E0D\u5230\u9AD8\u5EA6\uFF01');
7310
+ console.warn(_this10.$el.parentNode, '\u83B7\u53D6\u4E0D\u5230\u9AD8\u5EA6\uFF01');
7289
7311
  }
7312
+ } else if (!warn) {
7313
+ setTimeout(function () {
7314
+ _this10.resetHeight(true);
7315
+ }, 1000);
7290
7316
  }
7291
7317
  }
7292
7318
  });
@@ -7313,12 +7339,12 @@ var mainvue_type_script_lang_js_components;
7313
7339
  this.$emit('sort-change', res);
7314
7340
  },
7315
7341
  mergeThead: function mergeThead(res) {
7316
- var _this10 = this;
7342
+ var _this11 = this;
7317
7343
 
7318
7344
  this.theadData = res;
7319
7345
  this.icon = true;
7320
7346
  setTimeout(function () {
7321
- _this10.show = true;
7347
+ _this11.show = true;
7322
7348
  }, 100);
7323
7349
  }
7324
7350
  }
@@ -7335,7 +7361,7 @@ var mainvue_type_script_lang_js_components;
7335
7361
 
7336
7362
  var main_component = Object(componentNormalizer["a" /* default */])(
7337
7363
  src_mainvue_type_script_lang_js_,
7338
- mainvue_type_template_id_5975d010_render,
7364
+ mainvue_type_template_id_8d31e592_render,
7339
7365
  staticRenderFns,
7340
7366
  false,
7341
7367
  null,