zydx-plus 1.33.390 → 1.33.392
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
|
@@ -2065,7 +2065,7 @@ let buttonNames = {
|
|
|
2065
2065
|
headLevel: {
|
|
2066
2066
|
default: "demand",
|
|
2067
2067
|
demand: '武术要求',
|
|
2068
|
-
resourceIndex: '
|
|
2068
|
+
resourceIndex: '任务题目',
|
|
2069
2069
|
review: '武术点评',
|
|
2070
2070
|
guideIndex: '指导意见',
|
|
2071
2071
|
analyse: '武术分析',
|
|
@@ -2076,13 +2076,13 @@ let buttonNames = {
|
|
|
2076
2076
|
},
|
|
2077
2077
|
otherLevel: {
|
|
2078
2078
|
default: "singletonClass",
|
|
2079
|
-
singletonClass: this.getCurrentPrefix(item) + '
|
|
2080
|
-
allClass: this.getPrefix(item) + '
|
|
2079
|
+
singletonClass: this.getCurrentPrefix(item) + '题目',
|
|
2080
|
+
allClass: this.getPrefix(item) + '题目'
|
|
2081
2081
|
},
|
|
2082
2082
|
lowLevel: {
|
|
2083
2083
|
default: "viewResource",
|
|
2084
|
-
createResource: '
|
|
2085
|
-
viewResource: '
|
|
2084
|
+
createResource: '创建题目',
|
|
2085
|
+
viewResource: '题目列表',
|
|
2086
2086
|
selectResource: '查找资源',
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
@@ -2174,15 +2174,7 @@ let buttonNames = {
|
|
|
2174
2174
|
}
|
|
2175
2175
|
},
|
|
2176
2176
|
resource_lesson_guidance: { // 就业指导-指导意见配置项
|
|
2177
|
-
actionName: '指导意见'
|
|
2178
|
-
buttonList: {
|
|
2179
|
-
0: {
|
|
2180
|
-
headLevel: {
|
|
2181
|
-
default: "demand",
|
|
2182
|
-
demand: '指导意见'
|
|
2183
|
-
}
|
|
2184
|
-
}
|
|
2185
|
-
}
|
|
2177
|
+
actionName: '指导意见'
|
|
2186
2178
|
},
|
|
2187
2179
|
resource_scene:{
|
|
2188
2180
|
actionName: '情景资源',
|
|
@@ -67,11 +67,13 @@ const clearJson = {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
let editorAPP = null;
|
|
71
|
+
|
|
70
72
|
export default {
|
|
71
73
|
name: "zydx-sketchpad",
|
|
72
74
|
data() {
|
|
73
75
|
return {
|
|
74
|
-
editor: null
|
|
76
|
+
// editor: null
|
|
75
77
|
}
|
|
76
78
|
},
|
|
77
79
|
mounted() {
|
|
@@ -94,43 +96,43 @@ export default {
|
|
|
94
96
|
},
|
|
95
97
|
methods: {
|
|
96
98
|
handleMountedEditor(editor) {
|
|
97
|
-
|
|
99
|
+
editorAPP = editor
|
|
98
100
|
setTimeout(() => {
|
|
99
101
|
document.documentElement.scrollTop = 0
|
|
100
102
|
}, 0)
|
|
101
103
|
},
|
|
102
104
|
setOpacityForNextShapes(opacity){
|
|
103
|
-
|
|
105
|
+
editorAPP.setOpacityForNextShapes(opacity)
|
|
104
106
|
},
|
|
105
107
|
// 清空
|
|
106
108
|
clear() {
|
|
107
|
-
|
|
109
|
+
editorAPP.store.loadSnapshot(clearJson)
|
|
108
110
|
this.isFocused()
|
|
109
111
|
},
|
|
110
112
|
// 添加快照
|
|
111
113
|
setSnapshot(v) {
|
|
112
|
-
|
|
114
|
+
editorAPP.store.loadSnapshot(v)
|
|
113
115
|
this.isFocused()
|
|
114
116
|
},
|
|
115
117
|
// 获取快照
|
|
116
118
|
getSnapshot() {
|
|
117
|
-
return
|
|
119
|
+
return editorAPP.store.getSnapshot()
|
|
118
120
|
},
|
|
119
121
|
draw(v) {
|
|
120
122
|
this.styleProps('draw', 'color').defaultValue = v?.color ?? 'black'
|
|
121
123
|
this.styleProps('draw', 'size').defaultValue = v?.size ?? 'm'
|
|
122
124
|
this.styleProps('draw', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
123
125
|
this.styleProps('draw', 'fill').defaultValue = v?.fill ?? 'none'
|
|
124
|
-
|
|
126
|
+
editorAPP.setCurrentTool('draw')
|
|
125
127
|
},
|
|
126
128
|
select() {
|
|
127
|
-
|
|
129
|
+
editorAPP.setCurrentTool('select')
|
|
128
130
|
},
|
|
129
131
|
hand() {
|
|
130
|
-
|
|
132
|
+
editorAPP.setCurrentTool('hand')
|
|
131
133
|
},
|
|
132
134
|
eraser() {
|
|
133
|
-
|
|
135
|
+
editorAPP.setCurrentTool('eraser')
|
|
134
136
|
},
|
|
135
137
|
arrow(v) {
|
|
136
138
|
// 'none', 'semi', 'solid', 'pattern'
|
|
@@ -138,14 +140,14 @@ export default {
|
|
|
138
140
|
this.styleProps('arrow', 'size').defaultValue = v?.size ?? 'm'
|
|
139
141
|
this.styleProps('arrow', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
140
142
|
this.styleProps('arrow', 'fill').defaultValue = v?.fill ?? 'none'
|
|
141
|
-
|
|
143
|
+
editorAPP.setCurrentTool('arrow')
|
|
142
144
|
},
|
|
143
145
|
text(v) {
|
|
144
146
|
this.styleProps('text', 'color').defaultValue = v?.color ?? 'black'
|
|
145
147
|
this.styleProps('text', 'size').defaultValue = v?.size ?? 'm'
|
|
146
148
|
this.styleProps('text', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
|
|
147
149
|
this.styleProps('text', 'align').defaultValue = v?.align ?? 'start'
|
|
148
|
-
|
|
150
|
+
editorAPP.setCurrentTool('text')
|
|
149
151
|
},
|
|
150
152
|
note(v) {
|
|
151
153
|
let verticalAlign = ['middle-legacy', 'start-legacy', 'end-legacy']
|
|
@@ -158,14 +160,14 @@ export default {
|
|
|
158
160
|
this.styleProps('note', 'color').defaultValue = v?.color ?? 'black'
|
|
159
161
|
this.styleProps('note', 'size').defaultValue = v?.size ?? 'm'
|
|
160
162
|
this.styleProps('note', 'font').defaultValue = v?.font ?? 'draw' //['draw', 'sans', 'serif', 'mono']
|
|
161
|
-
|
|
163
|
+
editorAPP.setCurrentTool('note')
|
|
162
164
|
},
|
|
163
165
|
line(v) {
|
|
164
166
|
this.styleProps('arrow', 'color').defaultValue = v?.color ?? 'black'
|
|
165
167
|
this.styleProps('arrow', 'size').defaultValue = v?.size ?? 'm'
|
|
166
168
|
this.styleProps('arrow', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
167
169
|
this.styleProps('arrow', 'fill').defaultValue = v?.fill ?? 'none'
|
|
168
|
-
|
|
170
|
+
editorAPP.setCurrentTool('line')
|
|
169
171
|
},
|
|
170
172
|
rectangle(v) {
|
|
171
173
|
this.styleProps('geo', 'geo').defaultValue = 'rectangle'
|
|
@@ -173,7 +175,7 @@ export default {
|
|
|
173
175
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
174
176
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
175
177
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
176
|
-
|
|
178
|
+
editorAPP.setCurrentTool('geo')
|
|
177
179
|
},
|
|
178
180
|
ellipse(v) {
|
|
179
181
|
this.styleProps('geo', 'geo').defaultValue = 'ellipse'
|
|
@@ -181,7 +183,7 @@ export default {
|
|
|
181
183
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
182
184
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
183
185
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
184
|
-
|
|
186
|
+
editorAPP.setCurrentTool('geo')
|
|
185
187
|
},
|
|
186
188
|
triangle(v) {
|
|
187
189
|
this.styleProps('geo', 'geo').defaultValue = 'triangle'
|
|
@@ -189,7 +191,7 @@ export default {
|
|
|
189
191
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
190
192
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
191
193
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
192
|
-
|
|
194
|
+
editorAPP.setCurrentTool('geo')
|
|
193
195
|
},
|
|
194
196
|
|
|
195
197
|
rhombus(v) {
|
|
@@ -198,7 +200,7 @@ export default {
|
|
|
198
200
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
199
201
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
200
202
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
201
|
-
|
|
203
|
+
editorAPP.setCurrentTool('geo')
|
|
202
204
|
},
|
|
203
205
|
cloud(v) {
|
|
204
206
|
this.styleProps('geo', 'geo').defaultValue = 'cloud'
|
|
@@ -206,7 +208,7 @@ export default {
|
|
|
206
208
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
207
209
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
208
210
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
209
|
-
|
|
211
|
+
editorAPP.setCurrentTool('geo')
|
|
210
212
|
},
|
|
211
213
|
trapezoid(v) {
|
|
212
214
|
this.styleProps('geo', 'geo').defaultValue = 'trapezoid'
|
|
@@ -214,7 +216,7 @@ export default {
|
|
|
214
216
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
215
217
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
216
218
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
217
|
-
|
|
219
|
+
editorAPP.setCurrentTool('geo')
|
|
218
220
|
},
|
|
219
221
|
diamond(v) {
|
|
220
222
|
this.styleProps('geo', 'geo').defaultValue = 'diamond'
|
|
@@ -222,7 +224,7 @@ export default {
|
|
|
222
224
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
223
225
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
224
226
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
225
|
-
|
|
227
|
+
editorAPP.setCurrentTool('geo')
|
|
226
228
|
},
|
|
227
229
|
star(v) {
|
|
228
230
|
this.styleProps('geo', 'geo').defaultValue = 'star'
|
|
@@ -230,7 +232,7 @@ export default {
|
|
|
230
232
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
231
233
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
232
234
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
233
|
-
|
|
235
|
+
editorAPP.setCurrentTool('geo')
|
|
234
236
|
},
|
|
235
237
|
|
|
236
238
|
xBox(v) {
|
|
@@ -239,7 +241,7 @@ export default {
|
|
|
239
241
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
240
242
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
241
243
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
242
|
-
|
|
244
|
+
editorAPP.setCurrentTool('geo')
|
|
243
245
|
},
|
|
244
246
|
checkBox(v) {
|
|
245
247
|
this.styleProps('geo', 'geo').defaultValue = 'check-box'
|
|
@@ -247,7 +249,7 @@ export default {
|
|
|
247
249
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
248
250
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
249
251
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
250
|
-
|
|
252
|
+
editorAPP.setCurrentTool('geo')
|
|
251
253
|
},
|
|
252
254
|
oval(v) {
|
|
253
255
|
this.styleProps('geo', 'geo').defaultValue = 'oval'
|
|
@@ -255,7 +257,7 @@ export default {
|
|
|
255
257
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
256
258
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
257
259
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
258
|
-
|
|
260
|
+
editorAPP.setCurrentTool('geo')
|
|
259
261
|
},
|
|
260
262
|
arrowLeft(v) {
|
|
261
263
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-left'
|
|
@@ -263,7 +265,7 @@ export default {
|
|
|
263
265
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
264
266
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
265
267
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
266
|
-
|
|
268
|
+
editorAPP.setCurrentTool('geo')
|
|
267
269
|
},
|
|
268
270
|
arrowRight(v) {
|
|
269
271
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-right'
|
|
@@ -271,7 +273,7 @@ export default {
|
|
|
271
273
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
272
274
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
273
275
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
274
|
-
|
|
276
|
+
editorAPP.setCurrentTool('geo')
|
|
275
277
|
},
|
|
276
278
|
arrowUp(v) {
|
|
277
279
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-up'
|
|
@@ -279,7 +281,7 @@ export default {
|
|
|
279
281
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
280
282
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
281
283
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
282
|
-
|
|
284
|
+
editorAPP.setCurrentTool('geo')
|
|
283
285
|
},
|
|
284
286
|
arrowDown(v) {
|
|
285
287
|
this.styleProps('geo', 'geo').defaultValue = 'arrow-down'
|
|
@@ -287,7 +289,7 @@ export default {
|
|
|
287
289
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
288
290
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
289
291
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
290
|
-
|
|
292
|
+
editorAPP.setCurrentTool('geo')
|
|
291
293
|
},
|
|
292
294
|
hexagon(v) {
|
|
293
295
|
this.styleProps('geo', 'geo').defaultValue = 'hexagon'
|
|
@@ -295,21 +297,18 @@ export default {
|
|
|
295
297
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
296
298
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
297
299
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
298
|
-
|
|
300
|
+
editorAPP.setCurrentTool('geo')
|
|
299
301
|
},
|
|
300
302
|
highlight(v) {
|
|
301
303
|
this.styleProps('geo', 'color').defaultValue = v?.color ?? 'black'
|
|
302
304
|
this.styleProps('geo', 'size').defaultValue = v?.size ?? 'm'
|
|
303
305
|
this.styleProps('geo', 'dash').defaultValue = v?.dash ?? 'draw'
|
|
304
306
|
this.styleProps('geo', 'fill').defaultValue = v?.fill ?? 'none'
|
|
305
|
-
|
|
307
|
+
editorAPP.setCurrentTool('highlight')
|
|
306
308
|
},
|
|
307
309
|
insertPicture(img){
|
|
308
|
-
console.log('insertPicture',img)
|
|
309
310
|
const assetId = AssetRecordType.createId()
|
|
310
|
-
|
|
311
|
-
console.log('editor',this.editor)
|
|
312
|
-
this.editor.createAssets([{
|
|
311
|
+
editorAPP.createAssets([{
|
|
313
312
|
id: assetId,
|
|
314
313
|
type: 'image',
|
|
315
314
|
typeName: 'asset',
|
|
@@ -324,28 +323,31 @@ export default {
|
|
|
324
323
|
}
|
|
325
324
|
}])
|
|
326
325
|
const imageId = createShapeId()
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
editorAPP.createShape({
|
|
327
|
+
id: imageId,
|
|
329
328
|
type: 'image',
|
|
330
329
|
x: 200,
|
|
331
330
|
y: 200,
|
|
331
|
+
isLocked: false,
|
|
332
332
|
props: {
|
|
333
|
+
w: img.width,
|
|
334
|
+
h: img.height,
|
|
333
335
|
assetId
|
|
334
336
|
},
|
|
335
337
|
})
|
|
336
338
|
|
|
337
339
|
},
|
|
338
340
|
laser() {
|
|
339
|
-
|
|
341
|
+
editorAPP.setCurrentTool('laser')
|
|
340
342
|
},
|
|
341
343
|
undo() {
|
|
342
|
-
|
|
344
|
+
editorAPP.undo()
|
|
343
345
|
},
|
|
344
346
|
redo() {
|
|
345
|
-
|
|
347
|
+
editorAPP.redo()
|
|
346
348
|
},
|
|
347
349
|
styleProps(t, e) {
|
|
348
|
-
const style = [...
|
|
350
|
+
const style = [...editorAPP.styleProps[t]]
|
|
349
351
|
const index = style.findIndex(item => item[1] === e)
|
|
350
352
|
return style[index][0]
|
|
351
353
|
},
|
|
@@ -353,7 +355,7 @@ export default {
|
|
|
353
355
|
isFocused() {
|
|
354
356
|
const top = document.documentElement.scrollTop
|
|
355
357
|
setTimeout(() => {
|
|
356
|
-
|
|
358
|
+
editorAPP.updateInstanceState({isFocused: true})
|
|
357
359
|
document.documentElement.scrollTop = top
|
|
358
360
|
}, 10)
|
|
359
361
|
}
|