@web-utils/component 2.0.12 → 2.0.14

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