diff --git a/src/apis/system.ts b/src/apis/system.ts index ab33991..9ffe170 100644 --- a/src/apis/system.ts +++ b/src/apis/system.ts @@ -5,3 +5,4 @@ export const control = (params: System.CmdControlParams): Promise => export const getStatus = (): Promise => http.get('/sys/device-status') export const getPoint = (): Promise => http.get('/cmd/step/gantry-point') export const requireOutTray = (): Promise<{ moduleCode: string }[]> => http.get('/self-test/require-out-tray') +export const getTime = (): Promise => http.get('/sys/datetime') diff --git a/src/components/common/Countdown.vue b/src/components/common/Countdown.vue new file mode 100644 index 0000000..674c71a --- /dev/null +++ b/src/components/common/Countdown.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/src/components/home/Tube/index.vue b/src/components/home/Tube/index.vue index 2479fa9..0b22cc2 100644 --- a/src/components/home/Tube/index.vue +++ b/src/components/home/Tube/index.vue @@ -5,10 +5,10 @@ import errorIcon from 'assets/images/error.svg' import ingIcon from 'assets/images/ing.svg' import successIcon from 'assets/images/success.svg' import waitIcon from 'assets/images/wait.svg' -import { socket } from 'libs/socket' +import CountDown from 'components/common/Countdown.vue' import { useHomeStore } from 'stores/homeStore' import { useSystemStore } from 'stores/systemStore' -import { computed, onMounted, onUnmounted, ref } from 'vue' +import { computed, ref } from 'vue' const props = withDefaults(defineProps<{ data: System.HeatArea }>(), { data: () => ({ @@ -17,6 +17,7 @@ const props = withDefaults(defineProps<{ data: System.HeatArea }>(), { trayStatus: 0, fanOpen: false, heating: false, + heatingType: 'constant', capExist: false, temperature: 0, targetTemperature: 0, @@ -25,19 +26,6 @@ const props = withDefaults(defineProps<{ data: System.HeatArea }>(), { const emits = defineEmits(['selectChange', 'setTemperature']) -onMounted(() => { - socket.init(receiveMessage, 'heat_countdown') -}) - -onUnmounted(() => { - socket.unregisterCallback(receiveMessage, 'heat_countdown') -}) - -const numList = ref<{ heatModuleCode: string, countdownStr: string }[]>([]) -const receiveMessage = (data: any) => { - numList.value = data -} - const homeStore = useHomeStore() const systemStore = useSystemStore() const mousedownHandle = async (e: Event) => { @@ -122,7 +110,7 @@ defineExpose({
恒温中 降温中
-
- {{ numList.find(item => item.heatModuleCode === data.moduleCode)?.countdownStr }} -
+