#7 设备管理-飞行器页面点击导出飞行器信息无反应

main
zhufu 2 months ago
parent 29e52e9fc9
commit a519927a0f

@ -8,6 +8,7 @@ enum Api {
DeleteUav = '/api/Manage/DeleteUav',
GetGateway = '/api/AirportMaintenance/GetGateway',
GetManageDeviceHmsList = '/api/AirportMaintenance/GetManageDeviceHmsList',
ExportDevice = '/api/Manage/ExportDevice'
}
export function GetDataList(params) {
@ -54,4 +55,11 @@ export function GetManageDeviceHmsList(params) {
url: Api.GetManageDeviceHmsList,
params
});
}
export function ExportDevice(params?) {
return defHttp.get({
url: Api.ExportDevice,
params,
responseType: 'blob',
});
}

@ -1,7 +1,7 @@
<template>
<BasicTable class="w-4/4 xl:w-5/5" @register="registerTable">
<template #toolbar>
<a-button type="primary">导出飞行器信息</a-button>
<a-button type="primary" @click="exportDevice"></a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key == 'workSpaceId'">
@ -38,7 +38,7 @@ import { h, watch, onMounted, ref, nextTick } from "vue"
import { EditOutlined } from '@ant-design/icons-vue'
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema } from './utils'
import { GetUavPageList, DeleteUav } from '@/api/demo/device'
import { GetUavPageList, DeleteUav, ExportDevice } from '@/api/demo/device'
import { getClient, clientSubscribe } from '@/utils/mqtt'
import dayjs from "dayjs";
import { message, Modal } from "ant-design-vue";
@ -131,6 +131,18 @@ const delDate = (record) => {
},
});
}
const exportDevice = () => {
ExportDevice().then(res => {
const elink = document.createElement('a');
elink.download = '飞行器信息.xlsx';
elink.style.display = 'none';
elink.href = URL.createObjectURL(res);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
})
}
</script>
<style lang="scss" scoped></style>

Loading…
Cancel
Save