@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.
- package/dist/chunks/3d28cc08.js +57 -0
- package/dist/chunks/{41a066be.js → 44b78389.js} +8 -8
- package/dist/chunks/5d33812d.js +147 -0
- package/dist/chunks/{61ad06b2.js → 822300f3.js} +3 -3
- package/dist/chunks/9d848bf6.js +99 -0
- package/dist/chunks/a0bb327b.js +96 -0
- package/dist/chunks/a8891d2c.js +30 -0
- package/dist/chunks/c69d5628.js +248 -0
- package/dist/chunks/de9fe802.js +24 -0
- package/dist/chunks/{5a78e0db.js → e1939731.js} +6 -5
- package/dist/components/address-input/index.js +56 -43
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/aside-menu/index.js +36 -30
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/awesome-button/index.js +35 -32
- package/dist/components/base.css +66 -1
- package/dist/components/capsule-tab/index.js +33 -27
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/chunk-file-uploader/index.js +88 -54
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +31 -25
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +42 -28
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +212 -134
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +34 -28
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +35 -29
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +38 -30
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +181 -153
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +68 -49
- package/dist/components/confirm-button/index.js +21 -19
- package/dist/components/confirmable/index.js +19 -18
- package/dist/components/context-menu/index.js +130 -108
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/custom-scrollbar/index.js +67 -49
- package/dist/components/data-table-picker/index.js +81 -62
- package/dist/components/dynamic-table/index.js +113 -89
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +201 -120
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/editable-progress/index.js +93 -60
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +638 -423
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +46 -33
- package/dist/components/egd-collapse-item/index.js +76 -60
- package/dist/components/element-dialog/index.js +147 -95
- package/dist/components/element-dialog/style.css +102 -1
- package/dist/components/empty-view/index.js +34 -28
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +32 -26
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +40 -25
- package/dist/components/flex-item/index.js +57 -29
- package/dist/components/flex-row/index.js +40 -25
- package/dist/components/flex-scroller/index.js +32 -26
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/form-button/index.js +38 -34
- package/dist/components/form-cascader/index.js +81 -71
- package/dist/components/form-checkbox-group/index.js +113 -88
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +132 -70
- package/dist/components/form-holder/index.js +39 -32
- package/dist/components/form-input/index.js +62 -56
- package/dist/components/form-input-email/index.js +60 -48
- package/dist/components/form-input-id-card/index.js +59 -53
- package/dist/components/form-input-number/index.js +68 -61
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +55 -49
- package/dist/components/form-input-time/index.js +59 -53
- package/dist/components/form-item/index.js +123 -80
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +26 -25
- package/dist/components/form-item-group/index.js +111 -85
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +104 -85
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +91 -76
- package/dist/components/form-switch/index.js +57 -51
- package/dist/components/form-textarea/index.js +57 -51
- package/dist/components/form-view/index.js +232 -165
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/guide-steps/index.js +58 -44
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/icon-card/index.js +35 -29
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/iframe-window/index.js +35 -29
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-viewer/index.js +66 -48
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +193 -127
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +57 -45
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +120 -73
- package/dist/components/loading-view/index.js +32 -26
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/nav-bar/index.js +37 -27
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +31 -23
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/page/index.js +28 -22
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +36 -30
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +83 -62
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +68 -53
- package/dist/components/page-skeleton/index.js +37 -31
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +48 -42
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +253 -186
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +199 -129
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +151 -110
- package/dist/components/photo-swipe/style.css +20 -1
- package/dist/components/resize-observer/index.js +68 -34
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search-popover/index.js +211 -153
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign-panel/index.js +142 -92
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/split-pane/index.js +162 -101
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +34 -31
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +44 -37
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +150 -85
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +72 -54
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +35 -30
- package/dist/components/table-column/index.js +32 -30
- package/dist/components/table-view/index.js +227 -156
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +58 -44
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/tinymce-editor/index.js +95 -79
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +121 -92
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +84 -63
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +48 -41
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +36 -29
- package/dist/components/vue-tags-input/index.js +308 -188
- package/dist/components/vue-tags-input/style.css +682 -1
- package/dist/components/watermark/index.js +37 -25
- package/dist/components/watermark/style.css +11 -1
- package/dist/components/x-dialog/index.js +93 -67
- package/dist/components/x-dialog/style.css +15 -1
- package/dist/index.css +1105 -193
- package/dist/index.es.js +7242 -4789
- package/package.json +1 -1
- package/web-types.json +1 -1
- package/dist/chunks/3a79781b.js +0 -75
- package/dist/chunks/5d4282fb.js +0 -30
- package/dist/chunks/76680a03.js +0 -24
- package/dist/chunks/8c0142e0.js +0 -81
- package/dist/chunks/97652d86.js +0 -26
- package/dist/chunks/b4acd3a6.js +0 -126
- package/dist/chunks/f71045fc.js +0 -184
|
@@ -1 +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,123 +1,132 @@
|
|
|
1
|
-
import { n } from "../../chunks/
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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
|
-
}, [
|
|
8
|
+
}, [_c("div", {
|
|
7
9
|
directives: [{
|
|
8
10
|
name: "show",
|
|
9
11
|
rawName: "v-show",
|
|
10
|
-
value: !
|
|
12
|
+
value: !_vm.disabled && _vm.edit,
|
|
11
13
|
expression: "!disabled && edit"
|
|
12
14
|
}],
|
|
13
15
|
staticClass: "sign-edit"
|
|
14
|
-
}, [
|
|
16
|
+
}, [_c("div", {
|
|
15
17
|
staticClass: "sign-draw-area",
|
|
16
18
|
style: {
|
|
17
|
-
width: `${
|
|
18
|
-
height: `${
|
|
19
|
+
width: `${_vm.width + 2}px`,
|
|
20
|
+
height: `${_vm.height + 2}px`
|
|
19
21
|
}
|
|
20
|
-
}, [
|
|
22
|
+
}, [_c("div", {
|
|
21
23
|
staticClass: "sign-watermark",
|
|
22
24
|
style: {
|
|
23
|
-
fontSize: `${
|
|
25
|
+
fontSize: `${_vm.fontSize}px`
|
|
24
26
|
}
|
|
25
|
-
}, [
|
|
27
|
+
}, [_vm._v(" " + _vm._s(_vm.text) + " ")]), _c("canvas", {
|
|
26
28
|
ref: "canvas",
|
|
27
29
|
staticClass: "sign-canvas",
|
|
28
30
|
attrs: {
|
|
29
|
-
width:
|
|
30
|
-
height:
|
|
31
|
+
"width": _vm.width,
|
|
32
|
+
"height": _vm.height
|
|
31
33
|
},
|
|
32
34
|
on: {
|
|
33
|
-
touchstart: function(
|
|
34
|
-
|
|
35
|
+
"touchstart": function($event) {
|
|
36
|
+
$event.stopPropagation();
|
|
37
|
+
return _vm.touchstart.apply(null, arguments);
|
|
35
38
|
},
|
|
36
|
-
touchmove: function(
|
|
37
|
-
|
|
39
|
+
"touchmove": function($event) {
|
|
40
|
+
$event.stopPropagation();
|
|
41
|
+
return _vm.touchmove.apply(null, arguments);
|
|
38
42
|
},
|
|
39
|
-
mousedown: function(
|
|
40
|
-
|
|
43
|
+
"mousedown": function($event) {
|
|
44
|
+
$event.stopPropagation();
|
|
45
|
+
return _vm.down.apply(null, arguments);
|
|
41
46
|
},
|
|
42
|
-
touchend: function(
|
|
43
|
-
|
|
47
|
+
"touchend": function($event) {
|
|
48
|
+
$event.stopPropagation();
|
|
49
|
+
return _vm.touchend.apply(null, arguments);
|
|
44
50
|
},
|
|
45
|
-
mouseup: function(
|
|
46
|
-
|
|
51
|
+
"mouseup": function($event) {
|
|
52
|
+
$event.stopPropagation();
|
|
53
|
+
return _vm.up.apply(null, arguments);
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
}, [
|
|
56
|
+
}, [_vm._v("当前浏览器不支持手写签名 ")])]), _c("div", {
|
|
50
57
|
staticClass: "sign-tool-bar"
|
|
51
|
-
}, [
|
|
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:
|
|
64
|
+
"click": _vm.clear
|
|
58
65
|
}
|
|
59
|
-
}, [
|
|
66
|
+
}, [_c("i", {
|
|
60
67
|
staticClass: "fa fa-trash"
|
|
61
|
-
}),
|
|
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:
|
|
74
|
+
"click": _vm.cancel
|
|
68
75
|
}
|
|
69
|
-
}, [
|
|
76
|
+
}, [_c("i", {
|
|
70
77
|
staticClass: "fa fa-close"
|
|
71
|
-
}),
|
|
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:
|
|
84
|
+
"click": _vm.rollback
|
|
78
85
|
}
|
|
79
|
-
}, [
|
|
86
|
+
}, [_c("i", {
|
|
80
87
|
staticClass: "fa fa-repeat"
|
|
81
|
-
}),
|
|
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:
|
|
94
|
+
"click": _vm.save
|
|
88
95
|
}
|
|
89
|
-
}, [
|
|
96
|
+
}, [_c("i", {
|
|
90
97
|
staticClass: "fa fa-check"
|
|
91
|
-
}),
|
|
98
|
+
}), _vm._v(" 确定 ")])])]), _c("div", {
|
|
92
99
|
directives: [{
|
|
93
100
|
name: "show",
|
|
94
101
|
rawName: "v-show",
|
|
95
|
-
value:
|
|
102
|
+
value: _vm.disabled || !_vm.edit,
|
|
96
103
|
expression: "disabled || !edit"
|
|
97
104
|
}],
|
|
98
105
|
staticClass: "sign-view",
|
|
99
106
|
style: {
|
|
100
|
-
cursor:
|
|
107
|
+
cursor: _vm.disabled ? "not-allowed" : "pointer"
|
|
101
108
|
},
|
|
102
109
|
on: {
|
|
103
|
-
click:
|
|
110
|
+
"click": _vm.showSign
|
|
104
111
|
}
|
|
105
|
-
}, [
|
|
112
|
+
}, [_vm.value ? _c("img", {
|
|
106
113
|
staticClass: "sign-image",
|
|
107
114
|
attrs: {
|
|
108
|
-
src:
|
|
109
|
-
alt: "签名"
|
|
115
|
+
"src": _vm.value,
|
|
116
|
+
"alt": "签名"
|
|
110
117
|
}
|
|
111
|
-
}) :
|
|
118
|
+
}) : _vm._e(), !_vm.value ? _c("p", {
|
|
112
119
|
staticClass: "sign-tips",
|
|
113
120
|
style: {
|
|
114
|
-
color: !
|
|
121
|
+
color: !_vm.value && _vm.disabled ? "red" : ""
|
|
115
122
|
}
|
|
116
|
-
}, [
|
|
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
|
-
}
|
|
120
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
|
167
|
-
this.ctx.putImageData(
|
|
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
|
|
173
|
-
this.start =
|
|
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")
|
|
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
|
|
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(
|
|
182
|
-
this.position()
|
|
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(
|
|
185
|
-
this.moveLine(
|
|
210
|
+
move(e) {
|
|
211
|
+
this.moveLine(e.clientX, e.clientY, e);
|
|
186
212
|
},
|
|
187
213
|
up() {
|
|
188
|
-
|
|
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(
|
|
191
|
-
this.position()
|
|
220
|
+
touchstart(e) {
|
|
221
|
+
this.position();
|
|
222
|
+
this.startLine(e.changedTouches[0].clientX, e.changedTouches[0].clientY, e);
|
|
192
223
|
},
|
|
193
|
-
touchmove(
|
|
194
|
-
this.moveLine(
|
|
224
|
+
touchmove(e) {
|
|
225
|
+
this.moveLine(e.touches[0].clientX, e.touches[0].clientY, e);
|
|
195
226
|
},
|
|
196
|
-
startLine(
|
|
197
|
-
this.ctx.beginPath()
|
|
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(
|
|
200
|
-
|
|
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()
|
|
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
|
|
216
|
-
this.blank ===
|
|
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
|
-
|
|
265
|
+
if (!this.disabled) {
|
|
266
|
+
this.edit = true;
|
|
267
|
+
}
|
|
220
268
|
}
|
|
221
269
|
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
|
234
|
-
for (let
|
|
235
|
-
this[
|
|
282
|
+
function __vue2_injectStyles(context) {
|
|
283
|
+
for (let o in __cssModules) {
|
|
284
|
+
this[o] = __cssModules[o];
|
|
285
|
+
}
|
|
236
286
|
}
|
|
237
|
-
const
|
|
238
|
-
return
|
|
287
|
+
const SignPanel = /* @__PURE__ */ function() {
|
|
288
|
+
return __component__.exports;
|
|
239
289
|
}();
|
|
240
290
|
export {
|
|
241
|
-
|
|
291
|
+
SignPanel as default
|
|
242
292
|
};
|
|
@@ -1 +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
|
+
}
|