增加导入功能,支持科室自己导入项目发起流程

hedong
zhufu 2025-12-12 08:53:41 +08:00
parent bb474e575c
commit f698d8c6dc
2 changed files with 30 additions and 2 deletions

View File

@ -30,6 +30,8 @@ enum Api {
ProjectSupervise = '/api/DroneSsny/ProjectSupervise',
// 项目列表导出
GetDronssnydExport = '/api/DroneSsny/GetDronssnydExport',
// 项目列表导入
ImportCaseInfoShpDataSsny = '/api/DroneCaseInfoTask/ImportCaseInfoShpDataSsny',
}
export function TimeoutWarning(params) {
@ -103,4 +105,10 @@ export function GetDronssnydExport(params) {
params,
responseType: 'blob',
});
}
export function ImportCaseInfoShpDataSsny(params: {zipFilePath: string, srid: string}){
return defHttp.post({
url: `${Api.ImportCaseInfoShpDataSsny}?zipFilePath=${params.zipFilePath}&srid=${params.srid}`,
data: params,
})
}

View File

@ -2,6 +2,13 @@
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
<template #toolbar>
<a-upload
:accept="'.xlsx,.csv,.xls,.shp,.zip'"
:showUploadList="false"
:custom-request="customRequest"
>
<a-button type="primary">导入</a-button>
</a-upload>
<a-button type="primary" @click="download"></a-button>
</template>
<template #bodyCell="{ column, record }">
@ -39,13 +46,15 @@ import { ref } from "vue"
import { PageWrapper } from '@/components/Page';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema } from './utils';
import { GetDronssnydList, GetDronssnydExport } from '@/api/earlywarning/index'
import { GetDronssnydList, GetDronssnydExport, ImportCaseInfoShpDataSsny } from '@/api/earlywarning/index'
import ShowInfoModal from '@/components/EarlyWarning/InfoModal/index.vue'
import { uploadFile } from '@/api/formrender/index';
import { message } from "ant-design-vue";
const showInfoOpen = ref(false)
const showInfoData = ref();
const [registerTable, { getForm }] = useTable({
const [registerTable, { getForm, reload }] = useTable({
title: '项目列表',
api: GetDronssnydList,
columns,
@ -82,6 +91,17 @@ const download = () => {
document.body.removeChild(elink);
})
}
const customRequest = (file) => {
console.log('handleCustomRequest',file)
const formData = new FormData()
formData.append('files', file.file)
uploadFile(formData).then(res => {
ImportCaseInfoShpDataSsny({zipFilePath: res[0].filePath.replace(/\\/g, '/'), srid: '4326'}).then(resultRes => {
message.success('导入成功')
reload()
})
})
}
</script>
<style lang="scss" scoped>