<template>
|
<div class="DevList">
|
<div class="title">GB28181配置</div>
|
<div class="empty" v-if="devList.length === 0">
|
<img src="/images/search/1.png" alt="" />
|
<div class="des">您还未添加集群或设备,请在设备管理中添加</div>
|
<div class="button add" @click="$router.push('/equipmentList')">
|
立即添加
|
</div>
|
</div>
|
<div class="list scroll">
|
<div class="devItem" v-for="(item, index) in clusterList" :key="index">
|
<div class="mainInfo">
|
<img src="/images/hashrate/cluster.png" alt="" />
|
|
<div class="right">
|
<div class="name">{{ item.cluster_name }}</div>
|
<div class="ip">{{ item.virtual_ip }}</div>
|
<div class="number">设备总量:{{ item.nodeNum }}</div>
|
</div>
|
|
<div
|
class="button set"
|
@click="setting({ clusterId: item.cluster_id }, item.nodeList)"
|
>
|
配置
|
</div>
|
</div>
|
</div>
|
<div
|
class="devItem"
|
v-for="(item, index) in devList"
|
:key="index + 'dev'"
|
>
|
<div class="mainInfo">
|
<img src="/images/hashrate/equipment.png" alt="" />
|
|
<div class="right">
|
<div class="name">{{ item.devName }}</div>
|
<div class="ip">{{ item.devIp }}</div>
|
</div>
|
|
<div class="button set" @click="setting({ devId: item.devId })">
|
配置
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<SettingBox
|
v-if="showSettingBox"
|
@close="showSettingBox = false"
|
:id="idObj"
|
:nodeList="nodeList"
|
></SettingBox>
|
</div>
|
</template>
|
|
<script>
|
import SettingBox from "@/views/GB28181/components/SettingBox";
|
import { getClusterDevList } from "@/api/clusterManage";
|
|
export default {
|
components: {
|
SettingBox,
|
},
|
created() {
|
this.getClusterDevList();
|
},
|
data() {
|
return {
|
clusterList: [],
|
devList: [],
|
showSettingBox: false,
|
idObj: {},
|
nodeList: [],
|
};
|
},
|
methods: {
|
async getClusterDevList() {
|
const res = await getClusterDevList();
|
if (res && res.success) {
|
this.clusterList = res.data.clusterList;
|
this.devList = res.data.devList;
|
}
|
},
|
setting(id, nodeList) {
|
this.idObj = id;
|
this.nodeList = nodeList ? nodeList : [];
|
this.showSettingBox = true;
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped >
|
.DevList {
|
position: relative;
|
box-sizing: border-box;
|
padding: 20px;
|
width: 1280px;
|
height: 770px;
|
background-color: #fff;
|
margin: 0 auto;
|
|
.title {
|
margin-bottom: 20px;
|
height: 20px;
|
padding-left: 20px;
|
font-weight: 700;
|
font-size: 16px;
|
border-left: 4px solid #0065ff;
|
}
|
|
.empty {
|
text-align: center;
|
|
img {
|
margin-top: 150px;
|
margin-bottom: 10px;
|
width: 260px;
|
}
|
|
.des {
|
margin-bottom: 30px;
|
font-size: 14px;
|
}
|
|
.add {
|
margin: 0 auto;
|
width: 112px;
|
height: 40px;
|
text-align: center;
|
line-height: 40px;
|
color: #fff;
|
background-color: #0065ff;
|
}
|
}
|
|
.list {
|
display: flex;
|
flex-wrap: wrap;
|
overflow-y: auto;
|
height: 710px;
|
|
.devItem {
|
position: relative;
|
margin: 0 15px 20px 0;
|
width: 295px;
|
height: 150px;
|
border: 1px solid #c0c5cc;
|
border-radius: 5px;
|
|
.mainInfo {
|
display: flex;
|
padding: 20px;
|
|
img {
|
margin-right: 20px;
|
width: 88px;
|
}
|
}
|
|
.right {
|
.name {
|
margin-bottom: 6px;
|
font-size: 16px;
|
font-weight: 700;
|
}
|
|
.ip,
|
.number {
|
margin-bottom: 2px;
|
font-size: 12px;
|
color: #666;
|
}
|
}
|
|
.set {
|
position: absolute;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
height: 40px;
|
line-height: 40px;
|
text-align: center;
|
border: 1px solid #c0c5cc;
|
font-size: 16px;
|
color: #0065ff;
|
}
|
|
&:nth-child(4n) {
|
margin-right: 0;
|
}
|
|
&:hover {
|
box-shadow: 0px 2px 16px 0px rgba(0, 43, 106, 0.25);
|
|
.set {
|
color: #fff;
|
background-color: #0065ff;
|
border-color: #0065ff;
|
}
|
}
|
}
|
}
|
}
|
</style>
|