|
@@ -65,7 +65,7 @@
|
|
|
<section class="search-btn">
|
|
<section class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
- <el-button @click="">导出</el-button>
|
|
|
|
|
|
|
+ <el-button @click="handleDownload">导出</el-button>
|
|
|
</section>
|
|
</section>
|
|
|
</div>
|
|
</div>
|
|
|
</header>
|
|
</header>
|
|
@@ -80,7 +80,9 @@
|
|
|
<template #violateType="scope">
|
|
<template #violateType="scope">
|
|
|
<span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
|
|
<span>{{ ACT_VIOLATION_TYPE_LABEL[scope.row.violateType] }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #capturePhotos="scope"> </template>
|
|
|
|
|
|
|
+ <template #capturePhotos="scope">
|
|
|
|
|
+ <ImageViewer :file-list="scope.row.capturePhotos" />
|
|
|
|
|
+ </template>
|
|
|
<template #createSource="scope">
|
|
<template #createSource="scope">
|
|
|
<span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
|
|
<span>{{ ACT_NOTICE_DATA_SOURCE_LABEL[scope.row.createSource] }}</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -148,7 +150,14 @@
|
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
import type { ActTableSearch, ActTableQuery, ActTableData, UpdateActQuery } from './types';
|
|
import type { ActTableSearch, ActTableQuery, ActTableData, UpdateActQuery } from './types';
|
|
|
- import { getActTableList, noticeActData, deleteActData } from '@/api/traffic-violation/traffic-act';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getActTableList,
|
|
|
|
|
+ noticeActData,
|
|
|
|
|
+ deleteActData,
|
|
|
|
|
+ exportActViolation,
|
|
|
|
|
+ } from '@/api/traffic-violation/traffic-act';
|
|
|
|
|
+ import { downloadFile } from '@/views/disaster/utils/download';
|
|
|
|
|
+ import ImageViewer from './components/ImageViewer.vue';
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -156,7 +165,8 @@
|
|
|
// 搜索栏
|
|
// 搜索栏
|
|
|
const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
|
|
const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
|
|
|
const searchData = reactive<ActTableSearch>({});
|
|
const searchData = reactive<ActTableSearch>({});
|
|
|
- function handleSearch() {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function getQuery() {
|
|
|
if (!selectableInputRef.value) return;
|
|
if (!selectableInputRef.value) return;
|
|
|
tabelQuery.queryParam = {
|
|
tabelQuery.queryParam = {
|
|
|
pageType: 1,
|
|
pageType: 1,
|
|
@@ -175,6 +185,10 @@
|
|
|
tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
|
|
tabelQuery.queryParam.startTime = dayjs(searchData.searchTime[0]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
tabelQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
|
|
tabelQuery.queryParam.endTime = dayjs(searchData.searchTime[1]).format('YYYY-MM-DD HH:MM:ss');
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function handleSearch() {
|
|
|
|
|
+ getQuery();
|
|
|
getTabelData();
|
|
getTabelData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -187,6 +201,20 @@
|
|
|
searchData.searchTime = undefined;
|
|
searchData.searchTime = undefined;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ async function handleDownload() {
|
|
|
|
|
+ getQuery();
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await exportActViolation(tabelQuery.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);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 表格
|
|
// 表格
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
|