zydx-plus 1.33.370 → 1.33.372

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.33.370",
3
+ "version": "1.33.372",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1672,6 +1672,31 @@ let buttonNames = {
1672
1672
  }
1673
1673
  }
1674
1674
  },
1675
+ action_scene: {
1676
+ actionName: '情景学习',
1677
+ buttonList: {
1678
+ 0: {
1679
+ headLevel: {
1680
+ default: "demand",
1681
+ demand: '学习要求',
1682
+ singletonClass: this.getCurrentPrefix(item) + '学习',
1683
+ allClass: this.getPrefix(item) + '情况',
1684
+ },
1685
+ otherLevel: {
1686
+ default: "singletonClass",
1687
+ singletonClass: this.getCurrentPrefix(item) + '学习',
1688
+ allClass: this.getPrefix(item) + '情况',
1689
+ },
1690
+ lowLevel: {
1691
+ default: "singletonClass",
1692
+ singletonClass: '学习任务',
1693
+ score: '学习成绩',
1694
+ analysis: '统计分析',
1695
+ power: '学习动力'
1696
+ },
1697
+ }
1698
+ }
1699
+ },
1675
1700
  action_lesson056: {
1676
1701
  actionName: '讲给他人',
1677
1702
  buttonList: {
@@ -114,8 +114,10 @@
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 TouchEvent from 'simple-mind-map/src/plugins/TouchEvent.js'
117
118
  import AssociativeLine from 'simple-mind-map/src/plugins/AssociativeLine.js'
118
119
  MindMap.usePlugin(AssociativeLine)
120
+ MindMap.usePlugin(TouchEvent)
119
121
 
120
122
  export default {
121
123
  components: {Select, Coloring},
@@ -197,7 +199,8 @@ export default {
197
199
  },
198
200
  "children": []
199
201
  },
200
- fullShow: true
202
+ fullShow: true,
203
+ layoutList: ''
201
204
  }
202
205
  },
203
206
  props: {
@@ -228,11 +231,12 @@ export default {
228
231
  immediate: true
229
232
  },
230
233
  data: {
231
- handler: function (val, oldVal) {
234
+ handler: function (val) {
232
235
  if(Object.keys(val).length === 0) {
233
236
  this.mindMap?.setData(this.defaultData)
234
237
  }else {
235
- this.mindMap?.setData(val)
238
+ this.mindMap?.setData(this.msgFun(val))
239
+ this.mindMap?.setLayout(val.layoutList || 'logicalStructure')
236
240
  }
237
241
  },
238
242
  immediate: true
@@ -281,8 +285,8 @@ export default {
281
285
  mounted() {
282
286
  this.id = this.randomId()
283
287
  setTimeout(() => {
284
- this.init()
285
- }, 0)
288
+ this.init()
289
+ },0)
286
290
  window.onresize = () => {
287
291
  if (!document.fullscreenElement) {
288
292
  this.fullShow = true
@@ -296,13 +300,13 @@ export default {
296
300
  return id.replace(/[0-9]/g, '')
297
301
  },
298
302
  fullScreen(element) {
299
- if (element.requestFullScreen) {
300
- element.requestFullScreen()
301
- } else if (element.webkitRequestFullScreen) {
302
- element.webkitRequestFullScreen()
303
- } else if (element.mozRequestFullScreen) {
304
- element.mozRequestFullScreen()
305
- }
303
+ if (element.requestFullScreen) {
304
+ element.requestFullScreen()
305
+ } else if (element.webkitRequestFullScreen) {
306
+ element.webkitRequestFullScreen()
307
+ } else if (element.mozRequestFullScreen) {
308
+ element.mozRequestFullScreen()
309
+ }
306
310
  },
307
311
  cancelFullscreen() {
308
312
  if (document.exitFullscreen) {
@@ -324,6 +328,13 @@ export default {
324
328
  this.fullShow = false
325
329
  this.fullScreen(this.$refs[this.id])
326
330
  },
331
+ msgFun(e) {
332
+ if(e.msg) {
333
+ return Object.keys(e.msg).length === 0 ? this.defaultData : e.msg
334
+ }else {
335
+ return Object.keys(e).length === 0 ? this.defaultData : e
336
+ }
337
+ },
327
338
  // 初始化
328
339
  init() {
329
340
  const that = this
@@ -331,13 +342,13 @@ export default {
331
342
  el: document.getElementById(that.id),
332
343
  enableFreeDrag: false, // 是否开启自由拖拽
333
344
  enableNodeTransitionMove: false, // 是否开启节点过渡动画
334
- layout: 'logicalStructure', // 节点布局方式
345
+ layout: that.data.layoutList || 'logicalStructure', // 节点布局方式
335
346
  maxHistoryCount: 100, // 最大历史记录数
336
347
  maxNodeCacheCount: 100, // 最大节点缓存数
337
- data: Object.keys(that.data).length === 0 ? that.defaultData : that.data
348
+ data: that.msgFun(that.data)
338
349
  });
339
350
  this.mindMap.setMode(this.readOnly ? 'readonly' : 'edit')
340
- this.mindMap.on('node_active', (node, activeNodeList) => {
351
+ this.mindMap.on('node_active', (node) => {
341
352
  this.mindShow = node === null;
342
353
  })
343
354
  this.mindMap.on('back_forward', (index, len) => {
@@ -393,22 +404,25 @@ export default {
393
404
  this.top = parent
394
405
  },
395
406
  structure() {
396
- let layoutList = 'logicalStructure'
407
+ this.layoutList = 'logicalStructure'
397
408
  const layout = this.mindMap.getLayout()
398
409
  if (layout === 'mindMap') {
399
- layoutList = 'organizationStructure'
410
+ this.layoutList = 'organizationStructure'
400
411
  } else if (layout === 'organizationStructure') {
401
- layoutList = 'logicalStructure'
412
+ this.layoutList = 'logicalStructure'
402
413
  } else {
403
- layoutList = 'mindMap'
414
+ this.layoutList = 'mindMap'
404
415
  }
405
- this.mindMap.setLayout(layoutList)
416
+ this.mindMap.setLayout(this.layoutList)
406
417
  },
407
418
  // 保存
408
419
  preservation() {
409
420
  let that = this
410
421
  that.$emit('preservation', {
411
- data: that.mindMap.getData(),
422
+ data: {
423
+ msg: that.mindMap.getData(),
424
+ layoutList: this.layoutList
425
+ },
412
426
  url: ''
413
427
  })
414
428
  // that.mindMap.doExport.png().then((data) => {
package/src/index.js CHANGED
@@ -83,7 +83,7 @@ function install(app) {
83
83
  }
84
84
 
85
85
  export default {
86
- version: '1.33.370',
86
+ version: '1.33.372',
87
87
  install,
88
88
  Calendar,
89
89
  Message,