<template>
|
|
<!-- <b-card no-body >
|
<b-card-header header-tag="h5">
|
预警信息
|
</b-card-header>
|
<div class="pl20 pr20 pt10 pb30">
|
<Table
|
:data="tableList"
|
highlight-current-row
|
ref="leftTable"
|
>
|
<TableColumn
|
type="index"
|
prop="index"
|
label="序号"
|
:index="snMethod"
|
width="50"
|
/>
|
<TableColumn
|
label="地图名称"
|
prop="name"
|
/>
|
<TableColumn
|
label="更新时间"
|
prop="updateTime"
|
width="200"
|
/>
|
</Table>
|
<div class="pt20 pb20">
|
<b-pagination class="justify-content-center justify-content-sm-end m-0"
|
v-if="total"
|
v-model="activePage"
|
:total-rows="total"
|
:per-page="pageSize"
|
/>
|
</div>
|
</div>
|
</b-card> -->
|
<b-card no-body>
|
<b-card-header header-tag="h5" class="with-elements pr-0 pb-0">
|
<div class="card-header-title">预警信息</div>
|
</b-card-header>
|
<div class="pl10 pr10 pt10 overflow-y" style="height:80vh">
|
<b-list-group :flush="true" v-if="tableList.length !== 0">
|
<b-list-group-item class="py-3" v-for="(iteam,index) in tableList" :key="index">
|
<div class="badge badge-danger float-right">预警</div>
|
<div class="font-weight-semibold f18">{{index+1}}、【{{iteam.alarmType}}】</div>
|
<p class="text-truncate my-1"><span class="text-muted">报警时间:</span>{{iteam.alarmTime}}</p>
|
<p class="text-truncate"><span class="text-muted">报警地点:</span>{{iteam.deviceName}}</p>
|
</b-list-group-item>
|
</b-list-group>
|
<div class="py-5 text-center" v-else>
|
<small class="text-muted">暂无数据</small>
|
</div>
|
</div>
|
<div class="pb20 pl10 pr10" v-if="total">
|
<hr class="border-light mt-0">
|
<b-pagination class="justify-content-center justify-content-sm-end m-0" v-model="activePage" :total-rows="total" :per-page="pageSize" />
|
</div>
|
</b-card>
|
</template>
|
<!-- Page -->
|
<script>
|
import { Table, TableColumn } from 'element-ui'
|
import { getActiveAlarmList } from '@/server/home.js'
|
export default {
|
name: 'HomeAlarmInfoList',
|
data() {
|
return {
|
userInfo: this.$store.getters.basicUserInfo,
|
name: '',
|
tableList: [],
|
total: 0,
|
pageSize: 10,
|
activePage: 1
|
}
|
},
|
computed: {},
|
methods: {
|
snMethod(index) {
|
return this.activePage > 1
|
? this.pageSize * (this.activePage - 1) + index + 1
|
: index + 1
|
},
|
/* 设备列表初始化 */
|
async _initData() {
|
let res = await getActiveAlarmList({
|
orgId: this.userInfo.orgId,
|
startTime: this.$moment().format('YYYY-MM-DD 00:00:00'),
|
endTime: this.$moment().format('YYYY-MM-DD 23:59:59')
|
})
|
if (res) {
|
this.tableList = res
|
}
|
}
|
},
|
watch: {
|
activePage(val, oldVal) {
|
if (val !== oldVal) {
|
this.activePage = val
|
this._initData()
|
}
|
}
|
},
|
created() {
|
/* 查询列表 */
|
this._initData()
|
},
|
components: {
|
Table,
|
TableColumn
|
}
|
}
|
</script>
|