feat:隐藏首页topo的projectInfo

This commit is contained in:
zhangyu
2021-02-05 13:35:47 +08:00
parent 624eaa9760
commit 4684fcf8a6
3 changed files with 34 additions and 21 deletions

View File

@@ -3,9 +3,9 @@
@import "./L5/css/props.css"; @import "./L5/css/props.css";
</style> </style>
<template> <template>
<div class="project-box" v-loading="topologyLoading"> <div class="project-box" v-loading="topologyLoading" :style="{'border':fromOverView?'none':'1px solid #eeeeee'}">
<!--project主要信息--> <!--project主要信息-->
<div class="facade-top" v-if="!editTopologyFlag"> <div class="facade-top" v-if="!editTopologyFlag&&!fromOverView">
<div class="facade-top-left" v-loading="projectInfo.loading" v-if="projectInfoShow&&!fromPrev"> <div class="facade-top-left" v-loading="projectInfo.loading" v-if="projectInfoShow&&!fromPrev">
<div class="facade-top-title"> <div class="facade-top-title">
Project information Project information
@@ -202,7 +202,7 @@
<!--所有节点上的小图标--> <!--所有节点上的小图标-->
<div v-for="(item,index) in nodesArr" <div v-for="(item,index) in nodesArr"
:style="{position: 'absolute',top:item.rect.y - 48+'px',left:item.rect.center.x - 24 +'px'}" :style="{position: 'absolute',top:item.rect.y - 48+'px',left:item.rect.center.x - 24 +'px'}"
v-if="!editTopologyFlag" v-if="!editTopologyFlag&&item.data.iconToolState&&!fromPrev"
class="network-pop" class="network-pop"
> >
@@ -255,7 +255,7 @@
</div> </div>
<!--chart--> <!--chart-->
<div v-if="popDataShow.total"> <div v-if="popDataShow.total">
<topoTooltip :chartDataParent="chartData" :filterTime="filterTime" :isChart="true"/> <topoTooltip :chartDataParent="chartDataInfo" :filterTime="filterTime" :isChart="true"/>
</div> </div>
</div> </div>
<!--endpoint--> <!--endpoint-->
@@ -346,6 +346,7 @@
name:'topologyL5', name:'topologyL5',
data(){ data(){
return { return {
chartDataInfo:{},
topoPrevData:{},//预览数据 topoPrevData:{},//预览数据
imgInit:false,//判断图片是否加载完成 imgInit:false,//判断图片是否加载完成
toolGroup:'基本形状', toolGroup:'基本形状',
@@ -956,11 +957,11 @@
nodeTools(node,tool){ nodeTools(node,tool){
this.moduleId=node.data.moduleId; this.moduleId=node.data.moduleId;
setTimeout(()=>{ setTimeout(()=>{
this.popDataShowUpdate(tool.id) this.popDataShowUpdate(tool.id,false,node)
},100) },100)
}, },
popDataShowUpdate(key,flag){//key 显示对应的弹窗 flag是否不显示工具栏 popDataShowUpdate(key,flag,node){//key 显示对应的弹窗 flag是否不显示工具栏
this.popDataShow={ this.popDataShow={
endpoint:false, endpoint:false,
asset:false, asset:false,
@@ -970,6 +971,9 @@
alert:false, alert:false,
main:false, main:false,
}; };
if(key==='total'){
this.chartDataInfo={...node.data,...this.chartGetData.find(item=>item.id===node.id)};
}
this.$nextTick(()=>{ this.$nextTick(()=>{
this.popDataShow[key]=true; this.popDataShow[key]=true;
}); });

View File

@@ -5,7 +5,7 @@
<template> <template>
<div class="project-box" v-loading="topologyLoading"> <div class="project-box" v-loading="topologyLoading">
<!--project主要信息--> <!--project主要信息-->
<div class="facade-top" v-if="!editTopologyFlag"> <div class="facade-top" v-if="!editTopologyFlag&&!fromOverView">
<div class="facade-top-left" v-loading="projectInfo.loading" v-if="projectInfoShow&&!fromPrev"> <div class="facade-top-left" v-loading="projectInfo.loading" v-if="projectInfoShow&&!fromPrev">
<div class="facade-top-title"> <div class="facade-top-title">
Project information Project information
@@ -202,14 +202,14 @@
<!--所有节点上的小图标--> <!--所有节点上的小图标-->
<div v-for="(item,index) in nodesArr" <div v-for="(item,index) in nodesArr"
:style="{position: 'absolute',top:item.rect.y - 48+'px',left:item.rect.center.x - 24 +'px'}" :style="{position: 'absolute',top:item.rect.y - 48+'px',left:item.rect.center.x - 24 +'px'}"
v-if="!editTopologyFlag" v-if="!editTopologyFlag&&item.data.iconToolState&&!fromPrev"
class="network-pop" class="network-pop"
> >
<i <i
:class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.data.error&&!item.data.show,'model-error-active':item.data.error&&item.data.show}" :class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.data.error&&!item.data.show,'model-error-active':item.data.error&&item.data.show}"
:ref="'modelTopId'+index" :ref="'modelTopId'+index"
@click="showNodeTools(index)" @click="showNodeTools(index,item)"
> >
<i class="nz-icon nz-icon-model"></i> <i class="nz-icon nz-icon-model"></i>
</i> </i>
@@ -250,12 +250,13 @@
<div v-if="popDataShow.main"> <div v-if="popDataShow.main">
<popDataMain :moduleId="moduleId" :projectId="projectInfo.id"></popDataMain> <popDataMain :moduleId="moduleId" :projectId="projectInfo.id"></popDataMain>
</div> </div>
<div v-if="popDataShow.total">
<total-chart :moduleId="moduleId" :projectId="projectInfo.id" :nodesArray="totalArray"></total-chart>
</div>
<div v-if="popDataShow.info"> <div v-if="popDataShow.info">
<popDataInfo :moduleId="moduleId" :projectId="projectInfo.id"></popDataInfo> <popDataInfo :moduleId="moduleId" :projectId="projectInfo.id"></popDataInfo>
</div> </div>
<!--chart-->
<div v-if="popDataShow.total">
<topoTooltip :chartDataParent="chartDataInfo" :filterTime="filterTime" :isChart="true"/>
</div>
</div> </div>
<!--endpoint--> <!--endpoint-->
<transition name="right-box"> <transition name="right-box">
@@ -282,14 +283,14 @@
:before-close="previewBeforeClose" :before-close="previewBeforeClose"
> >
<div style="width: calc(80vw - 40px);height: 80vh"> <div style="width: calc(80vw - 40px);height: 80vh">
<topologyL5 <topologyPrev
v-if="previewShow" v-if="previewShow"
:obj="obj" :obj="obj"
:topoPrevDataS="topoPrevData" :topoPrevDataS="topoPrevData"
:fromOverView="true" :fromOverView="true"
:fromPrev="true" :fromPrev="true"
:topologyIndexF="1"> :topologyIndexF="1">
</topologyL5> </topologyPrev>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@@ -331,7 +332,7 @@
import topoTooltip from "./L5/topoTooltip"; import topoTooltip from "./L5/topoTooltip";
import {getMetricTypeValue} from '../js/tools' import {getMetricTypeValue} from '../js/tools'
import bus from "../../../libs/bus"; import bus from "../../../libs/bus";
import topologyL5 from './topologyL5' import topologyPrev from './topologyPrev'
import axios from 'axios'; import axios from 'axios';
const canvasOptions={ const canvasOptions={
@@ -345,6 +346,7 @@
name:'topologyL5', name:'topologyL5',
data(){ data(){
return { return {
chartDataInfo:{},
topoPrevData:{},//预览数据 topoPrevData:{},//预览数据
imgInit:false,//判断图片是否加载完成 imgInit:false,//判断图片是否加载完成
toolGroup:'基本形状', toolGroup:'基本形状',
@@ -457,7 +459,7 @@
endpointTable, endpointTable,
ExpressionInfo, ExpressionInfo,
topoTooltip, topoTooltip,
topologyL5, topologyPrev,
}, },
computed:{}, computed:{},
props:{ props:{
@@ -944,7 +946,8 @@
}, },
//显示module的工具 //显示module的工具
showNodeTools(index){ showNodeTools(index,pen){
console.log(pen);
this.nodesArr.forEach((item,i)=>{ this.nodesArr.forEach((item,i)=>{
item.data.show=i===index; item.data.show=i===index;
}) })
@@ -954,11 +957,11 @@
nodeTools(node,tool){ nodeTools(node,tool){
this.moduleId=node.data.moduleId; this.moduleId=node.data.moduleId;
setTimeout(()=>{ setTimeout(()=>{
this.popDataShowUpdate(tool.id) this.popDataShowUpdate(tool.id,false,node)
},100) },100)
}, },
popDataShowUpdate(key,flag){//key 显示对应的弹窗 flag是否不显示工具栏 popDataShowUpdate(key,flag,node){//key 显示对应的弹窗 flag是否不显示工具栏
this.popDataShow={ this.popDataShow={
endpoint:false, endpoint:false,
asset:false, asset:false,
@@ -968,6 +971,9 @@
alert:false, alert:false,
main:false, main:false,
}; };
if(key==='total'){
this.chartDataInfo={...node.data,...this.chartGetData.find(item=>item.id===node.id)};
}
this.$nextTick(()=>{ this.$nextTick(()=>{
this.popDataShow[key]=true; this.popDataShow[key]=true;
}); });
@@ -1005,7 +1011,7 @@
}, },
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))
if(getTopology(this.topologyIndex)){ if(getTopology(this.topologyIndex)){
this.cachesIndex=getTopology(this.topologyIndex).caches.index; this.cachesIndex=getTopology(this.topologyIndex).caches.index;
@@ -1256,8 +1262,10 @@
case 'line': case 'line':
case 'space': case 'space':
case 'scale': case 'scale':
case 'translate':
this.moduleId=''; this.moduleId='';
this.showNodeTools(''); this.showNodeTools('');
this.popDataShowUpdate('',false)
break; break;
} }
switch(event){ switch(event){
@@ -1883,7 +1891,7 @@
position: absolute; position: absolute;
top: 1px; top: 1px;
left: 2px; left: 2px;
transform: scale(0.9); transform: scale(0.95);
z-index: 0; z-index: 0;
} }

View File

@@ -1664,6 +1664,7 @@
font-size: 18px; font-size: 18px;
margin: 0; margin: 0;
position: absolute; position: absolute;
z-index: 1;
} }
.el-carousel__item:nth-child(2n) { .el-carousel__item:nth-child(2n) {