zydx-plus 1.34.450 → 1.34.451
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,5 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="chat-content"
|
|
2
|
+
<div class="chat-content"
|
|
3
|
+
:style="{
|
|
4
|
+
top: `${y !== '' ? `${y}px` : '50%'}`,
|
|
5
|
+
left: `${x !== '' ? `${x}px` : '50%'}`,
|
|
6
|
+
marginTop: `${y === ''? '-325px' : '0'}`,
|
|
7
|
+
marginLeft: `${x === ''? '-300px' : '0'}`,
|
|
8
|
+
}">
|
|
3
9
|
<div class="chat-header">
|
|
4
10
|
<span class="chat-header-title"
|
|
5
11
|
@mousedown.stop="chatMousedown"
|
|
@@ -60,8 +66,8 @@ export default {
|
|
|
60
66
|
messages: [],
|
|
61
67
|
userText: '',
|
|
62
68
|
disabled: false,
|
|
63
|
-
x:
|
|
64
|
-
y:
|
|
69
|
+
x: '',
|
|
70
|
+
y: '',
|
|
65
71
|
left: 0,
|
|
66
72
|
top: 0,
|
|
67
73
|
isMove: false,
|
|
@@ -88,17 +94,25 @@ export default {
|
|
|
88
94
|
_this.vol = params.vol
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
|
-
document.addEventListener('mousemove', () => {
|
|
97
|
+
document.addEventListener('mousemove', (e) => {
|
|
92
98
|
if (!this.isMove) return
|
|
93
|
-
this.x =
|
|
94
|
-
this.y =
|
|
99
|
+
this.x = e.clientX - this.left;
|
|
100
|
+
this.y = e.clientY - this.top;
|
|
95
101
|
// 超出边界
|
|
96
102
|
const w = document.documentElement.clientWidth;
|
|
97
103
|
const h = document.documentElement.clientHeight;
|
|
98
|
-
if (this.x < 0)
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (this.y
|
|
104
|
+
if (this.x < 0) {
|
|
105
|
+
this.x = 0;
|
|
106
|
+
}
|
|
107
|
+
if (this.y < 0) {
|
|
108
|
+
this.y = 0;
|
|
109
|
+
}
|
|
110
|
+
if (this.x > (w - 600)) {
|
|
111
|
+
this.x = w - 600;
|
|
112
|
+
}
|
|
113
|
+
if (this.y > (h - 650)) {
|
|
114
|
+
this.y = h - 650;
|
|
115
|
+
}
|
|
102
116
|
this.$emit('move', {x: this.x, y: this.y})
|
|
103
117
|
})
|
|
104
118
|
document.addEventListener('mouseup', (event) => {
|
|
@@ -307,7 +321,8 @@ export default {
|
|
|
307
321
|
height: 650px;
|
|
308
322
|
background: #fff;
|
|
309
323
|
box-shadow: 0 0 10px rgba(0, 0, 0, .2);
|
|
310
|
-
position:
|
|
324
|
+
position: fixed;
|
|
325
|
+
z-index: 10;
|
|
311
326
|
}
|
|
312
327
|
|
|
313
328
|
.chat-header {
|
|
@@ -58,6 +58,11 @@
|
|
|
58
58
|
<span :class="{'but-name-color':voiceOpen}" v-html="voiceOpen?'关闭语音':'语音输入'"></span>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
|
+
<div v-if='isShowAiTool' class="editor-but">
|
|
62
|
+
<div class="editor-but-name" @click="showAi">
|
|
63
|
+
<span>AI助手</span>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
61
66
|
<!-- <div class="editor-but">
|
|
62
67
|
<div class="editor-but-name">
|
|
63
68
|
<label>
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
</div>
|
|
68
73
|
</div>-->
|
|
69
74
|
</div>
|
|
75
|
+
<zydx-chat v-if="isShowAi" @close='isShowAi = false'></zydx-chat>
|
|
70
76
|
<div :class="{'editor-content-show': !editableShow}" class="editor-content">
|
|
71
77
|
<div class="editing">
|
|
72
78
|
<div v-if="signMenuShow" class="editing-header">
|
|
@@ -615,6 +621,7 @@ import MarginStandard from "../src/margin-standard.vue";
|
|
|
615
621
|
import MarginWide from "../src/margin-wide.vue";
|
|
616
622
|
import isSelect from "../src/isSelect.vue";
|
|
617
623
|
import Paint from '../../paint/src/paint'
|
|
624
|
+
import zydxChat from '../../chat/src/chat.vue'
|
|
618
625
|
|
|
619
626
|
const img = require('./image/annotation.png')
|
|
620
627
|
export default {
|
|
@@ -632,6 +639,7 @@ export default {
|
|
|
632
639
|
zydxColoring,
|
|
633
640
|
zydxDragPopup,
|
|
634
641
|
zydxSelect,
|
|
642
|
+
zydxChat,
|
|
635
643
|
delSvg, editSvg, viewSvg,Paint
|
|
636
644
|
},
|
|
637
645
|
beforeUnmount() {
|
|
@@ -794,6 +802,7 @@ export default {
|
|
|
794
802
|
timeOut: null,
|
|
795
803
|
isShowPageMargin: false,
|
|
796
804
|
isShowHorizontalLine: false,
|
|
805
|
+
isShowAi: false,
|
|
797
806
|
isShowSwitchingFormat: false,
|
|
798
807
|
templateType: 'freeTypesetting',
|
|
799
808
|
switchingFormat: [
|
|
@@ -870,6 +879,10 @@ export default {
|
|
|
870
879
|
}
|
|
871
880
|
},
|
|
872
881
|
props: {
|
|
882
|
+
isShowAiTool: {
|
|
883
|
+
type: Boolean,
|
|
884
|
+
default: true
|
|
885
|
+
},
|
|
873
886
|
html: {
|
|
874
887
|
type: Array,
|
|
875
888
|
default: () => []
|
|
@@ -1346,6 +1359,9 @@ export default {
|
|
|
1346
1359
|
},
|
|
1347
1360
|
emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee'],
|
|
1348
1361
|
methods: {
|
|
1362
|
+
showAi() {
|
|
1363
|
+
this.isShowAi = !this.isShowAi
|
|
1364
|
+
},
|
|
1349
1365
|
// 插入白板数据
|
|
1350
1366
|
exportImg(e) {
|
|
1351
1367
|
this.uploadFile(e, this.uploadImage).then(r => {
|
|
@@ -3723,8 +3739,8 @@ export default {
|
|
|
3723
3739
|
},
|
|
3724
3740
|
|
|
3725
3741
|
close() {
|
|
3726
|
-
if (this.ws === null) return
|
|
3727
3742
|
this.voiceOpen = false
|
|
3743
|
+
if (this.ws === null) return
|
|
3728
3744
|
this.ws?.send(JSON.stringify({"type": "CANCEL"}))
|
|
3729
3745
|
this.ws?.close()
|
|
3730
3746
|
this.ws = null
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="read">
|
|
3
3
|
<vue-office-docx v-if="fileType === 'docx'" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
|
|
4
4
|
<vue-office-excel v-if="fileType === 'xlsx' && xlsx" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
|
|
5
|
-
<div class="view-pdf" v-if="fileType === 'pdf'">
|
|
5
|
+
<div class="view-pdf" @scroll="scroll" v-if="fileType === 'pdf'">
|
|
6
6
|
<div class="pageContainer" v-for="(item,index) in idArr">
|
|
7
7
|
<canvas :id="item"></canvas>
|
|
8
8
|
<div class="pdfPage">{{ index + 1 }}/{{ pdfPages }}</div>
|
|
@@ -35,7 +35,7 @@ import '@vue-office/docx/lib/index.css'
|
|
|
35
35
|
import '@vue-office/excel/lib/index.css'
|
|
36
36
|
|
|
37
37
|
import Mess from '../../tipBox/index'
|
|
38
|
-
|
|
38
|
+
let pdfs = null
|
|
39
39
|
export default {
|
|
40
40
|
name: "zydx-read",
|
|
41
41
|
components: {VueOfficeDocx,VueOfficeExcel},
|
|
@@ -54,7 +54,8 @@ export default {
|
|
|
54
54
|
pdf: null,
|
|
55
55
|
page: 0,
|
|
56
56
|
xlsx: true,
|
|
57
|
-
canvasArr: []
|
|
57
|
+
canvasArr: [],
|
|
58
|
+
pageIndex: 0
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
props: {
|
|
@@ -148,10 +149,11 @@ export default {
|
|
|
148
149
|
cMapPacked: true
|
|
149
150
|
})
|
|
150
151
|
loadingTask.promise.then((pdf) => {
|
|
151
|
-
|
|
152
|
+
pdfs = pdf
|
|
152
153
|
that.pdfPages = pdf.numPages // 获取pdf文件的总页数
|
|
153
154
|
that.page = pdf.numPages
|
|
154
|
-
that.
|
|
155
|
+
that.pageIndex = that.page > 1? 2:1
|
|
156
|
+
that.getPDF(pdf,that.pageIndex)
|
|
155
157
|
}).catch(() => {
|
|
156
158
|
that.loading = false
|
|
157
159
|
Mess({
|
|
@@ -160,12 +162,29 @@ export default {
|
|
|
160
162
|
})
|
|
161
163
|
})
|
|
162
164
|
},
|
|
165
|
+
scroll(e) {
|
|
166
|
+
const dom = e.target
|
|
167
|
+
var scrollTop = dom.scrollTop; //滑入屏幕上方的高度
|
|
168
|
+
var windowHeitht = dom.clientHeight; //能看到的页面的高度
|
|
169
|
+
var scrollHeight = dom.scrollHeight; //监控的整个div的高度(包括现在看到的和上下隐藏起来看不到的)
|
|
170
|
+
let total = scrollTop + windowHeitht
|
|
171
|
+
if(total === scrollHeight){
|
|
172
|
+
if(this.pageIndex >= this.page) return
|
|
173
|
+
if((this.page - this.pageIndex) > 2) {
|
|
174
|
+
this.pageIndex += 2
|
|
175
|
+
this.getPDF(pdfs,2)
|
|
176
|
+
}else {
|
|
177
|
+
this.pageIndex += 1
|
|
178
|
+
this.getPDF(pdfs,1)
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
163
182
|
getPDF(pdf,page) {
|
|
164
183
|
let that = this
|
|
165
184
|
for (let i = 0; i < page; i++) {
|
|
166
185
|
const id = 'canvas' + Math.random().toString(36).substr(2)
|
|
167
186
|
that.idArr.push(id)
|
|
168
|
-
pdf.getPage(
|
|
187
|
+
pdf.getPage(this.pageIndex === 1? 1:this.pageIndex + i - 1).then(function (page) {
|
|
169
188
|
let canvas = document.getElementById(id)
|
|
170
189
|
that.canvasArr.push(canvas)
|
|
171
190
|
let ctx = canvas.getContext('2d');
|