济菏高速业务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

453 lines
12 KiB

1 year ago
<template>
<div class='topolog'>
1 year ago
<div class="list">
12 months ago
<div v-for="(item, index) in list" @click="listClick(index)"
:class="'listItem keep-ratio ' + (selIndex === index ? 'listItemAction' : '')">
{{ item.name }}
1 year ago
</div>
</div>
<div class="card">
12 months ago
<div class="top ">
<div class="t-left">{{ name }}</div>
<div style="display: flex;">
<div class="t-right" v-for="(item,index) in card">
交换机总数 <template v-if="card.length>1">({{ index+1 }})</template><span class="len">{{ item.total }}</span>
<div class="space"></div>
故障数<span class="len err">{{ item.error }}</span>
</div>
</div>
</div>
<div class="content" v-if="selIndex===0">
<div class="c c-border">
<div class="arrow-panel-line">
<div class="arrowdow"></div>
<div class="arrowdow"></div>
</div>
<div class="arrow-panel" style="margin-top: -5px;">
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
</div>
<div v-for="(item, index) in topo" v-if="index < 5" class="switch">
<div :class="'line ' + (item.netWorkStatus ? '' : 'liner')"></div>
<div :class="'arrowdown ' + (item.netWorkStatus ? '' : 'arrowr')"></div>
<div :class="'c-name ' + (item.netWorkStatus ? '' : 'c-namer')">{{ item.switchName }}</div>
<div :class="'line ' + (item.netWorkStatus ? '' : 'liner')"></div>
<div :class="'arrowdown ' + (item.netWorkStatus ? '' : 'arrowr')" style="margin-top:-35px;"></div>
<img v-if="item.netWorkStatus" src="./switch1.png">
<img v-else src="./switch0.png">
<div :class="'c-name c-namesw ' + (item.netWorkStatus ? '' : 'c-namer')">sw</div>
<div :class="'c-desc ' + (item.netWorkStatus ? '' : 'c-descr')">
<div>桩号{{ item.stakeMark }}</div>
<div>IP{{ item.switchIp }}</div>
</div>
</div>
<div class="arrow-panel" style="margin-top: 292px;">
<div class="arrow arrowrig"></div>
<div class="arrow arrowrig"></div>
<div class="arrow arrowrig"></div>
<div class="arrow arrowrig"></div>
</div>
<div class="arrow-panel-line" style="margin-left: 100.1%;">
<div class="arrowdow arrowtop"></div>
<div class="arrowdow arrowtop"></div>
</div>
</div>
<div class="c " style="margin-top: -5px;">
<div v-for="(item, index) in topo" v-if="index >= 5" class="switch">
<div :class="'line ' + (item.netWorkStatus ? '' : 'liner')"></div>
<div :class="'arrowdown ' + (item.netWorkStatus ? '' : 'arrowr')"></div>
<div :class="'c-name ' + (item.netWorkStatus ? '' : 'c-namer')">{{ item.switchName }}</div>
<div :class="'line ' + (item.netWorkStatus ? '' : 'liner')"></div>
<div :class="'arrowdown ' + (item.netWorkStatus ? '' : 'arrowr')" style="margin-top:-35px;"></div>
<img class="imgsw" v-if="item.netWorkStatus" src="./switch1.png" />
<img class="imgsw" v-else src="./switch0.png" />
<div :class="'c-name ' + (item.netWorkStatus ? '' : 'c-namer')"
style="padding:0px 50px;margin-top: -5px;border:0px">sw</div>
<div :class="'c-desc ' + (item.netWorkStatus ? '' : 'c-descr')">
<div>桩号{{ item.stakeMark }}</div>
<div>IP{{ item.switchIp }}</div>
</div>
</div>
</div>
</div>
<div class="content" v-else>
<div class="c c-border" style="margin-bottom: 30px;" v-for="(item,index) of topo">
<div class="arrow-panel-line">
<div class="arrowdow"></div>
<div class="arrowdow"></div>
</div>
<div class="arrow-panel" style="margin-top: -5px;">
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
</div>
<div class="cscorll">
<div :style="' height: 290px;width:'+item.length*200+'px;'">
<div v-for="(itm, idx) in item" class="switchScro">
<div class="switch">
<div :class="'line ' + (itm.netWorkStatus ? '' : 'liner')"></div>
<div :class="'arrowdown ' + (itm.netWorkStatus ? '' : 'arrowr')" style="margin-top: -30px;"></div>
<img class="imgsw" v-if="itm.netWorkStatus" src="./switch1.png" />
<img class="imgsw" v-else src="./switch0.png" />
<div :class="'c-name c-namesw ' + (itm.netWorkStatus ? '' : 'c-namer')">{{itm.switchName}}({{index+1}})</div>
<div :class="'line ' + (itm.netWorkStatus ? '' : 'liner')" style="height: 40px"></div>
<div :class="'arrowdown ' + (itm.netWorkStatus ? '' : 'arrowr')" style="margin-top: -30px;"></div>
<div :class="'device-list ' + (itm.netWorkStatus ? '' : 'device-list-r')">
<div v-for="(idv,idvx) in itm.dcDeviceList">
<div class="device-item">
<img src="./t10.png" />
<div>{{ idv.deviceName }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="arrow-panel" style="margin-top: 292px;">
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
<div class="arrow"></div>
</div>
<div class="arrow-panel-line" style="margin-left: 100.1%;">
<div class="arrowdow"></div>
<div class="arrowdow"></div>
</div>
</div>
1 year ago
</div>
</div>
1 year ago
</div>
</template>
<script>
1 year ago
import request from '@/utils/request'
import { Message } from "element-ui";
12 months ago
const enum_device_type = [
{type: "1", label: "枪机",}
]
1 year ago
export default {
name: 'InDevelopment',
components: {
},
12 months ago
1 year ago
data() {
return {
list: [],
12 months ago
selIndex: 0,
name: '',
card: [{total: 0, error: 0 }],
topo: []
1 year ago
}
},
1 year ago
mounted() {
1 year ago
this.bind()
12 months ago
request({
url: "/type/list",
method: "get",
}).then(res=>{
console.log(res)
});
1 year ago
},
12 months ago
methods: {
bind() {
1 year ago
request({
12 months ago
url: '/business/switch/list',
method: 'get'
}).then(result => {
if (result.code != 200) return Message.error(result?.msg);
this.map = result.data[0];
let list = [{ name: this.map.switchName }]
this.map.children.forEach(e => {
list.push({ name: e.switchName })
});
this.list = list;
this.listClick();
})
},
listClick(e = 0) {
this.selIndex = e;
if (e === 0) {
this.name = this.map.switchName,
this.card = [{
total: this.map.children.length,
error: this.map.children.filter(x => x.netWorkStatus === 0).length
}]
this.topo = this.map.children
} else {
this.name = this.map.children[e-1].switchName;
let cards = [];
let topo = [];
const list = this.map.children[e-1].children;
const list1 = list.filter(x=>x.ringNetWork === 1)
if(list1){
cards.push({
total: list1.length,
error: list1.filter(x => x.netWorkStatus === 0).length
})
topo.push(list1)
}
const list2 = list.filter(x=>x.ringNetWork === 2)
if(list2 && list2.length > 0){
cards.push({
total: list2.length,
error: list2.filter(x => x.netWorkStatus === 0).length
})
topo.push(list2)
}
this.topo = topo;
this.card = cards;
}
1 year ago
}
1 year ago
}
}
</script>
<style lang='scss' scoped>
.topolog {
width: 100%;
height: 100%;
position: relative;
z-index: 6;
color: white;
display: flex;
justify-content: center;
align-items: center;
p {
font-size: 200px;
}
}
12 months ago
.list {
width: 15vw;
1 year ago
height: 100%;
color: white;
12 months ago
margin: 0px 40px 0px 20px;
.listItem {
1 year ago
background-image: url(../topology/left-bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
12 months ago
height: 50px;
1 year ago
width: 100%;
text-align: center;
12 months ago
line-height: 50px;
1 year ago
margin-top: 20px;
}
12 months ago
.listItemAction {
background-image: url(../topology/left-bg-action.png);
}
1 year ago
}
12 months ago
.card {
1 year ago
flex: 1;
12 months ago
height: 100%;
.top {
width: 99%;
height: 50px;
margin-top: 20px;
display: flex;
justify-content: space-between;
.t-left {
height: 50px;
padding: 0px 20px;
line-height: 50px;
border-radius: 5px;
background: linear-gradient(to top, #278ea9, #ffffff00);
}
.t-right {
display: flex;
padding: 0px 30px;
border-radius: 5px;
background: linear-gradient(to top, #278ea9, #ffffff00);
justify-content: center;
align-items: flex-end;
padding-bottom: 10px;
margin-left: 20px;
.len {
color: #12F7B2;
font-size: 26px;
font-weight: bold;
margin: 0px 10px;
}
.err {
color: #FF5935;
}
.space {
width: 40px;
}
}
}
}
.content {
width: 99%;
margin-top: 20px;
}
.c {
display: flex;
flex-direction: row;
justify-content: space-around;
height: 300px;
}
.c-border {
border: 2px solid #34d3eb;
position: relative;
}
.arrow-panel {
position: absolute;
z-index: 999;
width: 65%;
display: flex;
justify-content: space-around;
.arrow {
width: 25px;
height: 10px;
background: linear-gradient(to right, #34d3eb, #ffffff00);
border-radius: 50%;
}
.arrowrig {
background: linear-gradient(to left, #34d3eb, #ffffff00);
}
}
.arrow-right {
width: 100%;
position: absolute;
background-color: #ff0000dd;
}
.arrow-panel-line {
height: 300px;
display: flex;
flex-direction: column;
position: absolute;
margin-left: -100.1%;
z-index: 99999;
justify-content: space-around;
.arrowdow {
border-radius: 50%;
width: 10px;
height: 20px;
background: linear-gradient(to top, #34d3eb, #ffffff00);
}
.arrowtop {
background: linear-gradient(to bottom, #34d3eb, #ffffff00);
}
}
.cscorll{
width: 80vw;
height: 290px;
overflow-x: auto;
overflow-y: hidden;
z-index: 9999;
}
.switchScro{
height: 300px;
width: 200px;
margin-right: 20px;
float: left;
}
.switch {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
.line {
height: 50px;
background-color: #34d3eb;
width: 2px;
}
.liner {
background-color: #FF5935;
}
.arrowdown {
width: 10px;
height: 20px;
background: linear-gradient(to top, #34d3eb, #ffffff00);
margin-top: -25px;
border-radius: 50%;
}
.arrowr {
background: linear-gradient(to top, #FF5935, #ffffff00);
}
.c-name {
background: linear-gradient(270deg, rgba(61, 231, 253, 0) 0%, rgba(61, 231, 253, 0.7) 51%, rgba(61, 231, 253, 0) 100%);
border-radius: 4px;
padding: 10px 30px;
margin-top: 5px;
border: 1px solid #34d3eb;
}
.c-namesw{
padding:0px 50px;
margin-top: -5px;
font-size: 14px;
border:0px !important;
}
.c-namer {
background: linear-gradient(270deg, rgba(255, 90, 54, 0) 0%, rgba(255, 90, 54, 0.8) 51%, rgba(255, 90, 54, 0) 100%);
border: 1px solid #FF5935;
}
.c-desc {
background: linear-gradient(to bottom, #102229 5%, #34d3eb);
padding: 5px 50px;
margin-bottom: 30px;
font-size: 14px;
padding-top: 10px;
}
.c-descr {
background: linear-gradient(to bottom, #102229 5%, #FF5935);
}
img {
width: 70px;
height: 50px;
margin-top: 10px;
}
}
.device-list{
border: 1px dashed #34d3eb;
height: 90px;
min-width: 160px;
margin-top: 10px;
}
.device-list-r{
border-color: #FF5935;
}
.device-item{
image{
width: 30px;
height: 30px;
}
1 year ago
}
1 year ago
</style>