修改设备监控页面显示数据名称
This commit is contained in:
@@ -2,39 +2,35 @@
|
|||||||
<d2-container>
|
<d2-container>
|
||||||
<el-card class="box-card" v-for="(item, index) in serverData" :key="index">
|
<el-card class="box-card" v-for="(item, index) in serverData" :key="index">
|
||||||
<div slot="header" class="device-header">
|
<div slot="header" class="device-header">
|
||||||
<span>前置服务 {{ item.name }} ({{ item.ip }} )</span>
|
<span>前置服务 {{ item.server_name }} ({{ item.url }} )</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-row :gutter="12">
|
<el-row :gutter="12">
|
||||||
<el-col :span="6" v-for="i in item.children" :key="i">
|
<el-col :span="6" v-for="i in item.devices" :key="i">
|
||||||
<el-popover placement="top" trigger="click">
|
<el-popover placement="top" trigger="click">
|
||||||
|
|
||||||
<el-menu @select="(index) => setServeStatus(i.id, index)" :style="{ 'borderRight': 'none' }">
|
<el-menu @select="(index) => setServeStatus(i.id, index)" :style="{ 'borderRight': 'none' }">
|
||||||
<el-menu-item index="0">
|
<el-menu-item index="0">
|
||||||
<!-- <i class="el-icon-menu"></i> -->
|
|
||||||
<span slot="title">暂停</span>
|
<span slot="title">暂停</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="1">
|
<el-menu-item index="1">
|
||||||
<!-- <i class="el-icon-menu"></i> -->
|
|
||||||
<span slot="title">重启</span>
|
<span slot="title">重启</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="2">
|
<el-menu-item index="2">
|
||||||
<!-- <i class="el-icon-menu"></i> -->
|
|
||||||
<span slot="title">关闭</span>
|
<span slot="title">关闭</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
<el-card slot="reference"
|
<el-card slot="reference"
|
||||||
:class="{ 'box-card': true, 'online': i.status === 1, 'offline': i.status === 0 }">
|
:class="{ 'box-card': true, 'online': i.device_status === 1, 'offline': i.device_status !== 1 }">
|
||||||
<div slot="header" class="header-title">
|
<div slot="header" class="header-title">
|
||||||
<span>{{ i.name }}</span>
|
<span>{{ i.device_name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
||||||
<span>设备类型</span>
|
<span>设备类型</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" style="padding-left:0px;">:{{ i.DeviceType }}</el-col>
|
<el-col :span="14" style="padding-left:0px;">:{{ i.device_type }}</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<!-- <el-row :gutter="24">
|
||||||
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
||||||
<span>IP/端口</span>
|
<span>IP/端口</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -51,18 +47,18 @@
|
|||||||
<span>采集耗时</span>
|
<span>采集耗时</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" style="padding-left:0px;">:{{ i.hs }}</el-col>
|
<el-col :span="14" style="padding-left:0px;">:{{ i.hs }}</el-col>
|
||||||
</el-row>
|
</el-row> -->
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
||||||
<span>成功次数</span>
|
<span>成功次数</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" style="padding-left:0px;">:{{ i.success_number }}</el-col>
|
<el-col :span="14" style="padding-left:0px;">:{{ i.success_count }}</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
<el-col :span="5" style="padding-right:0px;margin-bottom: 5px;">
|
||||||
<span>失败次数</span>
|
<span>失败次数</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14" style="padding-left:0px;">:{{ i.fail_number }}</el-col>
|
<el-col :span="14" style="padding-left:0px;">:{{ i.fail_count }}</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-alert v-if="i.error_mesage" :title="i.error_mesage" type="error" :closable="false">
|
<el-alert v-if="i.error_mesage" :title="i.error_mesage" type="error" :closable="false">
|
||||||
@@ -80,93 +76,36 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'ServeMonitoring',
|
data () {
|
||||||
data() {
|
return {
|
||||||
return {
|
serverData: []
|
||||||
serverData: [{
|
|
||||||
ip: '192.168.0.31',
|
|
||||||
name: '#001',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
name: 'DEV_001_001',
|
|
||||||
DeviceType: '西门子 S1200',
|
|
||||||
ip: '192.168.0.31',
|
|
||||||
port: '55667',
|
|
||||||
time: '2022-01-01 02:32:22',
|
|
||||||
hs: '537ms',
|
|
||||||
success_number: '827,732,221',
|
|
||||||
fail_number: '827,732,221',
|
|
||||||
error_mesage: 'Connected xxxx:Timeout',
|
|
||||||
status: 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
name: 'DEV_001_001',
|
|
||||||
DeviceType: '西门子 S1200',
|
|
||||||
ip: '192.168.0.31',
|
|
||||||
port: '55667',
|
|
||||||
time: '2022-01-01 02:32:22',
|
|
||||||
hs: '537ms',
|
|
||||||
success_number: '827,732,221',
|
|
||||||
fail_number: '827,732,221',
|
|
||||||
error_mesage: '',
|
|
||||||
status: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3',
|
|
||||||
name: 'DEV_001_001',
|
|
||||||
DeviceType: '西门子 S1200',
|
|
||||||
ip: '192.168.0.31',
|
|
||||||
port: '55667',
|
|
||||||
time: '2022-01-01 02:32:22',
|
|
||||||
hs: '537ms',
|
|
||||||
success_number: '827,732,221',
|
|
||||||
fail_number: '827,732,221',
|
|
||||||
error_mesage: '',
|
|
||||||
status: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '4',
|
|
||||||
name: 'DEV_001_001',
|
|
||||||
DeviceType: '西门子 S1200',
|
|
||||||
ip: '192.168.0.31',
|
|
||||||
port: '55667',
|
|
||||||
time: '2022-01-01 02:32:22',
|
|
||||||
hs: '537ms',
|
|
||||||
success_number: '827,732,221',
|
|
||||||
fail_number: '827,732,221',
|
|
||||||
error_mesage: '',
|
|
||||||
status: 0,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getServe() {
|
|
||||||
try {
|
|
||||||
const res = await this.$api.QUERY_SERVE_MONITORING()
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async setServeStatus(id, status) {
|
|
||||||
try {
|
|
||||||
const data = { id: id, status: status }
|
|
||||||
//await this.$api.SET_SERVE_STATUS(data)
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
this.getServe()
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async getServe () {
|
||||||
|
try {
|
||||||
|
this.serverData = await this.$api.GET_SERVE_MONITORING()
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async setServeStatus (id, status) {
|
||||||
|
try {
|
||||||
|
// const data = { id: id, status: status }
|
||||||
|
// await this.$api.SET_SERVE_STATUS(data)
|
||||||
|
this.$message({
|
||||||
|
message: '操作成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
this.getServe()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.getServe()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -179,7 +118,7 @@ export default {
|
|||||||
.device-header {
|
.device-header {
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 20px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.online {
|
.online {
|
||||||
@@ -200,6 +139,6 @@ export default {
|
|||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
|
|
||||||
font-size: 20px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user