Files
pqs-9100_client/frontend/src/api/socket/socket.ts

54 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-12-20 16:32:03 +08:00
import http from '@/api'
import { useDetectionLockStore } from '@/stores/modules/detectionLock'
2024-12-20 16:32:03 +08:00
export const startPreTest = async (params) => {
const result = await http.post(`/prepare/startPreTest`, params, {loading: false})
// 抢锁成功 → 标记本地为持锁者
useDetectionLockStore().setAsHolder()
return result
2024-12-23 21:02:00 +08:00
}
export const closePreTest = (params) => {
return http.post(`/prepare/closePreTest`, params,{ loading: false })
2024-12-24 11:29:31 +08:00
}
/**
*
* @param params
*/
2025-03-31 18:54:13 +08:00
// export const startTest = (params) => {
// return http.post(`/prepare/startTest`, params, {loading: false})
// }
2024-12-24 11:29:31 +08:00
/**
*
* @param params
*/
2025-01-09 16:27:05 +08:00
export const pauseTest = () => {
2025-01-13 13:57:24 +08:00
return http.get(`/prepare/closePreTest`, {loading: false})
2024-12-24 11:29:31 +08:00
}
/**
*
* @param params
*/
2024-12-31 14:27:36 +08:00
export const resumeTest = (params) => {
2025-01-09 16:27:05 +08:00
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
2024-12-24 11:29:31 +08:00
}
2025-08-07 14:43:56 +08:00
/**
*
* @param params
*/
export const contrastTest = async (params: any) => {
const result = await http.post(`/prepare/startContrastTest`, params)
// 抢锁成功 → 标记本地为持锁者
useDetectionLockStore().setAsHolder()
return result
2025-08-07 14:43:56 +08:00
}
2025-08-19 19:16:20 +08:00
export const exportAlignData= () => {
return http.download(`/prepare/exportAlignData`)
}