fix:修改topology图编辑缩放时 缩放显示没有相应变化的bug

This commit is contained in:
zhangyu
2021-03-29 15:50:52 +08:00
parent 78c8ed98a1
commit faa3690f80
4 changed files with 16 additions and 10 deletions

View File

@@ -1245,6 +1245,7 @@ export default {
},
onClickName (name) {
this.pen.name = name
// this.pen.calcControlPoints()
this.drowdown = 0
if (this.selection.pen) {
this.selection.pen.name = name

View File

@@ -109,14 +109,13 @@ export default {
const dataOption = getTopology(this.index).data
Object.keys(this.option).forEach(key => {
if (key === 'scale') {
this.scaleNum = (JSON.stringify(dataOption[key]) ? dataOption[key] * 100 : this.scaleNum)
this.scaleNum = (JSON.stringify(dataOption[key]) ? parseInt(dataOption[key] * 100) : this.scaleNum)
} else {
this.option[key] = (JSON.stringify(dataOption[key]) ? dataOption[key] : this.option[key])
}
})
},
methods: {
// todo 1清空后的 处理属性工具的默认值 2工具栏的移动 以及节点工具和属性工具的移动 3 结束箭头类型的方向
changeOption (key) {
getTopology(this.index).data[key] = this.option[key]
getTopology(this.index).render()

View File

@@ -81,7 +81,7 @@
</div>
<topology-top-tool
v-if="editTopologyFlag"
v-if="editTopologyFlag&&toolShow.topTool"
:selection.sync="props"
@del="delPen"
:index="topologyIndex"
@@ -460,6 +460,7 @@ export default {
toolShow: {
node: true,
attr: true,
topTool: true,
nodeCord: [0, 0],
attrCord: [0, 0],
height: 500
@@ -1163,12 +1164,14 @@ export default {
},
onMessage (event, data, e) {
// console.log('onMessage',event,data);
console.log('onMessage', event, data);
// console.log(getTopology(this.topologyIndex))
// this.notModuleIDArr=[];
this.toolShow.attr = false
this.toolShow.topTool = false
this.$nextTick(() => {
this.toolShow.attr = true
this.toolShow.topTool = true
})
if (data) {
this.notModuleIDArr.forEach(item => {
@@ -1418,7 +1421,7 @@ export default {
}
case 'scale': {
if (this.$refs.topTool) {
this.$refs.topTool.option.scale = data
this.$refs.topTool.scaleNum = parseInt(data * 100)
}
break
}

View File

@@ -81,7 +81,7 @@
</div>
<topology-top-tool
v-if="editTopologyFlag"
v-if="editTopologyFlag&&toolShow.topTool"
:selection.sync="props"
@del="delPen"
:index="topologyIndex"
@@ -460,6 +460,7 @@
toolShow: {
node: true,
attr: true,
topTool: true,
nodeCord: [0, 0],
attrCord: [0, 0],
height: 500
@@ -1163,12 +1164,14 @@
},
onMessage (event, data, e) {
// console.log('onMessage',event,data);
console.log('onMessage', event, data);
// console.log(getTopology(this.topologyIndex))
// this.notModuleIDArr=[];
this.toolShow.attr = false
this.toolShow.topTool = false
this.$nextTick(() => {
this.toolShow.attr = true
this.toolShow.topTool = true
})
if (data) {
this.notModuleIDArr.forEach(item => {
@@ -1418,7 +1421,7 @@
}
case 'scale': {
if (this.$refs.topTool) {
this.$refs.topTool.option.scale = data
this.$refs.topTool.scaleNum = parseInt(data * 100)
}
break
}