diff --git a/orion-ops-ui/src/layout/host-workspace-layout.vue b/orion-ops-ui/src/layout/host-workspace-layout.vue new file mode 100644 index 00000000..55ea0c0f --- /dev/null +++ b/orion-ops-ui/src/layout/host-workspace-layout.vue @@ -0,0 +1,41 @@ + + + + + + + diff --git a/orion-ops-ui/src/router/routes/base.ts b/orion-ops-ui/src/router/routes/base.ts index e811a4e5..7617aae3 100644 --- a/orion-ops-ui/src/router/routes/base.ts +++ b/orion-ops-ui/src/router/routes/base.ts @@ -7,28 +7,23 @@ import { NOT_FOUND_ROUTER_NAME, } from '@/router/constants'; +// 默认布局 export const DEFAULT_LAYOUT = () => import('@/layout/default-layout.vue'); -/** - * 根页面 - */ +// 根页面 export const ROOT_ROUTER: RouteRecordRaw = { path: '/', redirect: DEFAULT_ROUTE_FULL_PATH, }; -/** - * 登录页面 - */ +// 登录页面 export const LOGIN_ROUTER: RouteRecordRaw = { path: '/login', name: LOGIN_ROUTE_NAME, component: () => import('@/views/authentication/login/index.vue'), }; -/** - * 重定向页面 - */ +// 重定向页面 export const REDIRECT_ROUTER: RouteRecordRaw = { path: '/redirect', name: 'redirectWrapper', @@ -49,18 +44,14 @@ export const REDIRECT_ROUTER: RouteRecordRaw = { ], }; -/** - * 403 页面 - */ +// 403 页面 export const FORBIDDEN_ROUTE: RouteRecordRaw = { path: '/403', name: FORBIDDEN_ROUTER_NAME, component: () => import('@/views/base/status/forbidden/index.vue'), }; -/** - * 404 页面 - */ +// 404 页面 export const NOT_FOUND_ROUTE: RouteRecordRaw = { // path: '/:pathMatch(.*)*', path: '/404', diff --git a/orion-ops-ui/src/router/routes/index.ts b/orion-ops-ui/src/router/routes/index.ts index 994cd517..3bc298fc 100644 --- a/orion-ops-ui/src/router/routes/index.ts +++ b/orion-ops-ui/src/router/routes/index.ts @@ -3,6 +3,10 @@ import type { RouteRecordNormalized } from 'vue-router'; // 应用模块 const modules = import.meta.glob('./modules/*.ts', { eager: true }); +// 应用路由 +export const appRoutes: RouteRecordNormalized[] = formatModules(modules, []); + +// 格式化模块 function formatModules(_modules: any, result: RouteRecordNormalized[]) { Object.keys(_modules).forEach((key) => { const defaultModule = _modules[key].default; @@ -14,8 +18,3 @@ function formatModules(_modules: any, result: RouteRecordNormalized[]) { }); return result; } - -/** - * 应用路由 - */ -export const appRoutes: RouteRecordNormalized[] = formatModules(modules, []); diff --git a/orion-ops-ui/src/router/routes/modules/host-workspcae.ts b/orion-ops-ui/src/router/routes/modules/host-workspcae.ts new file mode 100644 index 00000000..d223da51 --- /dev/null +++ b/orion-ops-ui/src/router/routes/modules/host-workspcae.ts @@ -0,0 +1,16 @@ +import type { AppRouteRecordRaw } from '../types'; + +const DASHBOARD: AppRouteRecordRaw = { + name: 'hostWorkspace', + path: '/host-workspace', + component: () => import('@/layout/host-workspace-layout.vue'), + children: [ + { + name: 'hostTerminal', + path: '/host-workspace/terminal', + component: () => import('@/views/host-workspace/terminal/index.vue'), + }, + ], +}; + +export default DASHBOARD; diff --git a/orion-ops-ui/src/views/host-workspace/terminal/index.vue b/orion-ops-ui/src/views/host-workspace/terminal/index.vue new file mode 100644 index 00000000..98d28858 --- /dev/null +++ b/orion-ops-ui/src/views/host-workspace/terminal/index.vue @@ -0,0 +1,21 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/system/menu/components/menu-table.vue b/orion-ops-ui/src/views/system/menu/components/menu-table.vue index bb20b7f7..0c64459e 100644 --- a/orion-ops-ui/src/views/system/menu/components/menu-table.vue +++ b/orion-ops-ui/src/views/system/menu/components/menu-table.vue @@ -236,6 +236,7 @@ } } } + cacheStore.reset('menus'); Message.success('删除成功'); } catch (e) { } finally { @@ -245,12 +246,12 @@ // 添加后回调 const addedCallback = () => { - loadMenuData(); + loadMenuData(true); }; // 更新后回调 const updatedCallback = () => { - loadMenuData(); + loadMenuData(true); }; defineExpose({ @@ -258,11 +259,15 @@ }); // 加载菜单 - const loadMenuData = async () => { + const loadMenuData = async (all: any = undefined) => { try { setFetchLoading(true); - const { data } = await getMenuList(formModel); + const { data } = await getMenuList(all === true ? {} : formModel); tableRenderData.value = data as MenuQueryResponse[]; + // 重设缓存 + if (all) { + cacheStore.set('menus', data); + } } catch (e) { } finally { setFetchLoading(false); @@ -270,13 +275,13 @@ }; onMounted(() => { - loadMenuData(); + loadMenuData(true); }); // 重置菜单 const resetForm = () => { formRef.value.resetFields(); - loadMenuData(); + loadMenuData(true); }; // 切换展开/折叠