diff --git a/orion-ops-ui/src/components/system/message-box/const.ts b/orion-ops-ui/src/components/system/message-box/const.ts index 30201256..86a4d398 100644 --- a/orion-ops-ui/src/components/system/message-box/const.ts +++ b/orion-ops-ui/src/components/system/message-box/const.ts @@ -4,6 +4,8 @@ export const MessageStatus = { READ: 1, }; +export const MESSAGE_CONFIG_KEY = 'messageConfig'; + // 查询数量 export const messageLimit = 15; diff --git a/orion-ops-ui/src/components/system/message-box/index.vue b/orion-ops-ui/src/components/system/message-box/index.vue index fc01e683..54055a62 100644 --- a/orion-ops-ui/src/components/system/message-box/index.vue +++ b/orion-ops-ui/src/components/system/message-box/index.vue @@ -25,7 +25,7 @@ type="round" checked-text="未读" unchecked-text="全部" - @change="changeMessageStatus" /> + @change="reloadAllMessage" /> import type { MessageRecordResponse } from '@/api/system/message'; - import { ref, onMounted } from 'vue'; + import { ref, onMounted, onUnmounted } from 'vue'; import { clearSystemMessage, deleteSystemMessage, @@ -79,7 +79,7 @@ import useLoading from '@/hooks/loading'; import { useRouter } from 'vue-router'; import { useDictStore } from '@/store'; - import { dictKeys, messageClassifyKey, messageTypeKey, defaultClassify, messageLimit, MessageStatus } from './const'; + import { dictKeys, messageClassifyKey, messageTypeKey, defaultClassify, MESSAGE_CONFIG_KEY, messageLimit, MessageStatus } from './const'; import List from './list.vue'; import Modal from './modal.vue'; import { clearHtmlTag, replaceHtmlTag } from '@/utils'; @@ -96,8 +96,8 @@ const hasMore = ref(true); const modalRef = ref(); - // 修改消息状态 - const changeMessageStatus = async () => { + // 重新加载消息 + const reloadAllMessage = async () => { hasMore.value = true; messageList.value = []; // 查询数量 @@ -179,7 +179,7 @@ setMessageLoading(false); } // 查询消息 - await changeMessageStatus(); + await reloadAllMessage(); }; // 点击消息 @@ -239,7 +239,29 @@ }); // 获取消息 - onMounted(changeMessageStatus); + onMounted(() => { + // 获取配置缓存 + const item = localStorage.getItem(MESSAGE_CONFIG_KEY); + if (item) { + const config = JSON.parse(item) as Record; + if (config?.currentClassify) { + currentClassify.value = config.currentClassify; + } + if (config?.queryUnread) { + queryUnread.value = config.queryUnread; + } + } + // 查询数据 + reloadAllMessage(); + }); + + // 设置缓存配置 + onUnmounted(() => { + localStorage.setItem(MESSAGE_CONFIG_KEY, JSON.stringify({ + currentClassify: currentClassify.value, + queryUnread: queryUnread.value, + })); + }); diff --git a/orion-ops-ui/src/components/system/message-box/list.vue b/orion-ops-ui/src/components/system/message-box/list.vue index 85e84da4..f1ac3ce1 100644 --- a/orion-ops-ui/src/components/system/message-box/list.vue +++ b/orion-ops-ui/src/components/system/message-box/list.vue @@ -139,18 +139,19 @@ display: flex; flex-direction: column; justify-content: space-between; - font-size: 16px; + font-size: 14px; color: var(--color-text-1); cursor: pointer; &-title { display: flex; justify-content: space-between; - align-items: center; + align-items: flex-start; &-text { width: calc(100% - @actions-width - @gap); display: block; + font-size: 15px; font-weight: 600; text-overflow: clip; } @@ -179,6 +180,8 @@ } &-content { + display: block; + padding-bottom: 2px; color: var(--color-text-1); text-overflow: clip; } diff --git a/orion-ops-ui/src/router/routes/modules/exec.ts b/orion-ops-ui/src/router/routes/modules/exec.ts index d62abb9a..0c55f355 100644 --- a/orion-ops-ui/src/router/routes/modules/exec.ts +++ b/orion-ops-ui/src/router/routes/modules/exec.ts @@ -1,51 +1,37 @@ import type { AppRouteRecordRaw } from '../types'; -import { DEFAULT_LAYOUT, FULL_LAYOUT } from '../base'; +import { DEFAULT_LAYOUT } from '../base'; -const EXEC: AppRouteRecordRaw[] = [ - { - name: 'execModule', - path: '/exec-module', - component: DEFAULT_LAYOUT, - children: [ - { - name: 'execCommand', - path: '/exec-command', - component: () => import('@/views/exec/exec-command/index.vue'), - }, - { - name: 'execCommandLog', - path: '/exec-log', - component: () => import('@/views/exec/exec-command-log/index.vue'), - }, - { - name: 'batchUpload', - path: '/batch-upload', - component: () => import('@/views/exec/batch-upload/index.vue'), - }, - { - name: 'uploadTask', - path: '/upload-task', - component: () => import('@/views/exec/upload-task/index.vue'), - }, - { - name: 'execTemplate', - path: '/exec-template', - component: () => import('@/views/exec/exec-template/index.vue'), - }, - ], - }, - { - name: 'execFullModule', - path: '/exec-full-module', - component: FULL_LAYOUT, - children: [ - { - name: 'execCommandLogView', - path: '/exec-log-view', - component: () => import('@/views/exec/exec-command-log-view/index.vue'), - }, - ], - } -]; +const EXEC: AppRouteRecordRaw = { + name: 'execModule', + path: '/exec-module', + component: DEFAULT_LAYOUT, + children: [ + { + name: 'execCommand', + path: '/exec-command', + component: () => import('@/views/exec/exec-command/index.vue'), + }, + { + name: 'execCommandLog', + path: '/exec-log', + component: () => import('@/views/exec/exec-command-log/index.vue'), + }, + { + name: 'batchUpload', + path: '/batch-upload', + component: () => import('@/views/exec/batch-upload/index.vue'), + }, + { + name: 'uploadTask', + path: '/upload-task', + component: () => import('@/views/exec/upload-task/index.vue'), + }, + { + name: 'execTemplate', + path: '/exec-template', + component: () => import('@/views/exec/exec-template/index.vue'), + }, + ], +}; export default EXEC; diff --git a/orion-ops-ui/src/views/exec/exec-command-log-view/index.vue b/orion-ops-ui/src/views/exec/exec-command-log-view/index.vue deleted file mode 100644 index 6e49ef8b..00000000 --- a/orion-ops-ui/src/views/exec/exec-command-log-view/index.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - diff --git a/orion-ops-ui/src/views/exec/exec-command-log/index.vue b/orion-ops-ui/src/views/exec/exec-command-log/index.vue index 1c305a02..6869de2e 100644 --- a/orion-ops-ui/src/views/exec/exec-command-log/index.vue +++ b/orion-ops-ui/src/views/exec/exec-command-log/index.vue @@ -69,7 +69,7 @@ if (newWindow) { // 跳转新页面 openNewRoute({ - name: 'execCommandLogView', + name: 'execCommand', query: { id }