rebuild(runtime): govern market operations and job truth

This commit is contained in:
leefer
2026-07-30 10:14:29 +08:00
parent 4fc8691eee
commit d8f0dd930c
39 changed files with 2224 additions and 79 deletions
+11 -2
View File
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from "vue";
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
import { useRoute } from "vue-router";
import { operationsApi } from "../../shared/api/operations";
import { findWorkspace } from "../workspaceRegistry";
const route = useRoute();
@@ -9,12 +10,20 @@ const title = computed(() => {
if (typeof route.meta.title === "string") return route.meta.title;
return findWorkspace(String(route.params.workspace ?? ""))?.title ?? "小白复盘";
});
const runtimeMessage = ref("正在读取行情状态");
let timer: ReturnType<typeof setInterval> | undefined;
async function loadStatus(): Promise<void> {
try { runtimeMessage.value = (await operationsApi.status()).message; }
catch { runtimeMessage.value = "行情状态暂不可用"; }
}
onMounted(() => { void loadStatus(); timer = setInterval(loadStatus, 15_000); });
onBeforeUnmount(() => { if (timer) clearInterval(timer); });
</script>
<template>
<footer class="statusbar">
<span>{{ title }}</span>
<span class="statusbar-center">股市有风险投资需谨慎</span>
<span class="statusbar-right">等待行情数据</span>
<span class="statusbar-right">{{ runtimeMessage }}</span>
</footer>
</template>