zydx-plus 1.35.487 → 1.35.488
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
|
@@ -43,7 +43,7 @@ export function butJson(editor, data) {
|
|
|
43
43
|
<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>
|
|
44
44
|
<p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
|
|
45
45
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
46
|
-
<p data-signid="title-1" class="title ${randomId()}
|
|
46
|
+
<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
|
|
47
47
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
48
48
|
<p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
|
|
49
49
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
@@ -57,7 +57,7 @@ export function butJson(editor, data) {
|
|
|
57
57
|
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>
|
|
58
58
|
<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>
|
|
59
59
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
60
|
-
<p data-signid="title-1" class="title ${randomId()}
|
|
60
|
+
<p data-signid="title-1" style="text-align: center" class="title ${randomId()} "><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
|
|
61
61
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
62
62
|
<p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
|
|
63
63
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
@@ -73,7 +73,7 @@ export function butJson(editor, data) {
|
|
|
73
73
|
<p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: #333333;">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
|
|
74
74
|
<p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: #333333">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
|
|
75
75
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
76
|
-
<p data-signid="title-1" class="title ${randomId()}
|
|
76
|
+
<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
|
|
77
77
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
78
78
|
<p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimH ei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
|
|
79
79
|
<p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
|
|
@@ -190,7 +190,7 @@ export function butJson(editor, data) {
|
|
|
190
190
|
{name: '一级标题', key: 'title-1'},
|
|
191
191
|
{name: '二级标题', key: 'title-2'},
|
|
192
192
|
{name: '三级标题', key: 'title-3'},
|
|
193
|
-
{name: '四级标题', key: 'title-4'},
|
|
193
|
+
// {name: '四级标题', key: 'title-4'},
|
|
194
194
|
{name: '正文文本', key: 'text'},
|
|
195
195
|
],
|
|
196
196
|
html: {}
|
|
@@ -210,13 +210,13 @@ export function butJson(editor, data) {
|
|
|
210
210
|
name: '一级标题',
|
|
211
211
|
key: 'firstLevelHeading',
|
|
212
212
|
menuKeys: [],
|
|
213
|
-
html: `<p data-signid="title-1" class="title ${randomId()}
|
|
213
|
+
html: `<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
|
|
214
214
|
},
|
|
215
215
|
secondaryHeading: {
|
|
216
216
|
name: '二级标题',
|
|
217
217
|
key: 'secondaryHeading',
|
|
218
218
|
menuKeys: [],
|
|
219
|
-
html: `<p data-signid="title-2" class="title ${randomId()} indent"><
|
|
219
|
+
html: `<p data-signid="title-2" class="title ${randomId()} indent"><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></p>`
|
|
220
220
|
},
|
|
221
221
|
paragraphBody: {
|
|
222
222
|
name: '正文文本',
|
|
@@ -266,7 +266,7 @@ export function butJson(editor, data) {
|
|
|
266
266
|
{name: '黑体', key: 'SimHei'},
|
|
267
267
|
],
|
|
268
268
|
html: {
|
|
269
|
-
blackCenter4: `<p data-signId="title-1" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
|
|
269
|
+
blackCenter4: `<p data-signId="title-1" style="text-align: center" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
|
|
270
270
|
blackLeft4: `<p data-signId="title-2" class="title ${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
|
|
271
271
|
blackCenter5: `<p data-signId="title-3" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
|
|
272
272
|
blackLeft5: `<p data-signId="title-4" class="title ${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
|
|
@@ -640,7 +640,7 @@ export default {
|
|
|
640
640
|
zydxDragPopup,
|
|
641
641
|
zydxSelect,
|
|
642
642
|
zydxChat,
|
|
643
|
-
delSvg, editSvg, viewSvg,Paint
|
|
643
|
+
delSvg, editSvg, viewSvg, Paint
|
|
644
644
|
},
|
|
645
645
|
beforeUnmount() {
|
|
646
646
|
this.editor.destroy()
|
|
@@ -759,7 +759,7 @@ export default {
|
|
|
759
759
|
audioData: [],
|
|
760
760
|
time: {},
|
|
761
761
|
hex: '',
|
|
762
|
-
toolbar:
|
|
762
|
+
toolbar: [
|
|
763
763
|
'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
|
|
764
764
|
'outlineMenu', 'alignmentMode', 'titleMenu',
|
|
765
765
|
'textMenu', 'color', 'interposition'],
|
|
@@ -816,7 +816,7 @@ export default {
|
|
|
816
816
|
name: '公文版式',
|
|
817
817
|
key: 'officialDocumentFormat',
|
|
818
818
|
menuKeys: [],
|
|
819
|
-
html:
|
|
819
|
+
html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
|
|
820
820
|
<p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
|
|
821
821
|
<p contenteditable="false" class="solid"></p>
|
|
822
822
|
<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>
|
|
@@ -833,7 +833,7 @@ export default {
|
|
|
833
833
|
name: '新闻版式',
|
|
834
834
|
key: 'newsFormat',
|
|
835
835
|
menuKeys: [],
|
|
836
|
-
html:
|
|
836
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入标题</span></strong></p>
|
|
837
837
|
<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>
|
|
838
838
|
<p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
|
|
839
839
|
<p data-signid="title-1" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p>
|
|
@@ -847,7 +847,7 @@ export default {
|
|
|
847
847
|
name: '论文版式',
|
|
848
848
|
key: 'paperFormat',
|
|
849
849
|
menuKeys: [],
|
|
850
|
-
html:
|
|
850
|
+
html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入题目</span></strong></p>
|
|
851
851
|
<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>
|
|
852
852
|
<p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
|
|
853
853
|
<p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
|
|
@@ -926,7 +926,7 @@ export default {
|
|
|
926
926
|
customInsert(res, insertFn) {
|
|
927
927
|
setTimeout(() => {
|
|
928
928
|
insertFn('http://192.168.5.213:8888' + res.data)
|
|
929
|
-
},100)
|
|
929
|
+
}, 100)
|
|
930
930
|
},
|
|
931
931
|
onSuccess(file, res) {
|
|
932
932
|
console.log('图片上传成功', file, res)
|
|
@@ -1014,7 +1014,7 @@ export default {
|
|
|
1014
1014
|
html: {
|
|
1015
1015
|
handler: function (e, oldVal) {
|
|
1016
1016
|
this.init = false
|
|
1017
|
-
if (e&&e.sign?.tag === 'sign') {
|
|
1017
|
+
if (e && e.sign?.tag === 'sign') {
|
|
1018
1018
|
this.signMenuShow = true
|
|
1019
1019
|
// e.shift()
|
|
1020
1020
|
}
|
|
@@ -1033,6 +1033,8 @@ export default {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
setTimeout(() => {
|
|
1035
1035
|
this.init = true
|
|
1036
|
+
this.templateType = this.htmlJson.templateType
|
|
1037
|
+
this.changeTemplateType()
|
|
1036
1038
|
}, 500)
|
|
1037
1039
|
},
|
|
1038
1040
|
deep: true
|
|
@@ -1047,7 +1049,7 @@ export default {
|
|
|
1047
1049
|
if (this.page) {
|
|
1048
1050
|
this.editableShow = !e
|
|
1049
1051
|
setTimeout(() => {
|
|
1050
|
-
if(e){
|
|
1052
|
+
if (e) {
|
|
1051
1053
|
this.readOnlyPage() // 只读分页
|
|
1052
1054
|
}
|
|
1053
1055
|
}, 300)
|
|
@@ -1138,7 +1140,7 @@ export default {
|
|
|
1138
1140
|
BubbleMenu.configure({ // 气泡菜单
|
|
1139
1141
|
pluginKey: 'bubbleMenu',
|
|
1140
1142
|
element: document.querySelector('.menu'),
|
|
1141
|
-
tippyOptions:{
|
|
1143
|
+
tippyOptions: {
|
|
1142
1144
|
placement: 'right',
|
|
1143
1145
|
},
|
|
1144
1146
|
shouldShow: ({editor, view, state, oldState, from, to}) => {
|
|
@@ -1154,7 +1156,7 @@ export default {
|
|
|
1154
1156
|
BubbleMenu.configure({
|
|
1155
1157
|
pluginKey: 'bubbleMenuOne',
|
|
1156
1158
|
element: document.querySelector('.menu-one'),
|
|
1157
|
-
tippyOptions:{
|
|
1159
|
+
tippyOptions: {
|
|
1158
1160
|
placement: 'right',
|
|
1159
1161
|
},
|
|
1160
1162
|
shouldShow: ({editor, view, state, oldState, from, to}) => {
|
|
@@ -1238,6 +1240,7 @@ export default {
|
|
|
1238
1240
|
this.limits = true
|
|
1239
1241
|
},
|
|
1240
1242
|
onUpdate: ({editor}) => {
|
|
1243
|
+
editor.commands.focus()
|
|
1241
1244
|
const json = editor.getJSON()
|
|
1242
1245
|
for (let i = 0; i < json.content.length; i++) {
|
|
1243
1246
|
const item = json.content[i]
|
|
@@ -1264,24 +1267,24 @@ export default {
|
|
|
1264
1267
|
}
|
|
1265
1268
|
}
|
|
1266
1269
|
} else {
|
|
1267
|
-
if(/r-/.test(item.attrs.signId) || /a-/.test(item.attrs.signId)){
|
|
1268
|
-
json.content.splice(i,1)
|
|
1270
|
+
if (/r-/.test(item.attrs.signId) || /a-/.test(item.attrs.signId)) {
|
|
1271
|
+
json.content.splice(i, 1)
|
|
1269
1272
|
editor.chain().setContent(json).run()
|
|
1270
1273
|
}
|
|
1271
1274
|
}
|
|
1272
|
-
let r = json.content.filter(item=>item.attrs.signId
|
|
1273
|
-
let a = json.content.filter(item=>item.attrs.signId
|
|
1274
|
-
for (let i = 0; i < json.content.length; i++){
|
|
1275
|
+
let r = json.content.filter(item => item.attrs.signId && /r-/.test(item.attrs.signId)).length
|
|
1276
|
+
let a = json.content.filter(item => item.attrs.signId && /a-/.test(item.attrs.signId)).length
|
|
1277
|
+
for (let i = 0; i < json.content.length; i++) {
|
|
1275
1278
|
const item = json.content[i]
|
|
1276
|
-
if (r===0){
|
|
1277
|
-
if(item.attrs.signId==='reference' || item.attrs.signId==='reference-1' || item.attrs.signId==='annotationSplitLine'){
|
|
1278
|
-
json.content.splice(i,1)
|
|
1279
|
+
if (r === 0) {
|
|
1280
|
+
if (item.attrs.signId === 'reference' || item.attrs.signId === 'reference-1' || item.attrs.signId === 'annotationSplitLine') {
|
|
1281
|
+
json.content.splice(i, 1)
|
|
1279
1282
|
editor.chain().setContent(json).run()
|
|
1280
1283
|
}
|
|
1281
1284
|
}
|
|
1282
|
-
if (a===0){
|
|
1283
|
-
if(item.attrs.signId==='annotation' || item.attrs.signId==='annotation-1' || item.attrs.signId==='referenceSplitLine'){
|
|
1284
|
-
json.content.splice(i,1)
|
|
1285
|
+
if (a === 0) {
|
|
1286
|
+
if (item.attrs.signId === 'annotation' || item.attrs.signId === 'annotation-1' || item.attrs.signId === 'referenceSplitLine') {
|
|
1287
|
+
json.content.splice(i, 1)
|
|
1285
1288
|
editor.chain().setContent(json).run()
|
|
1286
1289
|
}
|
|
1287
1290
|
}
|
|
@@ -1357,12 +1360,14 @@ export default {
|
|
|
1357
1360
|
this.x = event.clientX - this.left;
|
|
1358
1361
|
this.y = event.clientY - this.top;
|
|
1359
1362
|
})
|
|
1363
|
+
this.templateType = this.htmlJson.templateType
|
|
1364
|
+
this.changeTemplateType()
|
|
1360
1365
|
// document.addEventListener('click', () => {
|
|
1361
1366
|
// // if(this.limits) return
|
|
1362
1367
|
// // this.close()
|
|
1363
1368
|
// })
|
|
1364
1369
|
},
|
|
1365
|
-
emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee', 'changeOutlineMenu'],
|
|
1370
|
+
emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee', 'changeOutlineMenu', 'getConfirm'],
|
|
1366
1371
|
methods: {
|
|
1367
1372
|
showAi() {
|
|
1368
1373
|
this.isShowAi = !this.isShowAi
|
|
@@ -1404,51 +1409,51 @@ export default {
|
|
|
1404
1409
|
},
|
|
1405
1410
|
//修改模板类型
|
|
1406
1411
|
async changeTemplateType() {
|
|
1407
|
-
const
|
|
1412
|
+
const oldFormatWriteNewFormat = (oldJson) => {
|
|
1408
1413
|
let newJson = this.editor.getJSON()
|
|
1409
|
-
if(oldJson.content.length===1
|
|
1414
|
+
if (oldJson.content.length === 1 && !oldJson.content[0].content) {
|
|
1410
1415
|
return
|
|
1411
1416
|
}
|
|
1412
1417
|
let oldContent = []
|
|
1413
|
-
let signIdArrObj={
|
|
1414
|
-
officialDocumentFormat: ['text','paragraph','date','subject'],
|
|
1415
|
-
newsFormat: ['text','paragraph','date','subject','author'],
|
|
1416
|
-
paperFormat: ['text','paragraph','date','subject','author']
|
|
1418
|
+
let signIdArrObj = {
|
|
1419
|
+
officialDocumentFormat: ['text', 'paragraph', 'date', 'subject'],
|
|
1420
|
+
newsFormat: ['text', 'paragraph', 'date', 'subject', 'author'],
|
|
1421
|
+
paperFormat: ['text', 'paragraph', 'date', 'subject', 'author']
|
|
1417
1422
|
}
|
|
1418
|
-
let signIdArr=signIdArrObj[this.templateType]
|
|
1423
|
+
let signIdArr = signIdArrObj[this.templateType]
|
|
1419
1424
|
let newSignIdIndex = -1
|
|
1420
1425
|
let remainIndex = 0
|
|
1421
|
-
for (let i = 0; i <oldJson.content.length
|
|
1426
|
+
for (let i = 0; i < oldJson.content.length; i++) {
|
|
1422
1427
|
let item = oldJson.content[i]
|
|
1423
|
-
if(signIdArr.indexOf(item.attrs.signId)
|
|
1428
|
+
if (signIdArr.indexOf(item.attrs.signId) !== -1 || (!!item.attrs.signId && item.attrs.signId.indexOf('title') !== -1)) {
|
|
1424
1429
|
item.reserve = true
|
|
1425
1430
|
for (let j = 0; j < newJson.content.length; j++) {
|
|
1426
1431
|
let newItem = newJson.content[j]
|
|
1427
|
-
if(newItem.attrs.signId&&item.attrs.signId&&item.attrs.signId===newItem.attrs.signId&&newSignIdIndex<j){
|
|
1428
|
-
newJson.content[j]=JSON.parse(JSON.stringify(item))
|
|
1432
|
+
if (newItem.attrs.signId && item.attrs.signId && item.attrs.signId === newItem.attrs.signId && newSignIdIndex < j) {
|
|
1433
|
+
newJson.content[j] = JSON.parse(JSON.stringify(item))
|
|
1429
1434
|
delete newJson.content[j].reserve
|
|
1430
1435
|
item.reserve = false
|
|
1431
|
-
if(newJson.content[j].attrs.signId==='subject'&&this.templateType === 'officialDocumentFormat'){
|
|
1432
|
-
newJson.content[j].attrs.margin= '80px 0 60px'
|
|
1433
|
-
}else {
|
|
1434
|
-
newJson.content[j].attrs.margin= null
|
|
1436
|
+
if (newJson.content[j].attrs.signId === 'subject' && this.templateType === 'officialDocumentFormat') {
|
|
1437
|
+
newJson.content[j].attrs.margin = '80px 0 60px'
|
|
1438
|
+
} else {
|
|
1439
|
+
newJson.content[j].attrs.margin = null
|
|
1435
1440
|
}
|
|
1436
|
-
newSignIdIndex=j
|
|
1441
|
+
newSignIdIndex = j
|
|
1437
1442
|
break
|
|
1438
|
-
}else {
|
|
1439
|
-
let arr = ['paragraph','date']
|
|
1440
|
-
if(newSignIdIndex>=0&&arr.indexOf(newJson.content[newSignIdIndex].attrs.signId)
|
|
1443
|
+
} else {
|
|
1444
|
+
let arr = ['paragraph', 'date']
|
|
1445
|
+
if (newSignIdIndex >= 0 && arr.indexOf(newJson.content[newSignIdIndex].attrs.signId) === -1) {
|
|
1441
1446
|
// 内容有意义但无法替换如新样板,位置起点留存
|
|
1442
|
-
remainIndex=newSignIdIndex
|
|
1447
|
+
remainIndex = newSignIdIndex
|
|
1443
1448
|
}
|
|
1444
1449
|
}
|
|
1445
1450
|
}
|
|
1446
1451
|
}
|
|
1447
1452
|
}
|
|
1448
|
-
oldContent = oldJson.content.filter(item=>item.reserve)
|
|
1449
|
-
oldContent.forEach((item,index)=>{
|
|
1453
|
+
oldContent = oldJson.content.filter(item => item.reserve)
|
|
1454
|
+
oldContent.forEach((item, index) => {
|
|
1450
1455
|
delete item.reserve
|
|
1451
|
-
newJson.content.splice(remainIndex+index+1,0,item)
|
|
1456
|
+
newJson.content.splice(remainIndex + index + 1, 0, item)
|
|
1452
1457
|
})
|
|
1453
1458
|
this.editor.chain().setContent(newJson).run()
|
|
1454
1459
|
}
|
|
@@ -1464,27 +1469,27 @@ export default {
|
|
|
1464
1469
|
'textMenu', 'color', 'interposition']
|
|
1465
1470
|
this.organizeButton()
|
|
1466
1471
|
this.interpositionData = []
|
|
1467
|
-
if(oldJson.content.length===1
|
|
1472
|
+
if (oldJson.content.length === 1 && !oldJson.content[0].content) {
|
|
1468
1473
|
return
|
|
1469
1474
|
}
|
|
1470
1475
|
let oldContent = []
|
|
1471
|
-
let signIdArr=['text','paragraph','date','subject','author']
|
|
1472
|
-
oldJson.content.forEach((item)=>{
|
|
1473
|
-
if(signIdArr.indexOf(item.attrs.signId)
|
|
1474
|
-
if(item.attrs.signId==='subject'){
|
|
1475
|
-
item.attrs.margin= null
|
|
1476
|
+
let signIdArr = ['text', 'paragraph', 'date', 'subject', 'author']
|
|
1477
|
+
oldJson.content.forEach((item) => {
|
|
1478
|
+
if (signIdArr.indexOf(item.attrs.signId) !== -1 || (!!item.attrs.signId && item.attrs.signId.indexOf('title') !== -1)) {
|
|
1479
|
+
if (item.attrs.signId === 'subject') {
|
|
1480
|
+
item.attrs.margin = null
|
|
1476
1481
|
}
|
|
1477
1482
|
oldContent.push(item)
|
|
1478
1483
|
}
|
|
1479
1484
|
})
|
|
1480
|
-
this.editor.chain().setContent({type:'doc',content:oldContent}).run()
|
|
1485
|
+
this.editor.chain().setContent({type: 'doc', content: oldContent}).run()
|
|
1481
1486
|
}
|
|
1482
1487
|
// 公文版式
|
|
1483
1488
|
if (this.templateType === 'officialDocumentFormat') {
|
|
1484
1489
|
const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
|
|
1485
1490
|
this.editor.chain().setContent(html).run()
|
|
1486
1491
|
this.toolbar = [
|
|
1487
|
-
'switchingFormat', 'signMenu', 'pageMargin','redMenu', 'firstLevelHeading',
|
|
1492
|
+
'switchingFormat', 'signMenu', 'pageMargin', 'redMenu', 'firstLevelHeading',
|
|
1488
1493
|
'secondaryHeading', 'paragraphBody', 'paragraphMenu', 'alignmentMode',
|
|
1489
1494
|
'titleMenu', 'color', 'interposition']
|
|
1490
1495
|
this.organizeButton()
|
|
@@ -2166,7 +2171,7 @@ export default {
|
|
|
2166
2171
|
let mtop = parseInt(getComputedStyle(data[i]).marginTop)
|
|
2167
2172
|
let Bottom = parseInt(getComputedStyle(data[i]).paddingBottom)
|
|
2168
2173
|
let mBottom = parseInt(getComputedStyle(data[i]).marginBottom)
|
|
2169
|
-
let text = data[i].offsetHeight+Bottom+top+mtop+mBottom
|
|
2174
|
+
let text = data[i].offsetHeight + Bottom + top + mtop + mBottom
|
|
2170
2175
|
if ((pHeight + text) > max) {
|
|
2171
2176
|
const {start, end, size} = this.rows(data[i], max - pHeight)
|
|
2172
2177
|
let child = data[i].childNodes[0]
|
|
@@ -2410,8 +2415,9 @@ export default {
|
|
|
2410
2415
|
let editorJson = this.editor.getJSON()
|
|
2411
2416
|
let sign = {node: 'element', tag: 'sign', child: []}
|
|
2412
2417
|
let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
|
|
2418
|
+
let templateType = this.templateType
|
|
2413
2419
|
let data = {
|
|
2414
|
-
directoryJson, editorHtml, editorJson, popupsData
|
|
2420
|
+
directoryJson, editorHtml, editorJson, popupsData, templateType
|
|
2415
2421
|
}
|
|
2416
2422
|
if (this.signMenuShow) {
|
|
2417
2423
|
data.sign = sign
|
|
@@ -2434,8 +2440,9 @@ export default {
|
|
|
2434
2440
|
let editorJson = this.editor.getJSON()
|
|
2435
2441
|
let sign = {node: 'element', tag: 'sign', child: []}
|
|
2436
2442
|
let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
|
|
2443
|
+
let templateType = this.templateType
|
|
2437
2444
|
let data = {
|
|
2438
|
-
directoryJson, editorHtml, editorJson, popupsData
|
|
2445
|
+
directoryJson, editorHtml, editorJson, popupsData, templateType
|
|
2439
2446
|
}
|
|
2440
2447
|
if (this.signMenuShow) {
|
|
2441
2448
|
data.sign = sign
|
|
@@ -2455,6 +2462,21 @@ export default {
|
|
|
2455
2462
|
// })
|
|
2456
2463
|
return data
|
|
2457
2464
|
},
|
|
2465
|
+
changeOutlineMenu() {
|
|
2466
|
+
let directoryJson = html2json(this.editor.getHTML()).child
|
|
2467
|
+
let editorHtml = this.editor.getHTML()
|
|
2468
|
+
let editorJson = this.editor.getJSON()
|
|
2469
|
+
let sign = {node: 'element', tag: 'sign', child: []}
|
|
2470
|
+
let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
|
|
2471
|
+
let templateType = this.templateType
|
|
2472
|
+
let data = {
|
|
2473
|
+
directoryJson, editorHtml, editorJson, popupsData, templateType
|
|
2474
|
+
}
|
|
2475
|
+
if (this.signMenuShow) {
|
|
2476
|
+
data.sign = sign
|
|
2477
|
+
}
|
|
2478
|
+
return data
|
|
2479
|
+
},
|
|
2458
2480
|
// 上传进度
|
|
2459
2481
|
progressFunction(e) {
|
|
2460
2482
|
if (e.lengthComputable) {
|
|
@@ -3072,7 +3094,6 @@ export default {
|
|
|
3072
3094
|
// }
|
|
3073
3095
|
}*/
|
|
3074
3096
|
}
|
|
3075
|
-
|
|
3076
3097
|
// 标志
|
|
3077
3098
|
if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
|
|
3078
3099
|
// 红头文件
|
|
@@ -3089,13 +3110,13 @@ export default {
|
|
|
3089
3110
|
if (data.key === 'firstLevelHeading') {
|
|
3090
3111
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
3091
3112
|
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3092
|
-
this.$emit('changeOutlineMenu')
|
|
3113
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3093
3114
|
}
|
|
3094
3115
|
// 二级标题
|
|
3095
3116
|
if (data.key === 'secondaryHeading') {
|
|
3096
3117
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
3097
3118
|
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
3098
|
-
this.$emit('changeOutlineMenu')
|
|
3119
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3099
3120
|
}
|
|
3100
3121
|
// 正文
|
|
3101
3122
|
if (data.key === 'paragraphBody') {
|
|
@@ -3198,16 +3219,31 @@ export default {
|
|
|
3198
3219
|
// 大纲级别
|
|
3199
3220
|
if (data.key === 'outlineMenu') {
|
|
3200
3221
|
if (key.key === 'text') {
|
|
3222
|
+
this.editor.commands.setNode('paragraph', {class: 'indent'})
|
|
3201
3223
|
this.editor.commands.setTitleId(key.key)
|
|
3202
3224
|
this.editor.commands.unsetSignId()
|
|
3203
|
-
this.editor.chain().
|
|
3225
|
+
this.editor.chain().unsetBold().setFontSize('14px').setColor('#000000').setTextAlign('left').focus().run()
|
|
3204
3226
|
} else {
|
|
3205
3227
|
const t = key.key.split('-')[0]
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3228
|
+
const level = key.key.split('-')[1]
|
|
3229
|
+
let size = '16px'
|
|
3230
|
+
if (level === '1') {
|
|
3231
|
+
this.editor.commands.setNode('paragraph', {class: ''})
|
|
3232
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
|
|
3233
|
+
this.editor.commands.setSignId(key.key)
|
|
3234
|
+
this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('center').focus().run()
|
|
3235
|
+
} else if (level === '2') {
|
|
3236
|
+
this.editor.commands.setSignId(key.key)
|
|
3237
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
|
|
3238
|
+
this.editor.chain().unsetBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
|
|
3239
|
+
} else {
|
|
3240
|
+
size = '14px'
|
|
3241
|
+
this.editor.commands.setSignId(key.key)
|
|
3242
|
+
this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
|
|
3243
|
+
this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
|
|
3244
|
+
}
|
|
3209
3245
|
}
|
|
3210
|
-
this.$emit('changeOutlineMenu')
|
|
3246
|
+
this.$emit('changeOutlineMenu', this.changeOutlineMenu())
|
|
3211
3247
|
}
|
|
3212
3248
|
// 对齐方式
|
|
3213
3249
|
if (data.key === 'alignmentMode') {
|
|
@@ -4041,9 +4077,12 @@ export default {
|
|
|
4041
4077
|
if (this.readOnly) {
|
|
4042
4078
|
let bodys = document.querySelector(`.z-editor`)
|
|
4043
4079
|
bodys.scrollTop = element.offsetTop
|
|
4044
|
-
|
|
4080
|
+
} else {
|
|
4081
|
+
let bodys = document.querySelector(`.editor-content`)
|
|
4082
|
+
bodys.scrollTop = element.offsetTop + 70
|
|
4045
4083
|
}
|
|
4046
|
-
|
|
4084
|
+
|
|
4085
|
+
// element.scrollIntoView({behavior: 'smooth'});
|
|
4047
4086
|
}
|
|
4048
4087
|
}
|
|
4049
4088
|
}
|
|
@@ -4130,8 +4169,8 @@ export default {
|
|
|
4130
4169
|
|
|
4131
4170
|
:deep(.title) {
|
|
4132
4171
|
/*padding: 10px 0 2px 0;*/
|
|
4133
|
-
font-weight: 900
|
|
4134
|
-
color
|
|
4172
|
+
/*font-weight: 900;*/
|
|
4173
|
+
color: #333333 !important;
|
|
4135
4174
|
}
|
|
4136
4175
|
|
|
4137
4176
|
.read-only-a {
|
|
@@ -1,86 +1,84 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<div class="list-cont" v-else>
|
|
18
|
-
<div class="list-li-cont" :style="{'color': (active === index)? activeColor : '#000000'}" v-if="active === index">
|
|
19
|
-
<p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{ item[it.label] }}</p>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
2
|
+
<div class="list-tree">
|
|
3
|
+
<div class="list-cont" v-if="list.length > 0">
|
|
4
|
+
<div :class="{'list-li':true, 'theme-text': active === index, pos: multiple}"
|
|
5
|
+
:style="{'border-bottom': (link)? '1px solid #ccc': '0'}"
|
|
6
|
+
v-for="(item,index) in listCopy" :key="index" @click="listTap(item,index)">
|
|
7
|
+
<input v-if="multiple" :checked="item.box" @change="checkboxChange($event,index)" class="box-list" type="checkbox" name="boxList" />
|
|
8
|
+
<div class="list-title">
|
|
9
|
+
<span :style="{'font-size': 'fontSize' in column[0]?column[0].fontSize + 'px':'16px', 'font-weight': column[0].fontWeight, 'color': (active === index)? activeColor : '#333333'}" v-html="(index + 1) + '.' + (angleBrackets ? '《' : '') + item[column[0].label] + (angleBrackets ? '》' : '')"></span>
|
|
10
|
+
<button v-if="delShow" @click="del(item)" v-html="delText"></button>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="list-cont">
|
|
13
|
+
<div class="list-li-cont" :style="{'color': (active === index)? activeColor : '#000000'}" v-if="open ? true : active === index">
|
|
14
|
+
<div v-for="(it,ind) in column.slice(1, column.length)" :key="ind" class="textWrap">
|
|
15
|
+
<div class="lable">{{ it.name }}</div>
|
|
16
|
+
<div class="text">:{{ item[it.label] }}</div>
|
|
22
17
|
</div>
|
|
18
|
+
</div>
|
|
23
19
|
</div>
|
|
24
|
-
|
|
20
|
+
</div>
|
|
25
21
|
</div>
|
|
22
|
+
<div v-else class="wu">暂无数据</div>
|
|
23
|
+
</div>
|
|
26
24
|
</template>
|
|
27
25
|
|
|
28
26
|
<script>
|
|
29
|
-
export default {
|
|
27
|
+
export default {
|
|
30
28
|
name: "zydx-tree-list",
|
|
31
29
|
data() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
return {
|
|
31
|
+
active: this.actives,
|
|
32
|
+
listCopy: []
|
|
33
|
+
}
|
|
36
34
|
},
|
|
37
35
|
props: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
36
|
+
list: { // 数据列表
|
|
37
|
+
type: Array,
|
|
38
|
+
default: () => []
|
|
39
|
+
},
|
|
40
|
+
column: { // 数据列表
|
|
41
|
+
type: Array,
|
|
42
|
+
default: () => []
|
|
43
|
+
},
|
|
44
|
+
delShow: { //是否显示取消按钮
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
angleBrackets: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
open: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
link: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
activeColor: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '#e20808'
|
|
63
|
+
},
|
|
64
|
+
actives: {
|
|
65
|
+
type: Number,
|
|
66
|
+
default: 0
|
|
67
|
+
},
|
|
68
|
+
delText: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '删除'
|
|
71
|
+
},
|
|
74
72
|
multiple: {
|
|
75
73
|
type: Boolean,
|
|
76
74
|
default: false
|
|
77
75
|
}
|
|
78
76
|
},
|
|
79
77
|
watch: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
actives(val) {
|
|
79
|
+
if (val === -1) return
|
|
80
|
+
this.active = val
|
|
81
|
+
},
|
|
84
82
|
list: {
|
|
85
83
|
handler(val) {
|
|
86
84
|
let list = JSON.parse(JSON.stringify(val))
|
|
@@ -106,41 +104,41 @@ export default {
|
|
|
106
104
|
const data = this.listCopy.filter(x => x.box)
|
|
107
105
|
this.$emit('multipleData', data)
|
|
108
106
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
del(data) {
|
|
108
|
+
this.$emit('del', data)
|
|
109
|
+
},
|
|
110
|
+
listTap(data, index) {
|
|
111
|
+
this.active = index
|
|
112
|
+
this.$emit('confirm', {...data, activeIndex: index})
|
|
113
|
+
},
|
|
116
114
|
}
|
|
117
|
-
}
|
|
115
|
+
}
|
|
118
116
|
</script>
|
|
119
117
|
|
|
120
118
|
<style scoped>
|
|
121
|
-
.pos{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
.box-list{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
.wu {
|
|
119
|
+
.pos{
|
|
120
|
+
position: relative;
|
|
121
|
+
padding-left: 20px;
|
|
122
|
+
}
|
|
123
|
+
.box-list{
|
|
124
|
+
position: absolute;
|
|
125
|
+
top: 9px;
|
|
126
|
+
left: 0;
|
|
127
|
+
z-index: 1;
|
|
128
|
+
}
|
|
129
|
+
.wu {
|
|
132
130
|
text-align: center;
|
|
133
131
|
font-size: 18px;
|
|
134
132
|
padding: 40px 0;
|
|
135
|
-
}
|
|
133
|
+
}
|
|
136
134
|
|
|
137
|
-
.list-title {
|
|
135
|
+
.list-title {
|
|
138
136
|
display: flex;
|
|
139
137
|
justify-content: center;
|
|
140
138
|
line-height: 30px;
|
|
141
|
-
}
|
|
139
|
+
}
|
|
142
140
|
|
|
143
|
-
.list-title > span {
|
|
141
|
+
.list-title > span {
|
|
144
142
|
flex: 1;
|
|
145
143
|
overflow: hidden;
|
|
146
144
|
white-space: nowrap;
|
|
@@ -148,9 +146,9 @@ export default {
|
|
|
148
146
|
height: 30px;
|
|
149
147
|
font-size: 14px;
|
|
150
148
|
font-weight: 600;
|
|
151
|
-
}
|
|
149
|
+
}
|
|
152
150
|
|
|
153
|
-
.list-title > button {
|
|
151
|
+
.list-title > button {
|
|
154
152
|
margin-left: 5px;
|
|
155
153
|
margin-top: 4px;
|
|
156
154
|
font-size: 12px;
|
|
@@ -161,31 +159,47 @@ export default {
|
|
|
161
159
|
cursor: pointer;
|
|
162
160
|
height: 22px;
|
|
163
161
|
min-width: 60px;
|
|
164
|
-
}
|
|
162
|
+
}
|
|
165
163
|
|
|
166
|
-
.list-tree {
|
|
164
|
+
.list-tree {
|
|
167
165
|
padding: 0 10px;
|
|
168
166
|
cursor: pointer;
|
|
169
|
-
}
|
|
170
|
-
/*.list-li{
|
|
171
|
-
|
|
172
|
-
/*}*/
|
|
173
|
-
.list-li > span {
|
|
167
|
+
}
|
|
168
|
+
/*.list-li{
|
|
169
|
+
/*padding-bottom: 10px;*/
|
|
170
|
+
/*}*/
|
|
171
|
+
.list-li > span {
|
|
174
172
|
font-size: 16px;
|
|
175
173
|
line-height: 30px;
|
|
176
|
-
}
|
|
174
|
+
}
|
|
177
175
|
|
|
178
|
-
.list-li-cont {
|
|
176
|
+
.list-li-cont {
|
|
179
177
|
font-size: 14px;
|
|
180
178
|
padding-left: 18px;
|
|
181
|
-
}
|
|
179
|
+
}
|
|
182
180
|
|
|
183
|
-
.list-li-cont >
|
|
181
|
+
.list-li-cont > .textWrap {
|
|
184
182
|
height: 25px;
|
|
185
183
|
line-height: 25px;
|
|
186
184
|
overflow: hidden;
|
|
187
185
|
white-space: nowrap;
|
|
188
186
|
text-overflow: ellipsis;
|
|
189
187
|
font-size: 14px;
|
|
190
|
-
|
|
188
|
+
display: flex;
|
|
189
|
+
justify-content: left;
|
|
190
|
+
align-items: center;
|
|
191
|
+
}
|
|
192
|
+
.lable{
|
|
193
|
+
line-height: 25px;
|
|
194
|
+
width: 57px;
|
|
195
|
+
text-align: justify;
|
|
196
|
+
text-align-last: justify;
|
|
197
|
+
}
|
|
198
|
+
.text {
|
|
199
|
+
width: calc(100% - 57px);
|
|
200
|
+
overflow: hidden;
|
|
201
|
+
white-space: nowrap;
|
|
202
|
+
text-overflow: ellipsis;
|
|
203
|
+
line-height: 25px;
|
|
204
|
+
}
|
|
191
205
|
</style>
|