老产品前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

173 lines
4.1 KiB

<template>
<div class="dialog-h-content scroll-h ">
<div class="div_dialog_table">
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%">
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50">
</el-table-column>
<el-table-column prop="createdTime"
header-align="center"
align="center"
label="通知时间"
width="150">
</el-table-column>
<el-table-column prop="channel"
header-align="center"
align="center"
label="渠道"
width="180">
</el-table-column>
<el-table-column prop="content"
header-align="center"
align="center"
label="内容"
min-width="380">
</el-table-column>
<el-table-column prop="sendResShow"
header-align="center"
align="center"
label="状态"
min-width="180">
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // 引入Loading服务
import { requestPost } from '@/js/dai/request'
let loading // 加载动画
export default {
data () {
return {
tableLoading: false,
total: 0,
realIdCard: '',
tableData: [],
pageSize: 20,
pageNo: 1,
origin: ''
}
},
components: {},
mounted () {
},
methods: {
async initTable (realIdCard, origin) {
this.realIdCard = realIdCard
this.origin = origin
await this.loadTable()
},
//加载form
async loadTable () {
this.tableLoading = true
const url = "/epmetuser/icNotice/page"
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNotice/page"
let params = {
idCard: this.realIdCard,
pageNo: this.pageNo,
pageSize: this.pageSize,
origin: this.origin
}
const { data, code, msg } = await requestPost(url, params)
this.tableLoading = false
if (code === 0) {
this.total = data.total
this.tableData = data.list
this.tableData.forEach(item => {
item.sendResShow = item.sendRes === '1' ? '成功' : item.sendRes === '0' ? '失败' : ''
});
// this.tableData = [...data.list]
} else {
this.$message.error(msg)
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
// 开启加载动画
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: '正在加载……', // 加载中需要显示的文字
background: 'rgba(0,0,0,.7)' // 背景颜色
})
},
// 结束加载动画
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return (this.clientHeight - 460)
},
...mapGetters(['clientHeight'])
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
</style>