@web-utils/component 2.0.10 → 2.0.11

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 (172) hide show
  1. package/dist/chunks/3d28cc08.js +57 -0
  2. package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
  3. package/dist/chunks/5d33812d.js +147 -0
  4. package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
  5. package/dist/chunks/9d848bf6.js +99 -0
  6. package/dist/chunks/a0bb327b.js +96 -0
  7. package/dist/chunks/a8891d2c.js +30 -0
  8. package/dist/chunks/c69d5628.js +248 -0
  9. package/dist/chunks/de9fe802.js +24 -0
  10. package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
  11. package/dist/components/address-input/index.js +56 -43
  12. package/dist/components/address-input/style.css +15 -1
  13. package/dist/components/aside-menu/index.js +36 -30
  14. package/dist/components/aside-menu/style.css +9 -1
  15. package/dist/components/awesome-button/index.js +35 -32
  16. package/dist/components/base.css +66 -1
  17. package/dist/components/capsule-tab/index.js +33 -27
  18. package/dist/components/capsule-tab/style.css +32 -1
  19. package/dist/components/chunk-file-uploader/index.js +88 -54
  20. package/dist/components/chunk-file-uploader/style.css +4 -1
  21. package/dist/components/chunk-file-uploader-button/index.js +31 -25
  22. package/dist/components/chunk-file-uploader-button/style.css +17 -1
  23. package/dist/components/chunk-file-uploader-drop/index.js +42 -28
  24. package/dist/components/chunk-file-uploader-drop/style.css +12 -1
  25. package/dist/components/chunk-file-uploader-file/index.js +212 -134
  26. package/dist/components/chunk-file-uploader-file/style.css +125 -1
  27. package/dist/components/chunk-file-uploader-files/index.js +34 -28
  28. package/dist/components/chunk-file-uploader-files/style.css +9 -1
  29. package/dist/components/chunk-file-uploader-list/index.js +35 -29
  30. package/dist/components/chunk-file-uploader-list/style.css +9 -1
  31. package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
  32. package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
  33. package/dist/components/code-mirror-editor/index.js +181 -153
  34. package/dist/components/code-mirror-editor/style.css +17 -1
  35. package/dist/components/color-picker/index.js +68 -49
  36. package/dist/components/confirm-button/index.js +21 -19
  37. package/dist/components/confirmable/index.js +19 -18
  38. package/dist/components/context-menu/index.js +130 -108
  39. package/dist/components/context-menu/style.css +88 -1
  40. package/dist/components/custom-scrollbar/index.js +67 -49
  41. package/dist/components/data-table-picker/index.js +81 -62
  42. package/dist/components/dynamic-table/index.js +113 -89
  43. package/dist/components/dynamic-table/style.css +30 -1
  44. package/dist/components/e-charts/index.js +201 -120
  45. package/dist/components/e-charts/style.css +10 -1
  46. package/dist/components/editable-progress/index.js +93 -60
  47. package/dist/components/editable-progress/style.css +37 -1
  48. package/dist/components/editable-tree/index.js +638 -423
  49. package/dist/components/editable-tree/style.css +82 -1
  50. package/dist/components/egd-collapse/index.js +46 -33
  51. package/dist/components/egd-collapse-item/index.js +76 -60
  52. package/dist/components/element-dialog/index.js +147 -95
  53. package/dist/components/element-dialog/style.css +102 -1
  54. package/dist/components/empty-view/index.js +34 -28
  55. package/dist/components/empty-view/style.css +17 -1
  56. package/dist/components/error-view/index.js +32 -26
  57. package/dist/components/error-view/style.css +17 -1
  58. package/dist/components/flex-column/index.js +40 -25
  59. package/dist/components/flex-item/index.js +57 -29
  60. package/dist/components/flex-row/index.js +40 -25
  61. package/dist/components/flex-scroller/index.js +32 -26
  62. package/dist/components/flex-scroller/style.css +20 -1
  63. package/dist/components/form-button/index.js +38 -34
  64. package/dist/components/form-cascader/index.js +81 -71
  65. package/dist/components/form-checkbox-group/index.js +113 -88
  66. package/dist/components/form-checkbox-group/style.css +51 -1
  67. package/dist/components/form-date-picker/index.js +132 -70
  68. package/dist/components/form-holder/index.js +39 -32
  69. package/dist/components/form-input/index.js +62 -56
  70. package/dist/components/form-input-email/index.js +60 -48
  71. package/dist/components/form-input-id-card/index.js +59 -53
  72. package/dist/components/form-input-number/index.js +68 -61
  73. package/dist/components/form-input-number/style.css +12 -1
  74. package/dist/components/form-input-phone-number/index.js +55 -49
  75. package/dist/components/form-input-time/index.js +59 -53
  76. package/dist/components/form-item/index.js +123 -80
  77. package/dist/components/form-item/style.css +11 -1
  78. package/dist/components/form-item-config-provider/index.js +26 -25
  79. package/dist/components/form-item-group/index.js +111 -85
  80. package/dist/components/form-item-group/style.css +30 -1
  81. package/dist/components/form-radio-group/index.js +104 -85
  82. package/dist/components/form-radio-group/style.css +53 -1
  83. package/dist/components/form-select/index.js +91 -76
  84. package/dist/components/form-switch/index.js +57 -51
  85. package/dist/components/form-textarea/index.js +57 -51
  86. package/dist/components/form-view/index.js +232 -165
  87. package/dist/components/form-view/style.css +158 -1
  88. package/dist/components/guide-steps/index.js +58 -44
  89. package/dist/components/guide-steps/style.css +34 -1
  90. package/dist/components/icon-card/index.js +35 -29
  91. package/dist/components/icon-card/style.css +56 -1
  92. package/dist/components/iframe-window/index.js +35 -29
  93. package/dist/components/iframe-window/style.css +20 -1
  94. package/dist/components/image-viewer/index.js +66 -48
  95. package/dist/components/image-viewer/style.css +21 -1
  96. package/dist/components/input-number/index.js +193 -127
  97. package/dist/components/input-number/style.css +15 -1
  98. package/dist/components/input-number-range/index.js +57 -45
  99. package/dist/components/input-number-range/style.css +12 -1
  100. package/dist/components/j-s-x-component/index.js +4 -4
  101. package/dist/components/keep-view-alive/index.js +120 -73
  102. package/dist/components/loading-view/index.js +32 -26
  103. package/dist/components/loading-view/style.css +17 -1
  104. package/dist/components/nav-bar/index.js +37 -27
  105. package/dist/components/nav-bar/style.css +17 -1
  106. package/dist/components/not-implement/index.js +31 -23
  107. package/dist/components/not-implement/style.css +15 -1
  108. package/dist/components/page/index.js +28 -22
  109. package/dist/components/page/style.css +12 -1
  110. package/dist/components/page-header/index.js +36 -30
  111. package/dist/components/page-header/style.css +14 -1
  112. package/dist/components/page-index/index.js +83 -62
  113. package/dist/components/page-index/style.css +23 -1
  114. package/dist/components/page-index-top/index.js +68 -53
  115. package/dist/components/page-skeleton/index.js +37 -31
  116. package/dist/components/page-skeleton/style.css +23 -1
  117. package/dist/components/page-skeleton-new/index.js +48 -42
  118. package/dist/components/page-skeleton-new/style.css +42 -1
  119. package/dist/components/pageable-table/index.js +253 -186
  120. package/dist/components/pageable-table/style.css +72 -1
  121. package/dist/components/pageable-view/index.js +199 -129
  122. package/dist/components/pageable-view/style.css +69 -1
  123. package/dist/components/photo-swipe/index.js +151 -110
  124. package/dist/components/photo-swipe/style.css +20 -1
  125. package/dist/components/resize-observer/index.js +68 -34
  126. package/dist/components/resize-observer/style.css +31 -1
  127. package/dist/components/search-popover/index.js +211 -153
  128. package/dist/components/search-popover/style.css +93 -1
  129. package/dist/components/sign-panel/index.js +142 -92
  130. package/dist/components/sign-panel/style.css +97 -1
  131. package/dist/components/split-pane/index.js +162 -101
  132. package/dist/components/split-pane/style.css +100 -1
  133. package/dist/components/stateful/index.js +34 -31
  134. package/dist/components/stateful/style.css +33 -1
  135. package/dist/components/static-pageable-table/index.js +44 -37
  136. package/dist/components/static-pageable-table/style.css +9 -1
  137. package/dist/components/swiper/index.js +150 -85
  138. package/dist/components/swiper/style.css +43 -1
  139. package/dist/components/tab/index.js +72 -54
  140. package/dist/components/tab/style.css +122 -1
  141. package/dist/components/tab-item/index.js +35 -30
  142. package/dist/components/table-column/index.js +32 -30
  143. package/dist/components/table-view/index.js +227 -156
  144. package/dist/components/table-view/style.css +95 -1
  145. package/dist/components/tag-render/index.js +58 -44
  146. package/dist/components/tag-render/style.css +33 -1
  147. package/dist/components/tinymce-editor/index.js +95 -79
  148. package/dist/components/tinymce-editor/style.css +43 -1
  149. package/dist/components/tinymce-wrapper/index.js +121 -92
  150. package/dist/components/tinymce-wrapper/style.css +36 -1
  151. package/dist/components/toolbar/index.js +84 -63
  152. package/dist/components/toolbar/style.css +39 -1
  153. package/dist/components/toolbar-button/index.js +48 -41
  154. package/dist/components/toolbar-button/style.css +21 -1
  155. package/dist/components/trigger/index.js +36 -29
  156. package/dist/components/vue-tags-input/index.js +308 -188
  157. package/dist/components/vue-tags-input/style.css +682 -1
  158. package/dist/components/watermark/index.js +37 -25
  159. package/dist/components/watermark/style.css +11 -1
  160. package/dist/components/x-dialog/index.js +93 -67
  161. package/dist/components/x-dialog/style.css +15 -1
  162. package/dist/index.css +1105 -193
  163. package/dist/index.es.js +7242 -4789
  164. package/package.json +1 -1
  165. package/web-types.json +1 -1
  166. package/dist/chunks/3a79781b.js +0 -75
  167. package/dist/chunks/5d4282fb.js +0 -30
  168. package/dist/chunks/76680a03.js +0 -24
  169. package/dist/chunks/8c0142e0.js +0 -81
  170. package/dist/chunks/97652d86.js +0 -26
  171. package/dist/chunks/b4acd3a6.js +0 -126
  172. package/dist/chunks/f71045fc.js +0 -184
@@ -1 +1,93 @@
1
- .search-popover{border-radius:4px;z-index:100;position:fixed;overflow:hidden;background-color:#f5f6f7;display:inline-flex;flex-direction:column;border:1px solid #1989fa;width:560px;height:500px;top:0;left:0;transform:translate3d(calc((100vw - 560px)/2),15%,0);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACZJREFUeNpi/PTpEwMY8PLyMsFZnz9/ZoKzgAzG////Q1hAABBgAFeiDto+NxIZAAAAAElFTkSuQmCC);background-repeat:repeat}.search-popover .footer-tips{padding:10px;text-align:left;border-top:1px solid #1989fa}.search-popover .keyboard-key{align-items:center;background:linear-gradient(-225deg,#d5dbe4,#f8f8f8);border-radius:2px;box-shadow:inset 0 -2px #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px #1e235a66;display:inline-flex;height:18px;justify-content:center;margin-right:.4em;padding-bottom:2px;width:20px}.search-popover .search-input{height:46px;border:1px solid #1989fa;appearance:none;border-radius:4px;outline:none;width:100%;box-sizing:border-box;padding:10px}.search-popover .search-li{padding:10px}.search-popover .search-icon{color:#969faf;flex-shrink:0;font-size:24px}.search-popover .search-item{box-shadow:0 1px 3px #d4d9e1;text-decoration:none;box-sizing:border-box;color:#000;padding:10px;display:flex;align-items:center;border-radius:4px;background-color:#fff;overflow-x:hidden}.search-popover .search-item .search-action{display:none}.search-popover .search-item .url{color:#969faf;text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow-x:hidden}.search-popover .search-item.active{color:#fff;background-color:#1989fa}.search-popover .search-item.active .url{color:#fff}.search-popover .search-item.active .search-action{display:inline-block}.search-popover .search-item.active .search-icon{color:#fff}
1
+ /* 全局公共颜色配置 */ /* 全局公共尺寸配置 */
2
+ /* 应用头部高度 */
3
+ /* 页面宽度 */
4
+ /* 侧栏宽度 */
5
+ /* 标签高度 */
6
+ /* 页面头部工具条高度 */
7
+ .search-popover {
8
+ border-radius: 4px;
9
+ z-index: 100;
10
+ position: fixed;
11
+ overflow: hidden;
12
+ background-color: #f5f6f7;
13
+ display: inline-flex;
14
+ flex-direction: column;
15
+ border: 1px solid #1989fa;
16
+ width: 560px;
17
+ height: 500px;
18
+ top: 0;
19
+ left: 0;
20
+ transform: translate3d(calc((100vw - 560px) / 2), 15%, 0);
21
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACZJREFUeNpi/PTpEwMY8PLyMsFZnz9/ZoKzgAzG////Q1hAABBgAFeiDto+NxIZAAAAAElFTkSuQmCC");
22
+ background-repeat: repeat;
23
+ }
24
+ .search-popover .footer-tips {
25
+ padding: 10px;
26
+ text-align: left;
27
+ border-top: 1px solid #1989fa;
28
+ }
29
+ .search-popover .keyboard-key {
30
+ align-items: center;
31
+ background: linear-gradient(-225deg, #d5dbe4, #f8f8f8);
32
+ border-radius: 2px;
33
+ box-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
34
+ display: inline-flex;
35
+ height: 18px;
36
+ justify-content: center;
37
+ margin-right: 0.4em;
38
+ padding-bottom: 2px;
39
+ width: 20px;
40
+ }
41
+ .search-popover .search-input {
42
+ height: 46px;
43
+ border: 1px solid #1989fa;
44
+ appearance: none;
45
+ border-radius: 4px;
46
+ outline: none;
47
+ width: 100%;
48
+ box-sizing: border-box;
49
+ padding: 10px;
50
+ }
51
+ .search-popover .search-li {
52
+ padding: 10px;
53
+ }
54
+ .search-popover .search-icon {
55
+ color: #969faf;
56
+ flex-shrink: 0;
57
+ font-size: 24px;
58
+ }
59
+ .search-popover .search-item {
60
+ box-shadow: 0 1px 3px 0 #d4d9e1;
61
+ text-decoration: none;
62
+ box-sizing: border-box;
63
+ color: #000;
64
+ padding: 10px;
65
+ display: flex;
66
+ align-items: center;
67
+ border-radius: 4px;
68
+ background-color: #fff;
69
+ overflow-x: hidden;
70
+ }
71
+ .search-popover .search-item .search-action {
72
+ display: none;
73
+ }
74
+ .search-popover .search-item .url {
75
+ color: #969faf;
76
+ text-overflow: ellipsis;
77
+ white-space: nowrap;
78
+ font-size: 14px;
79
+ overflow-x: hidden;
80
+ }
81
+ .search-popover .search-item.active {
82
+ color: #fff;
83
+ background-color: #1989fa;
84
+ }
85
+ .search-popover .search-item.active .url {
86
+ color: #fff;
87
+ }
88
+ .search-popover .search-item.active .search-action {
89
+ display: inline-block;
90
+ }
91
+ .search-popover .search-item.active .search-icon {
92
+ color: #fff;
93
+ }
@@ -1,123 +1,132 @@
1
- import { n } from "../../chunks/5d4282fb.js";
2
- var o = function() {
3
- var t = this, e = t.$createElement, i = t._self._c || e;
4
- return i("div", {
1
+ import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
2
+ var render = function() {
3
+ var _vm = this;
4
+ var _h = _vm.$createElement;
5
+ var _c = _vm._self._c || _h;
6
+ return _c("div", {
5
7
  staticClass: "sign-panel flex-column"
6
- }, [i("div", {
8
+ }, [_c("div", {
7
9
  directives: [{
8
10
  name: "show",
9
11
  rawName: "v-show",
10
- value: !t.disabled && t.edit,
12
+ value: !_vm.disabled && _vm.edit,
11
13
  expression: "!disabled && edit"
12
14
  }],
13
15
  staticClass: "sign-edit"
14
- }, [i("div", {
16
+ }, [_c("div", {
15
17
  staticClass: "sign-draw-area",
16
18
  style: {
17
- width: `${t.width + 2}px`,
18
- height: `${t.height + 2}px`
19
+ width: `${_vm.width + 2}px`,
20
+ height: `${_vm.height + 2}px`
19
21
  }
20
- }, [i("div", {
22
+ }, [_c("div", {
21
23
  staticClass: "sign-watermark",
22
24
  style: {
23
- fontSize: `${t.fontSize}px`
25
+ fontSize: `${_vm.fontSize}px`
24
26
  }
25
- }, [t._v(" " + t._s(t.text) + " ")]), i("canvas", {
27
+ }, [_vm._v(" " + _vm._s(_vm.text) + " ")]), _c("canvas", {
26
28
  ref: "canvas",
27
29
  staticClass: "sign-canvas",
28
30
  attrs: {
29
- width: t.width,
30
- height: t.height
31
+ "width": _vm.width,
32
+ "height": _vm.height
31
33
  },
32
34
  on: {
33
- touchstart: function(s) {
34
- return s.stopPropagation(), t.touchstart.apply(null, arguments);
35
+ "touchstart": function($event) {
36
+ $event.stopPropagation();
37
+ return _vm.touchstart.apply(null, arguments);
35
38
  },
36
- touchmove: function(s) {
37
- return s.stopPropagation(), t.touchmove.apply(null, arguments);
39
+ "touchmove": function($event) {
40
+ $event.stopPropagation();
41
+ return _vm.touchmove.apply(null, arguments);
38
42
  },
39
- mousedown: function(s) {
40
- return s.stopPropagation(), t.down.apply(null, arguments);
43
+ "mousedown": function($event) {
44
+ $event.stopPropagation();
45
+ return _vm.down.apply(null, arguments);
41
46
  },
42
- touchend: function(s) {
43
- return s.stopPropagation(), t.touchend.apply(null, arguments);
47
+ "touchend": function($event) {
48
+ $event.stopPropagation();
49
+ return _vm.touchend.apply(null, arguments);
44
50
  },
45
- mouseup: function(s) {
46
- return s.stopPropagation(), t.up.apply(null, arguments);
51
+ "mouseup": function($event) {
52
+ $event.stopPropagation();
53
+ return _vm.up.apply(null, arguments);
47
54
  }
48
55
  }
49
- }, [t._v("当前浏览器不支持手写签名 ")])]), i("div", {
56
+ }, [_vm._v("当前浏览器不支持手写签名 ")])]), _c("div", {
50
57
  staticClass: "sign-tool-bar"
51
- }, [i("div", {
58
+ }, [_c("div", {
52
59
  staticClass: "sign-button flex-item",
53
60
  staticStyle: {
54
- color: "red"
61
+ "color": "red"
55
62
  },
56
63
  on: {
57
- click: t.clear
64
+ "click": _vm.clear
58
65
  }
59
- }, [i("i", {
66
+ }, [_c("i", {
60
67
  staticClass: "fa fa-trash"
61
- }), t._v(" 清除 ")]), i("div", {
68
+ }), _vm._v(" 清除 ")]), _c("div", {
62
69
  staticClass: "sign-button flex-item",
63
70
  staticStyle: {
64
- color: "red"
71
+ "color": "red"
65
72
  },
66
73
  on: {
67
- click: t.cancel
74
+ "click": _vm.cancel
68
75
  }
69
- }, [i("i", {
76
+ }, [_c("i", {
70
77
  staticClass: "fa fa-close"
71
- }), t._v(" 取消 ")]), i("div", {
78
+ }), _vm._v(" 取消 ")]), _c("div", {
72
79
  staticClass: "sign-button flex-item",
73
80
  staticStyle: {
74
- color: "orange"
81
+ "color": "orange"
75
82
  },
76
83
  on: {
77
- click: t.rollback
84
+ "click": _vm.rollback
78
85
  }
79
- }, [i("i", {
86
+ }, [_c("i", {
80
87
  staticClass: "fa fa-repeat"
81
- }), t._v(" 撤销 ")]), i("div", {
88
+ }), _vm._v(" 撤销 ")]), _c("div", {
82
89
  staticClass: "sign-button flex-item",
83
90
  staticStyle: {
84
- color: "green"
91
+ "color": "green"
85
92
  },
86
93
  on: {
87
- click: t.save
94
+ "click": _vm.save
88
95
  }
89
- }, [i("i", {
96
+ }, [_c("i", {
90
97
  staticClass: "fa fa-check"
91
- }), t._v(" 确定 ")])])]), i("div", {
98
+ }), _vm._v(" 确定 ")])])]), _c("div", {
92
99
  directives: [{
93
100
  name: "show",
94
101
  rawName: "v-show",
95
- value: t.disabled || !t.edit,
102
+ value: _vm.disabled || !_vm.edit,
96
103
  expression: "disabled || !edit"
97
104
  }],
98
105
  staticClass: "sign-view",
99
106
  style: {
100
- cursor: t.disabled ? "not-allowed" : "pointer"
107
+ cursor: _vm.disabled ? "not-allowed" : "pointer"
101
108
  },
102
109
  on: {
103
- click: t.showSign
110
+ "click": _vm.showSign
104
111
  }
105
- }, [t.value ? i("img", {
112
+ }, [_vm.value ? _c("img", {
106
113
  staticClass: "sign-image",
107
114
  attrs: {
108
- src: t.value,
109
- alt: "签名"
115
+ "src": _vm.value,
116
+ "alt": "签名"
110
117
  }
111
- }) : t._e(), t.value ? t._e() : i("p", {
118
+ }) : _vm._e(), !_vm.value ? _c("p", {
112
119
  staticClass: "sign-tips",
113
120
  style: {
114
- color: !t.value && t.disabled ? "red" : ""
121
+ color: !_vm.value && _vm.disabled ? "red" : ""
115
122
  }
116
- }, [t._v(" " + t._s(t.disabled ? "未签名" : "点击进行签名") + " ")]), t.disabled ? t._e() : i("i", {
123
+ }, [_vm._v(" " + _vm._s(_vm.disabled ? "未签名" : "点击进行签名") + " ")]) : _vm._e(), !_vm.disabled ? _c("i", {
117
124
  staticClass: "el-icon-edit-outline sign-edit-icon"
118
- })])]);
119
- }, l = [];
120
- const c = {
125
+ }) : _vm._e()])]);
126
+ };
127
+ var staticRenderFns = [];
128
+ const SignPanel_vue_vue_type_style_index_0_lang = "";
129
+ const __vue2_script = {
121
130
  name: "SignPanel",
122
131
  props: {
123
132
  width: {
@@ -147,7 +156,7 @@ const c = {
147
156
  },
148
157
  data() {
149
158
  return {
150
- edit: !1
159
+ edit: false
151
160
  };
152
161
  },
153
162
  mounted() {
@@ -155,7 +164,9 @@ const c = {
155
164
  },
156
165
  methods: {
157
166
  init() {
158
- if (this.stack = [], this.canvas = this.$refs.canvas, !this.canvas.getContext) {
167
+ this.stack = [];
168
+ this.canvas = this.$refs.canvas;
169
+ if (!this.canvas.getContext) {
159
170
  alert("当前浏览器不支持手写签名");
160
171
  return;
161
172
  }
@@ -163,47 +174,75 @@ const c = {
163
174
  },
164
175
  rollback() {
165
176
  if (this.stack.length > 0) {
166
- const t = this.stack[this.stack.length - 1];
167
- this.ctx.putImageData(t, 0, 0), this.stack.length = this.stack.length - 1;
177
+ const restorePoint = this.stack[this.stack.length - 1];
178
+ this.ctx.putImageData(restorePoint, 0, 0);
179
+ this.stack.length = this.stack.length - 1;
168
180
  }
169
181
  },
170
182
  position() {
171
183
  this.restorePoint = this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
172
- const t = this.canvas.getBoundingClientRect();
173
- this.start = t.left, this.end = t.top;
184
+ const rect = this.canvas.getBoundingClientRect();
185
+ this.start = rect.left;
186
+ this.end = rect.top;
174
187
  },
175
188
  canvasInit() {
176
- this.ctx = this.canvas.getContext("2d"), this.ctx.lineCap = "round", this.ctx.lineWidth = this.lineWidth, this.ctx.clearRect(0, 0, this.width, this.height), this.blank = this.canvas.toDataURL("image/png");
189
+ this.ctx = this.canvas.getContext("2d");
190
+ this.ctx.lineCap = "round";
191
+ this.ctx.lineWidth = this.lineWidth;
192
+ this.ctx.clearRect(0, 0, this.width, this.height);
193
+ this.blank = this.canvas.toDataURL("image/png");
177
194
  },
178
195
  drawWaterMark() {
179
- this.ctx.font = `${this.fontSize}px bold 黑体`, this.ctx.fillStyle = "#eee", this.ctx.textAlign = "center", this.ctx.shadowBlur = 1, this.ctx.textBaseline = "middle", this.ctx.fillText(this.text, this.width / 2, this.height / 2);
196
+ this.ctx.font = `${this.fontSize}px bold 黑体`;
197
+ this.ctx.fillStyle = "#eee";
198
+ this.ctx.textAlign = "center";
199
+ this.ctx.shadowBlur = 1;
200
+ this.ctx.textBaseline = "middle";
201
+ this.ctx.fillText(this.text, this.width / 2, this.height / 2);
180
202
  },
181
- down(t) {
182
- this.position(), this.startLine(t.clientX, t.clientY, t), this.target = t.target, this.target.addEventListener("mousemove", this.move), window.addEventListener("mouseup", this.up);
203
+ down(e) {
204
+ this.position();
205
+ this.startLine(e.clientX, e.clientY, e);
206
+ this.target = e.target;
207
+ this.target.addEventListener("mousemove", this.move);
208
+ window.addEventListener("mouseup", this.up);
183
209
  },
184
- move(t) {
185
- this.moveLine(t.clientX, t.clientY, t);
210
+ move(e) {
211
+ this.moveLine(e.clientX, e.clientY, e);
186
212
  },
187
213
  up() {
188
- this.target && this.target.removeEventListener("mousemove", this.move), window.removeEventListener("mouseup", this.up), this.record();
214
+ if (this.target) {
215
+ this.target.removeEventListener("mousemove", this.move);
216
+ }
217
+ window.removeEventListener("mouseup", this.up);
218
+ this.record();
189
219
  },
190
- touchstart(t) {
191
- this.position(), this.startLine(t.changedTouches[0].clientX, t.changedTouches[0].clientY, t);
220
+ touchstart(e) {
221
+ this.position();
222
+ this.startLine(e.changedTouches[0].clientX, e.changedTouches[0].clientY, e);
192
223
  },
193
- touchmove(t) {
194
- this.moveLine(t.touches[0].clientX, t.touches[0].clientY, t);
224
+ touchmove(e) {
225
+ this.moveLine(e.touches[0].clientX, e.touches[0].clientY, e);
195
226
  },
196
- startLine(t, e) {
197
- this.ctx.beginPath(), t -= this.start, e -= this.end, this.ctx.moveTo(t, e);
227
+ startLine(x, y) {
228
+ this.ctx.beginPath();
229
+ x -= this.start;
230
+ y -= this.end;
231
+ this.ctx.moveTo(x, y);
198
232
  },
199
- moveLine(t, e, i) {
200
- i && i.preventDefault(), t -= this.start, e -= this.end, this.ctx.lineTo(t, e), this.ctx.stroke();
233
+ moveLine(x, y, event) {
234
+ event && event.preventDefault();
235
+ x -= this.start;
236
+ y -= this.end;
237
+ this.ctx.lineTo(x, y);
238
+ this.ctx.stroke();
201
239
  },
202
240
  clear() {
203
241
  this.ctx.clearRect(0, 0, this.width, this.height);
204
242
  },
205
243
  cancel() {
206
- this.clear(), this.edit = !1;
244
+ this.clear();
245
+ this.edit = false;
207
246
  },
208
247
  touchend() {
209
248
  this.record();
@@ -212,31 +251,42 @@ const c = {
212
251
  this.stack.push(this.restorePoint);
213
252
  },
214
253
  save() {
215
- const t = this.canvas.toDataURL("image/png");
216
- this.blank === t ? this.$emit("input", "") : this.$emit("input", t), this.edit = !1, this.stack.length = 0, this.ctx.clearRect(0, 0, this.width, this.height);
254
+ const dataURL = this.canvas.toDataURL("image/png");
255
+ if (this.blank === dataURL) {
256
+ this.$emit("input", "");
257
+ } else {
258
+ this.$emit("input", dataURL);
259
+ }
260
+ this.edit = false;
261
+ this.stack.length = 0;
262
+ this.ctx.clearRect(0, 0, this.width, this.height);
217
263
  },
218
264
  showSign() {
219
- this.disabled || (this.edit = !0);
265
+ if (!this.disabled) {
266
+ this.edit = true;
267
+ }
220
268
  }
221
269
  }
222
- }, a = {};
223
- var h = /* @__PURE__ */ n(
224
- c,
225
- o,
226
- l,
227
- !1,
228
- r,
270
+ };
271
+ const __cssModules = {};
272
+ var __component__ = /* @__PURE__ */ normalizeComponent(
273
+ __vue2_script,
274
+ render,
275
+ staticRenderFns,
276
+ false,
277
+ __vue2_injectStyles,
229
278
  null,
230
279
  null,
231
280
  null
232
281
  );
233
- function r(t) {
234
- for (let e in a)
235
- this[e] = a[e];
282
+ function __vue2_injectStyles(context) {
283
+ for (let o in __cssModules) {
284
+ this[o] = __cssModules[o];
285
+ }
236
286
  }
237
- const u = /* @__PURE__ */ function() {
238
- return h.exports;
287
+ const SignPanel = /* @__PURE__ */ function() {
288
+ return __component__.exports;
239
289
  }();
240
290
  export {
241
- u as default
291
+ SignPanel as default
242
292
  };
@@ -1 +1,97 @@
1
- .sign-panel{align-items:flex-start;justify-content:center;width:100%;background:#fff;user-select:none}.sign-panel .sign-canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;max-width:100%;height:100%;background:rgba(255,255,155,0);border:1px solid #ccc}.sign-panel .sign-tool-bar{display:flex;width:100%;border:1px solid #ccc;border-top:none}.sign-panel .sign-tips{user-select:none;pointer-events:none}.sign-panel .sign-button{padding:6px;line-height:1.6;text-align:center;background-color:#ebeef5;cursor:pointer;user-select:none}.sign-panel .sign-button:hover{color:#1989fa;background-color:#d0d4de}.sign-panel .sign-button:nth-child(n){border-right:1px solid #ccc}.sign-panel .sign-button:last-child{border:none!important}.sign-panel .sign-watermark{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:#eee}.sign-panel .sign-view{position:relative;display:flex;align-items:center;justify-content:center;min-width:212px;height:80px;background-color:#fff;border:1px solid #eee}.sign-panel .sign-edit-icon{position:absolute;right:4px;bottom:4px}.sign-panel .sign-image{display:inline-block;min-width:160px;height:80px}.sign-panel .sign-edit{display:flex;flex-direction:column;align-items:center;max-width:100%;background-color:#fff}.sign-panel .sign-draw-area{position:relative;max-width:100%}
1
+ /* 全局公共颜色配置 */ /* 全局公共尺寸配置 */
2
+ /* 应用头部高度 */
3
+ /* 页面宽度 */
4
+ /* 侧栏宽度 */
5
+ /* 标签高度 */
6
+ /* 页面头部工具条高度 */
7
+ .sign-panel {
8
+ align-items: flex-start;
9
+ justify-content: center;
10
+ width: 100%;
11
+ background: #fff;
12
+ user-select: none;
13
+ }
14
+ .sign-panel .sign-canvas {
15
+ position: absolute;
16
+ top: 0;
17
+ right: 0;
18
+ bottom: 0;
19
+ left: 0;
20
+ width: 100%;
21
+ max-width: 100%;
22
+ height: 100%;
23
+ background: rgba(255, 255, 155, 0);
24
+ border: 1px solid #ccc;
25
+ }
26
+ .sign-panel .sign-tool-bar {
27
+ display: flex;
28
+ width: 100%;
29
+ border: 1px solid #ccc;
30
+ border-top: none;
31
+ }
32
+ .sign-panel .sign-tips {
33
+ user-select: none;
34
+ pointer-events: none;
35
+ }
36
+ .sign-panel .sign-button {
37
+ padding: 6px;
38
+ line-height: 1.6;
39
+ text-align: center;
40
+ background-color: #ebeef5;
41
+ cursor: pointer;
42
+ user-select: none;
43
+ }
44
+ .sign-panel .sign-button:hover {
45
+ color: #1989fa;
46
+ background-color: #d0d4de;
47
+ }
48
+ .sign-panel .sign-button:nth-child(n) {
49
+ border-right: 1px solid #ccc;
50
+ }
51
+ .sign-panel .sign-button:last-child {
52
+ border: none !important;
53
+ }
54
+ .sign-panel .sign-watermark {
55
+ position: absolute;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ left: 0;
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ width: 100%;
64
+ height: 100%;
65
+ color: #eee;
66
+ }
67
+ .sign-panel .sign-view {
68
+ position: relative;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ min-width: 212px;
73
+ height: 80px;
74
+ background-color: #fff;
75
+ border: 1px solid #eee;
76
+ }
77
+ .sign-panel .sign-edit-icon {
78
+ position: absolute;
79
+ right: 4px;
80
+ bottom: 4px;
81
+ }
82
+ .sign-panel .sign-image {
83
+ display: inline-block;
84
+ min-width: 160px;
85
+ height: 80px;
86
+ }
87
+ .sign-panel .sign-edit {
88
+ display: flex;
89
+ flex-direction: column;
90
+ align-items: center;
91
+ max-width: 100%;
92
+ background-color: #fff;
93
+ }
94
+ .sign-panel .sign-draw-area {
95
+ position: relative;
96
+ max-width: 100%;
97
+ }