<script setup>
|
import doorInfoHistoryModule from "@/views/accessControl/js/doorInfoHistoryModule";
|
import {onMounted} from "vue";
|
const props = defineProps({
|
id: {
|
type: [Number, String],
|
default: 0
|
},
|
name: {
|
type: [Number, String],
|
default: 0
|
}
|
});
|
|
const {page, doorHistoryData, searchDoorHistory, exportFile} = doorInfoHistoryModule(props.id);
|
const handleSizeChange = (size)=>{
|
page.value.pageSize = size;
|
searchDoorHistory();
|
}
|
const handleCurrentChange = (current)=>{
|
page.value.pageCurr = current;
|
searchDoorHistory();
|
}
|
|
onMounted(()=>{
|
searchDoorHistory();
|
});
|
</script>
|
|
<template>
|
<div class="tbl-wrapper">
|
<div class="tbl-container">
|
<el-table
|
stripe
|
empty-text="暂无数据"
|
:data="doorHistoryData"
|
height="100%">
|
<el-table-column
|
type="index"
|
label="编号"
|
width="80">
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="carcameraName"
|
label="门禁名称">
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="recordTime"
|
label="开门时间">
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="state"
|
label="状态变换">
|
</el-table-column>
|
</el-table>
|
</div>
|
<div class="paging-wrapper">
|
<el-button type="primary" size="small" @click="searchDoorHistory()">查询</el-button>
|
<el-popover placement="top" effect="dark" :width="200" trigger="click">
|
<template #reference>
|
<el-button type="primary" size="small" style="margin-right: 16px">导出</el-button>
|
</template>
|
<el-button type="primary" size="small" @click="exportFile">导出当前页</el-button>
|
<el-button type="primary" size="small" @click="exportFile(true)">导出全部</el-button>
|
</el-popover>
|
<div class="paging-container">
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page.sync="page.pageCurr"
|
:page-size="page.pageSize"
|
layout="total, sizes, prev, pager, next"
|
:total="page.total">
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<style scoped>
|
.tbl-wrapper {
|
background-color: #FFFFFF;
|
}
|
.tbl-container {
|
width: 700px;
|
height: 440px;
|
}
|
.paging-wrapper {
|
text-align: center;
|
padding: 4px 8px;
|
}
|
.paging-container {
|
margin-left: 8px;
|
display: inline-block;
|
}
|
</style>
|