eoss-ui 0.7.76 → 0.7.77

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 (160) hide show
  1. package/lib/calogin.js +233 -233
  2. package/lib/eoss-ui.common.js +283 -265
  3. package/lib/index.js +1 -1
  4. package/lib/login.js +7 -4
  5. package/lib/main.js +24 -9
  6. package/lib/qr-code.js +13 -13
  7. package/lib/theme-chalk/index.css +1 -1
  8. package/lib/theme-chalk/login.css +1 -1
  9. package/package.json +1 -1
  10. package/packages/button/index.js +5 -5
  11. package/packages/button/src/main.vue +418 -418
  12. package/packages/button-group/index.js +5 -5
  13. package/packages/calendar/index.js +5 -5
  14. package/packages/calogin/index.js +5 -5
  15. package/packages/calogin/src/plugin.js +915 -915
  16. package/packages/card/index.js +5 -5
  17. package/packages/card/src/main.vue +156 -156
  18. package/packages/cascader/index.js +5 -5
  19. package/packages/cascader/src/main.vue +168 -168
  20. package/packages/checkbox-group/index.js +5 -5
  21. package/packages/checkbox-group/src/main.vue +333 -333
  22. package/packages/clients/index.js +5 -5
  23. package/packages/data-table/index.js +5 -5
  24. package/packages/data-table/src/children.vue +39 -39
  25. package/packages/data-table/src/sizer.vue +195 -195
  26. package/packages/data-table-form/index.js +5 -5
  27. package/packages/data-table-form/src/checkbox.vue +101 -101
  28. package/packages/data-table-form/src/colgroup.vue +17 -17
  29. package/packages/data-table-form/src/main.vue +181 -181
  30. package/packages/data-table-form/src/radio.vue +65 -65
  31. package/packages/data-table-form/src/table.vue +233 -233
  32. package/packages/data-table-form/src/tbody.vue +336 -336
  33. package/packages/data-table-form/src/thead.vue +68 -68
  34. package/packages/date-picker/index.js +5 -5
  35. package/packages/date-picker/src/main.vue +236 -236
  36. package/packages/dialog/index.js +5 -5
  37. package/packages/enable-drag/index.js +5 -5
  38. package/packages/enterprise/index.js +5 -5
  39. package/packages/enterprise/src/main.vue +66 -66
  40. package/packages/error-page/index.js +5 -5
  41. package/packages/error-page/src/main.vue +44 -44
  42. package/packages/flow/index.js +5 -5
  43. package/packages/flow/src/component/TimeLimit.vue +190 -190
  44. package/packages/flow/src/table.vue +58 -58
  45. package/packages/flow-group/index.js +5 -5
  46. package/packages/flow-list/index.js +5 -5
  47. package/packages/form/index.js +5 -5
  48. package/packages/handle-user/index.js +5 -5
  49. package/packages/handler/index.js +5 -5
  50. package/packages/icon/index.js +5 -5
  51. package/packages/icons/index.js +5 -5
  52. package/packages/icons/src/main.vue +81 -81
  53. package/packages/input/index.js +5 -5
  54. package/packages/input/src/main.vue +356 -356
  55. package/packages/input-number/index.js +5 -5
  56. package/packages/input-number/src/main.vue +106 -106
  57. package/packages/label/index.js +5 -5
  58. package/packages/label/src/main.vue +457 -457
  59. package/packages/layout/index.js +5 -5
  60. package/packages/layout/src/item.vue +152 -152
  61. package/packages/layout/src/main.vue +31 -31
  62. package/packages/login/index.js +5 -5
  63. package/packages/login/src/main.vue +5 -2
  64. package/packages/main/index.js +5 -5
  65. package/packages/main/src/default/message.vue +249 -249
  66. package/packages/main/src/default/notice.vue +157 -157
  67. package/packages/main/src/simplicity/lists.vue +84 -84
  68. package/packages/main/src/simplicity/router-page.vue +45 -45
  69. package/packages/main/src/simplicityTop/index.vue +12 -1
  70. package/packages/menu/index.js +5 -5
  71. package/packages/nav/index.js +5 -5
  72. package/packages/notify/index.js +5 -5
  73. package/packages/notify/src/main.vue +538 -538
  74. package/packages/page/index.js +5 -5
  75. package/packages/page/src/main.vue +167 -167
  76. package/packages/pagination/index.js +5 -5
  77. package/packages/pagination/src/main.vue +96 -96
  78. package/packages/player/index.js +5 -5
  79. package/packages/player/src/main.vue +194 -194
  80. package/packages/qr-code/index.js +5 -5
  81. package/packages/qr-code/src/main.vue +170 -170
  82. package/packages/radio-group/index.js +6 -6
  83. package/packages/radio-group/src/main.vue +319 -319
  84. package/packages/retrial-auth/index.js +5 -5
  85. package/packages/retrial-auth/src/main.vue +280 -280
  86. package/packages/select/index.js +5 -5
  87. package/packages/select-ganged/index.js +5 -5
  88. package/packages/select-ganged/src/main.vue +724 -724
  89. package/packages/selector/index.js +5 -5
  90. package/packages/selector-panel/index.js +5 -5
  91. package/packages/selector-panel/src/tree.vue +129 -129
  92. package/packages/sizer/index.js +5 -5
  93. package/packages/sizer/src/main.vue +254 -254
  94. package/packages/steps/index.js +5 -5
  95. package/packages/steps/src/main.vue +181 -181
  96. package/packages/switch/index.js +5 -5
  97. package/packages/table-form/index.js +5 -5
  98. package/packages/tabs/index.js +5 -5
  99. package/packages/tabs/src/main.vue +788 -788
  100. package/packages/tabs-panel/index.js +5 -5
  101. package/packages/tabs-panel/src/main.vue +29 -29
  102. package/packages/theme-chalk/lib/index.css +1 -1
  103. package/packages/theme-chalk/lib/login.css +1 -1
  104. package/packages/theme-chalk/src/base.scss +261 -261
  105. package/packages/theme-chalk/src/button-group.scss +176 -176
  106. package/packages/theme-chalk/src/button.scss +24 -24
  107. package/packages/theme-chalk/src/calendar.scss +113 -113
  108. package/packages/theme-chalk/src/card.scss +99 -99
  109. package/packages/theme-chalk/src/checkbox-group.scss +8 -8
  110. package/packages/theme-chalk/src/clients.scss +87 -87
  111. package/packages/theme-chalk/src/data-table-form.scss +67 -67
  112. package/packages/theme-chalk/src/date-picker.scss +7 -7
  113. package/packages/theme-chalk/src/dialog.scss +77 -77
  114. package/packages/theme-chalk/src/enable-drag.scss +181 -181
  115. package/packages/theme-chalk/src/enterprise.scss +5 -5
  116. package/packages/theme-chalk/src/error-page.scss +18 -18
  117. package/packages/theme-chalk/src/flow-group.scss +110 -110
  118. package/packages/theme-chalk/src/flow-list.scss +39 -39
  119. package/packages/theme-chalk/src/handle-user.scss +40 -40
  120. package/packages/theme-chalk/src/icons.scss +99 -99
  121. package/packages/theme-chalk/src/input.scss +9 -9
  122. package/packages/theme-chalk/src/label.scss +24 -24
  123. package/packages/theme-chalk/src/layout.scss +46 -46
  124. package/packages/theme-chalk/src/mixins/color.scss +117 -117
  125. package/packages/theme-chalk/src/nav.scss +111 -111
  126. package/packages/theme-chalk/src/page.scss +3 -3
  127. package/packages/theme-chalk/src/pagination.scss +29 -29
  128. package/packages/theme-chalk/src/player.scss +9 -9
  129. package/packages/theme-chalk/src/qr-code.scss +17 -17
  130. package/packages/theme-chalk/src/radio-group.scss +9 -9
  131. package/packages/theme-chalk/src/retrial-auth.scss +38 -38
  132. package/packages/theme-chalk/src/select-ganged.scss +8 -8
  133. package/packages/theme-chalk/src/select.scss +8 -8
  134. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  135. package/packages/theme-chalk/src/sizer.scss +36 -36
  136. package/packages/theme-chalk/src/steps.scss +88 -88
  137. package/packages/theme-chalk/src/switch.scss +3 -3
  138. package/packages/theme-chalk/src/table-form.scss +1 -1
  139. package/packages/theme-chalk/src/tabs.scss +87 -87
  140. package/packages/theme-chalk/src/tips.scss +7 -7
  141. package/packages/theme-chalk/src/toolbar.scss +179 -179
  142. package/packages/theme-chalk/src/tree-group.scss +72 -72
  143. package/packages/theme-chalk/src/wxlogin.scss +3 -3
  144. package/packages/tips/index.js +5 -5
  145. package/packages/toolbar/index.js +5 -5
  146. package/packages/tree/index.js +5 -5
  147. package/packages/tree-group/index.js +5 -5
  148. package/packages/upload/index.js +5 -5
  149. package/packages/upload/src/picture.js +15 -15
  150. package/packages/wujie/index.js +5 -5
  151. package/packages/wujie/src/main.vue +145 -145
  152. package/packages/wxlogin/index.js +5 -5
  153. package/packages/wxlogin/src/main.vue +128 -128
  154. package/src/config/image.js +2 -2
  155. package/src/index.js +1 -1
  156. package/src/utils/bus.js +3 -3
  157. package/src/utils/date-util.js +312 -312
  158. package/src/utils/http.js +50 -50
  159. package/src/utils/store.js +21 -21
  160. package/src/utils/webSocket.js +107 -107
@@ -1,457 +1,457 @@
1
- <script>
2
- export default {
3
- name: 'EsLabel',
4
- componentsName: 'EsLabel',
5
- inheritAttrs: false,
6
- props: {
7
- contents: {
8
- type: [Object, String],
9
- default() {
10
- return '';
11
- }
12
- },
13
- text: String,
14
- rules: {
15
- type: [Array, Object],
16
- default() {
17
- return {};
18
- }
19
- },
20
- icon: {
21
- type: String,
22
- default: ''
23
- },
24
- img: {
25
- type: String,
26
- default: ''
27
- },
28
- image: {
29
- type: String,
30
- default: ''
31
- },
32
- hide: {
33
- type: Boolean,
34
- default: false
35
- },
36
- tips: {
37
- type: [String, Object],
38
- default: ''
39
- },
40
- before: {
41
- type: Boolean,
42
- default: true
43
- },
44
- labelWidth: {
45
- type: String,
46
- default: '120px'
47
- },
48
- plain: Boolean,
49
- events: Object,
50
- event: Function
51
- },
52
- computed: {
53
- isRequired() {
54
- let flag = false;
55
- if (Array.isArray(this.rules)) {
56
- this.rules.forEach((item) => {
57
- if (Object.prototype.hasOwnProperty.call(item, 'required')) {
58
- flag = item.required;
59
- return flag;
60
- }
61
- });
62
- } else {
63
- if (Object.prototype.hasOwnProperty.call(this.rules, 'required')) {
64
- flag = this.rules.required;
65
- }
66
- }
67
- return flag;
68
- }
69
- },
70
- data() {
71
- return {
72
- placeholders: this.placeholder
73
- };
74
- },
75
- mounted() {},
76
- methods: {
77
- handleClick(e, type, obj) {
78
- e.stopPropagation();
79
- e.preventDefault();
80
- if (type) {
81
- if (this.events && this.events[type]) {
82
- let params = obj ? [obj, e, this] : [e, this];
83
- if (typeof this.events[type] === 'function') {
84
- this.events[type]('click', ...params);
85
- } else if (
86
- this.events[type]['click'] &&
87
- typeof this.events[type]['click'] === 'function'
88
- ) {
89
- this.events[type]['click'](...params);
90
- }
91
- }
92
- } else {
93
- this.event && this.event(this, e);
94
- this.$emit('click', this, e);
95
- }
96
- },
97
- handleMouseenter(e, type, obj) {
98
- e.stopPropagation();
99
- e.preventDefault();
100
- if (type && this.events && this.events[type]) {
101
- let params = obj ? [obj, e, this] : [e, this];
102
- if (typeof this.events[type] === 'function') {
103
- this.events[type]('mouseenter', ...params);
104
- } else if (
105
- this.events[type]['mouseenter'] &&
106
- typeof this.events[type]['mouseenter'] === 'function'
107
- ) {
108
- this.events[type]['mouseenter'](...params);
109
- }
110
- }
111
- },
112
- handleMouseleave(e, type, obj) {
113
- e.stopPropagation();
114
- e.preventDefault();
115
- if (type && this.events && this.events[type]) {
116
- let params = obj ? [obj, e, this] : [e, this];
117
- if (typeof this.events[type] === 'function') {
118
- this.events[type]('mouseleave', ...params);
119
- } else if (
120
- this.events[type]['mouseleave'] &&
121
- typeof this.events[type]['mouseleave'] === 'function'
122
- ) {
123
- this.events[type]['mouseleave'](...params);
124
- }
125
- }
126
- }
127
- },
128
- render(h) {
129
- let i = 0;
130
- let doms = [];
131
- if (!this.hide) {
132
- if (this.$slots.prepend) {
133
- doms.push(this.$slots.prepend);
134
- }
135
- if (typeof this.contents === 'string') {
136
- if (this.contents || this.text) {
137
- doms.push(this.contents || this.text);
138
- }
139
- if (this.icon) {
140
- if (
141
- this.icon.indexOf('es-icon-') > -1 ||
142
- this.icon.indexOf('el-icon-') > -1
143
- ) {
144
- doms.push(
145
- h('i', {
146
- class: [
147
- this.icon,
148
- this.events && this.events['icon'] ? 'es-pointer' : ''
149
- ],
150
- on: {
151
- click: (e) => {
152
- this.handleClick(e, 'icon');
153
- },
154
- mouseenter: (e) => {
155
- this.handleMouseenter(e, 'icon');
156
- },
157
- mouseleave: (e) => {
158
- this.handleMouseleave(e, 'icon');
159
- }
160
- }
161
- })
162
- );
163
- } else if (this.icon.indexOf('&#') > -1) {
164
- doms.push(
165
- h(
166
- 'i',
167
- {
168
- class: [
169
- 'es-label-icon',
170
- 'es-icon',
171
- this.events && this.events['icon'] ? 'es-pointer' : ''
172
- ],
173
- on: {
174
- click: (e) => {
175
- this.handleClick(e, 'icon');
176
- },
177
- mouseenter: (e) => {
178
- this.handleMouseenter(e, 'icon');
179
- },
180
- mouseleave: (e) => {
181
- this.handleMouseleave(e, 'icon');
182
- }
183
- }
184
- },
185
- [this.icon]
186
- )
187
- );
188
- } else {
189
- let icon =
190
- this.icon.indexOf('es-') > -1
191
- ? 'es-icon-' + this.icon.replace('es-', '')
192
- : 'el-icon-' + this.icon.replace('el-', '');
193
- doms.push(
194
- h('i', {
195
- class: [
196
- icon,
197
- 'es-label-icon',
198
- this.events && this.events['icon'] ? 'es-pointer' : ''
199
- ],
200
- on: {
201
- click: (e) => {
202
- this.handleClick(e, 'icon');
203
- },
204
- mouseenter: (e) => {
205
- this.handleMouseenter(e, 'icon');
206
- },
207
- mouseleave: (e) => {
208
- this.handleMouseleave(e, 'icon');
209
- }
210
- }
211
- })
212
- );
213
- }
214
- }
215
- if (this.image || this.img) {
216
- doms.push(
217
- h('img', {
218
- class: [
219
- 'es-label-img',
220
- this.events && (this.events['image'] || this.events['img'])
221
- ? 'es-pointer'
222
- : ''
223
- ],
224
- attrs: { src: this.image || this.img },
225
- on: {
226
- click: (e) => {
227
- this.handleClick(e, this.image ? 'image' : 'img');
228
- },
229
- mouseenter: (e) => {
230
- this.handleMouseenter(e, this.image ? 'image' : 'img');
231
- },
232
- mouseleave: (e) => {
233
- this.handleMouseleave(e, this.image ? 'image' : 'img');
234
- }
235
- }
236
- })
237
- );
238
- }
239
- if (this.tips) {
240
- if (typeof this.tips === 'string') {
241
- if (this.before) {
242
- doms.unshift(
243
- h('es-tips', {
244
- props: { contents: this.tips }
245
- })
246
- );
247
- } else {
248
- i = doms.length;
249
- doms.push(
250
- h('es-tips', {
251
- props: { contents: this.tips }
252
- })
253
- );
254
- }
255
- } else {
256
- if (this.before) {
257
- doms.unshift(
258
- h('es-tips', {
259
- props: { ...this.tips }
260
- })
261
- );
262
- } else {
263
- i = doms.length;
264
- doms.push(
265
- h('es-tips', {
266
- props: { ...this.tips }
267
- })
268
- );
269
- }
270
- }
271
- }
272
- } else {
273
- for (let i in this.contents) {
274
- switch (i) {
275
- case 'text':
276
- doms.push(this.contents[i]);
277
- break;
278
- case 'icon':
279
- if (
280
- this.contents[i].indexOf('es-icon-') > -1 ||
281
- this.contents[i].indexOf('el-icon-') > -1
282
- ) {
283
- doms.push(
284
- h('i', {
285
- class: [
286
- this.contents[i],
287
- this.events && this.events['icon'] ? 'es-pointer' : ''
288
- ],
289
- on: {
290
- click: (e) => {
291
- this.handleClick(e, 'icon');
292
- },
293
- mouseenter: (e) => {
294
- this.handleMouseenter(e, 'icon');
295
- },
296
- mouseleave: (e) => {
297
- this.handleMouseleave(e, 'icon');
298
- }
299
- }
300
- })
301
- );
302
- } else if (this.contents[i].indexOf('&#') > -1) {
303
- doms.push(
304
- h(
305
- 'i',
306
- {
307
- class: [
308
- 'es-label-icon',
309
- 'es-icon',
310
- this.events && this.events['icon'] ? 'es-pointer' : ''
311
- ],
312
- on: {
313
- click: (e) => {
314
- this.handleClick(e, 'icon');
315
- },
316
- mouseenter: (e) => {
317
- this.handleMouseenter(e, 'icon');
318
- },
319
- mouseleave: (e) => {
320
- this.handleMouseleave(e, 'icon');
321
- }
322
- }
323
- },
324
- [this.contents[i]]
325
- )
326
- );
327
- } else {
328
- let icon =
329
- this.contents[i].indexOf('es-') > -1
330
- ? 'es-icon-' + this.contents[i].replace('es-', '')
331
- : 'el-icon-' + this.contents[i].replace('el-', '');
332
- doms.push(
333
- h('i', {
334
- class: [
335
- icon,
336
- 'es-label-icon',
337
- this.events && this.events['icon'] ? 'es-pointer' : ''
338
- ],
339
- on: {
340
- click: (e) => {
341
- this.handleClick(e, 'icon');
342
- },
343
- mouseenter: (e) => {
344
- this.handleMouseenter(e, 'icon');
345
- },
346
- mouseleave: (e) => {
347
- this.handleMouseleave(e, 'icon');
348
- }
349
- }
350
- })
351
- );
352
- }
353
- break;
354
- case 'img':
355
- doms.push(
356
- h('img', {
357
- class: [
358
- 'es-label-img',
359
- this.events && this.events['img'] ? 'es-pointer' : ''
360
- ],
361
- attrs: { src: this.contents[i] },
362
- on: {
363
- click: (e) => {
364
- this.handleClick(e, 'img');
365
- },
366
- mouseenter: (e) => {
367
- this.handleMouseenter(e, 'img');
368
- },
369
- mouseleave: (e) => {
370
- this.handleMouseleave(e, 'img');
371
- }
372
- }
373
- })
374
- );
375
- break;
376
- case 'image':
377
- doms.push(
378
- h('img', {
379
- class: [
380
- 'es-label-img',
381
- this.events && this.events['image'] ? 'es-pointer' : ''
382
- ],
383
- attrs: { src: this.contents[i] },
384
- on: {
385
- click: (e) => {
386
- this.handleClick(e, 'image');
387
- },
388
- mouseenter: (e) => {
389
- this.handleMouseenter(e, 'image');
390
- },
391
- mouseleave: (e) => {
392
- this.handleMouseleave(e, 'image');
393
- }
394
- }
395
- })
396
- );
397
- break;
398
- case 'tips':
399
- if (typeof this.contents[i] === 'string') {
400
- if (this.before) {
401
- doms.unshift(
402
- h('es-tips', {
403
- props: { contents: this.contents[i] }
404
- })
405
- );
406
- } else {
407
- i = doms.length;
408
- doms.push(
409
- h('es-tips', {
410
- props: { contents: this.contents[i] }
411
- })
412
- );
413
- }
414
- } else {
415
- if (this.before) {
416
- doms.unshift(
417
- h('es-tips', {
418
- props: { ...this.contents[i] }
419
- })
420
- );
421
- } else {
422
- i = doms.length;
423
- doms.push(
424
- h('es-tips', {
425
- props: { ...this.contents[i] }
426
- })
427
- );
428
- }
429
- }
430
- break;
431
- }
432
- }
433
- }
434
- if (this.$slots.append) {
435
- if (i > 0) {
436
- doms.splice(i, 0, this.$slots.append);
437
- } else {
438
- doms.push(this.$slots.append);
439
- }
440
- }
441
- if (this.plain) {
442
- doms.push(':');
443
- }
444
- return h(
445
- 'span',
446
- {
447
- class: { 'es-label': true, 'es-is-required': this.isRequired },
448
- on: { click: this.handleClick }
449
- },
450
- doms
451
- );
452
- } else {
453
- return '';
454
- }
455
- }
456
- };
457
- </script>
1
+ <script>
2
+ export default {
3
+ name: 'EsLabel',
4
+ componentsName: 'EsLabel',
5
+ inheritAttrs: false,
6
+ props: {
7
+ contents: {
8
+ type: [Object, String],
9
+ default() {
10
+ return '';
11
+ }
12
+ },
13
+ text: String,
14
+ rules: {
15
+ type: [Array, Object],
16
+ default() {
17
+ return {};
18
+ }
19
+ },
20
+ icon: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+ img: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ image: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ hide: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ tips: {
37
+ type: [String, Object],
38
+ default: ''
39
+ },
40
+ before: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ labelWidth: {
45
+ type: String,
46
+ default: '120px'
47
+ },
48
+ plain: Boolean,
49
+ events: Object,
50
+ event: Function
51
+ },
52
+ computed: {
53
+ isRequired() {
54
+ let flag = false;
55
+ if (Array.isArray(this.rules)) {
56
+ this.rules.forEach((item) => {
57
+ if (Object.prototype.hasOwnProperty.call(item, 'required')) {
58
+ flag = item.required;
59
+ return flag;
60
+ }
61
+ });
62
+ } else {
63
+ if (Object.prototype.hasOwnProperty.call(this.rules, 'required')) {
64
+ flag = this.rules.required;
65
+ }
66
+ }
67
+ return flag;
68
+ }
69
+ },
70
+ data() {
71
+ return {
72
+ placeholders: this.placeholder
73
+ };
74
+ },
75
+ mounted() {},
76
+ methods: {
77
+ handleClick(e, type, obj) {
78
+ e.stopPropagation();
79
+ e.preventDefault();
80
+ if (type) {
81
+ if (this.events && this.events[type]) {
82
+ let params = obj ? [obj, e, this] : [e, this];
83
+ if (typeof this.events[type] === 'function') {
84
+ this.events[type]('click', ...params);
85
+ } else if (
86
+ this.events[type]['click'] &&
87
+ typeof this.events[type]['click'] === 'function'
88
+ ) {
89
+ this.events[type]['click'](...params);
90
+ }
91
+ }
92
+ } else {
93
+ this.event && this.event(this, e);
94
+ this.$emit('click', this, e);
95
+ }
96
+ },
97
+ handleMouseenter(e, type, obj) {
98
+ e.stopPropagation();
99
+ e.preventDefault();
100
+ if (type && this.events && this.events[type]) {
101
+ let params = obj ? [obj, e, this] : [e, this];
102
+ if (typeof this.events[type] === 'function') {
103
+ this.events[type]('mouseenter', ...params);
104
+ } else if (
105
+ this.events[type]['mouseenter'] &&
106
+ typeof this.events[type]['mouseenter'] === 'function'
107
+ ) {
108
+ this.events[type]['mouseenter'](...params);
109
+ }
110
+ }
111
+ },
112
+ handleMouseleave(e, type, obj) {
113
+ e.stopPropagation();
114
+ e.preventDefault();
115
+ if (type && this.events && this.events[type]) {
116
+ let params = obj ? [obj, e, this] : [e, this];
117
+ if (typeof this.events[type] === 'function') {
118
+ this.events[type]('mouseleave', ...params);
119
+ } else if (
120
+ this.events[type]['mouseleave'] &&
121
+ typeof this.events[type]['mouseleave'] === 'function'
122
+ ) {
123
+ this.events[type]['mouseleave'](...params);
124
+ }
125
+ }
126
+ }
127
+ },
128
+ render(h) {
129
+ let i = 0;
130
+ let doms = [];
131
+ if (!this.hide) {
132
+ if (this.$slots.prepend) {
133
+ doms.push(this.$slots.prepend);
134
+ }
135
+ if (typeof this.contents === 'string') {
136
+ if (this.contents || this.text) {
137
+ doms.push(this.contents || this.text);
138
+ }
139
+ if (this.icon) {
140
+ if (
141
+ this.icon.indexOf('es-icon-') > -1 ||
142
+ this.icon.indexOf('el-icon-') > -1
143
+ ) {
144
+ doms.push(
145
+ h('i', {
146
+ class: [
147
+ this.icon,
148
+ this.events && this.events['icon'] ? 'es-pointer' : ''
149
+ ],
150
+ on: {
151
+ click: (e) => {
152
+ this.handleClick(e, 'icon');
153
+ },
154
+ mouseenter: (e) => {
155
+ this.handleMouseenter(e, 'icon');
156
+ },
157
+ mouseleave: (e) => {
158
+ this.handleMouseleave(e, 'icon');
159
+ }
160
+ }
161
+ })
162
+ );
163
+ } else if (this.icon.indexOf('&#') > -1) {
164
+ doms.push(
165
+ h(
166
+ 'i',
167
+ {
168
+ class: [
169
+ 'es-label-icon',
170
+ 'es-icon',
171
+ this.events && this.events['icon'] ? 'es-pointer' : ''
172
+ ],
173
+ on: {
174
+ click: (e) => {
175
+ this.handleClick(e, 'icon');
176
+ },
177
+ mouseenter: (e) => {
178
+ this.handleMouseenter(e, 'icon');
179
+ },
180
+ mouseleave: (e) => {
181
+ this.handleMouseleave(e, 'icon');
182
+ }
183
+ }
184
+ },
185
+ [this.icon]
186
+ )
187
+ );
188
+ } else {
189
+ let icon =
190
+ this.icon.indexOf('es-') > -1
191
+ ? 'es-icon-' + this.icon.replace('es-', '')
192
+ : 'el-icon-' + this.icon.replace('el-', '');
193
+ doms.push(
194
+ h('i', {
195
+ class: [
196
+ icon,
197
+ 'es-label-icon',
198
+ this.events && this.events['icon'] ? 'es-pointer' : ''
199
+ ],
200
+ on: {
201
+ click: (e) => {
202
+ this.handleClick(e, 'icon');
203
+ },
204
+ mouseenter: (e) => {
205
+ this.handleMouseenter(e, 'icon');
206
+ },
207
+ mouseleave: (e) => {
208
+ this.handleMouseleave(e, 'icon');
209
+ }
210
+ }
211
+ })
212
+ );
213
+ }
214
+ }
215
+ if (this.image || this.img) {
216
+ doms.push(
217
+ h('img', {
218
+ class: [
219
+ 'es-label-img',
220
+ this.events && (this.events['image'] || this.events['img'])
221
+ ? 'es-pointer'
222
+ : ''
223
+ ],
224
+ attrs: { src: this.image || this.img },
225
+ on: {
226
+ click: (e) => {
227
+ this.handleClick(e, this.image ? 'image' : 'img');
228
+ },
229
+ mouseenter: (e) => {
230
+ this.handleMouseenter(e, this.image ? 'image' : 'img');
231
+ },
232
+ mouseleave: (e) => {
233
+ this.handleMouseleave(e, this.image ? 'image' : 'img');
234
+ }
235
+ }
236
+ })
237
+ );
238
+ }
239
+ if (this.tips) {
240
+ if (typeof this.tips === 'string') {
241
+ if (this.before) {
242
+ doms.unshift(
243
+ h('es-tips', {
244
+ props: { contents: this.tips }
245
+ })
246
+ );
247
+ } else {
248
+ i = doms.length;
249
+ doms.push(
250
+ h('es-tips', {
251
+ props: { contents: this.tips }
252
+ })
253
+ );
254
+ }
255
+ } else {
256
+ if (this.before) {
257
+ doms.unshift(
258
+ h('es-tips', {
259
+ props: { ...this.tips }
260
+ })
261
+ );
262
+ } else {
263
+ i = doms.length;
264
+ doms.push(
265
+ h('es-tips', {
266
+ props: { ...this.tips }
267
+ })
268
+ );
269
+ }
270
+ }
271
+ }
272
+ } else {
273
+ for (let i in this.contents) {
274
+ switch (i) {
275
+ case 'text':
276
+ doms.push(this.contents[i]);
277
+ break;
278
+ case 'icon':
279
+ if (
280
+ this.contents[i].indexOf('es-icon-') > -1 ||
281
+ this.contents[i].indexOf('el-icon-') > -1
282
+ ) {
283
+ doms.push(
284
+ h('i', {
285
+ class: [
286
+ this.contents[i],
287
+ this.events && this.events['icon'] ? 'es-pointer' : ''
288
+ ],
289
+ on: {
290
+ click: (e) => {
291
+ this.handleClick(e, 'icon');
292
+ },
293
+ mouseenter: (e) => {
294
+ this.handleMouseenter(e, 'icon');
295
+ },
296
+ mouseleave: (e) => {
297
+ this.handleMouseleave(e, 'icon');
298
+ }
299
+ }
300
+ })
301
+ );
302
+ } else if (this.contents[i].indexOf('&#') > -1) {
303
+ doms.push(
304
+ h(
305
+ 'i',
306
+ {
307
+ class: [
308
+ 'es-label-icon',
309
+ 'es-icon',
310
+ this.events && this.events['icon'] ? 'es-pointer' : ''
311
+ ],
312
+ on: {
313
+ click: (e) => {
314
+ this.handleClick(e, 'icon');
315
+ },
316
+ mouseenter: (e) => {
317
+ this.handleMouseenter(e, 'icon');
318
+ },
319
+ mouseleave: (e) => {
320
+ this.handleMouseleave(e, 'icon');
321
+ }
322
+ }
323
+ },
324
+ [this.contents[i]]
325
+ )
326
+ );
327
+ } else {
328
+ let icon =
329
+ this.contents[i].indexOf('es-') > -1
330
+ ? 'es-icon-' + this.contents[i].replace('es-', '')
331
+ : 'el-icon-' + this.contents[i].replace('el-', '');
332
+ doms.push(
333
+ h('i', {
334
+ class: [
335
+ icon,
336
+ 'es-label-icon',
337
+ this.events && this.events['icon'] ? 'es-pointer' : ''
338
+ ],
339
+ on: {
340
+ click: (e) => {
341
+ this.handleClick(e, 'icon');
342
+ },
343
+ mouseenter: (e) => {
344
+ this.handleMouseenter(e, 'icon');
345
+ },
346
+ mouseleave: (e) => {
347
+ this.handleMouseleave(e, 'icon');
348
+ }
349
+ }
350
+ })
351
+ );
352
+ }
353
+ break;
354
+ case 'img':
355
+ doms.push(
356
+ h('img', {
357
+ class: [
358
+ 'es-label-img',
359
+ this.events && this.events['img'] ? 'es-pointer' : ''
360
+ ],
361
+ attrs: { src: this.contents[i] },
362
+ on: {
363
+ click: (e) => {
364
+ this.handleClick(e, 'img');
365
+ },
366
+ mouseenter: (e) => {
367
+ this.handleMouseenter(e, 'img');
368
+ },
369
+ mouseleave: (e) => {
370
+ this.handleMouseleave(e, 'img');
371
+ }
372
+ }
373
+ })
374
+ );
375
+ break;
376
+ case 'image':
377
+ doms.push(
378
+ h('img', {
379
+ class: [
380
+ 'es-label-img',
381
+ this.events && this.events['image'] ? 'es-pointer' : ''
382
+ ],
383
+ attrs: { src: this.contents[i] },
384
+ on: {
385
+ click: (e) => {
386
+ this.handleClick(e, 'image');
387
+ },
388
+ mouseenter: (e) => {
389
+ this.handleMouseenter(e, 'image');
390
+ },
391
+ mouseleave: (e) => {
392
+ this.handleMouseleave(e, 'image');
393
+ }
394
+ }
395
+ })
396
+ );
397
+ break;
398
+ case 'tips':
399
+ if (typeof this.contents[i] === 'string') {
400
+ if (this.before) {
401
+ doms.unshift(
402
+ h('es-tips', {
403
+ props: { contents: this.contents[i] }
404
+ })
405
+ );
406
+ } else {
407
+ i = doms.length;
408
+ doms.push(
409
+ h('es-tips', {
410
+ props: { contents: this.contents[i] }
411
+ })
412
+ );
413
+ }
414
+ } else {
415
+ if (this.before) {
416
+ doms.unshift(
417
+ h('es-tips', {
418
+ props: { ...this.contents[i] }
419
+ })
420
+ );
421
+ } else {
422
+ i = doms.length;
423
+ doms.push(
424
+ h('es-tips', {
425
+ props: { ...this.contents[i] }
426
+ })
427
+ );
428
+ }
429
+ }
430
+ break;
431
+ }
432
+ }
433
+ }
434
+ if (this.$slots.append) {
435
+ if (i > 0) {
436
+ doms.splice(i, 0, this.$slots.append);
437
+ } else {
438
+ doms.push(this.$slots.append);
439
+ }
440
+ }
441
+ if (this.plain) {
442
+ doms.push(':');
443
+ }
444
+ return h(
445
+ 'span',
446
+ {
447
+ class: { 'es-label': true, 'es-is-required': this.isRequired },
448
+ on: { click: this.handleClick }
449
+ },
450
+ doms
451
+ );
452
+ } else {
453
+ return '';
454
+ }
455
+ }
456
+ };
457
+ </script>