|
@ -1,7 +1,9 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { getSelfFinish, getSelfStatus } from '@/apis/self' |
|
|
import { getSelfFinish, getSelfStatus } from '@/apis/self' |
|
|
import { ElMessage } from 'element-plus' |
|
|
import { ElMessage } from 'element-plus' |
|
|
|
|
|
import { socket } from 'libs/socket' |
|
|
import { useHomeStore } from 'stores/homeStore' |
|
|
import { useHomeStore } from 'stores/homeStore' |
|
|
|
|
|
import { useSystemStore } from 'stores/systemStore' |
|
|
import { onMounted, onUnmounted, ref } from 'vue' |
|
|
import { onMounted, onUnmounted, ref } from 'vue' |
|
|
|
|
|
|
|
|
interface SelfStatus { |
|
|
interface SelfStatus { |
|
@ -10,18 +12,27 @@ interface SelfStatus { |
|
|
value: string |
|
|
value: string |
|
|
type: string |
|
|
type: string |
|
|
} |
|
|
} |
|
|
defineEmits(['update:checking']) |
|
|
|
|
|
|
|
|
const emits = defineEmits(['close']) |
|
|
const homeStore = useHomeStore() |
|
|
const homeStore = useHomeStore() |
|
|
|
|
|
const systemStore = useSystemStore() |
|
|
|
|
|
|
|
|
const loading = ref(false) |
|
|
const loading = ref(false) |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
|
|
|
socket.init(receiveMessage, 'cmd_debug') |
|
|
|
|
|
socket.init(receiveMessage, 'cmd_response') |
|
|
onStartSelfTest() |
|
|
onStartSelfTest() |
|
|
}) |
|
|
}) |
|
|
onUnmounted(() => { |
|
|
onUnmounted(() => { |
|
|
clearInterval(patrolTimes.value) |
|
|
clearInterval(patrolTimes.value) |
|
|
|
|
|
socket.unregisterCallback(receiveMessage, 'cmd_debug') |
|
|
|
|
|
socket.unregisterCallback(receiveMessage, 'cmd_response') |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const receiveMessage = (data: Socket.cmdData) => { |
|
|
|
|
|
data.commandId === currentCommandId && systemStore.pushSystemList(data) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const onStartSelfTest = () => { |
|
|
const onStartSelfTest = () => { |
|
|
patrolSelfStatus() |
|
|
patrolSelfStatus() |
|
|
} |
|
|
} |
|
@ -224,7 +235,7 @@ const tray_lifting_origin = async (heatId: string) => { |
|
|
const onComplete = () => { |
|
|
const onComplete = () => { |
|
|
getSelfFinish().then(() => { |
|
|
getSelfFinish().then(() => { |
|
|
ElMessage.success('自检完成') |
|
|
ElMessage.success('自检完成') |
|
|
visible.value = false |
|
|
|
|
|
|
|
|
emits('close') |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|