From eba5e68e2f1b4dd68bf45741e8d900ef53dc35b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=BE=B7=E8=B6=85?= <13143889+he-dechao@user.noreply.gitee.com> Date: Tue, 12 Aug 2025 17:49:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=80=E7=A9=BA=E5=89=8D=E7=AB=AF=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E5=8E=9F=E6=95=B0=E6=8D=AE=E7=AE=A1=E7=90=86=E5=8F=B3?= =?UTF-8?q?=E8=BE=B9=E6=A0=87=E7=AD=BE=E9=A1=B5=EF=BC=8C=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E9=9C=80=E5=90=8C=E6=AD=A5=E9=85=8D=E7=BD=AE=E6=89=8D=E6=9C=89?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/video-monitor/index.ts | 55 ++ .../data-storage/components/raw-data.vue | 594 ++++++++---------- 2 files changed, 304 insertions(+), 345 deletions(-) create mode 100644 src/apis/video-monitor/index.ts diff --git a/src/apis/video-monitor/index.ts b/src/apis/video-monitor/index.ts new file mode 100644 index 0000000..b18a5e2 --- /dev/null +++ b/src/apis/video-monitor/index.ts @@ -0,0 +1,55 @@ +import http from '@/utils/http' + +/* 分页查询 */ +export function getVideoPage(params: { + pageNo: number + pageSize: number + projectId: string + turbineId?: string +}) { + return http.get('/video-monitor/page', params ) +} + +/* 单文件上传 */ +export function uploadSingleVideo( + projectId: string, + turbineId: string, + type: string, + file: File +) { + const fd = new FormData() + fd.append('file', file) + return http.post( + `/video-monitor/${projectId}/upload?turbineId=${turbineId}&type=${type}`, + fd, + { headers: { 'Content-Type': 'multipart/form-data' } } + ) +} + +/* 批量上传 */ +export function uploadBatchVideo( + projectId: string, + turbineId: string, + type: string, + files: File[] +) { + const fd = new FormData() + files.forEach(f => fd.append('files', f)) + return http.post( + `/video-monitor/${projectId}/upload-batch?turbineId=${turbineId}&type=${type}`, + fd, + { headers: { 'Content-Type': 'multipart/form-data' } } + ) +} + +/* 删除 */ +export function deleteVideo(videoId: string) { + return http.del(`/video-monitor/${videoId}`) +} + +/* 下载 */ +export function downloadVideo(videoId: string) { + return http + .get(`/video-monitor/download/${videoId}`, { responseType: 'blob' }) + .then(blob => URL.createObjectURL(blob)) +} \ No newline at end of file diff --git a/src/views/operation-platform/data-processing/data-storage/components/raw-data.vue b/src/views/operation-platform/data-processing/data-storage/components/raw-data.vue index c80beb2..035a01a 100644 --- a/src/views/operation-platform/data-processing/data-storage/components/raw-data.vue +++ b/src/views/operation-platform/data-processing/data-storage/components/raw-data.vue @@ -1,407 +1,311 @@