zydx-plus 1.35.522 → 1.35.524
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 +1 -1
- package/src/components/dragPopup/src/dragPopup.vue +1 -0
- package/src/components/dragPopup2/src/dragPopup.vue +1 -0
- package/src/components/editor/src/butJson.js +8 -8
- package/src/components/editor/src/editor.vue +216 -42
- package/src/components/sketchpad/src/sketchpad.vue +41 -2
- package/src/components/tipBox/src/main.vue +35 -3
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -282,6 +282,7 @@ export default {
|
|
|
282
282
|
this.clientHeight = document.documentElement.clientHeight;
|
|
283
283
|
this.x = this.clientWidth / 2 - this.footRightOffset / 2;
|
|
284
284
|
this.y = this.clientHeight / 2 - this.footDownOffset / 2;
|
|
285
|
+
this.y=isNaN(this.y)?100:this.y
|
|
285
286
|
}
|
|
286
287
|
setTimeout(() => {
|
|
287
288
|
interact(`#draggable${that.id}`).draggable({
|
|
@@ -291,6 +291,7 @@ export default {
|
|
|
291
291
|
this.clientHeight = document.documentElement.clientHeight;
|
|
292
292
|
this.x = this.clientWidth / 2 - this.footRightOffset / 2;
|
|
293
293
|
this.y = this.clientHeight / 2 - this.footDownOffset / 2;
|
|
294
|
+
this.y=isNaN(this.y)?100:this.y
|
|
294
295
|
}
|
|
295
296
|
setTimeout(() => {
|
|
296
297
|
interact(`#draggable${that.id}`).draggable({
|
|
@@ -28,7 +28,7 @@ export function butJson(editor, data) {
|
|
|
28
28
|
key: 'switchingFormat',
|
|
29
29
|
menuKeys: [
|
|
30
30
|
{
|
|
31
|
-
name: '
|
|
31
|
+
name: '自由版式',
|
|
32
32
|
key: 'freeTypesetting',
|
|
33
33
|
menuKeys: [],
|
|
34
34
|
html: ''
|
|
@@ -37,22 +37,22 @@ export function butJson(editor, data) {
|
|
|
37
37
|
name: '图书版式',
|
|
38
38
|
key: 'bookLayout',
|
|
39
39
|
menuKeys: [],
|
|
40
|
-
html: `<p data-signid="
|
|
40
|
+
html: `<p data-signid="title-1" class="title bookLayout1" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color:#000;line-height: 1;">请在此处输入一级标题</span></strong></p>
|
|
41
41
|
<p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
42
|
-
<p data-signid="title-
|
|
42
|
+
<p data-signid="title-2" style="text-align: center;" class="title ${randomId()} bookLayout2"><strong><span style="font-size: 20px; font-family: SimHei; color:#000">一、请在此处输入一级标题</span></strong></p>
|
|
43
43
|
<p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
44
|
-
<p data-signid="title-
|
|
44
|
+
<p data-signid="title-3" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#000">(一)请在此处输入二级标题</span></strong></p>
|
|
45
45
|
<p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>`
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
name: '公文版式',
|
|
49
49
|
key: 'officialDocumentFormat',
|
|
50
50
|
menuKeys: [],
|
|
51
|
-
html: `<p style="text-align: center"><span style="font-size:
|
|
51
|
+
html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
|
|
52
52
|
<p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
|
|
53
53
|
<p contenteditable="false" class="solid"></p>
|
|
54
54
|
<p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color:#333333;line-height: 1;">请在此处输入标题</span></strong></p>
|
|
55
|
-
<p data-signid="lookUp"><strong><span style="font-size:
|
|
55
|
+
<p data-signid="lookUp"><strong><span style="font-size: 18px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
|
|
56
56
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
57
57
|
<p data-signid="title-1" style="text-align: center;" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
|
|
58
58
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
@@ -135,7 +135,7 @@ export function butJson(editor, data) {
|
|
|
135
135
|
name: '抬 头',
|
|
136
136
|
key: 'lookUp',
|
|
137
137
|
menuKeys: [],
|
|
138
|
-
html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size:
|
|
138
|
+
html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size: 18px; font-family:SimHei;font-weight: 700;">请在此处输入抬头:</span><span> </span></p>`
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
141
|
name: '摘 要',
|
|
@@ -231,7 +231,7 @@ export function butJson(editor, data) {
|
|
|
231
231
|
name: '红 头',
|
|
232
232
|
key: 'redMenu',
|
|
233
233
|
menuKeys: [],
|
|
234
|
-
html: `<p style="text-align: center"><span style="font-size:
|
|
234
|
+
html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p><p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>`
|
|
235
235
|
},
|
|
236
236
|
firstLevelHeading: {
|
|
237
237
|
name: '一级标题',
|
|
@@ -387,13 +387,32 @@
|
|
|
387
387
|
<!-- 展示弹窗 -->
|
|
388
388
|
<div v-for="(item,index) in interpositionData" :key="index">
|
|
389
389
|
<zydx-drag-popup v-if="item.isShow" :drag-text-show="false" :enlargeShow="false" :minHeight="183"
|
|
390
|
-
:minWidth="['importWorks', 'linkCourseware', 'importArticles', 'videoLink'].indexOf(item.type) === -1 ? 640 :905"
|
|
390
|
+
:minWidth="['importWorks', 'linkCourseware', 'importArticles', 'videoLink','group-upload'].indexOf(item.type) === -1 ? 640 :905"
|
|
391
391
|
:minimize="false" :minimizeCir="false"
|
|
392
|
-
:title="titleDragPopup[item.type]?titleDragPopup[item.type]
|
|
393
|
-
:width="['importWorks', 'linkCourseware', 'importArticles', 'videoLink'].indexOf(item.type) === -1 ? 640 :905"
|
|
394
|
-
height
|
|
392
|
+
:title="titleDragPopup[item.type]?titleDragPopup[item.type]:`参考文献`"
|
|
393
|
+
:width="['importWorks', 'linkCourseware', 'importArticles', 'videoLink','group-upload'].indexOf(item.type) === -1 ? 640 :905"
|
|
394
|
+
auto-height
|
|
395
395
|
@close="closeDataShowPopup(item)">
|
|
396
396
|
<template #content>
|
|
397
|
+
<div v-if="item.type === 'group-upload'" style="padding: 5px 10px 10px 10px;height: 100%;">
|
|
398
|
+
<div class="p-popup-title-box">
|
|
399
|
+
<span class="p-popup-title-name">文章内容</span>
|
|
400
|
+
<div v-if="!readOnly" class="tip-btnBox" style="margin: 0">
|
|
401
|
+
<div class="tip-btn" style="margin-right: 0" @click="delAnnotatedLiterature(item.id,item.type)"
|
|
402
|
+
v-html="'删除'"></div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
<div class="tip-box" style="min-width:600px;max-height: 900px;">
|
|
406
|
+
<div class="tip-title" v-html="`${item.fileName}`"></div>
|
|
407
|
+
<div class="tip-boxContent" style="height: 700px;">
|
|
408
|
+
<zydx-read :url="item.url" style="height: 100%"></zydx-read>
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
<div style="display: flex;flex-direction: row;justify-content: flex-end;margin-top: 10px;">
|
|
412
|
+
<div class="tip-btn" @click="item.isShow=false" v-html="`关闭`"></div>
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
|
|
397
416
|
<div v-if="item.type === 'taggingMenu'" style="padding: 5px 10px 10px 10px">
|
|
398
417
|
<div class="p-popup-title-box">
|
|
399
418
|
<span class="p-popup-title-name">注释内容</span>
|
|
@@ -455,7 +474,7 @@
|
|
|
455
474
|
v-html="'删除'"></div>
|
|
456
475
|
</div>
|
|
457
476
|
</div>
|
|
458
|
-
<div class="tip-box" style="min-width:600px;">
|
|
477
|
+
<div class="tip-box" style="min-width:600px;max-height: 900px;">
|
|
459
478
|
<div class="tip-title" v-html="`${item.exegesis}`"></div>
|
|
460
479
|
<div class="tip-boxContent">
|
|
461
480
|
<zydx-read :url="item.url" style="height: 100%"></zydx-read>
|
|
@@ -611,7 +630,7 @@ import zydxColoring from '../../coloring'
|
|
|
611
630
|
import Message from '../../../components/tipBox/index';
|
|
612
631
|
import zydxTextarea from '../../textarea'
|
|
613
632
|
import zydxRead from '../../read'
|
|
614
|
-
import zydxDragPopup from '../../
|
|
633
|
+
import zydxDragPopup from '../../dragPopup2'
|
|
615
634
|
import zydxSelect from '../../select'
|
|
616
635
|
import {exegesisId} from "./extend/exegesis-id";
|
|
617
636
|
import {html2json, json2html} from '../../utils/html2json.js'
|
|
@@ -685,7 +704,8 @@ export default {
|
|
|
685
704
|
importArticles: '链接文章',
|
|
686
705
|
importWorks: '链接著作',
|
|
687
706
|
videoLink: '链接视频',
|
|
688
|
-
linkCourseware: '链接课件'
|
|
707
|
+
linkCourseware: '链接课件',
|
|
708
|
+
'group-upload':'附件'
|
|
689
709
|
},
|
|
690
710
|
literature: ['periodical', 'dissertation', 'writings', 'newspaper', 'customize'],
|
|
691
711
|
literatureName: {
|
|
@@ -820,7 +840,7 @@ export default {
|
|
|
820
840
|
<p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
|
|
821
841
|
<p contenteditable="false" class="solid"></p>
|
|
822
842
|
<p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);line-height: 1;">请在此处输入标题</span></strong></p>
|
|
823
|
-
<p data-signid="lookUp"><strong><span style="font-size:
|
|
843
|
+
<p data-signid="lookUp"><strong><span style="font-size: 18px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
|
|
824
844
|
<p class="indent"><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
825
845
|
<p data-signid="title-1" class="title indent"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p>
|
|
826
846
|
<p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
@@ -1524,8 +1544,8 @@ export default {
|
|
|
1524
1544
|
const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
|
|
1525
1545
|
this.editor.chain().setContent(html).run()
|
|
1526
1546
|
this.toolbar = [
|
|
1527
|
-
'switchingFormat', 'signMenu', 'pageMargin', '
|
|
1528
|
-
'
|
|
1547
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'outlineMenu',
|
|
1548
|
+
'paragraphMenu', 'alignmentMode',
|
|
1529
1549
|
'titleMenu', 'color', 'interposition']
|
|
1530
1550
|
this.organizeButton()
|
|
1531
1551
|
this.interpositionData = []
|
|
@@ -1536,8 +1556,8 @@ export default {
|
|
|
1536
1556
|
const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
|
|
1537
1557
|
this.editor.chain().setContent(html).run()
|
|
1538
1558
|
this.toolbar = [
|
|
1539
|
-
'switchingFormat', 'signMenu', 'pageMargin', '
|
|
1540
|
-
'
|
|
1559
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'outlineMenu',
|
|
1560
|
+
'ackMenu', 'paragraphMenu', 'alignmentMode',
|
|
1541
1561
|
'titleMenu', 'color', 'interposition']
|
|
1542
1562
|
this.organizeButton()
|
|
1543
1563
|
this.interpositionData = []
|
|
@@ -2025,10 +2045,37 @@ export default {
|
|
|
2025
2045
|
// 下载附件
|
|
2026
2046
|
enlDownload() {
|
|
2027
2047
|
this.$emit('enlDownload', this.encIndex)
|
|
2048
|
+
const urlToBlob = (url) => {
|
|
2049
|
+
return fetch(url).then(response => response.blob())
|
|
2050
|
+
.then(blob => blob);
|
|
2051
|
+
}
|
|
2052
|
+
// file { fileName: '1.pdf', url: 'http://192.168.155.31:8888/group1/M00/03/1B/wKibH2bxL0SAepw4AADv47rruEo751.pdf' }
|
|
2053
|
+
const downloadOfBlob = (file) => {
|
|
2054
|
+
urlToBlob(file.dataUrl).then((blob) => {
|
|
2055
|
+
const href = window.URL.createObjectURL(blob)
|
|
2056
|
+
const downloadElement = document.createElement("a")
|
|
2057
|
+
downloadElement.href = href
|
|
2058
|
+
downloadElement.target = "_blank"
|
|
2059
|
+
downloadElement.download = file.dataName
|
|
2060
|
+
document.body.appendChild(downloadElement)
|
|
2061
|
+
downloadElement.click()
|
|
2062
|
+
document.body.removeChild(downloadElement)
|
|
2063
|
+
window.URL.revokeObjectURL(href)
|
|
2064
|
+
}).catch(error => {
|
|
2065
|
+
console.error('downloadOfBlob_error', error)
|
|
2066
|
+
})
|
|
2067
|
+
}
|
|
2068
|
+
downloadOfBlob(this.encIndex)
|
|
2028
2069
|
},
|
|
2029
2070
|
// 查看附件
|
|
2030
2071
|
enlSee() {
|
|
2031
2072
|
this.$emit('enlSee', this.encIndex)
|
|
2073
|
+
let id = this.encIndex.signId.split('u-').join('')
|
|
2074
|
+
this.interpositionData.forEach(item => {
|
|
2075
|
+
if (item.id === id) {
|
|
2076
|
+
item.isShow = true
|
|
2077
|
+
}
|
|
2078
|
+
})
|
|
2032
2079
|
},
|
|
2033
2080
|
// 删除附件
|
|
2034
2081
|
enlDel() {
|
|
@@ -2039,6 +2086,8 @@ export default {
|
|
|
2039
2086
|
const val = json.content[i].attrs?.signId
|
|
2040
2087
|
if (val === this.encIndex.signId) {
|
|
2041
2088
|
json.content.splice(i, 1)
|
|
2089
|
+
let id = val.split('u-').join('')
|
|
2090
|
+
this.interpositionData=this.interpositionData.filter(item=>item.id!==id)
|
|
2042
2091
|
this.editor?.commands.setContent(json)
|
|
2043
2092
|
break
|
|
2044
2093
|
}
|
|
@@ -2298,6 +2347,18 @@ export default {
|
|
|
2298
2347
|
top: `${e.clientY - only.top - 40}px`,
|
|
2299
2348
|
left: `${e.clientX - only.left - 60}px`
|
|
2300
2349
|
}
|
|
2350
|
+
this.encIndex = {
|
|
2351
|
+
borderBottom : "",
|
|
2352
|
+
cont: "false",
|
|
2353
|
+
dataUrl: p[i].dataset.url,
|
|
2354
|
+
dataName:e.target.innerText,
|
|
2355
|
+
exegesisId: null,
|
|
2356
|
+
lineHeightId: "indent mu",
|
|
2357
|
+
margin: '',
|
|
2358
|
+
signId: p[i].dataset.signid,
|
|
2359
|
+
textAlign: null,
|
|
2360
|
+
titleId: "indent mu"
|
|
2361
|
+
}
|
|
2301
2362
|
}
|
|
2302
2363
|
}
|
|
2303
2364
|
|
|
@@ -2623,11 +2684,21 @@ export default {
|
|
|
2623
2684
|
const t = await this.signIdData('enclosure')
|
|
2624
2685
|
const r = await this.signIdData('reference')
|
|
2625
2686
|
const html = butJson(this.editor, this.menusText)[v].html
|
|
2626
|
-
if (r === -1) {
|
|
2687
|
+
// if (r === -1) {
|
|
2627
2688
|
const last = this.editor.state.selection.$anchor.path[0].content.size
|
|
2689
|
+
const id = new Date().getTime()
|
|
2690
|
+
let dataInfo = {
|
|
2691
|
+
isShow: false,
|
|
2692
|
+
edit: false,
|
|
2693
|
+
id: `${id}`,
|
|
2694
|
+
type: v,
|
|
2695
|
+
exegesis: this.tipTitle,
|
|
2696
|
+
fileName: name,
|
|
2697
|
+
url: url
|
|
2698
|
+
}
|
|
2628
2699
|
if (t === -1) this.editor.chain().focus().insertContentAt(to, html).run()
|
|
2629
2700
|
const num = this.upSort(this.editor, 'enclosure')
|
|
2630
|
-
const html2 = `<p contenteditable="false" data-signId="u-${
|
|
2701
|
+
const html2 = `<p contenteditable="false" data-signId="u-${id}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
|
|
2631
2702
|
this.editor.chain().focus().insertContentAt(num.len, html2).run()
|
|
2632
2703
|
const json = this.editor.getJSON()
|
|
2633
2704
|
for (let i = 0; i < json.content.length; i++) {
|
|
@@ -2639,12 +2710,24 @@ export default {
|
|
|
2639
2710
|
this.editor.chain().setContent(<p></p>).run()
|
|
2640
2711
|
this.editor.chain().setContent(json).run()
|
|
2641
2712
|
this.isShowUpload = false
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2713
|
+
this.interpositionData.push(dataInfo)
|
|
2714
|
+
this.documentClick()
|
|
2715
|
+
// return
|
|
2716
|
+
// }
|
|
2717
|
+
/*const num1 = this.upSort(this.editor, 'reference')
|
|
2645
2718
|
if (t === -1) this.editor.chain().focus().insertContentAt(num1.len - 7, html).run()
|
|
2646
2719
|
const num = this.upSort(this.editor, 'enclosure')
|
|
2647
|
-
const
|
|
2720
|
+
const id = new Date().getTime()
|
|
2721
|
+
let dataInfo = {
|
|
2722
|
+
isShow: false,
|
|
2723
|
+
edit: false,
|
|
2724
|
+
id: `${id}`,
|
|
2725
|
+
type: v,
|
|
2726
|
+
exegesis: this.tipTitle,
|
|
2727
|
+
fileName: name,
|
|
2728
|
+
url: url
|
|
2729
|
+
}
|
|
2730
|
+
const html2 = `<p contenteditable="false" data-signId="u-${id}" data-url="${url}" class="indent mu"><span>${num.num}. ${name}</span></p>`
|
|
2648
2731
|
this.editor.chain().focus().insertContentAt(num.len, html2).run()
|
|
2649
2732
|
const json = this.editor.getJSON()
|
|
2650
2733
|
for (let i = 0; i < json.content.length; i++) {
|
|
@@ -2656,6 +2739,8 @@ export default {
|
|
|
2656
2739
|
this.editor.chain().setContent(<p></p>).run()
|
|
2657
2740
|
this.editor.chain().setContent(json).run()
|
|
2658
2741
|
this.isShowUpload = false
|
|
2742
|
+
this.interpositionData.push(dataInfo)
|
|
2743
|
+
this.documentClick()*/
|
|
2659
2744
|
})
|
|
2660
2745
|
}
|
|
2661
2746
|
if (v === 'uploadImage') {
|
|
@@ -2862,13 +2947,35 @@ export default {
|
|
|
2862
2947
|
this.toolbar.forEach(item => {
|
|
2863
2948
|
let obj = butJson(this.editor, this.menusText)[item.key === undefined ? item : item.key]
|
|
2864
2949
|
if (obj) {
|
|
2865
|
-
if (
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2950
|
+
if (obj.key === 'outlineMenu') {
|
|
2951
|
+
if(this.templateType === 'bookLayout'||this.templateType === 'freeTypesetting'){
|
|
2952
|
+
obj.menuKeys = [
|
|
2953
|
+
{name: '一级标题', key: 'title-1'},
|
|
2954
|
+
{name: '二级标题', key: 'title-2'},
|
|
2955
|
+
{name: '三级标题', key: 'title-3'},
|
|
2956
|
+
// {name: '四级标题', key: 'title-4'},
|
|
2957
|
+
{name: '正文文本', key: 'text'},]
|
|
2958
|
+
}
|
|
2959
|
+
if(this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
|
|
2960
|
+
obj.menuKeys = [
|
|
2961
|
+
{
|
|
2962
|
+
name: '文章标题',
|
|
2963
|
+
key: 'subjectMenu',
|
|
2964
|
+
menuKeys: [],
|
|
2965
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>`
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
name: '作者',
|
|
2969
|
+
key: 'authorMenu',
|
|
2970
|
+
menuKeys: [],
|
|
2971
|
+
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
|
|
2972
|
+
},
|
|
2973
|
+
{name: '一级标题', key: 'title-1'},
|
|
2974
|
+
{name: '二级标题', key: 'title-2'},
|
|
2975
|
+
// {name: '三级标题', key: 'title-3'},
|
|
2976
|
+
// {name: '四级标题', key: 'title-4'},
|
|
2977
|
+
{name: '正文文本', key: 'text'},]
|
|
2978
|
+
}
|
|
2872
2979
|
this.butData.push(obj)
|
|
2873
2980
|
return
|
|
2874
2981
|
}
|
|
@@ -3266,6 +3373,28 @@ export default {
|
|
|
3266
3373
|
// 大纲级别
|
|
3267
3374
|
if (data.key === 'outlineMenu') {
|
|
3268
3375
|
const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
|
|
3376
|
+
if (this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
|
|
3377
|
+
const level = key.key.split('-')[1]
|
|
3378
|
+
// 一级标题
|
|
3379
|
+
if (level === '1') {
|
|
3380
|
+
const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
|
|
3381
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3382
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3383
|
+
}
|
|
3384
|
+
// 二级标题
|
|
3385
|
+
if (level === '2') {
|
|
3386
|
+
const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
|
|
3387
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3388
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3389
|
+
}
|
|
3390
|
+
// 正文
|
|
3391
|
+
if (key.key === 'text') {
|
|
3392
|
+
const html = butJson(this.editor, this.menusText)['paragraphBody'].html
|
|
3393
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3394
|
+
}
|
|
3395
|
+
return
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3269
3398
|
// 题目
|
|
3270
3399
|
if (key.key === 'subjectMenu') {
|
|
3271
3400
|
const html = menusHtml.filter(item => item.key == key.key)[0].html
|
|
@@ -3296,6 +3425,27 @@ export default {
|
|
|
3296
3425
|
if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('subject'), html).run()
|
|
3297
3426
|
return
|
|
3298
3427
|
}
|
|
3428
|
+
let sizeObj1 = {
|
|
3429
|
+
freeTypesetting:{size:'18px',color:'#000000',margin:'0 0 20px 0',textAlign:'left',bold:true},
|
|
3430
|
+
bookLayout:{size:'24px',color:'#333333',margin:'0 0 40px 0',textAlign:'center',bold:true},
|
|
3431
|
+
paperFormat:{size:'20px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3432
|
+
officialDocumentFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3433
|
+
newsFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3434
|
+
}
|
|
3435
|
+
let sizeObj2 = {
|
|
3436
|
+
freeTypesetting:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3437
|
+
bookLayout:{size:'20px',color:'#000000',margin:'0 0 20px 0',textAlign:'center',bold:true},
|
|
3438
|
+
paperFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3439
|
+
officialDocumentFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3440
|
+
newsFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3441
|
+
}
|
|
3442
|
+
let sizeObj3 = {
|
|
3443
|
+
freeTypesetting:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3444
|
+
bookLayout:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3445
|
+
paperFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3446
|
+
officialDocumentFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3447
|
+
newsFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3448
|
+
}
|
|
3299
3449
|
if (key.key === 'text') {
|
|
3300
3450
|
this.editor.commands.setNode('paragraph', {class: 'indent'})
|
|
3301
3451
|
this.editor.commands.setTitleId(key.key)
|
|
@@ -3304,31 +3454,37 @@ export default {
|
|
|
3304
3454
|
} else {
|
|
3305
3455
|
const t = key.key.split('-')[0]
|
|
3306
3456
|
const level = key.key.split('-')[1]
|
|
3307
|
-
let size = this.templateType === 'bookLayout' ? '24px' : '18px'
|
|
3308
|
-
let color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
|
|
3309
3457
|
if (level === '1') {
|
|
3310
|
-
this.
|
|
3458
|
+
let obj1 = sizeObj1[this.templateType]
|
|
3459
|
+
// this.editor.commands.setNode('paragraph', {class:{}})
|
|
3311
3460
|
this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
|
|
3312
3461
|
this.editor.commands.setSignId(key.key)
|
|
3313
|
-
this.
|
|
3462
|
+
if(this.templateType==='bookLayout'){
|
|
3463
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()} bookLayout1`)
|
|
3464
|
+
this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).focus().run()
|
|
3465
|
+
return
|
|
3466
|
+
}
|
|
3467
|
+
if (obj1.margin==='0px'){
|
|
3468
|
+
this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).focus().run()
|
|
3469
|
+
return
|
|
3470
|
+
}
|
|
3471
|
+
this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).setMargin(obj1.margin).focus().run()
|
|
3314
3472
|
} else if (level === '2') {
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
let align = this.templateType === 'bookLayout' ? 'center' : 'left'
|
|
3473
|
+
this.editor.commands.setNode('paragraph', {class: ''})
|
|
3474
|
+
let obj2 = sizeObj2[this.templateType]
|
|
3318
3475
|
this.editor.commands.setSignId(key.key)
|
|
3319
3476
|
if (this.templateType === 'bookLayout') {
|
|
3320
|
-
this.editor.commands.
|
|
3321
|
-
this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
|
|
3477
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()} bookLayout2`)
|
|
3322
3478
|
} else {
|
|
3323
|
-
this.editor.commands.setTitleId(`${t} ${this.randomId()}
|
|
3479
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
|
|
3324
3480
|
}
|
|
3325
|
-
this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign(
|
|
3481
|
+
this.editor.chain().setBold().setFontSize(obj2.size).setColor(obj2.color).setTextAlign(obj2.textAlign).focus().run()
|
|
3326
3482
|
} else {
|
|
3327
|
-
|
|
3328
|
-
|
|
3483
|
+
this.editor.commands.setNode('paragraph', {class: ''})
|
|
3484
|
+
let obj3 = sizeObj3[this.templateType]
|
|
3329
3485
|
this.editor.commands.setSignId(key.key)
|
|
3330
|
-
this.editor.commands.setTitleId(`${t} ${this.randomId()}
|
|
3331
|
-
this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign(
|
|
3486
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
|
|
3487
|
+
this.editor.chain().setBold().setFontSize(obj3.size).setColor(obj3.color).setTextAlign(obj3.textAlign).focus().run()
|
|
3332
3488
|
}
|
|
3333
3489
|
}
|
|
3334
3490
|
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
@@ -4244,7 +4400,7 @@ export default {
|
|
|
4244
4400
|
}
|
|
4245
4401
|
|
|
4246
4402
|
:deep(p[data-signid="subject"]) {
|
|
4247
|
-
padding-bottom:
|
|
4403
|
+
padding-bottom: 2px;
|
|
4248
4404
|
}
|
|
4249
4405
|
|
|
4250
4406
|
:deep(.author) {
|
|
@@ -4474,6 +4630,7 @@ li {
|
|
|
4474
4630
|
margin: 10px;
|
|
4475
4631
|
max-height: 900px;
|
|
4476
4632
|
overflow: auto;
|
|
4633
|
+
border: 1px solid #ccc;
|
|
4477
4634
|
}
|
|
4478
4635
|
|
|
4479
4636
|
.editor-content::-webkit-scrollbar {
|
|
@@ -4506,7 +4663,7 @@ li {
|
|
|
4506
4663
|
position: relative;
|
|
4507
4664
|
display: flex;
|
|
4508
4665
|
align-items: center;
|
|
4509
|
-
border: 1px solid #CCCCCC
|
|
4666
|
+
/*border: 1px solid #CCCCCC;*/
|
|
4510
4667
|
}
|
|
4511
4668
|
|
|
4512
4669
|
.editing-cont {
|
|
@@ -4693,6 +4850,10 @@ li {
|
|
|
4693
4850
|
opacity: 0;
|
|
4694
4851
|
position: relative;
|
|
4695
4852
|
}
|
|
4853
|
+
.tip-boxContent::-webkit-scrollbar{
|
|
4854
|
+
width: 0;
|
|
4855
|
+
opacity: 0;
|
|
4856
|
+
}
|
|
4696
4857
|
|
|
4697
4858
|
.tip-title {
|
|
4698
4859
|
font-size: 16px;
|
|
@@ -4714,6 +4875,10 @@ li {
|
|
|
4714
4875
|
max-height: 700px;
|
|
4715
4876
|
}
|
|
4716
4877
|
|
|
4878
|
+
.tip-box>.tip-boxContent {
|
|
4879
|
+
height: 700px;
|
|
4880
|
+
}
|
|
4881
|
+
|
|
4717
4882
|
.tip-title {
|
|
4718
4883
|
margin-bottom: 20px;
|
|
4719
4884
|
font-size: 18px;
|
|
@@ -5050,4 +5215,13 @@ li {
|
|
|
5050
5215
|
* {
|
|
5051
5216
|
box-sizing: border-box;
|
|
5052
5217
|
}
|
|
5218
|
+
:deep(.drag-down2){
|
|
5219
|
+
height: 20px;
|
|
5220
|
+
}
|
|
5221
|
+
:deep(.bookLayout1){
|
|
5222
|
+
margin-bottom: 40px;
|
|
5223
|
+
}
|
|
5224
|
+
:deep(.bookLayout2){
|
|
5225
|
+
margin-bottom: 20px;
|
|
5226
|
+
}
|
|
5053
5227
|
</style>
|
|
@@ -95,6 +95,10 @@ export default {
|
|
|
95
95
|
type: Boolean,
|
|
96
96
|
default: false
|
|
97
97
|
},
|
|
98
|
+
isToolLocked: { // 菜单工具锁
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: true
|
|
101
|
+
},
|
|
98
102
|
},
|
|
99
103
|
mounted() {
|
|
100
104
|
// 鼠标移入
|
|
@@ -149,7 +153,9 @@ export default {
|
|
|
149
153
|
},
|
|
150
154
|
handleMountedEditor(editor) {
|
|
151
155
|
editorAPP = editor
|
|
156
|
+
console.log('editorAPP',editorAPP);
|
|
152
157
|
editorAPP._cameraOptions.current.isLocked = this.cameraIsLocked
|
|
158
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
153
159
|
if (this.top) {
|
|
154
160
|
setTimeout(() => {
|
|
155
161
|
document.documentElement.scrollTop = 0
|
|
@@ -167,8 +173,14 @@ export default {
|
|
|
167
173
|
},
|
|
168
174
|
// 清空
|
|
169
175
|
clear() {
|
|
170
|
-
editorAPP.store.loadSnapshot(clearJson)
|
|
171
|
-
|
|
176
|
+
// editorAPP.store.loadSnapshot(clearJson)
|
|
177
|
+
let graphicIds = []
|
|
178
|
+
for(let key in editorAPP.store.query.atoms.current) {
|
|
179
|
+
if(key.split(':')[0]==='shape') {
|
|
180
|
+
graphicIds.push(key)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
editorAPP.deleteShapes(graphicIds)
|
|
172
184
|
},
|
|
173
185
|
// 添加快照
|
|
174
186
|
setSnapshot(v) {
|
|
@@ -185,23 +197,29 @@ export default {
|
|
|
185
197
|
this.styleProps('draw', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
186
198
|
this.styleProps('draw', 'fill').defaultValue = v?.fill ?? 'none'
|
|
187
199
|
editorAPP.setCurrentTool('draw')
|
|
200
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
188
201
|
},
|
|
189
202
|
select() {
|
|
190
203
|
editorAPP.setCurrentTool('select')
|
|
204
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
191
205
|
},
|
|
192
206
|
hand() {
|
|
193
207
|
editorAPP.setCurrentTool('hand')
|
|
208
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
194
209
|
},
|
|
195
210
|
eraser() {
|
|
196
211
|
editorAPP.setCurrentTool('eraser')
|
|
212
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
197
213
|
},
|
|
198
214
|
arrow(v) {
|
|
199
215
|
// 'none', 'semi', 'solid', 'pattern'
|
|
216
|
+
console.log('arrowarrowarrowarrowarrow');
|
|
200
217
|
this.styleProps('arrow', 'color').defaultValue = v?.color ?? 'black'
|
|
201
218
|
this.styleProps('arrow', 'size').defaultValue = v?.size ?? 'm'
|
|
202
219
|
this.styleProps('arrow', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
203
220
|
this.styleProps('arrow', 'fill').defaultValue = v?.fill ?? 'none'
|
|
204
221
|
editorAPP.setCurrentTool('arrow')
|
|
222
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
205
223
|
},
|
|
206
224
|
text(v) {
|
|
207
225
|
this.styleProps('text', 'color').defaultValue = v?.color ?? 'black'
|
|
@@ -209,6 +227,7 @@ export default {
|
|
|
209
227
|
this.styleProps('text', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
|
|
210
228
|
// this.styleProps('text', 'align').defaultValue = v?.align ?? 'start'
|
|
211
229
|
editorAPP.setCurrentTool('text')
|
|
230
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
212
231
|
},
|
|
213
232
|
note(v) {
|
|
214
233
|
let verticalAlign = ['middle-legacy', 'start-legacy', 'end-legacy']
|
|
@@ -222,6 +241,7 @@ export default {
|
|
|
222
241
|
this.styleProps('note', 'size').defaultValue = v?.size ?? 'm'
|
|
223
242
|
this.styleProps('note', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
|
|
224
243
|
editorAPP.setCurrentTool('note')
|
|
244
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
225
245
|
},
|
|
226
246
|
line(v) {
|
|
227
247
|
this.styleProps('arrow', 'color').defaultValue = v?.color ?? 'black'
|
|
@@ -229,6 +249,7 @@ export default {
|
|
|
229
249
|
this.styleProps('arrow', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
230
250
|
this.styleProps('arrow', 'fill').defaultValue = v?.fill ?? 'none'
|
|
231
251
|
editorAPP.setCurrentTool('line')
|
|
252
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
232
253
|
},
|
|
233
254
|
rectangle(v) {
|
|
234
255
|
this.styleProps('geo', 'geo').defaultValue = 'rectangle'
|
|
@@ -237,6 +258,7 @@ export default {
|
|
|
237
258
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
238
259
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
239
260
|
editorAPP.setCurrentTool('geo')
|
|
261
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
240
262
|
},
|
|
241
263
|
ellipse(v) {
|
|
242
264
|
this.styleProps('geo', 'geo').defaultValue = 'ellipse'
|
|
@@ -245,6 +267,7 @@ export default {
|
|
|
245
267
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
246
268
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
247
269
|
editorAPP.setCurrentTool('geo')
|
|
270
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
248
271
|
},
|
|
249
272
|
triangle(v) {
|
|
250
273
|
this.styleProps('geo', 'geo').defaultValue = 'triangle'
|
|
@@ -253,6 +276,7 @@ export default {
|
|
|
253
276
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
254
277
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
255
278
|
editorAPP.setCurrentTool('geo')
|
|
279
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
256
280
|
},
|
|
257
281
|
|
|
258
282
|
rhombus(v) {
|
|
@@ -262,6 +286,7 @@ export default {
|
|
|
262
286
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
263
287
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
264
288
|
editorAPP.setCurrentTool('geo')
|
|
289
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
265
290
|
},
|
|
266
291
|
cloud(v) {
|
|
267
292
|
this.styleProps('geo', 'geo').defaultValue = 'cloud'
|
|
@@ -270,6 +295,7 @@ export default {
|
|
|
270
295
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
271
296
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
272
297
|
editorAPP.setCurrentTool('geo')
|
|
298
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
273
299
|
},
|
|
274
300
|
trapezoid(v) {
|
|
275
301
|
this.styleProps('geo', 'geo').defaultValue = 'trapezoid'
|
|
@@ -278,6 +304,7 @@ export default {
|
|
|
278
304
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
279
305
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
280
306
|
editorAPP.setCurrentTool('geo')
|
|
307
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
281
308
|
},
|
|
282
309
|
diamond(v) {
|
|
283
310
|
this.styleProps('geo', 'geo').defaultValue = 'diamond'
|
|
@@ -286,6 +313,7 @@ export default {
|
|
|
286
313
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
287
314
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
288
315
|
editorAPP.setCurrentTool('geo')
|
|
316
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
289
317
|
},
|
|
290
318
|
star(v) {
|
|
291
319
|
this.styleProps('geo', 'geo').defaultValue = 'star'
|
|
@@ -294,6 +322,7 @@ export default {
|
|
|
294
322
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
295
323
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
296
324
|
editorAPP.setCurrentTool('geo')
|
|
325
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
297
326
|
},
|
|
298
327
|
|
|
299
328
|
xBox(v) {
|
|
@@ -303,6 +332,7 @@ export default {
|
|
|
303
332
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
304
333
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
305
334
|
editorAPP.setCurrentTool('geo')
|
|
335
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
306
336
|
},
|
|
307
337
|
checkBox(v) {
|
|
308
338
|
this.styleProps('geo', 'geo').defaultValue = 'check-box'
|
|
@@ -311,6 +341,7 @@ export default {
|
|
|
311
341
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
312
342
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
313
343
|
editorAPP.setCurrentTool('geo')
|
|
344
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
314
345
|
},
|
|
315
346
|
oval(v) {
|
|
316
347
|
this.styleProps('geo', 'geo').defaultValue = 'oval'
|
|
@@ -319,6 +350,7 @@ export default {
|
|
|
319
350
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
320
351
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
321
352
|
editorAPP.setCurrentTool('geo')
|
|
353
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
322
354
|
},
|
|
323
355
|
arrowLeft(v) {
|
|
324
356
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-left'
|
|
@@ -327,6 +359,7 @@ export default {
|
|
|
327
359
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
328
360
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
329
361
|
editorAPP.setCurrentTool('geo')
|
|
362
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
330
363
|
},
|
|
331
364
|
arrowRight(v) {
|
|
332
365
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-right'
|
|
@@ -335,6 +368,7 @@ export default {
|
|
|
335
368
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
336
369
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
337
370
|
editorAPP.setCurrentTool('geo')
|
|
371
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
338
372
|
},
|
|
339
373
|
arrowUp(v) {
|
|
340
374
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-up'
|
|
@@ -343,6 +377,7 @@ export default {
|
|
|
343
377
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
344
378
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
345
379
|
editorAPP.setCurrentTool('geo')
|
|
380
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
346
381
|
},
|
|
347
382
|
arrowDown(v) {
|
|
348
383
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-down'
|
|
@@ -351,6 +386,7 @@ export default {
|
|
|
351
386
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
352
387
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
353
388
|
editorAPP.setCurrentTool('geo')
|
|
389
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
354
390
|
},
|
|
355
391
|
hexagon(v) {
|
|
356
392
|
this.styleProps('geo', 'geo').defaultValue = 'hexagon'
|
|
@@ -359,6 +395,7 @@ export default {
|
|
|
359
395
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
360
396
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
361
397
|
editorAPP.setCurrentTool('geo')
|
|
398
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
362
399
|
},
|
|
363
400
|
highlight(v) {
|
|
364
401
|
this.styleProps('geo', 'color').defaultValue = v?.color ?? 'black'
|
|
@@ -366,6 +403,7 @@ export default {
|
|
|
366
403
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
367
404
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
368
405
|
editorAPP.setCurrentTool('highlight')
|
|
406
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
369
407
|
},
|
|
370
408
|
insertPicture(img) {
|
|
371
409
|
const assetId = AssetRecordType.createId()
|
|
@@ -400,6 +438,7 @@ export default {
|
|
|
400
438
|
},
|
|
401
439
|
laser() {
|
|
402
440
|
editorAPP.setCurrentTool('laser')
|
|
441
|
+
editorAPP.updateInstanceState({ isToolLocked: this.isToolLocked })
|
|
403
442
|
},
|
|
404
443
|
undo() {
|
|
405
444
|
editorAPP.undo()
|
|
@@ -88,12 +88,18 @@
|
|
|
88
88
|
<div class="cal" v-if="item.type === 'calender'">
|
|
89
89
|
<input type="text" :placeholder="item.placeholder" @focus="focus" :maxlength="item.maxlength"
|
|
90
90
|
v-model="item.value" :disabled="item.disabled"/>
|
|
91
|
-
<
|
|
91
|
+
<div class="empty" @click="emptyCal($event,item)">
|
|
92
|
+
<svg t="1747276919145" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4844" width="15" height="15"><path d="M511.333 127.333c51.868 0 102.15 10.144 149.451 30.15 45.719 19.337 86.792 47.034 122.078 82.321 35.287 35.286 62.983 76.359 82.321 122.078 20.006 47.3 30.15 97.583 30.15 149.451s-10.144 102.15-30.15 149.451c-19.337 45.719-47.034 86.792-82.321 122.078-35.286 35.287-76.359 62.983-122.078 82.321-47.3 20.006-97.583 30.15-149.451 30.15s-102.15-10.144-149.451-30.15c-45.719-19.337-86.792-47.034-122.078-82.321-35.287-35.286-62.983-76.359-82.321-122.078-20.006-47.3-30.15-97.583-30.15-149.451s10.144-102.15 30.15-149.451c19.337-45.719 47.034-86.792 82.321-122.078 35.286-35.287 76.359-62.983 122.078-82.321 47.301-20.006 97.583-30.15 149.451-30.15m0-64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448z" fill="#999999" p-id="4845"></path><path d="M557.254 512l147.373-147.373c12.497-12.497 12.497-32.758 0-45.255-12.496-12.497-32.758-12.497-45.254 0L512 466.746 364.627 319.373c-12.497-12.497-32.758-12.497-45.255 0s-12.497 32.758 0 45.255L466.746 512 319.373 659.373c-12.497 12.496-12.497 32.758 0 45.254C325.621 710.876 333.811 714 342 714s16.379-3.124 22.627-9.373L512 557.254l147.373 147.373C665.621 710.876 673.811 714 682 714s16.379-3.124 22.627-9.373c12.497-12.496 12.497-32.758 0-45.254L557.254 512z" fill="#999999" p-id="4846"></path></svg>
|
|
93
|
+
</div>
|
|
94
|
+
<Calendar v-if="tip" style="top: 35px;" @cancel="cancelCal" @confirm="confirm($event,item)"></Calendar>
|
|
92
95
|
</div>
|
|
93
96
|
<div class="cal" v-if="item.type === 'calenderYear'">
|
|
94
97
|
<input type="text" :placeholder="item.placeholder" @focus="focusYear" :maxlength="item.maxlength"
|
|
95
98
|
v-model="item.value" :disabled="item.disabled"/>
|
|
96
|
-
<
|
|
99
|
+
<div class="empty" @click="emptyYear($event,item)">
|
|
100
|
+
<svg t="1747276919145" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4844" width="15" height="15"><path d="M511.333 127.333c51.868 0 102.15 10.144 149.451 30.15 45.719 19.337 86.792 47.034 122.078 82.321 35.287 35.286 62.983 76.359 82.321 122.078 20.006 47.3 30.15 97.583 30.15 149.451s-10.144 102.15-30.15 149.451c-19.337 45.719-47.034 86.792-82.321 122.078-35.286 35.287-76.359 62.983-122.078 82.321-47.3 20.006-97.583 30.15-149.451 30.15s-102.15-10.144-149.451-30.15c-45.719-19.337-86.792-47.034-122.078-82.321-35.287-35.286-62.983-76.359-82.321-122.078-20.006-47.3-30.15-97.583-30.15-149.451s10.144-102.15 30.15-149.451c19.337-45.719 47.034-86.792 82.321-122.078 35.286-35.287 76.359-62.983 122.078-82.321 47.301-20.006 97.583-30.15 149.451-30.15m0-64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448z" fill="#999999" p-id="4845"></path><path d="M557.254 512l147.373-147.373c12.497-12.497 12.497-32.758 0-45.255-12.496-12.497-32.758-12.497-45.254 0L512 466.746 364.627 319.373c-12.497-12.497-32.758-12.497-45.255 0s-12.497 32.758 0 45.255L466.746 512 319.373 659.373c-12.497 12.496-12.497 32.758 0 45.254C325.621 710.876 333.811 714 342 714s16.379-3.124 22.627-9.373L512 557.254l147.373 147.373C665.621 710.876 673.811 714 682 714s16.379-3.124 22.627-9.373c12.497-12.496 12.497-32.758 0-45.254L557.254 512z" fill="#999999" p-id="4846"></path></svg>
|
|
101
|
+
</div>
|
|
102
|
+
<Year v-if="tipYear" style="top: 35px;" @cancel="cancelYear" @confirm="confirmYear($event,item)"></Year>
|
|
97
103
|
</div>
|
|
98
104
|
<div v-if="item.type === 'text'" class="text" v-html="item.value"></div>
|
|
99
105
|
<div v-if="item.type === 'code'" class="ph-code">
|
|
@@ -335,18 +341,44 @@ export default {
|
|
|
335
341
|
data.value = e
|
|
336
342
|
this.tipYear = false
|
|
337
343
|
},
|
|
344
|
+
cancelYear() {
|
|
345
|
+
this.tipYear = false
|
|
346
|
+
},
|
|
338
347
|
focus() {
|
|
339
348
|
this.tip = true
|
|
340
349
|
},
|
|
341
350
|
confirm(e, data) {
|
|
342
351
|
data.value = e.start
|
|
343
352
|
this.tip = false
|
|
344
|
-
}
|
|
353
|
+
},
|
|
354
|
+
emptyCal(e,data) {
|
|
355
|
+
data.value = ''
|
|
356
|
+
this.tip = true
|
|
357
|
+
this.tip = false
|
|
358
|
+
},
|
|
359
|
+
emptyYear(e,data) {
|
|
360
|
+
data.value = ''
|
|
361
|
+
this.tip = true
|
|
362
|
+
this.tip = false
|
|
363
|
+
},
|
|
364
|
+
cancelCal() {
|
|
365
|
+
this.tip = false
|
|
366
|
+
},
|
|
345
367
|
}
|
|
346
368
|
}
|
|
347
369
|
</script>
|
|
348
370
|
|
|
349
371
|
<style scoped>
|
|
372
|
+
.cal{
|
|
373
|
+
position: relative;
|
|
374
|
+
}
|
|
375
|
+
.empty{
|
|
376
|
+
position: absolute;
|
|
377
|
+
top: 8px;
|
|
378
|
+
right: 5px;
|
|
379
|
+
z-index: 1;
|
|
380
|
+
cursor: pointer;
|
|
381
|
+
}
|
|
350
382
|
:deep(.text) {
|
|
351
383
|
padding:0 10px;
|
|
352
384
|
}
|