zydx-plus 1.35.529 → 1.35.530
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/calendar/src/Calendar.css +3 -0
- package/src/components/calendar/src/Calendar.vue +10 -6
- package/src/components/dragPopup/src/dragPopup.vue +7 -2
- package/src/components/dragPopup2/src/dragPopup.vue +10 -4
- package/src/components/editor/src/butJson.js +18 -12
- package/src/components/editor/src/editor.vue +73 -25
- package/src/components/menuTree/src/ZydxMenuTreeInfo.vue +63 -44
- package/src/components/variableBox/index.vue +30 -8
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<div class="cle-frame"></div>
|
|
61
61
|
<div class="cle-time-y">
|
|
62
62
|
<ul @scroll="scrollHour($event)">
|
|
63
|
-
<li v-for="(item,index) in 30"></li>
|
|
63
|
+
<li v-for="(item,index) in 30*4"></li>
|
|
64
64
|
</ul>
|
|
65
65
|
<div class="cle-time-li" :style="{transform: 'translateY('+ transHour +'px)'}">
|
|
66
66
|
<p v-for="(item,index) in 30" :class="{'cle-time-act': index === -(transHour/26)+3}">{{ (index > 2 && index < 27)? ((index - 3) < 10)? '0'+(index - 3): (index - 3) : '' }}</p>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
</div>
|
|
69
69
|
<div class="cle-time-y">
|
|
70
70
|
<ul @scroll="scrollMinute($event)">
|
|
71
|
-
<li v-for="(item,index) in 66"></li>
|
|
71
|
+
<li v-for="(item,index) in 66*4"></li>
|
|
72
72
|
</ul>
|
|
73
73
|
<div class="cle-time-li" :style="{transform: 'translateY('+ transMinute +'px)'}">
|
|
74
74
|
<p v-for="(item,index) in 66" :class="{'cle-time-act': index === -(transMinute/26)+3}">{{ (index > 2 && index < 63)? ((index - 3) < 10)? '0'+(index - 3): (index - 3) : '' }}</p>
|
|
@@ -78,8 +78,10 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
80
80
|
<div class="cle-but-right">
|
|
81
|
-
<
|
|
82
|
-
|
|
81
|
+
<div class="cle-but-right-cont">
|
|
82
|
+
<button class="cle-but" @click="cancel">取消</button>
|
|
83
|
+
<button class="cle-but" @click="confirm">确认</button>
|
|
84
|
+
</div>
|
|
83
85
|
</div>
|
|
84
86
|
</div>
|
|
85
87
|
</div>
|
|
@@ -248,15 +250,17 @@ export default {
|
|
|
248
250
|
this.cleFocusShow = true
|
|
249
251
|
},
|
|
250
252
|
scrollMinute(e) {
|
|
251
|
-
let top = e.target.scrollTop
|
|
253
|
+
let top = e.target.scrollTop/3.8
|
|
252
254
|
let index = Math.floor(top/26)
|
|
255
|
+
if(index > 59 || index < 0) return
|
|
253
256
|
this.transMinute = -(index * 26)
|
|
254
257
|
this.minute = (index < 10)? '0'+ index: index
|
|
255
258
|
this.cleDate = `${this.hour}:${this.minute}`
|
|
256
259
|
},
|
|
257
260
|
scrollHour(e) {
|
|
258
|
-
let top = e.target.scrollTop
|
|
261
|
+
let top = e.target.scrollTop/3.8
|
|
259
262
|
let index = Math.floor(top/26)
|
|
263
|
+
if(index > 23 || index < 0) return
|
|
260
264
|
this.transHour = -(index * 26)
|
|
261
265
|
this.hour = (index < 10)? '0'+ index: index
|
|
262
266
|
this.cleDate = `${this.hour}:${this.minute}`
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
<div :class="{'drag-cont2': fixedStart,'drag-conts': true}">
|
|
15
15
|
<div class="drag-cont-slot" :class="{'zIndexSlot': footIsMove}">
|
|
16
|
-
<div class="zIndexSlot" v-if="footIsMove"></div>
|
|
16
|
+
<div class="zIndexSlot" v-if="footIsMove || draggableMove"></div>
|
|
17
17
|
<slot name="content"></slot>
|
|
18
18
|
</div>
|
|
19
19
|
<div v-show="!fixedStart&&!autoHeight">
|
|
@@ -56,7 +56,8 @@ export default {
|
|
|
56
56
|
transAll: false,
|
|
57
57
|
fixedStart: false,
|
|
58
58
|
initWidth: 1280,
|
|
59
|
-
draggableState: null
|
|
59
|
+
draggableState: null,
|
|
60
|
+
draggableMove: false
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
props: {
|
|
@@ -316,6 +317,7 @@ export default {
|
|
|
316
317
|
enabled: true,
|
|
317
318
|
listeners: {
|
|
318
319
|
start (event) {
|
|
320
|
+
that.draggableMove = true
|
|
319
321
|
that.dragTap()
|
|
320
322
|
},
|
|
321
323
|
move (event) {
|
|
@@ -335,6 +337,9 @@ export default {
|
|
|
335
337
|
if (that.y > that.clientHeight - that.footDownOffset + that.footDownOffset / 2) {
|
|
336
338
|
that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
|
|
337
339
|
}
|
|
340
|
+
},
|
|
341
|
+
end (event) {
|
|
342
|
+
that.draggableMove = false
|
|
338
343
|
}
|
|
339
344
|
}
|
|
340
345
|
})
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
<div :class="{'drag-cont2': fixedStart,'drag-conts': true}">
|
|
16
16
|
<div class="drag-cont-slot">
|
|
17
|
-
<div class="zIndexSlot" v-if="footIsMove"></div>
|
|
17
|
+
<div class="zIndexSlot" v-if="footIsMove || draggableMove"></div>
|
|
18
18
|
<slot name="content"></slot>
|
|
19
19
|
</div>
|
|
20
20
|
<div v-show="!fixedStart&&!autoHeight">
|
|
@@ -57,7 +57,8 @@ export default {
|
|
|
57
57
|
transAll: false,
|
|
58
58
|
fixedStart: false,
|
|
59
59
|
initWidth: 1280,
|
|
60
|
-
draggableState: null
|
|
60
|
+
draggableState: null,
|
|
61
|
+
draggableMove: false
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
props: {
|
|
@@ -325,7 +326,12 @@ export default {
|
|
|
325
326
|
this.draggableState.draggable({
|
|
326
327
|
enabled: true,
|
|
327
328
|
listeners: {
|
|
329
|
+
start (event) {
|
|
330
|
+
that.draggableMove = true
|
|
331
|
+
that.dragTap()
|
|
332
|
+
},
|
|
328
333
|
move (event) {
|
|
334
|
+
console.log('移动')
|
|
329
335
|
// 获取滚动距离
|
|
330
336
|
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
331
337
|
that.y = event.rect.top - scrollTop
|
|
@@ -343,8 +349,8 @@ export default {
|
|
|
343
349
|
that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
|
|
344
350
|
}
|
|
345
351
|
},
|
|
346
|
-
|
|
347
|
-
|
|
352
|
+
end (event) {
|
|
353
|
+
that.draggableMove = false
|
|
348
354
|
}
|
|
349
355
|
}
|
|
350
356
|
})
|
|
@@ -54,9 +54,9 @@ export function butJson(editor, data) {
|
|
|
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
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
|
-
<p data-signid="title-1"
|
|
57
|
+
<p data-signid="title-1" 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>
|
|
59
|
-
<p data-signid="title-2" class="title ${randomId()}
|
|
59
|
+
<p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
|
|
60
60
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
61
61
|
<p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p>
|
|
62
62
|
<p data-signid="date" style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
@@ -66,11 +66,11 @@ export function butJson(editor, data) {
|
|
|
66
66
|
key: 'newsFormat',
|
|
67
67
|
menuKeys: [],
|
|
68
68
|
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>
|
|
69
|
-
<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size:
|
|
69
|
+
<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>
|
|
70
70
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
71
|
-
<p data-signid="title-1"
|
|
71
|
+
<p data-signid="title-1" class="title ${randomId()} "><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
|
|
72
72
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
73
|
-
<p data-signid="title-2" class="title ${randomId()}
|
|
73
|
+
<p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
|
|
74
74
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
75
75
|
<p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p>
|
|
76
76
|
<p data-signid="date" style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
|
|
@@ -80,13 +80,13 @@ export function butJson(editor, data) {
|
|
|
80
80
|
key: 'paperFormat',
|
|
81
81
|
menuKeys: [],
|
|
82
82
|
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入题目</span></strong></p>
|
|
83
|
-
<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size:
|
|
83
|
+
<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者</span></p>
|
|
84
84
|
<p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: FangSong; color: #333333;">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
|
|
85
85
|
<p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: FangSong; color: #333333">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
|
|
86
86
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
87
|
-
<p data-signid="title-1"
|
|
87
|
+
<p data-signid="title-1" class="title ${randomId()}"><strong><span style="font-size: 20px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
|
|
88
88
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
89
|
-
<p data-signid="title-2" class="title ${randomId()}
|
|
89
|
+
<p data-signid="title-2" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
|
|
90
90
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
|
|
91
91
|
<p data-signid="splitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
|
|
92
92
|
<p data-signid="annotation" contenteditable="false" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">注释</span></strong></p>
|
|
@@ -210,7 +210,7 @@ export function butJson(editor, data) {
|
|
|
210
210
|
name: '作者',
|
|
211
211
|
key: 'authorMenu',
|
|
212
212
|
menuKeys: [],
|
|
213
|
-
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size:
|
|
213
|
+
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
|
|
214
214
|
},
|
|
215
215
|
{name: '一级标题', key: 'title-1'},
|
|
216
216
|
{name: '二级标题', key: 'title-2'},
|
|
@@ -237,13 +237,19 @@ export function butJson(editor, data) {
|
|
|
237
237
|
name: '一级标题',
|
|
238
238
|
key: 'firstLevelHeading',
|
|
239
239
|
menuKeys: [],
|
|
240
|
-
html: `<p data-signid="title-1"
|
|
240
|
+
html: `<p data-signid="title-1" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
|
|
241
241
|
},
|
|
242
242
|
secondaryHeading: {
|
|
243
243
|
name: '二级标题',
|
|
244
244
|
key: 'secondaryHeading',
|
|
245
245
|
menuKeys: [],
|
|
246
|
-
html: `<p data-signid="title-2" class="title ${randomId()}
|
|
246
|
+
html: `<p data-signid="title-2" class="title ${randomId()}"><span style="font-size: 16px; font-family: SimHei; color:#333333">(二)请在此处输入二级标题</span></p>`
|
|
247
|
+
},
|
|
248
|
+
level3Heading: {
|
|
249
|
+
name: '三级标题',
|
|
250
|
+
key: 'level3Heading',
|
|
251
|
+
menuKeys: [],
|
|
252
|
+
html: `<p data-signid="title-3" class="title ${randomId()}"><span style="font-size: 16px; font-family: SimHei; color:#333333">(三)请在此处输入三级标题</span></p>`
|
|
247
253
|
},
|
|
248
254
|
paragraphBody: {
|
|
249
255
|
name: '正文文本',
|
|
@@ -326,7 +332,7 @@ export function butJson(editor, data) {
|
|
|
326
332
|
name: '作者',
|
|
327
333
|
key: 'authorMenu',
|
|
328
334
|
menuKeys: [],
|
|
329
|
-
html: `<p class="author" data-signId="author" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size:
|
|
335
|
+
html: `<p class="author" data-signId="author" style="text-align: center;"><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiT;">${menusData(data, 'authorMenu').text}</span></p>`
|
|
330
336
|
},
|
|
331
337
|
numberMenu: {
|
|
332
338
|
name: '参考编号',
|
|
@@ -1197,7 +1197,6 @@ export default {
|
|
|
1197
1197
|
this.limits = true
|
|
1198
1198
|
},
|
|
1199
1199
|
onUpdate: ({editor}) => {
|
|
1200
|
-
_this.$emit('changeOutlineMenu', _this.changeOutlineMenu())
|
|
1201
1200
|
editor.commands.focus()
|
|
1202
1201
|
const json = editor.getJSON()
|
|
1203
1202
|
for (let i = 0; i < json.content.length; i++) {
|
|
@@ -1251,6 +1250,7 @@ export default {
|
|
|
1251
1250
|
_this.interpositionData = []
|
|
1252
1251
|
}
|
|
1253
1252
|
}
|
|
1253
|
+
_this.$emit('changeOutlineMenu', _this.changeOutlineMenu())
|
|
1254
1254
|
},
|
|
1255
1255
|
onTransaction: () => {
|
|
1256
1256
|
const index = _this.editor.state.selection.$anchor.path[1]
|
|
@@ -2911,7 +2911,7 @@ export default {
|
|
|
2911
2911
|
// {name: '四级标题', key: 'title-4'},
|
|
2912
2912
|
{name: '正文文本', key: 'text'},]
|
|
2913
2913
|
}
|
|
2914
|
-
if(this.templateType === 'newsFormat'
|
|
2914
|
+
if(this.templateType === 'newsFormat'){
|
|
2915
2915
|
obj.menuKeys = [
|
|
2916
2916
|
{
|
|
2917
2917
|
name: '文章标题',
|
|
@@ -2923,13 +2923,32 @@ export default {
|
|
|
2923
2923
|
name: '作者',
|
|
2924
2924
|
key: 'authorMenu',
|
|
2925
2925
|
menuKeys: [],
|
|
2926
|
-
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size:
|
|
2926
|
+
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
|
|
2927
2927
|
},
|
|
2928
2928
|
{name: '一级标题', key: 'title-1'},
|
|
2929
2929
|
{name: '二级标题', key: 'title-2'},
|
|
2930
2930
|
// {name: '三级标题', key: 'title-3'},
|
|
2931
2931
|
// {name: '四级标题', key: 'title-4'},
|
|
2932
2932
|
{name: '正文文本', key: 'text'},]
|
|
2933
|
+
}else if(this.templateType === 'paperFormat'){
|
|
2934
|
+
obj.menuKeys = [
|
|
2935
|
+
{
|
|
2936
|
+
name: '文章标题',
|
|
2937
|
+
key: 'subjectMenu',
|
|
2938
|
+
menuKeys: [],
|
|
2939
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>`
|
|
2940
|
+
},
|
|
2941
|
+
{
|
|
2942
|
+
name: '作者',
|
|
2943
|
+
key: 'authorMenu',
|
|
2944
|
+
menuKeys: [],
|
|
2945
|
+
html: `<p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 12px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>`
|
|
2946
|
+
},
|
|
2947
|
+
{name: '一级标题', key: 'title-1'},
|
|
2948
|
+
{name: '二级标题', key: 'title-2'},
|
|
2949
|
+
{name: '三级标题', key: 'title-3'},
|
|
2950
|
+
// {name: '四级标题', key: 'title-4'},
|
|
2951
|
+
{name: '正文文本', key: 'text'},]
|
|
2933
2952
|
}
|
|
2934
2953
|
this.butData.push(obj)
|
|
2935
2954
|
return
|
|
@@ -3328,28 +3347,7 @@ export default {
|
|
|
3328
3347
|
// 大纲级别
|
|
3329
3348
|
if (data.key === 'outlineMenu') {
|
|
3330
3349
|
const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
|
|
3331
|
-
if (
|
|
3332
|
-
const level = key.key.split('-')[1]
|
|
3333
|
-
// 一级标题
|
|
3334
|
-
if (level === '1') {
|
|
3335
|
-
const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
|
|
3336
|
-
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3337
|
-
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3338
|
-
}
|
|
3339
|
-
// 二级标题
|
|
3340
|
-
if (level === '2') {
|
|
3341
|
-
const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
|
|
3342
|
-
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3343
|
-
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3344
|
-
}
|
|
3345
|
-
// 正文
|
|
3346
|
-
if (key.key === 'text') {
|
|
3347
|
-
const html = butJson(this.editor, this.menusText)['paragraphBody'].html
|
|
3348
|
-
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3349
|
-
}
|
|
3350
|
-
return
|
|
3351
|
-
}
|
|
3352
|
-
|
|
3350
|
+
if (!key.key)return
|
|
3353
3351
|
// 题目
|
|
3354
3352
|
if (key.key === 'subjectMenu') {
|
|
3355
3353
|
const html = menusHtml.filter(item => item.key == key.key)[0].html
|
|
@@ -3401,6 +3399,56 @@ export default {
|
|
|
3401
3399
|
officialDocumentFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3402
3400
|
newsFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
|
|
3403
3401
|
}
|
|
3402
|
+
|
|
3403
|
+
if (this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
|
|
3404
|
+
const level = key.key.split('-')[1]
|
|
3405
|
+
// 一级标题
|
|
3406
|
+
if (level === '1') {
|
|
3407
|
+
const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
|
|
3408
|
+
if(this.templateType === 'paperFormat'){
|
|
3409
|
+
const obj1 = sizeObj1[this.templateType]
|
|
3410
|
+
let from = this.selection()
|
|
3411
|
+
this.editor.chain().focus().insertContentAt(from, html).run()
|
|
3412
|
+
this.editor.chain().setTextSelection({ from: from, to: from+14 }).setFontSize(obj1.size).setTextSelection(from+14).run()
|
|
3413
|
+
}else {
|
|
3414
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3415
|
+
}
|
|
3416
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3417
|
+
}
|
|
3418
|
+
// 二级标题
|
|
3419
|
+
if (level === '2') {
|
|
3420
|
+
const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
|
|
3421
|
+
if(this.templateType === 'paperFormat'){
|
|
3422
|
+
const obj2 = sizeObj2[this.templateType]
|
|
3423
|
+
let from = this.selection()
|
|
3424
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3425
|
+
this.editor.chain().setTextSelection({ from: from, to: from+15 }).setFontSize(obj2.size).setTextSelection(from+15).run()
|
|
3426
|
+
}else {
|
|
3427
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3428
|
+
}
|
|
3429
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3430
|
+
}
|
|
3431
|
+
// 三级标题
|
|
3432
|
+
if (level === '3') {
|
|
3433
|
+
const html = butJson(this.editor, this.menusText)['level3Heading'].html
|
|
3434
|
+
if(this.templateType === 'paperFormat'){
|
|
3435
|
+
const obj3 = sizeObj3[this.templateType]
|
|
3436
|
+
let from = this.selection()
|
|
3437
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3438
|
+
this.editor.chain().setTextSelection({ from: from, to: from+15 }).setFontSize(obj3.size).setTextSelection(from+15).run()
|
|
3439
|
+
}else {
|
|
3440
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3441
|
+
}
|
|
3442
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3443
|
+
}
|
|
3444
|
+
// 正文
|
|
3445
|
+
if (key.key === 'text') {
|
|
3446
|
+
const html = butJson(this.editor, this.menusText)['paragraphBody'].html
|
|
3447
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3448
|
+
}
|
|
3449
|
+
return
|
|
3450
|
+
}
|
|
3451
|
+
|
|
3404
3452
|
if (key.key === 'text') {
|
|
3405
3453
|
this.tipTitle = window.getSelection().toString()
|
|
3406
3454
|
if (this.tipTitle.length === 0) {
|
|
@@ -14,18 +14,16 @@ selectItem 传入当前选择的节点,是一个对象
|
|
|
14
14
|
<template>
|
|
15
15
|
<div>
|
|
16
16
|
<div
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
:class="menuInfo.level === 0 ? '' : 'marginLeft14'"
|
|
18
|
+
class="lineHeight30"
|
|
19
19
|
>
|
|
20
20
|
<div
|
|
21
|
-
|
|
21
|
+
:class=" menuConfig.isShowLine ? 'dashed' : 'no_dashed'"
|
|
22
22
|
>
|
|
23
|
-
<div
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:title="menuInfo.title"
|
|
28
|
-
>
|
|
23
|
+
<div :class="menuTitleStyle"
|
|
24
|
+
:title="menuInfo.title"
|
|
25
|
+
class="widthB100 ellipse cursor "
|
|
26
|
+
@click.stop="clickItem(menuInfo)">
|
|
29
27
|
<template v-if="menuConfig.isCheckBox">
|
|
30
28
|
<checkBox v-model="menuConfig.checkBoxValue" :value="menuInfo.catalogId"></checkBox>
|
|
31
29
|
</template>
|
|
@@ -33,21 +31,23 @@ selectItem 传入当前选择的节点,是一个对象
|
|
|
33
31
|
</div>
|
|
34
32
|
<div v-show="menuConfig.isShowUpDown && menuInfo.children">
|
|
35
33
|
<template v-if="menuConfig.isShowBtn">
|
|
36
|
-
<button class="z-button" @click="clickFont(menuInfo)">
|
|
34
|
+
<button class="z-button" @click="clickFont(menuInfo)">
|
|
35
|
+
{{ menuInfo.isShowUpDown ? '收  起' : '展  开' }}
|
|
36
|
+
</button>
|
|
37
37
|
</template>
|
|
38
38
|
<template v-else>
|
|
39
|
-
<span class="iconfont"
|
|
39
|
+
<span class="iconfont" @click="clickFont(menuInfo)" v-html="defaultFont"></span>
|
|
40
40
|
</template>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<div v-show="menuInfo.isShowUpDown">
|
|
44
44
|
<div v-for="(item, index) in menuInfo.children" :key="index">
|
|
45
45
|
<zydx-menu-tree-info
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
:menu-info="item"
|
|
47
|
+
:menuConfig="menuConfig"
|
|
48
|
+
:nodeLevel="nodeLevel"
|
|
49
|
+
:selectItem="selectItem"
|
|
50
|
+
@clickItem="clickItem"
|
|
51
51
|
>
|
|
52
52
|
</zydx-menu-tree-info>
|
|
53
53
|
</div>
|
|
@@ -68,17 +68,17 @@ export default {
|
|
|
68
68
|
props: {
|
|
69
69
|
// 目录配置
|
|
70
70
|
menuConfig: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
type: Object,
|
|
72
|
+
default: function () {
|
|
73
|
+
return {
|
|
74
|
+
isShowUpDown: false, // 是否显示收起展开
|
|
75
|
+
isShowLine: false, // 是否显示下划线
|
|
76
|
+
isShowBtn: false, // 显示按钮或者图标
|
|
77
|
+
isCheckBox: false, // 是否显示复选框
|
|
78
|
+
isUnifyFontSize: false, // 字体是否需要统一字号,
|
|
79
|
+
checkBoxValue: [], // 复选款选中的值
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
82
|
},
|
|
83
83
|
// 显示可操作节点
|
|
84
84
|
nodeLevel: {
|
|
@@ -109,21 +109,24 @@ export default {
|
|
|
109
109
|
let ar = [];
|
|
110
110
|
ar.push("level" + this.menuInfo.level);
|
|
111
111
|
if (!this.menuConfig.isUnifyFontSize) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
if (parseInt(this.menuInfo.level) == 0) {
|
|
113
|
+
ar.push("text_center");
|
|
114
|
+
}
|
|
115
|
+
if (parseInt(this.menuInfo.level) == 0 || parseInt(this.menuInfo.level) == 1) {
|
|
116
|
+
ar.push("font_border");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (this.menuInfo.hasData !== undefined && !this.menuInfo.hasData) {
|
|
120
|
+
ar.push("disable");
|
|
118
121
|
}
|
|
119
122
|
if (parseInt(this.menuInfo.level) > parseInt(this.nodeLevel)) {
|
|
120
123
|
ar.push("disable");
|
|
121
124
|
}
|
|
122
125
|
// 如果显示复选。 怎不显示高亮
|
|
123
126
|
if (!this.menuConfig.isCheckBox) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
if (this.selectItem && (this.selectItem.catalogId === this.menuInfo.catalogId)) {
|
|
128
|
+
ar.push("active");
|
|
129
|
+
}
|
|
127
130
|
}
|
|
128
131
|
return ar;
|
|
129
132
|
}
|
|
@@ -144,6 +147,7 @@ export default {
|
|
|
144
147
|
font-family: "iconfont";
|
|
145
148
|
src: url("./iconfont.ttf?t=1660878683989") format("truetype");
|
|
146
149
|
}
|
|
150
|
+
|
|
147
151
|
.iconfont {
|
|
148
152
|
font-family: "iconfont" !important;
|
|
149
153
|
font-size: 16px;
|
|
@@ -152,51 +156,64 @@ export default {
|
|
|
152
156
|
-moz-osx-font-smoothing: grayscale;
|
|
153
157
|
cursor: pointer;
|
|
154
158
|
}
|
|
159
|
+
|
|
155
160
|
.cursor {
|
|
156
161
|
cursor: pointer;
|
|
157
162
|
}
|
|
163
|
+
|
|
158
164
|
.disable {
|
|
159
165
|
color: #7c7c7c;
|
|
160
166
|
pointer-events: none;
|
|
161
167
|
cursor: default;
|
|
162
168
|
}
|
|
169
|
+
|
|
163
170
|
.border_bottom {
|
|
164
171
|
border-bottom: 1px #cccccc dashed;
|
|
165
172
|
}
|
|
173
|
+
|
|
166
174
|
.active {
|
|
167
175
|
color: #4B0C77;
|
|
168
176
|
}
|
|
177
|
+
|
|
169
178
|
.ellipse {
|
|
170
179
|
text-overflow: ellipsis;
|
|
171
180
|
white-space: nowrap;
|
|
172
181
|
overflow: hidden;
|
|
173
182
|
}
|
|
183
|
+
|
|
174
184
|
.marginLeft14 {
|
|
175
185
|
margin-left: 14px;
|
|
176
186
|
}
|
|
187
|
+
|
|
177
188
|
.widthB100 {
|
|
178
189
|
width: 100%;
|
|
179
190
|
}
|
|
191
|
+
|
|
180
192
|
.dashed {
|
|
181
193
|
display: flex;
|
|
182
194
|
flex-direction: row;
|
|
183
195
|
border-bottom: 1px #CCCCCC dashed;
|
|
184
196
|
}
|
|
197
|
+
|
|
185
198
|
.no_dashed {
|
|
186
199
|
display: flex;
|
|
187
200
|
flex-direction: row;
|
|
188
201
|
border-bottom: 1px #FFFFFF dashed;
|
|
189
202
|
}
|
|
203
|
+
|
|
190
204
|
.lineHeight30 {
|
|
191
|
-
|
|
205
|
+
line-height: 30px;
|
|
192
206
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
207
|
+
|
|
208
|
+
.text_center {
|
|
209
|
+
font-size: 16px;
|
|
210
|
+
text-align: center;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.font_border {
|
|
214
|
+
font-weight: bolder;
|
|
215
|
+
}
|
|
216
|
+
|
|
200
217
|
.z-button {
|
|
201
218
|
margin: 1px;
|
|
202
219
|
width: auto;
|
|
@@ -219,9 +236,11 @@ export default {
|
|
|
219
236
|
font-weight: normal;
|
|
220
237
|
box-sizing: border-box;
|
|
221
238
|
}
|
|
239
|
+
|
|
222
240
|
.level0 {
|
|
223
241
|
font-weight: bold;
|
|
224
242
|
}
|
|
243
|
+
|
|
225
244
|
.level1 {
|
|
226
245
|
font-weight: bold;
|
|
227
246
|
}
|
|
@@ -24,6 +24,22 @@ export default {
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: true
|
|
26
26
|
},
|
|
27
|
+
leftInitWidth:{
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 310
|
|
30
|
+
},
|
|
31
|
+
leftMinWidth:{
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 0
|
|
34
|
+
},
|
|
35
|
+
rightMinWidth:{
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 0
|
|
38
|
+
},
|
|
39
|
+
isPercent: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
27
43
|
},
|
|
28
44
|
watch: {
|
|
29
45
|
isShowsRight: {
|
|
@@ -59,29 +75,35 @@ export default {
|
|
|
59
75
|
mounted() {
|
|
60
76
|
},
|
|
61
77
|
methods: {
|
|
62
|
-
handleResize(
|
|
78
|
+
handleResize() {
|
|
63
79
|
// 获取Dom节点
|
|
64
80
|
const boxDom = this.$refs.boxRef,
|
|
65
81
|
leftDom = this.$refs.leftRef,
|
|
66
82
|
resizeDom = this.$refs.resizeRef,
|
|
67
83
|
rightDom = this.$refs.rightRef;
|
|
68
84
|
if (resizeDom) {
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
|
|
86
|
+
leftDom.style.width = `${this.isPercent?
|
|
87
|
+
this.leftInitWidth<=0||this.leftInitWidth>=100 ? 30 : this.leftInitWidth
|
|
88
|
+
: this.leftInitWidth}${this.isPercent? '%' : 'px'}`
|
|
89
|
+
rightDom.style.width = `${this.isPercent?
|
|
90
|
+
this.leftInitWidth<=0||this.leftInitWidth>=100 ? 70 : 100-this.leftInitWidth
|
|
91
|
+
: maxWidth-this.leftInitWidth}${this.isPercent? '%' : 'px'}`
|
|
92
|
+
/*leftDom.style.width = '50%'
|
|
93
|
+
rightDom.style.width = '50%'*/
|
|
71
94
|
resizeDom.onmousedown = e => {
|
|
72
95
|
const startX = e.clientX; // 记录坐标起始位置
|
|
73
96
|
leftDom.left = leftDom.offsetWidth; // 左边元素起始宽度
|
|
74
97
|
document.onmousemove = e => {
|
|
75
98
|
const endX = e.clientX; // 鼠标拖动的终止位置
|
|
76
99
|
let moveLen = leftDom.left + (endX - startX); // 移动的距离 = endX - startX,左边区域最后的宽度 = resizeDom.left + 移动的距离
|
|
77
|
-
const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
|
|
78
100
|
// 限制左边区域的最小宽度为 leftMinWidth
|
|
79
|
-
if (moveLen < leftMinWidth) {
|
|
80
|
-
moveLen = leftMinWidth;
|
|
101
|
+
if (moveLen < this.leftMinWidth) {
|
|
102
|
+
moveLen = this.leftMinWidth;
|
|
81
103
|
}
|
|
82
104
|
// 右边区域最小宽度为 rightMinWidth
|
|
83
|
-
if (moveLen > maxWidth - rightMinWidth) {
|
|
84
|
-
moveLen = maxWidth - rightMinWidth;
|
|
105
|
+
if (moveLen > maxWidth - this.rightMinWidth) {
|
|
106
|
+
moveLen = maxWidth - this.rightMinWidth;
|
|
85
107
|
}
|
|
86
108
|
leftDom.style.width = (moveLen / maxWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
|
|
87
109
|
rightDom.style.width = ((maxWidth - moveLen) / maxWidth) * 100 + "%"; // 右边区域 = 总大小 - 左边宽度 - 拖动条宽度
|