eoss-ui 0.4.87 → 0.4.89

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=5ae5ffe4&
3463
- var mainvue_type_template_id_5ae5ffe4_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_5ae5ffe4_render = function () {
3796
3796
  )
3797
3797
  }
3798
3798
  var staticRenderFns = []
3799
- mainvue_type_template_id_5ae5ffe4_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=5ae5ffe4&
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,54 +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
 
6693
- res.forEach(function (item) {
6694
- if ((!item.childHead || !item.childHead.length) && (!item.children || !item.children.length) && !item.width && !item.minWidth && item.title) {
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) {
6695
6705
  var width = item.title.length * 14 + 20;
6696
6706
  if (width > 80) {
6697
6707
  _this2.$set(item, 'minWidth', width);
6698
6708
  }
6699
6709
  }
6710
+ });
6711
+ },
6712
+ getOptions: function getOptions(res) {
6713
+ var _this3 = this;
6714
+
6715
+ res.forEach(function (item) {
6700
6716
  if (item.sysCode || item.url) {
6701
6717
  var params = util["a" /* default */].extend({}, item.sysCode ? { sysAppCode: item.sysCode } : {}, item.param ? item.param : {});
6702
- var key = _this2.getRequestKey({
6703
- method: _this2.method,
6718
+ var key = _this3.getRequestKey({
6719
+ method: _this3.method,
6704
6720
  url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6705
6721
  params: params,
6706
6722
  data: {}
6707
6723
  });
6708
- if (!_this2.requests.includes(key)) {
6724
+ if (!_this3.requests.includes(key)) {
6709
6725
  util["a" /* default */].ajax({
6710
6726
  url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6711
- method: _this2.method,
6727
+ method: _this3.method,
6712
6728
  params: params,
6713
6729
  data: params
6714
6730
  }).then(function (res) {
6715
6731
  if (res.rCode === 0) {
6716
6732
  if (item.type == 'ganged') {
6717
- _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))]);
6718
6734
  } else {
6719
- _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)));
6720
6736
  }
6721
- _this2.requests.push(key);
6737
+ _this3.requests.push(key);
6722
6738
  } else {
6723
6739
  var msg = res.msg || '系统错误,请联系管理员!';
6724
- _this2.$message.error(msg);
6740
+ _this3.$message.error(msg);
6725
6741
  }
6726
6742
  }).catch(function (err) {
6727
6743
  if (err.message && err.message !== 'canceled') {
6728
- _this2.$message.error(err.message);
6744
+ _this3.$message.error(err.message);
6729
6745
  }
6730
6746
  });
6731
6747
  }
6732
6748
  } else {
6733
6749
  if (item.childHead && item.childHead.length) {
6734
- _this2.getOptions(item.childHead);
6750
+ _this3.getOptions(item.childHead);
6735
6751
  }
6736
6752
  if (item.children && item.children.length) {
6737
- _this2.getOptions(item.children);
6753
+ _this3.getOptions(item.children);
6738
6754
  }
6739
6755
  }
6740
6756
  });
@@ -6743,7 +6759,7 @@ var mainvue_type_script_lang_js_components;
6743
6759
  return util["a" /* default */].getObjectType(item) === 'object';
6744
6760
  },
6745
6761
  chekOpenTotalArea: function chekOpenTotalArea() {
6746
- var _this3 = this;
6762
+ var _this4 = this;
6747
6763
 
6748
6764
  if (this.total || this.showSummary) {
6749
6765
  this.showTotal = true;
@@ -6752,7 +6768,7 @@ var mainvue_type_script_lang_js_components;
6752
6768
  var arr = JSON.parse(JSON.stringify(this.theads));
6753
6769
  arr.forEach(function (item) {
6754
6770
  if (item.total) {
6755
- _this3.showTotal = true;
6771
+ _this4.showTotal = true;
6756
6772
  }
6757
6773
  });
6758
6774
  },
@@ -6785,27 +6801,27 @@ var mainvue_type_script_lang_js_components;
6785
6801
  });
6786
6802
  },
6787
6803
  checkSelect: function checkSelect(newVal) {
6788
- var _this4 = this;
6804
+ var _this5 = this;
6789
6805
 
6790
6806
  this.$nextTick(function () {
6791
6807
  if (util["a" /* default */].getObjectType(newVal) === 'array') {
6792
6808
  newVal.forEach(function (row) {
6793
6809
  if (util["a" /* default */].isObject(row)) {
6794
- _this4.$refs.oaTable.toggleRowSelection(row, true);
6795
- } else _this4.datas.forEach(function (item) {
6796
- if (item[_this4.checkedKey] === row) {
6797
- _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);
6798
6814
  return;
6799
6815
  }
6800
6816
  });
6801
6817
  });
6802
6818
  } else if (newVal === true) {
6803
- _this4.toggleAllSelection();
6819
+ _this5.toggleAllSelection();
6804
6820
  }
6805
6821
  });
6806
6822
  },
6807
6823
  getTheads: function getTheads() {
6808
- var _this5 = this;
6824
+ var _this6 = this;
6809
6825
 
6810
6826
  util["a" /* default */].ajax({
6811
6827
  url: this.thead,
@@ -6817,27 +6833,27 @@ var mainvue_type_script_lang_js_components;
6817
6833
  if (res.rCode === 0) {
6818
6834
  var results = res.results;
6819
6835
  if (Array.isArray(results)) {
6820
- _this5.theadData = results;
6836
+ _this6.theadData = results;
6821
6837
  } else {
6822
- _this5.theadData = results.theadData || [];
6823
- _this5.list = results.data || results.records || [];
6824
- _this5.config.totalCount = results.count || results.total || results.totalCount;
6825
- _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);
6826
6842
  }
6827
6843
  } else {
6828
- _this5.theadData = [];
6844
+ _this6.theadData = [];
6829
6845
  var msg = res.msg || '系统错误,请联系管理员!';
6830
- _this5.$message.error(msg);
6846
+ _this6.$message.error(msg);
6831
6847
  }
6832
- _this5.$emit('success', res);
6848
+ _this6.$emit('success', res);
6833
6849
  }).catch(function (err) {
6834
6850
  if (err.message && err.message !== 'canceled') {
6835
- _this5.$message.error(err.message);
6851
+ _this6.$message.error(err.message);
6836
6852
  }
6837
6853
  });
6838
6854
  },
6839
6855
  getTableData: function getTableData(res) {
6840
- var _this6 = this;
6856
+ var _this7 = this;
6841
6857
 
6842
6858
  var where = void 0;
6843
6859
  var first = void 0;
@@ -6867,27 +6883,27 @@ var mainvue_type_script_lang_js_components;
6867
6883
  params: reqData,
6868
6884
  data: reqData
6869
6885
  }).then(function (res) {
6870
- _this6.tableLoading = false;
6886
+ _this7.tableLoading = false;
6871
6887
  if (res.rCode === 0 || res.status === 'success') {
6872
- var results = _this6.parseData !== undefined ? _this6.parseData(res.results || res.data || res) : res.results || res.data;
6873
- _this6.list = results.data || results.records || results.list || [];
6874
- _this6.config.totalCount = results.count || results.total || results.totalCount;
6875
- _this6.checked && _this6.$nextTick(function () {
6876
- _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);
6877
6893
  });
6878
6894
  } else {
6879
- _this6.list = [];
6895
+ _this7.list = [];
6880
6896
  //this.tableHeight = false;
6881
6897
  var msg = res.msg || '系统错误,请联系管理员!';
6882
- _this6.$message.error(msg);
6898
+ _this7.$message.error(msg);
6883
6899
  }
6884
- _this6.$emit('success', res);
6900
+ _this7.$emit('success', res);
6885
6901
  }).catch(function (err) {
6886
6902
  //this.tableHeight = false;
6887
6903
  if (err.message && err.message !== 'canceled') {
6888
- _this6.$message.error(err.message);
6904
+ _this7.$message.error(err.message);
6889
6905
  }
6890
- _this6.tableLoading = false;
6906
+ _this7.tableLoading = false;
6891
6907
  });
6892
6908
  },
6893
6909
  selectionChange: function selectionChange(data) {
@@ -6932,7 +6948,7 @@ var mainvue_type_script_lang_js_components;
6932
6948
  this.$emit('change', data, this.datas);
6933
6949
  },
6934
6950
  handleAjax: function handleAjax(handle, row) {
6935
- var _this7 = this;
6951
+ var _this8 = this;
6936
6952
 
6937
6953
  this.changeLoading(true, handle.text + '\u4E2D...');
6938
6954
  var params = handle.param || {};
@@ -6988,9 +7004,9 @@ var mainvue_type_script_lang_js_components;
6988
7004
  method: handle.method,
6989
7005
  format: handle.format
6990
7006
  }).then(function (res) {
6991
- _this7.changeLoading(false);
7007
+ _this8.changeLoading(false);
6992
7008
  if (res.rCode === 0) {
6993
- _this7.$message({
7009
+ _this8.$message({
6994
7010
  message: handle.text + '\u6210\u529F',
6995
7011
  duration: 2000,
6996
7012
  type: 'success',
@@ -6998,17 +7014,17 @@ var mainvue_type_script_lang_js_components;
6998
7014
  var first = Object.prototype.hasOwnProperty.call(handle, 'first') ? handle.first : false;
6999
7015
  var reload = handle.reload || true;
7000
7016
  if (reload) {
7001
- _this7.reload({}, first);
7017
+ _this8.reload({}, first);
7002
7018
  }
7003
7019
  }
7004
7020
  });
7005
7021
  } else {
7006
- _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');
7007
7023
  }
7008
7024
  }).catch(function (err) {
7009
- _this7.changeLoading(false);
7025
+ _this8.changeLoading(false);
7010
7026
  if (err.message && err.message !== 'canceled') {
7011
- _this7.$message.error(err.message);
7027
+ _this8.$message.error(err.message);
7012
7028
  }
7013
7029
  });
7014
7030
  },
@@ -7033,7 +7049,7 @@ var mainvue_type_script_lang_js_components;
7033
7049
  return mainvue_type_script_lang_js_extends({}, obj, item);
7034
7050
  },
7035
7051
  handleClick: function handleClick(res) {
7036
- var _this8 = this;
7052
+ var _this9 = this;
7037
7053
 
7038
7054
  var row = res.row,
7039
7055
  handle = res.handle;
@@ -7069,7 +7085,7 @@ var mainvue_type_script_lang_js_components;
7069
7085
  cancelButtonText: '取消',
7070
7086
  type: 'warning'
7071
7087
  }).then(function () {
7072
- _this8.handleAjax(handle, rows);
7088
+ _this9.handleAjax(handle, rows);
7073
7089
  }).catch(function () {});
7074
7090
  } else {
7075
7091
  this.handleAjax(handle, rows);
@@ -7262,40 +7278,40 @@ var mainvue_type_script_lang_js_components;
7262
7278
  }
7263
7279
  },
7264
7280
  resetHeight: function resetHeight(warn) {
7265
- var _this9 = this;
7281
+ var _this10 = this;
7266
7282
 
7267
7283
  this.$nextTick(function () {
7268
- if (_this9.full && !_this9.height && !_this9.maxHeight) {
7269
- var height = _this9.$el.parentNode.offsetHeight;
7284
+ if (_this10.full && !_this10.height && !_this10.maxHeight) {
7285
+ var height = _this10.$el.parentNode.offsetHeight;
7270
7286
  if (height) {
7271
- height = parseInt(util["a" /* default */].getStyle(_this9.$el.parentNode, 'height', '%'), 10);
7272
- 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);
7273
- for (var i = 0; i < _this9.$el.parentNode.childNodes.length; i++) {
7274
- var ele = _this9.$el.parentNode.childNodes[i];
7275
- 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) {
7276
7292
  height = height - ele.offsetHeight - parseInt(util["a" /* default */].getStyle(ele, 'margin-top'), 10) - parseInt(util["a" /* default */].getStyle(ele, 'margin-bottom'), 10);
7277
7293
  }
7278
7294
  }
7279
- height -= _this9.showToolbar ? 45 : 0;
7280
- height -= _this9.page === false ? 0 : 46;
7281
- height -= _this9.title ? _this9.$refs.title.offsetHeight : 0;
7282
- height -= parseInt(util["a" /* default */].getStyle(_this9.$refs.esTableContent, 'padding-top'), 10);
7283
- height -= parseInt(util["a" /* default */].getStyle(_this9.$refs.esTableContent, 'padding-bottom'), 10);
7284
- 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');
7285
7301
  var eht = 0;
7286
7302
  if (emptyText) {
7287
7303
  eht = emptyText.offsetHeight;
7288
- var thead = _this9.$refs.esTableContent.querySelector('.el-table__header');
7304
+ var thead = _this10.$refs.esTableContent.querySelector('.el-table__header');
7289
7305
  thead && (eht += thead.offsetHeight);
7290
7306
  }
7291
7307
  if (height > 1 && height - eht > 1) {
7292
- _this9.tableHeight = height;
7308
+ _this10.tableHeight = height;
7293
7309
  } else {
7294
- 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');
7295
7311
  }
7296
7312
  } else if (!warn) {
7297
7313
  setTimeout(function () {
7298
- _this9.resetHeight(true);
7314
+ _this10.resetHeight(true);
7299
7315
  }, 1000);
7300
7316
  }
7301
7317
  }
@@ -7323,12 +7339,12 @@ var mainvue_type_script_lang_js_components;
7323
7339
  this.$emit('sort-change', res);
7324
7340
  },
7325
7341
  mergeThead: function mergeThead(res) {
7326
- var _this10 = this;
7342
+ var _this11 = this;
7327
7343
 
7328
7344
  this.theadData = res;
7329
7345
  this.icon = true;
7330
7346
  setTimeout(function () {
7331
- _this10.show = true;
7347
+ _this11.show = true;
7332
7348
  }, 100);
7333
7349
  }
7334
7350
  }
@@ -7345,7 +7361,7 @@ var mainvue_type_script_lang_js_components;
7345
7361
 
7346
7362
  var main_component = Object(componentNormalizer["a" /* default */])(
7347
7363
  src_mainvue_type_script_lang_js_,
7348
- mainvue_type_template_id_5ae5ffe4_render,
7364
+ mainvue_type_template_id_8d31e592_render,
7349
7365
  staticRenderFns,
7350
7366
  false,
7351
7367
  null,