|
|
@@ -5,7 +5,7 @@
|
|
|
<section class="select-box">
|
|
|
<div class="select-box--item">
|
|
|
<span>地点:</span>
|
|
|
- <el-input v-model="searchData.todoshijian" placeholder="请输入地点" clearable> </el-input>
|
|
|
+ <el-input v-model="searchData.captureLocation" placeholder="请输入地点" clearable> </el-input>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>时间:</span>
|
|
|
@@ -44,8 +44,11 @@
|
|
|
import { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';
|
|
|
import { BreakTableData, BreakTableQuery } from '../types';
|
|
|
import { OUTER_PERSON_BREAK_TABEL_COLUMNS, TABLE_OPTIONS } from '../configs/table';
|
|
|
+ import { exportBreakTableList, getBreakTableList } from '@/api/security-confidentiality-person/outer-person';
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
|
|
|
- const searchData = reactive<any>({});
|
|
|
+ const searchData = reactive<BreakTableQuery>({});
|
|
|
const searchTime = ref<string[]>([]);
|
|
|
|
|
|
const { tableConfig, pagination } = useTableConfig(OUTER_PERSON_BREAK_TABEL_COLUMNS, TABLE_OPTIONS);
|
|
|
@@ -58,7 +61,7 @@
|
|
|
queryParam: {},
|
|
|
});
|
|
|
function getQuery() {
|
|
|
- const query = {
|
|
|
+ tableQuery.queryParam = {
|
|
|
...searchData,
|
|
|
startTime: searchTime.value[0],
|
|
|
endTime: searchTime.value[1],
|
|
|
@@ -66,20 +69,7 @@
|
|
|
}
|
|
|
async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
|
- const res = await new Promise<QueryPageResponse<BreakTableData>>((resolve) => {
|
|
|
- resolve({
|
|
|
- totalRow: 1,
|
|
|
- records: [
|
|
|
- {
|
|
|
- todoshijian: 1,
|
|
|
- todozhuapaididian: 'aaa',
|
|
|
- todozhuapaishijian: '2023-01-01 00:00:00',
|
|
|
- todozhuapaitupian: '',
|
|
|
- todolaiyuan: 1,
|
|
|
- },
|
|
|
- ],
|
|
|
- });
|
|
|
- });
|
|
|
+ const res = await getBreakTableList(tableQuery);
|
|
|
tableData.value = res.records;
|
|
|
pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
|
@@ -112,16 +102,16 @@
|
|
|
|
|
|
async function handleDownload() {
|
|
|
getQuery();
|
|
|
- // try {
|
|
|
- // const res = await exportActViolation(tableQuery.queryParam);
|
|
|
- // if (res.size === 0) return;
|
|
|
- // const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
- // const url = window.URL.createObjectURL(blob);
|
|
|
- // downloadFile(url, '违规行为记录.xlsx');
|
|
|
- // } catch (e) {
|
|
|
- // ElMessage.error('下载失败');
|
|
|
- // console.log(e);
|
|
|
- // }
|
|
|
+ try {
|
|
|
+ const res = await exportBreakTableList(tableQuery.queryParam);
|
|
|
+ if (res.size === 0) return;
|
|
|
+ const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
+ const url = window.URL.createObjectURL(blob);
|
|
|
+ downloadFile(url, '违规行为记录.xlsx');
|
|
|
+ } catch (e) {
|
|
|
+ ElMessage.error('下载失败');
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
getTableData();
|