zydx-plus 1.36.643 → 1.36.645

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.36.643",
3
+ "version": "1.36.645",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -374,14 +374,7 @@ export default {
374
374
  // 监听外部标注数据变化
375
375
  annotationsData: {
376
376
  handler: function (val) {
377
- if(typeof val === Object) {
378
- this.annotations.push({
379
- ...val,
380
- show: false,
381
- style: {},
382
- type: "tag"
383
- })
384
- }else {
377
+ if (Array.isArray(val)) {
385
378
  const arr = val.map(x => {
386
379
  return {
387
380
  ...x,
@@ -391,6 +384,13 @@ export default {
391
384
  }
392
385
  })
393
386
  this.annotations = arr.concat(this.annotationsInit)
387
+ } else if (val && typeof val === 'object') {
388
+ this.annotations.push({
389
+ ...val,
390
+ show: false,
391
+ style: {},
392
+ type: "tag"
393
+ })
394
394
  }
395
395
  },
396
396
  deep: true,
@@ -16,6 +16,7 @@
16
16
  <button @click="download">下载图片</button>
17
17
  <button @click="fullTap(false)" v-if="fullShow && full">全屏</button>
18
18
  <button @click="fullDel(true)" v-if="!fullShow">退出</button>
19
+ <button @click="save">保存</button>
19
20
  </div>
20
21
  <div :class="{'graph-relation-only': readOnly, 'graph-relation': !readOnly}" ref="graphContent">
21
22
  <RelationGraph ref="graphRef" :options="options" @node-click="onNodeClick" @line-click="onLineClick" @canvas-click="onCanvasClick" @node-drag-end="nodeDragEnd">
@@ -119,7 +120,7 @@ export default {
119
120
  left2: 0,
120
121
  }
121
122
  },
122
- emits: ['update:value'], // 数据变更时向父组件回传最新图谱数据(v-model:value)
123
+ emits: ['update:value', 'save'], // 数据变更时向父组件回传最新图谱数据(v-model:value)
123
124
  props: {
124
125
  /** 图谱数据(v-model),含 nodes / lines */
125
126
  value: {
@@ -173,6 +174,9 @@ export default {
173
174
  window.removeEventListener('keydown', this.handleKeydown)
174
175
  },
175
176
  methods: {
177
+ save() {
178
+ this.$emit('save')
179
+ },
176
180
  // ===== 全屏相关 =====
177
181
  /** 进入全屏:标记状态并让 body 全屏,随后重绘画布铺满视口 */
178
182
  fullTap(v) {
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.36.643',
92
+ version: '1.36.645',
93
93
  install,
94
94
  Calendar,
95
95
  Message,