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 @@