eoss-ui 0.5.74 → 0.5.76

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 (72) hide show
  1. package/lib/button-group.js +125 -23
  2. package/lib/button.js +125 -23
  3. package/lib/checkbox-group.js +125 -23
  4. package/lib/data-table-form.js +125 -23
  5. package/lib/data-table.js +155 -40
  6. package/lib/date-picker.js +125 -23
  7. package/lib/dialog.js +125 -23
  8. package/lib/eoss-ui.common.js +520 -296
  9. package/lib/flow-group.js +125 -23
  10. package/lib/flow-list.js +136 -31
  11. package/lib/flow.js +125 -23
  12. package/lib/form.js +125 -23
  13. package/lib/handle-user.js +125 -23
  14. package/lib/handler.js +125 -23
  15. package/lib/index.js +1 -1
  16. package/lib/input-number.js +124 -22
  17. package/lib/input.js +141 -29
  18. package/lib/login.js +293 -143
  19. package/lib/main.js +125 -23
  20. package/lib/nav.js +125 -23
  21. package/lib/page.js +125 -23
  22. package/lib/player.js +125 -23
  23. package/lib/qr-code.js +178 -59
  24. package/lib/radio-group.js +125 -23
  25. package/lib/retrial-auth.js +125 -23
  26. package/lib/select-ganged.js +125 -23
  27. package/lib/select.js +140 -28
  28. package/lib/selector-panel.js +125 -23
  29. package/lib/selector.js +125 -23
  30. package/lib/sizer.js +125 -23
  31. package/lib/steps.js +125 -23
  32. package/lib/switch.js +124 -22
  33. package/lib/table-form.js +125 -23
  34. package/lib/tabs.js +125 -23
  35. package/lib/theme-chalk/base.css +1 -1
  36. package/lib/theme-chalk/index.css +1 -1
  37. package/lib/theme-chalk/login.css +1 -1
  38. package/lib/theme-chalk/main.css +1 -1
  39. package/lib/theme-chalk/menu.css +1 -1
  40. package/lib/theme-chalk/sizer.css +1 -1
  41. package/lib/theme-chalk/upload.css +1 -1
  42. package/lib/tips.js +125 -23
  43. package/lib/toolbar.js +3 -2
  44. package/lib/tree-group.js +159 -57
  45. package/lib/tree.js +140 -26
  46. package/lib/upload.js +125 -23
  47. package/lib/utils/util.js +124 -22
  48. package/lib/wujie.js +125 -23
  49. package/lib/wxlogin.js +152 -34
  50. package/package.json +2 -2
  51. package/packages/data-table/src/main.vue +25 -15
  52. package/packages/flow-list/src/main.vue +63 -41
  53. package/packages/input/src/main.vue +7 -6
  54. package/packages/login/src/main.vue +42 -14
  55. package/packages/qr-code/src/main.vue +48 -37
  56. package/packages/select/src/main.vue +6 -5
  57. package/packages/theme-chalk/lib/base.css +1 -1
  58. package/packages/theme-chalk/lib/index.css +1 -1
  59. package/packages/theme-chalk/lib/login.css +1 -1
  60. package/packages/theme-chalk/lib/main.css +1 -1
  61. package/packages/theme-chalk/lib/menu.css +1 -1
  62. package/packages/theme-chalk/lib/sizer.css +1 -1
  63. package/packages/theme-chalk/lib/upload.css +1 -1
  64. package/packages/theme-chalk/src/base.scss +3 -0
  65. package/packages/theme-chalk/src/login.scss +862 -376
  66. package/packages/theme-chalk/src/main.scss +5 -2
  67. package/packages/toolbar/src/main.vue +16 -6
  68. package/packages/tree/src/main.vue +13 -1
  69. package/packages/tree-group/src/main.vue +24 -37
  70. package/packages/wxlogin/src/main.vue +30 -12
  71. package/src/index.js +1 -1
  72. package/src/utils/util.js +138 -23
@@ -8,7 +8,10 @@
8
8
  (item.type == 'splitReading' &&
9
9
  splitReadingData &&
10
10
  splitReadingData.length > 0) ||
11
- (item.type == 'preset' && presetData && presetData.length > 0 && currentUserHasPresetInfoAuth) ||
11
+ (item.type == 'preset' &&
12
+ presetData &&
13
+ presetData.length > 0 &&
14
+ currentUserHasPresetInfoAuth) ||
12
15
  (item.type != 'splitReading' && item.type != 'preset')
13
16
  "
14
17
  >
@@ -128,7 +131,7 @@ export default {
128
131
  pressTableList: [],
129
132
  currentPage: 1,
130
133
  pageSize: 20,
131
- currentUserHasPresetInfoAuth:false,
134
+ currentUserHasPresetInfoAuth: false,
132
135
  pressThead: [
133
136
  {
134
137
  title: '催办节点',
@@ -321,7 +324,7 @@ export default {
321
324
  label: '经办部门',
322
325
  field: 'deptid',
323
326
  align: 'center',
324
- key:'jbbm',
327
+ key: 'jbbm',
325
328
  showOverflowTooltip: true,
326
329
  width: 150
327
330
  },
@@ -329,7 +332,7 @@ export default {
329
332
  label: '步骤',
330
333
  field: 'itemname',
331
334
  align: 'center',
332
- key:'bz',
335
+ key: 'bz',
333
336
  showOverflowTooltip: true,
334
337
  width: 110
335
338
  },
@@ -337,7 +340,7 @@ export default {
337
340
  label: '办理人',
338
341
  field: 'userName',
339
342
  align: 'center',
340
- key:'blr',
343
+ key: 'blr',
341
344
  showOverflowTooltip: true,
342
345
  width: 110
343
346
  },
@@ -346,13 +349,13 @@ export default {
346
349
  field: 'deptName',
347
350
  align: 'center',
348
351
  showOverflowTooltip: true,
349
- key:'blrbm',
352
+ key: 'blrbm',
350
353
  width: 110
351
354
  },
352
355
  {
353
356
  label: '状态',
354
357
  field: 'pendstate',
355
- key:'zt',
358
+ key: 'zt',
356
359
  align: 'center',
357
360
  showOverflowTooltip: true,
358
361
  width: 80,
@@ -375,20 +378,25 @@ export default {
375
378
  field: 'doresult',
376
379
  align: 'center',
377
380
  showOverflowTooltip: true,
378
- key:'blyj',
381
+ key: 'blyj',
379
382
  render: (h, params) => {
380
- return h(
381
- 'span',
382
- {},
383
- params.row.doresult || params.row.handleInfo
384
- );
383
+ return h('span', {}, [
384
+ params.row.doresult
385
+ ? params.row.doresult + (params.row.handleInfo ? '&' : '')
386
+ : '',
387
+ h(
388
+ 'span',
389
+ { style: { color: '#A5A5A5', marginLeft: '2px' } },
390
+ params.row.handleInfo || ''
391
+ )
392
+ ]);
385
393
  }
386
394
  },
387
395
  {
388
396
  label: '验签',
389
397
  field: 'authTypeStr',
390
398
  align: 'center',
391
- key:'yq',
399
+ key: 'yq',
392
400
  showOverflowTooltip: true,
393
401
  width: 70,
394
402
  render: (h, params) => {
@@ -401,7 +409,7 @@ export default {
401
409
  },
402
410
  {
403
411
  label: '附件',
404
- key:'fj',
412
+ key: 'fj',
405
413
  field: 'hasAdjunct',
406
414
  align: 'center',
407
415
  showOverflowTooltip: true,
@@ -423,14 +431,16 @@ export default {
423
431
  label: '时间',
424
432
  field: 'doetime',
425
433
  align: 'center',
426
- key:'sj',
434
+ key: 'sj',
427
435
  showOverflowTooltip: true,
428
436
  width: 150,
429
437
  render: (h, params) => {
430
438
  return h(
431
439
  'span',
432
440
  {},
433
- params.row.doetime ? util.formatDate(params.row.doetime, 'yyyy-MM-dd HH:mm') : ''
441
+ params.row.doetime
442
+ ? util.formatDate(params.row.doetime, 'yyyy-MM-dd HH:mm')
443
+ : ''
434
444
  );
435
445
  }
436
446
  },
@@ -438,7 +448,7 @@ export default {
438
448
  label: '代办人',
439
449
  field: 'douserid',
440
450
  align: 'center',
441
- key:'dbr',
451
+ key: 'dbr',
442
452
  showOverflowTooltip: true,
443
453
  width: 80,
444
454
  hide: _that.flowTableInfo.hasAgent != '1'
@@ -447,7 +457,7 @@ export default {
447
457
  label: '催办',
448
458
  field: 'pressTimes',
449
459
  align: 'center',
450
- key:'cb',
460
+ key: 'cb',
451
461
  showOverflowTooltip: true,
452
462
  width: 150,
453
463
  render: (h, params) => {
@@ -484,7 +494,7 @@ export default {
484
494
  {
485
495
  label: '经办部门',
486
496
  field: 'deptid',
487
- key:'jbbm',
497
+ key: 'jbbm',
488
498
  align: 'center',
489
499
  showOverflowTooltip: true,
490
500
  width: 150
@@ -493,7 +503,7 @@ export default {
493
503
  label: '步骤',
494
504
  field: 'itemname',
495
505
  align: 'center',
496
- key:'bz',
506
+ key: 'bz',
497
507
  showOverflowTooltip: true,
498
508
  width: 110
499
509
  },
@@ -501,7 +511,7 @@ export default {
501
511
  label: '办理人',
502
512
  field: 'userName',
503
513
  align: 'center',
504
- key:'blr',
514
+ key: 'blr',
505
515
  showOverflowTooltip: true,
506
516
  width: 110
507
517
  },
@@ -509,7 +519,7 @@ export default {
509
519
  label: '状态',
510
520
  field: 'pendstate',
511
521
  align: 'center',
512
- key:'zt',
522
+ key: 'zt',
513
523
  showOverflowTooltip: true,
514
524
  width: 80,
515
525
  render: (h, params) => {
@@ -530,21 +540,26 @@ export default {
530
540
  label: '办理意见',
531
541
  field: 'doresult',
532
542
  align: 'center',
533
- key:'blyj',
543
+ key: 'blyj',
534
544
  showOverflowTooltip: true,
535
545
  render: (h, params) => {
536
- return h(
537
- 'span',
538
- {},
539
- params.row.doresult || params.row.handleInfo
540
- );
546
+ return h('span', {}, [
547
+ params.row.doresult
548
+ ? params.row.doresult + (params.row.handleInfo ? '&' : '')
549
+ : '',
550
+ h(
551
+ 'span',
552
+ { style: { color: '#A5A5A5', marginLeft: '2px' } },
553
+ params.row.handleInfo || ''
554
+ )
555
+ ]);
541
556
  }
542
557
  },
543
558
  {
544
559
  label: '验签',
545
560
  field: 'authTypeStr',
546
561
  align: 'center',
547
- key:'yq',
562
+ key: 'yq',
548
563
  showOverflowTooltip: true,
549
564
  width: 70,
550
565
  render: (h, params) => {
@@ -559,7 +574,7 @@ export default {
559
574
  label: '附件',
560
575
  field: 'hasAdjunct',
561
576
  align: 'center',
562
- key:'fj',
577
+ key: 'fj',
563
578
  showOverflowTooltip: true,
564
579
  width: 70,
565
580
  render: (h, params) => {
@@ -579,14 +594,16 @@ export default {
579
594
  label: '时间',
580
595
  field: 'doetime',
581
596
  align: 'center',
582
- key:'sj',
597
+ key: 'sj',
583
598
  showOverflowTooltip: true,
584
599
  width: 150,
585
600
  render: (h, params) => {
586
601
  return h(
587
602
  'span',
588
603
  {},
589
- params.row.doetime ? util.formatDate(params.row.doetime, 'yyyy-MM-dd HH:mm') : ''
604
+ params.row.doetime
605
+ ? util.formatDate(params.row.doetime, 'yyyy-MM-dd HH:mm')
606
+ : ''
590
607
  );
591
608
  }
592
609
  },
@@ -594,7 +611,7 @@ export default {
594
611
  label: '代办人',
595
612
  field: 'douserid',
596
613
  align: 'center',
597
- key:'dbr',
614
+ key: 'dbr',
598
615
  showOverflowTooltip: true,
599
616
  width: 80,
600
617
  hide: _that.flowTableInfo.hasAgent != '1'
@@ -603,7 +620,7 @@ export default {
603
620
  label: '催办',
604
621
  field: 'pressTimes',
605
622
  align: 'center',
606
- key:'cb',
623
+ key: 'cb',
607
624
  showOverflowTooltip: true,
608
625
  width: 150,
609
626
  render: (h, params) => {
@@ -988,11 +1005,11 @@ export default {
988
1005
  this.isShort = isShort;
989
1006
  this.taskReadName = taskReadName;
990
1007
  this.flowData = wfHistoryList;
991
- this.flowData.map(x => {
992
- if(!x.deptid){
993
- x.deptid = x.deptName
1008
+ this.flowData.map((x) => {
1009
+ if (!x.deptid) {
1010
+ x.deptid = x.deptName;
994
1011
  }
995
- })
1012
+ });
996
1013
  this.splitReadingData = fyHistoryList;
997
1014
  this.modify = modify;
998
1015
  this.show = true;
@@ -1111,13 +1128,18 @@ export default {
1111
1128
  const {
1112
1129
  status,
1113
1130
  message,
1114
- data: { presetInfoList, presetInfoListHiddenColumns, canDelete,currentUserHasPresetInfoAuth }
1131
+ data: {
1132
+ presetInfoList,
1133
+ presetInfoListHiddenColumns,
1134
+ canDelete,
1135
+ currentUserHasPresetInfoAuth
1136
+ }
1115
1137
  } = res;
1116
1138
  this.loading.close();
1117
1139
  if (status == 'success') {
1118
1140
  presetInfoList && (this.presetData = presetInfoList);
1119
1141
  this.presetInfoListHiddenColumns = presetInfoListHiddenColumns;
1120
- this.currentUserHasPresetInfoAuth = currentUserHasPresetInfoAuth
1142
+ this.currentUserHasPresetInfoAuth = currentUserHasPresetInfoAuth;
1121
1143
  this.canDelete = canDelete;
1122
1144
  } else {
1123
1145
  this.$message.error(message || '系统错误,请联系管理员!');
@@ -264,26 +264,27 @@ export default {
264
264
  );
265
265
  }
266
266
  }
267
+ let { prefix, suffix, prepend, append, ...attrs } = this.$attrs;
267
268
  if (this.$slots.prefix) {
268
269
  doms.push(h('template', { slot: 'prefix' }, this.$slots.prefix));
269
- } else if (this.$attrs.prefix) {
270
+ } else if (prefix) {
270
271
  this.renderd(doms, h, 'prefix');
271
272
  cls.push('es-input-button-prefix');
272
273
  }
273
274
  if (this.$slots.suffix) {
274
275
  doms.push(h('template', { slot: 'suffix' }, this.$slots.suffix));
275
- } else if (this.$attrs.suffix) {
276
+ } else if (suffix) {
276
277
  this.renderd(doms, h, 'suffix');
277
278
  cls.push('es-input-button-suffix');
278
279
  }
279
280
  if (this.$slots.prepend) {
280
281
  doms.push(h('template', { slot: 'prepend' }, this.$slots.prepend));
281
- } else if (this.$attrs.prepend) {
282
+ } else if (prepend) {
282
283
  this.renderd(doms, h, 'prepend');
283
284
  }
284
285
  if (this.$slots.append) {
285
286
  doms.push(h('template', { slot: 'append' }, this.$slots.append));
286
- } else if (this.$attrs.append) {
287
+ } else if (append) {
287
288
  this.renderd(doms, h, 'append');
288
289
  }
289
290
  if (this.fetchSuggestions || this.url || this.data.length > 0) {
@@ -295,7 +296,7 @@ export default {
295
296
  rules: this.rule
296
297
  },
297
298
  attrs: {
298
- ...this.$attrs,
299
+ ...attrs,
299
300
  fetchSuggestions: this.fetchSuggestions
300
301
  ? this.fetchSuggestions
301
302
  : this.getData,
@@ -323,7 +324,7 @@ export default {
323
324
  domProps: {
324
325
  value: this.model
325
326
  },
326
- attrs: { ...this.$attrs },
327
+ attrs: { ...attrs },
327
328
  on: { ...this.$listeners },
328
329
  directives: [
329
330
  {
@@ -12,19 +12,25 @@
12
12
  element-loading-text="登录中..."
13
13
  element-loading-spinner="el-icon-loading"
14
14
  element-loading-background="rgba(0, 0, 0, 0.65)"
15
- :class="{ 'es-simple': mode == 'simple' }"
15
+ :class="{
16
+ 'es-simple': mode == 'simple',
17
+ 'es-adaptive': !isScale
18
+ }"
16
19
  :style="transform"
17
20
  >
18
21
  <img v-if="loginNameImg" class="es-login-name" :src="loginNameImg" />
19
- <div class="es-login-main" :style="getBackground(loginMainImg)">
20
- <div v-if="loginTitleImg" class="es-login-title-image">
21
- <img class="es-login-title-img" :src="loginTitleImg" />
22
- </div>
22
+ <div
23
+ class="es-login-main"
24
+ :style="getBackground(loginMainImg)"
25
+ :class="{
26
+ 'es-switchs': switchs > 2
27
+ }"
28
+ >
23
29
  <div
24
30
  v-if="switchs > 1"
25
31
  :class="{
26
32
  'es-login-switch': switchs == 2,
27
- 'es-login-switchs': switchs > 2
33
+ 'es-login-switchs': switchs > 2 || (switchs == 2 && loginTitleImg)
28
34
  }"
29
35
  >
30
36
  <i
@@ -40,9 +46,16 @@
40
46
  ]"
41
47
  ></i>
42
48
  </div>
49
+ <div v-if="loginTitleImg" class="es-login-title-image">
50
+ <img class="es-login-title-img" :src="loginTitleImg" />
51
+ </div>
43
52
  <div class="es-login-form-box">
44
53
  <template v-if="isShow(active) && (active == 0 || active == 12)">
45
- <el-form ref="login" class="es-login-form" :model="formData">
54
+ <el-form
55
+ :ref="'login' + active"
56
+ class="es-login-form"
57
+ :model="formData"
58
+ >
46
59
  <template v-if="!loginTitleImg">
47
60
  <slot name="login-title" :type="active">
48
61
  <div class="es-login-title">
@@ -128,7 +141,7 @@
128
141
  >{{ btnText }}</el-button
129
142
  >
130
143
  <img
131
- v-show="imgCode && active == 0"
144
+ v-show="imgCode && (active == '0' || active == '12')"
132
145
  class="es-img-code"
133
146
  :src="imageCode"
134
147
  @click.stop="getImgCode"
@@ -189,12 +202,13 @@
189
202
  <es-qr-code
190
203
  :content="identifyingId"
191
204
  :logo="qrimg"
205
+ auto
192
206
  v-if="active == 3 && identifyingId"
193
207
  ></es-qr-code>
194
208
  <div class="es-wx-qrcode-box" v-if="active == 9">
195
209
  <es-wxlogin
196
210
  href="data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7CiAgICB3aWR0aDogMTAwJSAhaW1wb3J0YW50OwogICAgYm94LXNpemluZzogYm9yZGVyLWJveCAhaW1wb3J0YW50OwogICAgbWFyZ2luOiAwICFpbXBvcnRhbnQ7Cn0KCi5pbXBvd2VyQm94IC5pbmZvLAouaW1wb3dlckJveCAudGl0bGUgewogICAgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50Owp9"
197
- height="300px"
211
+ auto
198
212
  :appid="wechatAppid"
199
213
  :scope="wechatScope"
200
214
  :redirect_uri="redirectUri"
@@ -204,7 +218,7 @@
204
218
  </template>
205
219
  <template v-if="isShow(active) && (active == 6 || active == 11)">
206
220
  <el-form
207
- ref="login"
221
+ :ref="'login' + active"
208
222
  class="es-login-form es-login-verify"
209
223
  :model="formData"
210
224
  >
@@ -350,6 +364,7 @@
350
364
  </div>
351
365
  </template>
352
366
  <script>
367
+ import { debounce } from 'throttle-debounce';
353
368
  import resetPassword from './resetPassword.vue';
354
369
  import store from 'eoss-ui/src/utils/store';
355
370
  import util from 'eoss-ui/src/utils/util';
@@ -566,7 +581,8 @@ export default {
566
581
  scanIntervalTime: {
567
582
  type: Number,
568
583
  default: 1500
569
- }
584
+ },
585
+ isScale: Boolean
570
586
  },
571
587
  computed: {
572
588
  transform() {
@@ -768,6 +784,9 @@ export default {
768
784
  };
769
785
  },
770
786
  beforeCreate() {
787
+ this.setScale = debounce(300, () => {
788
+ util.setScale();
789
+ });
771
790
  util.removeStorage([
772
791
  'remind',
773
792
  'ssId',
@@ -780,6 +799,10 @@ export default {
780
799
  ]);
781
800
  },
782
801
  created() {
802
+ if (this.isScale) {
803
+ util.setScale();
804
+ window.addEventListener('resize', this.setScale);
805
+ }
783
806
  this.code = util.getParams('code');
784
807
  if (this.code) {
785
808
  this.doWechatLogin(this.code);
@@ -949,8 +972,6 @@ export default {
949
972
  }
950
973
  },
951
974
  switchLogin(res) {
952
- //this.$refs.login && this.$refs.login.resetFields();
953
- this.$refs.login && this.$refs.login.clearValidate();
954
975
  if (res != 1) {
955
976
  this.active = res.type;
956
977
  this.title = res.name;
@@ -959,6 +980,10 @@ export default {
959
980
  }
960
981
  this.countdown = 0;
961
982
  this.$emit('change-type', res, this.identifyingId);
983
+ this.$nextTick(() => {
984
+ let ref = 'login' + this.active;
985
+ this.$refs[ref] && this.$refs[ref].clearValidate();
986
+ });
962
987
  },
963
988
  isShow(res) {
964
989
  return this.loginModel.indexOf(res) > -1;
@@ -1019,7 +1044,9 @@ export default {
1019
1044
  this.setup = res.setup;
1020
1045
  this.sysName = res.subsystemName;
1021
1046
  this.downloadSetup = res.downloadSetup;
1022
- document.title = res.subsystemName;
1047
+ if (res.subsystemName) {
1048
+ document.title = res.subsystemName;
1049
+ }
1023
1050
  this.app = res.appName || res.subsystemName;
1024
1051
  if (res.qrimg || res.qrImg) {
1025
1052
  this.qrimg = res.qrimg || res.qrImg;
@@ -1558,6 +1585,7 @@ export default {
1558
1585
  }
1559
1586
  },
1560
1587
  beforeDestroy() {
1588
+ window.removeEventListener('resize', this.setScale);
1561
1589
  document.removeEventListener('keyup', this.doLogin);
1562
1590
  document.removeEventListener('keydown', this.forbiddenTab);
1563
1591
  }
@@ -1,25 +1,27 @@
1
1
  <template>
2
2
  <div class="es-qrcode-box" id="qrcode" ref="qrcode">
3
- <img
4
- class="es-qrcode-img"
5
- :width="_width"
6
- :height="_height"
7
- ref="qrcodeImg"
8
- alt="二维码图片"
9
- />
10
- <!-- <img
3
+ <template v-if="mwidth && mheight">
4
+ <img
5
+ class="es-qrcode-img"
6
+ :width="mwidth"
7
+ :height="mheight"
8
+ ref="qrcodeImg"
9
+ alt="二维码图片"
10
+ />
11
+ <!-- <img
11
12
  v-if="logo"
12
13
  class="es-qrcode-logo"
13
14
  ref="qrcodeLogo"
14
15
  :src="logo"
15
16
  alt="二维码logo"
16
17
  /> -->
17
- <canvas
18
- :width="_width"
19
- :height="_height"
20
- class="canvas"
21
- ref="canvas"
22
- ></canvas>
18
+ <canvas
19
+ :width="mwidth"
20
+ :height="mheight"
21
+ class="canvas"
22
+ ref="canvas"
23
+ ></canvas>
24
+ </template>
23
25
  </div>
24
26
  </template>
25
27
 
@@ -35,8 +37,14 @@ export default {
35
37
  },
36
38
  logo: String,
37
39
  text: String,
38
- width: Number,
39
- height: Number,
40
+ width: {
41
+ type: Number,
42
+ default: 300
43
+ },
44
+ height: {
45
+ type: Number,
46
+ default: 300
47
+ },
40
48
  auto: Boolean,
41
49
  option: {
42
50
  type: Object,
@@ -51,22 +59,12 @@ export default {
51
59
  }
52
60
  }
53
61
  },
54
- computed: {
55
- _width() {
56
- if (this.auto) {
57
- return this.$refs.qrcode.offsetWidth;
58
- }
59
- return this.width ? this.width : 300;
60
- },
61
- _height() {
62
- if (this.auto) {
63
- return this.$refs.qrcode.offsetHeight;
64
- }
65
- return this.height ? this.height : 300;
66
- }
67
- },
62
+ computed: {},
68
63
  data() {
69
- return {};
64
+ return {
65
+ mwidth: 0,
66
+ mheight: 0
67
+ };
70
68
  },
71
69
  watch: {
72
70
  logo: function (val) {
@@ -85,6 +83,19 @@ export default {
85
83
  },
86
84
  created() {},
87
85
  mounted() {
86
+ if (this.auto) {
87
+ let h =
88
+ this.$refs.qrcode.offsetHeight -
89
+ parseInt(util.getStyle(this.$refs.qrcode, 'padding-top'), 10) -
90
+ parseInt(util.getStyle(this.$refs.qrcode, 'padding-bottom'), 10);
91
+ if (h > 0) {
92
+ this.mwidth = h;
93
+ this.mheight = h;
94
+ }
95
+ } else {
96
+ this.mwidth = this.width;
97
+ this.mheight = this.height;
98
+ }
88
99
  this.$nextTick(() => {
89
100
  this.createQRCode();
90
101
  });
@@ -95,8 +106,8 @@ export default {
95
106
  //let qrcodeLogo = this.$refs.qrcodeLogo;
96
107
  let canvas = this.$refs.canvas;
97
108
  let option = util.extend({}, this.option, {
98
- width: this._width,
99
- height: this._height
109
+ width: this.mwidth,
110
+ height: this.mheight
100
111
  });
101
112
  if (!qrcodeImg) {
102
113
  return false;
@@ -108,12 +119,12 @@ export default {
108
119
  let ctx = canvas.getContext('2d');
109
120
  setTimeout(() => {
110
121
  //获取图片
111
- ctx.drawImage(qrcodeImg, 0, 0, this._width, this._height);
122
+ ctx.drawImage(qrcodeImg, 0, 0, this.mwidth, this.mheight);
112
123
  if (this.logo && this.logo.indexOf('.') > -1) {
113
124
  let logo = new Image();
114
125
  logo.src = this.logo;
115
126
  //设置logo大小
116
- let logoPosition = (this._width - 46) / 2; //logo相对于canvas居中定位
127
+ let logoPosition = (this.mwidth - 46) / 2; //logo相对于canvas居中定位
117
128
  //设置获取的logo将其变为圆角以及添加白色背景
118
129
  /* ctx.fillStyle = "#fff";
119
130
  ctx.beginPath();
@@ -138,8 +149,8 @@ export default {
138
149
  let fpadd = 10; //规定内间距
139
150
  ctx.font = 'bold 16px Arial';
140
151
  let tw = ctx.measureText(this.text).width; //文字真实宽度
141
- let ftop = (this._height - 16) / 2; //根据字体大小计算文字top
142
- let fleft = (this._width - tw) / 2; //根据字体大小计算文字left
152
+ let ftop = (this.mheight - 16) / 2; //根据字体大小计算文字top
153
+ let fleft = (this.mwidth - tw) / 2; //根据字体大小计算文字left
143
154
  let tp = 16 / 2; //字体边距为字体大小的一半可以自己设置
144
155
  ctx.fillStyle = '#fff';
145
156
  ctx.fillRect(fleft - tp / 2, ftop - tp / 2, tw + tp, 16 + tp);
@@ -673,26 +673,27 @@ export default {
673
673
  });
674
674
  }
675
675
  }
676
+ let { prefix, suffix, prepend, append, ...attrs } = this.$attrs;
676
677
  if (this.$slots.prefix) {
677
678
  doms.push(h('template', { slot: 'prefix' }, this.$slots.prefix));
678
- } else if (this.$attrs.prefix) {
679
+ } else if (prefix) {
679
680
  this.renderd(doms, h, 'prefix');
680
681
  cls.push('es-select-button-prefix');
681
682
  }
682
683
  if (this.$slots.suffix) {
683
684
  doms.push(h('template', { slot: 'suffix' }, this.$slots.suffix));
684
- } else if (this.$attrs.suffix) {
685
+ } else if (suffix) {
685
686
  this.renderd(doms, h, 'suffix');
686
687
  cls.push('es-select-button-suffix');
687
688
  }
688
689
  if (this.$slots.prepend) {
689
690
  doms.push(h('template', { slot: 'prepend' }, this.$slots.prepend));
690
- } else if (this.$attrs.prepend) {
691
+ } else if (prepend) {
691
692
  this.renderd(doms, h, 'prepend');
692
693
  }
693
694
  if (this.$slots.append) {
694
695
  doms.push(h('template', { slot: 'append' }, this.$slots.append));
695
- } else if (this.$attrs.append) {
696
+ } else if (append) {
696
697
  this.renderd(doms, h, 'append');
697
698
  }
698
699
  if (!this.models && this.results.length && this.defaultValue) {
@@ -717,7 +718,7 @@ export default {
717
718
  }
718
719
  ],
719
720
  props: {
720
- ...this.$attrs,
721
+ ...attrs,
721
722
  multiple: this.multiple,
722
723
  valueType: this.valueType,
723
724
  valueKey: this.valKey,