zydx-plus 1.35.553 → 1.35.555
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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<drag-popup
|
|
4
4
|
v-if='modelValue'
|
|
5
5
|
ref="dragPopup"
|
|
6
|
+
class='popup_chat'
|
|
6
7
|
:title="title"
|
|
7
8
|
:width="960"
|
|
8
9
|
:height="400"
|
|
@@ -340,7 +341,7 @@ export default {
|
|
|
340
341
|
url: '/zydx/voice/getBaiduToken',
|
|
341
342
|
method: 'post',
|
|
342
343
|
headers: {
|
|
343
|
-
'Authorization': localStorage.getItem('sessionId'),
|
|
344
|
+
'Authorization': localStorage.getItem('sessionId') || sessionStorage.getItem('sessionId'),
|
|
344
345
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
345
346
|
},
|
|
346
347
|
params: {
|
|
@@ -363,6 +364,10 @@ export default {
|
|
|
363
364
|
</script>
|
|
364
365
|
|
|
365
366
|
<style scoped>
|
|
367
|
+
/* 避免AI助手弹出层级小于全局弹窗 */
|
|
368
|
+
.popup_chat{
|
|
369
|
+
z-index: 10001;
|
|
370
|
+
}
|
|
366
371
|
.disabled{
|
|
367
372
|
opacity: 0.5;
|
|
368
373
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div ref="only" :class="`z-editor z-editor-${refSrc}`"
|
|
3
|
-
:style="!readOnly&&showBorder?'border:
|
|
3
|
+
:style="[!readOnly&&showBorder?'border:1px solid rgba(204, 204, 204, 1);':'',readOnly?'overflow-y:auto;':'']">
|
|
4
4
|
<div v-show="!readOnly" class="editor-header">
|
|
5
5
|
<div v-for="(item,index) in butData" :key="index" class="editor-but">
|
|
6
6
|
<div v-if="uploadTypeArr.indexOf(item.key) !== -1" class="editor-but-name">
|
|
@@ -873,7 +873,8 @@ export default {
|
|
|
873
873
|
headers: {
|
|
874
874
|
Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
|
|
875
875
|
},
|
|
876
|
-
server: '/zydx/lessonResource/editOfficeFile',
|
|
876
|
+
server: '/zydx/open/function/lessonResource/editOfficeFile',
|
|
877
|
+
// server: '/zydx/lessonResource/editOfficeFile',
|
|
877
878
|
}
|
|
878
879
|
}
|
|
879
880
|
},
|
|
@@ -2008,6 +2009,7 @@ export default {
|
|
|
2008
2009
|
enlSee() {
|
|
2009
2010
|
this.$emit('enlSee', this.encIndex)
|
|
2010
2011
|
let id = this.encIndex.signId.split('u-').join('')
|
|
2012
|
+
console.log('interpositionData',this.interpositionData);
|
|
2011
2013
|
this.interpositionData.forEach(item => {
|
|
2012
2014
|
if (item.id === id) {
|
|
2013
2015
|
item.isShow = true
|
|
@@ -2587,6 +2589,7 @@ export default {
|
|
|
2587
2589
|
fileName: name,
|
|
2588
2590
|
url: url
|
|
2589
2591
|
}
|
|
2592
|
+
console.log('11111',dataInfo)
|
|
2590
2593
|
//linkCourseware
|
|
2591
2594
|
if (v === 'linkCourseware') {
|
|
2592
2595
|
let officeInfo = this.getOffice
|
|
@@ -3014,6 +3017,8 @@ export default {
|
|
|
3014
3017
|
},
|
|
3015
3018
|
|
|
3016
3019
|
async butTap(data, key, childKey) {
|
|
3020
|
+
// 标志
|
|
3021
|
+
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
3017
3022
|
if (!key.key) return
|
|
3018
3023
|
// 切换版式
|
|
3019
3024
|
if (data.key === 'switchingFormat') {
|
|
@@ -3242,8 +3247,6 @@ export default {
|
|
|
3242
3247
|
// }
|
|
3243
3248
|
}*/
|
|
3244
3249
|
}
|
|
3245
|
-
// 标志
|
|
3246
|
-
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
3247
3250
|
// 红头文件
|
|
3248
3251
|
if (data.key === 'redMenu') {
|
|
3249
3252
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
@@ -4413,7 +4416,7 @@ export default {
|
|
|
4413
4416
|
|
|
4414
4417
|
.read-only {
|
|
4415
4418
|
position: relative;
|
|
4416
|
-
margin:
|
|
4419
|
+
margin: 8px auto;
|
|
4417
4420
|
display: flex;
|
|
4418
4421
|
flex-direction: column;
|
|
4419
4422
|
align-items: center;
|
|
@@ -4602,9 +4605,9 @@ li {
|
|
|
4602
4605
|
.z-editor {
|
|
4603
4606
|
position: relative;
|
|
4604
4607
|
width: 100%;
|
|
4605
|
-
max-height:
|
|
4606
|
-
overflow-y: auto;
|
|
4608
|
+
max-height: 952px;
|
|
4607
4609
|
scrollbar-width: none;
|
|
4610
|
+
overflow: hidden;
|
|
4608
4611
|
}
|
|
4609
4612
|
|
|
4610
4613
|
.editor-header {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
:style="{color: (voiceStatus)? '#4B0C77' :'#000'}">{{ voiceStatus ? '关闭语音' : '语音输入' }}
|
|
27
27
|
</button>
|
|
28
28
|
<button v-if='isShowAiTool' class="buts" @click="showAi">AI助手</button>
|
|
29
|
+
<button v-if="butText !== '' && readOnly" class="buts" @click="complete">{{ butText }}</button>
|
|
29
30
|
<slot name='toolBtn'></slot>
|
|
30
31
|
</div>
|
|
31
32
|
</div>
|
|
@@ -85,9 +86,9 @@
|
|
|
85
86
|
<svg style="cursor: pointer" @click="close" t="1698630749910" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4415" width="20" height="20"><path d="M726.976 274.432a16 16 0 0 0-22.656 0L512 466.752l-192.32-192.32a16 16 0 0 0-22.624 0l-22.656 22.624a16 16 0 0 0 0 22.624l192.32 192.32-192.32 192.32a16 16 0 0 0 0 22.656l22.656 22.624a16 16 0 0 0 22.624 0l192.32-192.32 192.32 192.32a16 16 0 0 0 22.656 0l22.624-22.624a16 16 0 0 0 0-22.624L557.28 512l192.32-192.352a16 16 0 0 0 0-22.624l-22.624-22.624z" fill="#fff" p-id="4416"></path></svg>
|
|
86
87
|
</div>
|
|
87
88
|
</div>
|
|
88
|
-
<div class="editor-but" v-if="butText !== '' && readOnly"
|
|
89
|
-
<button class="buts" @click="complete">{{ butText }}</button
|
|
90
|
-
</div
|
|
89
|
+
<!-- <div class="editor-but" v-if="butText !== '' && readOnly">-->
|
|
90
|
+
<!-- <button class="buts" @click="complete">{{ butText }}</button>-->
|
|
91
|
+
<!-- </div>-->
|
|
91
92
|
<div class="enclosure" v-if="uploadAttData.length > 0 && enclosureShow">
|
|
92
93
|
<p :style="enclosureStyle">{{ enclosureText }}</p>
|
|
93
94
|
<div class="enclosure-list" v-for="(item,index) in uploadAttData">
|
|
@@ -9,7 +9,6 @@ import {createRoot} from 'react-dom/client'
|
|
|
9
9
|
import {AssetRecordType,createShapeId, Tldraw} from 'tldraw'
|
|
10
10
|
import 'tldraw/tldraw.css'
|
|
11
11
|
import * as buffer from "buffer";
|
|
12
|
-
import {debounce} from "../../utils"; //引入buffer
|
|
13
12
|
|
|
14
13
|
if (typeof window.Buffer === "undefined") { // 判断当前环境是否有Buffer对象
|
|
15
14
|
window.Buffer = buffer.Buffer; // Buffer对象不存在则创建导入的buffer
|
|
@@ -80,6 +79,8 @@ export default {
|
|
|
80
79
|
name: "zydx-sketchpad",
|
|
81
80
|
data() {
|
|
82
81
|
return {
|
|
82
|
+
shapeArr:[],
|
|
83
|
+
interval:null
|
|
83
84
|
// editor: null
|
|
84
85
|
}
|
|
85
86
|
},
|
|
@@ -154,13 +155,23 @@ export default {
|
|
|
154
155
|
},
|
|
155
156
|
handleMountedEditor(editor) {
|
|
156
157
|
editorAPP = editor
|
|
157
|
-
editorAPP.sideEffects.registerAfterChangeHandler('shape',
|
|
158
|
+
editorAPP.sideEffects.registerAfterChangeHandler('shape', (prev, next)=> {
|
|
158
159
|
// there can only be one red shape at a time:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
let typeArr = ["note","text"]
|
|
161
|
+
this.$emit('shapeChangeHandler',typeArr.indexOf(prev.type) !==-1? next : prev);
|
|
162
|
+
})
|
|
163
|
+
editorAPP.sideEffects.registerAfterDeleteHandler('shape', (shape, source) => {
|
|
164
|
+
// if the last shape in a frame is deleted, delete the frame too:\
|
|
165
|
+
this.shapeArr.push(shape)
|
|
166
|
+
if(this.shapeArr.length > 0){
|
|
167
|
+
this.interval = setInterval(() => {
|
|
168
|
+
this.$emit('shapeDeleteHandler', this.shapeArr.shift());
|
|
169
|
+
},300)
|
|
170
|
+
}else {
|
|
171
|
+
if(this.interval){
|
|
172
|
+
clearInterval(this.interval)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
164
175
|
})
|
|
165
176
|
editorAPP.setCameraOptions({ isLocked: this.cameraIsLocked })
|
|
166
177
|
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
@@ -193,7 +204,20 @@ export default {
|
|
|
193
204
|
},
|
|
194
205
|
//
|
|
195
206
|
editorCreateShape(myShape){
|
|
196
|
-
editorAPP?.
|
|
207
|
+
let shape = editorAPP?.getShape(myShape.id)
|
|
208
|
+
myShape = JSON.parse(JSON.stringify(myShape))
|
|
209
|
+
if(shape){
|
|
210
|
+
shape = JSON.parse(JSON.stringify(shape))
|
|
211
|
+
if(shape.type==="draw"){
|
|
212
|
+
shape.props.segments[0].points.push(myShape.props.segments[0].points.at(-1))
|
|
213
|
+
}else {
|
|
214
|
+
shape = myShape
|
|
215
|
+
}
|
|
216
|
+
editorAPP?.updateShape(shape)
|
|
217
|
+
}else {
|
|
218
|
+
editorAPP?.createShape(myShape)
|
|
219
|
+
|
|
220
|
+
}
|
|
197
221
|
},
|
|
198
222
|
editorDeleteShape(shapeId){
|
|
199
223
|
editorAPP?.deleteShape(shapeId)
|
|
@@ -420,35 +444,69 @@ export default {
|
|
|
420
444
|
editorAPP.setCurrentTool('highlight')
|
|
421
445
|
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
422
446
|
},
|
|
423
|
-
insertPicture(img) {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
447
|
+
insertPicture(img, type) {
|
|
448
|
+
if(type){
|
|
449
|
+
editorAPP.createAssets([{...img.asset}])
|
|
450
|
+
editorAPP.createShape({...img.img})
|
|
451
|
+
}else {
|
|
452
|
+
const assetId = AssetRecordType.createId()
|
|
453
|
+
editorAPP.createAssets([{
|
|
454
|
+
id: assetId,
|
|
455
|
+
type: 'image',
|
|
456
|
+
typeName: 'asset',
|
|
457
|
+
meta: {},
|
|
458
|
+
props: {
|
|
459
|
+
w: img.width,
|
|
460
|
+
h: img.height,
|
|
461
|
+
name: 'image',
|
|
462
|
+
src: img.src,
|
|
463
|
+
mimeType: 'image/*',
|
|
464
|
+
isAnimated: false,
|
|
465
|
+
}
|
|
466
|
+
}])
|
|
467
|
+
const imageId = createShapeId()
|
|
468
|
+
editorAPP.createShape({
|
|
469
|
+
id: imageId,
|
|
470
|
+
type: 'image',
|
|
471
|
+
x: 200,
|
|
472
|
+
y: 200,
|
|
473
|
+
isLocked: false,
|
|
474
|
+
props: {
|
|
475
|
+
w: img.width,
|
|
476
|
+
h: img.height,
|
|
477
|
+
assetId
|
|
478
|
+
},
|
|
479
|
+
})
|
|
480
|
+
let imgObj = {
|
|
481
|
+
asset:{
|
|
482
|
+
id: assetId,
|
|
483
|
+
type: 'image',
|
|
484
|
+
typeName: 'asset',
|
|
485
|
+
meta: {},
|
|
486
|
+
props: {
|
|
487
|
+
w: img.width,
|
|
488
|
+
h: img.height,
|
|
489
|
+
name: 'image',
|
|
490
|
+
src: img.src,
|
|
491
|
+
mimeType: 'image/*',
|
|
492
|
+
isAnimated: false,
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
img:{
|
|
496
|
+
id: imageId,
|
|
497
|
+
type: 'image',
|
|
498
|
+
x: 200,
|
|
499
|
+
y: 200,
|
|
500
|
+
isLocked: false,
|
|
501
|
+
props: {
|
|
502
|
+
w: img.width,
|
|
503
|
+
h: img.height,
|
|
504
|
+
assetId
|
|
505
|
+
},
|
|
506
|
+
}
|
|
437
507
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
editorAPP.createShape({
|
|
441
|
-
id: imageId,
|
|
442
|
-
type: 'image',
|
|
443
|
-
x: 200,
|
|
444
|
-
y: 200,
|
|
445
|
-
isLocked: false,
|
|
446
|
-
props: {
|
|
447
|
-
w: img.width,
|
|
448
|
-
h: img.height,
|
|
449
|
-
assetId
|
|
450
|
-
},
|
|
451
|
-
})
|
|
508
|
+
this.$emit('insertPicture',imgObj);
|
|
509
|
+
}
|
|
452
510
|
|
|
453
511
|
},
|
|
454
512
|
laser() {
|