eoss-ui 0.5.61 → 0.5.63

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 (87) hide show
  1. package/lib/button-group.js +147 -129
  2. package/lib/button.js +14 -8
  3. package/lib/checkbox-group.js +14 -8
  4. package/lib/data-table-form.js +14 -8
  5. package/lib/data-table.js +129 -104
  6. package/lib/date-picker.js +14 -8
  7. package/lib/dialog.js +17 -11
  8. package/lib/eoss-ui.common.js +688 -545
  9. package/lib/flow-group.js +14 -8
  10. package/lib/flow-list.js +14 -8
  11. package/lib/flow.js +17 -11
  12. package/lib/form.js +14 -8
  13. package/lib/handle-user.js +14 -8
  14. package/lib/handler.js +17 -11
  15. package/lib/icon.js +19 -15
  16. package/lib/icons.js +2 -2
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +14 -8
  19. package/lib/input.js +14 -8
  20. package/lib/label.js +2 -2
  21. package/lib/login.js +139 -68
  22. package/lib/main.js +208 -164
  23. package/lib/menu.js +2 -2
  24. package/lib/nav.js +14 -8
  25. package/lib/page.js +14 -8
  26. package/lib/player.js +18 -12
  27. package/lib/qr-code.js +16 -10
  28. package/lib/radio-group.js +14 -8
  29. package/lib/retrial-auth.js +14 -8
  30. package/lib/select-ganged.js +14 -8
  31. package/lib/select.js +14 -8
  32. package/lib/selector-panel.js +17 -11
  33. package/lib/selector.js +18 -23
  34. package/lib/sizer.js +14 -8
  35. package/lib/steps.js +14 -8
  36. package/lib/switch.js +14 -8
  37. package/lib/table-form.js +14 -8
  38. package/lib/tabs.js +14 -8
  39. package/lib/theme-chalk/base.css +1 -1
  40. package/lib/theme-chalk/card.css +1 -1
  41. package/lib/theme-chalk/form.css +1 -1
  42. package/lib/theme-chalk/icon.css +1 -1
  43. package/lib/theme-chalk/index.css +1 -1
  44. package/lib/theme-chalk/login.css +1 -1
  45. package/lib/theme-chalk/main.css +1 -1
  46. package/lib/theme-chalk/menu.css +1 -1
  47. package/lib/theme-chalk/sizer.css +1 -1
  48. package/lib/theme-chalk/upload.css +1 -1
  49. package/lib/tips.js +14 -8
  50. package/lib/toolbar.js +4 -1
  51. package/lib/tree-group.js +28 -11
  52. package/lib/tree.js +14 -8
  53. package/lib/upload.js +17 -11
  54. package/lib/utils/util.js +14 -8
  55. package/lib/wujie.js +14 -8
  56. package/lib/wxlogin.js +14 -8
  57. package/package.json +3 -2
  58. package/packages/button-group/src/main.vue +71 -58
  59. package/packages/data-table/src/main.vue +11 -2
  60. package/packages/flow/src/main.vue +1 -1
  61. package/packages/handler/src/main.vue +1 -1
  62. package/packages/icon/src/main.vue +2 -2
  63. package/packages/label/src/main.vue +2 -2
  64. package/packages/login/src/main.vue +63 -35
  65. package/packages/main/src/main.vue +19 -11
  66. package/packages/main/src/userinfo.vue +165 -150
  67. package/packages/menu/src/main.vue +2 -2
  68. package/packages/selector/src/main.vue +0 -1
  69. package/packages/theme-chalk/lib/base.css +1 -1
  70. package/packages/theme-chalk/lib/card.css +1 -1
  71. package/packages/theme-chalk/lib/form.css +1 -1
  72. package/packages/theme-chalk/lib/icon.css +1 -1
  73. package/packages/theme-chalk/lib/index.css +1 -1
  74. package/packages/theme-chalk/lib/login.css +1 -1
  75. package/packages/theme-chalk/lib/main.css +1 -1
  76. package/packages/theme-chalk/lib/menu.css +1 -1
  77. package/packages/theme-chalk/lib/sizer.css +1 -1
  78. package/packages/theme-chalk/lib/upload.css +1 -1
  79. package/packages/theme-chalk/src/card.scss +2 -2
  80. package/packages/theme-chalk/src/form.scss +5 -3
  81. package/packages/theme-chalk/src/icon.scss +3 -3
  82. package/packages/theme-chalk/src/login.scss +6 -0
  83. package/packages/theme-chalk/src/menu.scss +1 -1
  84. package/packages/toolbar/src/main.vue +4 -1
  85. package/packages/tree-group/src/main.vue +12 -1
  86. package/src/index.js +1 -1
  87. package/src/utils/util.js +14 -9
package/lib/utils/util.js CHANGED
@@ -287,7 +287,7 @@ var ajax = function ajax(_ref) {
287
287
  error.message = '未授权,请重新登录';
288
288
  break;
289
289
  case 403:
290
- error.message = '登录过期,请重新登录';
290
+ error.message = '服务器错误';
291
291
  break;
292
292
  case 404:
293
293
  error.message = '网络请求不存在';
@@ -299,7 +299,7 @@ var ajax = function ajax(_ref) {
299
299
  error.message = '请求超时';
300
300
  break;
301
301
  case 500:
302
- error.message = '服务器端出错';
302
+ error.message = '服务器错误';
303
303
  break;
304
304
  case 501:
305
305
  error.message = '网络未实现';
@@ -655,18 +655,23 @@ var dayOfMonth = function dayOfMonth(date) {
655
655
  * @desc:添加js内容
656
656
  * @author huangbo
657
657
  * @date 2022年5月7日
658
- * @param {Function} [fn] - 函数
658
+ * @param {Function} [callback] - 函数
659
659
  * @param {Number} [wait] - 延迟毫秒数
660
660
  * @param {Boolean} [immediate] - 是否首次触发执行
661
661
  **/
662
662
 
663
- var debounce = function debounce(callback, delay) {
664
- var timeout = null;
663
+ var debounce = function debounce(callback, wait) {
664
+ var timeout = void 0;
665
665
  return function () {
666
- clearTimeout(timeout);
667
- timeout = setTimeout(callback, delay ? delay : 500);
666
+ var context = this;
667
+ var args = arguments;
668
+ if (timeout) clearTimeout(timeout);
669
+ timeout = setTimeout(function () {
670
+ callback.apply(context, args);
671
+ }, wait || 500);
668
672
  };
669
673
  };
674
+
670
675
  /**
671
676
  * delUrlParam
672
677
  * @desc:删除url指定参数
@@ -2803,7 +2808,8 @@ var toFunction = function toFunction(str) {
2803
2808
  * @param {string} [$color] - 颜色值
2804
2809
  **/
2805
2810
  var updateTheme = function updateTheme(color, send) {
2806
- color = color ? color : '#409eff';
2811
+ color = color && startWith(color, '#') ? color : '#409eff';
2812
+
2807
2813
  if (send === undefined) {
2808
2814
  send = true;
2809
2815
  }
package/lib/wujie.js CHANGED
@@ -370,7 +370,7 @@ var ajax = function ajax(_ref) {
370
370
  error.message = '未授权,请重新登录';
371
371
  break;
372
372
  case 403:
373
- error.message = '登录过期,请重新登录';
373
+ error.message = '服务器错误';
374
374
  break;
375
375
  case 404:
376
376
  error.message = '网络请求不存在';
@@ -382,7 +382,7 @@ var ajax = function ajax(_ref) {
382
382
  error.message = '请求超时';
383
383
  break;
384
384
  case 500:
385
- error.message = '服务器端出错';
385
+ error.message = '服务器错误';
386
386
  break;
387
387
  case 501:
388
388
  error.message = '网络未实现';
@@ -738,18 +738,23 @@ var dayOfMonth = function dayOfMonth(date) {
738
738
  * @desc:添加js内容
739
739
  * @author huangbo
740
740
  * @date 2022年5月7日
741
- * @param {Function} [fn] - 函数
741
+ * @param {Function} [callback] - 函数
742
742
  * @param {Number} [wait] - 延迟毫秒数
743
743
  * @param {Boolean} [immediate] - 是否首次触发执行
744
744
  **/
745
745
 
746
- var debounce = function debounce(callback, delay) {
747
- var timeout = null;
746
+ var debounce = function debounce(callback, wait) {
747
+ var timeout = void 0;
748
748
  return function () {
749
- clearTimeout(timeout);
750
- timeout = setTimeout(callback, delay ? delay : 500);
749
+ var context = this;
750
+ var args = arguments;
751
+ if (timeout) clearTimeout(timeout);
752
+ timeout = setTimeout(function () {
753
+ callback.apply(context, args);
754
+ }, wait || 500);
751
755
  };
752
756
  };
757
+
753
758
  /**
754
759
  * delUrlParam
755
760
  * @desc:删除url指定参数
@@ -2886,7 +2891,8 @@ var toFunction = function toFunction(str) {
2886
2891
  * @param {string} [$color] - 颜色值
2887
2892
  **/
2888
2893
  var updateTheme = function updateTheme(color, send) {
2889
- color = color ? color : '#409eff';
2894
+ color = color && startWith(color, '#') ? color : '#409eff';
2895
+
2890
2896
  if (send === undefined) {
2891
2897
  send = true;
2892
2898
  }
package/lib/wxlogin.js CHANGED
@@ -370,7 +370,7 @@ var ajax = function ajax(_ref) {
370
370
  error.message = '未授权,请重新登录';
371
371
  break;
372
372
  case 403:
373
- error.message = '登录过期,请重新登录';
373
+ error.message = '服务器错误';
374
374
  break;
375
375
  case 404:
376
376
  error.message = '网络请求不存在';
@@ -382,7 +382,7 @@ var ajax = function ajax(_ref) {
382
382
  error.message = '请求超时';
383
383
  break;
384
384
  case 500:
385
- error.message = '服务器端出错';
385
+ error.message = '服务器错误';
386
386
  break;
387
387
  case 501:
388
388
  error.message = '网络未实现';
@@ -738,18 +738,23 @@ var dayOfMonth = function dayOfMonth(date) {
738
738
  * @desc:添加js内容
739
739
  * @author huangbo
740
740
  * @date 2022年5月7日
741
- * @param {Function} [fn] - 函数
741
+ * @param {Function} [callback] - 函数
742
742
  * @param {Number} [wait] - 延迟毫秒数
743
743
  * @param {Boolean} [immediate] - 是否首次触发执行
744
744
  **/
745
745
 
746
- var debounce = function debounce(callback, delay) {
747
- var timeout = null;
746
+ var debounce = function debounce(callback, wait) {
747
+ var timeout = void 0;
748
748
  return function () {
749
- clearTimeout(timeout);
750
- timeout = setTimeout(callback, delay ? delay : 500);
749
+ var context = this;
750
+ var args = arguments;
751
+ if (timeout) clearTimeout(timeout);
752
+ timeout = setTimeout(function () {
753
+ callback.apply(context, args);
754
+ }, wait || 500);
751
755
  };
752
756
  };
757
+
753
758
  /**
754
759
  * delUrlParam
755
760
  * @desc:删除url指定参数
@@ -2886,7 +2891,8 @@ var toFunction = function toFunction(str) {
2886
2891
  * @param {string} [$color] - 颜色值
2887
2892
  **/
2888
2893
  var updateTheme = function updateTheme(color, send) {
2889
- color = color ? color : '#409eff';
2894
+ color = color && startWith(color, '#') ? color : '#409eff';
2895
+
2890
2896
  if (send === undefined) {
2891
2897
  send = true;
2892
2898
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.61",
3
+ "version": "0.5.63",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -67,6 +67,7 @@
67
67
  "sm-crypto": "^0.3.11",
68
68
  "sockjs-client": "^1.6.1",
69
69
  "stompjs": "^2.3.3",
70
+ "throttle-debounce": "^5.0.2",
70
71
  "video.js": "^8.0.4",
71
72
  "wujie-vue2": "^1.0.18"
72
73
  },
@@ -96,7 +97,7 @@
96
97
  "cp-cli": "^1.0.2",
97
98
  "cross-env": "^3.1.3",
98
99
  "css-loader": "^2.1.0",
99
- "eoss-element": "^0.2.91",
100
+ "eoss-element": "^0.2.93",
100
101
  "es6-promise": "^4.0.5",
101
102
  "eslint": "4.18.2",
102
103
  "eslint-config-elemefe": "0.1.1",
@@ -1,66 +1,68 @@
1
1
  <template>
2
2
  <el-button-group class="es-button-group">
3
- <template v-for="(item, index) in btns">
4
- <template v-if="item && !item.hide">
5
- <es-upload
6
- v-if="item.upload || (item.code && item.ownId)"
7
- class="el-button"
8
- v-bind="{
9
- ...item,
10
- method: 'post',
11
- size: size,
12
- showFileList: false,
13
- selectType: item.type ? item.type : ''
14
- }"
15
- ></es-upload>
16
- <es-button
17
- v-else
18
- :stop="stop"
19
- v-bind="item"
20
- :key="index"
21
- :size="size"
22
- :type="item.type"
23
- @click="handleClick({ ...data, handle: item })"
24
- >
25
- {{
26
- item.template ? item.template({ ...data, config: item }) : item.text
27
- }}
28
- </es-button>
29
- </template>
30
- <el-dropdown
31
- v-if="other.length > 0 && index == btns.length - 1"
32
- @command="handleCommand"
33
- @visible-change="handleChange"
34
- :trigger="trigger"
35
- >
36
- <el-button :size="size">
37
- <template v-if="moreText">
38
- {{ moreText }}
39
- <i
40
- :class="{
41
- 'el-icon-arrow-down': !show,
42
- 'el-icon-arrow-up': show
43
- }"
44
- ></i>
45
- </template>
46
- <i v-else class="es-icon-omit"></i>
47
- </el-button>
48
- <el-dropdown-menu slot="dropdown">
49
- <el-dropdown-item
50
- v-for="(item, index) in other"
3
+ <template v-if="length > 1">
4
+ <template v-for="(item, index) in showBtns">
5
+ <template v-if="item && !item.hide">
6
+ <es-upload
7
+ v-if="item.upload || (item.code && item.ownId)"
8
+ class="el-button"
9
+ v-bind="{
10
+ ...item,
11
+ method: 'post',
12
+ btnSize: size,
13
+ showFileList: false,
14
+ selectType: item.type ? item.type : ''
15
+ }"
16
+ ></es-upload>
17
+ <es-button
18
+ v-else
19
+ :stop="stop"
20
+ v-bind="item"
51
21
  :key="index"
52
- :command="item"
22
+ :size="size"
23
+ :type="item.type"
24
+ @click="handleClick({ ...data, handle: item })"
53
25
  >
54
- <i :class="item.icon" v-if="item.icon"></i
55
- >{{
26
+ {{
56
27
  item.template
57
28
  ? item.template({ ...data, config: item })
58
29
  : item.text
59
- }}</el-dropdown-item
60
- >
61
- </el-dropdown-menu>
62
- </el-dropdown>
30
+ }}
31
+ </es-button>
32
+ </template>
33
+ </template>
63
34
  </template>
35
+ <el-dropdown
36
+ v-if="other.length > 0"
37
+ @command="handleCommand"
38
+ @visible-change="handleChange"
39
+ :trigger="trigger"
40
+ >
41
+ <el-button :size="size">
42
+ <template v-if="moreText">
43
+ {{ moreText }}
44
+ <i
45
+ :class="{
46
+ 'el-icon-arrow-down': !show,
47
+ 'el-icon-arrow-up': show
48
+ }"
49
+ ></i>
50
+ </template>
51
+ <i v-else class="es-icon-omit"></i>
52
+ </el-button>
53
+ <el-dropdown-menu slot="dropdown">
54
+ <el-dropdown-item
55
+ v-for="(item, index) in other"
56
+ :key="index"
57
+ :command="item"
58
+ >
59
+ <i :class="item.icon" v-if="item.icon"></i
60
+ >{{
61
+ item.template ? item.template({ ...data, config: item }) : item.text
62
+ }}</el-dropdown-item
63
+ >
64
+ </el-dropdown-menu>
65
+ </el-dropdown>
64
66
  </el-button-group>
65
67
  </template>
66
68
  <script>
@@ -91,16 +93,27 @@ export default {
91
93
  size: {
92
94
  type: String,
93
95
  default: 'mini'
96
+ },
97
+ placement: {
98
+ type: String,
99
+ default: 'bottom'
94
100
  }
95
101
  },
96
102
  computed: {
97
103
  btns() {
98
104
  return this.getBtns();
99
105
  },
106
+ showBtns() {
107
+ return this.btns.length > this.length
108
+ ? this.btns.slice(0, this.length - 1)
109
+ : this.btns;
110
+ },
100
111
  other() {
101
- return this.length > 0 && this.btns.length > this.length
102
- ? this.btns.splice(this.length - 1, this.btns.length)
103
- : [];
112
+ let btns =
113
+ this.length > 0 && (this.btns.length > this.length || this.length == 1)
114
+ ? this.btns.slice(this.length - 1, this.btns.length)
115
+ : [];
116
+ return btns;
104
117
  }
105
118
  },
106
119
  watch: {},
@@ -11,6 +11,7 @@
11
11
  >
12
12
  <es-toolbar
13
13
  v-if="showToolbar"
14
+ ref="toolbar"
14
15
  v-bind="{
15
16
  contents: toolbars,
16
17
  showLabel: showLabel,
@@ -150,6 +151,7 @@
150
151
  </template>
151
152
  <script>
152
153
  import { findSysCode, getDictList } from 'eoss-ui/src/config/api.js';
154
+ import { debounce } from 'throttle-debounce';
153
155
  import children from './children.vue';
154
156
  import sizer from './sizer.vue';
155
157
  import util from 'eoss-ui/src/utils/util';
@@ -624,7 +626,7 @@ export default {
624
626
  param: {
625
627
  deep: true,
626
628
  handler(val) {
627
- this.getTableData();
629
+ this.getTableData(112);
628
630
  }
629
631
  },
630
632
  page: {
@@ -673,6 +675,9 @@ export default {
673
675
  }
674
676
  },
675
677
  created() {
678
+ this.getTableData = debounce(300, (res) => {
679
+ this.getTableDatas(res);
680
+ });
676
681
  if (Array.isArray(this.thead) && this.thead.length) {
677
682
  this.getOptions(this.thead);
678
683
  }
@@ -907,7 +912,7 @@ export default {
907
912
  }
908
913
  });
909
914
  },
910
- getTableData(res) {
915
+ getTableDatas(res) {
911
916
  let where;
912
917
  let first;
913
918
  if (res) {
@@ -1028,6 +1033,7 @@ export default {
1028
1033
  },
1029
1034
  doLayout() {
1030
1035
  this.$refs.oaTable.doLayout();
1036
+ this.$refs.oaTable.updateScroll();
1031
1037
  },
1032
1038
  sort(prop, order) {
1033
1039
  this.$refs.oaTable.sort(prop, order);
@@ -1496,6 +1502,9 @@ export default {
1496
1502
  this.sysCodes.forEach((item) => {
1497
1503
  bus.$off(item, this.setOptions);
1498
1504
  });
1505
+ },
1506
+ reset() {
1507
+ this.$refs.toolbar && this.$refs.toolbar.reset();
1499
1508
  }
1500
1509
  }
1501
1510
  };
@@ -1705,7 +1705,7 @@ export default {
1705
1705
  **/
1706
1706
  toTransfer(res) {
1707
1707
  if (this.beforeSubmit != undefined) {
1708
- this.beforeSubmit()
1708
+ this.beforeSubmit(0)
1709
1709
  .then((next) => {
1710
1710
  this.taskReadType = 'transfer';
1711
1711
  this.showTaskRead = true;
@@ -61,7 +61,7 @@
61
61
  :value="typeof ele.tips !== 'boolean' ? ele.tips : 0"
62
62
  ><i
63
63
  :class="[
64
- unicode(ele.icons) ? ele.icons : 'es-icons',
64
+ unicode(ele.icons) ? ele.icons : 'es-icon',
65
65
  'es-sub-system-icon',
66
66
  { 'es-icon-yingyong': !ele.icons }
67
67
  ]"
@@ -1,10 +1,9 @@
1
1
  <template>
2
2
  <i
3
- class="es-icon"
4
3
  :class="[className, { 'es-pointer': Object.keys(event).length }]"
5
4
  v-on="event"
5
+ v-html="code"
6
6
  >
7
- <slot>{{ code }}</slot>
8
7
  </i>
9
8
  </template>
10
9
  <script>
@@ -24,6 +23,7 @@ export default {
24
23
  if (typeof val == 'string') {
25
24
  if (util.startWith(val, '&#')) {
26
25
  this.code = val;
26
+ this.className = 'es-icon';
27
27
  } else {
28
28
  this.className = val;
29
29
  }
@@ -167,7 +167,7 @@ export default {
167
167
  {
168
168
  class: [
169
169
  'es-label-icon',
170
- 'es-icons',
170
+ 'es-icon',
171
171
  this.events && this.events['icon'] ? 'es-pointer' : ''
172
172
  ],
173
173
  on: {
@@ -306,7 +306,7 @@ export default {
306
306
  {
307
307
  class: [
308
308
  'es-label-icon',
309
- 'es-icons',
309
+ 'es-icon',
310
310
  this.events && this.events['icon'] ? 'es-pointer' : ''
311
311
  ],
312
312
  on: {