zydx-plus 1.35.579 → 1.35.581

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.579",
3
+ "version": "1.35.581",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -212,9 +212,8 @@ export default {
212
212
  // 监听窗口变化
213
213
  window.addEventListener('resize', () => {
214
214
  const wid = document.getElementById('app').offsetWidth
215
- if(this.fixedStart) {
216
- if(wid <= this.initWidth) return
217
- this.x = this.left + (wid-this.initWidth)/2
215
+ if(this.state) {
216
+ this.footRightOffset = wid
218
217
  }
219
218
  });
220
219
  document.onmouseup = () => {
@@ -235,19 +234,8 @@ export default {
235
234
  methods: {
236
235
  handleFullScreenChange() {
237
236
  if (!document.fullscreenElement) {
238
- let clientWidth = window.innerWidth
239
- this.x = clientWidth / 2 - this.width / 2;
240
- this.y = (window.innerHeight / 2 - this.height / 2) - 80;
241
- this.footDownOffset = this.height;
242
- this.footRightOffset = this.width;
243
- this.draggableState.draggable({enabled: true})
237
+ this.reducePop()
244
238
  this.state = false
245
- this.$emit('updateDrag', {
246
- width: this.footRightOffset,
247
- height: this.footDownOffset - ((this.dragTextShow)?60:30),
248
- left: this.x,
249
- top: this.y
250
- })
251
239
  this.$emit('enlarge', this.state)
252
240
  }
253
241
  },
@@ -324,6 +312,8 @@ export default {
324
312
  this.y=isNaN(this.y)?100:this.y
325
313
  }
326
314
  }
315
+ if(this.x < 0) this.x = 0
316
+ if(this.y < 0) this.y = 0
327
317
  setTimeout(() => {
328
318
  this.draggableState = interact(`#draggable${that.id}`)
329
319
  this.draggableState.draggable({
@@ -404,27 +394,33 @@ export default {
404
394
  })
405
395
  this.footIsMove = false;
406
396
  },
407
- enlarge() {
408
- let clientWidth = window.innerWidth
409
- if(this.state) {
410
- this.exitFullscreen()
411
- this.x = clientWidth / 2 - this.width / 2;
412
- this.y = window.innerHeight / 2 - this.height / 2;
397
+ reducePop() {
398
+ setTimeout(() => {
399
+ this.x = document.documentElement.clientWidth / 2 - this.width / 2;
400
+ this.y = document.documentElement.clientHeight / 2 - this.height / 2;
413
401
  this.footDownOffset = this.height;
414
402
  this.footRightOffset = this.width;
403
+ if(this.x < 0) this.x = 0
404
+ if(this.y < 0) this.y = 0
415
405
  this.$emit('updateDrag', {
416
406
  width: this.footRightOffset,
417
407
  height: this.footDownOffset - ((this.dragTextShow)?60:30),
418
408
  left: this.x,
419
409
  top: this.y
420
410
  })
411
+ },100)
412
+ },
413
+ enlarge() {
414
+ if(this.state) {
415
+ this.exitFullscreen()
416
+ this.reducePop()
421
417
  }else {
422
418
  this.fullScreen()
423
419
  setTimeout(() => {
424
420
  this.x = 0;
425
421
  this.y = 0;
426
- this.footDownOffset = window.outerHeight + 20;
427
- this.footRightOffset = window.outerWidth + 20;
422
+ this.footDownOffset = document.documentElement.clientHeight;
423
+ this.footRightOffset = document.documentElement.clientWidth;
428
424
  this.$emit('updateDrag', {
429
425
  width: this.footRightOffset,
430
426
  height: this.footDownOffset - ((this.dragTextShow)?60:30),
@@ -212,9 +212,8 @@ export default {
212
212
  // 监听窗口变化
213
213
  window.addEventListener('resize', () => {
214
214
  const wid = document.getElementById('app').offsetWidth
215
- if(this.fixedStart) {
216
- if(wid <= this.initWidth) return
217
- this.x = this.left + (wid-this.initWidth)/2
215
+ if(this.state) {
216
+ this.footRightOffset = wid
218
217
  }
219
218
  });
220
219
  setTimeout(() => {
@@ -242,19 +241,8 @@ export default {
242
241
  methods: {
243
242
  handleFullScreenChange() {
244
243
  if (!document.fullscreenElement) {
245
- let clientWidth = window.innerWidth
246
- this.x = clientWidth / 2 - this.width / 2;
247
- this.y = (window.innerHeight / 2 - this.height / 2) - 80;
248
- this.footDownOffset = this.height;
249
- this.footRightOffset = this.width;
250
- this.draggableState.draggable({enabled: true})
244
+ this.reducePop()
251
245
  this.state = false
252
- this.$emit('updateDrag', {
253
- width: this.footRightOffset,
254
- height: this.footDownOffset - ((this.dragTextShow)?60:30),
255
- left: this.x,
256
- top: this.y
257
- })
258
246
  this.$emit('enlarge', this.state)
259
247
  }
260
248
  },
@@ -317,6 +305,7 @@ export default {
317
305
  },
318
306
  init() {
319
307
  let that = this
308
+ console.log(window.devicePixelRatio)
320
309
  if(this.fixedStart) {
321
310
  if(!this.isInitShowBottomRight) {
322
311
  const wid = document.getElementById('app').offsetWidth
@@ -332,6 +321,8 @@ export default {
332
321
  this.y=isNaN(this.y)?100:this.y
333
322
  }
334
323
  }
324
+ if(this.x < 0) this.x = 0
325
+ if(this.y < 0) this.y = 0
335
326
  setTimeout(() => {
336
327
  this.draggableState = interact(`#draggable${that.id}`)
337
328
  this.draggableState.draggable({
@@ -413,27 +404,33 @@ export default {
413
404
  })
414
405
  this.footIsMove = false;
415
406
  },
416
- enlarge() {
417
- let clientWidth = window.innerWidth
418
- if(this.state) {
419
- this.exitFullscreen()
420
- this.x = clientWidth / 2 - this.width / 2;
421
- this.y = window.innerHeight / 2 - this.height / 2;
407
+ reducePop() {
408
+ setTimeout(() => {
409
+ this.x = document.documentElement.clientWidth / 2 - this.width / 2;
410
+ this.y = document.documentElement.clientHeight / 2 - this.height / 2;
422
411
  this.footDownOffset = this.height;
423
412
  this.footRightOffset = this.width;
413
+ if(this.x < 0) this.x = 0
414
+ if(this.y < 0) this.y = 0
424
415
  this.$emit('updateDrag', {
425
416
  width: this.footRightOffset,
426
417
  height: this.footDownOffset - ((this.dragTextShow)?60:30),
427
418
  left: this.x,
428
419
  top: this.y
429
420
  })
421
+ },100)
422
+ },
423
+ enlarge() {
424
+ if(this.state) {
425
+ this.exitFullscreen()
426
+ this.reducePop()
430
427
  }else {
431
428
  this.fullScreen()
432
429
  setTimeout(() => {
433
430
  this.x = 0;
434
431
  this.y = 0;
435
- this.footDownOffset = window.outerHeight + 20;
436
- this.footRightOffset = window.outerWidth + 20;
432
+ this.footDownOffset = document.documentElement.clientHeight;
433
+ this.footRightOffset = document.documentElement.clientWidth;
437
434
  this.$emit('updateDrag', {
438
435
  width: this.footRightOffset,
439
436
  height: this.footDownOffset - ((this.dragTextShow)?60:30),
@@ -667,11 +667,11 @@ export default {
667
667
  data: {
668
668
  // 百度实时转译 appid appkey
669
669
  appid: Number(_this.appData.appId),
670
- appkey: _this.appData.qfClientId,
670
+ appkey: _this.appData.key,
671
671
  // appid: 101913097,
672
672
  // appkey: 'xv9715uwu2jqkTmIzlJl8eGx',
673
673
  dev_pid: 15372,
674
- cuid: 'HpURryNC91ddJmAPq7iwu26OvMDW4jMS',
674
+ cuid: _this.appData.secret,
675
675
  format: 'pcm',
676
676
  sample: 16000,
677
677
  }
Binary file
@@ -601,8 +601,8 @@ export default {
601
601
  return {
602
602
  'left': x1 - 0.2 + '%',
603
603
  'top': (y1 - y2) - 0.2 + '%',
604
- 'width': x2 + 0.4 + '%',
605
- 'height': (y2 + 0.4) + '%',
604
+ 'width': x2 + 0.1 + '%',
605
+ 'height': (y2 + 0.1) + '%',
606
606
  'border': `${v.borderStyle.width}px solid rgb(${v.borderColor[0]},${v.borderColor[1]},${v.borderColor[2]})`
607
607
  }
608
608
  },
@@ -1714,7 +1714,7 @@ export default {
1714
1714
  }
1715
1715
  .magnifier>img{
1716
1716
  width: 80% !important;
1717
- height: 80% !important;
1717
+ height: 90% !important;
1718
1718
  display: block;
1719
1719
  margin: 0 auto;
1720
1720
  }
@@ -1731,10 +1731,10 @@ export default {
1731
1731
  overflow: hidden;
1732
1732
  }
1733
1733
  .magnifier-head{
1734
- height: 30px;
1734
+ height: 20px;
1735
1735
  width: 100%;
1736
1736
  background: #4B0C77;
1737
- line-height: 30px;
1737
+ line-height: 20px;
1738
1738
  display: flex;
1739
1739
  justify-content: space-between;
1740
1740
  padding: 0 5px;
@@ -1743,12 +1743,12 @@ export default {
1743
1743
  .magnifier-icon>img{
1744
1744
  width: 16px !important;
1745
1745
  height: 16px !important;
1746
- margin-left: 10px;
1746
+ margin-left: 6px;
1747
1747
  position: relative;
1748
1748
  top: 2px;
1749
1749
  }
1750
1750
  .magnifier-title{
1751
- font-size: 14px;
1751
+ font-size: 12px;
1752
1752
  color: #fff;
1753
1753
  }
1754
1754
  .magnifier-cont{
@@ -1,6 +1,5 @@
1
1
  <template>
2
- <onClickOutSide :target="dropdown"
3
- :handler="handler">
2
+ <onClickOutSide :target="dropdown" :handler="handler">
4
3
  <div class="wrapper">
5
4
  <div class="custom-select"
6
5
  :class="{ 'readonly': readonly }">
@@ -8,12 +7,12 @@
8
7
  :value="selected"
9
8
  :placeholder="placeholder"
10
9
  :readonly="true"
11
- @click="toggleDropDown"
10
+ @click.stop="toggleDropDown"
12
11
  class="select-css" />
13
12
 
14
13
  <span class="custom-select-icons"
15
14
  v-if="!readonly"
16
- @click="toggleDropDown">
15
+ @click.stop="toggleDropDown">
17
16
  <svg xmlns="http://www.w3.org/2000/svg"
18
17
  width="16"
19
18
  height="16"
@@ -24,20 +23,21 @@
24
23
  </g>
25
24
  </svg>
26
25
  </span>
27
- <transition>
26
+ <teleport to="body">
28
27
  <template v-if="!readonly">
29
28
  <template v-if="options.length">
30
29
  <ul v-if="isOpen"
31
30
  ref="dropdown"
31
+ :style="{position: 'fixed', 'z-index': '10000', left: x + 'px', top: y + 'px', width: width + 'px'}"
32
32
  :class="{ 'custom-select-options': true, 'scroll': maxHeight > 0 }">
33
33
  <li v-for="(option, idx) in options"
34
34
  :key="idx"
35
35
  :class="option.disable ? 'disable': ''"
36
- @click="handleClick(option)">{{ option.label }}</li>
36
+ @click.stop="handleClick(option)">{{ option.label }}</li>
37
37
  </ul>
38
38
  </template>
39
39
  </template>
40
- </transition>
40
+ </teleport>
41
41
  </div>
42
42
  </div>
43
43
  </onClickOutSide>
@@ -85,17 +85,27 @@ export default defineComponent({
85
85
  data() {
86
86
  return {
87
87
  isOpen: false,
88
- selected: null
88
+ selected: null,
89
+ x: 0,
90
+ y: 0,
91
+ width: 0
89
92
  }
90
93
  },
91
94
  methods: {
92
- toggleDropDown: function () {
95
+ toggleDropDown: function (e) {
96
+ const { x, y, width, height } = e.target.getBoundingClientRect()
97
+ this.x = x
98
+ this.y = y + height
99
+ this.width = width
93
100
  this.isOpen = !this.isOpen
101
+ if(this.isOpen) {
102
+ window.addEventListener('scroll', this.handler)
103
+ }else {
104
+ window.removeEventListener('scroll', this.handler)
105
+ }
94
106
  },
95
107
  handleClick: function (option) {
96
- if(option.disable) {
97
- return
98
- }
108
+ if(option.disable) return
99
109
  this.$emit('update:value', option.value)
100
110
  this.$emit('select', option)
101
111
  this.selected = option.label
@@ -103,7 +113,9 @@ export default defineComponent({
103
113
  },
104
114
  handler: function () {
105
115
  if (this.isOpen) {
106
- this.isOpen = false
116
+ setTimeout(() => {
117
+ this.isOpen = false
118
+ }, 100)
107
119
  }
108
120
  }
109
121
  },
@@ -267,4 +279,34 @@ export default defineComponent({
267
279
  .disable {
268
280
  color: gray !important;
269
281
  }
282
+
283
+
284
+ /* 适用于Webkit浏览器 */
285
+ ::-webkit-scrollbar {
286
+ display: unset !important;
287
+ width: 2px !important;
288
+ border-radius: 5px;
289
+ }
290
+
291
+ ::-webkit-scrollbar-track {
292
+ display: unset !important;
293
+ background: #f1f1f1 !important;
294
+ width: 2px !important;
295
+ border-radius: 5px;
296
+ }
297
+
298
+ ::-webkit-scrollbar-thumb {
299
+ display: unset !important;
300
+ background: #888 !important;
301
+ width: 2px !important;
302
+ border-radius: 5px;
303
+ }
304
+
305
+ ::-webkit-scrollbar-thumb:hover {
306
+ display: unset !important;
307
+ background: #555 !important;
308
+ width: 2px !important;
309
+ border-radius: 5px;
310
+ }
311
+
270
312
  </style>
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.579',
92
+ version: '1.35.581',
93
93
  install,
94
94
  Calendar,
95
95
  Message,