From 955857d1a4775dac1c22b766860327b51e14189e Mon Sep 17 00:00:00 2001
From: waibao2 <1@qq.com>
Date: Fri, 24 Oct 2025 16:59:19 +0800
Subject: [PATCH] =?UTF-8?q?docs:=E9=A2=84=E8=AD=A6=E4=BF=A1=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/styles/common.scss | 27 +-
src/assets/styles/variables.module.scss | 5 +
src/components/ChartsBar/index.vue | 316 ++++++++++++++++++++
src/components/ChartsBarLine/index.vue | 310 +++++++++++++++++++
src/components/ChartsTimeBar/index.vue | 382 ++++++++++++++++++++++++
src/components/ChartsTimeLine/index.vue | 369 +++++++++++++++++++++++
src/components/ESelectSingle/index.vue | 81 +++++
src/components/ETree/index.vue | 138 +++++++++
src/components/SingleStation/index.vue | 54 ++++
src/components/SizeSelect/index.vue | 19 ++
src/components/TreeSelect/index.vue | 156 ++++++++++
src/main.js | 23 +-
src/router/index.js | 6 +-
src/store/modules/app.js | 7 +-
src/views/alarm/list/index.vue | 244 +++++++++++++++
src/views/alarm/sms/index.vue | 259 ++++++++++++++++
src/views/alarm/xinxi/index.vue | 297 ++++++++++++++++++
17 files changed, 2684 insertions(+), 9 deletions(-)
create mode 100644 src/components/ChartsBar/index.vue
create mode 100644 src/components/ChartsBarLine/index.vue
create mode 100644 src/components/ChartsTimeBar/index.vue
create mode 100644 src/components/ChartsTimeLine/index.vue
create mode 100644 src/components/ESelectSingle/index.vue
create mode 100644 src/components/ETree/index.vue
create mode 100644 src/components/SingleStation/index.vue
create mode 100644 src/components/TreeSelect/index.vue
create mode 100644 src/views/alarm/list/index.vue
create mode 100644 src/views/alarm/sms/index.vue
create mode 100644 src/views/alarm/xinxi/index.vue
diff --git a/src/assets/styles/common.scss b/src/assets/styles/common.scss
index c8de5d0..6053090 100644
--- a/src/assets/styles/common.scss
+++ b/src/assets/styles/common.scss
@@ -1,18 +1,38 @@
:root {
--first-card-height: 0px;
--el-card-border-radius: 4px;
- --card-height-with-tags: calc(100vh - 50px - 34px - 31px - var(--first-card-height));
- --card-height-without-tags: calc(100vh - 50px - 31px - var(--first-card-height));
+ --card-height-with-tags: calc(
+ 100vh - 50px - 34px - 31px - var(--first-card-height)
+ );
+ --card-height-without-tags: calc(
+ 100vh - 50px - 31px - var(--first-card-height)
+ );
+ --table-font-size-large: #{$table-font-size-large};
+ --table-font-size-default: #{$table-font-size-default};
+ --table-font-size-small: #{$table-font-size-small};
+ --table-font-size: var(--table-font-size-default); // 默认值
}
.app-container-bg {
background-color: #f2f2f2;
}
+// 应用到所有el-table组件
+.el-table {
+ font-size: var(--table-font-size);
+
+ .el-table__header th,
+ .el-table__body td {
+ font-size: var(--table-font-size);
+ }
+}
.el-card-p {
height: var(--el-card-height, var(--card-height-without-tags)) !important;
box-sizing: border-box;
min-height: 0;
background-color: #fff;
}
+.scroll-bar {
+ overflow-y: auto;
+}
.card-shadow {
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
border-radius: var(--el-card-border-radius);
@@ -110,7 +130,6 @@
overflow-x: hidden !important;
}
-
.vxe-select--panel.is--transfer {
z-index: 999999 !important;
-}
\ No newline at end of file
+}
diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss
index a20f2bd..3b17fdb 100644
--- a/src/assets/styles/variables.module.scss
+++ b/src/assets/styles/variables.module.scss
@@ -44,6 +44,11 @@ $--color-info: #909399;
$base-sidebar-width: 200px;
+
+$table-font-size-large: 18px;
+$table-font-size-default: 14px;
+$table-font-size-small: 12px;
+
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
diff --git a/src/components/ChartsBar/index.vue b/src/components/ChartsBar/index.vue
new file mode 100644
index 0000000..0dff2b7
--- /dev/null
+++ b/src/components/ChartsBar/index.vue
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ChartsBarLine/index.vue b/src/components/ChartsBarLine/index.vue
new file mode 100644
index 0000000..593a7bf
--- /dev/null
+++ b/src/components/ChartsBarLine/index.vue
@@ -0,0 +1,310 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ChartsTimeBar/index.vue b/src/components/ChartsTimeBar/index.vue
new file mode 100644
index 0000000..0ca5275
--- /dev/null
+++ b/src/components/ChartsTimeBar/index.vue
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ChartsTimeLine/index.vue b/src/components/ChartsTimeLine/index.vue
new file mode 100644
index 0000000..64d1f54
--- /dev/null
+++ b/src/components/ChartsTimeLine/index.vue
@@ -0,0 +1,369 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ESelectSingle/index.vue b/src/components/ESelectSingle/index.vue
new file mode 100644
index 0000000..638477f
--- /dev/null
+++ b/src/components/ESelectSingle/index.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/ETree/index.vue b/src/components/ETree/index.vue
new file mode 100644
index 0000000..6b731eb
--- /dev/null
+++ b/src/components/ETree/index.vue
@@ -0,0 +1,138 @@
+
+
+
+ {{item.label}}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/SingleStation/index.vue b/src/components/SingleStation/index.vue
new file mode 100644
index 0000000..d1d24ff
--- /dev/null
+++ b/src/components/SingleStation/index.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue
index a17332e..0dc4e41 100644
--- a/src/components/SizeSelect/index.vue
+++ b/src/components/SizeSelect/index.vue
@@ -1,3 +1,4 @@
+
@@ -34,6 +35,24 @@
appStore.setSize(size);
setTimeout("window.location.reload()", 1000);
}
+
+ function updateTableFontSize(size) {
+ const root = document.documentElement;
+ let fontSizeVar;
+ switch (size) {
+ case 'large':
+ fontSizeVar = 'var(--table-font-size-large)';
+ break;
+ case 'small':
+ fontSizeVar = 'var(--table-font-size-small)';
+ break;
+ case 'default':
+ default:
+ fontSizeVar = 'var(--table-font-size-default)';
+ break;
+ }
+ root.style.setProperty('--table-font-size', fontSizeVar);
+}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index c97d6d1..81842a9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -65,7 +65,28 @@ import {
} from "@/utils/axiosService.js"
const app = createApp(App)
-
+// 初始化表格字体大小
+function initTableFontSize() {
+ const size = localStorage.getItem('size') || 'default';
+ let fontSizeVar;
+ switch (size) {
+ case 'large':
+ fontSizeVar = 'var(--table-font-size-large)';
+ break;
+ case 'small':
+ fontSizeVar = 'var(--table-font-size-small)';
+ break;
+ case 'default':
+ default:
+ fontSizeVar = 'var(--table-font-size-default)';
+ break;
+ }
+ document.documentElement.style.setProperty('--table-font-size', fontSizeVar);
+}
+
+
+// 在应用挂载前初始化
+initTableFontSize();
// 全局方法挂载
app.config.globalProperties.useDict = useDict
app.config.globalProperties.download = download
diff --git a/src/router/index.js b/src/router/index.js
index 4c14aa8..f0a905a 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -126,7 +126,7 @@ export const dynamicRoutes = [
path: 'index/:ruleId(\\d+)',
component: () => import('@/views/basic/error/rules'),
name: 'Rules',
- meta: { title: '设置预警规则', activeMenu: '/message/error' }
+ meta: { title: '预警类型设置/设置预警规则', activeMenu: '/message/error' }
}
]
},
@@ -175,7 +175,7 @@ export const dynamicRoutes = [
]
const router = createRouter({
- history: createWebHistory(),
+ history: createWebHistory('/report/'),
routes: constantRoutes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
@@ -186,4 +186,6 @@ const router = createRouter({
},
});
+
+
export default router;
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 0b57159..89f1857 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -1,3 +1,4 @@
+// src/store/modules/app.js
import Cookies from 'js-cookie'
const useAppStore = defineStore(
@@ -35,7 +36,9 @@ const useAppStore = defineStore(
},
setSize(size) {
this.size = size;
- Cookies.set('size', size)
+ Cookies.set('size', size);
+ // 保存到localStorage以便在应用初始化时使用
+ localStorage.setItem('size', size);
},
toggleSideBarHide(status) {
this.sidebar.hide = status
@@ -43,4 +46,4 @@ const useAppStore = defineStore(
}
})
-export default useAppStore
+export default useAppStore
\ No newline at end of file
diff --git a/src/views/alarm/list/index.vue b/src/views/alarm/list/index.vue
new file mode 100644
index 0000000..ee2a639
--- /dev/null
+++ b/src/views/alarm/list/index.vue
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 预警中
+ 预警结束
+
+
+
+
+ 未生成
+ 已生成
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/alarm/sms/index.vue b/src/views/alarm/sms/index.vue
new file mode 100644
index 0000000..124937e
--- /dev/null
+++ b/src/views/alarm/sms/index.vue
@@ -0,0 +1,259 @@
+/*
+* @Description: 预警短信
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 自动
+ 手动
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/alarm/xinxi/index.vue b/src/views/alarm/xinxi/index.vue
new file mode 100644
index 0000000..98a0c89
--- /dev/null
+++ b/src/views/alarm/xinxi/index.vue
@@ -0,0 +1,297 @@
+/*
+* @Description: 预警信息
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 预警中
+ 预警结束
+
+
+
+
+ 否
+ 是
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file