Commit 366bb8c3 authored by Asjoker's avatar Asjoker

feat: 业务监控-业务列表

parent d3910d92
......@@ -46,6 +46,7 @@
<el-button type="primary" size="small" @click="handleQuery">查询</el-button>
</el-form-item>
<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>
<div class="placeholder" />
<div style="padding: 10px">
......@@ -230,6 +231,9 @@ export default {
}
})// 实现模块全屏
},
refresh() {
window.location.reload() // 刷新页面
},
/** 查询登录日志 */
getList() {
this.loading = true
......
<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