feat(plugin): migrate time investment plugin

This commit is contained in:
digua committed 2026-08-18 14:29:38 +08:00
1 parent b00959fd5f
commit 0f46352b8d
28 files changed
+511 -436

No files matched your search

+3 -1
View File
@@ -18,7 +18,8 @@ import { WebWasmSessionSync } from './session-sync'
import { useSessionStore } from '@/stores/session'
import { initializeWebWasmLocale } from './locale-bootstrap'
import { installInsightPluginRuntime } from '@/plugins/insight-vue'
import { webWasmInsightRuntime, webWasmUiHost } from '@/plugins/web-wasm'
import { webWasmInsightBuiltins, webWasmInsightRuntime, webWasmUiHost, webWasmUiServices } from '@/plugins/web-wasm'
import { installStaticInsightPluginUiServices } from '@/plugins/static-insight'
import '@/assets/styles/main.css'
initializeWebWasmLocale()
@@ -52,6 +53,7 @@ async function start(): Promise<void> {
app.use(router)
app.use(ui)
app.use(i18n)
await installStaticInsightPluginUiServices(webWasmInsightBuiltins, webWasmInsightRuntime, webWasmUiServices)
installInsightPluginRuntime(app, webWasmInsightRuntime)
const sessionStore = useSessionStore(pinia)
+7 -9
View File
@@ -1,4 +1,9 @@
import type { RouteRecordRaw } from 'vue-router'
import { createVueInsightRouteRecords } from '@/plugins/insight-vue'
import { webWasmInsightRuntime } from '@/plugins/web-wasm'
const defaultInsightRoute =
webWasmInsightRuntime.getDefaultPage()?.routeName ?? webWasmInsightRuntime.listPages()[0]?.routeName
export const webWasmRoutes: RouteRecordRaw[] = [
{
@@ -19,14 +24,7 @@ export const webWasmRoutes: RouteRecordRaw[] = [
{
path: '/insight',
component: () => import('@/pages/insight/index.vue'),
redirect: { name: 'insight-time-investment' },
children: [
{
path: 'time-investment',
name: 'insight-time-investment',
component: () => import('@/pages/insight/time-investment/index.vue'),
meta: { insightPageId: 'time-investment' },
},
],
redirect: defaultInsightRoute ? { name: defaultInsightRoute } : undefined,
children: createVueInsightRouteRecords(webWasmInsightRuntime),
},
]