|
@ -36,7 +36,7 @@ |
|
|
>开门</van-button |
|
|
>开门</van-button |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
<van-button size="large" class="btn_size op_start_task" @click="taskNameVisible = true" |
|
|
|
|
|
|
|
|
<van-button size="large" class="btn_size op_start_task" @click="startTask" |
|
|
>开始实验</van-button |
|
|
>开始实验</van-button |
|
|
> |
|
|
> |
|
|
<van-button size="large" class="btn_size op_stop_task" @click="onEndTask" |
|
|
<van-button size="large" class="btn_size op_stop_task" @click="onEndTask" |
|
@ -126,14 +126,14 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { ref, reactive, onMounted, onUnmounted } from "vue"; |
|
|
import { ref, reactive, onMounted, onUnmounted } from "vue"; |
|
|
//@ts-ignore |
|
|
//@ts-ignore |
|
|
import { ElMessage } from "element-plus"; |
|
|
|
|
|
|
|
|
import {ElMessage, ElMessageBox} from "element-plus"; |
|
|
import { createWebSocket, sharedWsUrl } from "@/services/socket"; |
|
|
import { createWebSocket, sharedWsUrl } from "@/services/socket"; |
|
|
import { HeatPosition, TakePickture, AddLiquid } from "./components"; |
|
|
import { HeatPosition, TakePickture, AddLiquid } from "./components"; |
|
|
import OverlayModal from "@/components/OverlayModal.vue"; |
|
|
import OverlayModal from "@/components/OverlayModal.vue"; |
|
|
import CraftList from "@/views/graphite/components/CraftList.vue"; |
|
|
import CraftList from "@/views/graphite/components/CraftList.vue"; |
|
|
import { graphiteMock } from "./components/mock"; |
|
|
import { graphiteMock } from "./components/mock"; |
|
|
import { useStatusStore } from "@/stores/status"; |
|
|
import { useStatusStore } from "@/stores/status"; |
|
|
import { saveTaskName, stopTask } from '@/services/task/task'; |
|
|
|
|
|
|
|
|
import {getIngTask, saveTaskName, stopTask} from '@/services/task/task'; |
|
|
import { |
|
|
import { |
|
|
CmdDescMap, |
|
|
CmdDescMap, |
|
|
taskCmd, |
|
|
taskCmd, |
|
@ -515,6 +515,32 @@ const onSave = ()=> { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const startTask = async () => { |
|
|
|
|
|
const res = await getIngTask(); |
|
|
|
|
|
|
|
|
|
|
|
if(res.data) { |
|
|
|
|
|
ElMessageBox.confirm(`上一实验"${res.data.name}"未结束,是否结束并开始新的实验`, '提示', { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
center: true, |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
stopTask({taskId: res.data.id}).then(res=> { |
|
|
|
|
|
if(res.success){ |
|
|
|
|
|
ElMessage.success('实验已停止') |
|
|
|
|
|
taskNameVisible.value = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
ElMessage.error('实验停止失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(e=>{ |
|
|
|
|
|
ElMessage.error(e) |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}else { |
|
|
|
|
|
taskNameVisible.value = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//结束实验 |
|
|
//结束实验 |
|
|
const onEndTask = () => { |
|
|
const onEndTask = () => { |
|
|
const params = { |
|
|
const params = { |
|
|