eoss-ui 0.4.85 → 0.4.86

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 (48) 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 +63 -33
  6. package/lib/date-picker.js +4 -0
  7. package/lib/dialog.js +4 -0
  8. package/lib/eoss-ui.common.js +128 -90
  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 +4 -0
  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 +7 -4
  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 +4 -0
  34. package/lib/tabs.js +4 -0
  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 +75 -27
  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 +1 -1
  43. package/packages/data-table/src/main.vue +58 -40
  44. package/packages/flow/src/main.vue +1 -1
  45. package/packages/nav/src/main.vue +1 -2
  46. package/packages/upload/src/main.vue +43 -29
  47. package/src/index.js +1 -1
  48. 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=5975d010&
3463
+ var mainvue_type_template_id_5975d010_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_5975d010_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=5975d010&
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;
@@ -6673,27 +6693,36 @@ var mainvue_type_script_lang_js_components;
6673
6693
  res.forEach(function (item) {
6674
6694
  if (item.sysCode || item.url) {
6675
6695
  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,
6696
+ var key = _this2.getRequestKey({
6678
6697
  method: _this2.method,
6698
+ url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6679
6699
  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))]);
6700
+ data: {}
6701
+ });
6702
+ if (!_this2.requests.includes(key)) {
6703
+ util["a" /* default */].ajax({
6704
+ url: item.sysCode ? api["u" /* findSysCode */] : item.url,
6705
+ method: _this2.method,
6706
+ params: params,
6707
+ data: params
6708
+ }).then(function (res) {
6709
+ if (res.rCode === 0) {
6710
+ if (item.type == 'ganged') {
6711
+ _this2.$set(_this2.options, item.field || item.prop, [JSON.parse(JSON.stringify(res.results))]);
6712
+ } else {
6713
+ _this2.$set(_this2.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6714
+ }
6715
+ _this2.requests.push(key);
6685
6716
  } else {
6686
- _this2.$set(_this2.options, item.field || item.prop, JSON.parse(JSON.stringify(res.results)));
6717
+ var msg = res.msg || '系统错误,请联系管理员!';
6718
+ _this2.$message.error(msg);
6687
6719
  }
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
- });
6720
+ }).catch(function (err) {
6721
+ if (err.message && err.message !== 'canceled') {
6722
+ _this2.$message.error(err.message);
6723
+ }
6724
+ });
6725
+ }
6697
6726
  } else {
6698
6727
  if (item.childHead && item.childHead.length) {
6699
6728
  _this2.getOptions(item.childHead);
@@ -6714,7 +6743,7 @@ var mainvue_type_script_lang_js_components;
6714
6743
  this.showTotal = true;
6715
6744
  return;
6716
6745
  }
6717
- var arr = JSON.parse(JSON.stringify(this.thead));
6746
+ var arr = JSON.parse(JSON.stringify(this.theads));
6718
6747
  arr.forEach(function (item) {
6719
6748
  if (item.total) {
6720
6749
  _this3.showTotal = true;
@@ -6787,6 +6816,7 @@ var mainvue_type_script_lang_js_components;
6787
6816
  _this5.theadData = results.theadData || [];
6788
6817
  _this5.list = results.data || results.records || [];
6789
6818
  _this5.config.totalCount = results.count || results.total || results.totalCount;
6819
+ _this5.getOptions(_this5.theadData);
6790
6820
  }
6791
6821
  } else {
6792
6822
  _this5.theadData = [];
@@ -7020,7 +7050,7 @@ var mainvue_type_script_lang_js_components;
7020
7050
  } else if (row) {
7021
7051
  rows = JSON.parse(JSON.stringify(row));
7022
7052
  }
7023
- var thead = this.thead;
7053
+ var thead = this.theads;
7024
7054
  if (this.$refs.oaTable) {
7025
7055
  thead = this.$refs.oaTable.getThead();
7026
7056
  }
@@ -7115,8 +7145,8 @@ var mainvue_type_script_lang_js_components;
7115
7145
  } else {
7116
7146
  if (handle.exportXls) {
7117
7147
  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;
7148
+ if (this.theads[this.theads.length - 1] && this.theads[this.theads.length - 1].type === 'handle') {
7149
+ text = this.theads[this.theads.length - 1].title;
7120
7150
  }
7121
7151
  thead = thead.map(function (item) {
7122
7152
  return item.filter(function (ele) {
@@ -7305,7 +7335,7 @@ var mainvue_type_script_lang_js_components;
7305
7335
 
7306
7336
  var main_component = Object(componentNormalizer["a" /* default */])(
7307
7337
  src_mainvue_type_script_lang_js_,
7308
- mainvue_type_template_id_7556022c_render,
7338
+ mainvue_type_template_id_5975d010_render,
7309
7339
  staticRenderFns,
7310
7340
  false,
7311
7341
  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,