diff --git a/orion-ops-ui/src/api/system/message.ts b/orion-ops-ui/src/api/system/message.ts index 80aa48d6..c58e9ff0 100644 --- a/orion-ops-ui/src/api/system/message.ts +++ b/orion-ops-ui/src/api/system/message.ts @@ -21,20 +21,21 @@ export interface MessageRecordResponse { relKey: string; title: string; content: string; + contentHtml: string; createTime: number; } /** * 查询系统消息列表 */ -export function getMessageList(request: MessageQueryRequest) { +export function getSystemMessageList(request: MessageQueryRequest) { return axios.post>('/infra/system-message/list', request); } /** * 查询系统消息数量 */ -export function getMessageCount(queryUnread: boolean) { +export function getSystemMessageCount(queryUnread: boolean) { return axios.get>('/infra/system-message/count', { params: { queryUnread } }); } @@ -48,27 +49,27 @@ export function checkHasUnreadMessage() { /** * 更新系统消息为已读 */ -export function updateMessageRead(id: number) { +export function updateSystemMessageRead(id: number) { return axios.put('/infra/system-message/read', undefined, { params: { id } }); } /** * 更新全部系统消息为已读 */ -export function updateMessageReadAll(classify: string) { +export function updateSystemMessageReadAll(classify: string) { return axios.put('/infra/system-message/read-all', undefined, { params: { classify } }); } /** * 删除系统消息 */ -export function deleteMessage(id: number) { +export function deleteSystemMessage(id: number) { return axios.delete('/infra/system-message/delete', { params: { id } }); } /** * 清理已读的系统消息 */ -export function clearMessage(classify: string) { +export function clearSystemMessage(classify: string) { return axios.delete('/infra/system-message/clear', { params: { classify } }); } diff --git a/orion-ops-ui/src/components/app/navbar/index.vue b/orion-ops-ui/src/components/app/navbar/index.vue index 42fecadd..7ed5b09d 100644 --- a/orion-ops-ui/src/components/app/navbar/index.vue +++ b/orion-ops-ui/src/components/app/navbar/index.vue @@ -80,11 +80,11 @@ - -
  • - + +
  • +
    - + + content-class="message-popover" + position="br" + :show-arrow="false" + :popup-style="{ marginLeft: '198px' }" + :content-style="{ padding: 0, width: '498px' }">
    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 a661c331..85e84da4 100644 --- a/orion-ops-ui/src/components/system/message-box/list.vue +++ b/orion-ops-ui/src/components/system/message-box/list.vue @@ -1,149 +1,216 @@ + + diff --git a/orion-ops-ui/src/components/system/message-box/modal.vue b/orion-ops-ui/src/components/system/message-box/modal.vue new file mode 100644 index 00000000..17909f5a --- /dev/null +++ b/orion-ops-ui/src/components/system/message-box/modal.vue @@ -0,0 +1,49 @@ + + + + + + + diff --git a/orion-ops-ui/src/views/exec/batch-upload/index.vue b/orion-ops-ui/src/views/exec/batch-upload/index.vue index ec372558..7c67d048 100644 --- a/orion-ops-ui/src/views/exec/batch-upload/index.vue +++ b/orion-ops-ui/src/views/exec/batch-upload/index.vue @@ -28,10 +28,14 @@ await dictStore.loadKeys(dictKeys); }); + // 跳转日志 onMounted(async () => { const idParam = route.query.id; + const keyParam = route.query.key; if (idParam) { await panel.value?.openLog(Number.parseInt(idParam as string)); + } else if (keyParam) { + await panel.value?.openLog(Number.parseInt(keyParam as string)); } }); diff --git a/orion-ops-ui/src/views/exec/exec-command/index.vue b/orion-ops-ui/src/views/exec/exec-command/index.vue index 2af0d7d3..d1329e65 100644 --- a/orion-ops-ui/src/views/exec/exec-command/index.vue +++ b/orion-ops-ui/src/views/exec/exec-command/index.vue @@ -26,10 +26,13 @@ import useVisible from '@/hooks/visible'; import { useDictStore } from '@/store'; import { dictKeys } from '@/components/exec/log/const'; + import { useRoute } from 'vue-router'; + import { getExecCommandLog } from '@/api/exec/exec-command-log'; import ExecCommandPanel from './components/exec-command-panel.vue'; import ExecLogPanel from '@/components/exec/log/panel/index.vue'; const { visible: logVisible, setVisible: setLogVisible } = useVisible(); + const route = useRoute(); const log = ref(); @@ -41,12 +44,30 @@ }); }; + // 打开日志 + const openLogWithId = async (id: number) => { + setLogVisible(true); + // 查询日志 + const { data } = await getExecCommandLog(id); + openLog(data); + }; + // 加载字典值 onMounted(async () => { const dictStore = useDictStore(); await dictStore.loadKeys(dictKeys); }); + // 跳转日志 + onMounted(async () => { + const idParam = route.query.id; + const keyParam = route.query.key; + if (idParam) { + await openLogWithId(Number.parseInt(idParam as string)); + } else if (keyParam) { + await openLogWithId(Number.parseInt(keyParam as string)); + } + });