zydx-plus 1.30.160 → 1.30.162
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/biz_header/src/button_name.js +4 -1
- package/src/components/dragPopup/src/dragPopup.vue +9 -7
- package/src/components/editor/src/editor.vue +3 -2
- package/src/components/editor2/src/editor.vue +15 -3
- package/src/components/editor2/src/sign-id.js +33 -0
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1132,7 +1132,6 @@ let buttonNames = {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
}[this.actionId];
|
|
1134
1134
|
if (this.isTeacherReview) {
|
|
1135
|
-
console.log(actionInfo.buttonList[this.tabType].lowLevel)
|
|
1136
1135
|
delete actionInfo.buttonList[this.tabType].lowLevel.studentReview;
|
|
1137
1136
|
} else {
|
|
1138
1137
|
delete actionInfo.buttonList[this.tabType].lowLevel.teacherReview;
|
|
@@ -2192,6 +2191,7 @@ let buttonNames = {
|
|
|
2192
2191
|
headLevel: {
|
|
2193
2192
|
default: "demand",
|
|
2194
2193
|
demand: '实践要求',
|
|
2194
|
+
guideIndex: '指导意见',
|
|
2195
2195
|
resourceIndex: '实践项目',
|
|
2196
2196
|
review: '实践点评',
|
|
2197
2197
|
analyse: '实践分析',
|
|
@@ -2216,6 +2216,7 @@ let buttonNames = {
|
|
|
2216
2216
|
headLevel: {
|
|
2217
2217
|
default: "demand",
|
|
2218
2218
|
demand: '实验要求',
|
|
2219
|
+
guideIndex: '指导意见',
|
|
2219
2220
|
resourceIndex: '实验项目',
|
|
2220
2221
|
review: '实验点评',
|
|
2221
2222
|
analyse: '实验分析',
|
|
@@ -2240,6 +2241,7 @@ let buttonNames = {
|
|
|
2240
2241
|
headLevel: {
|
|
2241
2242
|
default: "demand",
|
|
2242
2243
|
demand: '项目要求',
|
|
2244
|
+
guideIndex: '指导意见',
|
|
2243
2245
|
resourceIndex: '项目主题',
|
|
2244
2246
|
review: '项目点评',
|
|
2245
2247
|
analyse: '项目分析',
|
|
@@ -2264,6 +2266,7 @@ let buttonNames = {
|
|
|
2264
2266
|
headLevel: {
|
|
2265
2267
|
default: "demand",
|
|
2266
2268
|
demand: '创新要求',
|
|
2269
|
+
guideIndex: '指导意见',
|
|
2267
2270
|
resourceIndex: '创新任务',
|
|
2268
2271
|
review: '创新点评',
|
|
2269
2272
|
analyse: '创新分析',
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
<div class="drag-cont-slot">
|
|
16
16
|
<slot name="content"></slot>
|
|
17
17
|
</div>
|
|
18
|
-
<i class="down" v-if="dragStatus" @mousedown="footDown($event,'d')" @mouseup="footUp"></i>
|
|
19
|
-
<i class="in" v-if="dragStatus" @mousedown="footDown($event,'in')" @mouseup="footUp"></i>
|
|
20
|
-
<i class="right" v-if="dragStatus" @mousedown="footDown($event,'r')" @mouseup="footUp"></i>
|
|
18
|
+
<i class="drag-down" v-if="dragStatus" @mousedown="footDown($event,'d')" @mouseup="footUp"></i>
|
|
19
|
+
<i class="drag-in" v-if="dragStatus" @mousedown="footDown($event,'in')" @mouseup="footUp"></i>
|
|
20
|
+
<i class="drag-right" v-if="dragStatus" @mousedown="footDown($event,'r')" @mouseup="footUp"></i>
|
|
21
21
|
</div>
|
|
22
22
|
<div class="down-text" v-if="dragStatus">
|
|
23
23
|
<div class="down-text-cont">
|
|
@@ -98,7 +98,7 @@ export default {
|
|
|
98
98
|
},
|
|
99
99
|
computed: {
|
|
100
100
|
position() {
|
|
101
|
-
return `
|
|
101
|
+
return `transform: translate(${this.x}px, ${this.y}px);width:${this.footRightOffset}px;height:${this.footDownOffset}px;`;
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
emits: ['dragStatus','close'],
|
|
@@ -201,7 +201,7 @@ export default {
|
|
|
201
201
|
padding: 0 10px;
|
|
202
202
|
text-align: right;
|
|
203
203
|
}
|
|
204
|
-
.down{
|
|
204
|
+
.drag-down{
|
|
205
205
|
position: absolute;
|
|
206
206
|
bottom: -50px;
|
|
207
207
|
right: 20px;
|
|
@@ -212,7 +212,7 @@ export default {
|
|
|
212
212
|
cursor: ns-resize;
|
|
213
213
|
user-select: none;
|
|
214
214
|
}
|
|
215
|
-
.in{
|
|
215
|
+
.drag-in{
|
|
216
216
|
position: absolute;
|
|
217
217
|
bottom: -40px;
|
|
218
218
|
right: -20px;
|
|
@@ -223,7 +223,7 @@ export default {
|
|
|
223
223
|
cursor: nwse-resize;
|
|
224
224
|
user-select: none;
|
|
225
225
|
}
|
|
226
|
-
.right{
|
|
226
|
+
.drag-right{
|
|
227
227
|
position: absolute;
|
|
228
228
|
bottom: 0;
|
|
229
229
|
right: -20px;
|
|
@@ -272,6 +272,8 @@ export default {
|
|
|
272
272
|
}
|
|
273
273
|
.drag-pop {
|
|
274
274
|
position: fixed;
|
|
275
|
+
top: 0;
|
|
276
|
+
left: 0;
|
|
275
277
|
box-shadow: 0 0 3px 2px #ccc;
|
|
276
278
|
background-color: #fff;
|
|
277
279
|
border-radius: 3px;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<button class="def-but" v-if="butShow" @click="confirm">完成</button>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="read-only" v-if="readOnly">
|
|
8
|
-
<div class="read-only-page" :style="{
|
|
8
|
+
<div class="read-only-page" :style="{height: !page? 'auto': '1123px','box-shadow': !page? 'none': '0 0 10px rgba(0, 0, 0, 0.1)', 'padding': !page? '10px':'60px'}" v-for="(item,index) in htmlArr" >
|
|
9
9
|
<div class="read-only-p" v-html="item"></div>
|
|
10
10
|
<div v-if="page" class="read-only-a">{{ index + 1 }}/{{ htmlArr.length }}</div>
|
|
11
11
|
</div>
|
|
@@ -88,7 +88,7 @@ export default defineComponent({
|
|
|
88
88
|
setTimeout(() => {
|
|
89
89
|
this.editableShow = true
|
|
90
90
|
this.readOnlyPage()
|
|
91
|
-
},
|
|
91
|
+
},50)
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
deep: true,
|
|
@@ -218,6 +218,7 @@ export default defineComponent({
|
|
|
218
218
|
text-align: right;
|
|
219
219
|
}
|
|
220
220
|
.read-only-page{
|
|
221
|
+
width: 794px;
|
|
221
222
|
margin: 0 auto 20px auto;
|
|
222
223
|
background-color: #fff;
|
|
223
224
|
box-sizing: border-box;
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
</div>
|
|
76
76
|
</template>
|
|
77
77
|
<script>
|
|
78
|
-
|
|
79
78
|
import { html2json, json2html } from 'html2json'
|
|
80
79
|
import { Editor, EditorContent } from '@tiptap/vue-3'
|
|
81
80
|
import StarterKit from '@tiptap/starter-kit'
|
|
@@ -84,6 +83,7 @@ import TextAlign from '@tiptap/extension-text-align'
|
|
|
84
83
|
import Placeholder from '@tiptap/extension-placeholder'
|
|
85
84
|
import Color from '@tiptap/extension-color'
|
|
86
85
|
import textStyle from '@tiptap/extension-text-style'
|
|
86
|
+
import { sid } from "./sign-id";
|
|
87
87
|
export default {
|
|
88
88
|
name: 'zydx-xiao-editor',
|
|
89
89
|
components: {
|
|
@@ -206,6 +206,7 @@ export default {
|
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
208
|
mounted() {
|
|
209
|
+
let _this = this
|
|
209
210
|
this.uploadAttData = (this.data.enclosure === undefined)? [] : this.enclosureAction(this.data.enclosure)
|
|
210
211
|
this.heightStyle = (this.height === '100%')? {height: '100%'} : {'min-height': this.height}
|
|
211
212
|
const height = this.height.split('px')[0] - 44
|
|
@@ -214,6 +215,7 @@ export default {
|
|
|
214
215
|
content: json2html({node: "root",child: (this.data.html === undefined)? [] : this.data.html}),
|
|
215
216
|
editable: this.readOnly,
|
|
216
217
|
extensions: [
|
|
218
|
+
sid,
|
|
217
219
|
StarterKit,
|
|
218
220
|
textStyle,
|
|
219
221
|
Color.configure({
|
|
@@ -237,7 +239,18 @@ export default {
|
|
|
237
239
|
html: html2json(editor.getHTML()).child,
|
|
238
240
|
enclosure: this.uploadAttData
|
|
239
241
|
})
|
|
240
|
-
}
|
|
242
|
+
}
|
|
243
|
+
})
|
|
244
|
+
document.addEventListener('keydown', function (e) {
|
|
245
|
+
if (e.keyCode === 8 || e.keyCode === 46) {
|
|
246
|
+
const sid = _this.editor.state.selection.$anchor.parent.attrs.sid
|
|
247
|
+
if(sid === 'prohibit') {
|
|
248
|
+
_this.editor.setEditable(false);
|
|
249
|
+
setTimeout(() => {
|
|
250
|
+
_this.editor.setEditable(true);
|
|
251
|
+
}, 0);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
241
254
|
})
|
|
242
255
|
},
|
|
243
256
|
methods: {
|
|
@@ -341,7 +354,6 @@ export default {
|
|
|
341
354
|
insertContent(v) {
|
|
342
355
|
for(let i=0; i< v.length; i++) {
|
|
343
356
|
let html = json2html(v[i])
|
|
344
|
-
console.log(html)
|
|
345
357
|
this.editor.chain().focus().insertContentAt(this.selection(),html).run()
|
|
346
358
|
}
|
|
347
359
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core'
|
|
2
|
+
|
|
3
|
+
export const sid = Extension.create({
|
|
4
|
+
name: 'sid',
|
|
5
|
+
|
|
6
|
+
addOptions() {
|
|
7
|
+
return {
|
|
8
|
+
types: ['heading', 'paragraph'],
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
addGlobalAttributes() {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
types: this.options.types,
|
|
16
|
+
attributes: {
|
|
17
|
+
sid: {
|
|
18
|
+
default: null,
|
|
19
|
+
parseHTML: element => element.getAttribute('data-sid'),
|
|
20
|
+
renderHTML: attributes => {
|
|
21
|
+
if (!attributes.sid) {
|
|
22
|
+
return {}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
'data-sid': attributes.sid,
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
})
|