zydx-plus 1.32.204 → 1.32.205
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zydx-plus",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.205",
|
|
4
4
|
"description": "Vue.js",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"pdfjs-dist": "^2.0.943",
|
|
25
25
|
"snabbdom": "^3.5.1",
|
|
26
26
|
"katex": "^0.15.6",
|
|
27
|
-
"simple-mind-map": "^0.
|
|
27
|
+
"simple-mind-map": "^0.6.14",
|
|
28
28
|
"html2json": "^1.0.2",
|
|
29
29
|
"@tiptap/extension-image": "^2.0.3",
|
|
30
30
|
"@tiptap/starter-kit": "^2.0.3",
|
|
@@ -64,7 +64,10 @@ export function butJson (editor,data) {
|
|
|
64
64
|
name: '标注编号',
|
|
65
65
|
key: 'numberMenu',
|
|
66
66
|
menuKeys: [],
|
|
67
|
-
html:
|
|
67
|
+
html: [
|
|
68
|
+
`<sup>[${menusData(data,'numberMenu').text}]</sup>`,
|
|
69
|
+
`<sup>[${menusData(data,'numberMenu').text}]</sup><span> </span>`
|
|
70
|
+
]
|
|
68
71
|
},
|
|
69
72
|
keywordMenu: {
|
|
70
73
|
name: '关键词',
|
|
@@ -91,7 +94,8 @@ export function butJson (editor,data) {
|
|
|
91
94
|
html: [
|
|
92
95
|
`<sup>${num[numSort(editor)]}</sup>`,
|
|
93
96
|
`<hr class="custom-link" contenteditable="false">`,
|
|
94
|
-
`<p data-signId="s-${numSort(editor)}"><span style="font-family: KaiTi">${num[numSort(editor)]}填写标注内容<span></p
|
|
97
|
+
`<p data-signId="s-${numSort(editor)}"><span style="font-family: KaiTi">${num[numSort(editor)]}填写标注内容<span></p>`,
|
|
98
|
+
`<sup>${num[numSort(editor)]}</sup><span> </span>`,
|
|
95
99
|
],
|
|
96
100
|
index: numSort(editor)
|
|
97
101
|
},
|
|
@@ -155,4 +159,4 @@ function getTime() {
|
|
|
155
159
|
let month = date.getMonth() + 1
|
|
156
160
|
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
|
|
157
161
|
return year + '年' + month + '月' + day + '日'
|
|
158
|
-
}
|
|
162
|
+
}
|
|
@@ -704,14 +704,11 @@ export default {
|
|
|
704
704
|
}
|
|
705
705
|
// 标注编号
|
|
706
706
|
if (data.key === 'numberMenu') {
|
|
707
|
-
|
|
707
|
+
let index = 0
|
|
708
|
+
const {path, pos} = this.editor.state.selection.$head
|
|
708
709
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
// }else {
|
|
712
|
-
// this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
713
|
-
// }
|
|
714
|
-
this.editor.chain().focus().insertContentAt(this.selection(), html).run()
|
|
710
|
+
if(path[5] === pos) index = 1
|
|
711
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html[index]).run()
|
|
715
712
|
}
|
|
716
713
|
// 关键词
|
|
717
714
|
if (data.key === 'keywordMenu') {
|
|
@@ -747,15 +744,18 @@ export default {
|
|
|
747
744
|
}
|
|
748
745
|
// 添加标注
|
|
749
746
|
if (data.key === 'taggingMenu') {
|
|
750
|
-
|
|
747
|
+
let ind = 0
|
|
748
|
+
const {path, pos} = this.editor.state.selection.$head
|
|
749
|
+
let index = this.editor.state.selection.$anchor.path[1] // 获取当前光标所行数
|
|
751
750
|
const content = this.editor.state.selection.$anchor.path[0].content.content // 获取内容
|
|
752
751
|
const name = content[index + 1]?.type.name
|
|
753
752
|
const num = this.cursorPosition(content, index) // 获取当前光标位置
|
|
754
753
|
const html = butJson(this.editor, this.menusText)[data.key].html
|
|
755
|
-
|
|
754
|
+
if(path[5] === pos) ind = 3
|
|
755
|
+
this.editor.chain().focus().insertContentAt(this.selection(), html[ind]).run()
|
|
756
756
|
const si = butJson(this.editor, this.menusText)[data.key].index - 1 // 获取标记的位置
|
|
757
|
-
const signID = this.selectionPath(`s-${si}`)
|
|
758
|
-
if (name !== 'horizontalRule') {
|
|
757
|
+
const signID = this.selectionPath(`s-${si}`) // 获取标记的位置
|
|
758
|
+
if (name !== 'horizontalRule') { // 判断是否有分割线
|
|
759
759
|
this.editor.chain().focus().insertContentAt(num, html[1]).run()
|
|
760
760
|
this.editor.chain().focus().insertContentAt(num + 2, html[2]).run()
|
|
761
761
|
} else {
|
|
@@ -1125,4 +1125,4 @@ li {
|
|
|
1125
1125
|
width: 100%;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
</style>
|
|
1128
|
+
</style>
|
|
@@ -114,13 +114,6 @@
|
|
|
114
114
|
import Select from '../../select/src/select.vue'
|
|
115
115
|
import Coloring from '../../coloring/src/coloring.vue'
|
|
116
116
|
import MindMap from "simple-mind-map";
|
|
117
|
-
import Drag from 'simple-mind-map/src/Drag.js'
|
|
118
|
-
import AssociativeLine from 'simple-mind-map/src/AssociativeLine.js'
|
|
119
|
-
import Export from 'simple-mind-map/src/Export.js'
|
|
120
|
-
import "simple-mind-map/dist/simpleMindMap.esm.css";
|
|
121
|
-
|
|
122
|
-
// 注册插件
|
|
123
|
-
MindMap.usePlugin(Drag).usePlugin(AssociativeLine).usePlugin(Export)
|
|
124
117
|
|
|
125
118
|
export default {
|
|
126
119
|
components: {Select, Coloring},
|