eoss-ui 0.4.85 → 0.4.87

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.
Files changed (51) hide show
  1. package/lib/button-group.js +4 -0
  2. package/lib/button.js +4 -0
  3. package/lib/checkbox-group.js +4 -0
  4. package/lib/data-table-form.js +4 -0
  5. package/lib/data-table.js +73 -33
  6. package/lib/date-picker.js +4 -0
  7. package/lib/dialog.js +4 -0
  8. package/lib/eoss-ui.common.js +1744 -1582
  9. package/lib/flow-group.js +4 -0
  10. package/lib/flow-list.js +4 -0
  11. package/lib/flow.js +7 -3
  12. package/lib/form.js +10 -22
  13. package/lib/handle-user.js +4 -0
  14. package/lib/handler.js +4 -0
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +4 -0
  17. package/lib/input.js +4 -0
  18. package/lib/login.js +4 -0
  19. package/lib/main.js +4 -0
  20. package/lib/nav.js +9 -6
  21. package/lib/page.js +4 -0
  22. package/lib/player.js +4 -0
  23. package/lib/qr-code.js +4 -0
  24. package/lib/radio-group.js +4 -0
  25. package/lib/retrial-auth.js +4 -0
  26. package/lib/select-ganged.js +4 -0
  27. package/lib/select.js +4 -0
  28. package/lib/selector-panel.js +4 -0
  29. package/lib/selector.js +4 -0
  30. package/lib/sizer.js +4 -0
  31. package/lib/steps.js +4 -0
  32. package/lib/switch.js +4 -0
  33. package/lib/table-form.js +10 -6
  34. package/lib/tabs.js +1569 -1435
  35. package/lib/tips.js +4 -0
  36. package/lib/tree-group.js +4 -0
  37. package/lib/tree.js +4 -0
  38. package/lib/upload.js +76 -28
  39. package/lib/utils/util.js +4 -0
  40. package/lib/wujie.js +4 -0
  41. package/lib/wxlogin.js +4 -0
  42. package/package.json +2 -2
  43. package/packages/data-table/src/main.vue +74 -40
  44. package/packages/flow/src/main.vue +1 -1
  45. package/packages/form/src/main.vue +4 -18
  46. package/packages/form/src/table.vue +1 -1
  47. package/packages/nav/src/main.vue +3 -4
  48. package/packages/tabs/src/main.vue +479 -474
  49. package/packages/upload/src/main.vue +44 -30
  50. package/src/index.js +1 -1
  51. package/src/utils/util.js +4 -0
@@ -452,6 +452,10 @@ var ajax = function ajax(_ref) {
452
452
  if (!header['content-type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
+ } else {
456
+ if (!header['content-type']) {
457
+ header['content-type'] = 'application/json;charset=UTF-8';
458
+ }
455
459
  }
456
460
  return http({
457
461
  method: method,
package/lib/button.js CHANGED
@@ -452,6 +452,10 @@ var ajax = function ajax(_ref) {
452
452
  if (!header['content-type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
+ } else {
456
+ if (!header['content-type']) {
457
+ header['content-type'] = 'application/json;charset=UTF-8';
458
+ }
455
459
  }
456
460
  return http({
457
461
  method: method,
@@ -452,6 +452,10 @@ var ajax = function ajax(_ref) {
452
452
  if (!header['content-type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
+ } else {
456
+ if (!header['content-type']) {
457
+ header['content-type'] = 'application/json;charset=UTF-8';
458
+ }
455
459
  }
456
460
  return http({
457
461
  method: method,
@@ -451,6 +451,10 @@ var ajax = function ajax(_ref) {
451
451
  if (!header['content-type']) {
452
452
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
453
453
  }
454
+ } else {
455
+ if (!header['content-type']) {
456
+ header['content-type'] = 'application/json;charset=UTF-8';
457
+ }
454
458
  }
455
459
  return http({
456
460
  method: method,
package/lib/data-table.js CHANGED
@@ -451,6 +451,10 @@ var ajax = function ajax(_ref) {
451
451
  if (!header['content-type']) {
452
452
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
453
453
  }
454
+ } else {
455
+ if (!header['content-type']) {
456
+ header['content-type'] = 'application/json;charset=UTF-8';
457
+ }
454
458
  }
455
459
  return http({
456
460
  method: method,
@@ -3455,8 +3459,8 @@ module.exports = require("vue");
3455
3459
  // ESM COMPAT FLAG
3456
3460
  __webpack_require__.r(__webpack_exports__);
3457
3461
 
3458
- // 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=7556022c&
3459
- var mainvue_type_template_id_7556022c_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=5ae5ffe4&
3463
+ var mainvue_type_template_id_5ae5ffe4_render = function () {
3460
3464
  var _vm = this
3461
3465
  var _h = _vm.$createElement
3462
3466
  var _c = _vm._self._c || _h
@@ -3792,10 +3796,10 @@ var mainvue_type_template_id_7556022c_render = function () {
3792
3796
  )
3793
3797
  }
3794
3798
  var staticRenderFns = []
3795
- mainvue_type_template_id_7556022c_render._withStripped = true
3799
+ mainvue_type_template_id_5ae5ffe4_render._withStripped = true
3796
3800
 
3797
3801
 
3798
- // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=7556022c&
3802
+ // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=5ae5ffe4&
3799
3803
 
3800
3804
  // EXTERNAL MODULE: ./src/config/api.js
3801
3805
  var api = __webpack_require__(1);
@@ -6066,6 +6070,10 @@ var sizer_component = Object(componentNormalizer["a" /* default */])(
6066
6070
  // EXTERNAL MODULE: ./src/utils/bus.js
6067
6071
  var bus = __webpack_require__(13);
6068
6072
 
6073
+ // EXTERNAL MODULE: external "qs"
6074
+ var external_qs_ = __webpack_require__(3);
6075
+ var external_qs_default = /*#__PURE__*/__webpack_require__.n(external_qs_);
6076
+
6069
6077
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=script&lang=js&
6070
6078
  var mainvue_type_script_lang_js_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6071
6079
 
@@ -6275,6 +6283,7 @@ var mainvue_type_script_lang_js_components;
6275
6283
 
6276
6284
 
6277
6285
 
6286
+
6278
6287
  /* harmony default export */ var mainvue_type_script_lang_js_ = ({
6279
6288
  name: 'EsDataTable',
6280
6289
  inheritAttrs: false,
@@ -6487,6 +6496,7 @@ var mainvue_type_script_lang_js_components;
6487
6496
  },
6488
6497
  data: function data() {
6489
6498
  return {
6499
+ requests: [],
6490
6500
  theadData: [],
6491
6501
  list: null,
6492
6502
  tableLoading: this.loading,
@@ -6520,7 +6530,7 @@ var mainvue_type_script_lang_js_components;
6520
6530
 
6521
6531
  theads: {
6522
6532
  get: function get() {
6523
- return this.theadData.length ? this.theadData : this.thead;
6533
+ return typeof this.thead === 'string' ? this.theadData : this.thead;
6524
6534
  },
6525
6535
  set: function set(val) {
6526
6536
  return val;
@@ -6599,20 +6609,19 @@ var mainvue_type_script_lang_js_components;
6599
6609
  },
6600
6610
 
6601
6611
  thead: {
6602
- immediate: true,
6612
+ deep: true,
6603
6613
  handler: function handler(val) {
6604
6614
  if (typeof val === 'string') {
6605
6615
  this.getTheads();
6616
+ } else {
6617
+ this.getOptions(val);
6606
6618
  }
6607
6619
  }
6608
6620
  },
6609
6621
  theads: {
6610
- immediate: true,
6611
- handler: function handler(val) {
6622
+ deep: true,
6623
+ handler: function handler() {
6612
6624
  this.chekOpenTotalArea();
6613
- if (val && val.length) {
6614
- this.getOptions(val);
6615
- }
6616
6625
  }
6617
6626
  },
6618
6627
  param: {
@@ -6652,6 +6661,9 @@ var mainvue_type_script_lang_js_components;
6652
6661
  }
6653
6662
  },
6654
6663
  created: function created() {
6664
+ if (Array.isArray(this.thead) && this.thead.length) {
6665
+ this.getOptions(this.thead);
6666
+ }
6655
6667
  this.immediate && this.getTableData();
6656
6668
  },
6657
6669
  mounted: function mounted() {
@@ -6660,6 +6672,14 @@ var mainvue_type_script_lang_js_components;
6660
6672
  },
6661
6673
 
6662
6674
  methods: {
6675
+ getRequestKey: function getRequestKey(config) {
6676
+ var method = config.method,
6677
+ url = config.url,
6678
+ params = config.params,
6679
+ data = config.data;
6680
+
6681
+ return [method, url, external_qs_default.a.stringify(params), external_qs_default.a.stringify(data)].join('&');
6682
+ },
6663
6683
  getIcon: function getIcon(res) {
6664
6684
  if (this.sizer && this.icon && res !== 'right' && !this.$slots.prepend && !this.$slots.append && !this.$slots.default && !this.form) {
6665
6685
  this.icon = false;
@@ -6671,29 +6691,44 @@ var mainvue_type_script_lang_js_components;
6671
6691
  var _this2 = this;
6672
6692
 
6673
6693
  res.forEach(function (item) {
6694
+ if ((!item.childHead || !item.childHead.length) && (!item.children || !item.children.length) && !item.width && !item.minWidth && item.title) {
6695
+ var width = item.title.length * 14 + 20;
6696
+ if (width > 80) {
6697
+ _this2.$set(item, 'minWidth', width);
6698
+ }
6699
+ }
6674
6700
  if (item.sysCode || item.url) {
6675
6701
  var params = util["a" /* default */].extend({}, item.sysCode ? { sysAppCode: item.sysCode } : {}, item.param ? item.param : {});
6676
- util["a" /* default */].ajax({
6677
- url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6702
+ var key = _this2.getRequestKey({
6678
6703
  method: _this2.method,
6704
+ url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6679
6705
  params: params,
6680
- data: params
6681
- }).then(function (res) {
6682
- if (res.rCode === 0) {
6683
- if (item.type == 'ganged') {
6684
- _this2.$set(_this2.options, item.field || item.prop, [JSON.parse(JSON.stringify(res.results))]);
6706
+ data: {}
6707
+ });
6708
+ if (!_this2.requests.includes(key)) {
6709
+ util["a" /* default */].ajax({
6710
+ url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6711
+ method: _this2.method,
6712
+ params: params,
6713
+ data: params
6714
+ }).then(function (res) {
6715
+ if (res.rCode === 0) {
6716
+ if (item.type == 'ganged') {
6717
+ _this2.$set(_this2.options, item.field || item.prop, [JSON.parse(JSON.stringify(res.results))]);
6718
+ } else {
6719
+ _this2.$set(_this2.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6720
+ }
6721
+ _this2.requests.push(key);
6685
6722
  } else {
6686
- _this2.$set(_this2.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6723
+ var msg = res.msg || '系统错误,请联系管理员!';
6724
+ _this2.$message.error(msg);
6687
6725
  }
6688
- } else {
6689
- var msg = res.msg || '系统错误,请联系管理员!';
6690
- _this2.$message.error(msg);
6691
- }
6692
- }).catch(function (err) {
6693
- if (err.message && err.message !== 'canceled') {
6694
- _this2.$message.error(err.message);
6695
- }
6696
- });
6726
+ }).catch(function (err) {
6727
+ if (err.message && err.message !== 'canceled') {
6728
+ _this2.$message.error(err.message);
6729
+ }
6730
+ });
6731
+ }
6697
6732
  } else {
6698
6733
  if (item.childHead && item.childHead.length) {
6699
6734
  _this2.getOptions(item.childHead);
@@ -6714,7 +6749,7 @@ var mainvue_type_script_lang_js_components;
6714
6749
  this.showTotal = true;
6715
6750
  return;
6716
6751
  }
6717
- var arr = JSON.parse(JSON.stringify(this.thead));
6752
+ var arr = JSON.parse(JSON.stringify(this.theads));
6718
6753
  arr.forEach(function (item) {
6719
6754
  if (item.total) {
6720
6755
  _this3.showTotal = true;
@@ -6787,6 +6822,7 @@ var mainvue_type_script_lang_js_components;
6787
6822
  _this5.theadData = results.theadData || [];
6788
6823
  _this5.list = results.data || results.records || [];
6789
6824
  _this5.config.totalCount = results.count || results.total || results.totalCount;
6825
+ _this5.getOptions(_this5.theadData);
6790
6826
  }
6791
6827
  } else {
6792
6828
  _this5.theadData = [];
@@ -7020,7 +7056,7 @@ var mainvue_type_script_lang_js_components;
7020
7056
  } else if (row) {
7021
7057
  rows = JSON.parse(JSON.stringify(row));
7022
7058
  }
7023
- var thead = this.thead;
7059
+ var thead = this.theads;
7024
7060
  if (this.$refs.oaTable) {
7025
7061
  thead = this.$refs.oaTable.getThead();
7026
7062
  }
@@ -7115,8 +7151,8 @@ var mainvue_type_script_lang_js_components;
7115
7151
  } else {
7116
7152
  if (handle.exportXls) {
7117
7153
  var text = '操作';
7118
- if (this.thead[this.thead.length - 1] && this.thead[this.thead.length - 1].type === 'handle') {
7119
- text = this.thead[this.thead.length - 1].title;
7154
+ if (this.theads[this.theads.length - 1] && this.theads[this.theads.length - 1].type === 'handle') {
7155
+ text = this.theads[this.theads.length - 1].title;
7120
7156
  }
7121
7157
  thead = thead.map(function (item) {
7122
7158
  return item.filter(function (ele) {
@@ -7257,6 +7293,10 @@ var mainvue_type_script_lang_js_components;
7257
7293
  } else {
7258
7294
  console.warn(_this9.$el.parentNode, '\u83B7\u53D6\u4E0D\u5230\u9AD8\u5EA6\uFF01');
7259
7295
  }
7296
+ } else if (!warn) {
7297
+ setTimeout(function () {
7298
+ _this9.resetHeight(true);
7299
+ }, 1000);
7260
7300
  }
7261
7301
  }
7262
7302
  });
@@ -7305,7 +7345,7 @@ var mainvue_type_script_lang_js_components;
7305
7345
 
7306
7346
  var main_component = Object(componentNormalizer["a" /* default */])(
7307
7347
  src_mainvue_type_script_lang_js_,
7308
- mainvue_type_template_id_7556022c_render,
7348
+ mainvue_type_template_id_5ae5ffe4_render,
7309
7349
  staticRenderFns,
7310
7350
  false,
7311
7351
  null,
@@ -452,6 +452,10 @@ var ajax = function ajax(_ref) {
452
452
  if (!header['content-type']) {
453
453
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
454
454
  }
455
+ } else {
456
+ if (!header['content-type']) {
457
+ header['content-type'] = 'application/json;charset=UTF-8';
458
+ }
455
459
  }
456
460
  return http({
457
461
  method: method,
package/lib/dialog.js CHANGED
@@ -451,6 +451,10 @@ var ajax = function ajax(_ref) {
451
451
  if (!header['content-type']) {
452
452
  header['content-type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
453
453
  }
454
+ } else {
455
+ if (!header['content-type']) {
456
+ header['content-type'] = 'application/json;charset=UTF-8';
457
+ }
454
458
  }
455
459
  return http({
456
460
  method: method,