|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="bigBox">
|
|
|
- <div ref="container" class="container"></div>
|
|
|
+ <div ref="container" class="container" v-loading="loading"></div>
|
|
|
</div>
|
|
|
<!-- 功能模态框 -->
|
|
|
<AbilityModal v-if="abModal" :abModal="abModal" :modelId="modelId" :iedType="iedType" @abilityBack="abilityBack">
|
|
@@ -96,6 +96,7 @@ export default {
|
|
|
let startText = ref("")//开始节点名称
|
|
|
let endText = ref("")//结束节点名称
|
|
|
let lineType = ref("")//连接线
|
|
|
+ let loading = ref(false)
|
|
|
watch(() => props.lineMenuColor, (newVal) => {
|
|
|
copyColor.value = newVal
|
|
|
})
|
|
@@ -123,22 +124,26 @@ export default {
|
|
|
coolName.value = newVal
|
|
|
})
|
|
|
watch(() => props.coolObj, (newVal) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = true
|
|
|
copyObj.value = newVal
|
|
|
modelId.value = copyObj.value.id
|
|
|
- cid.getModelInfo(copyObj.value.id).then(res => {
|
|
|
+ cid.getModelInfo({ id: copyObj.value.id, pageno: 1, pagesize: 20 }).then(res => {
|
|
|
if (res.data[0].relation_json == null || res.data[0].relation_json == '') return;
|
|
|
const origiondata = JSON.parse(res.data[0].relation_json)
|
|
|
lf.value.render(origiondata);
|
|
|
+ loading.value = false
|
|
|
console.log('watchRender');
|
|
|
for (let index = 0; index < origiondata.edges.length; index++) {
|
|
|
const element = origiondata.edges[index];
|
|
|
if (element.properties != null && element.properties["issv"] === 'SV') {
|
|
|
let lineStyle = lf.value.getEdgeModelById(element.id)//.getEdgeStyle();
|
|
|
- console.log(lineStyle)
|
|
|
+ // console.log(lineStyle)
|
|
|
lineStyle.setProperties({ svEdge: { stroke: 'orange' } })
|
|
|
}
|
|
|
}
|
|
|
}, { immediate: true })
|
|
|
+ }, 3000);
|
|
|
})
|
|
|
watch(() => props.svOrGoose, (newVal) => {
|
|
|
numCase.value = newVal
|
|
@@ -174,7 +179,7 @@ export default {
|
|
|
const data = JSON.stringify(lf.value.getGraphData())
|
|
|
cid.saveMap(
|
|
|
{
|
|
|
- id: copyObj.value.id - 0,
|
|
|
+ id: copyObj.value.id - 0 || modelId.value - 0,
|
|
|
//model_name: coolName.value,
|
|
|
//vol_id: coolObj.value.id - 0,
|
|
|
//line_link_style: coolId.value - 0,
|
|
@@ -217,13 +222,14 @@ export default {
|
|
|
function momal() {
|
|
|
lf.value.graphModel.moveNode2Coordinate(copyId.value, setX.value - 0, setY.value - 0, true);
|
|
|
}
|
|
|
- function lastRender(){
|
|
|
+ function lastRender() {
|
|
|
+ loading.value = true
|
|
|
modelId.value = route.query.modelid
|
|
|
- cid.getModelInfo(modelId.value).then(res => {
|
|
|
+ cid.getModelInfo({ id: modelId.value, pageno: 1, pagesize: 20 }).then(res => {
|
|
|
if (res.data[0].relation_json == null || res.data[0].relation_json == '') return;
|
|
|
const origiondata = JSON.parse(res.data[0].relation_json)
|
|
|
lf.value.render(origiondata);
|
|
|
- console.log('watchRender');
|
|
|
+ loading.value = false
|
|
|
for (let index = 0; index < origiondata.edges.length; index++) {
|
|
|
const element = origiondata.edges[index];
|
|
|
if (element.properties != null && element.properties["issv"] === 'SV') {
|
|
@@ -240,6 +246,7 @@ export default {
|
|
|
coolName.value = props.needName
|
|
|
copyObj.value = props.coolObj
|
|
|
numCase.value = props.svOrGoose
|
|
|
+ copyColor.value = props.lineMenuColor
|
|
|
systemRow.getChildren({ code: "ied_type" }).then(res => {
|
|
|
needMap.value = res.data.map(item => {
|
|
|
return {
|
|
@@ -394,6 +401,15 @@ export default {
|
|
|
endText.value = end.text.value//结束文本
|
|
|
startTarget.value = start.properties
|
|
|
endTarget.value = end.properties
|
|
|
+ console.log(copyColor.value,'copy');
|
|
|
+ console.log(data,'data');
|
|
|
+ if(copyColor.value == '#255CE7'){
|
|
|
+ lf.value.graphModel.updateText(data.data.id, "GOOSE");
|
|
|
+ console.log('修改了goose');
|
|
|
+ }else if(copyColor.value == 'orange'){
|
|
|
+ lf.value.graphModel.updateText(data.data.id, "SV");
|
|
|
+ console.log('修改了sv');
|
|
|
+ }
|
|
|
ldModal.value = true
|
|
|
})
|
|
|
lf.value.on('node:mousemove', function (data, e) {//传递坐标轴参数到父组件
|
|
@@ -419,6 +435,9 @@ export default {
|
|
|
lf.value.extension.dndPanel.setPatternItems(needMap.value);
|
|
|
lf.value.render();
|
|
|
lastRender()
|
|
|
+ setTimeout(()=>{
|
|
|
+ loading.value = false
|
|
|
+ },10000)
|
|
|
})
|
|
|
})
|
|
|
function abilityBack(data) {
|
|
@@ -464,6 +483,7 @@ export default {
|
|
|
endText,//结束节点名称
|
|
|
lineType,//连接线
|
|
|
lastRender,//路由跳转的渲染
|
|
|
+ loading,
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -483,7 +503,9 @@ export default {
|
|
|
:deep(.lf-element-text) {
|
|
|
color: black;
|
|
|
}
|
|
|
-
|
|
|
+/* :deep(.lf-dndpanel){
|
|
|
+ w
|
|
|
+} */
|
|
|
/* :deep(.lf-basic-shape) {
|
|
|
width: 150px;
|
|
|
height: 150px;
|