Commit 366bb8c3 authored by Asjoker's avatar Asjoker

feat: 业务监控-业务列表

parent d3910d92
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<el-button type="primary" size="small" @click="handleQuery">查询</el-button> <el-button type="primary" size="small" @click="handleQuery">查询</el-button>
</el-form-item> </el-form-item>
<el-button id="fullScreen" style="float: right;margin: 0 10px">{{ isScreen ? '退出全屏' : '全屏' }}</el-button> <el-button id="fullScreen" style="float: right;margin: 0 10px">{{ isScreen ? '退出全屏' : '全屏' }}</el-button>
<el-button style="float: right;margin: 0 10px" @click="refresh">刷新</el-button>
</el-form> </el-form>
<div class="placeholder" /> <div class="placeholder" />
<div style="padding: 10px"> <div style="padding: 10px">
...@@ -230,6 +231,9 @@ export default { ...@@ -230,6 +231,9 @@ export default {
} }
})// 实现模块全屏 })// 实现模块全屏
}, },
refresh() {
window.location.reload() // 刷新页面
},
/** 查询登录日志 */ /** 查询登录日志 */
getList() { getList() {
this.loading = true this.loading = true
......
<template> <template>
<div id="sylog-container" class="app-container-realTime"> <div id="sylog-container" class="realTime-container">
<el-tabs v-model="currentTab" type="card"> <div class="warnHead">
<el-tab-pane label="实时报告" name="1"> <div class="warnBtns">
<div style="padding: 10px 10px 10px 0"> <el-button class="headBtn" @click="changeTime">添加</el-button>
<el-table <el-button class="headBtn" @click="changeTime">修改</el-button>
v-loading="loading" <el-button class="headBtn" @click="handleDelete">删除</el-button>
border <el-button class="headBtnW" @click="refresh">刷新</el-button>
:data="data" <el-button id="fullScreen" class="headBtnW">{{ isScreen ? '退出全屏' : '全屏' }}</el-button>
:header-cell-style="{textAlign: 'center'}" </div>
@selection-change="handleSelectionChange" </div>
> <div class="app-container-realTime">
<el-table-column type="expand"> <el-tabs v-model="currentTab" type="card">
<template slot-scope="props"> <el-tab-pane label="实时报告" name="1">
<span>{{ props.row.path }}</span> <div style="padding: 10px 10px 10px 0">
</template> <el-table
</el-table-column> v-loading="loading"
<el-table-column :show-overflow-tooltip="true" label="监测对象" align="center" prop="monitorObject"> border
<template slot-scope="scope"> :data="data"
{{ scope.row.monitorObject || '-' }} :header-cell-style="{textAlign: 'center'}"
</template> @selection-change="handleSelectionChange"
</el-table-column> >
<el-table-column :show-overflow-tooltip="true" label="监测点名称" align="center" prop="monitorName"> <el-table-column type="expand">
<template slot-scope="scope"> <template slot-scope="props">
{{ scope.row.monitorName || '-' }} <span>{{ props.row.path }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" label="状态" align="center" width="100" prop="logContent"> <el-table-column :show-overflow-tooltip="true" label="监测对象" align="center" prop="monitorObject">
<template> <template slot-scope="scope">
<span class="st-square" style="background-color: #3db58d;" /> {{ scope.row.monitorObject || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :show-overflow-tooltip="true" label="CPU使用效率(%)" width="250" align="center" prop="cpu"> <el-table-column :show-overflow-tooltip="true" label="监测点名称" align="center" prop="monitorName">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.cpuRate || '-' }} {{ scope.row.monitorName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> <el-table-column :show-overflow-tooltip="true" label="状态" align="center" width="100" prop="logContent">
</div> <template>
<pagination <span class="st-square" style="background-color: #3db58d;" />
v-show="total>0" </template>
:total="total" </el-table-column>
:page.sync="queryParams.page" <el-table-column :show-overflow-tooltip="true" label="CPU使用效率(%)" width="250" align="center" prop="cpu">
:limit.sync="queryParams.rows" <template slot-scope="scope">
@pagination="getList" {{ scope.row.cpuRate || '-' }}
/> </template>
</el-tab-pane> </el-table-column>
<el-tab-pane label="指标统计" name="2"> </el-table>
<div style="padding: 10px 10px 10px 0"> </div>
<el-table <pagination
v-loading="loading" v-show="total>0"
border :total="total"
:data="initialData" :page.sync="queryParams.page"
:header-cell-style="{textAlign: 'center'}" :limit.sync="queryParams.rows"
> @pagination="getList"
<el-table-column :show-overflow-tooltip="true" label="指标名称" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.name || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="最大值" align="center" prop="createTime">
<template slot-scope="scope">
{{ scope.row.max || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="最小值" align="center" prop="logContent">
<template slot-scope="scope">
{{ scope.row.min || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="平均值" align="center" prop="logContent">
<template slot-scope="scope">
{{ scope.row.average || '-' }}
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<el-dialog :visible.sync="open" title="添加报告" width="700px">
<el-form label-width="100px">
<el-form-item label="报告标题">
<el-input />
</el-form-item>
<el-form-item label="每页显示报告数">
<el-input />
</el-form-item>
<el-form-item label="选择设备列表">
<el-date-picker
v-model="queryParams.endTime"
type="datetime"
size="small"
value-format="yyyy-MM-DD HH:MM:SS"
/> />
</el-form-item> </el-tab-pane>
</el-form> <el-tab-pane label="指标统计" name="2">
<div style="padding: 10px 10px 10px 0">
<el-table
v-loading="loading"
border
:data="initialData"
:header-cell-style="{textAlign: 'center'}"
>
<el-table-column :show-overflow-tooltip="true" label="指标名称" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.name || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="最大值" align="center" prop="createTime">
<template slot-scope="scope">
{{ scope.row.max || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="最小值" align="center" prop="logContent">
<template slot-scope="scope">
{{ scope.row.min || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="平均值" align="center" prop="logContent">
<template slot-scope="scope">
{{ scope.row.average || '-' }}
</template>
</el-table-column>
</el-table>
</div>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer"> <el-dialog :visible.sync="open" title="添加报告" width="700px">
<el-button @click="open = false">取消</el-button> <el-form label-width="110px">
<el-button type="primary" @click="open = false">确定</el-button> <el-form-item label="报告标题">
</div> <el-input />
</el-dialog> </el-form-item>
<el-form-item label="每页显示报告数">
<el-input />
</el-form-item>
<el-form-item label="选择设备列表">
<div class="equipmentDiv">
<el-tree
:data="treeData"
show-checkbox
node-key="id"
:default-expanded-keys="[2, 3]"
:default-checked-keys="[5]"
/>
</div>
</el-form-item>
<el-form-item label="选择监测点类型">
<span style="font-weight: bold">监测点类型</span>
<el-select />
<span style="font-weight: bold">监测指标</span>
<el-select placeholder="请选择" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="open = false">取消</el-button>
<el-button type="primary" @click="open = false">确定</el-button>
</div>
</el-dialog>
</div>
</div> </div>
</template> </template>
...@@ -125,7 +145,7 @@ export default { ...@@ -125,7 +145,7 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单参数 // 表单参数
isScreen: screenfull.isEnabled, isScreen: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
page: 1, page: 1,
...@@ -262,42 +282,38 @@ export default { ...@@ -262,42 +282,38 @@ export default {
} }
], ],
treeData: [{ treeData: [{
id: 1,
label: '本机容器', label: '本机容器',
children: [{ children: [{
id: 4,
label: '虚拟化平台', label: '虚拟化平台',
children: [{ children: [{
label: '信服工业云平台' id: 9,
}, { label: '虚拟设备'
label: '192.168.1.30'
}, { }, {
label: '虚拟机虚拟化硬件' id: 10,
label: '三级 1-1-2'
}] }]
}] }]
}, { }, {
label: '一级 2', id: 2,
label: '服务器硬件',
children: [{ children: [{
label: '二级 2-1', id: 5,
children: [{ label: '云打印服务器'
label: '三级 2-1-1'
}]
}, { }, {
label: '二级 2-2', id: 6,
children: [{ label: '服务器'
label: '三级 2-2-1'
}]
}] }]
}, { }, {
id: 3,
label: '一级 3', label: '一级 3',
children: [{ children: [{
label: '二级 3-1', id: 7,
children: [{ label: '二级 3-1'
label: '三级 3-1-1'
}]
}, { }, {
label: '二级 3-2', id: 8,
children: [{ label: '二级 3-2'
label: '三级 3-2-1'
}]
}] }]
}] }]
} }
...@@ -325,11 +341,29 @@ export default { ...@@ -325,11 +341,29 @@ export default {
handleExpand() { handleExpand() {
const element = document.getElementById('sylog-container')// 指定全屏区域元素 const element = document.getElementById('sylog-container')// 指定全屏区域元素
document.getElementById('fullScreen').addEventListener('click', () => { document.getElementById('fullScreen').addEventListener('click', () => {
if (screenfull.isEnabled) { if (screenfull.isEnabled && this.isScreen === false) {
screenfull.request(element) screenfull.request(element)
} else {
screenfull.exit()
} }
})// 实现模块全屏 })// 实现模块全屏
}, },
refresh() {
window.location.reload() // 刷新页面
},
handleDelete() {
const h = this.$createElement
this.$confirm(h('p', null, [
h('span', null, '确定删除本报告吗? '),
h('br', null),
h('span', { style: 'font-size: 8px' }, '提示:该操作无法恢复')
]), '', {
customClass: 'custom-confirm',
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
},
/** 查询登录日志 */ /** 查询登录日志 */
getList() { getList() {
this.loading = true this.loading = true
...@@ -360,9 +394,40 @@ export default { ...@@ -360,9 +394,40 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.realTime-container{
.warnHead{
height: 58px;
padding: 15px 20px 10px 20px;
background-color: #edeef3 !important;
border-bottom: 1px solid #DBDDE3;
.warnBtns{
float: right;
.headBtn{
line-height: 10px;
color: #fff;
border-color: #768398;
background-color: #768398;
}
.headBtnW{
border-radius: 4px;
line-height: 22px;
font-size: 12px;
padding: 0 10px;
margin: 0 5px;
}
}
}
.app-container-realTime { .app-container-realTime {
padding: 0 20px; padding: 0 20px;
font-size: 18px; font-size: 18px;
.equipmentDiv{
max-height: 200px;
height: 200px;
overflow: auto;
border: 1px solid #d2d6de;
padding: 10px 0;
border-radius: 4px;
}
.placeholder{ .placeholder{
height:14px; height:14px;
background-color: #F4F4F4; background-color: #F4F4F4;
...@@ -376,5 +441,6 @@ export default { ...@@ -376,5 +441,6 @@ export default {
display: inline-block; display: inline-block;
} }
} }
}
</style> </style>
<template>
<div id="sylog-container" class="app-container-Sylog">
<!-- <div class="placeholder" />-->
<div style="padding: 10px">
<div class="mb12 font-small-bold" style="width: 100px;display: inline-block">业务列表</div>
<el-button id="fullScreen" style="float: right;margin: -5px 10px 10px">{{ isScreen ? '退出全屏' : '全屏' }}</el-button>
<el-button style="float: right;margin: -5px 10px 10px" @click="refresh">刷新</el-button>
<el-table
v-loading="loading"
border
:data="data"
:header-cell-style="{textAlign: 'center'}"
@selection-change="handleSelectionChange"
>
<el-table-column :show-overflow-tooltip="true" label="名称" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.name || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="状态" align="center" prop="ipAddress">
<template slot-scope="scope">
<span v-if="scope.row.status === '1'" class="st-square" style="background-color: #3db58d;" />
<span v-else class="st-square" style="background-color: #eb5d5d;" />
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="健康度" align="center" prop="ipAddress">
<template slot-scope="scope">
<div :style="{ color: scope.row.status === '1' ? '#3db58d' : '#eb5d5d'}">
{{ scope.row.health || '-' }}
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="可用性" align="center" prop="ipAddress">
<template slot-scope="scope">
<div :style="{ color: scope.row.status === '1' ? '#3db58d' : '#eb5d5d'}">
{{ scope.row.useful || '-' }}
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="繁忙度" align="center" prop="ipAddress">
<template slot-scope="scope">
<div :style="{ color: scope.row.status === '1' ? '#3db58d' : '#eb5d5d'}">
{{ scope.row.busy || '-' }}
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="告警(关键)" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.warnKey || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="告警(重要)" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.warnImportant || '-' }}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" label="告警(普通)" align="center" prop="ipAddress">
<template slot-scope="scope">
{{ scope.row.warnNormal || '-' }}
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<el-dialog :visible.sync="open" title="自定义时间" width="500px">
<el-form label-width="100px">
<el-form-item label="开始日期">
<el-date-picker
v-model="queryParams.startTime"
type="datetime"
size="small"
value-format="yyyy-MM-DD HH:MM:SS"
/>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="queryParams.endTime"
type="datetime"
size="small"
value-format="yyyy-MM-DD HH:MM:SS"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="open = false">取消</el-button>
<el-button type="primary" @click="open = false">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import screenfull from 'screenfull'
export default {
name: 'SnmpTrapLog',
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 总条数
total: 0,
// 表格数据
list: [],
// 是否显示弹出层
open: false,
// 表单参数
form: {},
// 表单参数
isScreen: false,
// 查询参数
queryParams: {
page: 1,
rows: 10,
status: 1,
startTime: '',
endTime: '',
ipAddress: '',
logContent: ''
},
data: [
{
name: 'OA业务部',
status: '1',
health: '97%',
useful: '25%',
busy: '2%',
warnKey: '0',
warnImportant: '0',
warnNormal: '1'
},
{
name: '市场部',
status: '0',
health: '0%',
useful: '0%',
busy: '100%',
warnKey: '0',
warnImportant: '0',
warnNormal: '1'
},
{
name: '职能部',
status: '1',
health: '97%',
useful: '45%',
busy: '2%',
warnKey: '0',
warnImportant: '0',
warnNormal: '1'
},
{
name: '开发部',
status: '1',
health: '85%',
useful: '25%',
busy: '2%',
warnKey: '0',
warnImportant: '0',
warnNormal: '1'
},
{
name: '测试部',
status: '0',
health: '0%',
useful: '0%',
busy: '100%',
warnKey: '16',
warnImportant: '0',
warnNormal: '1'
},
{
name: '运维部',
status: '0',
health: '0%',
useful: '0%',
busy: '100%',
warnKey: '5',
warnImportant: '0',
warnNormal: '1'
}
]
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
this.$store.dispatch('searchSave/searchParamsSet', {
path: this.$route.path,
param: {
...this.queryParams
}
})
next()
},
created() {
this.getList()
},
mounted() {
this.handleExpand()
window.onresize = () => {
this.isScreen = screenfull.isFullscreen
}
},
methods: {
handleExpand() {
const element = document.getElementById('sylog-container')// 指定全屏区域元素
document.getElementById('fullScreen').addEventListener('click', () => {
if (screenfull.isEnabled && this.isScreen === false) {
screenfull.request(element)
} else {
screenfull.exit()
}
})// 实现模块全屏
},
refresh() {
window.location.reload() // 刷新页面
},
/** 查询登录日志 */
getList() {
this.loading = true
setTimeout(() => {
this.loading = false
}, 500)
},
/** 查询按钮操作 */
changeTime() {
this.open = !this.open
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = ''
this.resetForm('queryForm')
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.operId)
}
}
}
</script>
<style lang="scss" scoped>
.app-container-Sylog {
padding: 0;
font-size: 18px;
.placeholder{
height:14px;
background-color: #F4F4F4;
margin-bottom:10px
}
.st-square{
cursor: pointer;
margin-right: 6px;
width: 9px;
height: 9px;
display: inline-block;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment