zydx-plus 1.35.553 → 1.35.554
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"
|
|
@@ -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">
|
|
@@ -3014,6 +3014,8 @@ export default {
|
|
|
3014
3014
|
},
|
|
3015
3015
|
|
|
3016
3016
|
async butTap(data, key, childKey) {
|
|
3017
|
+
// 标志
|
|
3018
|
+
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
3017
3019
|
if (!key.key) return
|
|
3018
3020
|
// 切换版式
|
|
3019
3021
|
if (data.key === 'switchingFormat') {
|
|
@@ -3242,8 +3244,6 @@ export default {
|
|
|
3242
3244
|
// }
|
|
3243
3245
|
}*/
|
|
3244
3246
|
}
|
|
3245
|
-
// 标志
|
|
3246
|
-
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
3247
3247
|
// 红头文件
|
|
3248
3248
|
if (data.key === 'redMenu') {
|
|
3249
3249
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
@@ -4413,7 +4413,7 @@ export default {
|
|
|
4413
4413
|
|
|
4414
4414
|
.read-only {
|
|
4415
4415
|
position: relative;
|
|
4416
|
-
margin:
|
|
4416
|
+
margin: 8px auto;
|
|
4417
4417
|
display: flex;
|
|
4418
4418
|
flex-direction: column;
|
|
4419
4419
|
align-items: center;
|
|
@@ -4602,9 +4602,9 @@ li {
|
|
|
4602
4602
|
.z-editor {
|
|
4603
4603
|
position: relative;
|
|
4604
4604
|
width: 100%;
|
|
4605
|
-
max-height:
|
|
4606
|
-
overflow-y: auto;
|
|
4605
|
+
max-height: 952px;
|
|
4607
4606
|
scrollbar-width: none;
|
|
4607
|
+
overflow: hidden;
|
|
4608
4608
|
}
|
|
4609
4609
|
|
|
4610
4610
|
.editor-header {
|
|
@@ -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() {
|