|
|
@@ -66,11 +66,12 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
+import axios, { AxiosRequestConfig } from 'axios';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
import { genFileId, ElMessage } from 'element-plus';
|
|
|
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
|
|
import { Close, Document, WarnTriangleFilled, Download } from '@element-plus/icons-vue';
|
|
|
-import { downloadSpaceCode, downloadBatchTemplate } from '@/api/camera/camera-overview'
|
|
|
+import { useGlobSetting } from '@/hooks/setting';
|
|
|
|
|
|
onMounted(() => {
|
|
|
cardVisible.value = props.modelValue;
|
|
|
@@ -96,10 +97,16 @@ const updateValue = (value) => {
|
|
|
emits('update:modelValue', value);
|
|
|
};
|
|
|
|
|
|
+const { urlPrefix } = useGlobSetting()
|
|
|
+
|
|
|
// 下载场景code信息查询表
|
|
|
const handleDownloadSceneCode = async () => {
|
|
|
try {
|
|
|
- const response = await downloadSpaceCode();
|
|
|
+ const config: AxiosRequestConfig = {
|
|
|
+ headers,
|
|
|
+ responseType: 'blob',
|
|
|
+ };
|
|
|
+ const response = await axios.get(urlPrefix + '/addCameraList/downloadWorkspaceCodeForm', config);
|
|
|
const blob = new Blob([response.data], {
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
|
});
|
|
|
@@ -120,7 +127,11 @@ const handleDownloadSceneCode = async () => {
|
|
|
// 下载模板
|
|
|
const handleDownloadTemplate = async () => {
|
|
|
try {
|
|
|
- const response = await downloadBatchTemplate();
|
|
|
+ const config: AxiosRequestConfig = {
|
|
|
+ headers,
|
|
|
+ responseType: 'blob',
|
|
|
+ };
|
|
|
+ const response = await axios.get('/skyeye-file-upload/skyeye/CAMERALIST_TEMPLATE/camera-upload-template.xlsx', config);
|
|
|
const blob = new Blob([response.data], {
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
|
});
|