@toolspack/ttd-common 0.3.1 → 0.4.3
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/README.md +5 -12
- package/lib/ttd-common.common.js +3614 -17480
- package/lib/ttd-common.umd.js +3618 -17484
- package/lib/ttd-common.umd.min.js +1 -31
- package/package.json +2 -7
- package/src/App.vue +0 -9
- package/src/main.js +0 -20
- package/src/packages/cfca/CfcaPdf.vue +30 -14
- package/src/packages/index.js +0 -35
- package/src/packages/ukey/WzhSign.vue +65 -34
- package/lib/fonts/iconfont.1a79c8ea.eot +0 -0
- package/lib/fonts/iconfont.3303ffae.ttf +0 -0
- package/lib/img/iconfont.18b11516.svg +0 -65
- package/lib/ttd-common.common.vendors~pdfjsWorker.js +0 -442
- package/lib/ttd-common.umd.min.vendors~pdfjsWorker.js +0 -23
- package/lib/ttd-common.umd.vendors~pdfjsWorker.js +0 -442
- package/src/packages/img-view/hevue-img-preview.vue +0 -626
- package/src/packages/img-view/iconfont/iconfont.css +0 -69
- package/src/packages/img-view/iconfont/iconfont.eot +0 -0
- package/src/packages/img-view/iconfont/iconfont.svg +0 -65
- package/src/packages/img-view/iconfont/iconfont.ttf +0 -0
- package/src/packages/img-view/iconfont/iconfont.woff +0 -0
- package/src/packages/img-view/index.js +0 -51
- package/src/packages/label-list/LabelOperate.vue +0 -179
- package/src/packages/make-label/LabelMake.vue +0 -631
- package/src/packages/make-label/commontag.vue +0 -55
- package/src/packages/make-label/config/label_config.js +0 -90
- package/src/packages/make-label/config/label_size.js +0 -32
- package/src/packages/make-label/directive.js +0 -23
- package/src/packages/make-label/labelProterty.vue +0 -134
- package/src/packages/pdf-view/PdfView.vue +0 -273
- package/src/packages/pdf-view/SwitchPage.vue +0 -78
- package/src/packages/pdf-view/build/pdf.js +0 -26002
- package/src/packages/pdf-view/build/pdf.sandbox.js +0 -414
- package/src/packages/pdf-view/build/pdf.worker.js +0 -92533
- package/src/packages/pdf-view/pdf.worker.js +0 -68364
- package/src/packages/pdf-view/pdf.worker.min.js +0 -22
- package/src/router/route.js +0 -18
|
@@ -1,626 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<transition name="fade">
|
|
3
|
-
<div
|
|
4
|
-
class="hevue-wrap"
|
|
5
|
-
id="hevue-wrap"
|
|
6
|
-
v-if="show"
|
|
7
|
-
ref="heImg"
|
|
8
|
-
@mouseup="removeMove('pc')"
|
|
9
|
-
@touchend="removeMove('mobile')"
|
|
10
|
-
v-on:click="clickMask"
|
|
11
|
-
:style="'background:' + mainBackground"
|
|
12
|
-
>
|
|
13
|
-
<!-- 用于临时在手机端展示一些调试信息 -->
|
|
14
|
-
<!-- <div>{{ logText }}--{{imgState}}</div> -->
|
|
15
|
-
<div class="he-img-wrap">
|
|
16
|
-
<img src="https://jzwsp.totodi.com/jz/image-loading.gif" v-show="imgState === 1" />
|
|
17
|
-
<img
|
|
18
|
-
:src="imgurl"
|
|
19
|
-
ref="heImView"
|
|
20
|
-
@click.stop
|
|
21
|
-
v-show="imgState === 2"
|
|
22
|
-
class="he-img-view"
|
|
23
|
-
:style="
|
|
24
|
-
'transform: scale(' +
|
|
25
|
-
imgScale +
|
|
26
|
-
') rotate(' +
|
|
27
|
-
imgRotate +
|
|
28
|
-
'deg);margin-top:' +
|
|
29
|
-
imgTop +
|
|
30
|
-
'px;margin-left:' +
|
|
31
|
-
imgLeft +
|
|
32
|
-
'px;' +
|
|
33
|
-
maxWH
|
|
34
|
-
"
|
|
35
|
-
@mousedown="addMove"
|
|
36
|
-
@touchstart="addMoveMobile"
|
|
37
|
-
/>
|
|
38
|
-
<div class="iconfont hevue-img-error" v-show="imgState === 3"></div>
|
|
39
|
-
<div
|
|
40
|
-
class="iconfont he-close-icon"
|
|
41
|
-
@click.stop="close"
|
|
42
|
-
:style="'color:' + closeColor"
|
|
43
|
-
></div>
|
|
44
|
-
<!-- 左箭头 -->
|
|
45
|
-
<div
|
|
46
|
-
class="arrow arrow-left iconfont"
|
|
47
|
-
@click.stop="toogleImg(false)"
|
|
48
|
-
v-if="multiple"
|
|
49
|
-
:style="'color:' + controlColor + ';background: ' + controlBackground"
|
|
50
|
-
></div>
|
|
51
|
-
<!-- 右箭头 -->
|
|
52
|
-
<div
|
|
53
|
-
class="arrow arrow-right iconfont"
|
|
54
|
-
@click.stop="toogleImg(true)"
|
|
55
|
-
v-if="multiple"
|
|
56
|
-
:style="'color:' + controlColor + ';background: ' + controlBackground"
|
|
57
|
-
></div>
|
|
58
|
-
<div class="he-control-bar-wrap">
|
|
59
|
-
<div
|
|
60
|
-
class="he-control-bar"
|
|
61
|
-
@click.stop
|
|
62
|
-
:style="
|
|
63
|
-
'color:' + controlColor + ';background: ' + controlBackground
|
|
64
|
-
"
|
|
65
|
-
>
|
|
66
|
-
<!-- 缩小 -->
|
|
67
|
-
<div class="he-control-btn iconfont" @click.stop="scaleFunc(-0.15)"></div>
|
|
68
|
-
<!-- 放大 -->
|
|
69
|
-
<div class="he-control-btn iconfont" @click.stop="scaleFunc(0.15)"></div>
|
|
70
|
-
<!-- 复位 -->
|
|
71
|
-
<div class="he-control-btn iconfont" v-show="isFull" @click.stop="imgToggle"></div>
|
|
72
|
-
<!-- 复位 -->
|
|
73
|
-
<div class="he-control-btn iconfont" v-show="!isFull" @click.stop="imgToggle"></div>
|
|
74
|
-
<!-- 左转 -->
|
|
75
|
-
<div class="he-control-btn iconfont" @click.stop="rotateFunc(-90)"></div>
|
|
76
|
-
<!-- 右转 -->
|
|
77
|
-
<div class="he-control-btn iconfont" @click.stop="rotateFunc(90)"></div>
|
|
78
|
-
<!-- 下载 -->
|
|
79
|
-
<!-- <div class="he-control-btn iconfont" @click.stop="downloadIamge"></div> -->
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div
|
|
84
|
-
class="he-control-num"
|
|
85
|
-
v-if="multiple"
|
|
86
|
-
:style="'color:' + controlColor + ';background: ' + controlBackground"
|
|
87
|
-
>{{ imgIndex + 1 }} / {{ imgList.length }}</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</transition>
|
|
91
|
-
</template>
|
|
92
|
-
|
|
93
|
-
<script>
|
|
94
|
-
export default {
|
|
95
|
-
name: 'hevue-img-preview',
|
|
96
|
-
props: {
|
|
97
|
-
show: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: false,
|
|
100
|
-
},
|
|
101
|
-
clickMaskCLose: String,
|
|
102
|
-
url: String,
|
|
103
|
-
mainBackground: String, // 整体背景颜色
|
|
104
|
-
controlColor: String, // 控制条字体颜色
|
|
105
|
-
controlBackground: String, // 控制条背景颜色
|
|
106
|
-
closeColor: String, // 关闭图标的颜色
|
|
107
|
-
instance: Object,
|
|
108
|
-
multiple: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: false,
|
|
111
|
-
},
|
|
112
|
-
keyboard: {
|
|
113
|
-
type: String,
|
|
114
|
-
default: 'open',
|
|
115
|
-
},
|
|
116
|
-
nowImgIndex: {
|
|
117
|
-
type: Number,
|
|
118
|
-
default: 0,
|
|
119
|
-
},
|
|
120
|
-
imgList: Array,
|
|
121
|
-
},
|
|
122
|
-
data() {
|
|
123
|
-
return {
|
|
124
|
-
// imgWidth: 0,
|
|
125
|
-
// imgHeight: 0,
|
|
126
|
-
imgScale: 1,
|
|
127
|
-
imgTop: 0,
|
|
128
|
-
imgLeft: 0,
|
|
129
|
-
imgRotate: 0,
|
|
130
|
-
isFull: false,
|
|
131
|
-
maxWH: 'max-width:100%;max-height:100%;',
|
|
132
|
-
clientX: 0,
|
|
133
|
-
clientY: 0,
|
|
134
|
-
imgIndex: 0,
|
|
135
|
-
canRun: true,
|
|
136
|
-
imgurl: '',
|
|
137
|
-
imgState: 1,
|
|
138
|
-
logText: '',
|
|
139
|
-
start: [
|
|
140
|
-
{
|
|
141
|
-
clientX: 217,
|
|
142
|
-
clientY: 279,
|
|
143
|
-
force: 1,
|
|
144
|
-
identifier: 0,
|
|
145
|
-
pageX: 217,
|
|
146
|
-
pageY: 279,
|
|
147
|
-
radiusX: 11.5,
|
|
148
|
-
radiusY: 11.5,
|
|
149
|
-
rotationAngle: 0,
|
|
150
|
-
screenX: 493,
|
|
151
|
-
screenY: 456,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
clientX: 247,
|
|
155
|
-
clientY: 273,
|
|
156
|
-
force: 1,
|
|
157
|
-
identifier: 0,
|
|
158
|
-
pageX: 247,
|
|
159
|
-
pageY: 273,
|
|
160
|
-
radiusX: 11.5,
|
|
161
|
-
radiusY: 11.5,
|
|
162
|
-
rotationAngle: 0,
|
|
163
|
-
screenX: 523,
|
|
164
|
-
screenY: 450,
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
mobileScale: 0, // 手指离开时图片的缩放比例
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
mounted() {
|
|
171
|
-
this.initImg();
|
|
172
|
-
},
|
|
173
|
-
watch: {
|
|
174
|
-
url() {
|
|
175
|
-
this.initImg();
|
|
176
|
-
},
|
|
177
|
-
show(newV) {
|
|
178
|
-
if (newV) {
|
|
179
|
-
this.$nextTick((_) => {
|
|
180
|
-
// eslint-disable-next-line
|
|
181
|
-
const _dom = document.getElementById('hevue-wrap');
|
|
182
|
-
_dom.onmousewheel = this.scrollFunc;
|
|
183
|
-
// 火狐浏览器没有onmousewheel事件,用DOMMouseScroll代替(滚轮事件)
|
|
184
|
-
document.body.addEventListener('DOMMouseScroll', this.scrollFunc);
|
|
185
|
-
// 禁止火狐浏览器下拖拽图片的默认事件
|
|
186
|
-
document.ondragstart = function () {
|
|
187
|
-
return false;
|
|
188
|
-
};
|
|
189
|
-
// 判断是否多图
|
|
190
|
-
if (this.multiple) {
|
|
191
|
-
if (Array.isArray(this.imgList) && this.imgList.length > 0) {
|
|
192
|
-
this.imgIndex = Number(this.nowImgIndex) || 0;
|
|
193
|
-
// this.url = this.imgList[this.imgIndex]
|
|
194
|
-
this.changeUrl(this.imgList[this.imgIndex], this.imgIndex);
|
|
195
|
-
} else {
|
|
196
|
-
console.error('imgList 为空或格式不正确');
|
|
197
|
-
}
|
|
198
|
-
} else {
|
|
199
|
-
this.changeUrl(this.url);
|
|
200
|
-
// var ImgObj = new Image()
|
|
201
|
-
// ImgObj.src = this.url
|
|
202
|
-
// if (ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)) {
|
|
203
|
-
// return true
|
|
204
|
-
// } else {
|
|
205
|
-
// console.error('传入图片地址不正确--组件hevue-img-preview')
|
|
206
|
-
// }
|
|
207
|
-
}
|
|
208
|
-
// 判断是否开启键盘事件
|
|
209
|
-
if (this.keyboard === 'open') {
|
|
210
|
-
document.addEventListener('keydown', this.keyHandleDebounce);
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
methods: {
|
|
217
|
-
close() {
|
|
218
|
-
// this.$closehevueImgPreview()
|
|
219
|
-
this.instance.show = false;
|
|
220
|
-
this.initImg();
|
|
221
|
-
this.maxWH = 'max-width:100%;max-height:100%;';
|
|
222
|
-
this.isFull = false;
|
|
223
|
-
// 移除火狐浏览器下的鼠标滚动事件
|
|
224
|
-
document.body.removeEventListener('DOMMouseScroll', this.scrollFunc);
|
|
225
|
-
// 恢复火狐及Safari浏览器下的图片拖拽
|
|
226
|
-
document.ondragstart = null;
|
|
227
|
-
// 移除键盘事件
|
|
228
|
-
if (this.keyboard) {
|
|
229
|
-
document.removeEventListener('keydown', this.keyHandleDebounce);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
initImg() {
|
|
233
|
-
this.mobileScale = 1;
|
|
234
|
-
this.imgScale = 1;
|
|
235
|
-
this.imgRotate = 0;
|
|
236
|
-
this.imgTop = 0;
|
|
237
|
-
this.imgLeft = 0;
|
|
238
|
-
},
|
|
239
|
-
/**
|
|
240
|
-
* 切换图片
|
|
241
|
-
* true 下一张
|
|
242
|
-
* false 上一张
|
|
243
|
-
*/
|
|
244
|
-
toogleImg(bool) {
|
|
245
|
-
if (bool) {
|
|
246
|
-
this.imgIndex++;
|
|
247
|
-
if (this.imgIndex > this.imgList.length - 1) {
|
|
248
|
-
this.imgIndex = 0;
|
|
249
|
-
}
|
|
250
|
-
} else {
|
|
251
|
-
this.imgIndex--;
|
|
252
|
-
if (this.imgIndex < 0) {
|
|
253
|
-
this.imgIndex = this.imgList.length - 1;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
// this.url = this.imgList[this.imgIndex]
|
|
257
|
-
this.changeUrl(this.imgList[this.imgIndex], this.imgIndex);
|
|
258
|
-
},
|
|
259
|
-
// 改变图片地址
|
|
260
|
-
/**
|
|
261
|
-
* @description:
|
|
262
|
-
* @param {String} url 要显示的图片的url
|
|
263
|
-
* @param {Number} index 当前显示当图片下标,防止用户点击切换图片过快
|
|
264
|
-
* @return {*}
|
|
265
|
-
*/
|
|
266
|
-
changeUrl(url, index) {
|
|
267
|
-
this.imgState = 1;
|
|
268
|
-
const img = new Image();
|
|
269
|
-
img.src = url;
|
|
270
|
-
img.onload = () => {
|
|
271
|
-
// 如果加载出来图片当下标不是当前显示图片当下标,则不予显示(用户点击过快当时候,会出现用户点到第三张了,此时第一张图片才加载完当情况)
|
|
272
|
-
console.log(`onload: index=${index}--imgIndex=${this.imgIndex}--imgState=${ this.imgState}`)
|
|
273
|
-
if (index !== undefined && index === this.imgIndex) {
|
|
274
|
-
this.imgState = 2;
|
|
275
|
-
this.imgurl = url;
|
|
276
|
-
} else if (index === undefined) {
|
|
277
|
-
this.imgState = 2;
|
|
278
|
-
this.imgurl = url;
|
|
279
|
-
}
|
|
280
|
-
console.log('imgState=', this.imgState)
|
|
281
|
-
};
|
|
282
|
-
img.onerror = () => {
|
|
283
|
-
if (index !== undefined && index === this.imgIndex) {
|
|
284
|
-
this.imgState = 3;
|
|
285
|
-
} else if (index === undefined) {
|
|
286
|
-
this.imgState = 3;
|
|
287
|
-
}
|
|
288
|
-
console.log(`onerror : index=${index}--imgIndex=${this.imgIndex}--imgState=${ this.imgState}`)
|
|
289
|
-
};
|
|
290
|
-
},
|
|
291
|
-
// 旋转图片
|
|
292
|
-
rotateFunc(deg) {
|
|
293
|
-
this.imgRotate += deg;
|
|
294
|
-
},
|
|
295
|
-
// 图片缩放
|
|
296
|
-
scaleFunc(num, bool) {
|
|
297
|
-
if (this.imgScale <= 0.2 && num < 0) return;
|
|
298
|
-
if (bool) {
|
|
299
|
-
this.imgScale = num;
|
|
300
|
-
} else {
|
|
301
|
-
this.imgScale += num;
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
// 图片原尺寸切换
|
|
305
|
-
imgToggle() {
|
|
306
|
-
this.initImg();
|
|
307
|
-
if (this.isFull) {
|
|
308
|
-
this.maxWH = 'max-width:100%;max-height:100%;';
|
|
309
|
-
} else {
|
|
310
|
-
this.maxWH = '';
|
|
311
|
-
}
|
|
312
|
-
this.isFull = !this.isFull;
|
|
313
|
-
},
|
|
314
|
-
// 鼠标滚轮缩放
|
|
315
|
-
scrollFunc(e) {
|
|
316
|
-
e = e || window.event;
|
|
317
|
-
// e.returnValue = false // ie
|
|
318
|
-
// 火狐下没有wheelDelta,用detail代替,由于detail值的正负和wheelDelta相反,所以取反
|
|
319
|
-
e.delta = e.wheelDelta || -e.detail;
|
|
320
|
-
|
|
321
|
-
e.preventDefault();
|
|
322
|
-
if (e.delta > 0) {
|
|
323
|
-
// 当滑轮向上滚动时
|
|
324
|
-
this.scaleFunc(0.05);
|
|
325
|
-
}
|
|
326
|
-
if (e.delta < 0) {
|
|
327
|
-
// 当滑轮向下滚动时
|
|
328
|
-
this.scaleFunc(-0.05);
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
// 鼠标按下
|
|
332
|
-
addMove(e) {
|
|
333
|
-
e = e || window.event;
|
|
334
|
-
this.clientX = e.clientX;
|
|
335
|
-
this.clientY = e.clientY;
|
|
336
|
-
this.$refs.heImg.onmousemove = this.moveFunc;
|
|
337
|
-
},
|
|
338
|
-
// 手指按下事件
|
|
339
|
-
addMoveMobile(e) {
|
|
340
|
-
e.preventDefault();
|
|
341
|
-
e = e || window.event;
|
|
342
|
-
if (e.touches.length > 1) {
|
|
343
|
-
this.start = e.touches;
|
|
344
|
-
} else {
|
|
345
|
-
this.clientX = e.touches[0].pageX;
|
|
346
|
-
this.clientY = e.touches[0].pageY;
|
|
347
|
-
}
|
|
348
|
-
// 添加手指拖动事件
|
|
349
|
-
this.$refs.heImg.ontouchmove = this.moveFuncMobile;
|
|
350
|
-
},
|
|
351
|
-
// 鼠标拖动
|
|
352
|
-
moveFunc(e) {
|
|
353
|
-
e = e || window.event;
|
|
354
|
-
e.preventDefault();
|
|
355
|
-
const movementX = e.clientX - this.clientX;
|
|
356
|
-
const movementY = e.clientY - this.clientY;
|
|
357
|
-
// event.clientY;
|
|
358
|
-
this.imgLeft += movementX * 2;
|
|
359
|
-
this.imgTop += movementY * 2;
|
|
360
|
-
this.clientX = e.clientX;
|
|
361
|
-
this.clientY = e.clientY;
|
|
362
|
-
},
|
|
363
|
-
// 手指拖动
|
|
364
|
-
moveFuncMobile(e) {
|
|
365
|
-
e = e || window.event;
|
|
366
|
-
// console.log(e);
|
|
367
|
-
if (e.touches.length > 1) {
|
|
368
|
-
const now = e.touches;
|
|
369
|
-
const scale = this.getDistance(now[0], now[1])
|
|
370
|
-
/ this.getDistance(this.start[0], this.start[1]);
|
|
371
|
-
// this.mobileScale = scale;
|
|
372
|
-
this.logText = `${scale},${this.mobileScale}`;
|
|
373
|
-
// 判断是否手指缩放过,如果缩放过,要在上次缩放的比例基础上进行缩放
|
|
374
|
-
if (this.mobileScale) {
|
|
375
|
-
if (scale > 1) {
|
|
376
|
-
// 放大
|
|
377
|
-
this.scaleFunc(scale + this.mobileScale - 1, true);
|
|
378
|
-
} else {
|
|
379
|
-
// 缩小
|
|
380
|
-
this.scaleFunc(scale * this.mobileScale, true);
|
|
381
|
-
}
|
|
382
|
-
} else {
|
|
383
|
-
this.scaleFunc(scale, true);
|
|
384
|
-
}
|
|
385
|
-
} else {
|
|
386
|
-
const touch = e.touches[0];
|
|
387
|
-
e.preventDefault();
|
|
388
|
-
const movementX = touch.pageX - this.clientX;
|
|
389
|
-
const movementY = touch.pageY - this.clientY;
|
|
390
|
-
// event.clientY;
|
|
391
|
-
this.imgLeft += movementX * 2;
|
|
392
|
-
this.imgTop += movementY * 2;
|
|
393
|
-
this.clientX = touch.pageX;
|
|
394
|
-
this.clientY = touch.pageY;
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
// 移除拖动事件
|
|
398
|
-
removeMove(type) {
|
|
399
|
-
if (type === 'pc') {
|
|
400
|
-
this.$refs.heImg.onmousemove = null;
|
|
401
|
-
} else {
|
|
402
|
-
this.mobileScale = this.imgScale;
|
|
403
|
-
this.$refs.heImg.ontouchmove = null;
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
keyHandleDebounce(e) {
|
|
407
|
-
if (this.canRun) {
|
|
408
|
-
// 如果this.canRun为true证明当前可以执行函数
|
|
409
|
-
this.keyHandle(e);
|
|
410
|
-
this.canRun = false; // 执行函数后一段时间内不可再次执行
|
|
411
|
-
setTimeout(() => {
|
|
412
|
-
this.canRun = true; // 等到了我们设定的时间之后,把this.canRun改为true,可以再次执行函数
|
|
413
|
-
}, 300);
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
// 键盘事件
|
|
417
|
-
keyHandle(ev) {
|
|
418
|
-
const e = window.event || ev;
|
|
419
|
-
const key = e.keyCode || e.which || e.charCode;
|
|
420
|
-
switch (key) {
|
|
421
|
-
case 27: // esc
|
|
422
|
-
this.close();
|
|
423
|
-
break;
|
|
424
|
-
case 65: // a键-上一张
|
|
425
|
-
if (this.multiple) {
|
|
426
|
-
this.toogleImg(false);
|
|
427
|
-
}
|
|
428
|
-
break;
|
|
429
|
-
case 68: // d键-下一张
|
|
430
|
-
if (this.multiple) {
|
|
431
|
-
this.toogleImg(true);
|
|
432
|
-
}
|
|
433
|
-
break;
|
|
434
|
-
case 87: // w键-放大
|
|
435
|
-
this.scaleFunc(0.15);
|
|
436
|
-
break;
|
|
437
|
-
case 83: // s键-缩小
|
|
438
|
-
this.scaleFunc(-0.15);
|
|
439
|
-
break;
|
|
440
|
-
case 81: // q键-逆时针旋转
|
|
441
|
-
this.rotateFunc(-90);
|
|
442
|
-
break;
|
|
443
|
-
case 69: // e键-顺时针旋转
|
|
444
|
-
this.rotateFunc(90);
|
|
445
|
-
break;
|
|
446
|
-
case 82: // r键-复位键
|
|
447
|
-
this.initImg();
|
|
448
|
-
break;
|
|
449
|
-
|
|
450
|
-
default:
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
// 点击遮罩层
|
|
455
|
-
clickMask() {
|
|
456
|
-
console.log('hello', this.clickMaskCLose);
|
|
457
|
-
if (this.clickMaskCLose === 'open') {
|
|
458
|
-
this.close();
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
// 缩放 勾股定理方法-求两点之间的距离
|
|
462
|
-
getDistance(p1, p2) {
|
|
463
|
-
const x = p2.pageX - p1.pageX;
|
|
464
|
-
const y = p2.pageY - p1.pageY;
|
|
465
|
-
return Math.sqrt(x * x + y * y);
|
|
466
|
-
},
|
|
467
|
-
/**
|
|
468
|
-
* @description:
|
|
469
|
-
* @param {String} imgsrc
|
|
470
|
-
* @param {*} name
|
|
471
|
-
* @return {*}
|
|
472
|
-
*/
|
|
473
|
-
downloadIamge() {
|
|
474
|
-
// 下载图片地址和图片名
|
|
475
|
-
const image = new Image();
|
|
476
|
-
// 解决跨域 Canvas 污染问题
|
|
477
|
-
image.setAttribute('crossOrigin', 'anonymous');
|
|
478
|
-
image.onload = function () {
|
|
479
|
-
const canvas = document.createElement('canvas');
|
|
480
|
-
canvas.width = image.width;
|
|
481
|
-
canvas.height = image.height;
|
|
482
|
-
const context = canvas.getContext('2d');
|
|
483
|
-
context.drawImage(image, 0, 0, image.width, image.height);
|
|
484
|
-
const url = canvas.toDataURL('image/png'); // 得到图片的base64编码数据
|
|
485
|
-
const a = document.createElement('a'); // 生成一个a元素
|
|
486
|
-
const event = new MouseEvent('click'); // 创建一个单击事件
|
|
487
|
-
a.download = `photo${ +new Date()}`; // 设置图片名称
|
|
488
|
-
a.href = url; // 将生成的URL设置为a.href属性
|
|
489
|
-
a.dispatchEvent(event); // 触发a的单击事件
|
|
490
|
-
};
|
|
491
|
-
image.onerror = function (err) {
|
|
492
|
-
console.log('图片信息不正确或图片服务器禁止访问');
|
|
493
|
-
console.log(err);
|
|
494
|
-
};
|
|
495
|
-
if (this.multiple) {
|
|
496
|
-
image.src = this.imgList[this.imgIndex];
|
|
497
|
-
} else {
|
|
498
|
-
image.src = this.url;
|
|
499
|
-
}
|
|
500
|
-
},
|
|
501
|
-
},
|
|
502
|
-
};
|
|
503
|
-
</script>
|
|
504
|
-
|
|
505
|
-
<style scoped>
|
|
506
|
-
@import "./iconfont/iconfont.css";
|
|
507
|
-
/* @import '//at.alicdn.com/t/font_1776686_mw0jz39v97.css'; */
|
|
508
|
-
.hevue-wrap {
|
|
509
|
-
position: fixed;
|
|
510
|
-
top: 0;
|
|
511
|
-
bottom: 0;
|
|
512
|
-
right: 0;
|
|
513
|
-
left: 0;
|
|
514
|
-
user-select: none;
|
|
515
|
-
-moz-user-select: none;
|
|
516
|
-
-webkit-user-select: none;
|
|
517
|
-
-ms-user-select: none;
|
|
518
|
-
z-index: 999999;
|
|
519
|
-
}
|
|
520
|
-
.he-img-wrap {
|
|
521
|
-
width: 100%;
|
|
522
|
-
height: 100%;
|
|
523
|
-
text-align: center;
|
|
524
|
-
vertical-align: middle;
|
|
525
|
-
display: flex;
|
|
526
|
-
flex-direction: column;
|
|
527
|
-
justify-content: center;
|
|
528
|
-
align-items: center;
|
|
529
|
-
color: #fff;
|
|
530
|
-
}
|
|
531
|
-
.he-img-view {
|
|
532
|
-
/* transition: transform 0.3s; */
|
|
533
|
-
}
|
|
534
|
-
.he-close-icon {
|
|
535
|
-
position: absolute;
|
|
536
|
-
right: 50px;
|
|
537
|
-
top: 50px;
|
|
538
|
-
font-size: 46px;
|
|
539
|
-
color: #666;
|
|
540
|
-
cursor: pointer;
|
|
541
|
-
transition: all 0.2s;
|
|
542
|
-
}
|
|
543
|
-
.arrow {
|
|
544
|
-
width: 50px;
|
|
545
|
-
height: 50px;
|
|
546
|
-
text-align: center;
|
|
547
|
-
line-height: 50px;
|
|
548
|
-
position: absolute;
|
|
549
|
-
top: 50%;
|
|
550
|
-
border-radius: 50%;
|
|
551
|
-
transform: translateY(-50%);
|
|
552
|
-
-ms-transform: translateY(-50%);
|
|
553
|
-
font-size: 3vw;
|
|
554
|
-
opacity: 0.6;
|
|
555
|
-
cursor: pointer;
|
|
556
|
-
transition: all 0.2s;
|
|
557
|
-
}
|
|
558
|
-
.arrow:hover {
|
|
559
|
-
opacity: 0.8;
|
|
560
|
-
font-size: 32px;
|
|
561
|
-
}
|
|
562
|
-
.arrow-left {
|
|
563
|
-
left: 50px;
|
|
564
|
-
}
|
|
565
|
-
.arrow-right {
|
|
566
|
-
right: 50px;
|
|
567
|
-
}
|
|
568
|
-
.he-close-icon:hover {
|
|
569
|
-
transform: rotate(90deg);
|
|
570
|
-
}
|
|
571
|
-
.he-control-bar-wrap {
|
|
572
|
-
display: flex;
|
|
573
|
-
position: absolute;
|
|
574
|
-
width: 100%;
|
|
575
|
-
bottom: 10%;
|
|
576
|
-
left: 0;
|
|
577
|
-
}
|
|
578
|
-
.he-control-bar {
|
|
579
|
-
height: 44px;
|
|
580
|
-
bottom: 10%;
|
|
581
|
-
padding: 0 22px;
|
|
582
|
-
/* position: absolute; */
|
|
583
|
-
/* left: 50%; */
|
|
584
|
-
/* display: flex;
|
|
585
|
-
justify-content: space-between; */
|
|
586
|
-
display: flex;
|
|
587
|
-
border-radius: 22px;
|
|
588
|
-
margin: 0 auto;
|
|
589
|
-
|
|
590
|
-
/* display: flex;
|
|
591
|
-
justify-content: space-between; */
|
|
592
|
-
}
|
|
593
|
-
.he-control-num {
|
|
594
|
-
position: absolute;
|
|
595
|
-
bottom: 5%;
|
|
596
|
-
left: 50%;
|
|
597
|
-
transform: translateX(-50%);
|
|
598
|
-
-ms-transform: translateX(-50%);
|
|
599
|
-
padding: 0 22px;
|
|
600
|
-
font-size: 16px;
|
|
601
|
-
border-radius: 15px;
|
|
602
|
-
}
|
|
603
|
-
.he-control-btn {
|
|
604
|
-
line-height: 44px;
|
|
605
|
-
font-size: 24px;
|
|
606
|
-
cursor: pointer;
|
|
607
|
-
padding: 0 9px;
|
|
608
|
-
/* display: inline-block; */
|
|
609
|
-
transition: all 0.2s;
|
|
610
|
-
}
|
|
611
|
-
.he-control-btn:hover {
|
|
612
|
-
transform: scale(1.2);
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
.fade-enter-active,
|
|
616
|
-
.fade-leave-active {
|
|
617
|
-
transition: opacity 0.3s;
|
|
618
|
-
}
|
|
619
|
-
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
|
620
|
-
opacity: 0;
|
|
621
|
-
}
|
|
622
|
-
.hevue-img-error {
|
|
623
|
-
font-size: 56px;
|
|
624
|
-
color: #ccc;
|
|
625
|
-
}
|
|
626
|
-
</style>
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
@font-face {font-family: "iconfont";
|
|
2
|
-
src: url('iconfont.eot?t=1615190912050'); /* IE9 */
|
|
3
|
-
src: url('iconfont.eot?t=1615190912050#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
|
4
|
-
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAkQAAsAAAAAERQAAAjCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEaAqSMI8UATYCJAM4Cx4ABCAFhG0HgV4bkA5RlFBSI9nPAru5g41UuVLFiYtgRJc5aOrfayPXP6QQTk1nO2RIyxvXBRylMCIoBFyI8w4MKCPAjCED5M5j/vCQf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FsO18Uen8AEBjGBujSDj4efrpO8G72E10t7R6W0E1M/njWZjrMXkV0r7Y27Q38hqBG55EJ1v5nroWlC+YG9w6q8U3PfaKL7uf9HRoK+1vXzoce1YQWon9IVdZq4QWkS4nUGnM+CNeqfAV+i8pCI6FGPelKKQCrxgH/jdmheLgtNqK36C+ZjUgxRWRLAdN1dnGYgV3ZcA1OBtZCsv+VrDJojP05YVDQSBoApGCUCCeCsTmcYnQY07C7gBnYPQjXiMQ7mRZuhA5ndWphR+QkEImtr5gzXeYcMau/KGXLdoujd7FR03Zmqzs/U+ESa6NOZsUpyXYxtbxpXdXYbDcrJrZxeqxpLpdFtChygdiIbWHOz5dFhyLnmrNd5W2odFSrUMEy2bZ8tlwAVn0Ks0wuP3oOEVn6p5Rkk9lZFndhSz/fjpmVW75MSkufi5SdmCmcpOWLSEV5mHpYNabtvfrcl9ZOHlZpcHHOQnQ7K2QFRDTinFm+KpeJcNSvlsssm0t52AilDtVQgY9l6UuX3z5bcKvTuPn6lQ81NorQhCEaoiU6oicGwhKO8EQgRhKEktfiTQfYpAFuOUvKlAfY3HZTWnpqRiXGZs53cLlS5oBMaYBNtltDXW6HlGkv1XXapKxMKXgwuXemosh9eyuS1eZiW3LtLtltqNTQz51pt7Mz7WzMpXL9bQGtRMqXtBa0suZk6pxuud9WVfr/qms5JLtVa43ysiQAAA==') format('woff2'),
|
|
5
|
-
url('iconfont.woff?t=1615190912050') format('woff'),
|
|
6
|
-
url('iconfont.ttf?t=1615190912050') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
|
7
|
-
url('iconfont.svg?t=1615190912050#iconfont') format('svg'); /* iOS 4.1- */
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.iconfont {
|
|
11
|
-
font-family: "iconfont" !important;
|
|
12
|
-
font-size: 16px;
|
|
13
|
-
font-style: normal;
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
-moz-osx-font-smoothing: grayscale;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iconiconfontzhizuobiaozhun023146:before {
|
|
19
|
-
content: "\e694";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.iconhelp:before {
|
|
23
|
-
content: "\e626";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.iconjiazaizhong:before {
|
|
27
|
-
content: "\e6b1";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icontupianjiazaishibai:before {
|
|
31
|
-
content: "\ec0d";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.iconicon_arrow_right:before {
|
|
35
|
-
content: "\e60d";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.iconjiantouzuo:before {
|
|
39
|
-
content: "\e620";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.iconxuanzhuan:before {
|
|
43
|
-
content: "\e66f";
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.iconxuanzhuan1:before {
|
|
47
|
-
content: "\e670";
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.iconyuanshibili:before {
|
|
51
|
-
content: "\e86b";
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.iconfangda:before {
|
|
55
|
-
content: "\e65d";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.iconsuoxiao:before {
|
|
59
|
-
content: "\e65e";
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.iconquanping:before {
|
|
63
|
-
content: "\e698";
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.iconguanbi:before {
|
|
67
|
-
content: "\e764";
|
|
68
|
-
}
|
|
69
|
-
|
|
Binary file
|