zydx-plus 1.35.515 → 1.35.517

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zydx-plus",
3
- "version": "1.35.515",
3
+ "version": "1.35.517",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -215,6 +215,33 @@ export default {
215
215
  },
216
216
  emits: ['dragStatus', 'close', 'enlarge','updateDrag','minimize','dragMouseup'],
217
217
  methods: {
218
+ // 全屏
219
+ fullScreen() {
220
+ const myElement = document.body;
221
+ if (myElement.requestFullscreen) {
222
+ myElement.requestFullscreen();
223
+ } else if (myElement.mozRequestFullScreen) { // Firefox
224
+ myElement.mozRequestFullScreen();
225
+ } else if (myElement.webkitRequestFullscreen) { // Chrome, Safari and Opera
226
+ myElement.webkitRequestFullscreen();
227
+ } else if (myElement.msRequestFullscreen) { // IE and Edge
228
+ myElement.msRequestFullscreen();
229
+ }
230
+ this.state = true
231
+ },
232
+ // 退出全屏
233
+ exitFullscreen() {
234
+ if (document.exitFullscreen) {
235
+ document.exitFullscreen();
236
+ } else if (document.mozCancelFullScreen) {
237
+ document.mozCancelFullScreen();
238
+ } else if (document.webkitExitFullscreen) {
239
+ document.webkitExitFullscreen();
240
+ } else if (document.msExitFullscreen) {
241
+ document.msExitFullscreen();
242
+ }
243
+ this.state = false
244
+ },
218
245
  dragTap() {
219
246
  let pop = JSON.parse(sessionStorage.getItem('pop'))
220
247
  for(let i = 0; i< pop.length; i++) {
@@ -328,21 +355,21 @@ export default {
328
355
  this.footIsMove = false;
329
356
  },
330
357
  enlarge() {
331
- this.state = false
332
- let clientWidth = document.documentElement.clientWidth;
333
- let clientHeight = document.documentElement.clientHeight;
334
- if (clientWidth === this.footRightOffset && clientHeight === this.footDownOffset) {
358
+ let clientWidth = window.innerWidth
359
+ if(this.state) {
360
+ this.exitFullscreen()
335
361
  this.x = clientWidth / 2 - this.width / 2;
336
- this.y = clientHeight / 2 - this.height / 2;
362
+ this.y = window.innerHeight / 2 - this.height / 2;
337
363
  this.footDownOffset = this.height;
338
364
  this.footRightOffset = this.width;
339
- this.state = false
340
- } else {
341
- this.x = 0;
342
- this.y = 0;
343
- this.footDownOffset = clientHeight;
344
- this.footRightOffset = clientWidth;
345
- this.state = true
365
+ }else {
366
+ this.fullScreen()
367
+ setTimeout(() => {
368
+ this.x = 0;
369
+ this.y = 0;
370
+ this.footDownOffset = window.innerHeight;
371
+ this.footRightOffset = clientWidth;
372
+ },100)
346
373
  }
347
374
  this.$emit('updateDrag', {
348
375
  width: this.footRightOffset,
@@ -355,11 +382,13 @@ export default {
355
382
  minimizeTap() {
356
383
  this.isMove = false
357
384
  this.footIsMove = false
385
+ this.exitFullscreen()
358
386
  this.$emit('minimize');
359
387
  },
360
388
  close() {
361
389
  this.isMove = false
362
390
  this.footIsMove = false
391
+ this.exitFullscreen()
363
392
  this.$emit('close');
364
393
  },
365
394
  selectedDrag(){
@@ -223,6 +223,33 @@ export default {
223
223
  },
224
224
  emits: ['dragStatus', 'close', 'enlarge','updateDrag','minimize','dragMouseup'],
225
225
  methods: {
226
+ // 全屏
227
+ fullScreen() {
228
+ const myElement = document.body;
229
+ if (myElement.requestFullscreen) {
230
+ myElement.requestFullscreen();
231
+ } else if (myElement.mozRequestFullScreen) { // Firefox
232
+ myElement.mozRequestFullScreen();
233
+ } else if (myElement.webkitRequestFullscreen) { // Chrome, Safari and Opera
234
+ myElement.webkitRequestFullscreen();
235
+ } else if (myElement.msRequestFullscreen) { // IE and Edge
236
+ myElement.msRequestFullscreen();
237
+ }
238
+ this.state = true
239
+ },
240
+ // 退出全屏
241
+ exitFullscreen() {
242
+ if (document.exitFullscreen) {
243
+ document.exitFullscreen();
244
+ } else if (document.mozCancelFullScreen) {
245
+ document.mozCancelFullScreen();
246
+ } else if (document.webkitExitFullscreen) {
247
+ document.webkitExitFullscreen();
248
+ } else if (document.msExitFullscreen) {
249
+ document.msExitFullscreen();
250
+ }
251
+ this.state = false
252
+ },
226
253
  dragTap() {
227
254
  if(this.zIndex > 0) return
228
255
  let pop = JSON.parse(sessionStorage.getItem('pop'))
@@ -334,21 +361,21 @@ export default {
334
361
  this.footIsMove = false;
335
362
  },
336
363
  enlarge() {
337
- this.state = false
338
- let clientWidth = document.documentElement.clientWidth;
339
- let clientHeight = document.documentElement.clientHeight;
340
- if (clientWidth === this.footRightOffset && clientHeight === this.footDownOffset) {
364
+ let clientWidth = window.innerWidth
365
+ if(this.state) {
366
+ this.exitFullscreen()
341
367
  this.x = clientWidth / 2 - this.width / 2;
342
- this.y = clientHeight / 2 - this.height / 2;
368
+ this.y = window.innerHeight / 2 - this.height / 2;
343
369
  this.footDownOffset = this.height;
344
370
  this.footRightOffset = this.width;
345
- this.state = false
346
- } else {
347
- this.x = 0;
348
- this.y = 0;
349
- this.footDownOffset = clientHeight;
350
- this.footRightOffset = clientWidth;
351
- this.state = true
371
+ }else {
372
+ this.fullScreen()
373
+ setTimeout(() => {
374
+ this.x = 0;
375
+ this.y = 0;
376
+ this.footDownOffset = window.innerHeight;
377
+ this.footRightOffset = clientWidth;
378
+ },100)
352
379
  }
353
380
  this.$emit('updateDrag', {
354
381
  width: this.footRightOffset,
@@ -314,14 +314,14 @@ export default {
314
314
  // 清屏
315
315
  if (this.toolId === 'clear') {
316
316
  this.$refs.sketchpad.clear()
317
- setTimeout(() => { // 解决清屏篡位的问题
318
- this.width = this.width2 - 0.02
319
- this.height = this.height2 - 0.02
320
- setTimeout(() => {
321
- this.width2 = this.width
322
- this.height2 = this.height
323
- },10)
324
- },10)
317
+ // setTimeout(() => { // 解决清屏篡位的问题
318
+ // this.width = this.width2 - 0.02
319
+ // this.height = this.height2 - 0.02
320
+ // setTimeout(() => {
321
+ // this.width2 = this.width
322
+ // this.height2 = this.height
323
+ // },10)
324
+ // },10)
325
325
  }
326
326
  // 橡皮
327
327
  if (this.toolId === 'rubber') {
@@ -546,11 +546,13 @@ export default {
546
546
  }, 100)
547
547
  },
548
548
  mousemove(e) {
549
+ e.stopPropagation()
549
550
  if (!this.pressDown) return
550
551
  this.left = e.clientX - this.leftOffset;
551
552
  this.top = e.clientY - this.topOffset;
552
553
  },
553
554
  mouseup(e) {
555
+ e.stopPropagation()
554
556
  clearInterval(timer)
555
557
  if (!this.pressDown) {
556
558
  stayTime = 0
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.515',
92
+ version: '1.35.517',
93
93
  install,
94
94
  Calendar,
95
95
  Message,