<template>
|
<div class="app-container">
|
<div class="filter-container">
|
<el-input v-model="listQuery.keyword" size="small" placeholder="请输入发送人/报警类型" clearable class="filter-item w-200" />
|
<el-button-group class="filter-item">
|
<el-button size="small" type="primary" icon="el-icon-search" @click="search">
|
搜索
|
</el-button>
|
<el-button size="small" type="primary" icon="el-icon-refresh" @click="refresh">
|
刷新
|
</el-button>
|
</el-button-group>
|
</div>
|
|
<el-table v-loading="listLoading" :data="list" element-loading-text="Loading" border fit height="100%"
|
class="table-container" highlight-current-row>
|
<el-table-column fixed label="ID" width="70" >
|
<template slot-scope="scope">
|
{{ scope.row.id }}
|
</template>
|
</el-table-column>
|
<el-table-column label="报警类型" >
|
<template slot-scope="scope">
|
{{ scope.row.type }}
|
</template>
|
</el-table-column>
|
<el-table-column label="发送人" width="100">
|
<template slot-scope="scope">
|
{{ scope.row.name }}
|
</template>
|
</el-table-column>
|
<el-table-column label="发送电话" width="110">
|
<template slot-scope="scope">
|
{{ scope.row.phone }}
|
</template>
|
</el-table-column>
|
<el-table-column label="发送部门" >
|
<template slot-scope="scope">
|
{{ scope.row.bumen}}
|
</template>
|
</el-table-column>
|
<el-table-column label="发送内容" width="980">
|
<template slot-scope="scope">
|
{{ scope.row.msg}}
|
</template>
|
</el-table-column>
|
<el-table-column label="发送时间" width="180">
|
<template slot-scope="scope">
|
{{ scope.row.addtime}}
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<pagination v-show="total > 0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size"
|
@pagination="fetchData" />
|
</div>
|
</template>
|
|
<script>
|
import Pagination from '@/components/Pagination'
|
import { getDuanxinlogPage, searchDuanxinlog } from '@/api/duanxinlog'
|
import { deepClone } from '@/utils'
|
|
export default {
|
components: {
|
Pagination
|
},
|
data() {
|
return {
|
total: 0,
|
list: [],
|
menus: [],
|
listLoading: true,
|
listQuery: {
|
current: 1,
|
size: 20,
|
keyword: undefined,
|
username:localStorage.getItem('username')
|
},
|
dialogVisible: false,
|
dialogType: 'create',
|
loading: false
|
}
|
},
|
created() {
|
this.fetchData()
|
},
|
methods: {
|
// 搜索
|
search() {
|
this.listLoading = true
|
searchDuanxinlog(this.listQuery).then(response => {
|
console.log(response);
|
|
|
this.list = response.data.records
|
this.total = response.data.total
|
this.listLoading = false
|
})
|
},
|
refresh() {
|
this.listQuery = {
|
current: 1,
|
size: 20,
|
keyword: undefined,
|
username:localStorage.getItem('username')
|
}
|
this.fetchData()
|
},
|
// 分页数据
|
fetchData() {
|
this.listLoading = true
|
getDuanxinlogPage(this.listQuery).then(response => {
|
this.list = response.data.records
|
this.total = response.data.total
|
this.listLoading = false
|
})
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.el-upload {
|
border: 1px dashed #d9d9d9 !important;
|
border-radius: 6px;
|
cursor: pointer;
|
position: relative;
|
overflow: hidden;
|
|
.el-icon-plus.avatar-uploader-icon {
|
border: 1px dashed #d9d9d9 !important;
|
border-radius: 6px;
|
font-size: 28px;
|
color: #8c939d;
|
width: 128px;
|
height: 128px;
|
line-height: 128px;
|
text-align: center;
|
}
|
}
|
|
.avatar-uploader {
|
height: 128px;
|
|
img {
|
width: 128px;
|
height: 128px;
|
}
|
}
|
</style>
|