fix: panel 的diagRam bug修改

This commit is contained in:
zhangyu
2021-09-26 12:52:14 +08:00
parent 6ed6c1f4cf
commit 7f3e6b20ae
2 changed files with 30 additions and 32 deletions

View File

@@ -339,6 +339,7 @@ import topoTooltip from '../project/L5/topoTooltip'
import { getMetricTypeValue } from '../js/tools'
import bus from '../../../libs/bus'
import CanvasContextMenu from '@/components/common/project/L5/CanvasContextMenu'
import {imageTemp} from "../project/L5/services/canvas";
// 注册到画布
registerNode('rectangleImg2', myShape, myAnchors, myIconRect2, myTextRect2)
registerNode('myCube', myCubec, myCubeAnchors, null, null)
@@ -1572,42 +1573,40 @@ export default {
if (res.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
this.uploadPicShow = false
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data, header) => {
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
if (group) {
group.children.push({
...imageTemp2,
data: {
...imageTemp2.data,
text: res.data.imageName,
image: data.data,
imageId: res.data.id,
unit: this.uploadPic.unit,
rect: {
width: data.width,
height: data.height
}
}
this.$get('monitor/project/topo/icon', { id: res.data.id }).then(iconInfo => {
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data, header) => {
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
this.iconArray.push({
...iconInfo.data.list[0],
image: data
})
} else {
this.tools.push({
group: this.uploadPic.unit,
children: [{
...imageTemp2,
if (group) {
group.children.push({
...imageTemp,
data: {
...imageTemp2.data,
...imageTemp.data,
text: res.data.imageName,
image: data.data,
image: data,
imageId: res.data.id,
unit: this.uploadPic.unit,
rect: {
width: data.width,
height: data.height
}
unit: this.uploadPic.unit
}
}]
})
}
})
} else {
this.tools.push({
group: this.uploadPic.unit,
children: [{
...imageTemp,
data: {
...imageTemp.data,
text: res.data.imageName,
image: data,
imageId: res.data.id,
unit: this.uploadPic.unit
}
}]
})
}
})
})
} else {
this.$message.error(res.msg)