From 18531bfcac4234d391d785dfcf1174237178aa5d Mon Sep 17 00:00:00 2001
From: zxr <271055687@qq.com>
Date: Wed, 24 Jun 2026 15:12:18 +0800
Subject: [PATCH] fix
---
.env.development | 4 +-
.env.production | 1 +
src/api/ops/alertEvent.ts | 17 +++++
src/main.ts | 5 +-
src/views/ops/pages/alert/detail/index.vue | 78 ++++++++++++++++++++++
5 files changed, 103 insertions(+), 2 deletions(-)
create mode 100644 src/api/ops/alertEvent.ts
diff --git a/.env.development b/.env.development
index 6e87a31..3cbdb98 100644
--- a/.env.development
+++ b/.env.development
@@ -6,9 +6,11 @@ VITE_APP_WORKSPACE=ops
# 应用标题
VITE_APP_TITLE=标准管理系统
VITE_APP_DESCRIPTION="default standard template"
+VITE_USE_MOCK=false
# API 基础URL
-VITE_API_BASE_URL=https://ops-api.apinb.com
+# VITE_API_BASE_URL=https://ops-api.apinb.com
+VITE_API_BASE_URL=http://127.0.0.1
# Logs 本地调试地址(仅 logs 模块使用)
VITE_LOGS_API_BASE_URL=http://127.0.0.1:12440
diff --git a/.env.production b/.env.production
index 8f9f8ee..f1213e6 100644
--- a/.env.production
+++ b/.env.production
@@ -5,6 +5,7 @@ VITE_APP_WORKSPACE=ops
VITE_APP_TITLE=标准管理系统
VITE_APP_DESCRIPTION="default standard template"
+VITE_USE_MOCK=false
# API 基础URL
VITE_API_BASE_URL=https://ops-api.apinb.com
diff --git a/src/api/ops/alertEvent.ts b/src/api/ops/alertEvent.ts
new file mode 100644
index 0000000..f5a3c01
--- /dev/null
+++ b/src/api/ops/alertEvent.ts
@@ -0,0 +1,17 @@
+import { request } from '@/api/request'
+
+export const fetchAlertEvents = (data: {
+ page?: number
+ page_size?: number
+ alert_record_id?: number
+ event_type?: string
+ source?: string
+ severity?: string
+ start_time?: string
+ end_time?: string
+ keyword?: string
+ sort?: string
+ order?: string
+}) => request.get('/Alert/v1/event/list', { params: data })
+
+export const fetchAlertEventDetail = (id: number) => request.get(`/Alert/v1/event/get/${id}`)
diff --git a/src/main.ts b/src/main.ts
index ee16179..6c6ce59 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -5,7 +5,6 @@ import { createApp } from 'vue'
import App from './App.vue'
import directive from './directive'
import i18n from './locale'
-import './mock'
import router from './router'
import store from './store'
// Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details
@@ -14,6 +13,10 @@ import store from './store'
import '@/api/interceptor'
import '@/assets/style/global.less'
+if (import.meta.env.VITE_USE_MOCK === 'true') {
+ import('./mock')
+}
+
const app = createApp(App)
app.use(ArcoVue, {})
diff --git a/src/views/ops/pages/alert/detail/index.vue b/src/views/ops/pages/alert/detail/index.vue
index 2dba6c9..5168b73 100644
--- a/src/views/ops/pages/alert/detail/index.vue
+++ b/src/views/ops/pages/alert/detail/index.vue
@@ -174,6 +174,20 @@