zydx-plus 1.33.348 → 1.33.349
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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<slot name="icon"></slot>
|
|
12
12
|
<i class="disconnect" v-if="disconnectShow" @click.stop="disconnect"></i>
|
|
13
13
|
<i class="enlarge" v-if="enlargeShow" @click.stop="enlarge"></i>
|
|
14
|
-
<i @click.stop="close"></i>
|
|
14
|
+
<i v-if="closeShow" @click.stop="close"></i>
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
<div :class="{'drag-cont': dragStatus || dragTextShow,'drag-conts': !dragStatus || !dragTextShow}"
|
|
@@ -104,6 +104,10 @@ export default {
|
|
|
104
104
|
type: Number,
|
|
105
105
|
default: 200
|
|
106
106
|
},
|
|
107
|
+
closeShow: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: true
|
|
110
|
+
}
|
|
107
111
|
},
|
|
108
112
|
beforeUnmount() {
|
|
109
113
|
this.clean()
|
|
@@ -379,10 +379,9 @@ export default {
|
|
|
379
379
|
default: () => {
|
|
380
380
|
return {
|
|
381
381
|
meta: {
|
|
382
|
-
bizId: 'b5063ffdac7047f6ba27d198ffb5b847',
|
|
383
382
|
},
|
|
384
383
|
headers: {
|
|
385
|
-
Authorization:localStorage.getItem("remember") === "1"? localStorage.getItem('sessionId'): sessionStorage.getItem('sessionId')
|
|
384
|
+
Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
|
|
386
385
|
},
|
|
387
386
|
server: '/zydx/lessonResource/editOfficeFile',
|
|
388
387
|
}
|
|
@@ -394,7 +393,7 @@ export default {
|
|
|
394
393
|
return {
|
|
395
394
|
server: '/zydx/lessonResource/upload/img',
|
|
396
395
|
headers: {
|
|
397
|
-
Authorization: localStorage.getItem("remember") === "1"? localStorage.getItem('sessionId'): sessionStorage.getItem('sessionId')
|
|
396
|
+
Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
|
|
398
397
|
},
|
|
399
398
|
customInsert(res, insertFn) {
|
|
400
399
|
insertFn('http://192.168.5.213:8888' + res.data)
|
|
@@ -408,15 +407,14 @@ export default {
|
|
|
408
407
|
uploadAttachment: {
|
|
409
408
|
type: Object,
|
|
410
409
|
default: () => {
|
|
411
|
-
return
|
|
410
|
+
return {
|
|
412
411
|
server: '/zydx/fileanex/uploadfile',
|
|
413
412
|
fieldName: 'file',
|
|
414
413
|
maxFileSize: 100 * 1024 * 1024,
|
|
415
414
|
meta: {
|
|
416
|
-
bizId: 'b5063ffdac7047f6ba27d198ffb5b847',
|
|
417
415
|
},
|
|
418
416
|
headers: {
|
|
419
|
-
Authorization:
|
|
417
|
+
Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
|
|
420
418
|
},
|
|
421
419
|
// 在上传之前
|
|
422
420
|
onBeforeUpload(file) {
|
|
@@ -536,10 +534,10 @@ export default {
|
|
|
536
534
|
},
|
|
537
535
|
mounted() {
|
|
538
536
|
const _this = this
|
|
539
|
-
_this.htmlJson=_this.html
|
|
537
|
+
_this.htmlJson = _this.html ? JSON.parse(JSON.stringify(_this.html)) : []
|
|
540
538
|
if (_this.htmlJson[_this.htmlJson.length - 1]?.type === 'interpositionData') {
|
|
541
539
|
this.interpositionData = _this.htmlJson[_this.htmlJson.length - 1].data
|
|
542
|
-
_this.htmlJson.splice(_this.htmlJson.length - 1,1)
|
|
540
|
+
_this.htmlJson.splice(_this.htmlJson.length - 1, 1)
|
|
543
541
|
}
|
|
544
542
|
let dataHtml = json2html({node: "root", child: (_this.html === undefined || _this.html === null) ? [] : _this.html})
|
|
545
543
|
if (dataHtml[0]?.tag === 'sign') {
|
|
@@ -601,8 +599,14 @@ export default {
|
|
|
601
599
|
shouldShow: ({editor, view, state, oldState, from, to}) => {
|
|
602
600
|
let encIndex = state.selection.$from.nodeBefore?.marks
|
|
603
601
|
if (encIndex && encIndex.length) {
|
|
604
|
-
let name =
|
|
605
|
-
|
|
602
|
+
let name = ''
|
|
603
|
+
let nameArr = ["superscript", "underline"]
|
|
604
|
+
encIndex.forEach(item => {
|
|
605
|
+
if (nameArr.indexOf(item.type.name) !== -1) {
|
|
606
|
+
name = item.type.name
|
|
607
|
+
}
|
|
608
|
+
})
|
|
609
|
+
return nameArr.indexOf(name) !== -1
|
|
606
610
|
} else {
|
|
607
611
|
return false
|
|
608
612
|
}
|
|
@@ -1295,7 +1299,7 @@ export default {
|
|
|
1295
1299
|
const data = document.querySelectorAll('.editing-cont')[0].childNodes[0].childNodes
|
|
1296
1300
|
this.wit = document.getElementsByClassName('editor-content')[0].offsetWidth + 20
|
|
1297
1301
|
if (this.wit > 900) this.wit = 900
|
|
1298
|
-
let max = this.wit * 1.6 -
|
|
1302
|
+
let max = this.wit * 1.6 - 46
|
|
1299
1303
|
let pHeight = 0
|
|
1300
1304
|
let html = ''
|
|
1301
1305
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -1383,7 +1387,7 @@ export default {
|
|
|
1383
1387
|
let styleKey = 'left'
|
|
1384
1388
|
let positionNum = `-${bubbleMenu.width / 2}px`
|
|
1385
1389
|
let menusStyle = {
|
|
1386
|
-
'max-width'
|
|
1390
|
+
'max-width': `${width - 20}px`,
|
|
1387
1391
|
position: 'absolute',
|
|
1388
1392
|
'text-indent': bubbleMenu.width === width ? '2em' : '0em',
|
|
1389
1393
|
top: this.readOnly ? `${e.clientY - only.top + 10}px` : `${30}px`,
|
|
@@ -1404,7 +1408,7 @@ export default {
|
|
|
1404
1408
|
if (only.left + (only.width / 2) < e.clientX) {
|
|
1405
1409
|
styleKey = 'right'
|
|
1406
1410
|
if ((e.clientX + (bubbleMenu.width / 2)) > (only.left + only.width - marginRight - 10)) {
|
|
1407
|
-
let difference = Math.floor((e.clientX + (bubbleMenu.width / 2)) - (only.left + only.width- marginRight - 10))
|
|
1411
|
+
let difference = Math.floor((e.clientX + (bubbleMenu.width / 2)) - (only.left + only.width - marginRight - 10))
|
|
1408
1412
|
positionNum = `-${(bubbleMenu.width / 2) - difference - 10}px`
|
|
1409
1413
|
}
|
|
1410
1414
|
} else {
|
|
@@ -1514,6 +1518,10 @@ export default {
|
|
|
1514
1518
|
child: []
|
|
1515
1519
|
})
|
|
1516
1520
|
}
|
|
1521
|
+
data.push({
|
|
1522
|
+
type:'interpositionData',
|
|
1523
|
+
data:this.interpositionData
|
|
1524
|
+
})
|
|
1517
1525
|
return data
|
|
1518
1526
|
},
|
|
1519
1527
|
// 上传进度
|
|
@@ -1554,7 +1562,7 @@ export default {
|
|
|
1554
1562
|
this.uploadFile(file, up).then(res => {
|
|
1555
1563
|
if (res.code === '200') {
|
|
1556
1564
|
const {from, to} = this.editor.state.selection
|
|
1557
|
-
this.tipTitle =
|
|
1565
|
+
this.tipTitle = window.getSelection().toString()
|
|
1558
1566
|
let typeArr = ['importArticles', 'importWorks', 'interposition', 'videoLink', 'linkCourseware']
|
|
1559
1567
|
if (typeArr.indexOf(v) !== -1) {
|
|
1560
1568
|
up.customInsert(res, file, async (name, url) => {
|
|
@@ -1583,10 +1591,7 @@ export default {
|
|
|
1583
1591
|
url: officeRes.data
|
|
1584
1592
|
}
|
|
1585
1593
|
}
|
|
1586
|
-
this.editor.chain()
|
|
1587
|
-
.setLink({href: `${dataInfo.id}`})
|
|
1588
|
-
.setUnderline().insertContentAt(to, ` `)
|
|
1589
|
-
.setTextSelection({from: to, to: to + 1})
|
|
1594
|
+
this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({from: to, to: to + 1})
|
|
1590
1595
|
.unsetUnderline().unsetLink().focus('end').run()
|
|
1591
1596
|
this.interpositionData.push(dataInfo)
|
|
1592
1597
|
this.documentClick()
|
|
@@ -1847,7 +1852,6 @@ export default {
|
|
|
1847
1852
|
},
|
|
1848
1853
|
|
|
1849
1854
|
async butTap(data, key, childKey) {
|
|
1850
|
-
console.log(data, key, childKey)
|
|
1851
1855
|
// 快捷排版
|
|
1852
1856
|
if (data.key === 'shortcut') {
|
|
1853
1857
|
const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
|
|
@@ -1877,7 +1881,6 @@ export default {
|
|
|
1877
1881
|
// 摘要
|
|
1878
1882
|
if (key.key === 'abstractMenu') {
|
|
1879
1883
|
const html = menusHtml.filter(item => item.key == key.key)[0].html
|
|
1880
|
-
console.log('html',html)
|
|
1881
1884
|
const r = await this.signIdData('abstract')
|
|
1882
1885
|
if (r === -1) this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
1883
1886
|
}
|
|
@@ -2042,8 +2045,8 @@ export default {
|
|
|
2042
2045
|
}
|
|
2043
2046
|
// 添加标注
|
|
2044
2047
|
if (key.key === 'taggingMenu') {
|
|
2045
|
-
const {from, to} = this.editor.state.selection
|
|
2046
|
-
this.tipTitle = this.editor.getText().substring(from - 1, to - 1)
|
|
2048
|
+
// const {from, to} = this.editor.state.selection
|
|
2049
|
+
this.tipTitle = window.getSelection().toString()// this.editor.getText().substring(from - 1, to - 1)
|
|
2047
2050
|
if (this.tipTitle.length === 0) {
|
|
2048
2051
|
await Message({type: 'text', promptContent: '请选中需要注释的文字'})
|
|
2049
2052
|
return
|
|
@@ -2413,10 +2416,7 @@ export default {
|
|
|
2413
2416
|
}
|
|
2414
2417
|
})
|
|
2415
2418
|
} else {
|
|
2416
|
-
this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({
|
|
2417
|
-
from: to,
|
|
2418
|
-
to: to + 1
|
|
2419
|
-
}).unsetUnderline().unsetLink().focus('end').run()
|
|
2419
|
+
this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({ from: to, to: to + 1 }).unsetUnderline().unsetLink().focus('end').run()
|
|
2420
2420
|
this.interpositionData.push(dataInfo)
|
|
2421
2421
|
}
|
|
2422
2422
|
this.isShowExegesis = false
|
|
@@ -2651,6 +2651,9 @@ export default {
|
|
|
2651
2651
|
.read-only {
|
|
2652
2652
|
position: relative;
|
|
2653
2653
|
margin: 0 auto;
|
|
2654
|
+
display: flex;
|
|
2655
|
+
flex-direction: column;
|
|
2656
|
+
align-items: center;
|
|
2654
2657
|
}
|
|
2655
2658
|
|
|
2656
2659
|
.read-only-page {
|
|
@@ -2926,12 +2929,14 @@ li {
|
|
|
2926
2929
|
min-height: 700px;
|
|
2927
2930
|
margin: 0 auto;
|
|
2928
2931
|
position: relative;
|
|
2932
|
+
display: flex;
|
|
2933
|
+
align-items: center;
|
|
2929
2934
|
}
|
|
2930
2935
|
|
|
2931
2936
|
.editing-cont {
|
|
2932
2937
|
padding: 8% 0;
|
|
2933
2938
|
box-sizing: border-box;
|
|
2934
|
-
|
|
2939
|
+
width: 100%;
|
|
2935
2940
|
min-height: 700px;
|
|
2936
2941
|
margin: 0 15%;
|
|
2937
2942
|
}
|
|
@@ -3052,13 +3057,11 @@ li {
|
|
|
3052
3057
|
}
|
|
3053
3058
|
|
|
3054
3059
|
.menu-one {
|
|
3055
|
-
//max-width: 557px;
|
|
3056
|
-
min-width: 300px;
|
|
3060
|
+
//max-width: 557px; min-width: 300px;
|
|
3057
3061
|
width: max-content;
|
|
3058
3062
|
padding: 10px;
|
|
3059
3063
|
border-radius: 7px;
|
|
3060
|
-
//margin:0 100px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.58); background: #FFFFFF; display: flex; flex-direction: column;
|
|
3061
|
-
justify-content: space-between;
|
|
3064
|
+
//margin:0 100px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.58); background: #FFFFFF; display: flex; flex-direction: column; justify-content: space-between;
|
|
3062
3065
|
z-index: 10 !important;
|
|
3063
3066
|
}
|
|
3064
3067
|
|
|
@@ -3093,6 +3096,7 @@ li {
|
|
|
3093
3096
|
align-items: center;
|
|
3094
3097
|
color: #CCCCCC;
|
|
3095
3098
|
}
|
|
3099
|
+
|
|
3096
3100
|
@keyframes linkDown {
|
|
3097
3101
|
0% {
|
|
3098
3102
|
opacity: 0;
|
|
@@ -3123,7 +3127,6 @@ li {
|
|
|
3123
3127
|
|
|
3124
3128
|
:deep(.text) {
|
|
3125
3129
|
font-size: 14px;
|
|
3126
|
-
padding: 0 10px;
|
|
3127
3130
|
font-family: FangSong;
|
|
3128
3131
|
}
|
|
3129
3132
|
|