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) { onClickName (name) {
this.pen.name = name this.pen.name = name
// this.pen.calcControlPoints()
this.drowdown = 0 this.drowdown = 0
if (this.selection.pen) { if (this.selection.pen) {
this.selection.pen.name = name this.selection.pen.name = name

View File

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

View File

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

View File

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