This commit is contained in:
2025-07-14 16:46:51 +08:00
parent c0351508c5
commit cdf9462a70
6 changed files with 160 additions and 22 deletions

View File

@@ -6,12 +6,8 @@ export const authlogin = (username, password) => post('auth/login', {
password: password
})
// 建图
export const startMapping = (na) => post('teaching/startMapping', {
mapName: na
})
export const setStation = (sn) => post('teaching/setStation', {
stationName: sn
})
export const startMapping = (na) => post('teaching/startMapping?mapName=' + na, {})
export const setStation = (sn) => post('teaching/setStation?stationName=' + sn, {})
export const stopMapping = () => post('teaching/stopMapping', {})
export const getLocalMaps = () => post('teaching/getLocalMaps', {})
export const synchronzieMap = (map) => post('teaching/synchronzieMap', {
@@ -29,8 +25,9 @@ export const queryTaskChain = () => post('api/operate/queryTaskChain', {})
export const sendTask = (data) => post('api/operate/sendTask', {
data: data
})
export const saveTask = (data) => post('api/operate/saveTask', {
data: data
export const saveTask = (data, chain) => post('api/operate/saveTask', {
data: data,
chain_name: chain
})
export const cancelTask = () => post('api/operate/cancelTask', {})
export const deleteTaskChain = (id) => post('api/operate/deleteTaskChain', {

View File

@@ -1,5 +1,4 @@
// import { Message } from 'element-ui'
import { toast } from './utils.js'
// import { getToken } from '@/utils/authToken' // 与后端的协商websocket请求需要带上token参数
let websock = null
let messageCallback = null
@@ -37,7 +36,7 @@ function websocketclose (e) {
// e.code === 1000 表示正常关闭。 无论为何目的而创建, 该链接都已成功完成任务。
// e.code !== 1000 表示非正常关闭。
if (e && e.code !== 1000) {
toast('server error')
this.$message.error('server error')
errorCallback()
// // 如果需要设置异常重连则可替换为下面的代码,自行进行测试
// if (tryTime < 10) {
@@ -60,7 +59,7 @@ function websocketOpen (e) {
// 初始化weosocket
function initWebSocket () {
if (typeof (WebSocket) === 'undefined') {
toast('您的浏览器不支持WebSocket无法获取数据')
this.$message.error('您的浏览器不支持WebSocket无法获取数据')
return false
}
// ws请求完整地址