|
|
@@ -10,7 +10,9 @@
|
|
|
<el-button type="primary" class="search-table-container--button" :icon="Plus" @click="handleCreateAct">
|
|
|
新建记录
|
|
|
</el-button>
|
|
|
- <el-button plain class="search-table-container--button" @click=""> 批量导入 </el-button>
|
|
|
+ <el-button plain class="search-table-container--button" @click="batchImportVisible = true">
|
|
|
+ 批量导入
|
|
|
+ </el-button>
|
|
|
<RealtimeNotice />
|
|
|
</div>
|
|
|
|
|
|
@@ -122,6 +124,14 @@
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
</main>
|
|
|
+ <BatchImport
|
|
|
+ :visible="batchImportVisible"
|
|
|
+ :importApiUrl="importApiUrl"
|
|
|
+ :templateUrl="templateUrl"
|
|
|
+ :templateName="'违规行为记录-批量导入模版'"
|
|
|
+ @close="() => (batchImportVisible = false)"
|
|
|
+ @update="handleUpdate"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -131,6 +141,7 @@
|
|
|
import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import RealtimeNotice from './components/RealtimeNotice.vue';
|
|
|
+ import dayjs from 'dayjs';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import { TABLE_OPTIONS, VIOLATION_ACT_TABLE_COLUMNS } from './configs/tables';
|
|
|
import {
|
|
|
@@ -158,7 +169,9 @@
|
|
|
} from '@/api/traffic-violation/traffic-act';
|
|
|
import { downloadFile } from '@/views/disaster/utils/download';
|
|
|
import ImageViewer from './components/ImageViewer.vue';
|
|
|
- import dayjs from 'dayjs';
|
|
|
+ import { BatchImport } from '@/components/batch-import';
|
|
|
+ import { useGlobSetting } from '@/hooks/setting';
|
|
|
+ import urlJoin from 'url-join';
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
@@ -189,7 +202,7 @@
|
|
|
|
|
|
function handleSearch() {
|
|
|
getQuery();
|
|
|
- getTabelData();
|
|
|
+ getTableData();
|
|
|
}
|
|
|
|
|
|
function handleReset() {
|
|
|
@@ -233,12 +246,12 @@
|
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
|
tabelQuery.pageSize = value;
|
|
|
- getTabelData();
|
|
|
+ getTableData();
|
|
|
};
|
|
|
const handleCurrentChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
|
tabelQuery.pageSize = value;
|
|
|
- getTabelData();
|
|
|
+ getTableData();
|
|
|
};
|
|
|
|
|
|
const handleSelectionChange = (value: any[]) => {};
|
|
|
@@ -265,7 +278,7 @@
|
|
|
// getTableData();
|
|
|
// };
|
|
|
|
|
|
- async function getTabelData() {
|
|
|
+ async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
|
const res = await getActTableList(tabelQuery);
|
|
|
tableData.value = res.records;
|
|
|
@@ -273,8 +286,19 @@
|
|
|
tableConfig.loading = false;
|
|
|
}
|
|
|
|
|
|
+ // 批量导入
|
|
|
+ const batchImportVisible = ref(false);
|
|
|
+ const { urlPrefix } = useGlobSetting();
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/trafficViolation/importTrafficViolationList'));
|
|
|
+ const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-vehicle-template.xlsx');
|
|
|
+
|
|
|
+ const handleUpdate = () => {
|
|
|
+ batchImportVisible.value = false;
|
|
|
+ getTableData();
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
- await getTabelData();
|
|
|
+ await getTableData();
|
|
|
});
|
|
|
|
|
|
function handleCreateAct() {
|
|
|
@@ -305,7 +329,7 @@
|
|
|
} finally {
|
|
|
tableConfig.loading = false;
|
|
|
}
|
|
|
- getTabelData();
|
|
|
+ getTableData();
|
|
|
}
|
|
|
|
|
|
async function handleDeleteAct(id: number) {
|
|
|
@@ -318,7 +342,7 @@
|
|
|
} finally {
|
|
|
tableConfig.loading = false;
|
|
|
}
|
|
|
- getTabelData();
|
|
|
+ getTableData();
|
|
|
}
|
|
|
</script>
|
|
|
|