fix: 处理 进入编辑页面 无法立即编辑的问题
This commit is contained in:
@@ -659,53 +659,61 @@ export default {
|
|||||||
axiosArr.push({ item, arr })
|
axiosArr.push({ item, arr })
|
||||||
promiseArr.push(pensPromise(item, arr, index))
|
promiseArr.push(pensPromise(item, arr, index))
|
||||||
})
|
})
|
||||||
Promise.all(promiseArr).then((res) => {
|
if (this.fromTopologyDialog && !this.isPreview) {
|
||||||
getTopology(this.topologyIndex).open(data)
|
|
||||||
getTopology(this.topologyIndex).lock(1)
|
|
||||||
this.objChange = false
|
|
||||||
let flag = false
|
|
||||||
const position = {
|
|
||||||
x: this.$refs['topology-canvas' + this.topologyIndexF].offsetWidth,
|
|
||||||
y: this.$refs['topology-canvas' + this.topologyIndexF].offsetHeight
|
|
||||||
}
|
|
||||||
this.oldScale = getTopology(this.topologyIndex).data.scale
|
|
||||||
getTopology(this.topologyIndex).data.pens.forEach(item => {
|
|
||||||
if (flag) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (item.rect.ex > position.x || item.rect.ey > position.y) {
|
|
||||||
if (this.fromOverView) {
|
|
||||||
getTopology(this.topologyIndex).fitView(20)
|
|
||||||
}
|
|
||||||
flag = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
getTopology(this.topologyIndex).resize()
|
|
||||||
getTopology(this.topologyIndex).centerView()
|
|
||||||
if (this.fromChartBox || this.fromChart) { // 是否来自panel 和 chartBox
|
|
||||||
getTopology(this.topologyIndex).fitView(20)
|
|
||||||
if (this.chartInfo && this.chartInfo.param && this.chartInfo.param.lock) { // 判断节点 以及画布 是否可以拖动
|
|
||||||
getTopology(this.topologyIndex).lock(2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.penToolTipScale = getTopology(this.topologyIndex).data.scale
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
getTopology(this.topologyIndex).open(data)
|
||||||
|
getTopology(this.topologyIndex).centerView()
|
||||||
|
getTopology(this.topologyIndex).resize()
|
||||||
|
this.editTopology()
|
||||||
|
}, 100)
|
||||||
|
} else {
|
||||||
|
Promise.all(promiseArr).then((res) => {
|
||||||
|
getTopology(this.topologyIndex).open(data)
|
||||||
|
this.objChange = false
|
||||||
|
let flag = false
|
||||||
|
const position = {
|
||||||
|
x: this.$refs['topology-canvas' + this.topologyIndexF].offsetWidth,
|
||||||
|
y: this.$refs['topology-canvas' + this.topologyIndexF].offsetHeight
|
||||||
|
}
|
||||||
|
this.oldScale = getTopology(this.topologyIndex).data.scale
|
||||||
getTopology(this.topologyIndex).data.pens.forEach(item => {
|
getTopology(this.topologyIndex).data.pens.forEach(item => {
|
||||||
if (item.animatePlay) {
|
if (flag) {
|
||||||
item.stopAnimate()
|
return
|
||||||
setTimeout(() => {
|
|
||||||
item.startAnimate()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}, 100)
|
if (item.rect.ex > position.x || item.rect.ey > position.y) {
|
||||||
|
if (this.fromOverView) {
|
||||||
|
getTopology(this.topologyIndex).fitView(20)
|
||||||
|
}
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
getTopology(this.topologyIndex).resize()
|
||||||
|
getTopology(this.topologyIndex).centerView()
|
||||||
|
if (this.fromChartBox || this.fromChart) { // 是否来自panel 和 chartBox
|
||||||
|
getTopology(this.topologyIndex).fitView(20)
|
||||||
|
if (this.chartInfo && this.chartInfo.param && this.chartInfo.param.lock) { // 判断节点 以及画布 是否可以拖动
|
||||||
|
getTopology(this.topologyIndex).lock(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.penToolTipScale = getTopology(this.topologyIndex).data.scale
|
||||||
|
setTimeout(() => {
|
||||||
|
getTopology(this.topologyIndex).data.pens.forEach(item => {
|
||||||
|
if (item.animatePlay) {
|
||||||
|
item.stopAnimate()
|
||||||
|
setTimeout(() => {
|
||||||
|
item.startAnimate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
// if(this.fromPrev){
|
||||||
|
// getTopology(this.topologyIndex).scaleTo(data.scale/2)
|
||||||
|
// }
|
||||||
|
// getTopology(this.topologyIndex).fitView();
|
||||||
|
this.oldTopologyData = JSON.stringify(getTopology(this.topologyIndex).data)
|
||||||
|
this.getNodesArr()
|
||||||
})
|
})
|
||||||
// if(this.fromPrev){
|
}
|
||||||
// getTopology(this.topologyIndex).scaleTo(data.scale/2)
|
|
||||||
// }
|
|
||||||
// getTopology(this.topologyIndex).fitView();
|
|
||||||
this.oldTopologyData = JSON.stringify(getTopology(this.topologyIndex).data)
|
|
||||||
this.getNodesArr()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -754,11 +762,6 @@ export default {
|
|||||||
getTopology(this.topologyIndex).data.name = ''
|
getTopology(this.topologyIndex).data.name = ''
|
||||||
}
|
}
|
||||||
getTopology(this.topologyIndex).lock(1)
|
getTopology(this.topologyIndex).lock(1)
|
||||||
if (this.fromTopologyDialog && !this.isPreview) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.editTopology()
|
|
||||||
}, 100)
|
|
||||||
}
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -878,7 +881,6 @@ export default {
|
|||||||
const selLevel = pen.data.valueMapping.find(item => item.level === maxLevel)
|
const selLevel = pen.data.valueMapping.find(item => item.level === maxLevel)
|
||||||
if (selLevel) {
|
if (selLevel) {
|
||||||
pen.fontColor = selLevel.color.text
|
pen.fontColor = selLevel.color.text
|
||||||
console.log(pen.iconFamily)
|
|
||||||
if (pen.iconFamily) {
|
if (pen.iconFamily) {
|
||||||
pen.fillStyle = 'transparent'
|
pen.fillStyle = 'transparent'
|
||||||
pen.iconColor = selLevel.color.fill
|
pen.iconColor = selLevel.color.fill
|
||||||
@@ -1543,9 +1545,13 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
...imageTemp2.data,
|
...imageTemp2.data,
|
||||||
text: res.data.imageName,
|
text: res.data.imageName,
|
||||||
image: data,
|
image: data.data,
|
||||||
imageId: res.data.id,
|
imageId: res.data.id,
|
||||||
unit: this.uploadPic.unit
|
unit: this.uploadPic.unit,
|
||||||
|
rect: {
|
||||||
|
width: data.width,
|
||||||
|
height: data.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -1556,9 +1562,13 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
...imageTemp2.data,
|
...imageTemp2.data,
|
||||||
text: res.data.imageName,
|
text: res.data.imageName,
|
||||||
image: data,
|
image: data.data,
|
||||||
imageId: res.data.id,
|
imageId: res.data.id,
|
||||||
unit: this.uploadPic.unit
|
unit: this.uploadPic.unit,
|
||||||
|
rect: {
|
||||||
|
width: data.width,
|
||||||
|
height: data.height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -1664,9 +1674,10 @@ export default {
|
|||||||
imgArr.push({ ...item })
|
imgArr.push({ ...item })
|
||||||
})
|
})
|
||||||
Promise.all(promiseArr).then((res2, header) => {
|
Promise.all(promiseArr).then((res2, header) => {
|
||||||
|
console.log(res2)
|
||||||
this.iconArray = [...res.data.list]
|
this.iconArray = [...res.data.list]
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
item.image = res2[index]
|
item.image = res2[index].data
|
||||||
const group = this.tools.find(tool => tool.group === item.unit)
|
const group = this.tools.find(tool => tool.group === item.unit)
|
||||||
if (group) {
|
if (group) {
|
||||||
group.children.push({
|
group.children.push({
|
||||||
@@ -1674,9 +1685,13 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
...imageTemp2.data,
|
...imageTemp2.data,
|
||||||
text: item.imageName,
|
text: item.imageName,
|
||||||
image: res2[index],
|
image: res2[index].data,
|
||||||
imageId: item.id,
|
imageId: item.id,
|
||||||
unit: item.unit
|
unit: item.unit,
|
||||||
|
rect: {
|
||||||
|
width: res2[index].width,
|
||||||
|
height: res2[index].height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -1687,9 +1702,13 @@ export default {
|
|||||||
data: {
|
data: {
|
||||||
...imageTemp2.data,
|
...imageTemp2.data,
|
||||||
text: item.imageName,
|
text: item.imageName,
|
||||||
image: res2[index],
|
image: res2[index].data,
|
||||||
imageId: item.id,
|
imageId: item.id,
|
||||||
unit: item.unit
|
unit: item.unit,
|
||||||
|
rect: {
|
||||||
|
width: res2[index].width,
|
||||||
|
height: res2[index].height
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -1721,7 +1740,7 @@ export default {
|
|||||||
})
|
})
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
item.image = res2[index]
|
item.image = res2[index].data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.imgInit = true
|
this.imgInit = true
|
||||||
@@ -1739,11 +1758,13 @@ export default {
|
|||||||
.get(url)
|
.get(url)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return {
|
return {
|
||||||
data: ('data:image/jpeg;base64,' + res.data)
|
data: ('data:image/jpeg;base64,' + res.data),
|
||||||
|
width: res.headers.width === -1 ? 100 : (res.headers.width > 900 ? 900 : res.headers.width),
|
||||||
|
height: res.headers.height === -1 ? 100 : (res.headers.height > 900 ? 900 : res.headers.height)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
resolve(data.data, data.header)
|
resolve(data)
|
||||||
// changeImage(data,(img)=>{
|
// changeImage(data,(img)=>{
|
||||||
// resolve(img)
|
// resolve(img)
|
||||||
// })
|
// })
|
||||||
@@ -1779,6 +1800,10 @@ export default {
|
|||||||
item.data.expressArr = ['']
|
item.data.expressArr = ['']
|
||||||
item.data.legends = ['']
|
item.data.legends = ['']
|
||||||
}
|
}
|
||||||
|
if (!item.data.expressAllArr.length) {
|
||||||
|
item.data.expressArr = ['']
|
||||||
|
item.data.legends = ['']
|
||||||
|
}
|
||||||
item.animateType = item.data.animateType
|
item.animateType = item.data.animateType
|
||||||
if (item.type === 0) {
|
if (item.type === 0) {
|
||||||
item.fillStyle = item.data.fillStyle
|
item.fillStyle = item.data.fillStyle
|
||||||
|
|||||||
Reference in New Issue
Block a user