Compare commits
93 Commits
2025-12
...
cd2be0f4aa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd2be0f4aa | ||
|
|
855c569535 | ||
| 6a84d28101 | |||
|
|
1a69be62a0 | ||
|
|
02caca969e | ||
|
|
3f1af5e4cc | ||
|
|
88e9812d5f | ||
|
|
83a827ba5b | ||
| 40b1092718 | |||
|
|
83a1128884 | ||
| 1a44a2f9e0 | |||
|
|
5044c88946 | ||
|
|
51a862ed00 | ||
|
|
1ca8e536dd | ||
|
|
2445cfbff3 | ||
|
|
21ac0611cd | ||
|
|
ff841cfa93 | ||
|
|
01cc29c8b2 | ||
|
|
a324f7afcf | ||
|
|
4272f7756e | ||
|
|
070e404bbb | ||
| ed60e2b7f3 | |||
| 7785d4f708 | |||
| 0c64711dd8 | |||
|
|
d85dba8bf8 | ||
|
|
56b8158f4a | ||
| 765507398e | |||
| 9224ea17b8 | |||
| dc08f7d1ac | |||
| 1652b5faf8 | |||
|
|
fae2a7d735 | ||
|
|
bf3a99cbf3 | ||
|
|
2e7c0b7f44 | ||
|
|
98e0f9de02 | ||
|
|
21756e05d4 | ||
|
|
abfdf29a38 | ||
|
|
120892808b | ||
|
|
0f5cb1d3c5 | ||
| dbaa42ff7e | |||
|
|
48472bdb85 | ||
|
|
fafc5f82c4 | ||
| 93ee7e4034 | |||
|
|
7d2ce51510 | ||
|
|
9202da17f1 | ||
|
|
30eddd0572 | ||
|
|
15bd1ac6d2 | ||
|
|
f5c76c1b7a | ||
|
|
b25515b5db | ||
|
|
bfa061fb03 | ||
|
|
15e3d4aec8 | ||
|
|
59489aaafa | ||
|
|
5d0421dd40 | ||
|
|
6d7ef7cf5d | ||
|
|
8d9ccf97a7 | ||
|
|
7188e3e681 | ||
|
|
a9fc77eb8b | ||
|
|
87af11288d | ||
|
|
0763187744 | ||
|
|
ae641604ba | ||
|
|
564e6ef4ab | ||
|
|
c84c5dae3b | ||
|
|
c902dabb73 | ||
|
|
8d1497032f | ||
|
|
6aeac753ef | ||
|
|
56d65a6c17 | ||
|
|
8b356c87a3 | ||
|
|
c0feeaee7b | ||
|
|
6a112c8ae2 | ||
|
|
a19952b771 | ||
|
|
0b76347853 | ||
|
|
379951699d | ||
|
|
003737cf52 | ||
|
|
20e6d3719a | ||
|
|
77617412dd | ||
|
|
68ea43c42b | ||
|
|
e65df4daad | ||
|
|
136248eec2 | ||
|
|
bfafb6dc5b | ||
|
|
0b91027da4 | ||
|
|
22aeb0bf4c | ||
|
|
87bc9d9017 | ||
|
|
43d4d37cd0 | ||
|
|
ad1528e53b | ||
|
|
c1e36440e7 | ||
|
|
16f5213d7a | ||
|
|
ab891e6125 | ||
|
|
36c8ab87a2 | ||
|
|
6c3037f19b | ||
|
|
54517c0d5f | ||
|
|
715cdb892f | ||
|
|
953b96fe05 | ||
|
|
cb19fef4c6 | ||
|
|
98c887b79d |
6
.env.LN
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 辽宁嵌入
|
||||||
|
NODE_ENV = LN
|
||||||
|
VITE_NAME="LN"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
6
.env.LNqr
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 辽宁嵌入
|
||||||
|
NODE_ENV = LNqr
|
||||||
|
VITE_NAME="LNqr"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
6
.env.qujing
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# 云南曲靖
|
||||||
|
NODE_ENV = qujing
|
||||||
|
VITE_NAME="qujing"
|
||||||
|
# 电网一张图 地图图层
|
||||||
|
VITE_NARIMAP=null
|
||||||
|
VITE_NRGISCOMMON=null
|
||||||
156
README.md
@@ -1,78 +1,78 @@
|
|||||||
#### 介绍
|
#### 介绍
|
||||||
|
|
||||||
```
|
```
|
||||||
Vue 3 + TypeScript + Vite这个模板可以帮助您开始使用Vue 3和TypeScript在Vite中进行开发。该模板使用了Vue 3的<script setup>单文件组件,请查看script setup文档了解更多信息。
|
Vue 3 + TypeScript + Vite这个模板可以帮助您开始使用Vue 3和TypeScript在Vite中进行开发。该模板使用了Vue 3的<script setup>单文件组件,请查看script setup文档了解更多信息。
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 安装依赖&运行项目
|
#### 安装依赖&运行项目
|
||||||
|
|
||||||
> node version:^18.17.0 || >=20.5.0"
|
> node version:^18.17.0 || >=20.5.0"
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
#项目使用pnpm包管理器
|
#项目使用pnpm包管理器
|
||||||
npm i pnpm -g
|
npm i pnpm -g
|
||||||
|
|
||||||
#安装依赖
|
#安装依赖
|
||||||
pnpm i
|
pnpm i
|
||||||
|
|
||||||
#运行项目
|
#运行项目
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
#冀北现场启动命令 区分是否加载现场电网一张图内网api
|
#jb现场启动命令 区分是否加载现场电网一张图内网api
|
||||||
npm run dev:jibei
|
npm run dev:jibei
|
||||||
|
|
||||||
#去除后台所有模块名 如除/xxxx-boot
|
#去除后台所有模块名 如除/xxxx-boot
|
||||||
npm run dev:removeMode
|
npm run dev:removeMode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#因海南和冀北技术监督不同 通过修改文件的方式来区分
|
#因海南和jb技术监督不同 通过修改文件的方式来区分
|
||||||
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
#海南打包 需要吧pqs目录下supervise_hn 文件夹改成supervise 原文件改成supervise_jb
|
||||||
#冀北打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
#jb打包 需要吧pqs目录下supervise_jb 文件夹改成supervise 原文件改成supervise_hn
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 页面编写-示例
|
#### 页面编写-示例
|
||||||
|
|
||||||
```
|
```
|
||||||
基础页面写法请查看`src/template`下的readme.md
|
基础页面写法请查看`src/template`下的readme.md
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 开发规范
|
#### 开发规范
|
||||||
|
|
||||||
> 初衷:养成合理的习惯,精力留在技术调研、业务开发中。
|
> 初衷:养成合理的习惯,精力留在技术调研、业务开发中。
|
||||||
>
|
>
|
||||||
> 常见点如下描述,更多的规范待前端开发人员有时间后,慢慢丰富。
|
> 常见点如下描述,更多的规范待前端开发人员有时间后,慢慢丰富。
|
||||||
|
|
||||||
- 命名风格:所有的包(文件夹)、文件名以小驼峰的风格命名,比如 xxxAaa,禁止 XxxAaa 或者 xxx-aaa。
|
- 命名风格:所有的包(文件夹)、文件名以小驼峰的风格命名,比如 xxxAaa,禁止 XxxAaa 或者 xxx-aaa。
|
||||||
- 命名语义:禁止中文命名或拼音,英文命名借用下工具,稍微准确一点,不要与实际业务相差太远。
|
- 命名语义:禁止中文命名或拼音,英文命名借用下工具,稍微准确一点,不要与实际业务相差太远。
|
||||||
- 功能组件创建风格:以**功能名称**命名文件夹,每个功能下以**index.vue**作为该功能的组件入口。正确示例参考:/src/views/auth/menu/index.vue。
|
- 功能组件创建风格:以**功能名称**命名文件夹,每个功能下以**index.vue**作为该功能的组件入口。正确示例参考:/src/views/auth/menu/index.vue。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- todo...:待后续补充。
|
- todo...:待后续补充。
|
||||||
|
|
||||||
#### 开发助手
|
#### 开发助手
|
||||||
|
|
||||||
##### 1、表格系列
|
##### 1、表格系列
|
||||||
|
|
||||||
- 页面表格以及表格页面按钮的弹出等功能参考:/views/pqs/voltageSags/sagGovern/index.vue
|
- 页面表格以及表格页面按钮的弹出等功能参考:/views/pqs/voltageSags/sagGovern/index.vue
|
||||||
- 表格中需要替换数据:
|
- 表格中需要替换数据:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// 通过formatter函数返回实际需要返回的值
|
// 通过formatter函数返回实际需要返回的值
|
||||||
{
|
{
|
||||||
title: '数据来源', field: 'dataSource', minWidth: '130',
|
title: '数据来源', field: 'dataSource', minWidth: '130',
|
||||||
formatter: (row: any) => {
|
formatter: (row: any) => {
|
||||||
return row.dataSource == 0 ? '离线导入' : '监测点同步'
|
return row.dataSource == 0 ? '离线导入' : '监测点同步'
|
||||||
}
|
}
|
||||||
}****
|
}****
|
||||||
```
|
```
|
||||||
|
|
||||||
##### 2、样式系列
|
##### 2、样式系列
|
||||||
|
|
||||||
- 获取当前主体的高度:import { mainHeight } from '@/utils/layout'
|
- 获取当前主体的高度:import { mainHeight } from '@/utils/layout'
|
||||||
- 弹框内输入框长度设置 1 行 1 个 class="form-one" 1 行 2 个 class="form-two"
|
- 弹框内输入框长度设置 1 行 1 个 class="form-one" 1 行 2 个 class="form-two"
|
||||||
|
|
||||||
#### 依赖变更记录
|
#### 依赖变更记录
|
||||||
|
|
||||||
- 2024-04-25 新增 vform3,by 洪圣文,用于页面表单设计保存为 json,命令:pnpm i vform3-builds
|
- 2024-04-25 新增 vform3,by 洪圣文,用于页面表单设计保存为 json,命令:pnpm i vform3-builds
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<script src="/static/luckysheet/plugin.js"></script>
|
<script src="/static/luckysheet/plugin.js"></script>
|
||||||
<script src="/static/luckysheet/luckysheet.umd.js"></script>
|
<script src="/static/luckysheet/luckysheet.umd.js"></script>
|
||||||
|
|
||||||
<!-- 冀北地图 -->
|
<!-- jb地图 -->
|
||||||
<!--引入样式文件-->
|
<!--引入样式文件-->
|
||||||
<script src="%VITE_NARIMAP%"></script>
|
<script src="%VITE_NARIMAP%"></script>
|
||||||
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
|
<!-- <script src="%VITE_NRGISCOMMON%"></script> -->
|
||||||
|
|||||||
8813
package-lock.json
generated
205
package.json
@@ -1,101 +1,108 @@
|
|||||||
{
|
{
|
||||||
"name": "canneng-admin",
|
"name": "canneng-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --mode dev",
|
"dev": "vite --mode dev",
|
||||||
"dev:jibei": "vite --mode jibei",
|
"dev:jibei": "vite --mode jibei",
|
||||||
"dev:hainan": "vite --mode hainan",
|
"dev:hainan": "vite --mode hainan",
|
||||||
"dev:removeMode": "vite --mode removeMode",
|
"dev:qujing": "vite --mode qujing",
|
||||||
"build": "vite build --mode dev",
|
"dev:LN": "vite --mode LN",
|
||||||
"build:jibei": "vite build --mode jibei",
|
"dev:LNqr": "vite --mode LNqr",
|
||||||
"build:hainan": "vite build --mode hainan",
|
"dev:removeMode": "vite --mode removeMode",
|
||||||
"build:removeMode": "vite build --mode removeMode",
|
"build": "vite build --mode dev",
|
||||||
"preview": "vite preview"
|
"build:jibei": "vite build --mode jibei",
|
||||||
},
|
"build:hainan": "vite build --mode hainan",
|
||||||
"dependencies": {
|
"build:qujing": "vite build --mode qujing",
|
||||||
"@ant-design/colors": "^7.0.2",
|
"build:LN": "vite build --mode LN",
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"build:LNqr": "vite build --mode LNqr",
|
||||||
"@form-create/designer": "^3.1.3",
|
"build:removeMode": "vite build --mode removeMode",
|
||||||
"@form-create/element-ui": "^3.1.24",
|
"preview": "vite preview"
|
||||||
"@fortawesome/fontawesome-free": "^6.5.1",
|
},
|
||||||
"@kjgl77/datav-vue3": "^1.7.4",
|
"dependencies": {
|
||||||
"@vue-office/docx": "^1.6.3",
|
"@ant-design/colors": "^7.0.2",
|
||||||
"@vue-office/excel": "^1.7.8",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"@vue-office/pdf": "^2.0.2",
|
"@form-create/designer": "^3.1.3",
|
||||||
"@vueuse/core": "^10.7.0",
|
"@form-create/element-ui": "^3.1.24",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@fortawesome/fontawesome-free": "^6.5.1",
|
||||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
"@kjgl77/datav-vue3": "^1.7.4",
|
||||||
"@wangeditor/plugin-formula": "^1.0.11",
|
"@vue-office/docx": "^1.6.3",
|
||||||
"axios": "^1.6.2",
|
"@vue-office/excel": "^1.7.8",
|
||||||
"bpmn-js": "8.9.0",
|
"@vue-office/pdf": "^2.0.2",
|
||||||
"bpmn-js-properties-panel": "0.46.0",
|
"@vueuse/core": "^10.7.0",
|
||||||
"bpmn-js-token-simulation": "^0.10.0",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"bpmn-moddle": "^6.0.0",
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||||
"camunda-bpmn-moddle": "^7.0.1",
|
"@wangeditor/plugin-formula": "^1.0.11",
|
||||||
"crypto-js": "^4.2.0",
|
"axios": "^1.6.2",
|
||||||
"dayjs": "^1.11.10",
|
"bpmn-js": "8.9.0",
|
||||||
"diagram-js": "^11.4.1",
|
"bpmn-js-properties-panel": "0.46.0",
|
||||||
"diagram-js-minimap": "^2.0.4",
|
"bpmn-js-token-simulation": "^0.10.0",
|
||||||
"echarts": "^5.4.3",
|
"bpmn-moddle": "^6.0.0",
|
||||||
"echarts-gl": "^2.0.9",
|
"camunda-bpmn-moddle": "^7.0.1",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"crypto-js": "^4.2.0",
|
||||||
"echarts4": "npm:echarts@^4.9.0",
|
"dayjs": "^1.11.10",
|
||||||
"element-plus": "^2.9.11",
|
"diagram-js": "^11.4.1",
|
||||||
"exceljs": "^4.4.0",
|
"diagram-js-minimap": "^2.0.4",
|
||||||
"file-saver": "^2.0.5",
|
"echarts": "^5.4.3",
|
||||||
"grid-layout-plus": "^1.1.0",
|
"echarts-gl": "^2.0.9",
|
||||||
"html2canvas": "^1.4.1",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"jquery": "^3.7.1",
|
"echarts4": "npm:echarts@^4.9.0",
|
||||||
"js-pinyin": "^0.2.5",
|
"element-plus": "^2.9.11",
|
||||||
"jsencrypt": "^3.3.2",
|
"exceljs": "^4.4.0",
|
||||||
"katex": "^0.16.11",
|
"file-saver": "^2.0.5",
|
||||||
"less": "^4.2.0",
|
"grid-layout-plus": "^1.1.0",
|
||||||
"lodash-es": "^4.17.21",
|
"html2canvas": "^1.4.1",
|
||||||
"luckyexcel": "^1.0.1",
|
"jquery": "^3.7.1",
|
||||||
"luckysheet": "^2.1.13",
|
"js-pinyin": "^0.2.5",
|
||||||
"mathjax": "^3.2.2",
|
"jsencrypt": "^3.3.2",
|
||||||
"min-dash": "^4.2.1",
|
"katex": "^0.16.11",
|
||||||
"mitt": "^3.0.1",
|
"less": "^4.2.0",
|
||||||
"mqtt": "^5.13.3",
|
"lodash-es": "^4.17.21",
|
||||||
"nprogress": "^0.2.0",
|
"luckyexcel": "^1.0.1",
|
||||||
"pinia": "^2.1.7",
|
"luckysheet": "^2.1.13",
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"mathjax": "^3.2.2",
|
||||||
"qs": "^6.12.0",
|
"min-dash": "^4.2.1",
|
||||||
"screenfull": "^6.0.2",
|
"mitt": "^3.0.1",
|
||||||
"splitpanes": "^3.1.5",
|
"mqtt": "^5.13.3",
|
||||||
"steady-xml": "0.1.0",
|
"nprogress": "^0.2.0",
|
||||||
"svg-pan-zoom": "^3.6.2",
|
"pinia": "^2.1.7",
|
||||||
"use-element-plus-theme": "^0.0.5",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"vexip-ui": "^2.3.28",
|
"qs": "^6.12.0",
|
||||||
"vue": "^3.3.11",
|
"screenfull": "^6.0.2",
|
||||||
"vue-baidu-map-3x": "^1.0.35",
|
"splitpanes": "^3.1.5",
|
||||||
"vue-baidu-map-offline": "^1.0.7",
|
"steady-xml": "0.1.0",
|
||||||
"vue-demi": "^0.14.8",
|
"svg-pan-zoom": "^3.6.2",
|
||||||
"vue-draggable-resizable": "3.0.0-beta.2",
|
"use-element-plus-theme": "^0.0.5",
|
||||||
"vue-i18n": "9.10.2",
|
"vexip-ui": "^2.3.28",
|
||||||
"vue-katex": "^0.5.0",
|
"vue": "^3.3.11",
|
||||||
"vue-router": "4",
|
"vue-baidu-map-3x": "^1.0.35",
|
||||||
"vue-types": "^5.1.1",
|
"vue-baidu-map-offline": "^1.0.7",
|
||||||
"vxe-table": "^4.5.17",
|
"vue-demi": "^0.14.8",
|
||||||
"vxe-table-plugin-export-xlsx": "^4.0.1",
|
"vue-draggable-resizable": "3.0.0-beta.2",
|
||||||
"web-storage-cache": "^1.1.1",
|
"vue-i18n": "9.10.2",
|
||||||
"xe-utils": "^3.5.14",
|
"vue-katex": "^0.5.0",
|
||||||
"yarn": "^1.22.22"
|
"vue-router": "4",
|
||||||
},
|
"vue-types": "^5.1.1",
|
||||||
"devDependencies": {
|
"vxe-pc-ui": "~4.15.19",
|
||||||
"@purge-icons/generated": "^0.9.0",
|
"vxe-table": "^4.19.22",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||||
"@types/node": "^20.10.5",
|
"web-storage-cache": "^1.1.1",
|
||||||
"@types/splitpanes": "^2.2.6",
|
"xe-utils": "^3.5.14",
|
||||||
"@vitejs/plugin-vue": "^4.5.2",
|
"yarn": "^1.22.22"
|
||||||
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
},
|
||||||
"sass": "^1.69.5",
|
"devDependencies": {
|
||||||
"typescript": "^5.2.2",
|
"@purge-icons/generated": "^0.9.0",
|
||||||
"unplugin-auto-import": "^0.16.7",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"vite": "^5.0.8",
|
"@types/node": "^20.10.5",
|
||||||
"vite-plugin-mkcert": "^1.17.3",
|
"@types/splitpanes": "^2.2.6",
|
||||||
"vue-tsc": "^1.8.25"
|
"@vitejs/plugin-vue": "^4.5.2",
|
||||||
}
|
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
||||||
|
"sass": "^1.69.5",
|
||||||
|
"typescript": "^5.2.2",
|
||||||
|
"unplugin-auto-import": "^0.16.7",
|
||||||
|
"vite": "^5.0.8",
|
||||||
|
"vite-plugin-mkcert": "^1.17.3",
|
||||||
|
"vue-tsc": "^1.8.25"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/App.vue
@@ -9,14 +9,20 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|||||||
import useSetTheme from '@/utils/setTheme'
|
import useSetTheme from '@/utils/setTheme'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
useSetTheme()
|
useSetTheme()
|
||||||
onMounted(async () => {
|
const fetchMqttUrl = async () => {
|
||||||
const response = await fetch('/')
|
const response = await fetch('/')
|
||||||
const WebSocketUrl:any = response.headers.get('X-WebSocket-Url')
|
const WebSocketUrl: any = response.headers.get('X-WebSocket-Url')
|
||||||
const WebSocketUrl2:any = response.headers.get('X-WebSocket-Url2')
|
const WebSocketUrl2: any = response.headers.get('X-WebSocket-Url2')
|
||||||
const MqttUrl:any = response.headers.get('X-MqttUrl-Url')
|
const WebSocketUrl3: any = response.headers.get('X-WebSocket-Url3')
|
||||||
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
const MqttUrl: any = response.headers.get('X-MqttUrl-Url')
|
||||||
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
localStorage.setItem('WebSocketUrl', WebSocketUrl)
|
||||||
|
localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
|
||||||
|
localStorage.setItem('WebSocketUrl3', WebSocketUrl3)
|
||||||
localStorage.setItem('MqttUrl', MqttUrl)
|
localStorage.setItem('MqttUrl', MqttUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
fetchMqttUrl()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
// 密码规则修改
|
// 密码规则修改
|
||||||
export function ruleUpdate(data) {
|
export function ruleUpdate(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
@@ -24,3 +25,77 @@ export function unlockRoot(data) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据客户端名查询信息
|
||||||
|
export function getClientInfoByPath() {
|
||||||
|
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/authClient/getAuthClientByName/njcn',
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//客户端会话配置更新
|
||||||
|
export function updateClientSessionConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/authClient/sessionConfigUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取用户配置
|
||||||
|
export function getUserConfig() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/password/getUserStrategyList',
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询系统列表
|
||||||
|
export function getSystemList() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/getSysConfigData',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//激活系统配置
|
||||||
|
export function activeSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/updateSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除系统配置
|
||||||
|
export function deleteSystemConfig( data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/removeSysConfigById',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增系统配置
|
||||||
|
export function addSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/addSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改系统配置
|
||||||
|
export function updateSystemConfig(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/config/updateSysConfig',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -129,7 +129,7 @@ export function queryAllByType(params: any) {
|
|||||||
//获取用户
|
//获取用户
|
||||||
export function selectUserList(data: any) {
|
export function selectUserList(data: any) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/supervision-boot/userReport/selectUserList',
|
url: '/device-boot/userReport/selectUserList',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -206,3 +206,11 @@ export function exportTerminalBase() {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//一键分配终端
|
||||||
|
export function allotTerminal(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/device-boot/nodeDevice/oneKeyDistribution',
|
||||||
|
method: 'post',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 获取区域中断终端
|
// 获取区域中断终端
|
||||||
export function getAreaOffDev(data) {
|
export function getAreaOffDev(data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/device-boot/device/getAreaOffDev',
|
url: '/device-boot/device/getAreaOffDev',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@@ -9,10 +9,28 @@ export function getAreaOffDev(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取区域中断终端
|
// 获取区域中断终端
|
||||||
export function getYwZtSubstation(data) {
|
export function getYwZtSubstation(data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/device-boot/ywZt/getYwZtSubstation',
|
url: '/device-boot/ywZt/getYwZtSubstation',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: data
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//终端周期检测
|
||||||
|
export function terminalCheckPage(data:any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/alarm/terminalCheckPage',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function userCheckUpload(data:any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/userCheckUpload',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -45,3 +45,13 @@ export const getLineOverLimitData = (id: string) => {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//导出数据总览
|
||||||
|
export function dataVerifyExcel(params: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/dataVerify/dataVerifyExcel',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -31,4 +31,13 @@ export function getDevTypeList() {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getDeviceTypeList = (params: any) => {
|
||||||
|
return createAxios({
|
||||||
|
url: '/device-boot/devType/pageDevTypeList',
|
||||||
|
method: 'POST',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,10 @@ import request from '@/utils/request'
|
|||||||
export function getSubLineGiveAnAlarm(data: any) {
|
export function getSubLineGiveAnAlarm(data: any) {
|
||||||
return request({ url: '/harmonic-boot/gridDiagram/getSubLineGiveAnAlarm', method: 'post', data })
|
return request({ url: '/harmonic-boot/gridDiagram/getSubLineGiveAnAlarm', method: 'post', data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getAreaObjAlarm(data: any) {
|
||||||
|
return request({ url: '/harmonic-boot/gridDiagram/getAreaObjAlarm', method: 'post', data })
|
||||||
|
}
|
||||||
// 变电站详细列表
|
// 变电站详细列表
|
||||||
export function getPollutionAlarmPageData(data: any) {
|
export function getPollutionAlarmPageData(data: any) {
|
||||||
return request({ url: '/harmonic-boot/gridDiagram/getPollutionAlarmPageData', method: 'post', data })
|
return request({ url: '/harmonic-boot/gridDiagram/getPollutionAlarmPageData', method: 'post', data })
|
||||||
|
|||||||
103
src/api/device-boot/sensitiveLoadMange.ts
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 新增敏感用户
|
||||||
|
export function saveUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/save',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改敏感用户
|
||||||
|
export function updateUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除敏感用户
|
||||||
|
export function deleteUser(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqSensitiveUser/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源接入功能删除流程
|
||||||
|
*/
|
||||||
|
export const deleteUserReport = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/deleteUserReport',
|
||||||
|
method: 'POST',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 提交表单数据
|
||||||
|
*/
|
||||||
|
export const submitFormData = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/add',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getById = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/getById',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交表单数据
|
||||||
|
*/
|
||||||
|
export const addEditor = (data: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReportRenewal/addEditor',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getByDeptDevLine = (params: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/line/getByDeptDevLine',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据id获取用户档案录入的详细数据
|
||||||
|
*/
|
||||||
|
export const getUserReportUpdateById = (id: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReportRenewal/getUserReportUpdateById?businessId='+id,
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据id获取用户档案录入的详细数据
|
||||||
|
export const getUserReportById = (id: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/userReport/getUserReportById?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 根据id查询文件信息集合
|
||||||
|
export const getFileById = (params: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/fileUrl/getFileById',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,72 +1,137 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
//事件报告
|
|
||||||
export function getEventReport(data) {
|
//事件报告
|
||||||
return createAxios({
|
// export function getEventReport(data) {
|
||||||
url: '/event-boot/report/getEventReport',
|
// return createAxios({
|
||||||
method: 'post',
|
// url: '/event-boot/report/getEventReport',
|
||||||
data
|
// method: 'post',
|
||||||
})
|
// data
|
||||||
}
|
// })
|
||||||
// 生成报告
|
// }
|
||||||
export function getAreaReport(data) {
|
|
||||||
return createAxios({
|
export function getEventReport(data) {
|
||||||
url: '/event-boot/report/getAreaReport',
|
return createAxios({
|
||||||
method: 'post',
|
url: '/event-boot/report/createEventReport',
|
||||||
data,
|
method: 'post',
|
||||||
responseType: 'blob'
|
data,
|
||||||
})
|
responseType: 'blob'
|
||||||
}
|
}).then(async res => {
|
||||||
//查询所有模板
|
let load: any = await readJsonBlob(res)
|
||||||
export function getList(data) {
|
if (load.code) {
|
||||||
return createAxios({
|
if (load.data.code == 'A0011') {
|
||||||
url: '/system-boot/EventTemplate/getList',
|
ElMessage.warning('下载失败!')
|
||||||
method: 'post',
|
} else {
|
||||||
data
|
ElMessage.warning(load.data.message)
|
||||||
})
|
}
|
||||||
}
|
} else {
|
||||||
export function selectReleation(data) {
|
return res
|
||||||
return createAxios({
|
}
|
||||||
url: '/system-boot/EventTemplate/selectReleation',
|
})
|
||||||
method: 'post',
|
}
|
||||||
params: data
|
|
||||||
})
|
|
||||||
}
|
// 生成报告
|
||||||
export function getLineExport(data) {
|
export function getAreaReport(data) {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/event-boot/report/getLineExport',
|
url: '/event-boot/report/getAreaReport',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
}).then(async res => {
|
||||||
}
|
let load: any = await readJsonBlob(res)
|
||||||
export function getVoltage(data: any) {
|
if (load.code) {
|
||||||
return createAxios({
|
if (load.data.code == 'A0011') {
|
||||||
url: '/event-boot/report/getVoltage',
|
ElMessage.warning('下载失败!')
|
||||||
method: 'post',
|
} else {
|
||||||
data
|
ElMessage.warning(load.data.message)
|
||||||
})
|
}
|
||||||
}
|
} else {
|
||||||
export function getGeneralSituation(data: any) {
|
return res
|
||||||
return createAxios({
|
}
|
||||||
url: '/event-boot/report/getGeneralSituation',
|
})
|
||||||
method: 'post',
|
}
|
||||||
data
|
async function readJsonBlob(blob) {
|
||||||
})
|
try {
|
||||||
}
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
export function getTransientValue(data: any) {
|
const jsonStr = await blob.text()
|
||||||
return createAxios({
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
url: '/event-boot/transient/getTransientValue',
|
const jsonData = JSON.parse(jsonStr)
|
||||||
method: 'post',
|
// 3. 拿到数据,后续随便用
|
||||||
data
|
return {
|
||||||
})
|
code: true,
|
||||||
}
|
data: jsonData
|
||||||
// 周报导出
|
}
|
||||||
export function getExport(data: any) {
|
} catch (err) {
|
||||||
return createAxios({
|
return {
|
||||||
url: '/event-boot/report/getExport',
|
code: false,
|
||||||
method: 'post',
|
data: {}
|
||||||
data,
|
}
|
||||||
responseType: 'blob'
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查询所有模板
|
||||||
|
export function getList(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/EventTemplate/getList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function selectReleation(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/system-boot/EventTemplate/selectReleation',
|
||||||
|
method: 'post',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getLineExport(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getLineExport',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getVoltage(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getVoltage',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getGeneralSituation(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getGeneralSituation',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getTransientValue(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/transient/getTransientValue',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 周报导出
|
||||||
|
export function getExport(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/event-boot/report/getExport',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,106 +1,114 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getTypeIdData(data: any) {
|
export function getTypeIdData(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system-boot/dictData/getTypeIdData',
|
url: '/system-boot/dictData/getTypeIdData',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getOnlineRateData2(data:any) {
|
export function getOnlineRateData2(data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/harmonic-boot/onlineRateData/getOnlineRateData',
|
url: '/harmonic-boot/onlineRateData/getOnlineRateData',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getAreaDept() {
|
export function getAreaDept() {
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/dept/loginDeptTree',
|
url: '/user-boot/dept/loginDeptTree',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function getOnlineRateDataCensus(data:any) {
|
// 承载能力评估去除前缀
|
||||||
return request({
|
export function getAreaDeptRemoveMode(params) {
|
||||||
url: '/device-boot/terminalOnlineRateData/getOnlineRateDataCensus',
|
return request({
|
||||||
method: 'post',
|
url: '/user-boot/dept/loginDeptTree',
|
||||||
data: data
|
method: 'GET',
|
||||||
})
|
params: params
|
||||||
}
|
})
|
||||||
export function IntegrityIcon(data:any) {
|
}
|
||||||
return request({
|
export function getOnlineRateDataCensus(data:any) {
|
||||||
url: '/harmonic-boot/integrity/getIntegrityIcon',
|
return request({
|
||||||
method: 'post',
|
url: '/device-boot/terminalOnlineRateData/getOnlineRateDataCensus',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getDeptIdAreaTree() {
|
}
|
||||||
return request({
|
export function IntegrityIcon(data:any) {
|
||||||
url: '/system-boot/area/getDeptIdAreaTree',
|
return request({
|
||||||
method: 'post'
|
url: '/harmonic-boot/integrity/getIntegrityIcon',
|
||||||
})
|
method: 'post',
|
||||||
}
|
data: data
|
||||||
export function getOnlineRateData(data:any) {
|
})
|
||||||
return request({
|
}
|
||||||
url: '/device-boot/terminalOnlineRateData/getOnlineRateData',
|
export function getDeptIdAreaTree() {
|
||||||
method: 'post',
|
return request({
|
||||||
data: data
|
url: '/system-boot/area/getDeptIdAreaTree',
|
||||||
})
|
method: 'post'
|
||||||
}
|
})
|
||||||
export function getSubstationInfoById(data:any) {
|
}
|
||||||
return request({
|
export function getOnlineRateData(data:any) {
|
||||||
url: '/harmonic-boot/PollutionSubstation/getSubstationInfoById',
|
return request({
|
||||||
method: 'post',
|
url: '/device-boot/terminalOnlineRateData/getOnlineRateData',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getLineInfoById(data:any) {
|
}
|
||||||
return request({
|
export function getSubstationInfoById(data:any) {
|
||||||
url: '/harmonic-boot/PollutionSubstation/getLineInfoById',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/PollutionSubstation/getSubstationInfoById',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getLineRank(data:any) {
|
}
|
||||||
return request({
|
export function getLineInfoById(data:any) {
|
||||||
url: '/harmonic-boot/PollutionSubstation/getLineRank',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/PollutionSubstation/getLineInfoById',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function deptInfo(data:any) {
|
}
|
||||||
return request({
|
export function getLineRank(data:any) {
|
||||||
url: '/harmonic-boot/detailAnalysis/deptInfo',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/PollutionSubstation/getLineRank',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getXbLineInfoById(data:any) {
|
}
|
||||||
return request({
|
export function deptInfo(data:any) {
|
||||||
url: '/harmonic-boot/detailAnalysis/getXbLineInfoById',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/detailAnalysis/deptInfo',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getSubInfoById(data:any) {
|
}
|
||||||
return request({
|
export function getXbLineInfoById(data:any) {
|
||||||
url: '/harmonic-boot/detailAnalysis/getSubInfoById',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/detailAnalysis/getXbLineInfoById',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
export function getXbLineRank(data:any) {
|
}
|
||||||
return request({
|
export function getSubInfoById(data:any) {
|
||||||
url: '/harmonic-boot/detailAnalysis/getXbLineRank',
|
return request({
|
||||||
method: 'post',
|
url: '/harmonic-boot/detailAnalysis/getSubInfoById',
|
||||||
data: data
|
method: 'post',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
// 数据补招
|
}
|
||||||
export function FullRecall(data:any) {
|
export function getXbLineRank(data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/data-processing-boot/data/FullRecall',
|
url: '/harmonic-boot/detailAnalysis/getXbLineRank',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 数据补招
|
||||||
|
export function FullRecall(data:any) {
|
||||||
|
return request({
|
||||||
|
url: '/data-processing-boot/data/FullRecall',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,48 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
export function getHistoryResult(data: any) {
|
export function getHistoryResult(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/harmonic-boot/harmonic/getHistoryResult',
|
url: '/harmonic-boot/harmonic/getHistoryResult',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// word报告
|
// word报告
|
||||||
export function exportModelJB(data: any) {
|
export function exportModelJB(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/harmonic-boot/exportmodel/exportModelJB',
|
url: '/harmonic-boot/exportmodel/exportModelJB',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
data: data
|
data: data
|
||||||
})
|
}).then(async res => {
|
||||||
}
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,60 @@
|
|||||||
import createAxios from '@/utils/request'
|
import createAxios from '@/utils/request'
|
||||||
|
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||||
export function exportModel(data: any) {
|
|
||||||
return createAxios({
|
export function exportModel(data: any) {
|
||||||
url: '/harmonic-boot/exportmodel/exportModel',
|
return createAxios({
|
||||||
method: 'post',
|
url: '/harmonic-boot/exportmodel/exportModel',
|
||||||
data: data,
|
method: 'post',
|
||||||
responseType: 'blob'
|
data: data,
|
||||||
})
|
responseType: 'blob'
|
||||||
}
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function areaHarmonicReport(data: any) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/harmonic-boot/areaHarmonicReport/areaHarmonicReport',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(async res => {
|
||||||
|
let load: any = await readJsonBlob(res)
|
||||||
|
if (load.code) {
|
||||||
|
if (load.data.code == 'A0011') {
|
||||||
|
ElMessage.warning('下载失败!')
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(load.data.message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
async function readJsonBlob(blob) {
|
||||||
|
try {
|
||||||
|
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||||
|
const jsonStr = await blob.text()
|
||||||
|
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||||
|
const jsonData = JSON.parse(jsonStr)
|
||||||
|
// 3. 拿到数据,后续随便用
|
||||||
|
return {
|
||||||
|
code: true,
|
||||||
|
data: jsonData
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
return {
|
||||||
|
code: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
// console.error('解析Blob的JSON数据失败:', err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
42
src/api/system-boot/MonitoringPoint.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
//查询所有模板
|
||||||
|
export function getList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/getList",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//字典树
|
||||||
|
export function getDictTree(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/DictTree",
|
||||||
|
method: "post",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//新增模板
|
||||||
|
export function addData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/add",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//修改模板
|
||||||
|
export function updateData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/update",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除模板
|
||||||
|
export function deleteData(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/EventTemplate/delete",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
43
src/api/system-boot/ReportTemplate.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//获取字典树数据
|
||||||
|
export function getDictTree(data) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/DictTree",
|
||||||
|
method: "post",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询字典列表
|
||||||
|
export function getReportDictList(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/getReportDictList",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//新增字典表
|
||||||
|
export function addDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/addDict",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//更新字典表
|
||||||
|
export function updateDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/updateDict",
|
||||||
|
method: "put",
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除字典表
|
||||||
|
export function deleteDict(data: any) {
|
||||||
|
return request({
|
||||||
|
url: "/system-boot/reportDict/deleteDict",
|
||||||
|
method: "delete",
|
||||||
|
params:data
|
||||||
|
});
|
||||||
|
}
|
||||||
37
src/api/system-boot/area.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
//区域树形表格接口
|
||||||
|
export function areaTree(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/areaTree',
|
||||||
|
method: 'post',
|
||||||
|
params: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function areaAdd(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function areaDelete(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function update(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function selectPid(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/area/selectPid',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ export const uploadFile = (file: any, path: string) => {
|
|||||||
data: form
|
data: form
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == `A0000`) {
|
if (res.code == `A0000`) {
|
||||||
ElMessage.success('上传成功!')
|
ElMessage.success('文件上传成功!')
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,215 +1,250 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { LoginData } from '@/api/types'
|
import { LoginData } from '@/api/types'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
import { sm3Digest } from '@/assets/commjs/sm3.js'
|
||||||
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
|
import { sm2, encrypt } from '@/assets/commjs/sm2.js'
|
||||||
|
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
export function gongkey(params?: any) {
|
export function gongkey(params?: any) {
|
||||||
if (!params) {
|
if (!params) {
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
params = {
|
params = {
|
||||||
loginName: encrypt(adminInfo.$state.loginName)
|
loginName: encrypt(adminInfo.$state.loginName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/user/generateSm2Key',
|
url: '/user-boot/user/generateSm2Key',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function pwdSm3(pwd: any, loginName?: string) {
|
export async function pwdSm3(pwd: any, loginName?: string) {
|
||||||
let publicKey = await gongkey(
|
let publicKey = await gongkey(
|
||||||
loginName
|
loginName
|
||||||
? {
|
? {
|
||||||
loginName: encrypt(loginName)
|
loginName: encrypt(loginName)
|
||||||
}
|
}
|
||||||
: false
|
: false
|
||||||
)
|
)
|
||||||
let sm3Pwd = sm3Digest(pwd) //SM3加密
|
let sm3Pwd = sm3Digest(pwd) //SM3加密
|
||||||
return sm2(sm3Pwd + '|' + pwd, publicKey.data, 0)
|
return sm2(sm3Pwd + '|' + pwd, publicKey.data, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
//登录获取token
|
//登录获取token
|
||||||
export async function login(params: any) {
|
export async function login(params: any) {
|
||||||
if (params.refresh_token == undefined) {
|
if (params.refresh_token == undefined) {
|
||||||
params.password = await pwdSm3(params.password, params.username)
|
params.password = await pwdSm3(params.password, params.username)
|
||||||
}
|
}
|
||||||
params.username = encrypt(params.username)
|
params.username = encrypt(params.username)
|
||||||
return request({
|
return request({
|
||||||
url: '/pqs-auth/oauth/token',
|
url: '/pqs-auth/oauth/token',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//辽宁嵌入登录获取token
|
||||||
//获取用户信息
|
export async function loginLNqr(data: any) {
|
||||||
export function getUserById() {
|
return request({
|
||||||
const adminInfo = useAdminInfo()
|
url: '/pqs-auth/oauth/lnLogin',
|
||||||
return request({
|
method: 'get',
|
||||||
url: '/user-boot/user/getUserById?id=' + adminInfo.userIndex,
|
params: data
|
||||||
method: 'get'
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
|
export async function lnRefreshToken(data: any) {
|
||||||
// 刷新token
|
return request({
|
||||||
// 导出一个名为refreshToken的函数,该函数返回一个Promise对象
|
url: '/pqs-auth/oauth/lnRefreshToken',
|
||||||
export function refreshToken(): Promise<any> {
|
method: 'get',
|
||||||
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
params: data
|
||||||
const adminInfo = useAdminInfo()
|
})
|
||||||
// 调用login函数,传入一个对象作为参数,该对象包含grant_type、refresh_token和username三个属性
|
}
|
||||||
// grant_type设置为'refresh_token',表示使用刷新令牌的方式获取新的访问令牌
|
|
||||||
// refresh_token使用adminInfo中的refresh_token属性
|
export async function logout() {
|
||||||
// username使用adminInfo中的loginName属性
|
return request({
|
||||||
// 返回login函数的调用结果,即一个Promise对象
|
url: '/pqs-auth/oauth/logout',
|
||||||
return login({
|
method: 'DELETE',
|
||||||
grant_type: 'refresh_token',
|
})
|
||||||
refresh_token: adminInfo.refresh_token,
|
}
|
||||||
username: adminInfo.loginName
|
|
||||||
})
|
|
||||||
}
|
//获取用户信息
|
||||||
|
export function getUserById() {
|
||||||
/**
|
const adminInfo = useAdminInfo()
|
||||||
* 获取营销用户列表
|
return request({
|
||||||
* @returns {AxiosPromise}
|
url: '/user-boot/user/getUserById?id=' + adminInfo.userIndex,
|
||||||
*/
|
method: 'get'
|
||||||
export const getMarketList = () => {
|
})
|
||||||
return request({
|
}
|
||||||
url: '/user-boot/user/getMarketList',
|
|
||||||
method: 'post'
|
// 刷新token
|
||||||
})
|
// 导出一个名为refreshToken的函数,该函数返回一个Promise对象
|
||||||
}
|
export function refreshToken(): Promise<any> {
|
||||||
|
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
||||||
export function add(data: any) {
|
const adminInfo = useAdminInfo()
|
||||||
return request({
|
// 调用login函数,传入一个对象作为参数,该对象包含grant_type、refresh_token和username三个属性
|
||||||
url: '/user-boot/user/add',
|
// grant_type设置为'refresh_token',表示使用刷新令牌的方式获取新的访问令牌
|
||||||
method: 'post',
|
// refresh_token使用adminInfo中的refresh_token属性
|
||||||
data: data
|
// username使用adminInfo中的loginName属性
|
||||||
})
|
// 返回login函数的调用结果,即一个Promise对象
|
||||||
}
|
return login({
|
||||||
|
grant_type: 'refresh_token',
|
||||||
export function edit(data: any) {
|
refresh_token: adminInfo.refresh_token,
|
||||||
return request({
|
username: adminInfo.loginName
|
||||||
url: '/user-boot/user/update',
|
})
|
||||||
method: 'put',
|
}
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
export function lnRefreshTokenTo(): Promise<any> {
|
||||||
|
// 调用useAdminInfo函数获取管理员信息,并将其赋值给adminInfo变量
|
||||||
export async function passwordConfirm(pwd: string) {
|
const adminInfo = useAdminInfo()
|
||||||
return request({
|
return lnRefreshToken({
|
||||||
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd)),
|
refreshToken: adminInfo.refresh_token,
|
||||||
method: 'get'
|
clientId: "njcn",
|
||||||
})
|
clientSecret:"njcnpqs"
|
||||||
}
|
})
|
||||||
|
}
|
||||||
export function deluser(data: any) {
|
|
||||||
return request({
|
/**
|
||||||
url: '/user-boot/user/delete',
|
* 获取营销用户列表
|
||||||
method: 'delete',
|
* @returns {AxiosPromise}
|
||||||
params: data
|
*/
|
||||||
})
|
export const getMarketList = () => {
|
||||||
}
|
return request({
|
||||||
|
url: '/user-boot/user/getMarketList',
|
||||||
export function activateUser(data: any) {
|
method: 'post'
|
||||||
return request({
|
})
|
||||||
url: '/user-boot/user/activateUser',
|
}
|
||||||
method: 'put',
|
|
||||||
params: data
|
export function add(data: any) {
|
||||||
})
|
return request({
|
||||||
}
|
url: '/user-boot/user/add',
|
||||||
|
method: 'post',
|
||||||
export async function updatePassword(params: any) {
|
data: data
|
||||||
return request({
|
})
|
||||||
url: '/user-boot/user/updatePassword',
|
}
|
||||||
method: 'put',
|
|
||||||
params: {
|
export function edit(data: any) {
|
||||||
id: params.id,
|
return request({
|
||||||
newPassword: await pwdSm3(params.newPassword)
|
url: '/user-boot/user/update',
|
||||||
}
|
method: 'put',
|
||||||
})
|
data: data
|
||||||
}
|
})
|
||||||
|
}
|
||||||
export async function updateFirstPassword(params: any) {
|
|
||||||
return request({
|
export async function passwordConfirm(pwd: string) {
|
||||||
url: '/user-boot/user/updateFirstPassword',
|
return request({
|
||||||
method: 'put',
|
url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd)),
|
||||||
data: {
|
method: 'get'
|
||||||
name: encrypt(params.name),
|
})
|
||||||
password: await pwdSm3(params.password, params.name)
|
}
|
||||||
}
|
|
||||||
})
|
export function deluser(data: any) {
|
||||||
}
|
return request({
|
||||||
|
url: '/user-boot/user/delete',
|
||||||
export function checkUser(data: any) {
|
method: 'delete',
|
||||||
return request({
|
params: data
|
||||||
url: '/user-boot/user/check',
|
})
|
||||||
method: 'put',
|
}
|
||||||
data: data
|
|
||||||
})
|
export function activateUser(data: any) {
|
||||||
}
|
return request({
|
||||||
export function existMonitorDeptTree() {
|
url: '/user-boot/user/activateUser',
|
||||||
return request({
|
method: 'put',
|
||||||
url: '/user-boot/dept/existMonitorDeptTree',
|
params: data
|
||||||
method: 'post'
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
// 获取用户
|
export async function updatePassword(params: any) {
|
||||||
export function getUserByRoleType(data: any) {
|
return request({
|
||||||
return request({
|
url: '/user-boot/user/updatePassword',
|
||||||
url: '/user-boot/user/getUserByRoleType?roleType=' + data,
|
method: 'put',
|
||||||
method: 'GET'
|
params: {
|
||||||
})
|
id: params.id,
|
||||||
}
|
newPassword: await pwdSm3(params.newPassword)
|
||||||
|
}
|
||||||
// 获取部门下所有用户
|
})
|
||||||
export function listAllUserByDeptId(data: any) {
|
}
|
||||||
return request({
|
|
||||||
url: '/user-boot/user/listAllUserByDeptId?deptId=' + data,
|
export async function updateFirstPassword(params: any) {
|
||||||
method: 'GET'
|
return request({
|
||||||
})
|
url: '/user-boot/user/updateFirstPassword',
|
||||||
}
|
method: 'put',
|
||||||
|
data: {
|
||||||
// 根据id获取所有用户信息
|
name: encrypt(params.name),
|
||||||
export function getUserListByIds(data: any) {
|
password: await pwdSm3(params.password, params.name)
|
||||||
return request({
|
}
|
||||||
url: '/user-boot/user/getUserListByIds',
|
})
|
||||||
method: 'POST',
|
}
|
||||||
data
|
|
||||||
})
|
export function checkUser(data: any) {
|
||||||
}
|
return request({
|
||||||
|
url: '/user-boot/user/check',
|
||||||
/**
|
method: 'put',
|
||||||
* 查询所有用户不包括管理员
|
data: data
|
||||||
*/
|
})
|
||||||
export const getUserSimpleList = () => {
|
}
|
||||||
return request({
|
export function existMonitorDeptTree() {
|
||||||
url: '/user-boot/user/simpleList',
|
return request({
|
||||||
method: 'GET'
|
url: '/user-boot/dept/existMonitorDeptTree',
|
||||||
})
|
method: 'post'
|
||||||
}
|
})
|
||||||
|
}
|
||||||
/**
|
// 获取用户
|
||||||
* 查询所有用户包括管理员
|
export function getUserByRoleType(data: any) {
|
||||||
*/
|
return request({
|
||||||
export const getAllUserSimpleList = () => {
|
url: '/user-boot/user/getUserByRoleType?roleType=' + data,
|
||||||
return request({
|
method: 'GET'
|
||||||
url: '/user-boot/user/getAllUserSimpleList',
|
})
|
||||||
method: 'GET'
|
}
|
||||||
})
|
|
||||||
}
|
// 获取部门下所有用户
|
||||||
|
export function listAllUserByDeptId(data: any) {
|
||||||
export const getSysConfig = () => {
|
return request({
|
||||||
return request({
|
url: '/user-boot/user/listAllUserByDeptId?deptId=' + data,
|
||||||
url: '/system-boot/config/getSysConfig',
|
method: 'GET'
|
||||||
method: 'get'
|
})
|
||||||
})
|
}
|
||||||
}
|
|
||||||
// 驾驶舱组件配置
|
// 根据id获取所有用户信息
|
||||||
export const componentTree = () => {
|
export function getUserListByIds(data: any) {
|
||||||
return request({
|
return request({
|
||||||
url: '/user-boot/component/componentTree',
|
url: '/user-boot/user/getUserListByIds',
|
||||||
method: 'GET'
|
method: 'POST',
|
||||||
})
|
data
|
||||||
}
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有用户不包括管理员
|
||||||
|
*/
|
||||||
|
export const getUserSimpleList = () => {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/user/simpleList',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有用户包括管理员
|
||||||
|
*/
|
||||||
|
export const getAllUserSimpleList = () => {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/user/getAllUserSimpleList',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSysConfig = () => {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/config/getSysConfig',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 驾驶舱组件配置
|
||||||
|
export const componentTree = () => {
|
||||||
|
return request({
|
||||||
|
url: '/user-boot/component/componentTree',
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/assets/img/region.png
Normal file
|
After Width: | Height: | Size: 243 KiB |
BIN
src/assets/imgs/m0.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
src/assets/imgs/m1.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
src/assets/imgs/m2.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src/assets/imgs/m3.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/assets/imgs/m4.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
src/assets/logo/海南.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/logo/灿能.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/logo/电网.png
Normal file
|
After Width: | Height: | Size: 249 KiB |
BIN
src/assets/logo/电网1.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
@@ -23,7 +23,7 @@ export function upper(str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function makeOptionsRule(t, to, userOptions) {
|
export function makeOptionsRule(t, to, userOptions) {
|
||||||
console.log(userOptions[0])
|
//console.log(userOptions[0])
|
||||||
const options = [
|
const options = [
|
||||||
{ label: t('props.optionsType.struct'), value: 0 },
|
{ label: t('props.optionsType.struct'), value: 0 },
|
||||||
{ label: t('props.optionsType.json'), value: 1 },
|
{ label: t('props.optionsType.json'), value: 1 },
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { downloadFile } from '@/api/system-boot/file'
|
|||||||
import { previewFile } from '@/utils/fileDownLoad'
|
import { previewFile } from '@/utils/fileDownLoad'
|
||||||
|
|
||||||
const { push, options, currentRoute } = useRouter()
|
const { push, options, currentRoute } = useRouter()
|
||||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
const VITE_FLAG = false//import.meta.env.VITE_NAME == 'jibei'
|
||||||
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
// const url = 'http://192.168.1.22:9009/excelreport' + currentRoute.value.href?.split('?')[1]
|
||||||
const url = ref('')
|
const url = ref('')
|
||||||
const excelOptions = ref({})
|
const excelOptions = ref({})
|
||||||
@@ -43,7 +43,6 @@ if (VITE_FLAG) {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
|
|
||||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||||
url.value = previewUrl
|
url.value = previewUrl
|
||||||
excelOptions.value = ref({
|
excelOptions.value = ref({
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ const processSave = async () => {
|
|||||||
// return result.value || ' '
|
// return result.value || ' '
|
||||||
// }
|
// }
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
console.log(props, 'propspropspropsprops')
|
//console.log(props, 'propspropspropsprops')
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initBpmnModeler()
|
initBpmnModeler()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const addTask = (event, options: any = {}) => {
|
|||||||
const ElementFactory = bpmnInstances().elementFactory
|
const ElementFactory = bpmnInstances().elementFactory
|
||||||
const create = bpmnInstances().modeler.get('create')
|
const create = bpmnInstances().modeler.get('create')
|
||||||
|
|
||||||
console.log(ElementFactory, create)
|
//console.log(ElementFactory, create)
|
||||||
|
|
||||||
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ const addTask = (event, options: any = {}) => {
|
|||||||
shape.businessObject.di.isExpanded = options.isExpanded
|
shape.businessObject.di.isExpanded = options.isExpanded
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(event, 'event')
|
//console.log(event, 'event')
|
||||||
console.log(shape, 'shape')
|
//console.log(shape, 'shape')
|
||||||
create.start(event, shape)
|
create.start(event, shape)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const unwatchBpmn = watch(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('props.bpmnModeler 有值了!!!')
|
//console.log('props.bpmnModeler 有值了!!!')
|
||||||
const w = window as any
|
const w = window as any
|
||||||
w.bpmnInstances = {
|
w.bpmnInstances = {
|
||||||
modeler: props.bpmnModeler,
|
modeler: props.bpmnModeler,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ onBeforeUnmount(() => {
|
|||||||
watch(
|
watch(
|
||||||
() => props.businessObject,
|
() => props.businessObject,
|
||||||
(val) => {
|
(val) => {
|
||||||
console.log(val, 'val')
|
//console.log(val, 'val')
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFlowCondition()
|
resetFlowCondition()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ const openListenerForm = (listener, index?) => {
|
|||||||
}
|
}
|
||||||
// 移除监听器
|
// 移除监听器
|
||||||
const removeListener = (listener, index?) => {
|
const removeListener = (listener, index?) => {
|
||||||
console.log(listener, 'listener')
|
//console.log(listener, 'listener')
|
||||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||||
confirmButtonText: '确 认',
|
confirmButtonText: '确 认',
|
||||||
cancelButtonText: '取 消'
|
cancelButtonText: '取 消'
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export function initListenerForm(listener) {
|
|||||||
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(k)
|
//console.log(k)
|
||||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const modelConfig = computed(() => {
|
|||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
|
|
||||||
const initDataList = () => {
|
const initDataList = () => {
|
||||||
console.log(window, 'window')
|
//console.log(window, 'window')
|
||||||
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
||||||
messageIdMap.value = {}
|
messageIdMap.value = {}
|
||||||
signalIdMap.value = {}
|
signalIdMap.value = {}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function xml2json(xml) {
|
|||||||
|
|
||||||
function xmlObj2json(xml) {
|
function xmlObj2json(xml) {
|
||||||
const xmlObj = xmlStr2XmlObj(xml)
|
const xmlObj = xmlStr2XmlObj(xml)
|
||||||
console.log(xmlObj)
|
// console.log(xmlObj)
|
||||||
let jsonObj = {}
|
let jsonObj = {}
|
||||||
if (xmlObj.childNodes.length > 0) {
|
if (xmlObj.childNodes.length > 0) {
|
||||||
jsonObj = xml2json(xmlObj)
|
jsonObj = xml2json(xmlObj)
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ const prop = defineProps({
|
|||||||
width: { type: [String, Number] },
|
width: { type: [String, Number] },
|
||||||
height: { type: [String, Number] },
|
height: { type: [String, Number] },
|
||||||
timeKey: { type: [String, Number] },
|
timeKey: { type: [String, Number] },
|
||||||
timeValue: { type: Object }
|
timeValue: { type: Object },
|
||||||
|
searchKey: { type: [String, Number] }
|
||||||
})
|
})
|
||||||
|
|
||||||
const headerHeight = ref(57)
|
const headerHeight = ref(57)
|
||||||
@@ -347,22 +348,22 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
watch(
|
watch(
|
||||||
() => prop.timeKey,
|
() => prop.searchKey,
|
||||||
val => {
|
val => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(
|
// watch(
|
||||||
() => prop.timeValue,
|
// () => prop.timeValue,
|
||||||
|
|
||||||
val => {
|
// val => {
|
||||||
tableStore.index()
|
// tableStore.index()
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
deep: true
|
// deep: true
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/assets/font/iconfont.css';
|
@import '@/assets/font/iconfont.css';
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ const prop = defineProps({
|
|||||||
width: { type: [String, Number] },
|
width: { type: [String, Number] },
|
||||||
height: { type: [String, Number] },
|
height: { type: [String, Number] },
|
||||||
timeKey: { type: [String, Number] },
|
timeKey: { type: [String, Number] },
|
||||||
timeValue: { type: Object }
|
timeValue: { type: Object },
|
||||||
|
searchKey: { type: [String, Number] }
|
||||||
})
|
})
|
||||||
|
|
||||||
const headerHeight = ref(57)
|
const headerHeight = ref(57)
|
||||||
@@ -183,7 +184,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.citTotalNum != 0
|
return k.citTotalNum != 0
|
||||||
} else {
|
} else {
|
||||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
return !k.citName.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -223,7 +224,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -240,7 +241,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -249,7 +250,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -270,11 +271,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e ' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -329,22 +330,22 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
watch(
|
watch(
|
||||||
() => prop.timeKey,
|
() => prop.searchKey,
|
||||||
val => {
|
val => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(
|
// watch(
|
||||||
() => prop.timeValue,
|
// () => prop.timeValue,
|
||||||
|
|
||||||
val => {
|
// val => {
|
||||||
tableStore.index()
|
// tableStore.index()
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
deep: true
|
// deep: true
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/assets/font/iconfont.css';
|
@import '@/assets/font/iconfont.css';
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
@selectChange="selectChange"
|
@selectChange="selectChange"
|
||||||
datePicker
|
datePicker
|
||||||
v-if="fullscreen"
|
v-if="fullscreen"
|
||||||
></TableHeader>
|
>
|
||||||
|
</TableHeader>
|
||||||
<div
|
<div
|
||||||
class="monitoringPoints"
|
class="monitoringPoints"
|
||||||
:style="{
|
:style="{
|
||||||
@@ -120,7 +121,8 @@ const prop = defineProps({
|
|||||||
width: { type: [String, Number] },
|
width: { type: [String, Number] },
|
||||||
height: { type: [String, Number] },
|
height: { type: [String, Number] },
|
||||||
timeKey: { type: [String, Number] },
|
timeKey: { type: [String, Number] },
|
||||||
timeValue: { type: Object }
|
timeValue: { type: Object },
|
||||||
|
searchKey: { type: [String, Number] }
|
||||||
})
|
})
|
||||||
|
|
||||||
const headerHeight = ref(57)
|
const headerHeight = ref(57)
|
||||||
@@ -181,7 +183,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.citTotalNum != 0
|
return k.citTotalNum != 0
|
||||||
} else {
|
} else {
|
||||||
return k.citName != '上送国网' && k.citName != '非上送国网'
|
return !k.citName.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -222,7 +224,7 @@ const echart = () => {
|
|||||||
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '异常总数',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 12,
|
barWidth: 12,
|
||||||
data: [100],
|
data: [100],
|
||||||
@@ -239,7 +241,7 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#57bc6e' // 100% 处的颜色
|
color: '#FF9100' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -248,7 +250,7 @@ const echart = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '异常占比',
|
name: '',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: 13,
|
barWidth: 13,
|
||||||
data: [
|
data: [
|
||||||
@@ -269,11 +271,11 @@ const echart = () => {
|
|||||||
colorStops: [
|
colorStops: [
|
||||||
{
|
{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
color: '#FF9100' // 0% 处的颜色
|
color: '#57bc6e' // 0% 处的颜色
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
offset: 1,
|
offset: 1,
|
||||||
color: '#FF9100' // 100% 处的颜色
|
color: '#57bc6e' // 100% 处的颜色
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
global: false // 缺省为 false
|
global: false // 缺省为 false
|
||||||
@@ -328,22 +330,22 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
watch(
|
watch(
|
||||||
() => prop.timeKey,
|
() => prop.searchKey,
|
||||||
val => {
|
val => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(
|
// watch(
|
||||||
() => prop.timeValue,
|
// () => prop.timeValue,
|
||||||
|
|
||||||
val => {
|
// val => {
|
||||||
tableStore.index()
|
// tableStore.index()
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
deep: true
|
// deep: true
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/assets/font/iconfont.css';
|
@import '@/assets/font/iconfont.css';
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ const prop = defineProps({
|
|||||||
width: { type: [String, Number] },
|
width: { type: [String, Number] },
|
||||||
height: { type: [String, Number] },
|
height: { type: [String, Number] },
|
||||||
timeKey: { type: [String, Number] },
|
timeKey: { type: [String, Number] },
|
||||||
timeValue: { type: Object }
|
timeValue: { type: Object },
|
||||||
|
searchKey: { type: [String, Number] }
|
||||||
})
|
})
|
||||||
|
|
||||||
const headerHeight = ref(57)
|
const headerHeight = ref(57)
|
||||||
@@ -233,7 +234,7 @@ const tableStore: any = new TableStore({
|
|||||||
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
if (tableStore.table.params.statisticalType.name == '终端厂家') {
|
||||||
return k.count != 0
|
return k.count != 0
|
||||||
} else {
|
} else {
|
||||||
return k.name != '上送国网' && k.name != '非上送国网'
|
return !k.name.includes('上送')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -246,22 +247,28 @@ onMounted(() => {
|
|||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
watch(
|
watch(
|
||||||
() => prop.timeKey,
|
() => prop.searchKey,
|
||||||
val => {
|
val => {
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(
|
// watch(
|
||||||
() => prop.timeValue,
|
// () => prop.timeKey,
|
||||||
|
// val => {
|
||||||
|
// tableStore.index()
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
// watch(
|
||||||
|
// () => prop.timeValue,
|
||||||
|
|
||||||
val => {
|
// val => {
|
||||||
tableStore.index()
|
// tableStore.index()
|
||||||
},
|
// },
|
||||||
|
|
||||||
{
|
// {
|
||||||
deep: true
|
// deep: true
|
||||||
}
|
// }
|
||||||
)
|
// )
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/assets/font/iconfont.css';
|
@import '@/assets/font/iconfont.css';
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const config = useConfig()
|
|||||||
// import { nextTick } from 'process'
|
// import { nextTick } from 'process'
|
||||||
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
||||||
color[0] = config.layout.elementUiPrimary[0]
|
color[0] = config.layout.elementUiPrimary[0]
|
||||||
|
|
||||||
const chartRef = ref<HTMLDivElement>()
|
const chartRef = ref<HTMLDivElement>()
|
||||||
|
|
||||||
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
||||||
@@ -70,6 +71,8 @@ const initChart = () => {
|
|||||||
const value =
|
const value =
|
||||||
item.value === 3.14159 || item.value === 0.14159
|
item.value === 3.14159 || item.value === 0.14159
|
||||||
? '暂无数据'
|
? '暂无数据'
|
||||||
|
: item.value === 0.14158
|
||||||
|
? 0
|
||||||
: Math.round(item.value * 100) / 100 // 处理特殊值
|
: Math.round(item.value * 100) / 100 // 处理特殊值
|
||||||
tips += `<div style=" display: flex;justify-content: space-between;">
|
tips += `<div style=" display: flex;justify-content: space-between;">
|
||||||
<span>${item.marker}
|
<span>${item.marker}
|
||||||
@@ -154,7 +157,6 @@ const initChart = () => {
|
|||||||
if (params.seriesName == '暂态触发点') {
|
if (params.seriesName == '暂态触发点') {
|
||||||
emit('triggerPoint', params.data)
|
emit('triggerPoint', params.data)
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
emit('echartClick', params)
|
emit('echartClick', params)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, ref, watch, onMounted, defineEmits } from 'vue'
|
import { onBeforeUnmount, ref, watch, onMounted, } from 'vue'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import 'echarts-gl'
|
import 'echarts-gl'
|
||||||
import 'echarts-liquidfill'
|
import 'echarts-liquidfill'
|
||||||
@@ -19,14 +19,21 @@ const myCharts = ref()
|
|||||||
const showCircle = ref(false)
|
const showCircle = ref(false)
|
||||||
|
|
||||||
const fetchConfig = async (name: string) => {
|
const fetchConfig = async (name: string) => {
|
||||||
const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
try {
|
||||||
return res.default
|
// 处理城市名称(去掉末尾的"市")并尝试导入对应文件
|
||||||
|
const res = await import(`../../assets/map/${name.replace(/市$/, '')}.json`)
|
||||||
|
return res.default
|
||||||
|
} catch (error) {
|
||||||
|
const chinaRes = await import(`../../assets/map/中国.json`) // 请确认中国文件的实际命名
|
||||||
|
return chinaRes.default
|
||||||
|
}
|
||||||
|
// const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
||||||
|
// return res.default
|
||||||
// GetEchar(res.default)
|
// GetEchar(res.default)
|
||||||
}
|
}
|
||||||
// fetchConfig()
|
// fetchConfig()
|
||||||
|
|
||||||
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
|
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
|
||||||
onMounted(() => { })
|
|
||||||
|
|
||||||
const GetEchar = async (name: string) => {
|
const GetEchar = async (name: string) => {
|
||||||
let chartDom = document.getElementById('chartMap')
|
let chartDom = document.getElementById('chartMap')
|
||||||
@@ -36,6 +43,7 @@ const GetEchar = async (name: string) => {
|
|||||||
name == dictData.state.area?.[0].name ? (showCircle.value = false) : (showCircle.value = true)
|
name == dictData.state.area?.[0].name ? (showCircle.value = false) : (showCircle.value = true)
|
||||||
|
|
||||||
echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图
|
echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图
|
||||||
|
|
||||||
let option = {
|
let option = {
|
||||||
title: {
|
title: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
@@ -91,6 +99,7 @@ const GetEchar = async (name: string) => {
|
|||||||
// top: 10,
|
// top: 10,
|
||||||
// bottom: 0,
|
// bottom: 0,
|
||||||
roam: true,
|
roam: true,
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
normal: {
|
||||||
show: true,
|
show: true,
|
||||||
@@ -170,6 +179,7 @@ const GetEchar = async (name: string) => {
|
|||||||
}, 0)
|
}, 0)
|
||||||
window.addEventListener('resize', resizeHandler)
|
window.addEventListener('resize', resizeHandler)
|
||||||
const flag1 = ref(true)
|
const flag1 = ref(true)
|
||||||
|
|
||||||
// 点击事件
|
// 点击事件
|
||||||
myCharts.value.off('click')
|
myCharts.value.off('click')
|
||||||
myCharts.value.on('click', (e: any) => {
|
myCharts.value.on('click', (e: any) => {
|
||||||
|
|||||||
@@ -1,441 +1,499 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-loading="loading">
|
<div v-loading="loading">
|
||||||
<div>
|
<div>
|
||||||
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
||||||
<div class="bx" id="wave"></div>
|
<div class="bx" id="wave"></div>
|
||||||
</div>
|
</div>
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
||||||
<el-table stripe :data="Data" :height="height" border style="width: 100%"
|
<vxe-table
|
||||||
header-cell-class-name="table_header">
|
stripe
|
||||||
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
:data="Data"
|
||||||
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
:height="height"
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
border
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
style="width: 100%"
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
header-cell-class-name="table_header"
|
||||||
</el-table-column>
|
>
|
||||||
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
<vxe-column align="center" field="number" title="事件段"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<vxe-colgroup align="center" field="number1" title="波形起始点相位(°)">
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<vxe-column align="center" field="number2" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<vxe-column align="center" field="number3" title="B相"></vxe-column>
|
||||||
</el-table-column>
|
<vxe-column align="center" field="number4" title="C相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
</vxe-colgroup>
|
||||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
<vxe-colgroup align="center" field="number" title="跳变段电压变化率(V/ms)">
|
||||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
<vxe-column align="center" field="number5" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
<vxe-column align="center" field="number6" title="B相"></vxe-column>
|
||||||
</el-table-column>
|
<vxe-column align="center" field="number7" title="C相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
</vxe-colgroup>
|
||||||
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
<vxe-colgroup align="center" field="number" title="相位跳变(°)">
|
||||||
<el-table-column align="center" prop="number" label="暂降类型"></el-table-column>
|
<vxe-column align="center" field="number8" title="A相"></vxe-column>
|
||||||
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
<vxe-column align="center" field="number9" title="B相"></vxe-column>
|
||||||
</el-table>
|
<vxe-column align="center" field="number10" title="C相"></vxe-column>
|
||||||
</el-tab-pane>
|
</vxe-colgroup>
|
||||||
</el-tabs>
|
<vxe-column align="center" field="number11" title="总分段数目"></vxe-column>
|
||||||
</div>
|
<vxe-column
|
||||||
</div>
|
align="center"
|
||||||
</template>
|
field="number12"
|
||||||
<script>
|
title="三相电压不平衡度(%)"
|
||||||
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
width="180"
|
||||||
import { mainHeight } from '@/utils/layout'
|
></vxe-column>
|
||||||
import * as echarts from 'echarts'
|
<vxe-column align="center" field="number13" title="触发类型"></vxe-column>
|
||||||
import url from '@/assets/img/point.png'
|
<vxe-column align="center" field="number14" title="暂降原因"></vxe-column>
|
||||||
import $ from 'jquery'
|
</vxe-table>
|
||||||
export default {
|
</el-tab-pane>
|
||||||
props: {
|
</el-tabs>
|
||||||
flag: {
|
</div>
|
||||||
type: Boolean,
|
</div>
|
||||||
default: false
|
</template>
|
||||||
},
|
<script>
|
||||||
DColor: {
|
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||||
type: Boolean,
|
import { mainHeight } from '@/utils/layout'
|
||||||
default: false
|
import * as echarts from 'echarts'
|
||||||
},
|
import url from '@/assets/img/point.png'
|
||||||
boxoList: {
|
import $ from 'jquery'
|
||||||
type: [Object, Array]
|
export default {
|
||||||
},
|
props: {
|
||||||
GJList: {
|
flag: {
|
||||||
type: [Object, Array]
|
type: Boolean,
|
||||||
}
|
default: false
|
||||||
},
|
},
|
||||||
data() {
|
DColor: {
|
||||||
return {
|
type: Boolean,
|
||||||
loading: true,
|
default: false
|
||||||
|
},
|
||||||
valA: 0,
|
boxoList: {
|
||||||
isOpen: false,
|
type: [Object, Array]
|
||||||
time: '',
|
},
|
||||||
type: '',
|
GJList: {
|
||||||
severity: '',
|
type: [Object, Array]
|
||||||
iphasic: '',
|
}
|
||||||
eventValue: '',
|
},
|
||||||
persistTime: '',
|
data() {
|
||||||
lineName: '',
|
return {
|
||||||
subName: '',
|
loading: true,
|
||||||
waveDatas: [],
|
|
||||||
|
valA: 0,
|
||||||
Data: [],
|
isOpen: false,
|
||||||
height: null,
|
time: '',
|
||||||
vhh: null,
|
type: '',
|
||||||
ptpass: '',
|
severity: '',
|
||||||
waveHeight: undefined,
|
iphasic: '',
|
||||||
$wave: undefined,
|
eventValue: '',
|
||||||
color: '#006565',
|
persistTime: '',
|
||||||
charts: {},
|
lineName: '',
|
||||||
arrpoints: [],
|
subName: '',
|
||||||
titles: '',
|
waveDatas: [],
|
||||||
vh: null,
|
|
||||||
vw: null,
|
Data: [
|
||||||
zoom: ''
|
{
|
||||||
}
|
number: 1,
|
||||||
},
|
number1: 0,
|
||||||
created() { },
|
number2: 0,
|
||||||
watch: {
|
number3: 0,
|
||||||
value: function (a, b) {
|
number4: 0,
|
||||||
if (a == 2) {
|
number5: 0,
|
||||||
// $("#wave1").remove();
|
number6: 0,
|
||||||
this.initWaves()
|
number7: 0,
|
||||||
} else {
|
number8: 0,
|
||||||
$('#wave1').remove()
|
number9: 0,
|
||||||
this.initWaves()
|
number10: 0,
|
||||||
}
|
number11: 1,
|
||||||
}
|
number12: 0,
|
||||||
},
|
number13: '其他',
|
||||||
mounted() {
|
number14: '其他'
|
||||||
this.setHeight()
|
}
|
||||||
window.addEventListener('resize', this.setHeight)
|
],
|
||||||
this.$wave = $('#wave').eq(0)
|
height: null,
|
||||||
this.$nextTick(() => {
|
vhh: null,
|
||||||
this.query()
|
ptpass: '',
|
||||||
})
|
waveHeight: undefined,
|
||||||
},
|
$wave: undefined,
|
||||||
beforeDestroy() {
|
color: '#006565',
|
||||||
window.removeEventListener('resize', this.setHeight)
|
charts: {},
|
||||||
},
|
arrpoints: [],
|
||||||
methods: {
|
titles: '',
|
||||||
setHeight() {
|
vh: null,
|
||||||
this.zoom = 1 / document.body.style.zoom
|
vw: null,
|
||||||
if (this.flag) {
|
zoom: ''
|
||||||
// console.log(123);
|
}
|
||||||
this.vh = mainHeight(250).height
|
},
|
||||||
} else {
|
created() {},
|
||||||
// console.log(3333);
|
watch: {
|
||||||
this.vh = mainHeight(270).height
|
value: function (a, b) {
|
||||||
}
|
if (a == 2) {
|
||||||
},
|
// $("#wave1").remove();
|
||||||
query() {
|
this.initWaves()
|
||||||
this.loading = true
|
} else {
|
||||||
this.initWave()
|
$('#wave1').remove()
|
||||||
},
|
this.initWaves()
|
||||||
|
}
|
||||||
//开始画图
|
}
|
||||||
initWave() {
|
},
|
||||||
//清除之前增加的div
|
mounted() {
|
||||||
// $("#wave ~ .bx1").remove();
|
this.setHeight()
|
||||||
$('div.bx1').remove()
|
window.addEventListener('resize', this.setHeight)
|
||||||
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
this.$wave = $('#wave').eq(0)
|
||||||
// var height = $(window).height() - 90;
|
this.$nextTick(() => {
|
||||||
var picHeight
|
this.query()
|
||||||
var show = true
|
})
|
||||||
|
},
|
||||||
//var v = $("#interval").val();
|
beforeDestroy() {
|
||||||
var isvisible = false
|
window.removeEventListener('resize', this.setHeight)
|
||||||
|
},
|
||||||
picHeight = this.vh
|
methods: {
|
||||||
// this.$wave.css('height', picHeight)
|
setHeight() {
|
||||||
// this.$wave.css('width', '100%')
|
this.zoom = 1 / document.body.style.zoom
|
||||||
$('#wave').css('height', picHeight)
|
if (this.flag) {
|
||||||
$('#wave').css('width', this.vw)
|
// console.log(123);
|
||||||
|
this.vh = mainHeight(280).height
|
||||||
var adata = []
|
} else {
|
||||||
var bdata = []
|
// console.log(3333);
|
||||||
var cdata = []
|
this.vh = mainHeight(305).height
|
||||||
var max = 0
|
}
|
||||||
var min = 0
|
},
|
||||||
//绘制横向第一个波形图
|
query() {
|
||||||
this.GJList.smp_x.forEach((item, ind) => {
|
this.loading = true
|
||||||
if (this.GJList.smp_a[ind] > max) {
|
this.initWave()
|
||||||
max = this.GJList.smp_a[ind]
|
},
|
||||||
} else if (this.GJList.smp_a[ind] < min) {
|
|
||||||
min = this.GJList.smp_a[ind]
|
//开始画图
|
||||||
}
|
initWave() {
|
||||||
if (this.GJList.smp_b[ind] > max) {
|
//清除之前增加的div
|
||||||
max = this.GJList.smp_b[ind]
|
// $("#wave ~ .bx1").remove();
|
||||||
} else if (this.GJList.smp_b[ind] < min) {
|
$('div.bx1').remove()
|
||||||
min = this.GJList.smp_b[ind]
|
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
||||||
}
|
// var height = $(window).height() - 90;
|
||||||
if (this.GJList.smp_c[ind] > max) {
|
var picHeight
|
||||||
max = this.GJList.smp_c[ind]
|
var show = true
|
||||||
} else if (this.GJList.smp_c[ind] < min) {
|
|
||||||
min = this.GJList.smp_c[ind]
|
//var v = $("#interval").val();
|
||||||
}
|
var isvisible = false
|
||||||
|
|
||||||
adata.push([item, this.GJList.smp_a[ind]])
|
picHeight = this.vh
|
||||||
bdata.push([item, this.GJList.smp_b[ind]])
|
// this.$wave.css('height', picHeight)
|
||||||
cdata.push([item, this.GJList.smp_c[ind]])
|
// this.$wave.css('width', '100%')
|
||||||
})
|
$('#wave').css('height', picHeight)
|
||||||
//绘制瞬时波形图
|
$('#wave').css('width', this.vw)
|
||||||
// const echarts = require('echarts')
|
|
||||||
let wave = document.getElementById('wave')
|
var adata = []
|
||||||
let _this = this
|
var bdata = []
|
||||||
var myChartes = echarts.init(wave)
|
var cdata = []
|
||||||
let echartsColor = {
|
var max = 0
|
||||||
WordColor: '#000',
|
var min = 0
|
||||||
thread: '#000000',
|
//绘制横向第一个波形图
|
||||||
FigureColor: [
|
this.GJList.smp_x.forEach((item, ind) => {
|
||||||
'#07CCCA ',
|
if (this.GJList.smp_a[ind] > max) {
|
||||||
'#00BFF5',
|
max = this.GJList.smp_a[ind]
|
||||||
'#FFBF00',
|
} else if (this.GJList.smp_a[ind] < min) {
|
||||||
'#77DA63',
|
min = this.GJList.smp_a[ind]
|
||||||
'#D5FF6B',
|
}
|
||||||
'#Ff6600',
|
if (this.GJList.smp_b[ind] > max) {
|
||||||
'#FF9100',
|
max = this.GJList.smp_b[ind]
|
||||||
'#5B6E96',
|
} else if (this.GJList.smp_b[ind] < min) {
|
||||||
'#66FFCC',
|
min = this.GJList.smp_b[ind]
|
||||||
'#B3B3B3',
|
}
|
||||||
'#FF00FF',
|
if (this.GJList.smp_c[ind] > max) {
|
||||||
'#CC00FF',
|
max = this.GJList.smp_c[ind]
|
||||||
'#FF9999'
|
} else if (this.GJList.smp_c[ind] < min) {
|
||||||
]
|
min = this.GJList.smp_c[ind]
|
||||||
}
|
}
|
||||||
var option = {
|
|
||||||
tooltip: {
|
adata.push([item, this.GJList.smp_a[ind]])
|
||||||
top: '10px',
|
bdata.push([item, this.GJList.smp_b[ind]])
|
||||||
trigger: 'axis',
|
cdata.push([item, this.GJList.smp_c[ind]])
|
||||||
borderColor: 'grey',
|
})
|
||||||
backgroundColor: '#fff',
|
//绘制瞬时波形图
|
||||||
style: {
|
// const echarts = require('echarts')
|
||||||
color: '#000',
|
let wave = document.getElementById('wave')
|
||||||
fontSize: '15px',
|
let _this = this
|
||||||
padding: 10
|
var myChartes = echarts.init(wave)
|
||||||
},
|
let echartsColor = {
|
||||||
formatter: function (params) {
|
WordColor: '#000',
|
||||||
// console.log(params)
|
thread: '#000000',
|
||||||
var tips = ''
|
FigureColor: [
|
||||||
tips += '时刻:' + params[0].data[0] + '</br/>'
|
'#07CCCA ',
|
||||||
|
'#00BFF5',
|
||||||
for (var i = 0; i < params.length; i++) {
|
'#FFBF00',
|
||||||
if (params[i].seriesName != '暂降触发点') {
|
'#77DA63',
|
||||||
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
'#D5FF6B',
|
||||||
}
|
'#Ff6600',
|
||||||
}
|
'#FF9100',
|
||||||
return tips
|
'#5B6E96',
|
||||||
},
|
'#66FFCC',
|
||||||
// axisPointer: {
|
'#B3B3B3',
|
||||||
// type: "cross",
|
'#FF00FF',
|
||||||
// label: {
|
'#CC00FF',
|
||||||
// color: "#fff",
|
'#FF9999'
|
||||||
// fontSize: 16,
|
]
|
||||||
// },
|
}
|
||||||
// },
|
console.log('🚀 ~ this.boxoList:', this.boxoList)
|
||||||
textStyle: {
|
|
||||||
color: '#fff',
|
var option = {
|
||||||
fontStyle: 'normal',
|
tooltip: {
|
||||||
opacity: 0.35,
|
top: '10px',
|
||||||
fontSize: 14
|
trigger: 'axis',
|
||||||
},
|
borderColor: 'grey',
|
||||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
backgroundColor: '#fff',
|
||||||
borderWidth: 0
|
style: {
|
||||||
},
|
color: '#000',
|
||||||
|
fontSize: '15px',
|
||||||
title: {
|
padding: 10
|
||||||
left: 'center',
|
},
|
||||||
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
formatter: function (params) {
|
||||||
textStyle: {
|
// console.log(params)
|
||||||
fontSize: 16,
|
var tips = ''
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
tips += '时刻:' + params[0].data[0] + '</br/>'
|
||||||
}
|
|
||||||
},
|
for (var i = 0; i < params.length; i++) {
|
||||||
legend: {
|
if (params[i].seriesName != '暂降触发点') {
|
||||||
left: '5%',
|
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
||||||
top: '20',
|
}
|
||||||
verticalAlign: 'top',
|
}
|
||||||
enabled: true,
|
return tips
|
||||||
itemDistance: 5,
|
},
|
||||||
textStyle: {
|
// axisPointer: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
// type: "cross",
|
||||||
rich: {
|
// label: {
|
||||||
a: {
|
// color: "#fff",
|
||||||
verticalAlign: 'middle'
|
// fontSize: 16,
|
||||||
}
|
// },
|
||||||
},
|
// },
|
||||||
|
textStyle: {
|
||||||
padding: [2, 0, 0, 0] //[上、右、下、左]
|
color: '#fff',
|
||||||
}
|
fontStyle: 'normal',
|
||||||
},
|
opacity: 0.35,
|
||||||
toolbox: {
|
fontSize: 14
|
||||||
show: false,
|
},
|
||||||
feature: {
|
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||||
//restore: {},
|
borderWidth: 0
|
||||||
saveAsImage: {
|
},
|
||||||
iconStyle: {
|
|
||||||
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
title: {
|
||||||
}
|
left: 'center',
|
||||||
}
|
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.pt,
|
||||||
}
|
textStyle: {
|
||||||
},
|
fontSize: 16,
|
||||||
xAxis: {
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
type: 'value',
|
}
|
||||||
name: '时刻',
|
},
|
||||||
boundaryGap: false,
|
legend: {
|
||||||
min: this.GJList.smp_x[0],
|
left: '5%',
|
||||||
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
top: '20',
|
||||||
title: {
|
verticalAlign: 'top',
|
||||||
text: 'ms',
|
enabled: true,
|
||||||
textStyle: {
|
itemDistance: 5,
|
||||||
fontSize: 12,
|
textStyle: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
},
|
rich: {
|
||||||
enabled: true,
|
a: {
|
||||||
align: 'high'
|
verticalAlign: 'middle'
|
||||||
},
|
}
|
||||||
splitLine: {
|
},
|
||||||
show: false
|
|
||||||
},
|
padding: [2, 0, 0, 0] //[上、右、下、左]
|
||||||
axisTick: {
|
}
|
||||||
alignWithLabel: true
|
},
|
||||||
},
|
toolbox: {
|
||||||
axisLine: {
|
show: false,
|
||||||
lineStyle: {
|
feature: {
|
||||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
//restore: {},
|
||||||
},
|
saveAsImage: {
|
||||||
onZero: false //-----------重点
|
iconStyle: {
|
||||||
},
|
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
axisLabel: {
|
}
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
}
|
||||||
formatter: function (value, index) {
|
}
|
||||||
if (_this.valA != (value - 0).toFixed(0)) {
|
},
|
||||||
_this.valA = (value - 0).toFixed(0)
|
xAxis: {
|
||||||
return (value - 0).toFixed(0)
|
type: 'value',
|
||||||
}
|
name: '时刻',
|
||||||
}
|
boundaryGap: false,
|
||||||
//rotate:39
|
min: this.GJList.smp_x[0],
|
||||||
}
|
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
||||||
// data: this.syncExtremes,
|
title: {
|
||||||
},
|
text: 'ms',
|
||||||
yAxis: {
|
textStyle: {
|
||||||
type: 'value',
|
fontSize: 12,
|
||||||
name: 'kV',
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
title: {
|
},
|
||||||
align: 'high',
|
enabled: true,
|
||||||
offset: 0,
|
align: 'high'
|
||||||
text: 'kV',
|
},
|
||||||
rotation: 0,
|
splitLine: {
|
||||||
y: -10
|
show: false
|
||||||
},
|
},
|
||||||
|
axisTick: {
|
||||||
boundaryGap: [0, '100%'],
|
alignWithLabel: true
|
||||||
showLastLabel: true,
|
},
|
||||||
max: (max + 10).toFixed(2),
|
axisLine: {
|
||||||
min: (min - 10).toFixed(2),
|
lineStyle: {
|
||||||
opposite: false,
|
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||||
nameTextStyle: {
|
},
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
onZero: false //-----------重点
|
||||||
},
|
},
|
||||||
//minInterval: 1,
|
axisLabel: {
|
||||||
type: 'value',
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
axisLine: {
|
formatter: function (value, index) {
|
||||||
show: true,
|
if (_this.valA != (value - 0).toFixed(0)) {
|
||||||
lineStyle: {
|
_this.valA = (value - 0).toFixed(0)
|
||||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
return (value - 0).toFixed(0)
|
||||||
},
|
}
|
||||||
onZero: false //-----------重点
|
}
|
||||||
},
|
//rotate:39
|
||||||
axisLabel: {
|
}
|
||||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
// data: this.syncExtremes,
|
||||||
formatter: function (value, index) {
|
},
|
||||||
return (value - 0).toFixed(2)
|
yAxis: {
|
||||||
}
|
type: 'value',
|
||||||
},
|
name: 'kV',
|
||||||
splitLine: {
|
title: {
|
||||||
lineStyle: {
|
align: 'high',
|
||||||
// 使用深浅的间隔色
|
offset: 0,
|
||||||
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
text: 'kV',
|
||||||
type: 'dashed',
|
rotation: 0,
|
||||||
opacity: 0.5
|
y: -10
|
||||||
}
|
},
|
||||||
}
|
|
||||||
},
|
boundaryGap: [0, '100%'],
|
||||||
grid: {
|
showLastLabel: true,
|
||||||
left: '1%',
|
max: (max + 10).toFixed(2),
|
||||||
right: '40px',
|
min: (min - 10).toFixed(2),
|
||||||
bottom: '40px',
|
opposite: false,
|
||||||
top: '55px',
|
nameTextStyle: {
|
||||||
containLabel: true
|
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||||
},
|
},
|
||||||
dataZoom: [
|
//minInterval: 1,
|
||||||
{
|
type: 'value',
|
||||||
type: 'inside',
|
axisLine: {
|
||||||
height: 13,
|
show: true,
|
||||||
start: 0,
|
lineStyle: {
|
||||||
bottom: '20px',
|
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||||
end: 100
|
},
|
||||||
},
|
onZero: false //-----------重点
|
||||||
{
|
},
|
||||||
start: 0,
|
axisLabel: {
|
||||||
height: 13,
|
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||||
bottom: '20px',
|
formatter: function (value, index) {
|
||||||
end: 100
|
return (value - 0).toFixed(2)
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
series: [
|
splitLine: {
|
||||||
{
|
lineStyle: {
|
||||||
name: 'A相',
|
// 使用深浅的间隔色
|
||||||
type: 'line',
|
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
||||||
smooth: true,
|
type: 'dashed',
|
||||||
symbol: 'none',
|
opacity: 0.5
|
||||||
sampling: 'lttb',
|
}
|
||||||
itemStyle: {
|
}
|
||||||
color: '#DAA520'
|
},
|
||||||
},
|
grid: {
|
||||||
data: adata
|
left: '1%',
|
||||||
},
|
right: '40px',
|
||||||
{
|
bottom: '40px',
|
||||||
name: 'B相',
|
top: '55px',
|
||||||
type: 'line',
|
containLabel: true
|
||||||
smooth: true,
|
},
|
||||||
symbol: 'none',
|
dataZoom: [
|
||||||
sampling: 'lttb',
|
{
|
||||||
itemStyle: {
|
type: 'inside',
|
||||||
color: '#2E8B57'
|
height: 13,
|
||||||
},
|
start: 0,
|
||||||
data: bdata
|
bottom: '20px',
|
||||||
},
|
end: 100
|
||||||
{
|
},
|
||||||
name: 'C相',
|
{
|
||||||
type: 'line',
|
start: 0,
|
||||||
smooth: true,
|
height: 13,
|
||||||
symbol: 'none',
|
bottom: '20px',
|
||||||
sampling: 'lttb',
|
end: 100
|
||||||
itemStyle: {
|
}
|
||||||
color: '#A52a2a'
|
],
|
||||||
},
|
series: [
|
||||||
data: cdata
|
{
|
||||||
},
|
name: '跳变期',
|
||||||
{
|
type: 'line',
|
||||||
name: '暂降触发点',
|
data: [],
|
||||||
type: 'scatter',
|
showSymbol: true, // 强制显示标记
|
||||||
symbol: 'image://' + url,
|
symbol: 'rect', // 标记形状为方块
|
||||||
itemStyle: {
|
symbolSize: 10, // 方块大小
|
||||||
width: 16,
|
itemStyle: {
|
||||||
height: 16
|
color: '#888888', // 方块颜色为灰色
|
||||||
},
|
borderWidth: 0
|
||||||
data: [[0, min]]
|
},
|
||||||
}
|
|
||||||
]
|
markArea: {
|
||||||
}
|
silent: true, // 不响应交互
|
||||||
|
itemStyle: { color: '#ccc' },
|
||||||
myChartes.setOption(option)
|
data: [
|
||||||
// window.echartsArr.push(myChartes)
|
[
|
||||||
setTimeout(() => {
|
{ xAxis: '0' }, // 第一个跳变期起始
|
||||||
myChartes.resize()
|
{ xAxis: '5' } // 第一个跳变期结束
|
||||||
this.loading = false
|
],
|
||||||
}, 400)
|
[
|
||||||
|
{ xAxis: '210' }, // 第二个跳变期起始
|
||||||
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
{ xAxis: '220' } // 第二个跳变期结束
|
||||||
|
]
|
||||||
// let waveDatasTemp = waveDatas.slice(1);
|
]
|
||||||
// waveDatasTemp.reverse();
|
}
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
}
|
name: 'A相',
|
||||||
</script>
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbol: 'none',
|
||||||
|
sampling: 'lttb',
|
||||||
|
itemStyle: {
|
||||||
|
color: '#DAA520'
|
||||||
|
},
|
||||||
|
data: adata
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'B相',
|
||||||
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbol: 'none',
|
||||||
|
sampling: 'lttb',
|
||||||
|
itemStyle: {
|
||||||
|
color: '#2E8B57'
|
||||||
|
},
|
||||||
|
data: bdata
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'C相',
|
||||||
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbol: 'none',
|
||||||
|
sampling: 'lttb',
|
||||||
|
itemStyle: {
|
||||||
|
color: '#A52a2a'
|
||||||
|
},
|
||||||
|
data: cdata
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '暂降触发点',
|
||||||
|
type: 'scatter',
|
||||||
|
symbol: 'image://' + url,
|
||||||
|
itemStyle: {
|
||||||
|
width: 16,
|
||||||
|
height: 16
|
||||||
|
},
|
||||||
|
data: [[0, min]]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
myChartes.setOption(option)
|
||||||
|
// window.echartsArr.push(myChartes)
|
||||||
|
setTimeout(() => {
|
||||||
|
myChartes.resize()
|
||||||
|
this.loading = false
|
||||||
|
}, 400)
|
||||||
|
|
||||||
|
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
||||||
|
|
||||||
|
// let waveDatasTemp = waveDatas.slice(1);
|
||||||
|
// waveDatasTemp.reverse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|||||||
1498
src/components/echarts/gaoji.js
Normal file
322
src/components/echarts/rmsWorker.js
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
// 辅助函数
|
||||||
|
const getMax = (temp, tempA, tempB, tempC) => {
|
||||||
|
temp = temp > tempA ? temp : tempA
|
||||||
|
temp = temp > tempB ? temp : tempB
|
||||||
|
if (tempC !== undefined) {
|
||||||
|
temp = temp > tempC ? temp : tempC
|
||||||
|
}
|
||||||
|
return temp
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMaxTwo = (temp, tempA, tempB) => {
|
||||||
|
temp = temp > tempA ? temp : tempA
|
||||||
|
temp = temp > tempB ? temp : tempB
|
||||||
|
return temp
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMin = (temp, tempA, tempB, tempC) => {
|
||||||
|
temp = temp < tempA ? temp : tempA
|
||||||
|
temp = temp < tempB ? temp : tempB
|
||||||
|
if (tempC !== undefined) {
|
||||||
|
temp = temp < tempC ? temp : tempC
|
||||||
|
}
|
||||||
|
return temp
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMinOpen = (temp, tempA, tempB) => {
|
||||||
|
temp = temp < tempA ? temp : tempA
|
||||||
|
temp = temp < tempB ? temp : tempB
|
||||||
|
return temp
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据处理函数
|
||||||
|
const fliteWaveData = (wp, step, iphasicValue, isOpen) => {
|
||||||
|
const rmsData = wp.listRmsData
|
||||||
|
const pt = Number(wp.pt) / 1000
|
||||||
|
const ct = Number(wp.ct)
|
||||||
|
const titleList = wp.waveTitle
|
||||||
|
let xishu = pt
|
||||||
|
let aTitle = '',
|
||||||
|
bTitle = '',
|
||||||
|
cTitle = '',
|
||||||
|
unit = '电压'
|
||||||
|
let rmsvFirstX = 0,
|
||||||
|
rmsvFirstY = 0,
|
||||||
|
rmsvSecondX = 0,
|
||||||
|
rmsvSecondY = 0,
|
||||||
|
firstZhou = 'a',
|
||||||
|
secondeZhou = 'a'
|
||||||
|
let ifmax = 0,
|
||||||
|
ifmin = 0,
|
||||||
|
ismax = 0,
|
||||||
|
ismin = 0,
|
||||||
|
rfmax = 0,
|
||||||
|
rfmin = 0,
|
||||||
|
rsmax = 0,
|
||||||
|
rsmin = 0
|
||||||
|
|
||||||
|
const shunshiFA = []
|
||||||
|
const shunshiFB = []
|
||||||
|
const shunshiFC = []
|
||||||
|
const shunshiSA = []
|
||||||
|
const shunshiSB = []
|
||||||
|
const shunshiSC = []
|
||||||
|
const rmsFA = []
|
||||||
|
const rmsFB = []
|
||||||
|
const rmsFC = []
|
||||||
|
const rmsSA = []
|
||||||
|
const rmsSB = []
|
||||||
|
const rmsSC = []
|
||||||
|
|
||||||
|
if (titleList[iphasicValue * step + 1]?.substring(0, 1) !== 'U') {
|
||||||
|
xishu = ct
|
||||||
|
unit = '电流'
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 1; i <= iphasicValue; i++) {
|
||||||
|
switch (i) {
|
||||||
|
case 1:
|
||||||
|
aTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
bTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
cTitle = titleList[iphasicValue * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rmsData[0] && rmsData[0][iphasicValue * step + 1] !== undefined) {
|
||||||
|
rfmax = rmsData[0][iphasicValue * step + 1] * xishu
|
||||||
|
rfmin = rmsData[0][iphasicValue * step + 1] * xishu
|
||||||
|
rmsvFirstY = rmsData[0][iphasicValue * step + 1] * xishu
|
||||||
|
rmsvFirstX = rmsData[0][0]
|
||||||
|
rsmax = rmsData[0][iphasicValue * step + 1]
|
||||||
|
rsmin = rmsData[0][iphasicValue * step + 1]
|
||||||
|
rmsvSecondY = rmsData[0][iphasicValue * step + 1]
|
||||||
|
rmsvSecondX = rmsData[0][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let rms = 0; rms < rmsData.length; rms++) {
|
||||||
|
if (!rmsData[rms] || rmsData[rms][iphasicValue * step + 1] === undefined) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (iphasicValue) {
|
||||||
|
case 1:
|
||||||
|
const rmsFirstA = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||||
|
rmsFA.push([rmsData[rms][0], rmsFirstA])
|
||||||
|
rfmax = rfmax > rmsFirstA ? rfmax : rmsFirstA
|
||||||
|
rfmin = rfmin < rmsFirstA ? rfmin : rmsFirstA
|
||||||
|
if (rfmin < rmsvFirstY) {
|
||||||
|
rmsvFirstY = rfmin
|
||||||
|
firstZhou = 'a'
|
||||||
|
rmsvFirstX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
const rmsSecondA = rmsData[rms][iphasicValue * step + 1]
|
||||||
|
rmsSA.push([rmsData[rms][0], rmsSecondA])
|
||||||
|
rsmax = rsmax > rmsSecondA ? rsmax : rmsSecondA
|
||||||
|
rsmin = rsmin < rmsSecondA ? rsmin : rmsSecondA
|
||||||
|
if (rsmin < rmsvSecondY) {
|
||||||
|
rmsvSecondY = rsmin
|
||||||
|
secondeZhou = 'a'
|
||||||
|
rmsvSecondX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
const rmsFirstA2 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||||
|
const rmsFirstB2 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||||
|
rmsFA.push([rmsData[rms][0], rmsFirstA2])
|
||||||
|
rmsFB.push([rmsData[rms][0], rmsFirstB2])
|
||||||
|
rfmax = getMaxTwo(rfmax, rmsFirstA2, rmsFirstB2)
|
||||||
|
rfmin = getMinOpen(rfmin, rmsFirstA2, rmsFirstB2)
|
||||||
|
if (rfmin < rmsvFirstY) {
|
||||||
|
rmsvFirstY = rfmin
|
||||||
|
if (rfmin === rmsFirstA2) {
|
||||||
|
firstZhou = 'a'
|
||||||
|
} else if (rfmin === rmsFirstB2) {
|
||||||
|
firstZhou = 'b'
|
||||||
|
}
|
||||||
|
rmsvFirstX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
const rmsSecondA2 = rmsData[rms][iphasicValue * step + 1]
|
||||||
|
const rmsSecondB2 = rmsData[rms][iphasicValue * step + 2]
|
||||||
|
rmsSA.push([rmsData[rms][0], rmsSecondA2])
|
||||||
|
rmsSB.push([rmsData[rms][0], rmsSecondB2])
|
||||||
|
rsmax = getMaxTwo(rsmax, rmsSecondA2, rmsSecondB2)
|
||||||
|
rsmin = getMinOpen(rsmin, rmsSecondA2, rmsSecondB2)
|
||||||
|
if (rsmin < rmsvSecondY) {
|
||||||
|
rmsvSecondY = rsmin
|
||||||
|
if (rsmin === rmsSecondA2) {
|
||||||
|
secondeZhou = 'a'
|
||||||
|
} else if (rsmin === rmsSecondB2) {
|
||||||
|
secondeZhou = 'b'
|
||||||
|
}
|
||||||
|
rmsvSecondX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
const rmsFirstA3 = rmsData[rms][iphasicValue * step + 1] * xishu
|
||||||
|
const rmsFirstB3 = rmsData[rms][iphasicValue * step + 2] * xishu
|
||||||
|
const rmsFirstC3 = rmsData[rms][iphasicValue * step + 3] * xishu
|
||||||
|
rmsFA.push([rmsData[rms][0], rmsFirstA3])
|
||||||
|
rmsFB.push([rmsData[rms][0], rmsFirstB3])
|
||||||
|
rmsFC.push([rmsData[rms][0], rmsFirstC3])
|
||||||
|
rfmax = getMax(rfmax, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||||
|
rfmin = isOpen
|
||||||
|
? getMinOpen(rfmin, rmsFirstA3, rmsFirstC3)
|
||||||
|
: getMin(rfmin, rmsFirstA3, rmsFirstB3, rmsFirstC3)
|
||||||
|
if (rfmin < rmsvFirstY) {
|
||||||
|
rmsvFirstY = rfmin
|
||||||
|
if (rfmin === rmsFirstA3) {
|
||||||
|
firstZhou = 'a'
|
||||||
|
} else if (rfmin === rmsFirstB3) {
|
||||||
|
firstZhou = 'b'
|
||||||
|
} else {
|
||||||
|
firstZhou = 'c'
|
||||||
|
}
|
||||||
|
rmsvFirstX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
const rmsSecondA3 = rmsData[rms][iphasicValue * step + 1]
|
||||||
|
const rmsSecondB3 = rmsData[rms][iphasicValue * step + 2]
|
||||||
|
const rmsSecondC3 = rmsData[rms][iphasicValue * step + 3]
|
||||||
|
rmsSA.push([rmsData[rms][0], rmsSecondA3])
|
||||||
|
rmsSB.push([rmsData[rms][0], rmsSecondB3])
|
||||||
|
rmsSC.push([rmsData[rms][0], rmsSecondC3])
|
||||||
|
rsmax = getMax(rsmax, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||||
|
rsmin = isOpen
|
||||||
|
? getMinOpen(rsmin, rmsSecondA3, rmsSecondC3)
|
||||||
|
: getMin(rsmin, rmsSecondA3, rmsSecondB3, rmsSecondC3)
|
||||||
|
if (rsmin < rmsvSecondY) {
|
||||||
|
rmsvSecondY = rsmin
|
||||||
|
if (rsmin === rmsSecondA3) {
|
||||||
|
secondeZhou = 'a'
|
||||||
|
} else if (rsmin === rmsSecondB3) {
|
||||||
|
secondeZhou = 'b'
|
||||||
|
} else {
|
||||||
|
secondeZhou = 'c'
|
||||||
|
}
|
||||||
|
rmsvSecondX = rmsData[rms][0]
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const instantF = { max: ifmax, min: ifmin }
|
||||||
|
const instantS = { max: ismax, min: ismin }
|
||||||
|
const RMSF = { max: rfmax, min: rfmin }
|
||||||
|
const RMSS = { max: rsmax, min: rsmin }
|
||||||
|
const RMSFMinDetail = { rmsvFirstX, rmsvFirstY, firstZhou }
|
||||||
|
const RMSSMinDetail = { rmsvSecondX, rmsvSecondY, secondeZhou }
|
||||||
|
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||||
|
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||||
|
const RMSFWave = { rmsFA, rmsFB, rmsFC }
|
||||||
|
const RMSSWave = { rmsSA, rmsSB, rmsSC }
|
||||||
|
const title = { aTitle, bTitle, cTitle, unit }
|
||||||
|
|
||||||
|
return {
|
||||||
|
instantF,
|
||||||
|
instantS,
|
||||||
|
RMSF,
|
||||||
|
RMSS,
|
||||||
|
RMSFMinDetail,
|
||||||
|
RMSSMinDetail,
|
||||||
|
shunshiF,
|
||||||
|
shunshiS,
|
||||||
|
RMSFWave,
|
||||||
|
RMSSWave,
|
||||||
|
title,
|
||||||
|
unit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听消息
|
||||||
|
self.onmessage = function (e) {
|
||||||
|
const { wp, isOpen, value, boxoList, requestId } = e.data
|
||||||
|
|
||||||
|
try {
|
||||||
|
const iphasicValue = wp.iphasic || 1
|
||||||
|
|
||||||
|
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||||
|
const waveDatas = []
|
||||||
|
|
||||||
|
for (let i = 0; i < picCounts; i++) {
|
||||||
|
const data = fliteWaveData(wp, i, iphasicValue, isOpen, boxoList)
|
||||||
|
waveDatas.push(data)
|
||||||
|
}
|
||||||
|
// 处理标题
|
||||||
|
let titles = ''
|
||||||
|
if (boxoList.systemType == 'pms') {
|
||||||
|
titles =
|
||||||
|
'变电站名称:' +
|
||||||
|
boxoList.powerStationName +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.measurementPointName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.duration +
|
||||||
|
's'
|
||||||
|
} else if (boxoList.systemType == 'ZL') {
|
||||||
|
titles =
|
||||||
|
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.equipmentName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
boxoList.evtParamVVaDepth +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.evtParamTm +
|
||||||
|
's'
|
||||||
|
} else if (boxoList.systemType == 'YPT') {
|
||||||
|
titles =
|
||||||
|
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.lineName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.persistTime +
|
||||||
|
's'
|
||||||
|
} else {
|
||||||
|
titles =
|
||||||
|
' 变电站名称:' +
|
||||||
|
boxoList.subName +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.lineName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.duration +
|
||||||
|
's'
|
||||||
|
}
|
||||||
|
// 发送处理结果回主线程
|
||||||
|
self.postMessage({
|
||||||
|
requestId,
|
||||||
|
titles: titles,
|
||||||
|
success: true,
|
||||||
|
waveDatas,
|
||||||
|
time: wp.time,
|
||||||
|
type: wp.waveType,
|
||||||
|
severity: wp.yzd,
|
||||||
|
iphasic: iphasicValue
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
self.postMessage({
|
||||||
|
requestId,
|
||||||
|
success: false,
|
||||||
|
error: error.message
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
207
src/components/echarts/shuWorker.js
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
// waveData.worker.js
|
||||||
|
self.addEventListener('message', function (e) {
|
||||||
|
const { wp, value, iphasic, isOpen, boxoList, requestId } = e.data
|
||||||
|
|
||||||
|
// 处理波形数据的函数
|
||||||
|
const fliteWaveData = (wp, step) => {
|
||||||
|
// 将原有的fliteWaveData函数实现复制到这里
|
||||||
|
const shunData = wp.listWaveData
|
||||||
|
const pt = Number(wp.pt) / 1000
|
||||||
|
const ct = Number(wp.ct)
|
||||||
|
const titleList = wp.waveTitle
|
||||||
|
let xishu = pt
|
||||||
|
let aTitle = '',
|
||||||
|
bTitle = '',
|
||||||
|
cTitle = '',
|
||||||
|
unit = '电压'
|
||||||
|
let ifmax = 0,
|
||||||
|
ifmin = 0,
|
||||||
|
ismax = 0,
|
||||||
|
ismin = 0
|
||||||
|
|
||||||
|
const shunshiFA = []
|
||||||
|
const shunshiFB = []
|
||||||
|
const shunshiFC = []
|
||||||
|
const shunshiSA = []
|
||||||
|
const shunshiSB = []
|
||||||
|
const shunshiSC = []
|
||||||
|
|
||||||
|
if (shunData.length > 0) {
|
||||||
|
if (titleList[iphasic * step + 1]?.substring(0, 1) !== 'U') {
|
||||||
|
xishu = ct
|
||||||
|
unit = '电流'
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 1; i <= iphasic; i++) {
|
||||||
|
switch (i) {
|
||||||
|
case 1:
|
||||||
|
aTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
bTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
cTitle = titleList[iphasic * step + i]?.substring(1) || ''
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shunData[0][iphasic * step + 1] !== undefined) {
|
||||||
|
ifmax = shunData[0][iphasic * step + 1] * xishu
|
||||||
|
ifmin = shunData[0][iphasic * step + 1] * xishu
|
||||||
|
ismax = shunData[0][iphasic * step + 1]
|
||||||
|
ismin = shunData[0][iphasic * step + 1]
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let shun = 0; shun < shunData.length; shun++) {
|
||||||
|
if (shunData[shun][iphasic * step + 1] === undefined) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (iphasic) {
|
||||||
|
case 1:
|
||||||
|
const shunFirstA = shunData[shun][iphasic * step + 1] * xishu
|
||||||
|
shunshiFA.push([shunData[shun][0], shunFirstA])
|
||||||
|
ifmax = Math.max(ifmax, shunFirstA)
|
||||||
|
ifmin = Math.min(ifmin, shunFirstA)
|
||||||
|
|
||||||
|
const shunSecondA = shunData[shun][iphasic * step + 1]
|
||||||
|
shunshiSA.push([shunData[shun][0], shunSecondA])
|
||||||
|
ismax = Math.max(ismax, shunSecondA)
|
||||||
|
ismin = Math.min(ismin, shunSecondA)
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
const shunFirstA2 = shunData[shun][iphasic * step + 1] * xishu
|
||||||
|
const shunFirstB2 = shunData[shun][iphasic * step + 2] * xishu
|
||||||
|
shunshiFA.push([shunData[shun][0], shunFirstA2])
|
||||||
|
shunshiFB.push([shunData[shun][0], shunFirstB2])
|
||||||
|
ifmax = Math.max(ifmax, shunFirstA2, shunFirstB2)
|
||||||
|
ifmin = Math.min(ifmin, shunFirstA2, shunFirstB2)
|
||||||
|
|
||||||
|
const shunSecondA2 = shunData[shun][iphasic * step + 1]
|
||||||
|
const shunSecondB2 = shunData[shun][iphasic * step + 2]
|
||||||
|
shunshiSA.push([shunData[shun][0], shunSecondA2])
|
||||||
|
shunshiSB.push([shunData[shun][0], shunSecondB2])
|
||||||
|
ismax = Math.max(ismax, shunSecondA2, shunSecondB2)
|
||||||
|
ismin = Math.min(ismin, shunSecondA2, shunSecondB2)
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
const shunFirstA3 = shunData[shun][iphasic * step + 1] * xishu
|
||||||
|
const shunFirstB3 = shunData[shun][iphasic * step + 2] * xishu
|
||||||
|
const shunFirstC3 = shunData[shun][iphasic * step + 3] * xishu
|
||||||
|
shunshiFA.push([shunData[shun][0], shunFirstA3])
|
||||||
|
shunshiFB.push([shunData[shun][0], shunFirstB3])
|
||||||
|
shunshiFC.push([shunData[shun][0], shunFirstC3])
|
||||||
|
ifmax = Math.max(ifmax, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||||
|
ifmin = isOpen
|
||||||
|
? Math.min(ifmin, shunFirstA3, shunFirstC3)
|
||||||
|
: Math.min(ifmin, shunFirstA3, shunFirstB3, shunFirstC3)
|
||||||
|
|
||||||
|
const shunSecondA3 = shunData[shun][iphasic * step + 1]
|
||||||
|
const shunSecondB3 = shunData[shun][iphasic * step + 2]
|
||||||
|
const shunSecondC3 = shunData[shun][iphasic * step + 3]
|
||||||
|
shunshiSA.push([shunData[shun][0], shunSecondA3])
|
||||||
|
shunshiSB.push([shunData[shun][0], shunSecondB3])
|
||||||
|
shunshiSC.push([shunData[shun][0], shunSecondC3])
|
||||||
|
ismax = Math.max(ismax, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||||
|
ismin = isOpen
|
||||||
|
? Math.min(ismin, shunSecondA3, shunSecondC3)
|
||||||
|
: Math.min(ismin, shunSecondA3, shunSecondB3, shunSecondC3)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const instantF = { max: ifmax, min: ifmin }
|
||||||
|
const instantS = { max: ismax, min: ismin }
|
||||||
|
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
|
||||||
|
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
|
||||||
|
const title = { aTitle, bTitle, cTitle, unit }
|
||||||
|
|
||||||
|
return { instantF, instantS, shunshiF, shunshiS, title, unit }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理标题
|
||||||
|
let titles = ''
|
||||||
|
if (boxoList.systemType == 'pms') {
|
||||||
|
titles =
|
||||||
|
'变电站名称:' +
|
||||||
|
boxoList.powerStationName +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.measurementPointName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.duration +
|
||||||
|
's'
|
||||||
|
} else if (boxoList.systemType == 'ZL') {
|
||||||
|
titles =
|
||||||
|
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.equipmentName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
boxoList.evtParamVVaDepth +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.evtParamTm +
|
||||||
|
's'
|
||||||
|
} else if (boxoList.systemType == 'YPT') {
|
||||||
|
titles =
|
||||||
|
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.lineName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.persistTime +
|
||||||
|
's'
|
||||||
|
} else {
|
||||||
|
titles =
|
||||||
|
'变电站名称:' +
|
||||||
|
boxoList.subName +
|
||||||
|
' 监测点名称:' +
|
||||||
|
boxoList.lineName +
|
||||||
|
' 发生时刻:' +
|
||||||
|
boxoList.startTime +
|
||||||
|
' 暂降(骤升)幅值:' +
|
||||||
|
(boxoList.featureAmplitude * 100).toFixed(2) +
|
||||||
|
'% 持续时间:' +
|
||||||
|
boxoList.duration +
|
||||||
|
's'
|
||||||
|
}
|
||||||
|
|
||||||
|
const iphasicValue = wp.iphasic || 1
|
||||||
|
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
|
||||||
|
const waveDatas = []
|
||||||
|
|
||||||
|
for (let i = 0; i < picCounts; i++) {
|
||||||
|
const data = fliteWaveData(wp, i)
|
||||||
|
waveDatas.push(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
const time = wp.time
|
||||||
|
const type = wp.waveType
|
||||||
|
let severity = wp.yzd
|
||||||
|
|
||||||
|
if (severity < 0) {
|
||||||
|
severity = '/'
|
||||||
|
type = '/'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将处理结果发送回主线程
|
||||||
|
self.postMessage({
|
||||||
|
requestId,
|
||||||
|
success: true,
|
||||||
|
waveDatas,
|
||||||
|
time,
|
||||||
|
type,
|
||||||
|
severity,
|
||||||
|
titles,
|
||||||
|
iphasic: iphasicValue
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<div v-if="view2">
|
<div v-if="view2">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<span style="font-size: 14px; line-height: 30px">值类型选择:</span>
|
<!-- <span style="font-size: 14px; line-height: 30px">值类型选择:</span>
|
||||||
<el-select
|
<el-select
|
||||||
style="min-width: 200px; width: 200px"
|
style="min-width: 200px; width: 200px"
|
||||||
@change="changeView"
|
@change="changeView"
|
||||||
@@ -15,52 +15,31 @@
|
|||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
<!-- <el-button v-if="view2 && senior" class="ml10" type="primary"
|
<el-radio-group v-model.trim="value" @change="changeView">
|
||||||
@click="AdvancedAnalytics">高级分析</el-button> -->
|
<el-radio-button label="一次值" :value="1" />
|
||||||
|
<el-radio-button label="二次值" :value="2" />
|
||||||
|
</el-radio-group>
|
||||||
|
<!-- <el-button v-if="view2 && senior" class="ml10" type="primary" @click="AdvancedAnalytics">
|
||||||
|
高级分析
|
||||||
|
</el-button> -->
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-button
|
<el-button @click="backbxlb" icon="el-icon-Back" style="float: right">返回</el-button>
|
||||||
@click="backbxlb"
|
|
||||||
class="el-icon-refresh-right"
|
|
||||||
icon="el-icon-Back"
|
|
||||||
style="float: right"
|
|
||||||
>
|
|
||||||
返回
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div v-loading="loading" style="height: calc(100vh - 190px)">
|
<div v-loading="loading" style="height: calc(100vh - 190px)" class="mt10">
|
||||||
<el-tabs v-if="view4" class="default-main" v-model="bxactiveName" @tab-click="bxhandleClick">
|
<el-tabs v-if="view4" type="border-card" v-model="bxactiveName"
|
||||||
<el-tab-pane
|
@tab-click="bxhandleClick">
|
||||||
label="瞬时波形"
|
<el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
|
||||||
name="ssbx"
|
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||||
class="boxbx pt10 pb10"
|
<shushiboxi ref="shushiboxiRef" v-if="bxactiveName == 'ssbx' && showBoxi" :value="value"
|
||||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
|
:parentHeight="parentHeight" :boxoList="boxoList" :wp="wp"></shushiboxi>
|
||||||
>
|
|
||||||
<shushiboxi
|
|
||||||
ref="shushiboxiRef"
|
|
||||||
v-if="bxactiveName == 'ssbx' && showBoxi"
|
|
||||||
:value="value"
|
|
||||||
:parentHeight="parentHeight"
|
|
||||||
:boxoList="boxoList"
|
|
||||||
:wp="wp"
|
|
||||||
></shushiboxi>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
|
||||||
label="RMS波形"
|
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||||
class="boxbx pt10 pb10"
|
<rmsboxi ref="rmsboxiRef" v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value"
|
||||||
name="rmsbx"
|
:parentHeight="parentHeight" :boxoList="boxoList" :wp="wp"></rmsboxi>
|
||||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'"
|
|
||||||
>
|
|
||||||
<rmsboxi
|
|
||||||
ref="rmsboxiRef"
|
|
||||||
v-if="bxactiveName == 'rmsbx' && showBoxi"
|
|
||||||
:value="value"
|
|
||||||
:parentHeight="parentHeight"
|
|
||||||
:boxoList="boxoList"
|
|
||||||
:wp="wp"
|
|
||||||
></rmsboxi>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-empty v-else description="暂无数据" style="height: calc(100vh - 190px)" />
|
<el-empty v-else description="暂无数据" style="height: calc(100vh - 190px)" />
|
||||||
@@ -76,10 +55,12 @@
|
|||||||
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
import shushiboxi from '@/components/echarts/shushiboxi.vue'
|
||||||
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
import rmsboxi from '@/components/echarts/rmsboxi.vue'
|
||||||
import analytics from '@/components/echarts/analytics.vue'
|
import analytics from '@/components/echarts/analytics.vue'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, shallowRef } from 'vue'
|
||||||
import { analysis } from '@/api/advance-boot/analyse'
|
import { analysis } from '@/api/advance-boot/analyse'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { getMonitorEventAnalyseWave, downloadWaveFile } from '@/api/event-boot/transient'
|
import { getMonitorEventAnalyseWave, downloadWaveFile } from '@/api/event-boot/transient'
|
||||||
|
import { buildWaveStoreKey, registerWaveRaw, buildSlimWp, releaseWaveRaw } from '@/utils/waveRawStore'
|
||||||
|
import { clearWaveCache } from '@/utils/waveCache'
|
||||||
const emit = defineEmits(['backbxlb'])
|
const emit = defineEmits(['backbxlb'])
|
||||||
interface Props {
|
interface Props {
|
||||||
// boxoList: any
|
// boxoList: any
|
||||||
@@ -106,14 +87,14 @@ const options = ref([
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
const shushiboxiRef = ref()
|
const shushiboxiRef = ref()
|
||||||
const bxecharts = ref(mainHeight(95).height as any)
|
const bxecharts = ref(mainHeight(145).height as any)
|
||||||
const view2 = ref(true)
|
const view2 = ref(true)
|
||||||
const boxoList = ref(null)
|
const boxoList: any = ref(null)
|
||||||
const wp = ref(null)
|
const wp = shallowRef<any>(null)
|
||||||
const showBoxi = ref(true)
|
const showBoxi = ref(true)
|
||||||
const view3 = ref(false)
|
const view3 = ref(false)
|
||||||
const view4 = ref(false)
|
const view4 = ref(false)
|
||||||
const GJList = ref([])
|
const GJList = ref({})
|
||||||
|
|
||||||
const open = async (row: any) => {
|
const open = async (row: any) => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
@@ -122,19 +103,20 @@ const open = async (row: any) => {
|
|||||||
row.loading = false
|
row.loading = false
|
||||||
if (res != undefined) {
|
if (res != undefined) {
|
||||||
boxoList.value = row
|
boxoList.value = row
|
||||||
wp.value = res.data
|
boxoList.value.pt = res.data.pt
|
||||||
|
const storeKey = buildWaveStoreKey(row)
|
||||||
|
registerWaveRaw(storeKey, res.data)
|
||||||
|
wp.value = buildSlimWp(res.data, storeKey)
|
||||||
loading.value = false
|
loading.value = false
|
||||||
view4.value = true
|
view4.value = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
backbxlb()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const bxhandleClick = (tab: any) => {
|
const bxhandleClick = (tab: any) => {
|
||||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
|
||||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
if (tab.name == 'ssbx') {
|
if (tab.name == 'ssbx') {
|
||||||
bxactiveName.value = 'ssbx'
|
bxactiveName.value = 'ssbx'
|
||||||
@@ -147,10 +129,12 @@ const bxhandleClick = (tab: any) => {
|
|||||||
// console.log(tab, event);
|
// console.log(tab, event);
|
||||||
}
|
}
|
||||||
const backbxlb = () => {
|
const backbxlb = () => {
|
||||||
|
const storeKey = wp.value?.waveStoreKey
|
||||||
|
releaseWaveRaw(storeKey, 'all')
|
||||||
|
clearWaveCache()
|
||||||
boxoList.value = null
|
boxoList.value = null
|
||||||
wp.value = null
|
wp.value = null
|
||||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
|
||||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
|
||||||
|
|
||||||
emit('backbxlb')
|
emit('backbxlb')
|
||||||
}
|
}
|
||||||
@@ -168,14 +152,17 @@ const AdvancedAnalytics = () => {
|
|||||||
analysis({
|
analysis({
|
||||||
eventIndex: boxoList.value.eventId
|
eventIndex: boxoList.value.eventId
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
GJList.value = res.data
|
// GJList.value = res.data
|
||||||
view3.value = true
|
// view3.value = true
|
||||||
view2.value = false
|
// view2.value = false
|
||||||
})
|
})
|
||||||
|
GJList.value = {}
|
||||||
|
view3.value = true
|
||||||
|
view2.value = false
|
||||||
}
|
}
|
||||||
const changeView = () => {
|
const changeView = () => {
|
||||||
if (shushiboxiRef.value) shushiboxiRef.value.backbxlb()
|
shushiboxiRef.value?.backbxlb?.()
|
||||||
if (rmsboxiRef.value) rmsboxiRef.value.backbxlb()
|
rmsboxiRef.value?.backbxlb?.()
|
||||||
showBoxi.value = false
|
showBoxi.value = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showBoxi.value = true
|
showBoxi.value = true
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width: 540px">
|
<div :style="{ width: isMinuteData ? '750px' : '610px' }">
|
||||||
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
|
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
|
||||||
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="timeValue"
|
v-model="timeValue"
|
||||||
type="daterange"
|
:type="pickerType"
|
||||||
:disabled="disabledPicker"
|
:disabled="disabledPicker"
|
||||||
:disabled-date="isFutureDate"
|
:disabled-date="isFutureDate"
|
||||||
style="width: 220px; margin-right: 10px"
|
:style="{ width: isMinuteData ? '360px' : '220px', marginRight: '10px' }"
|
||||||
unlink-panels
|
unlink-panels
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
:start-placeholder="isMinuteData ? '开始时间' : '开始日期'"
|
||||||
end-placeholder="结束日期"
|
:end-placeholder="isMinuteData ? '结束时间' : '结束日期'"
|
||||||
value-format="YYYY-MM-DD"
|
:value-format="pickerValueFormat"
|
||||||
:shortcuts="shortcuts"
|
:shortcuts="isMinuteData ? undefined : shortcuts"
|
||||||
/>
|
/>
|
||||||
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
|
<el-button :disabled="backDisabled" type="primary" :icon="DArrowLeft" @click="preClick"></el-button>
|
||||||
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
|
<el-button type="primary" :icon="VideoPause" @click="nowTime">当前</el-button>
|
||||||
@@ -26,18 +26,41 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
|
import { DArrowLeft, VideoPause, DArrowRight } from '@element-plus/icons-vue'
|
||||||
import { ref, onMounted, nextTick, watch } from 'vue'
|
import { ref, onMounted, computed, watch } from 'vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
nextFlag?: boolean
|
nextFlag?: boolean
|
||||||
theCurrentTime?: boolean
|
theCurrentTime?: boolean
|
||||||
|
isStatisticData?: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
nextFlag: false,
|
nextFlag: false,
|
||||||
theCurrentTime: false
|
theCurrentTime: false,
|
||||||
|
isStatisticData: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isMinuteData = computed(() => Number(props.isStatisticData) === 1)
|
||||||
|
const pickerType = computed(() => (isMinuteData.value ? 'datetimerange' : 'daterange'))
|
||||||
|
const pickerValueFormat = computed(() => (isMinuteData.value ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'))
|
||||||
|
|
||||||
|
const toDatePart = (value: string) => (value?.includes(' ') ? value.split(' ')[0] : value)
|
||||||
|
|
||||||
|
const toMinuteStart = (date: string) => `${toDatePart(date)} 00:00:00`
|
||||||
|
|
||||||
|
const toMinuteEnd = (date: string) => `${toDatePart(date)} 23:59:59`
|
||||||
|
|
||||||
|
const normalizeRange = (start: string, end: string) => {
|
||||||
|
if (!isMinuteData.value) {
|
||||||
|
return [toDatePart(start), toDatePart(end)]
|
||||||
|
}
|
||||||
|
return [toMinuteStart(start), toMinuteEnd(end)]
|
||||||
|
}
|
||||||
|
|
||||||
|
const setRangeValue = (start: string, end: string) => {
|
||||||
|
timeValue.value = normalizeRange(start, end)
|
||||||
|
}
|
||||||
|
|
||||||
const interval = ref(3)
|
const interval = ref(3)
|
||||||
const timeFlag = ref(1)
|
const timeFlag = ref(1)
|
||||||
const count = ref(0)
|
const count = ref(0)
|
||||||
@@ -95,13 +118,13 @@ const timeChange = (e: number) => {
|
|||||||
if (e == 1) {
|
if (e == 1) {
|
||||||
disabledPicker.value = true
|
disabledPicker.value = true
|
||||||
|
|
||||||
timeValue.value = [setTime(1), setTime()]
|
setRangeValue(setTime(1), setTime())
|
||||||
} else if (e == 2) {
|
} else if (e == 2) {
|
||||||
disabledPicker.value = true
|
disabledPicker.value = true
|
||||||
timeValue.value = [setTime(2), setTime()]
|
setRangeValue(setTime(2), setTime())
|
||||||
} else if (e == 3) {
|
} else if (e == 3) {
|
||||||
disabledPicker.value = true
|
disabledPicker.value = true
|
||||||
timeValue.value = [setTime(3), setTime()]
|
setRangeValue(setTime(3), setTime())
|
||||||
} else if (e == 4) {
|
} else if (e == 4) {
|
||||||
let year = parseInt(setTime().substring(0, 4))
|
let year = parseInt(setTime().substring(0, 4))
|
||||||
let month = parseInt(setTime().substring(5, 7))
|
let month = parseInt(setTime().substring(5, 7))
|
||||||
@@ -111,12 +134,12 @@ const timeChange = (e: number) => {
|
|||||||
var dayOfWeek = start.getDay() == 0 ? 7 : start.getDay() - 1 // 如果为周日,则置为7天
|
var dayOfWeek = start.getDay() == 0 ? 7 : start.getDay() - 1 // 如果为周日,则置为7天
|
||||||
|
|
||||||
disabledPicker.value = true
|
disabledPicker.value = true
|
||||||
timeValue.value = [setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek)]
|
setRangeValue(setTime(0, dayOfWeek), setTime(0, -6 + dayOfWeek))
|
||||||
} else if (e == 5) {
|
} else if (e == 5) {
|
||||||
disabledPicker.value = false
|
disabledPicker.value = false
|
||||||
backDisabled.value = true
|
backDisabled.value = true
|
||||||
preDisabled.value = props.nextFlag ? false : true
|
preDisabled.value = props.nextFlag ? false : true
|
||||||
timeValue.value = [setTime(), setTime()]
|
setRangeValue(setTime(), setTime())
|
||||||
}
|
}
|
||||||
if (e == 1 || e == 2) {
|
if (e == 1 || e == 2) {
|
||||||
timeFlag.value = 0
|
timeFlag.value = 0
|
||||||
@@ -127,7 +150,7 @@ const timeChange = (e: number) => {
|
|||||||
|
|
||||||
// 当前
|
// 当前
|
||||||
const nowTime = () => {
|
const nowTime = () => {
|
||||||
console.log(interval.value, '000000000')
|
//console.log(interval.value, '000000000')
|
||||||
timeChange(interval.value)
|
timeChange(interval.value)
|
||||||
}
|
}
|
||||||
// 上一个
|
// 上一个
|
||||||
@@ -186,7 +209,7 @@ const preClick = () => {
|
|||||||
startTime = year + '-01-01'
|
startTime = year + '-01-01'
|
||||||
endTime = year + '-12-31'
|
endTime = year + '-12-31'
|
||||||
}
|
}
|
||||||
timeValue.value = [startTime, endTime]
|
setRangeValue(startTime, endTime)
|
||||||
|
|
||||||
// 判断向后键的状态
|
// 判断向后键的状态
|
||||||
// var temp = NowgetEndTime()
|
// var temp = NowgetEndTime()
|
||||||
@@ -312,7 +335,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
month = month + 3
|
month = month + 3
|
||||||
console.log('🚀 ~ next ~ presentM:', presentM, month)
|
// console.log('🚀 ~ next ~ presentM:', presentM, month)
|
||||||
|
|
||||||
// 季度进位后,超过当前月份是不科学的
|
// 季度进位后,超过当前月份是不科学的
|
||||||
if (year == presentY && !props.nextFlag) {
|
if (year == presentY && !props.nextFlag) {
|
||||||
@@ -327,7 +350,7 @@ const next = () => {
|
|||||||
endTime = year + '-0' + presentM + '-' + presentD
|
endTime = year + '-0' + presentM + '-' + presentD
|
||||||
}
|
}
|
||||||
} else if (presentM > 3 && presentM < 7) {
|
} else if (presentM > 3 && presentM < 7) {
|
||||||
console.log(123123)
|
// console.log(123123)
|
||||||
// 第二季度
|
// 第二季度
|
||||||
startTime = year + '-04-01'
|
startTime = year + '-04-01'
|
||||||
if (presentD < 10) {
|
if (presentD < 10) {
|
||||||
@@ -380,7 +403,7 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(startTime, endTime)
|
// console.log(startTime, endTime)
|
||||||
} else if (interval.value == 5) {
|
} else if (interval.value == 5) {
|
||||||
} else if (interval.value == 4) {
|
} else if (interval.value == 4) {
|
||||||
//根据开始时间推
|
//根据开始时间推
|
||||||
@@ -415,16 +438,27 @@ const next = () => {
|
|||||||
}
|
}
|
||||||
if (!props.nextFlag) {
|
if (!props.nextFlag) {
|
||||||
if (
|
if (
|
||||||
new Date(endTime + ' 00:00:00').getTime() >=
|
new Date(toDatePart(endTime) + ' 00:00:00').getTime() >=
|
||||||
new Date(window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd ') + ' 00:00:00').getTime()
|
new Date(window.XEUtils.toDateString(new Date(), 'yyyy-MM-dd ') + ' 00:00:00').getTime()
|
||||||
) {
|
) {
|
||||||
preDisabled.value = props.nextFlag ? false : true
|
preDisabled.value = props.nextFlag ? false : true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timeValue.value = [startTime, endTime]
|
setRangeValue(startTime, endTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.isStatisticData,
|
||||||
|
() => {
|
||||||
|
if (timeValue.value?.length === 2) {
|
||||||
|
setRangeValue(timeValue.value[0], timeValue.value[1])
|
||||||
|
} else {
|
||||||
|
timeChange(interval.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
const setTime = (flag = 0, e = 0) => {
|
const setTime = (flag = 0, e = 0) => {
|
||||||
let dd = window.XEUtils.toDateString(new Date().getTime() - e * 3600 * 1000 * 24, 'dd')
|
let dd = window.XEUtils.toDateString(new Date().getTime() - e * 3600 * 1000 * 24, 'dd')
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,8 @@ export const defaultAttribute: VxeTableProps = {
|
|||||||
columnConfig: { resizable: true },
|
columnConfig: { resizable: true },
|
||||||
rowConfig: { isCurrent: true, isHover: true },
|
rowConfig: { isCurrent: true, isHover: true },
|
||||||
scrollX: { scrollToLeftOnChange: true },
|
scrollX: { scrollToLeftOnChange: true },
|
||||||
scrollY: { scrollToTopOnChange: true, enabled: true },
|
scrollY: { scrollToTopOnChange: true, enabled: true, gt: 100 },
|
||||||
treeConfig: {
|
customConfig: { enabled: true, allowFixed: false, showFooter: false, immediate: true ,mode:'default'},
|
||||||
reserve: true
|
showOverflow: 'tooltip',
|
||||||
},
|
showHeaderOverflow: false
|
||||||
showOverflow: true,
|
|
||||||
showFooter:true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,11 @@
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
>
|
>
|
||||||
<el-form-item v-if="datePicker" style="grid-column: span 2; max-width: 630px">
|
<el-form-item
|
||||||
|
v-if="datePicker"
|
||||||
|
style="grid-column: span 2"
|
||||||
|
:style="{ maxWidth: isStatisticData == 1 ? '750px' : '610px' }"
|
||||||
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
<el-checkbox v-if="showTimeAll" v-model="timeAll" label="统计时间" />
|
||||||
<span v-else>{{ dateLabel }}</span>
|
<span v-else>{{ dateLabel }}</span>
|
||||||
@@ -19,11 +23,17 @@
|
|||||||
v-if="timeAll"
|
v-if="timeAll"
|
||||||
:nextFlag="nextFlag"
|
:nextFlag="nextFlag"
|
||||||
:theCurrentTime="theCurrentTime"
|
:theCurrentTime="theCurrentTime"
|
||||||
|
:isStatisticData="isStatisticData"
|
||||||
></DatePicker>
|
></DatePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="区域" v-if="area">
|
<el-form-item label="区域" v-if="area">
|
||||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" />
|
<Area
|
||||||
|
ref="areaRef"
|
||||||
|
v-model="tableStore.table.params.deptIndex"
|
||||||
|
@change-value="onAreaChange"
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<slot name="select"></slot>
|
<slot name="select"></slot>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -52,7 +62,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
@click="onExport"
|
@click="onExport"
|
||||||
v-if="showExport"
|
v-if="showExport"
|
||||||
:loading="tableStore.table.loading"
|
:loading="tableStore.table.exportLoading"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-Download"
|
icon="el-icon-Download"
|
||||||
>
|
>
|
||||||
@@ -60,6 +70,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<slot name="operation"></slot>
|
<slot name="operation"></slot>
|
||||||
|
<el-button class="ml10" v-if="showCustomColumn" :icon="Setting" @click="openCustomColumn">列设置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-form
|
<el-form
|
||||||
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
:style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
|
||||||
@@ -79,9 +90,8 @@ import DatePicker from '@/components/form/datePicker/index.vue'
|
|||||||
import Area from '@/components/form/area/index.vue'
|
import Area from '@/components/form/area/index.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
import { Search, RefreshLeft, Setting } from '@element-plus/icons-vue'
|
||||||
import { defineProps } from 'vue'
|
const emit = defineEmits(['selectChange', 'areaChange'])
|
||||||
const emit = defineEmits(['selectChange'])
|
|
||||||
const tableStore = inject('tableStore') as TableStore
|
const tableStore = inject('tableStore') as TableStore
|
||||||
const tableHeader = ref()
|
const tableHeader = ref()
|
||||||
const datePickerRef = ref()
|
const datePickerRef = ref()
|
||||||
@@ -100,6 +110,8 @@ interface Props {
|
|||||||
showExport?: boolean //导出控制
|
showExport?: boolean //导出控制
|
||||||
showTimeAll?: boolean //控制时间是否显示
|
showTimeAll?: boolean //控制时间是否显示
|
||||||
dateLabel?: string //设置时间名称
|
dateLabel?: string //设置时间名称
|
||||||
|
isStatisticData?: number | string // 0统计数据 1分钟数据
|
||||||
|
showCustomColumn?: boolean // 列设置
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
@@ -111,7 +123,9 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
showReset: true,
|
showReset: true,
|
||||||
showExport: false,
|
showExport: false,
|
||||||
showTimeAll: false,
|
showTimeAll: false,
|
||||||
dateLabel: '统计日期'
|
dateLabel: '统计日期',
|
||||||
|
isStatisticData: 0,
|
||||||
|
showCustomColumn: false
|
||||||
})
|
})
|
||||||
// 动态计算table高度
|
// 动态计算table高度
|
||||||
const resizeObserver = new ResizeObserver(entries => {
|
const resizeObserver = new ResizeObserver(entries => {
|
||||||
@@ -132,6 +146,10 @@ const headerFormSecondStyleClose = {
|
|||||||
padding: '0'
|
padding: '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onAreaChange = data => {
|
||||||
|
emit('areaChange', { label: data.label })
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => tableStore?.table.params.deptIndex,
|
() => tableStore?.table.params.deptIndex,
|
||||||
newVal => {
|
newVal => {
|
||||||
@@ -149,7 +167,13 @@ watch(
|
|||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
const openCustomColumn = () => {
|
||||||
|
tableStore?.table?.ref?.openCustom?.()
|
||||||
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
if (props.showCustomColumn && tableStore?.table) {
|
||||||
|
tableStore.table.customColumnInHeader = true
|
||||||
|
}
|
||||||
timeAll.value = props.showTimeAll ? false : true
|
timeAll.value = props.showTimeAll ? false : true
|
||||||
if (props.datePicker && timeAll.value) {
|
if (props.datePicker && timeAll.value) {
|
||||||
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
tableStore.table.params.searchBeginTime = datePickerRef.value.timeValue[0]
|
||||||
@@ -232,14 +256,14 @@ const onResetForm = () => {
|
|||||||
//时间重置成默认值
|
//时间重置成默认值
|
||||||
datePickerRef.value?.setTheDate(3)
|
datePickerRef.value?.setTheDate(3)
|
||||||
|
|
||||||
if(props.showTimeAll){
|
if (props.showTimeAll) {
|
||||||
timeAll.value = false
|
timeAll.value = false
|
||||||
delete tableStore.table.params.searchBeginTime
|
delete tableStore.table.params.searchBeginTime
|
||||||
delete tableStore.table.params.searchEndTime
|
delete tableStore.table.params.searchEndTime
|
||||||
delete tableStore.table.params.startTime
|
delete tableStore.table.params.startTime
|
||||||
delete tableStore.table.params.endTime
|
delete tableStore.table.params.endTime
|
||||||
delete tableStore.table.params.timeFlag
|
delete tableStore.table.params.timeFlag
|
||||||
delete tableStore.table.params.interval
|
delete tableStore.table.params.interval
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.datePicker && timeAll.value) {
|
if (props.datePicker && timeAll.value) {
|
||||||
@@ -258,7 +282,6 @@ const setTheDate = (val: any) => {
|
|||||||
}
|
}
|
||||||
// 导出
|
// 导出
|
||||||
const onExport = () => {
|
const onExport = () => {
|
||||||
console.log('222')
|
|
||||||
tableStore.onTableAction('export', { showAllFlag: true })
|
tableStore.onTableAction('export', { showAllFlag: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,6 +317,7 @@ defineExpose({
|
|||||||
padding: 13px 15px;
|
padding: 13px 15px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.table-header-operate-text {
|
.table-header-operate-text {
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,46 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||||
<vxe-table ref="tableRef" height="auto" :key="key" :data="tableStore.table.data"
|
<div v-if="showCustomColumn && !tableStore?.table?.customColumnInHeader" class="table-custom-toolbar">
|
||||||
v-loading="tableStore.table.loading" v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
<el-button icon="el-icon-Setting" @click="openCustomColumn">列设置</el-button>
|
||||||
@checkbox-all="selectChangeEvent" @checkbox-change="selectChangeEvent" :showOverflow="showOverflow"
|
</div>
|
||||||
@sort-change="handleSortChange">
|
<vxe-table
|
||||||
|
ref="tableRef"
|
||||||
|
height="auto"
|
||||||
|
:key="key"
|
||||||
|
:data="tableStore.table.data"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
v-bind="tableBindProps"
|
||||||
|
@checkbox-all="selectChangeEvent"
|
||||||
|
@checkbox-change="selectChangeEvent"
|
||||||
|
@cell-click="onCellClick"
|
||||||
|
>
|
||||||
|
<!-- @sort-change="handleSortChange" -->
|
||||||
<!-- Column 组件内部是 el-table-column -->
|
<!-- Column 组件内部是 el-table-column -->
|
||||||
<template v-if="isGroup">
|
<template v-if="isGroup">
|
||||||
<GroupColumn :column="tableStore.table.column" />
|
<GroupColumn :column="tableStore.table.column" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<Column :attr="item" :key="key + '-column'" v-for="(item, key) in tableStore.table.column"
|
<Column
|
||||||
:tree-node="item.treeNode">
|
:attr="item"
|
||||||
|
:key="key + '-column'"
|
||||||
|
v-for="(item, key) in tableStore.table.column"
|
||||||
|
:tree-node="item.treeNode"
|
||||||
|
>
|
||||||
<!-- tableStore 预设的列 render 方案 -->
|
<!-- tableStore 预设的列 render 方案 -->
|
||||||
<template v-if="item.render" #default="scope">
|
<template v-if="item.render" #default="scope">
|
||||||
<FieldRender :field="item" :row="scope.row" :column="scope.column" :index="scope.rowIndex" :key="key +
|
<FieldRender
|
||||||
'-' +
|
:field="item"
|
||||||
item.render +
|
:row="scope.row"
|
||||||
'-' +
|
:column="scope.column"
|
||||||
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
:index="scope.rowIndex"
|
||||||
" />
|
:key="
|
||||||
|
key +
|
||||||
|
'-' +
|
||||||
|
item.render +
|
||||||
|
'-' +
|
||||||
|
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||||
|
"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</Column>
|
</Column>
|
||||||
</template>
|
</template>
|
||||||
@@ -27,17 +49,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="tableStore.showPage" class="table-pagination">
|
<div v-if="tableStore.showPage" class="table-pagination">
|
||||||
<el-pagination :currentPage="tableStore.table.params!.pageNum" :page-size="tableStore.table.params!.pageSize"
|
<el-pagination
|
||||||
:page-sizes="pageSizes" background
|
:currentPage="tableStore.table.params!.pageNum"
|
||||||
|
:page-size="tableStore.table.params!.pageSize"
|
||||||
|
:page-sizes="pageSizes"
|
||||||
|
background
|
||||||
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
||||||
:total="tableStore.table.total" @size-change="onTableSizeChange"
|
:total="tableStore.table.total"
|
||||||
@current-change="onTableCurrentChange"></el-pagination>
|
@size-change="onTableSizeChange"
|
||||||
|
@current-change="onTableCurrentChange"
|
||||||
|
></el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<slot name="footer"></slot>
|
<slot name="footer"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, nextTick, inject, computed, onMounted, watch } from 'vue'
|
import { ref, nextTick, inject, computed, onMounted, watch, useAttrs } from 'vue'
|
||||||
import type { ElTable } from 'element-plus'
|
import type { ElTable } from 'element-plus'
|
||||||
import { VxeTableEvents, VxeTableInstance } from 'vxe-table'
|
import { VxeTableEvents, VxeTableInstance } from 'vxe-table'
|
||||||
import FieldRender from '@/components/table/fieldRender/index.vue'
|
import FieldRender from '@/components/table/fieldRender/index.vue'
|
||||||
@@ -53,17 +80,32 @@ const tableRef = ref<VxeTableInstance>()
|
|||||||
const tableStore = inject('tableStore') as TableStoreClass
|
const tableStore = inject('tableStore') as TableStoreClass
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const key = ref(0)
|
const key = ref(0)
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'cell-click', params: any): void
|
||||||
|
}>()
|
||||||
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
||||||
isGroup?: boolean
|
isGroup?: boolean
|
||||||
showOverflow?: boolean
|
showOverflow?: boolean | 'ellipsis' | 'title' | 'tooltip'
|
||||||
height?: string | number
|
height?: string | number
|
||||||
|
showCustomColumn?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
isGroup: false,
|
isGroup: false,
|
||||||
showOverflow: true,
|
showOverflow: 'tooltip',
|
||||||
height: undefined
|
height: undefined,
|
||||||
|
showCustomColumn: false
|
||||||
})
|
})
|
||||||
|
const attrs = useAttrs()
|
||||||
|
const tableBindProps = computed(() => {
|
||||||
|
return Object.assign({}, defaultAttribute, attrs, {
|
||||||
|
showOverflow: props.showOverflow,
|
||||||
|
showHeaderOverflow: false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const onCellClick: VxeTableEvents.CellClick<any> = params => {
|
||||||
|
emit('cell-click', params)
|
||||||
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableStore.table.ref = tableRef.value as VxeTableInstance
|
tableStore.table.ref = tableRef.value as VxeTableInstance
|
||||||
})
|
})
|
||||||
@@ -93,7 +135,9 @@ const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ checked }) => {
|
|||||||
const records = (tableRef.value as VxeTableInstance).getCheckboxRecords()
|
const records = (tableRef.value as VxeTableInstance).getCheckboxRecords()
|
||||||
tableStore.onTableAction('selection-change', records)
|
tableStore.onTableAction('selection-change', records)
|
||||||
}
|
}
|
||||||
|
const openCustomColumn = () => {
|
||||||
|
tableRef.value?.openCustom?.()
|
||||||
|
}
|
||||||
const getRef = () => {
|
const getRef = () => {
|
||||||
return tableRef.value
|
return tableRef.value
|
||||||
}
|
}
|
||||||
|
|||||||
187
src/components/tree/allocation.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||||
|
<div class="mt15 mr10" style="display: flex; justify-content: end">
|
||||||
|
<el-button type="primary" icon="el-icon-Select" @click="save" :loading="loading">保存</el-button>
|
||||||
|
</div>
|
||||||
|
<Icon
|
||||||
|
v-show="menuCollapse"
|
||||||
|
@click="onMenuCollapse"
|
||||||
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
|
:class="menuCollapse ? 'unfold' : ''"
|
||||||
|
size="18"
|
||||||
|
class="fold ml10 mt20 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
/>
|
||||||
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
|
<el-input maxlength="32" show-word-limit v-model.trim="filterText" placeholder="请输入内容" clearable>
|
||||||
|
<template #prefix>
|
||||||
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
|
||||||
|
<template #content>
|
||||||
|
<span>台账推送</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<Icon
|
||||||
|
name="el-icon-Promotion"
|
||||||
|
size="20"
|
||||||
|
class="fold ml10 menu-collapse"
|
||||||
|
style="cursor: pointer"
|
||||||
|
:style="{ color: config.getColorVal('elementUiPrimary') }"
|
||||||
|
@click="onAdd"
|
||||||
|
/>
|
||||||
|
</el-tooltip>
|
||||||
|
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" v-else
|
||||||
|
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
|
||||||
|
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-tree
|
||||||
|
:style="{ height: 'calc(100vh - 235px)' }"
|
||||||
|
style="overflow: auto"
|
||||||
|
ref="treeRef"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
:default-expand-all="false"
|
||||||
|
@check-change="checkTreeNodeChange"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
node-key="id"
|
||||||
|
v-bind="$attrs"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="custom-tree-node">
|
||||||
|
<Icon
|
||||||
|
:name="data.icon"
|
||||||
|
style="font-size: 16px"
|
||||||
|
:style="{ color: data.color }"
|
||||||
|
v-if="data.icon"
|
||||||
|
/>
|
||||||
|
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
|
import { emit } from 'process'
|
||||||
|
import { ref, watch } from 'vue'
|
||||||
|
import { t } from 'vxe-table'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'govern/tree'
|
||||||
|
})
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
width?: string
|
||||||
|
canExpand?: boolean
|
||||||
|
showPush?: boolean
|
||||||
|
}
|
||||||
|
const loading = ref(false)
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
width: '280px',
|
||||||
|
canExpand: true,
|
||||||
|
showPush: false
|
||||||
|
})
|
||||||
|
const config = useConfig()
|
||||||
|
const { proxy } = useCurrentInstance()
|
||||||
|
const menuCollapse = ref(false)
|
||||||
|
const filterText = ref('')
|
||||||
|
const defaultProps = {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['checkTreeNodeChange', 'onAdd', 'checkChange'])
|
||||||
|
watch(filterText, val => {
|
||||||
|
treeRef.value!.filter(val)
|
||||||
|
})
|
||||||
|
const onMenuCollapse = () => {
|
||||||
|
menuCollapse.value = !menuCollapse.value
|
||||||
|
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||||
|
}
|
||||||
|
const save = () => {
|
||||||
|
loading.value = true
|
||||||
|
emit('checkChange')
|
||||||
|
}
|
||||||
|
const filterNode = (value: string, data: any, node: any) => {
|
||||||
|
console.log(value, data, node, 'filterNode')
|
||||||
|
if (!value) return true
|
||||||
|
// return data.name.includes(value)
|
||||||
|
if (data.name) {
|
||||||
|
return chooseNode(value, data, node)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||||
|
const chooseNode = (value: string, data: any, node: any) => {
|
||||||
|
if (data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const level = node.level
|
||||||
|
// 如果传入的节点本身就是一级节点就不用校验了
|
||||||
|
if (level === 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
// 先取当前节点的父节点
|
||||||
|
let parentData = node.parent
|
||||||
|
// 遍历当前节点的父节点
|
||||||
|
let index = 0
|
||||||
|
while (index < level - 1) {
|
||||||
|
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||||
|
if (parentData.data.name.indexOf(value) !== -1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// 否则的话再往上一层做匹配
|
||||||
|
parentData = parentData.parent
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
// 没匹配到返回false
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
const checkTreeNodeChange = () => {
|
||||||
|
// console.log(treeRef.value?.getCheckedNodes(), "ikkkkkiisiiisis");
|
||||||
|
emit('checkTreeNodeChange', treeRef.value?.getCheckedNodes())
|
||||||
|
}
|
||||||
|
|
||||||
|
const onAdd = () => {
|
||||||
|
emit('onAdd')
|
||||||
|
}
|
||||||
|
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
defineExpose({ treeRef, loading })
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.cn-tree {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.el-tree) {
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||||
|
background-color: var(--el-color-primary-light-7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-collapse {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-tree-node {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,167 +3,177 @@
|
|||||||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane label="监测点详情" name="tab1">
|
<el-tab-pane label="监测点详情" name="tab1">
|
||||||
<el-descriptions :column="3" border label-width="150px">
|
<el-descriptions :column="3" border label-width="150px">
|
||||||
<el-descriptions-item label="项目工程">
|
<el-descriptions-item label="项目工程">
|
||||||
{{ details.areaName }}
|
{{ details.areaName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="项目单位">
|
<el-descriptions-item label="项目单位">
|
||||||
{{ details.gdName }}
|
{{ details.gdName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="所属变电站">
|
<el-descriptions-item label="所属变电站">
|
||||||
{{ details.bdName }}
|
{{ details.bdName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="电压等级">
|
<el-descriptions-item label="监测点名称">
|
||||||
{{ details.scale }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="终端厂家">
|
|
||||||
{{ details.manufacturer }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="终端名称">
|
|
||||||
{{ details.devName }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="网络参数">
|
|
||||||
{{ details.ip }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="监测点名称">
|
|
||||||
{{ details.lineName }}
|
{{ details.lineName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="监测点序号">
|
<el-descriptions-item label="监测点对象名称">
|
||||||
{{ details.id }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="通讯状态">
|
|
||||||
{{ details.comFlag }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="干扰源类型">
|
|
||||||
{{ details.loadType }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="监测点对象名称">
|
|
||||||
{{ details.objName }}
|
{{ details.objName }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="接线方式">
|
<el-descriptions-item label="监测点序号">
|
||||||
|
{{ details.id }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="终端厂家">
|
||||||
|
{{ details.manufacturer }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端名称">
|
||||||
|
{{ details.devName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="终端型号">
|
||||||
|
{{ typeArr.find(item => item.id == details.devType)?.name }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="电压等级">
|
||||||
|
{{ details.scale }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="网络参数">
|
||||||
|
{{ details.ip }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="通讯状态">
|
||||||
|
{{ details.comFlag }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="干扰源类型">
|
||||||
|
{{ details.loadType }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="接线方式">
|
||||||
{{ details.ptType }}
|
{{ details.ptType }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="PT变比">
|
<el-descriptions-item label="统计间隔(分钟)">
|
||||||
|
{{ details.timeInterval }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PT变比">
|
||||||
{{ details.pt }}
|
{{ details.pt }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="CT变比">
|
<el-descriptions-item label="CT变比">
|
||||||
{{ details.ct }}
|
{{ details.ct }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="基准容量(MVA)">
|
<el-descriptions-item label="基准容量(MVA)">
|
||||||
{{ details.standardCapacity }}
|
{{ details.standardCapacity }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="最小短路容量(MVA)">
|
<el-descriptions-item label="供电设备容量(MVA)">
|
||||||
{{ details.shortCapacity }}
|
|
||||||
</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="供电设备容量(MVA)">
|
|
||||||
{{ details.devCapacity }}
|
{{ details.devCapacity }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="用户协议容量(MVA)">
|
<el-descriptions-item label="最小短路容量(MW)">
|
||||||
|
{{ details.shortCapacity }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="用户协议容量(MW)">
|
||||||
{{ details.dealCapacity }}
|
{{ details.dealCapacity }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="监测点限值" name="tab2">
|
<el-tab-pane label="监测点限值" name="tab2">
|
||||||
<el-descriptions :column="3" border label-width="250px">
|
<el-descriptions :column="3" border label-width="250px">
|
||||||
<el-descriptions-item label="电压偏差上限值(%)">
|
<el-descriptions-item label="电压偏差上限值(%)">
|
||||||
{{ limitValue.voltageDev }}
|
{{ limitValue.voltageDev }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="电压偏差下限值(%)">
|
<el-descriptions-item label="电压偏差下限值(%)">
|
||||||
{{ limitValue.uvoltageDev }}
|
{{ limitValue.uvoltageDev }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="频率偏差限值(Hz)">
|
<el-descriptions-item label="频率偏差限值(Hz)">
|
||||||
{{ limitValue.freqDev }}
|
{{ limitValue.freqDev }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="三相电压不平衡度限值(%)">
|
<el-descriptions-item label="三相电压不平衡度限值(%)">
|
||||||
{{ limitValue.ubalance }}
|
{{ limitValue.ubalance }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="负序电流限值(A)">
|
<el-descriptions-item label="负序电流限值(A)">
|
||||||
{{ limitValue.ineg }}
|
{{ limitValue.ineg }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="长时闪变限值(%)">
|
<el-descriptions-item label="长时闪变限值(%)">
|
||||||
{{ limitValue.flicker }}
|
{{ limitValue.flicker }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="电压总畸变率限值(%)">
|
<el-descriptions-item label="电压总畸变率限值(%)">
|
||||||
{{ limitValue.uaberrance }}
|
{{ limitValue.uaberrance }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="奇次谐波电压含有率限值(%)">
|
<el-descriptions-item label="奇次谐波电压含有率限值(%)">
|
||||||
{{ limitValue.oddHarm }}
|
{{ limitValue.oddHarm }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="偶次谐波电压含有率限值(%)">
|
<el-descriptions-item label="偶次谐波电压含有率限值(%)">
|
||||||
{{ limitValue.evenHarm }}
|
{{ limitValue.evenHarm }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="3次谐波电流幅值限值(A)">
|
<el-descriptions-item label="3次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm3 }}
|
{{ limitValue.iharm3 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="4次谐波电流幅值限值(A)">
|
<el-descriptions-item label="4次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm4 }}
|
{{ limitValue.iharm4 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="5次谐波电流幅值限值(A)">
|
<el-descriptions-item label="5次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm5 }}
|
{{ limitValue.iharm5 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="6次谐波电流幅值限值(A)">
|
<el-descriptions-item label="6次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm6 }}
|
{{ limitValue.iharm6 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="7次谐波电流幅值限值(A)">
|
<el-descriptions-item label="7次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm7 }}
|
{{ limitValue.iharm7 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="8次谐波电流幅值限值(A)">
|
<el-descriptions-item label="8次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm8 }}
|
{{ limitValue.iharm8 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="9次谐波电流幅值限值(A)">
|
<el-descriptions-item label="9次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm9 }}
|
{{ limitValue.iharm9 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="10次谐波电流幅值限值(A)">
|
<el-descriptions-item label="10次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm10 }}
|
{{ limitValue.iharm10 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="11次谐波电流幅值限值(A)">
|
<el-descriptions-item label="11次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm11 }}
|
{{ limitValue.iharm11 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="12次谐波电流幅值限值(A)">
|
<el-descriptions-item label="12次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm12 }}
|
{{ limitValue.iharm12 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="13次谐波电流幅值限值(A)">
|
<el-descriptions-item label="13次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm13 }}
|
{{ limitValue.iharm13 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="14次谐波电流幅值限值(A)">
|
<el-descriptions-item label="14次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm14 }}
|
{{ limitValue.iharm14 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="15次谐波电流幅值限值(A)">
|
<el-descriptions-item label="15次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm15 }}
|
{{ limitValue.iharm15 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="16次谐波电流幅值限值(A)">
|
<el-descriptions-item label="16次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm16 }}
|
{{ limitValue.iharm16 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="17次谐波电流幅值限值(A)">
|
<el-descriptions-item label="17次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm17 }}
|
{{ limitValue.iharm17 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="18次谐波电流幅值限值(A)">
|
<el-descriptions-item label="18次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm18 }}
|
{{ limitValue.iharm18 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="19次谐波电流幅值限值(A)">
|
<el-descriptions-item label="19次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm19 }}
|
{{ limitValue.iharm19 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="20次谐波电流幅值限值(A)">
|
<el-descriptions-item label="20次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm20 }}
|
{{ limitValue.iharm20 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="21次谐波电流幅值限值(A)">
|
<el-descriptions-item label="21次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm21 }}
|
{{ limitValue.iharm21 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="22次谐波电流幅值限值(A)">
|
<el-descriptions-item label="22次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm22 }}
|
{{ limitValue.iharm22 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="23次谐波电流幅值限值(A)">
|
<el-descriptions-item label="23次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm23 }}
|
{{ limitValue.iharm23 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="24次谐波电流幅值限值(A)">
|
<el-descriptions-item label="24次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm24 }}
|
{{ limitValue.iharm24 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="25次谐波电流幅值限值(A)">
|
<el-descriptions-item label="25次谐波电流幅值限值(A)">
|
||||||
{{ limitValue.iharm25 }}
|
{{ limitValue.iharm25 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="0.5-1.5次间谐波电压含有率限值(%)">
|
<el-descriptions-item label="0.5-1.5次间谐波电压含有率限值(%)">
|
||||||
{{ limitValue.inUharm }}
|
{{ limitValue.inUharm }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="2.5-15.5次谐波电压含有率限值(%)">
|
<el-descriptions-item label="2.5-15.5次谐波电压含有率限值(%)">
|
||||||
{{ limitValue.inUharm16 }}
|
{{ limitValue.inUharm16 }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
@@ -174,11 +184,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, inject } from 'vue'
|
import { ref, inject } from 'vue'
|
||||||
import { getLineOverLimitData, getLineDetailData } from '@/api/device-boot/line'
|
import { getLineOverLimitData, getLineDetailData } from '@/api/device-boot/line'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const title = ref('')
|
const title = ref('')
|
||||||
const activeName = ref('tab1')
|
const activeName = ref('tab1')
|
||||||
const details: any = ref([])
|
const details: any = ref([])
|
||||||
|
const dictData = useDictData()
|
||||||
const limitValue: any = ref([])
|
const limitValue: any = ref([])
|
||||||
|
const typeArr = dictData.getBasicData('Dev_Type')
|
||||||
const open = (data: any) => {
|
const open = (data: any) => {
|
||||||
details.value = []
|
details.value = []
|
||||||
limitValue.value = []
|
limitValue.value = []
|
||||||
@@ -187,7 +200,7 @@ const open = (data: any) => {
|
|||||||
|
|
||||||
getLineDetailData(data.id).then(res => {
|
getLineDetailData(data.id).then(res => {
|
||||||
details.value = res.data
|
details.value = res.data
|
||||||
|
res.data.objName ? (title.value = res.data.objName + '_' + title.value) : ''
|
||||||
})
|
})
|
||||||
getLineOverLimitData(data.id).then(res => {
|
getLineOverLimitData(data.id).then(res => {
|
||||||
limitValue.value = res.data
|
limitValue.value = res.data
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<Icon
|
<Icon
|
||||||
@click="onMenuCollapse"
|
@click="onMenuCollapse"
|
||||||
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||||
@@ -147,7 +147,7 @@ const onMenuCollapse = () => {
|
|||||||
}
|
}
|
||||||
// 查看详情
|
// 查看详情
|
||||||
const viewDetails = (data: any) => {
|
const viewDetails = (data: any) => {
|
||||||
console.log('🚀 ~ viewDetails ~ data:', data)
|
// console.log('🚀 ~ viewDetails ~ data:', data)
|
||||||
if (data.level == 3) {
|
if (data.level == 3) {
|
||||||
// 变电站详情
|
// 变电站详情
|
||||||
// substationDetails
|
// substationDetails
|
||||||
@@ -201,7 +201,7 @@ onMounted(async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const scrollToNode = (id: string) => {
|
const scrollToNode = (id: string) => {
|
||||||
console.log("🚀 ~ scrollToNode ~ id:", id)
|
// console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||||
if (!treeRef.value) return
|
if (!treeRef.value) return
|
||||||
|
|
||||||
// 获取目标节点的元素
|
// 获取目标节点的元素
|
||||||
|
|||||||
@@ -28,66 +28,66 @@ const info = (id: any) => {
|
|||||||
expanded.value = [id]
|
expanded.value = [id]
|
||||||
getTerminalTree().then(res => {
|
getTerminalTree().then(res => {
|
||||||
// let arr: any[] = []
|
// let arr: any[] = []
|
||||||
if (VITE_FLAG) {
|
// if (VITE_FLAG) {
|
||||||
res.data.forEach((item: any) => {
|
// res.data.forEach((item: any) => {
|
||||||
item.icon = 'el-icon-Menu'
|
// item.icon = 'el-icon-Menu'
|
||||||
item.plevel = item.level
|
// item.plevel = item.level
|
||||||
item.level = 0
|
// item.level = 0
|
||||||
item.children.forEach((item2: any) => {
|
// item.children.forEach((item2: any) => {
|
||||||
item2.icon = 'el-icon-HomeFilled'
|
// item2.icon = 'el-icon-HomeFilled'
|
||||||
|
|
||||||
item2.plevel = item2.level
|
// item2.plevel = item2.level
|
||||||
item2.level = 100
|
// item2.level = 100
|
||||||
expanded.value.push(item2.id)
|
// expanded.value.push(item2.id)
|
||||||
item2.children.forEach((item3: any) => {
|
// item2.children.forEach((item3: any) => {
|
||||||
item3.icon = 'el-icon-CollectionTag'
|
// item3.icon = 'el-icon-CollectionTag'
|
||||||
item3.plevel = item3.level
|
// item3.plevel = item3.level
|
||||||
item3.level = 200
|
// item3.level = 200
|
||||||
item3.children.forEach((item4: any) => {
|
// item3.children.forEach((item4: any) => {
|
||||||
item4.icon = 'el-icon-Flag'
|
// item4.icon = 'el-icon-Flag'
|
||||||
item4.plevel = item4.level
|
// item4.plevel = item4.level
|
||||||
item4.level = 300
|
// item4.level = 300
|
||||||
// arr.push(item4)
|
// // arr.push(item4)
|
||||||
item4.children.forEach((item5: any) => {
|
// item4.children.forEach((item5: any) => {
|
||||||
item5.icon = 'el-icon-OfficeBuilding'
|
// item5.icon = 'el-icon-OfficeBuilding'
|
||||||
item5.plevel = item5.level
|
// item5.plevel = item5.level
|
||||||
item5.level = 300
|
// item5.level = 300
|
||||||
// item5.id = item4.id
|
// // item5.id = item4.id
|
||||||
item5.children.forEach((item6: any) => {
|
// item5.children.forEach((item6: any) => {
|
||||||
item6.icon = 'el-icon-HelpFilled'
|
// item6.icon = 'el-icon-HelpFilled'
|
||||||
item6.plevel = 4
|
// item6.plevel = 4
|
||||||
if (item6.name == '电网侧' && item6.children.length == 0) {
|
// if (item6.name == '电网侧' && item6.children.length == 0) {
|
||||||
item6.level = 400
|
// item6.level = 400
|
||||||
} else {
|
// } else {
|
||||||
item6.level = 400
|
// item6.level = 400
|
||||||
}
|
// }
|
||||||
item6.children.forEach((item7: any) => {
|
// item6.children.forEach((item7: any) => {
|
||||||
item7.icon = 'el-icon-Film'
|
// item7.icon = 'el-icon-Film'
|
||||||
item7.plevel = item7.level
|
// item7.plevel = item7.level
|
||||||
item7.level = 400
|
// item7.level = 400
|
||||||
item7.children.forEach((item8: any) => {
|
// item7.children.forEach((item8: any) => {
|
||||||
item8.icon = 'el-icon-Collection'
|
// item8.icon = 'el-icon-Collection'
|
||||||
item8.plevel = item8.level
|
// item8.plevel = item8.level
|
||||||
item8.level = 500
|
// item8.level = 500
|
||||||
item8.children.forEach((item9: any) => {
|
// item8.children.forEach((item9: any) => {
|
||||||
item9.icon = 'el-icon-Share'
|
// item9.icon = 'el-icon-Share'
|
||||||
item9.plevel = item9.level
|
// item9.plevel = item9.level
|
||||||
item9.level = 600
|
// item9.level = 600
|
||||||
item9.children.forEach((item10: any) => {
|
// item9.children.forEach((item10: any) => {
|
||||||
item10.icon = 'el-icon-Location'
|
// item10.icon = 'el-icon-Location'
|
||||||
item10.plevel = item10.level
|
// item10.plevel = item10.level
|
||||||
item10.level = 700
|
// item10.level = 700
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
})
|
// })
|
||||||
} else {
|
// } else {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
item.icon = 'el-icon-Menu'
|
item.icon = 'el-icon-Menu'
|
||||||
item.plevel = item.level
|
item.plevel = item.level
|
||||||
@@ -129,7 +129,7 @@ const info = (id: any) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
// }
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
|||||||
import Tree from '../index.vue'
|
import Tree from '../index.vue'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -35,7 +34,7 @@ const tree = ref()
|
|||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
|
|
||||||
const loadData = (id?: any) => {
|
const loadData = (id?: any) => {
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
// console.log('🚀 ~ loadData ~ id:', id)
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
queryAllAlgorithmLibrary().then(res => {
|
queryAllAlgorithmLibrary().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
|
|||||||
150
src/components/tree/pqs/areaTree.vue
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<div class="point-tree">
|
||||||
|
<div style="flex: 1; overflow: hidden">
|
||||||
|
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
|
import Tree from '../index.vue'
|
||||||
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
import { getAreaList } from '@/api/common'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
|
defineOptions({
|
||||||
|
name: 'pms/pointTree'
|
||||||
|
})
|
||||||
|
interface Props {
|
||||||
|
showSelect?: boolean
|
||||||
|
}
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
showSelect: true
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['init'])
|
||||||
|
const attrs = useAttrs()
|
||||||
|
const adminInfo = useAdminInfo()
|
||||||
|
const dictData = useDictData()
|
||||||
|
const config = useConfig()
|
||||||
|
const tree = ref()
|
||||||
|
const treeRef = ref()
|
||||||
|
|
||||||
|
const loadData = () => {
|
||||||
|
let nodeKey = ''
|
||||||
|
getAreaList().then(res => {
|
||||||
|
processTreeData(res.data, res.data[0].level)
|
||||||
|
let firstLevel6Node = getDeepestFirstChildData(res.data)
|
||||||
|
|
||||||
|
nodeKey = firstLevel6Node.id
|
||||||
|
emit('init', firstLevel6Node)
|
||||||
|
|
||||||
|
tree.value = res.data
|
||||||
|
if (nodeKey) {
|
||||||
|
nextTick(() => {
|
||||||
|
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||||
|
|
||||||
|
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const scrollToNode = (id: string) => {
|
||||||
|
// 树滚动
|
||||||
|
treeRef.value.scrollToNode(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归获取树形结构中一直向下的第一个children的最后一组有效数据
|
||||||
|
* @param {Array} treeData - 原始递归树形数据
|
||||||
|
* @returns {Object|null} 路径最后一组有效数据,无有效数据时返回null
|
||||||
|
*/
|
||||||
|
function getDeepestFirstChildData(treeData) {
|
||||||
|
// 递归辅助函数:逐层查找第一个children
|
||||||
|
function findDeepestNode(currentNode) {
|
||||||
|
// 检查当前节点是否有有效的children数组
|
||||||
|
if (currentNode && Array.isArray(currentNode.children) && currentNode.children.length > 0) {
|
||||||
|
// 有下一级children,继续递归查找下一级第一个元素
|
||||||
|
return findDeepestNode(currentNode.children[0])
|
||||||
|
}
|
||||||
|
// 没有下一级children,返回当前节点(递归终止)
|
||||||
|
return currentNode
|
||||||
|
}
|
||||||
|
|
||||||
|
// 边界处理:原始数据非数组/空数组时返回null
|
||||||
|
if (!Array.isArray(treeData) || treeData.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从根节点第一个元素开始递归查找
|
||||||
|
return findDeepestNode(treeData[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
|
loadData()
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,7 +11,6 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
|||||||
import Tree from '../index.vue'
|
import Tree from '../index.vue'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
import { getTree } from '@/api/advance-boot/assess'
|
import { getTree } from '@/api/advance-boot/assess'
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ const adminInfo = useAdminInfo()
|
|||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const config = useConfig()
|
const config = useConfig()
|
||||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
const tree = ref()
|
const tree = ref()
|
||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -54,6 +55,9 @@ const loadData = () => {
|
|||||||
}) || { code: '' }
|
}) || { code: '' }
|
||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
|
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||||
|
form.statisticalType.deptName = 'qujing'
|
||||||
|
}
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -67,56 +71,62 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
nodeKey = firstLevel6Node.id
|
||||||
emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
emit('init', firstLevel6Node)
|
||||||
|
// res.data.forEach((item: any) => {
|
||||||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
||||||
|
// emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
@@ -127,9 +137,113 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const setKey = (key: string) => {
|
const setKey = (key: string) => {
|
||||||
treeRef.value.treeRef.setCurrentKey(key)
|
treeRef.value.treeRef.setCurrentKey(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1) {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ setKey })
|
defineExpose({ setKey })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
/>
|
/>
|
||||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||||
<div style="display: flex; align-items: center" class="mb10">
|
<div style="display: flex; align-items: center" class="mb10">
|
||||||
<el-input v-model="filterText" placeholder="请输入内容" clearable>
|
<el-input v-model="filterText" placeholder="请输入内容" maxlength="10" show-word-limit clearable>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { useDictData } from '@/stores/dictData'
|
|||||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { defineProps } from 'vue'
|
import { defineProps } from 'vue'
|
||||||
|
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'pms/pointTree'
|
name: 'pms/pointTree'
|
||||||
})
|
})
|
||||||
@@ -61,6 +62,9 @@ const loadData = () => {
|
|||||||
}) || { code: '' }
|
}) || { code: '' }
|
||||||
let form = JSON.parse(JSON.stringify(formData.value))
|
let form = JSON.parse(JSON.stringify(formData.value))
|
||||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||||
|
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||||
|
form.statisticalType.deptName = 'qujing'
|
||||||
|
}
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
getTerminalTreeForFive(form).then(res => {
|
getTerminalTreeForFive(form).then(res => {
|
||||||
//console.log('---',res)
|
//console.log('---',res)
|
||||||
@@ -74,62 +78,71 @@ const loadData = () => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
res.data.forEach((item: any) => {
|
// if (VITE_FLAG) {
|
||||||
item.icon = 'el-icon-HomeFilled'
|
processTreeData(res.data)
|
||||||
item.color = config.getColorVal('elementUiPrimary')
|
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||||
item.children.forEach((item2: any) => {
|
|
||||||
item2.icon = 'el-icon-CollectionTag'
|
|
||||||
item2.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item2.children.forEach((item3: any) => {
|
|
||||||
item3.icon = 'el-icon-Flag'
|
|
||||||
item3.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item3.children.forEach((item4: any) => {
|
|
||||||
item4.icon = 'el-icon-OfficeBuilding'
|
|
||||||
item4.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item4.children.forEach((item5: anyObj) => {
|
|
||||||
if (item5.level == 7) {
|
|
||||||
item5.icon = 'el-icon-DataAnalysis'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
item5.children.forEach((item6: anyObj) => {
|
|
||||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
|
||||||
item6.pid = item4.id
|
|
||||||
item6.icon = 'fa-solid fa-location-dot'
|
|
||||||
item6.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item6.comFlag == 0) {
|
|
||||||
item6.color = 'red !important'
|
|
||||||
} else if (item6.comFlag == 1) {
|
|
||||||
item6.color = '#00f93b !important'
|
|
||||||
} else if (item6.comFlag == 2) {
|
|
||||||
item6.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
|
||||||
item5.pid = item4.id
|
|
||||||
item5.icon = 'fa-solid fa-location-dot'
|
|
||||||
item5.color = config.getColorVal('elementUiPrimary')
|
|
||||||
if (item5.comFlag == 0) {
|
|
||||||
item5.color = 'red !important'
|
|
||||||
} else if (item5.comFlag == 1) {
|
|
||||||
item5.color = '#00f93b !important'
|
|
||||||
} else if (item5.comFlag == 2) {
|
|
||||||
item5.color = '#8c8c8c !important'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
nodeKey =
|
nodeKey = firstLevel6Node.id
|
||||||
res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
emit('init', firstLevel6Node)
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.id
|
// } else {
|
||||||
emit(
|
// // 正常树处理
|
||||||
'init',
|
// res.data.forEach((item: any) => {
|
||||||
res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
// item.icon = 'el-icon-HomeFilled'
|
||||||
res.data[0].children[0].children[0].children[0].children[0]
|
// item.color = config.getColorVal('elementUiPrimary')
|
||||||
)
|
// item.children.forEach((item2: any) => {
|
||||||
|
// item2.icon = 'el-icon-CollectionTag'
|
||||||
|
// item2.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item2.children.forEach((item3: any) => {
|
||||||
|
// item3.icon = 'el-icon-Flag'
|
||||||
|
// item3.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item3.children.forEach((item4: any) => {
|
||||||
|
// item4.icon = 'el-icon-OfficeBuilding'
|
||||||
|
// item4.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item4.children.forEach((item5: anyObj) => {
|
||||||
|
// if (item5.level == 7) {
|
||||||
|
// item5.icon = 'el-icon-DataAnalysis'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// item5.children.forEach((item6: anyObj) => {
|
||||||
|
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||||
|
// item6.pid = item4.id
|
||||||
|
// item6.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item6.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item6.comFlag == 0) {
|
||||||
|
// item6.color = 'red !important'
|
||||||
|
// } else if (item6.comFlag == 1) {
|
||||||
|
// item6.color = '#00f93b !important'
|
||||||
|
// } else if (item6.comFlag == 2) {
|
||||||
|
// item6.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||||
|
// item5.pid = item4.id
|
||||||
|
// item5.icon = 'fa-solid fa-location-dot'
|
||||||
|
// item5.color = config.getColorVal('elementUiPrimary')
|
||||||
|
// if (item5.comFlag == 0) {
|
||||||
|
// item5.color = 'red !important'
|
||||||
|
// } else if (item5.comFlag == 1) {
|
||||||
|
// item5.color = '#00f93b !important'
|
||||||
|
// } else if (item5.comFlag == 2) {
|
||||||
|
// item5.color = '#8c8c8c !important'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
// nodeKey =
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.id
|
||||||
|
// emit(
|
||||||
|
// 'init',
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
||||||
|
// res.data[0].children[0].children[0].children[0].children[0]
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
tree.value = res.data
|
tree.value = res.data
|
||||||
if (nodeKey) {
|
if (nodeKey) {
|
||||||
@@ -145,6 +158,109 @@ const scrollToNode = (id: string) => {
|
|||||||
// 树滚动
|
// 树滚动
|
||||||
treeRef.value.scrollToNode(id)
|
treeRef.value.scrollToNode(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||||
|
const levelIconMap = {
|
||||||
|
'-1': 'el-icon-HomeFilled',
|
||||||
|
0: 'el-icon-CollectionTag',
|
||||||
|
1: 'el-icon-CollectionTag',
|
||||||
|
2: 'el-icon-Flag',
|
||||||
|
3: 'el-icon-OfficeBuilding',
|
||||||
|
4: 'el-icon-DataAnalysis',
|
||||||
|
5: 'el-icon-DataAnalysis',
|
||||||
|
7: 'el-icon-DataAnalysis',
|
||||||
|
6: 'fa-solid fa-location-dot'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||||
|
* @param data 树形数据数组
|
||||||
|
* @param level 当前层级(默认从1开始)
|
||||||
|
*/
|
||||||
|
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||||
|
// 空值判断,避免数组为空或undefined时报错
|
||||||
|
if (!Array.isArray(data) || data.length === 0) return
|
||||||
|
|
||||||
|
data.forEach(item => {
|
||||||
|
// 1. 设置基础图标(根据层级匹配)
|
||||||
|
item.icon = levelIconMap[level] || ''
|
||||||
|
item.alias = alias + `${item.name}`
|
||||||
|
// 2. 设置基础颜色
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
|
||||||
|
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||||
|
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||||
|
switch (item.comFlag) {
|
||||||
|
case 0:
|
||||||
|
item.color = 'red !important'
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
item.color = '#00f93b !important'
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
item.color = '#8c8c8c !important'
|
||||||
|
break
|
||||||
|
// 默认值:保持原有基础颜色
|
||||||
|
default:
|
||||||
|
item.color = config.getColorVal('elementUiPrimary')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 递归处理子节点,层级+1
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||||
|
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||||
|
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||||
|
*/
|
||||||
|
function findFirstLevel6Node(tree: any) {
|
||||||
|
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||||
|
if (Array.isArray(tree)) {
|
||||||
|
for (const rootNode of tree) {
|
||||||
|
const result = traverse(rootNode)
|
||||||
|
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||||
|
if (result) return result
|
||||||
|
}
|
||||||
|
// 所有根节点遍历完未找到
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
// 入参是单个节点,直接递归遍历
|
||||||
|
return traverse(tree)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核心递归遍历函数
|
||||||
|
function traverse(node) {
|
||||||
|
// 终止条件1:节点不存在,返回null
|
||||||
|
if (!node) return null
|
||||||
|
|
||||||
|
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||||
|
if (node.level === 6) {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
|
||||||
|
// 终止条件3:节点无children,返回null
|
||||||
|
if (!node.children || node.children.length === 0) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 按顺序遍历当前节点的子节点
|
||||||
|
for (const child of node.children) {
|
||||||
|
const foundNode = traverse(child)
|
||||||
|
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||||
|
if (foundNode) {
|
||||||
|
return foundNode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前节点及所有子节点都无匹配,返回null
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ treeRef, scrollToNode, tree })
|
defineExpose({ treeRef, scrollToNode, tree })
|
||||||
loadData()
|
loadData()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const tree = ref()
|
|||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
|
|
||||||
const loadData = (id?: any) => {
|
const loadData = (id?: any) => {
|
||||||
console.log('🚀 ~ loadData ~ id:', id)
|
|
||||||
let nodeKey = ''
|
let nodeKey = ''
|
||||||
queryAll().then(res => {
|
queryAll().then(res => {
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
|
|||||||
@@ -11,25 +11,25 @@
|
|||||||
:data="eventList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
:data="eventList.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
|
||||||
>
|
>
|
||||||
<!-- <vxe-column type="seq" width="70px" title="序号"></vxe-column> -->
|
<!-- <vxe-column type="seq" width="70px" title="序号"></vxe-column> -->
|
||||||
<vxe-column field="time" width="180px" sortable title="发生时刻"></vxe-column>
|
<vxe-column field="time" width="180px" sortable title="暂降发生时刻"></vxe-column>
|
||||||
<vxe-column field="lineName" title="监测点"></vxe-column>
|
|
||||||
<vxe-column field="powerCompany" title="变电站" width="100px"></vxe-column>
|
|
||||||
<vxe-column field="powerCompany" title="供电公司" width="100px"></vxe-column>
|
|
||||||
<vxe-column field="persistTime" width="120px" sortable title="持续时间(s)">
|
|
||||||
<template #default="{ row }">
|
|
||||||
{{ Math.floor(row.persistTime * 1000) / 1000 }}
|
|
||||||
</template>
|
|
||||||
</vxe-column>
|
|
||||||
<vxe-column field="eventValue" width="160px" sortable title="暂降(骤升)幅值(%)">
|
<vxe-column field="eventValue" width="160px" sortable title="暂降(骤升)幅值(%)">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
<vxe-column field="eventType" width="100px" title="暂降类型">
|
<vxe-column field="persistTime" width="120px" sortable title="持续时间(s)">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ Math.floor(row.persistTime * 1000) / 1000 }}
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="eventType" width="100px" title="触发类型">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
||||||
</template>
|
</template>
|
||||||
</vxe-column>
|
</vxe-column>
|
||||||
|
<vxe-column field="powerCompany" title="变电站" width="100px"></vxe-column>
|
||||||
|
<vxe-column field="powerCompany" title="供电公司" width="100px"></vxe-column>
|
||||||
|
<vxe-column field="lineName" title="监测点"></vxe-column>
|
||||||
</vxe-table>
|
</vxe-table>
|
||||||
<div class="table-pagination mt10">
|
<div class="table-pagination mt10">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@@ -50,7 +50,8 @@ import { ref, reactive, onMounted } from 'vue'
|
|||||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
import { useDictData } from '@/stores/dictData'
|
import { useDictData } from '@/stores/dictData'
|
||||||
import MQTT from '@/utils/mqtt'
|
// import MQTT from '@/utils/mqtt'
|
||||||
|
import socketClient from '@/utils/webSocketClient'
|
||||||
const dictData = useDictData()
|
const dictData = useDictData()
|
||||||
const event = dictData.getBasicData('Event_Statis')
|
const event = dictData.getBasicData('Event_Statis')
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
@@ -68,37 +69,71 @@ const handleClose = (done: any) => {
|
|||||||
drawer.value = false
|
drawer.value = false
|
||||||
done()
|
done()
|
||||||
}
|
}
|
||||||
const init = async () => {
|
const dataSocket = reactive({
|
||||||
const mqttClient = new MQTT('/sendEvent')
|
socketServe: socketClient.Instance
|
||||||
// 设置消息接收回调
|
})
|
||||||
try {
|
// const init = async () => {
|
||||||
await mqttClient.init()
|
// const mqttClient = new MQTT('/sendEvent')
|
||||||
|
// // 设置消息接收回调
|
||||||
|
// try {
|
||||||
|
// await mqttClient.init()
|
||||||
|
|
||||||
// 订阅主题
|
// // 订阅主题
|
||||||
await mqttClient.subscribe()
|
// await mqttClient.subscribe()
|
||||||
// 设置消息接收回调
|
// // 设置消息接收回调
|
||||||
mqttClient.onMessage((topic, message) => {
|
// mqttClient.onMessage((topic, message) => {
|
||||||
const msg = JSON.parse(message.toString())
|
// const msg = JSON.parse(message.toString())
|
||||||
console.log('🚀 ~ init ~ msg:', msg)
|
// // console.log('🚀 ~ init ~ msg:', msg)
|
||||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
// if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||||
drawer.value = true
|
// drawer.value = true
|
||||||
isLoading.value = true
|
// isLoading.value = true
|
||||||
eventList.value.unshift(msg)
|
// eventList.value.unshift(msg)
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
isLoading.value = false
|
// isLoading.value = false
|
||||||
}, 500)
|
// }, 500)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
console.error('MQTT 初始化失败:', error)
|
// // console.error('MQTT 初始化失败:', error)
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
const socket = async () => {
|
||||||
|
const url = localStorage.getItem('WebSocketUrl3') || 'null' //'ws://192.168.2.130:10203/event/'
|
||||||
|
|
||||||
|
// const url = 'ws://192.168.1.68:10203/event/'
|
||||||
|
|
||||||
|
await dataSocket.socketServe.connect(`${url}${adminInfo.id}`)
|
||||||
|
|
||||||
|
await dataSocket.socketServe.registerCallBack('message', (res: any) => {
|
||||||
|
if (res.deptList.includes(adminInfo.$state.deptId)) {
|
||||||
|
drawer.value = true
|
||||||
|
isLoading.value = true
|
||||||
|
eventList.value.unshift(res)
|
||||||
|
setTimeout(() => {
|
||||||
|
isLoading.value = false
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
// logList.value.push({
|
||||||
|
// type: res.code == 500 ? 'error' : '',
|
||||||
|
// time: formatDate(new Date(), 'YYYY-MM-DD hh:mm:ss'),
|
||||||
|
// name: res.message
|
||||||
|
// })
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
dataSocket.socketServe?.closeWs()
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// startMqtt('/sendEvent', (topic, message) => {
|
// startMqtt('/sendEvent', (topic, message) => {
|
||||||
// const msg = JSON.parse(message.toString())
|
// const msg = JSON.parse(message.toString())
|
||||||
// console.log(msg)
|
// console.log(msg)
|
||||||
// })
|
// })
|
||||||
init()
|
|
||||||
|
setTimeout(() => {
|
||||||
|
socket()
|
||||||
|
}, 3000)
|
||||||
})
|
})
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -8,41 +8,14 @@
|
|||||||
name="el-icon-BellFilled"
|
name="el-icon-BellFilled"
|
||||||
size="18"
|
size="18"
|
||||||
/>
|
/>
|
||||||
<span class="nav-menu-text" v-if="globalPopUpRef?.eventList.length != 0">
|
<span class="nav-menu-text" v-if="globalPopUpRef?.eventList?.length > 0">
|
||||||
{{ (globalPopUpRef?.eventList.length>99? '99+':globalPopUpRef?.eventList.length) || 0 }}
|
{{ globalPopUpRef.eventList.length > 99 ? '99+' : globalPopUpRef.eventList.length }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- <el-tooltip effect="dark" content="截图" placement="bottom">
|
|
||||||
<div @click="savePng" class="nav-menu-item">
|
|
||||||
<Icon
|
|
||||||
:color="configStore.getColorVal('headerBarTabColor')"
|
|
||||||
class="nav-menu-icon"
|
|
||||||
name="el-icon-Camera"
|
|
||||||
size="18"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-tooltip effect="dark" :content="state.isFullScreen ? '缩小' : '放大'" placement="bottom">
|
|
||||||
<div @click="onFullScreen" class="nav-menu-item" :class="state.isFullScreen ? 'hover' : ''">
|
|
||||||
<Icon
|
|
||||||
:color="configStore.getColorVal('headerBarTabColor')"
|
|
||||||
class="nav-menu-icon"
|
|
||||||
v-if="state.isFullScreen"
|
|
||||||
name="fa-solid fa-compress"
|
|
||||||
size="18"
|
|
||||||
/>
|
|
||||||
<Icon
|
|
||||||
:color="configStore.getColorVal('headerBarTabColor')"
|
|
||||||
class="nav-menu-icon"
|
|
||||||
v-else
|
|
||||||
name="fa-solid fa-expand"
|
|
||||||
size="18"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-tooltip> -->
|
|
||||||
<el-dropdown style="height: 100%" @command="handleCommand">
|
<el-dropdown style="height: 100%" @command="handleCommand">
|
||||||
<div class="admin-info" :class="state.currentNavMenu == 'adminInfo' ? 'hover' : ''">
|
<div class="admin-info" :class="state.currentNavMenu === 'adminInfo' ? 'hover' : ''">
|
||||||
<el-avatar :size="25" fit="fill">
|
<el-avatar :size="25" fit="fill">
|
||||||
<img src="@/assets/avatar.png" alt="" />
|
<img src="@/assets/avatar.png" alt="" />
|
||||||
</el-avatar>
|
</el-avatar>
|
||||||
@@ -51,98 +24,115 @@
|
|||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item command="adminInfo">个人资料</el-dropdown-item>
|
<el-dropdown-item command="adminInfo">个人资料</el-dropdown-item>
|
||||||
<el-dropdown-item command="changePwd">修改密码</el-dropdown-item>
|
<el-dropdown-item command="changePwd" v-if="!IS_LNQR">修改密码</el-dropdown-item>
|
||||||
<el-dropdown-item command="layout">退出登录</el-dropdown-item>
|
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<!-- <div @click="configStore.setLayout('showDrawer', true)" class="nav-menu-item">
|
|
||||||
<Icon
|
|
||||||
:color="configStore.getColorVal('headerBarTabColor')"
|
|
||||||
class="nav-menu-icon"
|
|
||||||
name="fa fa-cogs"
|
|
||||||
size="18"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
<Config />
|
<Config />
|
||||||
<PopupPwd ref="popupPwd" />
|
<PopupPwd ref="popupPwd" />
|
||||||
<AdminInfo ref="popupAdminInfo" />
|
<AdminInfo ref="popupAdminInfo" />
|
||||||
<!-- <TerminalVue /> -->
|
|
||||||
<!-- 全局暂降事件 -->
|
|
||||||
<globalPopUp ref="globalPopUpRef" />
|
<globalPopUp ref="globalPopUpRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import screenfull from 'screenfull'
|
|
||||||
import { useConfig } from '@/stores/config'
|
import { useConfig } from '@/stores/config'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import Config from './config.vue'
|
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import router from '@/router'
|
import { useNavTabs } from '@/stores/navTabs'
|
||||||
import globalPopUp from './globalPopUp.vue'
|
import { logout } from '@/api/user-boot/user'
|
||||||
import { routePush } from '@/utils/router'
|
import Config from './config.vue'
|
||||||
import html2canvas from 'html2canvas'
|
|
||||||
import PopupPwd from './popup/password.vue'
|
import PopupPwd from './popup/password.vue'
|
||||||
import AdminInfo from './popup/adminInfo.vue'
|
import AdminInfo from './popup/adminInfo.vue'
|
||||||
import { useNavTabs } from '@/stores/navTabs'
|
import globalPopUp from './globalPopUp.vue'
|
||||||
|
const { replace } = useRouter()
|
||||||
|
// 环境标识
|
||||||
|
const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr'
|
||||||
|
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const navTabs = useNavTabs()
|
const navTabs = useNavTabs()
|
||||||
const configStore = useConfig()
|
const configStore = useConfig()
|
||||||
|
|
||||||
|
// 引用
|
||||||
const popupPwd = ref()
|
const popupPwd = ref()
|
||||||
const popupAdminInfo = ref()
|
const popupAdminInfo = ref()
|
||||||
const state = reactive({
|
|
||||||
isFullScreen: false,
|
|
||||||
currentNavMenu: '',
|
|
||||||
showLayoutDrawer: false,
|
|
||||||
showAdminInfoPopover: false
|
|
||||||
})
|
|
||||||
const globalPopUpRef = ref()
|
const globalPopUpRef = ref()
|
||||||
const savePng = () => {
|
|
||||||
html2canvas(document.body, {
|
// 状态
|
||||||
scale: 1,
|
const state = reactive({
|
||||||
useCORS: true
|
currentNavMenu: ''
|
||||||
}).then(function (canvas) {
|
})
|
||||||
var link = document.createElement('a')
|
|
||||||
link.href = canvas.toDataURL('image/png')
|
// 打开暂降事件
|
||||||
link.download = 'screenshot.png'
|
const temporaryLandingEvent = () => {
|
||||||
link.click()
|
if (globalPopUpRef.value) {
|
||||||
})
|
globalPopUpRef.value.open()
|
||||||
}
|
|
||||||
const onFullScreen = () => {
|
|
||||||
if (!screenfull.isEnabled) {
|
|
||||||
ElMessage.warning('layouts.Full screen is not supported')
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
screenfull.toggle()
|
|
||||||
screenfull.onchange(() => {
|
|
||||||
state.isFullScreen = screenfull.isFullscreen
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCommand = (key: string) => {
|
// 下拉菜单命令
|
||||||
console.log(key)
|
const handleCommand = async (key: string) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'adminInfo':
|
case 'adminInfo':
|
||||||
popupAdminInfo.value.open()
|
popupAdminInfo.value?.open()
|
||||||
break
|
break
|
||||||
case 'changePwd':
|
case 'changePwd':
|
||||||
popupPwd.value.open()
|
popupPwd.value?.open()
|
||||||
break
|
break
|
||||||
case 'layout':
|
case 'logout':
|
||||||
navTabs.closeTabs()
|
await handleLogout()
|
||||||
window.localStorage.clear()
|
|
||||||
adminInfo.reset()
|
|
||||||
router.push({ name: 'login' })
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const temporaryLandingEvent = () => {
|
|
||||||
globalPopUpRef.value.open()
|
// 统一登出逻辑
|
||||||
|
const handleLogout = async () => {
|
||||||
|
try {
|
||||||
|
// 1. 调用后端登出接口
|
||||||
|
await logout()
|
||||||
|
// console.log('✅ 后端登出成功')
|
||||||
|
} catch (err) {
|
||||||
|
// console.error('❌ 登出接口异常', err)
|
||||||
|
} finally {
|
||||||
|
// 2. 清理本地所有数据
|
||||||
|
clearLocalData()
|
||||||
|
|
||||||
|
// 3. LNqr 环境跳 CAS 登出
|
||||||
|
if (IS_LNQR) {
|
||||||
|
redirectToCasLogout()
|
||||||
|
} else {
|
||||||
|
// 普通环境直接跳登录页
|
||||||
|
replace('/login')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理本地数据
|
||||||
|
const clearLocalData = () => {
|
||||||
|
// 清空 localStorage
|
||||||
|
window.localStorage.clear()
|
||||||
|
|
||||||
|
// 清空用户状态
|
||||||
|
adminInfo.reset()
|
||||||
|
|
||||||
|
// 清空标签页
|
||||||
|
navTabs.closeTabs()
|
||||||
|
|
||||||
|
console.log('✅ 本地数据已全部清空')
|
||||||
|
}
|
||||||
|
|
||||||
|
// CAS 登出跳转
|
||||||
|
const redirectToCasLogout = () => {
|
||||||
|
const casLogoutUrl =
|
||||||
|
'http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/logout?service=http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/login?service=http://PQMonitoring.dcloud.ln.dc.sgcc.com.cn'
|
||||||
|
window.location.href = casLogoutUrl
|
||||||
|
// 清 Cookie
|
||||||
|
document.cookie.split(';').forEach(cookie => {
|
||||||
|
const name = cookie.split('=')[0].trim()
|
||||||
|
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -156,7 +146,6 @@ const temporaryLandingEvent = () => {
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// height: 100%;
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
background-color: v-bind('configStore.getColorVal("headerBarBackground")');
|
background-color: v-bind('configStore.getColorVal("headerBarBackground")');
|
||||||
|
|
||||||
@@ -212,37 +201,15 @@ const temporaryLandingEvent = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu-box :deep(.el-dropdown-menu__item) {
|
.nav-menu-text {
|
||||||
justify-content: center;
|
position: absolute;
|
||||||
}
|
top: 13px;
|
||||||
|
left: 20px;
|
||||||
.admin-info-base {
|
font-size: 12px;
|
||||||
display: flex;
|
background: #ff0000;
|
||||||
justify-content: center;
|
color: #fff;
|
||||||
flex-wrap: wrap;
|
border-radius: 5px;
|
||||||
padding-top: 10px;
|
padding: 0 3px;
|
||||||
|
|
||||||
.admin-info-other {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
padding: 10px 0;
|
|
||||||
|
|
||||||
.admin-info-name {
|
|
||||||
font-size: var(--el-font-size-large);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.admin-info-footer {
|
|
||||||
padding: 10px 0;
|
|
||||||
margin: 0 -12px -12px -12px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pt2 {
|
|
||||||
padding-top: 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes twinkle {
|
@keyframes twinkle {
|
||||||
@@ -256,15 +223,4 @@ const temporaryLandingEvent = () => {
|
|||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.nav-menu-text {
|
|
||||||
position: absolute;
|
|
||||||
top: 13px;
|
|
||||||
left: 20px;
|
|
||||||
font-size: 12px;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: #ff0000;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 0 3px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,109 +1,117 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||||
<el-form-item label="校验密码:" prop="password">
|
<el-form-item label="校验密码:" prop="password">
|
||||||
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
||||||
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
||||||
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submit">确认</el-button>
|
<el-button type="primary" @click="submit">确认</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, inject } from 'vue'
|
import { ref, inject } from 'vue'
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||||
import { validatePwd } from '@/utils/common'
|
import { validatePwd } from '@/utils/common'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
|
import router from '@/router'
|
||||||
const adminInfo = useAdminInfo()
|
import { useNavTabs } from '@/stores/navTabs'
|
||||||
const dialogVisible = ref(false)
|
const navTabs = useNavTabs()
|
||||||
const title = ref('修改密码')
|
const adminInfo = useAdminInfo()
|
||||||
const formRef = ref()
|
const dialogVisible = ref(false)
|
||||||
// 注意不要和表单ref的命名冲突
|
const title = ref('修改密码')
|
||||||
const form = reactive({
|
const formRef = ref()
|
||||||
password: '',
|
// 注意不要和表单ref的命名冲突
|
||||||
newPwd: '',
|
const form = reactive({
|
||||||
confirmPwd: ''
|
password: '',
|
||||||
})
|
newPwd: '',
|
||||||
const rules = {
|
confirmPwd: ''
|
||||||
password: [
|
})
|
||||||
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
const rules = {
|
||||||
{
|
password: [
|
||||||
min: 6,
|
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
}
|
message: '长度在 6 到 12 个字符',
|
||||||
],
|
trigger: 'blur'
|
||||||
newPwd: [
|
}
|
||||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
],
|
||||||
{
|
newPwd: [
|
||||||
min: 6,
|
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
},
|
message: '长度在 6 到 12 个字符',
|
||||||
{ validator: validatePwd, trigger: 'blur' }
|
trigger: 'blur'
|
||||||
],
|
},
|
||||||
confirmPwd: [
|
{ validator: validatePwd, trigger: 'blur' }
|
||||||
{ required: true, message: '请确认密码', trigger: 'blur' },
|
],
|
||||||
{
|
confirmPwd: [
|
||||||
min: 6,
|
{ required: true, message: '请确认密码', trigger: 'blur' },
|
||||||
max: 12,
|
{
|
||||||
message: '长度在 6 到 12 个字符',
|
min: 6,
|
||||||
trigger: 'blur'
|
max: 12,
|
||||||
},
|
message: '长度在 6 到 12 个字符',
|
||||||
{
|
trigger: 'blur'
|
||||||
validator: (rule: any, value: string, callback: any) => {
|
},
|
||||||
if (value === '') {
|
{
|
||||||
callback(new Error('请再次输入密码'))
|
validator: (rule: any, value: string, callback: any) => {
|
||||||
} else if (value !== form.newPwd) {
|
if (value === '') {
|
||||||
callback(new Error('两次输入密码不一致!'))
|
callback(new Error('请再次输入密码'))
|
||||||
} else {
|
} else if (value !== form.newPwd) {
|
||||||
callback()
|
callback(new Error('两次输入密码不一致!'))
|
||||||
}
|
} else {
|
||||||
},
|
callback()
|
||||||
trigger: 'blur',
|
}
|
||||||
required: true
|
},
|
||||||
}
|
trigger: 'blur',
|
||||||
]
|
required: true
|
||||||
}
|
}
|
||||||
|
]
|
||||||
const open = () => {
|
}
|
||||||
dialogVisible.value = true
|
|
||||||
form.password = ''
|
const open = () => {
|
||||||
form.newPwd = ''
|
dialogVisible.value = true
|
||||||
form.confirmPwd = ''
|
form.password = ''
|
||||||
}
|
form.newPwd = ''
|
||||||
const submit = () => {
|
form.confirmPwd = ''
|
||||||
formRef.value.validate(async (valid: boolean) => {
|
}
|
||||||
if (valid) {
|
const submit = () => {
|
||||||
passwordConfirm(form.password).then(res => {
|
formRef.value.validate(async (valid: boolean) => {
|
||||||
updatePassword({
|
if (valid) {
|
||||||
id: adminInfo.$state.userIndex,
|
passwordConfirm(form.password).then(res => {
|
||||||
newPassword: form.newPwd
|
updatePassword({
|
||||||
}).then((res: any) => {
|
id: adminInfo.$state.userIndex,
|
||||||
ElMessage.success('密码修改成功')
|
newPassword: form.newPwd
|
||||||
dialogVisible.value = false
|
}).then((res: any) => {
|
||||||
})
|
ElMessage.success('密码修改成功,请重新登录!')
|
||||||
})
|
dialogVisible.value = false
|
||||||
}
|
setTimeout(() => {
|
||||||
})
|
navTabs.closeTabs()
|
||||||
}
|
window.localStorage.clear()
|
||||||
|
adminInfo.reset()
|
||||||
defineExpose({ open })
|
router.push({ name: 'login' })
|
||||||
</script>
|
}, 0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ open })
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const emit = defineEmits(['update:modelValue'])
|
|||||||
const dialogVisible = computed({
|
const dialogVisible = computed({
|
||||||
get: () => props.modelValue,
|
get: () => props.modelValue,
|
||||||
set: (val) => {
|
set: (val) => {
|
||||||
console.log('set: ', val)
|
|
||||||
emit('update:modelValue', val)
|
emit('update:modelValue', val)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import router from './router'
|
|||||||
import pinia from '@/stores/index'
|
import pinia from '@/stores/index'
|
||||||
import { registerIcons } from '@/utils/common'
|
import { registerIcons } from '@/utils/common'
|
||||||
import mitt from 'mitt'
|
import mitt from 'mitt'
|
||||||
|
import VxeUI from 'vxe-pc-ui'
|
||||||
import VXETable from 'vxe-table'
|
import VXETable from 'vxe-table'
|
||||||
import XEUtils from 'xe-utils'
|
import XEUtils from 'xe-utils'
|
||||||
|
import 'vxe-pc-ui/lib/style.css'
|
||||||
import 'vxe-table/lib/style.css'
|
import 'vxe-table/lib/style.css'
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
import 'element-plus/dist/index.css'
|
import 'element-plus/dist/index.css'
|
||||||
@@ -61,6 +63,7 @@ const setupAll = async () => {
|
|||||||
await setupI18n(app)
|
await setupI18n(app)
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.use(pinia)
|
app.use(pinia)
|
||||||
|
app.use(VxeUI)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus)
|
||||||
app.use(VXETable)
|
app.use(VXETable)
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +1,22 @@
|
|||||||
import type { App } from 'vue'
|
import type { App } from 'vue'
|
||||||
// 👇使用 form-create 需额外全局引入 element plus 组件
|
import FcDesigner from '@form-create/designer'
|
||||||
import {
|
import formCreate from '@form-create/element-ui'
|
||||||
ElAlert,
|
import install from '@form-create/element-ui/auto-import'
|
||||||
ElAside,
|
//======================= 自定义组件 =======================
|
||||||
ElContainer,
|
import { UploadFile, UploadImg, UploadImgs } from '@/components/UploadFile'
|
||||||
ElDivider,
|
import { DictSelect } from '@/components/DictSelect'
|
||||||
ElHeader,
|
import UserSelect from '@/views/system/auth/userList/UserSelect.vue'
|
||||||
ElMain,
|
import { Editor } from '@/components/Editor'
|
||||||
ElPopconfirm,
|
|
||||||
ElTable,
|
// Element Plus 已在 main.ts 通过 app.use(ElementPlus) 全局注册,此处仅注册 form-create 自定义组件
|
||||||
ElTableColumn,
|
const components = [UploadImg, UploadImgs, UploadFile, DictSelect, UserSelect, Editor]
|
||||||
ElTabPane,
|
|
||||||
ElTabs,
|
// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
|
||||||
ElTransfer
|
export const setupFormCreate = (app: App<Element>) => {
|
||||||
} from 'element-plus'
|
components.forEach((component) => {
|
||||||
import FcDesigner from '@form-create/designer'
|
app.component(component.name!, component)
|
||||||
import formCreate from '@form-create/element-ui'
|
})
|
||||||
import install from '@form-create/element-ui/auto-import'
|
formCreate.use(install)
|
||||||
//======================= 自定义组件 =======================
|
app.use(formCreate)
|
||||||
import { UploadFile, UploadImg, UploadImgs } from '@/components/UploadFile'
|
app.use(FcDesigner)
|
||||||
import { DictSelect } from '@/components/DictSelect'
|
}
|
||||||
import UserSelect from '@/views/system/auth/userList/UserSelect.vue'
|
|
||||||
import { Editor } from '@/components/Editor'
|
|
||||||
|
|
||||||
const components = [
|
|
||||||
ElAside,
|
|
||||||
ElPopconfirm,
|
|
||||||
ElHeader,
|
|
||||||
ElMain,
|
|
||||||
ElContainer,
|
|
||||||
ElDivider,
|
|
||||||
ElTransfer,
|
|
||||||
ElAlert,
|
|
||||||
ElTabs,
|
|
||||||
ElTable,
|
|
||||||
ElTableColumn,
|
|
||||||
ElTabPane,
|
|
||||||
UploadImg,
|
|
||||||
UploadImgs,
|
|
||||||
UploadFile,
|
|
||||||
DictSelect,
|
|
||||||
UserSelect,
|
|
||||||
Editor
|
|
||||||
]
|
|
||||||
|
|
||||||
// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
|
|
||||||
export const setupFormCreate = (app: App<Element>) => {
|
|
||||||
components.forEach((component) => {
|
|
||||||
app.component(component.name, component)
|
|
||||||
})
|
|
||||||
formCreate.use(install)
|
|
||||||
app.use(formCreate)
|
|
||||||
app.use(FcDesigner)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import staticRoutes from '@/router/static'
|
import staticRoutes from '@/router/static'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import NProgress from 'nprogress'
|
import NProgress from 'nprogress'
|
||||||
import { loading } from '@/utils/loading'
|
import { loading } from '@/utils/loading'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes: staticRoutes
|
routes: staticRoutes
|
||||||
})
|
})
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
if (!window.existLoading) {
|
if (!window.existLoading) {
|
||||||
loading.show()
|
loading.show()
|
||||||
window.existLoading = true
|
window.existLoading = true
|
||||||
}
|
}
|
||||||
if (to.path == '/login' || to.path == '/404') {
|
if (to.path == '/login' || to.path == '/404') {
|
||||||
// 登录或者注册才可以往下进行
|
// 登录或者注册才可以往下进行
|
||||||
next()
|
next()
|
||||||
} else if (to.path == '/admin/center/homePage') {
|
} else if (to.path == '/admin/center/homePage') {
|
||||||
window.open(window.location.origin + '/homePage/#/')
|
window.open(window.location.origin + '/homePage/#/')
|
||||||
} else {
|
} else {
|
||||||
// 获取 token
|
// 获取 token
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
const token = adminInfo.getToken()
|
const token = adminInfo.getToken()
|
||||||
// token 不存在
|
// token 不存在
|
||||||
if (token === null || token === '') {
|
if (token === null || token === '') {
|
||||||
ElMessage.error('您还没有登录,请先登录')
|
// ElMessage.error('您还没有登录,请先登录')
|
||||||
next('/login')
|
next('/login')
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// next()
|
// next()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 路由加载后
|
// 路由加载后
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
if (window.existLoading) {
|
if (window.existLoading) {
|
||||||
loading.hide()
|
loading.hide()
|
||||||
}
|
}
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
})
|
})
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
@@ -1,246 +1,246 @@
|
|||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
||||||
import type { Layout } from '@/stores/interface'
|
import type { Layout } from '@/stores/interface'
|
||||||
|
|
||||||
export const useConfig = defineStore(
|
export const useConfig = defineStore(
|
||||||
'config',
|
'config',
|
||||||
() => {
|
() => {
|
||||||
const layout: Layout = reactive({
|
const layout: Layout = reactive({
|
||||||
/* 全局 */
|
/* 全局 */
|
||||||
showDrawer: false,
|
showDrawer: false,
|
||||||
// 是否收缩布局(小屏终端)
|
// 是否收缩布局(小屏终端)
|
||||||
shrink: false,
|
shrink: false,
|
||||||
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||||
layoutMode: 'Classic',
|
layoutMode: 'Classic',
|
||||||
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||||
mainAnimation: 'slide-right',
|
mainAnimation: 'slide-right',
|
||||||
// 是否暗黑模式
|
// 是否暗黑模式
|
||||||
isDark: false,
|
isDark: false,
|
||||||
elementUiPrimary: ['#002B6A', '#002B6A'],
|
elementUiPrimary: ['#002B6A', '#002B6A'],
|
||||||
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
||||||
tableHeaderColor: ['#111', '#fff'],
|
tableHeaderColor: ['#111', '#fff'],
|
||||||
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
||||||
/* 侧边菜单 */
|
/* 侧边菜单 */
|
||||||
// 侧边菜单背景色
|
// 侧边菜单背景色
|
||||||
menuBackground: ['#002B6A', '#1d1e1f'],
|
menuBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 侧边菜单文字颜色
|
// 侧边菜单文字颜色
|
||||||
menuColor: ['#FFFFFF', '#CFD3DC'],
|
menuColor: ['#FFFFFF', '#CFD3DC'],
|
||||||
// 侧边菜单激活项背景色
|
// 侧边菜单激活项背景色
|
||||||
menuActiveBackground: ['#002255', '#1d1e1f'],
|
menuActiveBackground: ['#002255', '#1d1e1f'],
|
||||||
// 侧边菜单激活项文字色
|
// 侧边菜单激活项文字色
|
||||||
menuActiveColor: ['#409eff', '#3375b9'],
|
menuActiveColor: ['#409eff', '#3375b9'],
|
||||||
// 侧边菜单顶栏背景色
|
// 侧边菜单顶栏背景色
|
||||||
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 侧边菜单宽度(展开时),单位px
|
// 侧边菜单宽度(展开时),单位px
|
||||||
menuWidth: 260,
|
menuWidth: 260,
|
||||||
// 侧边菜单项默认图标
|
// 侧边菜单项默认图标
|
||||||
menuDefaultIcon: 'fa fa-circle-o',
|
menuDefaultIcon: 'fa fa-circle-o',
|
||||||
// 是否水平折叠收起菜单
|
// 是否水平折叠收起菜单
|
||||||
menuCollapse: false,
|
menuCollapse: false,
|
||||||
// 是否只保持一个子菜单的展开(手风琴)
|
// 是否只保持一个子菜单的展开(手风琴)
|
||||||
menuUniqueOpened: false,
|
menuUniqueOpened: false,
|
||||||
// 显示菜单栏顶栏(LOGO)
|
// 显示菜单栏顶栏(LOGO)
|
||||||
menuShowTopBar: true,
|
menuShowTopBar: true,
|
||||||
|
|
||||||
/* 顶栏 */
|
/* 顶栏 */
|
||||||
// 顶栏文字色
|
// 顶栏文字色
|
||||||
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
||||||
// // 顶栏激活项背景色
|
// // 顶栏激活项背景色
|
||||||
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||||
// 顶栏激活项文字色
|
// 顶栏激活项文字色
|
||||||
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||||
// 顶栏背景色
|
// 顶栏背景色
|
||||||
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
||||||
// 顶栏悬停时背景色
|
// 顶栏悬停时背景色
|
||||||
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||||
})
|
})
|
||||||
|
|
||||||
const lang = reactive({
|
const lang = reactive({
|
||||||
// 默认语言,可选值<zh-cn|en>
|
// 默认语言,可选值<zh-cn|en>
|
||||||
defaultLang: 'zh-cn',
|
defaultLang: 'zh-cn',
|
||||||
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||||
fallbackLang: 'zh-cn',
|
fallbackLang: 'zh-cn',
|
||||||
// 支持的语言列表
|
// 支持的语言列表
|
||||||
langArray: [
|
langArray: [
|
||||||
{ name: 'zh-cn', value: '中文简体' },
|
{ name: 'zh-cn', value: '中文简体' },
|
||||||
{ name: 'en', value: 'English' }
|
{ name: 'en', value: 'English' }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
function menuWidth() {
|
function menuWidth() {
|
||||||
if (layout.shrink) {
|
if (layout.shrink) {
|
||||||
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||||
}
|
}
|
||||||
// 菜单是否折叠
|
// 菜单是否折叠
|
||||||
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLang(val: string) {
|
function setLang(val: string) {
|
||||||
lang.defaultLang = val
|
lang.defaultLang = val
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSetLayoutColor(data = layout.layoutMode) {
|
function onSetLayoutColor(data = layout.layoutMode) {
|
||||||
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||||
const tempValue = layout.isDark
|
const tempValue = layout.isDark
|
||||||
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||||
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||||
if (
|
if (
|
||||||
data == 'Classic' &&
|
data == 'Classic' &&
|
||||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||||
) {
|
) {
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||||
} else if (
|
} else if (
|
||||||
data == 'Default' &&
|
data == 'Default' &&
|
||||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||||
) {
|
) {
|
||||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLayoutMode(data: string) {
|
function setLayoutMode(data: string) {
|
||||||
layout.layoutMode = data
|
layout.layoutMode = data
|
||||||
onSetLayoutColor(data)
|
onSetLayoutColor(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
const setLayout = (name: keyof Layout, value: any) => {
|
const setLayout = (name: keyof Layout, value: any) => {
|
||||||
layout[name] = value as never
|
layout[name] = value as never
|
||||||
}
|
}
|
||||||
|
|
||||||
const getColorVal = function (name: keyof Layout): string {
|
const getColorVal = function (name: keyof Layout): string {
|
||||||
const colors = layout[name] as string[]
|
const colors = layout[name] as string[] || ['#082E6C', '#0e8780']
|
||||||
if (layout.isDark) {
|
if (layout.isDark) {
|
||||||
return colors[1]
|
return colors[1]
|
||||||
} else {
|
} else {
|
||||||
return colors[0]
|
return colors[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||||
},
|
},
|
||||||
// () => {
|
// () => {
|
||||||
//
|
//
|
||||||
// console.log('🚀 ~ subject:', subject)
|
// console.log('🚀 ~ subject:', subject)
|
||||||
// const layout: Layout = reactive({
|
// const layout: Layout = reactive({
|
||||||
// /* 全局 */
|
// /* 全局 */
|
||||||
// showDrawer: false,
|
// showDrawer: false,
|
||||||
// // 是否收缩布局(小屏终端)
|
// // 是否收缩布局(小屏终端)
|
||||||
// shrink: false,
|
// shrink: false,
|
||||||
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||||
// layoutMode: 'Classic',
|
// layoutMode: 'Classic',
|
||||||
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||||
// mainAnimation: subject.mainAnimation,
|
// mainAnimation: subject.mainAnimation,
|
||||||
// // 是否暗黑模式
|
// // 是否暗黑模式
|
||||||
// isDark: false,
|
// isDark: false,
|
||||||
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
||||||
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
||||||
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
||||||
// tableCurrent: JSON.parse(subject.tableCurrent),
|
// tableCurrent: JSON.parse(subject.tableCurrent),
|
||||||
// /* 侧边菜单 */
|
// /* 侧边菜单 */
|
||||||
// // 侧边菜单背景色
|
// // 侧边菜单背景色
|
||||||
// menuBackground: JSON.parse(subject.menuBackground),
|
// menuBackground: JSON.parse(subject.menuBackground),
|
||||||
// // 侧边菜单文字颜色
|
// // 侧边菜单文字颜色
|
||||||
// menuColor:JSON.parse(subject.menuColor),
|
// menuColor:JSON.parse(subject.menuColor),
|
||||||
// // 侧边菜单激活项背景色
|
// // 侧边菜单激活项背景色
|
||||||
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
||||||
// // 侧边菜单激活项文字色
|
// // 侧边菜单激活项文字色
|
||||||
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
||||||
// // 侧边菜单顶栏背景色
|
// // 侧边菜单顶栏背景色
|
||||||
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
||||||
// // 侧边菜单宽度(展开时),单位px
|
// // 侧边菜单宽度(展开时),单位px
|
||||||
// menuWidth: 260,
|
// menuWidth: 260,
|
||||||
// // 侧边菜单项默认图标
|
// // 侧边菜单项默认图标
|
||||||
// menuDefaultIcon: 'fa fa-circle-o',
|
// menuDefaultIcon: 'fa fa-circle-o',
|
||||||
// // 是否水平折叠收起菜单
|
// // 是否水平折叠收起菜单
|
||||||
// menuCollapse: false,
|
// menuCollapse: false,
|
||||||
// // 是否只保持一个子菜单的展开(手风琴)
|
// // 是否只保持一个子菜单的展开(手风琴)
|
||||||
// menuUniqueOpened: false,
|
// menuUniqueOpened: false,
|
||||||
// // 显示菜单栏顶栏(LOGO)
|
// // 显示菜单栏顶栏(LOGO)
|
||||||
// menuShowTopBar: true,
|
// menuShowTopBar: true,
|
||||||
|
|
||||||
// /* 顶栏 */
|
// /* 顶栏 */
|
||||||
// // 顶栏文字色
|
// // 顶栏文字色
|
||||||
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
||||||
// // // 顶栏激活项背景色
|
// // // 顶栏激活项背景色
|
||||||
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||||
// // 顶栏激活项文字色
|
// // 顶栏激活项文字色
|
||||||
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||||
// // 顶栏背景色
|
// // 顶栏背景色
|
||||||
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
||||||
// // 顶栏悬停时背景色
|
// // 顶栏悬停时背景色
|
||||||
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||||
// })
|
// })
|
||||||
// // console.log(123, window.localStorage.getItem('getTheme'))
|
// // console.log(123, window.localStorage.getItem('getTheme'))
|
||||||
|
|
||||||
// const lang = reactive({
|
// const lang = reactive({
|
||||||
// // 默认语言,可选值<zh-cn|en>
|
// // 默认语言,可选值<zh-cn|en>
|
||||||
// defaultLang: 'zh-cn',
|
// defaultLang: 'zh-cn',
|
||||||
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||||
// fallbackLang: 'zh-cn',
|
// fallbackLang: 'zh-cn',
|
||||||
// // 支持的语言列表
|
// // 支持的语言列表
|
||||||
// langArray: [
|
// langArray: [
|
||||||
// { name: 'zh-cn', value: '中文简体' },
|
// { name: 'zh-cn', value: '中文简体' },
|
||||||
// { name: 'en', value: 'English' }
|
// { name: 'en', value: 'English' }
|
||||||
// ]
|
// ]
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// function menuWidth() {
|
// function menuWidth() {
|
||||||
// if (layout.shrink) {
|
// if (layout.shrink) {
|
||||||
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||||
// }
|
// }
|
||||||
// // 菜单是否折叠
|
// // 菜单是否折叠
|
||||||
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function setLang(val: string) {
|
// function setLang(val: string) {
|
||||||
// lang.defaultLang = val
|
// lang.defaultLang = val
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function onSetLayoutColor(data = layout.layoutMode) {
|
// function onSetLayoutColor(data = layout.layoutMode) {
|
||||||
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||||
// const tempValue = layout.isDark
|
// const tempValue = layout.isDark
|
||||||
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||||
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||||
// if (
|
// if (
|
||||||
// data == 'Classic' &&
|
// data == 'Classic' &&
|
||||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||||
// ) {
|
// ) {
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||||
// } else if (
|
// } else if (
|
||||||
// data == 'Default' &&
|
// data == 'Default' &&
|
||||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||||
// ) {
|
// ) {
|
||||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// function setLayoutMode(data: string) {
|
// function setLayoutMode(data: string) {
|
||||||
// layout.layoutMode = data
|
// layout.layoutMode = data
|
||||||
// onSetLayoutColor(data)
|
// onSetLayoutColor(data)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// const setLayout = (name: keyof Layout, value: any) => {
|
// const setLayout = (name: keyof Layout, value: any) => {
|
||||||
// layout[name] = value as never
|
// layout[name] = value as never
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// const getColorVal = function (name: keyof Layout): string {
|
// const getColorVal = function (name: keyof Layout): string {
|
||||||
// const colors = layout[name] as string[]
|
// const colors = layout[name] as string[]
|
||||||
// if (layout.isDark) {
|
// if (layout.isDark) {
|
||||||
// return colors[1]
|
// return colors[1]
|
||||||
// } else {
|
// } else {
|
||||||
// return colors[0]
|
// return colors[0]
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
persist: {
|
persist: {
|
||||||
key: STORE_CONFIG
|
key: STORE_CONFIG
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,12 +29,10 @@ export const useMonitoringPoint = defineStore(
|
|||||||
const setShowCheckBox = (val: boolean) => {
|
const setShowCheckBox = (val: boolean) => {
|
||||||
if (val && state.lineIds.length === 0) {
|
if (val && state.lineIds.length === 0) {
|
||||||
state.lineIds = [state.lineId]
|
state.lineIds = [state.lineId]
|
||||||
console.log('====================================')
|
|
||||||
console.log(state.lineIds)
|
|
||||||
console.log('====================================')
|
|
||||||
}
|
}
|
||||||
state.showCheckBox = val
|
state.showCheckBox = val
|
||||||
}
|
}
|
||||||
|
|
||||||
return { state, setValue, setShowCheckBox }
|
return { state, setValue, setShowCheckBox }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -404,6 +404,11 @@ body,
|
|||||||
.el-select__wrapper {
|
.el-select__wrapper {
|
||||||
height: 32px !important;
|
height: 32px !important;
|
||||||
}
|
}
|
||||||
|
.BMap_center,
|
||||||
|
.BMap_top,
|
||||||
|
.BMap_bottom {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'AlimamaFangYuanTiVF';
|
font-family: 'AlimamaFangYuanTiVF';
|
||||||
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
|
src: url('../assets/font/ali/AlimamaFangYuanTiVF-Thin.woff') format('woff'),
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ $border-color: map.merge(
|
|||||||
@include set-component-css-var('border-color', $border-color);
|
@include set-component-css-var('border-color', $border-color);
|
||||||
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
--vxe-ui-table-row-current-background-color: var(--el-color-primary-light-8);
|
||||||
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
--vxe-ui-table-row-hover-current-background-color: var(--el-color-primary-light-8);
|
||||||
|
--vxe-ui-font-primary-color: var(--el-color-primary);
|
||||||
|
--vxe-ui-font-primary-lighten-color: var(--el-color-primary);
|
||||||
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
// --vxe-table-row-current-background-color: var(--el-color-primary-light-7);
|
||||||
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
// --vxe-table-row-hover-background-color: var(--el-color-primary-light-9);
|
||||||
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
// --vxe-table-row-hover-current-background-color: var(--el-color-primary-light-7);
|
||||||
|
|||||||
@@ -70,7 +70,8 @@
|
|||||||
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
// .vxe-table--render-default .is--disabled.vxe-cell--checkbox .vxe-checkbox--icon{
|
||||||
// color: #fff0;
|
// color: #fff0;
|
||||||
// }
|
// }
|
||||||
.vxe-table--tooltip-wrapper {
|
.vxe-table--tooltip-wrapper,
|
||||||
|
.vxe-tooltip--wrapper {
|
||||||
z-index: 10000 !important;
|
z-index: 10000 !important;
|
||||||
}
|
}
|
||||||
.is--disabled {
|
.is--disabled {
|
||||||
@@ -98,3 +99,8 @@
|
|||||||
background-color: #000 !important;
|
background-color: #000 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.vxe-table-custom--panel-list > li {
|
||||||
|
max-width: 28em;
|
||||||
|
min-width: 15em;
|
||||||
|
padding: 0.3em 1em 0.2em 1em;
|
||||||
|
}
|
||||||
@@ -1,176 +1,176 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='default-main'>
|
<div class='default-main'>
|
||||||
<!-- 表头 -->
|
<!-- 表头 -->
|
||||||
<!-- date-picker 时间组件 area区域组件-->
|
<!-- date-picker 时间组件 area区域组件-->
|
||||||
<TableHeader date-picker area>
|
<TableHeader date-picker area showCustomColumn>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label='关键词:'>
|
<el-form-item label='关键词:'>
|
||||||
<el-input
|
<el-input
|
||||||
style='width: 240px'
|
style='width: 240px'
|
||||||
v-model='tableStore.table.params.searchValue'
|
v-model='tableStore.table.params.searchValue'
|
||||||
clearable
|
clearable
|
||||||
placeholder='仅根据用户名/登录名'
|
placeholder='仅根据用户名/登录名'
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<Table ref='tableRef' />
|
<Table ref='tableRef' />
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<PopupEdit ref='popupEdit' />
|
<PopupEdit ref='popupEdit' />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { ref, onMounted, provide, defineOptions } from 'vue'
|
import { ref, onMounted, provide, defineOptions } from 'vue'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import PopupEdit from './dialog.vue'
|
import PopupEdit from './dialog.vue'
|
||||||
import { mainHeight } from '@/utils/layout'
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
|
||||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'auth/userlist'
|
name: 'auth/userlist'
|
||||||
})
|
})
|
||||||
const popupEdit = ref()
|
const popupEdit = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||||
// publicHeight: 60,
|
// publicHeight: 60,
|
||||||
url: '/user-boot/user/list',
|
url: '/user-boot/user/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ title: '用户名称', field: 'name', minWidth: '130' },
|
{ title: '用户名称', field: 'name', minWidth: '130' },
|
||||||
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
||||||
{ title: '角色', field: 'roleName', minWidth: '130' },
|
{ title: '角色', field: 'roleName', minWidth: '130' },
|
||||||
{ title: '部门', field: 'deptName', minWidth: '200' },
|
{ title: '部门', field: 'deptName', minWidth: '200' },
|
||||||
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
||||||
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
||||||
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
||||||
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
width: '100',
|
width: '100',
|
||||||
render: 'tag',
|
render: 'tag',
|
||||||
custom: {
|
custom: {
|
||||||
0: 'danger',
|
0: 'danger',
|
||||||
1: 'success',
|
1: 'success',
|
||||||
2: 'warning',
|
2: 'warning',
|
||||||
3: 'warning',
|
3: 'warning',
|
||||||
4: 'info',
|
4: 'info',
|
||||||
5: 'danger'
|
5: 'danger'
|
||||||
},
|
},
|
||||||
replaceValue: {
|
replaceValue: {
|
||||||
0: '注销',
|
0: '注销',
|
||||||
1: '正常',
|
1: '正常',
|
||||||
2: '锁定',
|
2: '锁定',
|
||||||
3: '待审核',
|
3: '待审核',
|
||||||
4: '休眠',
|
4: '休眠',
|
||||||
5: '密码过期'
|
5: '密码过期'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',fixed: 'right',
|
||||||
width: '180',
|
width: '180',
|
||||||
render: 'buttons',
|
render: 'buttons',
|
||||||
fixed: 'right',
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-EditPen',
|
icon: 'el-icon-EditPen',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '修改密码',
|
title: '修改密码',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Lock',
|
icon: 'el-icon-Lock',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
inputType: 'password'
|
inputType: 'password'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '激活',
|
title: '激活',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
icon: 'el-icon-Open',
|
icon: 'el-icon-Open',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
title: '注销',
|
title: '注销',
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
icon: 'el-icon-SwitchButton',
|
icon: 'el-icon-SwitchButton',
|
||||||
render: 'basicButton',
|
render: 'basicButton',
|
||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1 && row.state !== 3
|
return row.state !== 1 && row.state !== 3
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
tableStore.table.data.forEach((item: any) => {
|
tableStore.table.data.forEach((item: any) => {
|
||||||
item.deptName = item.deptName || '/'
|
item.deptName = item.deptName || '/'
|
||||||
item.phoneShow = item.phone || '/'
|
item.phoneShow = item.phone || '/'
|
||||||
item.roleName = item.role.length ? item.role : '/'
|
item.roleName = item.role.length ? item.role : '/'
|
||||||
switch (item.casualUser) {
|
switch (item.casualUser) {
|
||||||
case 0:
|
case 0:
|
||||||
item.casualUserName = '临时用户'
|
item.casualUserName = '临时用户'
|
||||||
break
|
break
|
||||||
case 1:
|
case 1:
|
||||||
item.casualUserName = '长期用户'
|
item.casualUserName = '长期用户'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
item.casualUserName = '/'
|
item.casualUserName = '/'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 注入到子组件
|
// 注入到子组件
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
// 默认参数 参数多的话可以使用Object.assign方法
|
// 默认参数 参数多的话可以使用Object.assign方法
|
||||||
tableStore.table.params.searchState = 1
|
tableStore.table.params.searchState = 1
|
||||||
tableStore.table.params.searchValue = ''
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.casualUser = -1
|
tableStore.table.params.casualUser = -1
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 加载数据
|
// 加载数据
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 弹框
|
// 弹框
|
||||||
const addUser = () => {
|
const addUser = () => {
|
||||||
popupEdit.value.open('新增用户')
|
popupEdit.value.open('新增用户')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
59
src/utils/chartAxisHelper.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
const AXIS_DECIMALS = 2
|
||||||
|
|
||||||
|
export function roundAxisValue(val: number, decimals = AXIS_DECIMALS): number {
|
||||||
|
if (!Number.isFinite(val)) return 0
|
||||||
|
const factor = 10 ** decimals
|
||||||
|
return Math.round(val * factor) / factor
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Y 轴刻度:最多 2 位小数,末尾 0 去掉(如 1.00 → 1,0.10 → 0.1) */
|
||||||
|
export function formatAxisLabel(value: number): string {
|
||||||
|
if (!Number.isFinite(value)) return '0'
|
||||||
|
return String(Number(roundAxisValue(value).toFixed(AXIS_DECIMALS)))
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 瞬间波形 Y 轴范围 */
|
||||||
|
export function calcShuYAxisRange(dataMin: number, dataMax: number): { min: number; max: number } {
|
||||||
|
const min = Number(dataMin)
|
||||||
|
const max = Number(dataMax)
|
||||||
|
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
||||||
|
return { min: 0, max: 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
let axisMax = max * 1.1
|
||||||
|
let axisMin = min > 0 ? min - min * 0.1 : min * 1.1
|
||||||
|
|
||||||
|
if (axisMax <= axisMin) {
|
||||||
|
const pad = Math.abs(max) * 0.1 || 0.01
|
||||||
|
axisMax = max + pad
|
||||||
|
axisMin = min - pad
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
min: roundAxisValue(axisMin),
|
||||||
|
max: roundAxisValue(axisMax)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** RMS 波形 Y 轴范围 */
|
||||||
|
export function calcRmsYAxisRange(dataMin: number, dataMax: number): { min: number; max: number } {
|
||||||
|
const min = Number(dataMin)
|
||||||
|
const max = Number(dataMax)
|
||||||
|
if (!Number.isFinite(min) || !Number.isFinite(max)) {
|
||||||
|
return { min: 0, max: 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
let axisMax = max * 1.06 * 1.1
|
||||||
|
let axisMin = min - min * 0.2
|
||||||
|
|
||||||
|
if (axisMax <= axisMin) {
|
||||||
|
const pad = Math.abs(max - min) * 0.1 || Math.abs(max) * 0.1 || 0.01
|
||||||
|
axisMax = max + pad
|
||||||
|
axisMin = min - pad
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
min: roundAxisValue(axisMin),
|
||||||
|
max: roundAxisValue(axisMax)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
// 高级算法
|
// 高级算法
|
||||||
export const ADVANCE_BOOT = '/advance-boot'
|
export const ADVANCE_BOOT = '/advance-boot'
|
||||||
|
|
||||||
//技术监督
|
//技术监督
|
||||||
export const PROCESS_BOOT = '/process-boot'
|
export const PROCESS_BOOT = '/process-boot'
|
||||||
|
|
||||||
//工作流模块
|
//工作流模块
|
||||||
export const BPM_BOOT = '/bpm-boot'
|
export const BPM_BOOT = '/bpm-boot'
|
||||||
|
|
||||||
//冀北技术监督
|
//网公司技术监督
|
||||||
export const SUPERVISION_BOOT = '/supervision-boot'
|
export const SUPERVISION_BOOT = '/supervision-boot'
|
||||||
|
|
||||||
//终端模块
|
//终端模块
|
||||||
export const DEVICE_BOOT = '/device-boot'
|
export const DEVICE_BOOT = '/device-boot'
|
||||||
@@ -1,286 +1,337 @@
|
|||||||
//指标类型
|
//指标类型
|
||||||
export const indexOptions = [
|
export const indexOptions = [
|
||||||
{
|
{
|
||||||
label: '电压趋势',
|
label: '电压趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '10',
|
value: '10',
|
||||||
label: '相电压有效值'
|
label: '相电压有效值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '11',
|
value: '11',
|
||||||
label: '线电压有效值'
|
label: '线电压有效值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '12',
|
value: '12',
|
||||||
label: '电压偏差'
|
label: '电压偏差'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '13',
|
value: '13',
|
||||||
label: '三相电压不平衡'
|
label: '三相电压不平衡'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '14',
|
value: '14',
|
||||||
label: '电压不平衡'
|
label: '电压不平衡'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '15',
|
value: '15',
|
||||||
label: '电压总谐波畸变率'
|
label: '电压总谐波畸变率'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '电流趋势',
|
label: '电流趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '20',
|
value: '20',
|
||||||
label: '电流有效值'
|
label: '电流有效值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '21',
|
value: '21',
|
||||||
label: '电流总谐波畸变率'
|
label: '电流总谐波畸变率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '22',
|
value: '22',
|
||||||
label: '负序电流'
|
label: '负序电流'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '频率趋势',
|
label: '频率趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '30',
|
value: '30',
|
||||||
label: '频率'
|
label: '频率'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '谐波趋势',
|
label: '谐波趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '40',
|
value: '40',
|
||||||
label: '谐波电压含有率'
|
label: '谐波电压含有率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '43',
|
value: '43',
|
||||||
label: '谐波电流幅值'
|
label: '谐波电流幅值'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '44',
|
value: '44',
|
||||||
label: '谐波电压相角'
|
label: '谐波电压相角'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '45',
|
value: '45',
|
||||||
label: '谐波电流相角'
|
label: '谐波电流相角'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '46',
|
value: '46',
|
||||||
label: '间谐波电压含有率'
|
label: '间谐波电压含有率'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// value: '47',
|
// value: '47',
|
||||||
// label: '间谐波电流含有率'
|
// label: '间谐波电流含有率'
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
// value: '48',
|
// value: '48',
|
||||||
// label: '间谐波电压幅值'
|
// label: '间谐波电压幅值'
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
value: '49',
|
value: '49',
|
||||||
label: '间谐波电流幅值'
|
label: '间谐波电流幅值'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '功率趋势',
|
label: '功率趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '50',
|
value: '50',
|
||||||
label: '谐波有功功率'
|
label: '谐波有功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '51',
|
value: '51',
|
||||||
label: '谐波无功功率'
|
label: '谐波无功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '52',
|
value: '52',
|
||||||
label: '谐波视在功率'
|
label: '谐波视在功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '53',
|
value: '53',
|
||||||
label: '三相有功功率'
|
label: '三相有功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '54',
|
value: '54',
|
||||||
label: '三相无功功率'
|
label: '三相无功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '55',
|
value: '55',
|
||||||
label: '三相视在功率'
|
label: '三相视在功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '56',
|
value: '56',
|
||||||
label: '三相总有功功率'
|
label: '三相总有功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '57',
|
value: '57',
|
||||||
label: '三相总无功功率'
|
label: '三相总无功功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '58',
|
value: '58',
|
||||||
label: '三相总视在功率'
|
label: '三相总视在功率'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '59',
|
value: '59',
|
||||||
label: '视在功率因数'
|
label: '视在功率因数'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '591',
|
value: '591',
|
||||||
label: '位移功率因数'
|
label: '位移功率因数'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '592',
|
value: '592',
|
||||||
label: '总视在功率因数'
|
label: '总视在功率因数'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '593',
|
value: '593',
|
||||||
label: '总位移功率因数'
|
label: '总位移功率因数'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '闪变趋势',
|
label: '闪变趋势',
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '60',
|
value: '60',
|
||||||
label: '短时电压闪变'
|
label: '短时电压闪变'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '61',
|
value: '61',
|
||||||
label: '长时电压闪变'
|
label: '长时电压闪变'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '62',
|
value: '62',
|
||||||
label: '电压波动'
|
label: '电压波动'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
//谐波次数
|
//谐波次数
|
||||||
export const harmonicOptions = [
|
export const harmonicOptions = [
|
||||||
{ label: '基波', value: 1 },
|
{ label: '基波', value: 1 },
|
||||||
{ label: '2次', value: 2 },
|
{ label: '2次', value: 2 },
|
||||||
{ label: '3次', value: 3 },
|
{ label: '3次', value: 3 },
|
||||||
{ label: '4次', value: 4 },
|
{ label: '4次', value: 4 },
|
||||||
{ label: '5次', value: 5 },
|
{ label: '5次', value: 5 },
|
||||||
{ label: '6次', value: 6 },
|
{ label: '6次', value: 6 },
|
||||||
{ label: '7次', value: 7 },
|
{ label: '7次', value: 7 },
|
||||||
{ label: '8次', value: 8 },
|
{ label: '8次', value: 8 },
|
||||||
{ label: '9次', value: 9 },
|
{ label: '9次', value: 9 },
|
||||||
{ label: '10次', value: 10 },
|
{ label: '10次', value: 10 },
|
||||||
{ label: '11次', value: 11 },
|
{ label: '11次', value: 11 },
|
||||||
{ label: '12次', value: 12 },
|
{ label: '12次', value: 12 },
|
||||||
{ label: '13次', value: 13 },
|
{ label: '13次', value: 13 },
|
||||||
{ label: '14次', value: 14 },
|
{ label: '14次', value: 14 },
|
||||||
{ label: '15次', value: 15 },
|
{ label: '15次', value: 15 },
|
||||||
{ label: '16次', value: 16 },
|
{ label: '16次', value: 16 },
|
||||||
{ label: '17次', value: 17 },
|
{ label: '17次', value: 17 },
|
||||||
{ label: '18次', value: 18 },
|
{ label: '18次', value: 18 },
|
||||||
{ label: '19次', value: 19 },
|
{ label: '19次', value: 19 },
|
||||||
{ label: '20次', value: 20 },
|
{ label: '20次', value: 20 },
|
||||||
{ label: '21次', value: 21 },
|
{ label: '21次', value: 21 },
|
||||||
{ label: '22次', value: 22 },
|
{ label: '22次', value: 22 },
|
||||||
{ label: '23次', value: 23 },
|
{ label: '23次', value: 23 },
|
||||||
{ label: '24次', value: 24 },
|
{ label: '24次', value: 24 },
|
||||||
{ label: '25次', value: 25 },
|
{ label: '25次', value: 25 },
|
||||||
{ label: '26次', value: 26 },
|
{ label: '26次', value: 26 },
|
||||||
{ label: '27次', value: 27 },
|
{ label: '27次', value: 27 },
|
||||||
{ label: '28次', value: 28 },
|
{ label: '28次', value: 28 },
|
||||||
{ label: '29次', value: 29 },
|
{ label: '29次', value: 29 },
|
||||||
{ label: '30次', value: 30 },
|
{ label: '30次', value: 30 },
|
||||||
{ label: '31次', value: 31 },
|
{ label: '31次', value: 31 },
|
||||||
{ label: '32次', value: 32 },
|
{ label: '32次', value: 32 },
|
||||||
{ label: '33次', value: 33 },
|
{ label: '33次', value: 33 },
|
||||||
{ label: '34次', value: 34 },
|
{ label: '34次', value: 34 },
|
||||||
{ label: '35次', value: 35 },
|
{ label: '35次', value: 35 },
|
||||||
{ label: '36次', value: 36 },
|
{ label: '36次', value: 36 },
|
||||||
{ label: '37次', value: 37 },
|
{ label: '37次', value: 37 },
|
||||||
{ label: '38次', value: 38 },
|
{ label: '38次', value: 38 },
|
||||||
{ label: '39次', value: 39 },
|
{ label: '39次', value: 39 },
|
||||||
{ label: '40次', value: 40 },
|
{ label: '40次', value: 40 },
|
||||||
{ label: '41次', value: 41 },
|
{ label: '41次', value: 41 },
|
||||||
{ label: '42次', value: 42 },
|
{ label: '42次', value: 42 },
|
||||||
{ label: '43次', value: 43 },
|
{ label: '43次', value: 43 },
|
||||||
{ label: '44次', value: 44 },
|
{ label: '44次', value: 44 },
|
||||||
{ label: '45次', value: 45 },
|
{ label: '45次', value: 45 },
|
||||||
{ label: '46次', value: 46 },
|
{ label: '46次', value: 46 },
|
||||||
{ label: '47次', value: 47 },
|
{ label: '47次', value: 47 },
|
||||||
{ label: '48次', value: 48 },
|
{ label: '48次', value: 48 },
|
||||||
{ label: '49次', value: 49 },
|
{ label: '49次', value: 49 },
|
||||||
{ label: '50次', value: 50 }
|
{ label: '50次', value: 50 }
|
||||||
]
|
]
|
||||||
//简谐波次数
|
export const harmonicOptions1 = [
|
||||||
export const inharmonicOptions = [
|
{ label: '2次', value: 2 },
|
||||||
{ label: '0.5次', value: 1 },
|
{ label: '3次', value: 3 },
|
||||||
{ label: '1.5次', value: 2 },
|
{ label: '4次', value: 4 },
|
||||||
{ label: '2.5次', value: 3 },
|
{ label: '5次', value: 5 },
|
||||||
{ label: '3.5次', value: 4 },
|
{ label: '6次', value: 6 },
|
||||||
{ label: '4.5次', value: 5 },
|
{ label: '7次', value: 7 },
|
||||||
{ label: '5.5次', value: 6 },
|
{ label: '8次', value: 8 },
|
||||||
{ label: '6.5次', value: 7 },
|
{ label: '9次', value: 9 },
|
||||||
{ label: '7.5次', value: 8 },
|
{ label: '10次', value: 10 },
|
||||||
{ label: '8.5次', value: 9 },
|
{ label: '11次', value: 11 },
|
||||||
{ label: '9.5次', value: 10 },
|
{ label: '12次', value: 12 },
|
||||||
{ label: '10.5次', value: 11 },
|
{ label: '13次', value: 13 },
|
||||||
{ label: '11.5次', value: 12 },
|
{ label: '14次', value: 14 },
|
||||||
{ label: '12.5次', value: 13 },
|
{ label: '15次', value: 15 },
|
||||||
{ label: '13.5次', value: 14 },
|
{ label: '16次', value: 16 },
|
||||||
{ label: '14.5次', value: 15 },
|
{ label: '17次', value: 17 },
|
||||||
{ label: '15.5次', value: 16 },
|
{ label: '18次', value: 18 },
|
||||||
{ label: '16.5次', value: 17 },
|
{ label: '19次', value: 19 },
|
||||||
{ label: '17.5次', value: 18 },
|
{ label: '20次', value: 20 },
|
||||||
{ label: '18.5次', value: 19 },
|
{ label: '21次', value: 21 },
|
||||||
{ label: '19.5次', value: 20 },
|
{ label: '22次', value: 22 },
|
||||||
{ label: '20.5次', value: 21 },
|
{ label: '23次', value: 23 },
|
||||||
{ label: '21.5次', value: 22 },
|
{ label: '24次', value: 24 },
|
||||||
{ label: '22.5次', value: 23 },
|
{ label: '25次', value: 25 },
|
||||||
{ label: '23.5次', value: 24 },
|
{ label: '26次', value: 26 },
|
||||||
{ label: '24.5次', value: 25 },
|
{ label: '27次', value: 27 },
|
||||||
{ label: '25.5次', value: 26 },
|
{ label: '28次', value: 28 },
|
||||||
{ label: '26.5次', value: 27 },
|
{ label: '29次', value: 29 },
|
||||||
{ label: '27.5次', value: 28 },
|
{ label: '30次', value: 30 },
|
||||||
{ label: '28.5次', value: 29 },
|
{ label: '31次', value: 31 },
|
||||||
{ label: '29.5次', value: 30 },
|
{ label: '32次', value: 32 },
|
||||||
{ label: '30.5次', value: 31 },
|
{ label: '33次', value: 33 },
|
||||||
{ label: '31.5次', value: 32 },
|
{ label: '34次', value: 34 },
|
||||||
{ label: '32.5次', value: 33 },
|
{ label: '35次', value: 35 },
|
||||||
{ label: '33.5次', value: 34 },
|
{ label: '36次', value: 36 },
|
||||||
{ label: '34.5次', value: 35 },
|
{ label: '37次', value: 37 },
|
||||||
{ label: '35.5次', value: 36 },
|
{ label: '38次', value: 38 },
|
||||||
{ label: '36.5次', value: 37 },
|
{ label: '39次', value: 39 },
|
||||||
{ label: '37.5次', value: 38 },
|
{ label: '40次', value: 40 },
|
||||||
{ label: '38.5次', value: 39 },
|
{ label: '41次', value: 41 },
|
||||||
{ label: '39.5次', value: 40 },
|
{ label: '42次', value: 42 },
|
||||||
{ label: '40.5次', value: 41 },
|
{ label: '43次', value: 43 },
|
||||||
{ label: '41.5次', value: 42 },
|
{ label: '44次', value: 44 },
|
||||||
{ label: '42.5次', value: 43 },
|
{ label: '45次', value: 45 },
|
||||||
{ label: '43.5次', value: 44 },
|
{ label: '46次', value: 46 },
|
||||||
{ label: '44.5次', value: 45 },
|
{ label: '47次', value: 47 },
|
||||||
{ label: '45.5次', value: 46 },
|
{ label: '48次', value: 48 },
|
||||||
{ label: '46.5次', value: 47 },
|
{ label: '49次', value: 49 },
|
||||||
{ label: '47.5次', value: 48 },
|
{ label: '50次', value: 50 }
|
||||||
{ label: '48.5次', value: 49 },
|
]
|
||||||
{ label: '49.5次', value: 50 },
|
//简谐波次数
|
||||||
|
export const inharmonicOptions = [
|
||||||
|
{ label: '0.5次', value: 1 },
|
||||||
|
{ label: '1.5次', value: 2 },
|
||||||
]
|
{ label: '2.5次', value: 3 },
|
||||||
|
{ label: '3.5次', value: 4 },
|
||||||
//值类型
|
{ label: '4.5次', value: 5 },
|
||||||
export const typeOptions = [
|
{ label: '5.5次', value: 6 },
|
||||||
{ label: '平均值', value: 1 },
|
{ label: '6.5次', value: 7 },
|
||||||
{ label: '最小值', value: 2 },
|
{ label: '7.5次', value: 8 },
|
||||||
{ label: '最大值', value: 3 },
|
{ label: '8.5次', value: 9 },
|
||||||
{ label: 'cp95值', value: 4 }
|
{ label: '9.5次', value: 10 },
|
||||||
]
|
{ label: '10.5次', value: 11 },
|
||||||
|
{ label: '11.5次', value: 12 },
|
||||||
|
{ label: '12.5次', value: 13 },
|
||||||
|
{ label: '13.5次', value: 14 },
|
||||||
|
{ label: '14.5次', value: 15 },
|
||||||
|
{ label: '15.5次', value: 16 },
|
||||||
|
{ label: '16.5次', value: 17 },
|
||||||
|
{ label: '17.5次', value: 18 },
|
||||||
|
{ label: '18.5次', value: 19 },
|
||||||
|
{ label: '19.5次', value: 20 },
|
||||||
|
{ label: '20.5次', value: 21 },
|
||||||
|
{ label: '21.5次', value: 22 },
|
||||||
|
{ label: '22.5次', value: 23 },
|
||||||
|
{ label: '23.5次', value: 24 },
|
||||||
|
{ label: '24.5次', value: 25 },
|
||||||
|
{ label: '25.5次', value: 26 },
|
||||||
|
{ label: '26.5次', value: 27 },
|
||||||
|
{ label: '27.5次', value: 28 },
|
||||||
|
{ label: '28.5次', value: 29 },
|
||||||
|
{ label: '29.5次', value: 30 },
|
||||||
|
{ label: '30.5次', value: 31 },
|
||||||
|
{ label: '31.5次', value: 32 },
|
||||||
|
{ label: '32.5次', value: 33 },
|
||||||
|
{ label: '33.5次', value: 34 },
|
||||||
|
{ label: '34.5次', value: 35 },
|
||||||
|
{ label: '35.5次', value: 36 },
|
||||||
|
{ label: '36.5次', value: 37 },
|
||||||
|
{ label: '37.5次', value: 38 },
|
||||||
|
{ label: '38.5次', value: 39 },
|
||||||
|
{ label: '39.5次', value: 40 },
|
||||||
|
{ label: '40.5次', value: 41 },
|
||||||
|
{ label: '41.5次', value: 42 },
|
||||||
|
{ label: '42.5次', value: 43 },
|
||||||
|
{ label: '43.5次', value: 44 },
|
||||||
|
{ label: '44.5次', value: 45 },
|
||||||
|
{ label: '45.5次', value: 46 },
|
||||||
|
{ label: '46.5次', value: 47 },
|
||||||
|
{ label: '47.5次', value: 48 },
|
||||||
|
{ label: '48.5次', value: 49 },
|
||||||
|
{ label: '49.5次', value: 50 },
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
//值类型
|
||||||
|
export const typeOptions = [
|
||||||
|
{ label: '平均值', value: 1 },
|
||||||
|
{ label: '最小值', value: 2 },
|
||||||
|
{ label: '最大值', value: 3 },
|
||||||
|
{ label: 'cp95值', value: 4 }
|
||||||
|
]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
} else if (value > -1 && value < 0 && isMin == false) {
|
} else if (value > -1 && value < 0 && isMin == false) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
let base
|
let base
|
||||||
if (Math.abs(o) >= 100) {
|
if (Math.abs(o) >= 100) {
|
||||||
base = 100
|
base = 100
|
||||||
@@ -19,8 +20,11 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
} else if (Math.abs(o) >= 1) {
|
} else if (Math.abs(o) >= 1) {
|
||||||
base = 1
|
base = 1
|
||||||
} else {
|
} else {
|
||||||
base = 0.1
|
const multiple = 1 / 0.1
|
||||||
|
|
||||||
|
base = Math.ceil(Math.abs(o) * multiple) / multiple
|
||||||
}
|
}
|
||||||
|
|
||||||
let calculatedValue
|
let calculatedValue
|
||||||
if (isMin) {
|
if (isMin) {
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
@@ -35,98 +39,37 @@ const calculateValue = (o: number, value: number, num: number, isMin: boolean) =
|
|||||||
calculatedValue = value + num * value
|
calculatedValue = value + num * value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (base === 0.1) {
|
if (base === 0.1) {
|
||||||
return parseFloat(calculatedValue.toFixed(1))
|
// return parseFloat(calculatedValue.toFixed(1))
|
||||||
|
return Math.ceil(calculatedValue * 10) / 10
|
||||||
} else if (isMin) {
|
} else if (isMin) {
|
||||||
return Math.floor(calculatedValue / base) * base
|
return Math.floor(calculatedValue / base) * base
|
||||||
} else {
|
} else {
|
||||||
return Math.ceil(calculatedValue / base) * base
|
return Math.ceil(calculatedValue / base) * base
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理y轴最大最小值
|
// 处理y轴最大最小值
|
||||||
export const yMethod = (arr: any) => {
|
export const yMethod = (arr: any) => {
|
||||||
let num = 0.1
|
let num = 0.2
|
||||||
let numList = dataProcessing(arr)
|
let numList = dataProcessing(arr)
|
||||||
let maxValue = 0
|
if (numList.length === 0) {
|
||||||
let minValue = 0
|
return [0, 0]
|
||||||
let max = 0
|
|
||||||
let min = 0
|
|
||||||
maxValue = Math.max(...numList)
|
|
||||||
minValue = Math.min(...numList)
|
|
||||||
const o = maxValue - minValue
|
|
||||||
if (Math.abs(o) >= 300) {
|
|
||||||
num = 0.02
|
|
||||||
}
|
}
|
||||||
|
const maxValue = Math.max(...numList)
|
||||||
|
const minValue = Math.min(...numList)
|
||||||
|
let min = 0
|
||||||
|
let max = 0
|
||||||
|
|
||||||
min = calculateValue(o, minValue, num, true)
|
// 一正一负时各自按绝对值范围计算,不用 max - min 作为跨度
|
||||||
max = calculateValue(o, maxValue, num, false)
|
if (maxValue > 0 && minValue < 0) {
|
||||||
// if (-100 >= minValue) {
|
min = calculateValue(Math.abs(minValue), minValue, num, true)
|
||||||
// min = Math.floor((minValue + num * minValue) / 100) * 100
|
max = calculateValue(Math.abs(maxValue), maxValue, num, false)
|
||||||
// } else if (-10 >= minValue && minValue > -100) {
|
} else {
|
||||||
// min = Math.floor((minValue + num * minValue) / 10) * 10
|
const o = maxValue - minValue === 0 ? maxValue : maxValue - minValue
|
||||||
// } else if (-1 >= minValue && minValue > -10) {
|
min = calculateValue(o, minValue, num, true)
|
||||||
// min = Math.floor(minValue + num * minValue)
|
max = calculateValue(o, maxValue, num, false)
|
||||||
// } else if (0 > minValue && minValue > -1) {
|
}
|
||||||
// min = parseFloat((minValue + num * minValue).toFixed(1))
|
|
||||||
// } else if (minValue == 0) {
|
|
||||||
// min = 0
|
|
||||||
// } else if (0 < minValue && minValue < 1) {
|
|
||||||
// min = parseFloat((minValue - num * minValue).toFixed(1))
|
|
||||||
// } else if (1 <= minValue && minValue < 10) {
|
|
||||||
// min = Math.floor(minValue - num * minValue)
|
|
||||||
// } else if (10 <= minValue && minValue < 100) {
|
|
||||||
// min = Math.floor((minValue - num * minValue) / 10) * 10
|
|
||||||
// } else if (100 <= minValue) {
|
|
||||||
// min = Math.floor((minValue - num * minValue) / 100) * 100
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (-100 >= maxValue) {
|
|
||||||
// max = Math.ceil((maxValue - num * maxValue) / 100) * 100
|
|
||||||
// } else if (-10 >= maxValue && maxValue > -100) {
|
|
||||||
// max = Math.ceil((maxValue - num * maxValue) / 10) * 10
|
|
||||||
// } else if (-1 >= maxValue && maxValue > -10) {
|
|
||||||
// max = Math.ceil(maxValue - num * maxValue)
|
|
||||||
// } else if (0 > maxValue && maxValue > -1) {
|
|
||||||
// max = parseFloat((maxValue - num * maxValue).toFixed(1))
|
|
||||||
// } else if (maxValue == 0) {
|
|
||||||
// max = 0
|
|
||||||
// } else if (0 < maxValue && maxValue < 1) {
|
|
||||||
// max = parseFloat((maxValue + num * maxValue).toFixed(1))
|
|
||||||
// } else if (1 <= maxValue && maxValue < 10) {
|
|
||||||
// max = Math.ceil(maxValue + num * maxValue)
|
|
||||||
// } else if (10 <= maxValue && maxValue < 100) {
|
|
||||||
// max = Math.ceil((maxValue + num * maxValue) / 10) * 10
|
|
||||||
// } else if (100 <= maxValue) {
|
|
||||||
// max = Math.ceil((maxValue + num * maxValue) / 100) * 100
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (maxValue > 1000 || minValue < -1000) {
|
|
||||||
// max = Math.ceil(maxValue / 100) * 100
|
|
||||||
// if (minValue == 0) {
|
|
||||||
// min = 0
|
|
||||||
// } else {
|
|
||||||
// min = Math.floor(minValue / 100) * 100
|
|
||||||
// }
|
|
||||||
// } else if (maxValue < 60 && minValue > 40) {
|
|
||||||
// max = 60
|
|
||||||
// min = 40
|
|
||||||
// } else if (maxValue == minValue && maxValue < 10 && minValue > 0) {
|
|
||||||
// max = Math.ceil(maxValue / 10) * 10
|
|
||||||
// min = Math.floor(minValue / 10) * 10
|
|
||||||
// } else if (maxValue == minValue && maxValue != 0 && minValue != 0) {
|
|
||||||
// max = Math.ceil(maxValue / 10 + 1) * 10
|
|
||||||
// min = Math.floor(minValue / 10 - 1) * 10
|
|
||||||
// } else {
|
|
||||||
// max = Math.ceil(maxValue / 10) * 10
|
|
||||||
// min = Math.floor(minValue / 10) * 10
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (maxValue > 0 && maxValue < 1) {
|
|
||||||
// max = 1
|
|
||||||
// } else if (max == 0 && minValue > -1 && minValue < 0) {
|
|
||||||
// min = -1
|
|
||||||
// }
|
|
||||||
|
|
||||||
return [min, max]
|
return [min, max]
|
||||||
}
|
}
|
||||||
@@ -158,8 +101,6 @@ export const exportCSV = (title: object, data: any, filename: string) => {
|
|||||||
URL.revokeObjectURL(link.href)
|
URL.revokeObjectURL(link.href)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补全时间序列数据中缺失的条目
|
* 补全时间序列数据中缺失的条目
|
||||||
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
* @param rawData 原始数据,格式为 [["时间字符串", "数值", "单位", "类型"], ...]
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
import { downloadFile } from '@/api/system-boot/file'
|
import { downloadFile } from '@/api/system-boot/file'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
|
const sanitizeUrl = (url: string): string => {
|
||||||
|
return url.replace(/\[/g, '(').replace(/\]/g, ')')
|
||||||
|
}
|
||||||
|
|
||||||
// 下载文件
|
// 下载文件
|
||||||
export const download = (urls: string) => {
|
export const download = (urls: string) => {
|
||||||
//console.log('下载', urls)
|
//console.log('下载', urls)
|
||||||
|
ElMessage.info('下载中...')
|
||||||
downloadFile({ filePath: urls })
|
downloadFile({ filePath: urls })
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
@@ -21,9 +27,9 @@ export const download = (urls: string) => {
|
|||||||
}
|
}
|
||||||
return mimeMap[ext] || ''
|
return mimeMap[ext] || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const blob = new Blob([res], { type: getFileType(urls) })
|
const blob = new Blob([res], { type: getFileType(urls) })
|
||||||
|
|
||||||
// 2. 提取文件名并保留原生后缀(核心修复点)
|
// 2. 提取文件名并保留原生后缀(核心修复点)
|
||||||
const fileName = urls.split('/').at(-1) || '下载文件' // 先提取URL最后一段(文件名)
|
const fileName = urls.split('/').at(-1) || '下载文件' // 先提取URL最后一段(文件名)
|
||||||
|
|
||||||
@@ -38,8 +44,12 @@ export const download = (urls: string) => {
|
|||||||
// 4. 清理资源(优化)
|
// 4. 清理资源(优化)
|
||||||
link.remove()
|
link.remove()
|
||||||
window.URL.revokeObjectURL(url) // 释放blob URL
|
window.URL.revokeObjectURL(url) // 释放blob URL
|
||||||
|
setTimeout(() => {
|
||||||
|
ElMessage.success('下载成功')
|
||||||
|
}, 1000)
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
ElMessage.warning('下载失败:', err)
|
||||||
console.error('下载失败:', err)
|
console.error('下载失败:', err)
|
||||||
// 可添加错误提示(如Toast)
|
// 可添加错误提示(如Toast)
|
||||||
})
|
})
|
||||||
@@ -55,10 +65,8 @@ function removeLastDotSuffix(str: string) {
|
|||||||
export const previewFile = async (urls: any) => {
|
export const previewFile = async (urls: any) => {
|
||||||
//console.log('预览', urls)
|
//console.log('预览', urls)
|
||||||
let url = ''
|
let url = ''
|
||||||
//console.log('urls', decodeURI(urls))
|
|
||||||
await downloadFile({ filePath: decodeURI(urls) })
|
await downloadFile({ filePath: decodeURI(urls) })
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
|
||||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||||
const getFileType = (url: string) => {
|
const getFileType = (url: string) => {
|
||||||
const ext = url.split('.').pop()?.toLowerCase() || ''
|
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||||
@@ -75,10 +83,7 @@ export const previewFile = async (urls: any) => {
|
|||||||
}
|
}
|
||||||
return mimeMap[ext] || ''
|
return mimeMap[ext] || ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||||
|
|
||||||
|
|
||||||
// 3. 创建下载链接
|
// 3. 创建下载链接
|
||||||
url = window.URL.createObjectURL(blob)
|
url = window.URL.createObjectURL(blob)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ class MQTT {
|
|||||||
clean: true,
|
clean: true,
|
||||||
connectTimeout: 30 * 1000,
|
connectTimeout: 30 * 1000,
|
||||||
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
clientId: `mqttjs_${Math.random().toString(16).substr(2, 8)}`,
|
||||||
username: 't_user',
|
username: '',
|
||||||
password: 'njcnpqs',
|
password: '',
|
||||||
reconnectPeriod: 1000, // 默认1秒重试一次
|
reconnectPeriod: 1000, // 默认1秒重试一次
|
||||||
maxReconnectTimes: 3 // 默认最大重连5次
|
maxReconnectTimes: 3 // 默认最大重连5次
|
||||||
}
|
}
|
||||||
@@ -50,12 +50,16 @@ class MQTT {
|
|||||||
if (this.client) {
|
if (this.client) {
|
||||||
throw new Error('MQTT 客户端已初始化')
|
throw new Error('MQTT 客户端已初始化')
|
||||||
}
|
}
|
||||||
|
const mqttUrl = localStorage.getItem('MqttUrl')
|
||||||
|
console.log('MQTT URL:', mqttUrl)
|
||||||
|
if (!mqttUrl || mqttUrl === 'null') {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const mqttUrl =
|
// const mqttUrl =
|
||||||
localStorage.getItem('MqttUrl') == 'null'
|
// localStorage.getItem('MqttUrl') == 'null'
|
||||||
? 'ws://192.168.1.68:8083/mqtt'
|
// ? 'ws://192.168.1.68:8083/mqtt'
|
||||||
: localStorage.getItem('MqttUrl')
|
// : localStorage.getItem('MqttUrl')
|
||||||
|
|
||||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
||||||
this.setupEventListeners()
|
this.setupEventListeners()
|
||||||
@@ -77,12 +81,12 @@ class MQTT {
|
|||||||
|
|
||||||
this.client?.on('error', error => {
|
this.client?.on('error', error => {
|
||||||
clearTimeout(timeout)
|
clearTimeout(timeout)
|
||||||
console.error('MQTT 连接错误:', error)
|
console.log('MQTT 连接错误:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('初始化 MQTT 失败:', error)
|
// console.log('初始化 MQTT 失败:', error)
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +135,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.subscribe(this.topic, { qos: this.defaultOptions.qos, ...subscribeOptions }, error => {
|
this.client?.subscribe(this.topic, { qos: this.defaultOptions.qos, ...subscribeOptions }, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('订阅失败:', error)
|
console.log('订阅失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('订阅成功')
|
console.log('订阅成功')
|
||||||
@@ -153,7 +157,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.unsubscribe(this.topic, error => {
|
this.client?.unsubscribe(this.topic, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('取消订阅失败:', error)
|
console.log('取消订阅失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('取消订阅成功')
|
console.log('取消订阅成功')
|
||||||
@@ -188,7 +192,7 @@ class MQTT {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.client?.publish(this.topic, message, { qos: this.defaultOptions.qos, ...options }, error => {
|
this.client?.publish(this.topic, message, { qos: this.defaultOptions.qos, ...options }, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error('消息发布失败:', error)
|
console.log('消息发布失败:', error)
|
||||||
reject(error)
|
reject(error)
|
||||||
} else {
|
} else {
|
||||||
console.log('消息发布成功')
|
console.log('消息发布成功')
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import type { AxiosRequestConfig, Method } from 'axios'
|
import type { AxiosRequestConfig, Method } from 'axios'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
|
||||||
import { refreshToken } from '@/api/user-boot/user'
|
import { lnRefreshToken, lnRefreshTokenTo, refreshToken } from '@/api/user-boot/user'
|
||||||
import router from '@/router/index'
|
import router from '@/router/index'
|
||||||
import { useAdminInfo } from '@/stores/adminInfo'
|
import { useAdminInfo } from '@/stores/adminInfo'
|
||||||
import { debounce } from 'lodash-es'
|
import { debounce } from 'lodash-es'
|
||||||
|
const IS_LN_VERSION = import.meta.env.VITE_NAME === 'LNqr'
|
||||||
let loginExpireTimer: any = null
|
let loginExpireTimer: any = null
|
||||||
window.requests = []
|
window.requests = []
|
||||||
window.tokenRefreshing = false
|
window.tokenRefreshing = false
|
||||||
@@ -104,11 +105,16 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
if (token) {
|
if (token) {
|
||||||
;(config.headers as anyObj).Authorization = token
|
;(config.headers as anyObj).Authorization = token
|
||||||
} else {
|
} else {
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
|
if (
|
||||||
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
|
config.url == '/user-boot/user/generateSm2Key' ||
|
||||||
|
config.url == '/pqs-auth/oauth/token' ||
|
||||||
|
config.url == '/pqs-auth/oauth/lnLogin' ||
|
||||||
|
config.url == '/pqs-auth/oauth/lnRefreshToken'
|
||||||
|
) {
|
||||||
|
config.headers.Authorization = 'Basic bmpjbjpuamNucHFz'
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
@@ -142,22 +148,46 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
if (!window.tokenRefreshing) {
|
if (!window.tokenRefreshing) {
|
||||||
window.tokenRefreshing = true
|
window.tokenRefreshing = true
|
||||||
|
|
||||||
return refreshToken()
|
if (IS_LN_VERSION) {
|
||||||
.then(res => {
|
//辽宁版本
|
||||||
adminInfo.setToken(res.data.access_token, 'auth')
|
return lnRefreshTokenTo()
|
||||||
window.requests.forEach(cb => cb(res.data.access_token))
|
.then(res => {
|
||||||
window.requests = []
|
adminInfo.setToken(res.data.access_token, 'auth')
|
||||||
|
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||||
|
window.requests.forEach(cb => cb(res.data.access_token))
|
||||||
|
window.requests = []
|
||||||
|
|
||||||
return Axios(response.config)
|
return Axios(response.config)
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
adminInfo.removeToken()
|
// refresh_token + CAS 都过期 → 重新走CAS登录
|
||||||
router.push({ name: 'login' })
|
//window.location.href = '/api/pqs-auth/oauth/lnCheck'
|
||||||
return Promise.reject(err)
|
return Promise.reject(err)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
window.tokenRefreshing = false
|
window.tokenRefreshing = false
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
//通用版本
|
||||||
|
return refreshToken()
|
||||||
|
.then(res => {
|
||||||
|
adminInfo.setToken(res.data.access_token, 'auth')
|
||||||
|
adminInfo.setToken(res.data.refresh_token, 'refresh')
|
||||||
|
window.requests.forEach(cb => cb(res.data.access_token))
|
||||||
|
window.requests = []
|
||||||
|
|
||||||
|
return Axios(response.config)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
window.location.reload()
|
||||||
|
adminInfo.removeToken()
|
||||||
|
router.push({ name: 'login' })
|
||||||
|
return Promise.reject(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
window.tokenRefreshing = false
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 用函数形式将 resolve 存入,等待刷新后再执行
|
// 用函数形式将 resolve 存入,等待刷新后再执行
|
||||||
@@ -183,6 +213,17 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
|
|||||||
loginExpireTimer = null // 执行后清空定时器
|
loginExpireTimer = null // 执行后清空定时器
|
||||||
}, 100) // 可根据实际情况调整延迟时间
|
}, 100) // 可根据实际情况调整延迟时间
|
||||||
return Promise.reject(response.data)
|
return Promise.reject(response.data)
|
||||||
|
} else if (response.data.code == 'A0121') {
|
||||||
|
//统一认证过期
|
||||||
|
//const casLogoutUrl = 'http://privilege-epri.dcloud.ln.dc.sgcc.com.cn/cas/login?service=http://PQMonitoring.dcloud.ln.dc.sgcc.com.cn'
|
||||||
|
// 1. 清空本地失效token、用户信息
|
||||||
|
adminInfo.removeToken()
|
||||||
|
adminInfo.reset()
|
||||||
|
// 2. 跳转统一鉴权中转接口
|
||||||
|
const authCheckUrl = '/api/pqs-auth/oauth/lnCheck'
|
||||||
|
window.location.href = authCheckUrl
|
||||||
|
// 中断请求
|
||||||
|
return Promise.reject(response.data)
|
||||||
} else {
|
} else {
|
||||||
if (options.showCodeMessage) {
|
if (options.showCodeMessage) {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { compact, isEmpty, reverse } from 'lodash-es'
|
|||||||
import { getRouteMenu, dictDataCache } from '@/api/auth'
|
import { getRouteMenu, dictDataCache } from '@/api/auth'
|
||||||
import { isAdminApp } from '@/utils/common'
|
import { isAdminApp } from '@/utils/common'
|
||||||
import { adminBaseRoutePath } from '@/router/static'
|
import { adminBaseRoutePath } from '@/router/static'
|
||||||
const route:any = useRouter()
|
|
||||||
/**
|
/**
|
||||||
* 导航失败有错误消息的路由push
|
* 导航失败有错误消息的路由push
|
||||||
* @param to — 导航位置,同 router.push
|
* @param to — 导航位置,同 router.push
|
||||||
@@ -319,8 +318,9 @@ export const getMenu = () => {
|
|||||||
}
|
}
|
||||||
handlerMenu(res.data)
|
handlerMenu(res.data)
|
||||||
handleAdminRoute(res.data)
|
handleAdminRoute(res.data)
|
||||||
if (route?.params.to) {
|
const currentRoute = router.currentRoute.value
|
||||||
const lastRoute = JSON.parse(route.params.to as string)
|
if (currentRoute?.params.to) {
|
||||||
|
const lastRoute = JSON.parse(currentRoute.params.to as string)
|
||||||
if (lastRoute.path != adminBaseRoutePath) {
|
if (lastRoute.path != adminBaseRoutePath) {
|
||||||
let query = !isEmpty(lastRoute.query) ? lastRoute.query : {}
|
let query = !isEmpty(lastRoute.query) ? lastRoute.query : {}
|
||||||
routePush({ path: lastRoute.path, query: query })
|
routePush({ path: lastRoute.path, query: query })
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ interface TableStoreParams {
|
|||||||
publicHeight?: number //计算高度
|
publicHeight?: number //计算高度
|
||||||
resetCallback?: () => void // 重置
|
resetCallback?: () => void // 重置
|
||||||
loadCallback?: () => void // 接口调用后的回调
|
loadCallback?: () => void // 接口调用后的回调
|
||||||
exportProcessingData?:() => void //导出处理数据
|
exportProcessingData?: () => void //导出处理数据
|
||||||
beforeSearchFun?: () => void // 接口调用前的回调
|
beforeSearchFun?: () => void // 接口调用前的回调
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +45,10 @@ export default class TableStore {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
},
|
},
|
||||||
filename:null,
|
filename: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
|
exportLoading: false,
|
||||||
|
customColumnInHeader: false,
|
||||||
column: [],
|
column: [],
|
||||||
loadCallback: null,
|
loadCallback: null,
|
||||||
exportProcessingData: null,
|
exportProcessingData: null,
|
||||||
@@ -65,7 +67,7 @@ export default class TableStore {
|
|||||||
this.table.filename = options.filename || null
|
this.table.filename = options.filename || null
|
||||||
this.table.column = options.column
|
this.table.column = options.column
|
||||||
this.showPage = options.showPage !== false
|
this.showPage = options.showPage !== false
|
||||||
|
|
||||||
this.table.publicHeight = options.publicHeight || 0
|
this.table.publicHeight = options.publicHeight || 0
|
||||||
this.table.resetCallback = options.resetCallback || null
|
this.table.resetCallback = options.resetCallback || null
|
||||||
this.table.loadCallback = options.loadCallback || null
|
this.table.loadCallback = options.loadCallback || null
|
||||||
@@ -76,6 +78,7 @@ export default class TableStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
index() {
|
index() {
|
||||||
|
|
||||||
this.table.beforeSearchFun && this.table.beforeSearchFun()
|
this.table.beforeSearchFun && this.table.beforeSearchFun()
|
||||||
this.table.data = []
|
this.table.data = []
|
||||||
this.table.loading = true
|
this.table.loading = true
|
||||||
@@ -84,13 +87,11 @@ export default class TableStore {
|
|||||||
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
||||||
}
|
}
|
||||||
if (!this.timeAll) {
|
if (!this.timeAll) {
|
||||||
delete this.table.params.startTime;
|
delete this.table.params.startTime
|
||||||
delete this.table.params.endTime;
|
delete this.table.params.endTime
|
||||||
delete this.table.params.searchBeginTime;
|
delete this.table.params.searchBeginTime
|
||||||
delete this.table.params.searchEndTime;
|
delete this.table.params.searchEndTime
|
||||||
delete this.table.params.timeFlag;
|
delete this.table.params.timeFlag
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -98,10 +99,12 @@ export default class TableStore {
|
|||||||
url: this.url,
|
url: this.url,
|
||||||
method: this.method
|
method: this.method
|
||||||
},
|
},
|
||||||
|
|
||||||
requestPayload(this.method, this.table.params, this.paramsPOST)
|
requestPayload(this.method, this.table.params, this.paramsPOST)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
|
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.table.data = res.data.records || res.data
|
this.table.data = res.data.records || res.data
|
||||||
this.table.total = res.data?.total || res.data.length || 0
|
this.table.total = res.data?.total || res.data.length || 0
|
||||||
@@ -130,13 +133,15 @@ export default class TableStore {
|
|||||||
* @param data 携带数据
|
* @param data 携带数据
|
||||||
*/
|
*/
|
||||||
onTableAction = (event: string, data: anyObj) => {
|
onTableAction = (event: string, data: anyObj) => {
|
||||||
|
|
||||||
const actionFun = new Map([
|
const actionFun = new Map([
|
||||||
[
|
[
|
||||||
'search',
|
'search',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
this.table.params.pageNum = 1
|
this.table.params.pageNum = 1
|
||||||
this.index()
|
this.index()
|
||||||
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -202,8 +207,10 @@ export default class TableStore {
|
|||||||
[
|
[
|
||||||
'export',
|
'export',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
|
this.table.exportLoading = true
|
||||||
// this.index()
|
// this.index()
|
||||||
console.log('export')
|
|
||||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||||
createAxios(
|
createAxios(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
@@ -213,12 +220,17 @@ export default class TableStore {
|
|||||||
},
|
},
|
||||||
requestPayload(this.method, params, this.paramsPOST)
|
requestPayload(this.method, params, this.paramsPOST)
|
||||||
)
|
)
|
||||||
).then(res => {
|
)
|
||||||
this.table.allData = filtration(res.data.records || res.data)
|
.then(res => {
|
||||||
console.log('11111',this.table)
|
this.table.allData = filtration(res.data.records || res.data)
|
||||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||||
this.table.allFlag = data.showAllFlag || true
|
this.table.allFlag = data.showAllFlag || true
|
||||||
})
|
this.table.exportLoading = false
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.table.exportLoading = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,400 +1,432 @@
|
|||||||
interface TreeHelperConfig {
|
interface TreeHelperConfig {
|
||||||
id: string
|
id: string
|
||||||
children: string
|
children: string
|
||||||
pid: string
|
pid: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_CONFIG: TreeHelperConfig = {
|
const DEFAULT_CONFIG: TreeHelperConfig = {
|
||||||
id: 'id',
|
id: 'id',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
pid: 'pid'
|
pid: 'pid'
|
||||||
}
|
}
|
||||||
export const defaultProps = {
|
export const defaultProps = {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id',
|
value: 'id',
|
||||||
isLeaf: 'leaf',
|
isLeaf: 'leaf',
|
||||||
emitPath: false // 用于 cascader 组件:在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
emitPath: false // 用于 cascader 组件:在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||||
}
|
}
|
||||||
|
|
||||||
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config)
|
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config)
|
||||||
|
|
||||||
// tree from list
|
// tree from list
|
||||||
export const listToTree = <T = any>(list: any[], config: Partial<TreeHelperConfig> = {}): T[] => {
|
export const listToTree = <T = any>(list: any[], config: Partial<TreeHelperConfig> = {}): T[] => {
|
||||||
const conf = getConfig(config) as TreeHelperConfig
|
const conf = getConfig(config) as TreeHelperConfig
|
||||||
const nodeMap = new Map()
|
const nodeMap = new Map()
|
||||||
const result: T[] = []
|
const result: T[] = []
|
||||||
const { id, children, pid } = conf
|
const { id, children, pid } = conf
|
||||||
|
|
||||||
for (const node of list) {
|
for (const node of list) {
|
||||||
node[children] = node[children] || []
|
node[children] = node[children] || []
|
||||||
nodeMap.set(node[id], node)
|
nodeMap.set(node[id], node)
|
||||||
}
|
}
|
||||||
for (const node of list) {
|
for (const node of list) {
|
||||||
const parent = nodeMap.get(node[pid])
|
const parent = nodeMap.get(node[pid])
|
||||||
;(parent ? parent.children : result).push(node)
|
;(parent ? parent.children : result).push(node)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export const treeToList = <T = any>(tree: any, config: Partial<TreeHelperConfig> = {}): T => {
|
export const treeToList = <T = any>(tree: any, config: Partial<TreeHelperConfig> = {}): T => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const { children } = config
|
const { children } = config
|
||||||
const result: any = [...tree]
|
const result: any = [...tree]
|
||||||
for (let i = 0; i < result.length; i++) {
|
for (let i = 0; i < result.length; i++) {
|
||||||
if (!result[i][children!]) continue
|
if (!result[i][children!]) continue
|
||||||
result.splice(i + 1, 0, ...result[i][children!])
|
result.splice(i + 1, 0, ...result[i][children!])
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export const findNode = <T = any>(
|
export const findNode = <T = any>(
|
||||||
tree: any,
|
tree: any,
|
||||||
func: Fn,
|
func: Fn,
|
||||||
config: Partial<TreeHelperConfig> = {}
|
config: Partial<TreeHelperConfig> = {}
|
||||||
): T | null => {
|
): T | null => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const { children } = config
|
const { children } = config
|
||||||
const list = [...tree]
|
const list = [...tree]
|
||||||
for (const node of list) {
|
for (const node of list) {
|
||||||
if (func(node)) return node
|
if (func(node)) return node
|
||||||
node[children!] && list.push(...node[children!])
|
node[children!] && list.push(...node[children!])
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
export const findNodeAll = <T = any>(
|
export const findNodeAll = <T = any>(
|
||||||
tree: any,
|
tree: any,
|
||||||
func: Fn,
|
func: Fn,
|
||||||
config: Partial<TreeHelperConfig> = {}
|
config: Partial<TreeHelperConfig> = {}
|
||||||
): T[] => {
|
): T[] => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const { children } = config
|
const { children } = config
|
||||||
const list = [...tree]
|
const list = [...tree]
|
||||||
const result: T[] = []
|
const result: T[] = []
|
||||||
for (const node of list) {
|
for (const node of list) {
|
||||||
func(node) && result.push(node)
|
func(node) && result.push(node)
|
||||||
node[children!] && list.push(...node[children!])
|
node[children!] && list.push(...node[children!])
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export const findPath = <T = any>(
|
export const findPath = <T = any>(
|
||||||
tree: any,
|
tree: any,
|
||||||
func: Fn,
|
func: Fn,
|
||||||
config: Partial<TreeHelperConfig> = {}
|
config: Partial<TreeHelperConfig> = {}
|
||||||
): T | T[] | null => {
|
): T | T[] | null => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const path: T[] = []
|
const path: T[] = []
|
||||||
const list = [...tree]
|
const list = [...tree]
|
||||||
const visitedSet = new Set()
|
const visitedSet = new Set()
|
||||||
const { children } = config
|
const { children } = config
|
||||||
while (list.length) {
|
while (list.length) {
|
||||||
const node = list[0]
|
const node = list[0]
|
||||||
if (visitedSet.has(node)) {
|
if (visitedSet.has(node)) {
|
||||||
path.pop()
|
path.pop()
|
||||||
list.shift()
|
list.shift()
|
||||||
} else {
|
} else {
|
||||||
visitedSet.add(node)
|
visitedSet.add(node)
|
||||||
node[children!] && list.unshift(...node[children!])
|
node[children!] && list.unshift(...node[children!])
|
||||||
path.push(node)
|
path.push(node)
|
||||||
if (func(node)) {
|
if (func(node)) {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
export const findPathAll = (tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}) => {
|
export const findPathAll = (tree: any, func: Fn, config: Partial<TreeHelperConfig> = {}) => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const path: any[] = []
|
const path: any[] = []
|
||||||
const list = [...tree]
|
const list = [...tree]
|
||||||
const result: any[] = []
|
const result: any[] = []
|
||||||
const visitedSet = new Set(),
|
const visitedSet = new Set(),
|
||||||
{ children } = config
|
{ children } = config
|
||||||
while (list.length) {
|
while (list.length) {
|
||||||
const node = list[0]
|
const node = list[0]
|
||||||
if (visitedSet.has(node)) {
|
if (visitedSet.has(node)) {
|
||||||
path.pop()
|
path.pop()
|
||||||
list.shift()
|
list.shift()
|
||||||
} else {
|
} else {
|
||||||
visitedSet.add(node)
|
visitedSet.add(node)
|
||||||
node[children!] && list.unshift(...node[children!])
|
node[children!] && list.unshift(...node[children!])
|
||||||
path.push(node)
|
path.push(node)
|
||||||
func(node) && result.push([...path])
|
func(node) && result.push([...path])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
export const filter = <T = any>(
|
export const filter = <T = any>(
|
||||||
tree: T[],
|
tree: T[],
|
||||||
func: (n: T) => boolean,
|
func: (n: T) => boolean,
|
||||||
config: Partial<TreeHelperConfig> = {}
|
config: Partial<TreeHelperConfig> = {}
|
||||||
): T[] => {
|
): T[] => {
|
||||||
config = getConfig(config)
|
config = getConfig(config)
|
||||||
const children = config.children as string
|
const children = config.children as string
|
||||||
|
|
||||||
function listFilter(list: T[]) {
|
function listFilter(list: T[]) {
|
||||||
return list
|
return list
|
||||||
.map((node: any) => ({ ...node }))
|
.map((node: any) => ({ ...node }))
|
||||||
.filter((node) => {
|
.filter((node) => {
|
||||||
node[children] = node[children] && listFilter(node[children])
|
node[children] = node[children] && listFilter(node[children])
|
||||||
return func(node) || (node[children] && node[children].length)
|
return func(node) || (node[children] && node[children].length)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return listFilter(tree)
|
return listFilter(tree)
|
||||||
}
|
}
|
||||||
|
export const filterTree = <T = any>(
|
||||||
export const forEach = <T = any>(
|
tree: T[],
|
||||||
tree: T[],
|
func: (n: T) => boolean,
|
||||||
func: (n: T) => any,
|
config: Partial<TreeHelperConfig> = {}
|
||||||
config: Partial<TreeHelperConfig> = {}
|
): T[] => {
|
||||||
): void => {
|
config = getConfig(config)
|
||||||
config = getConfig(config)
|
const children = config.children as string
|
||||||
const list: any[] = [...tree]
|
|
||||||
const { children } = config
|
function listFilter(list: T[]) {
|
||||||
for (let i = 0; i < list.length; i++) {
|
return list
|
||||||
// func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿
|
.map((node: any) => ({ ...node }))
|
||||||
if (func(list[i])) {
|
.filter((node) => {
|
||||||
return
|
// 1. 如果当前节点匹配 → 直接保留【所有子节点】,不再过滤下级
|
||||||
}
|
if (func(node)) {
|
||||||
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children])
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// 2. 如果当前节点不匹配,递归过滤子节点
|
||||||
/**
|
if (node[children]) {
|
||||||
* @description: Extract tree specified structure
|
const filteredChildren = listFilter(node[children]);
|
||||||
*/
|
if (filteredChildren.length > 0) {
|
||||||
export const treeMap = <T = any>(
|
node[children] = filteredChildren;
|
||||||
treeData: T[],
|
return true;
|
||||||
opt: { children?: string; conversion: Fn }
|
}
|
||||||
): T[] => {
|
}
|
||||||
return treeData.map((item) => treeMapEach(item, opt))
|
|
||||||
}
|
// 3. 都不匹配,过滤掉
|
||||||
|
return false;
|
||||||
/**
|
})
|
||||||
* @description: Extract tree specified structure
|
}
|
||||||
*/
|
|
||||||
export const treeMapEach = (
|
return listFilter(tree)
|
||||||
data: any,
|
}
|
||||||
{ children = 'children', conversion }: { children?: string; conversion: Fn }
|
export const forEach = <T = any>(
|
||||||
) => {
|
tree: T[],
|
||||||
const haveChildren = Array.isArray(data[children]) && data[children].length > 0
|
func: (n: T) => any,
|
||||||
const conversionData = conversion(data) || {}
|
config: Partial<TreeHelperConfig> = {}
|
||||||
if (haveChildren) {
|
): void => {
|
||||||
return {
|
config = getConfig(config)
|
||||||
...conversionData,
|
const list: any[] = [...tree]
|
||||||
[children]: data[children].map((i: number) =>
|
const { children } = config
|
||||||
treeMapEach(i, {
|
for (let i = 0; i < list.length; i++) {
|
||||||
children,
|
// func 返回true就终止遍历,避免大量节点场景下无意义循环,引起浏览器卡顿
|
||||||
conversion
|
if (func(list[i])) {
|
||||||
})
|
return
|
||||||
)
|
}
|
||||||
}
|
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children])
|
||||||
} else {
|
}
|
||||||
return {
|
}
|
||||||
...conversionData
|
|
||||||
}
|
/**
|
||||||
}
|
* @description: Extract tree specified structure
|
||||||
}
|
*/
|
||||||
|
export const treeMap = <T = any>(
|
||||||
/**
|
treeData: T[],
|
||||||
* 递归遍历树结构
|
opt: { children?: string; conversion: Fn }
|
||||||
* @param treeDatas 树
|
): T[] => {
|
||||||
* @param callBack 回调
|
return treeData.map((item) => treeMapEach(item, opt))
|
||||||
* @param parentNode 父节点
|
}
|
||||||
*/
|
|
||||||
export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => {
|
/**
|
||||||
treeDatas.forEach((element) => {
|
* @description: Extract tree specified structure
|
||||||
const newNode = callBack(element, parentNode) || element
|
*/
|
||||||
if (element.children) {
|
export const treeMapEach = (
|
||||||
eachTree(element.children, callBack, newNode)
|
data: any,
|
||||||
}
|
{ children = 'children', conversion }: { children?: string; conversion: Fn }
|
||||||
})
|
) => {
|
||||||
}
|
const haveChildren = Array.isArray(data[children]) && data[children].length > 0
|
||||||
|
const conversionData = conversion(data) || {}
|
||||||
/**
|
if (haveChildren) {
|
||||||
* 构造树型结构数据
|
return {
|
||||||
* @param {*} data 数据源
|
...conversionData,
|
||||||
* @param {*} id id字段 默认 'id'
|
[children]: data[children].map((i: number) =>
|
||||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
treeMapEach(i, {
|
||||||
* @param {*} children 孩子节点字段 默认 'children'
|
children,
|
||||||
*/
|
conversion
|
||||||
export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => {
|
})
|
||||||
if (!Array.isArray(data)) {
|
)
|
||||||
console.warn('data must be an array')
|
}
|
||||||
return []
|
} else {
|
||||||
}
|
return {
|
||||||
const config = {
|
...conversionData
|
||||||
id: id || 'id',
|
}
|
||||||
parentId: parentId || 'parentId',
|
}
|
||||||
childrenList: children || 'children'
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
const childrenListMap = {}
|
* 递归遍历树结构
|
||||||
const nodeIds = {}
|
* @param treeDatas 树
|
||||||
const tree: any[] = []
|
* @param callBack 回调
|
||||||
|
* @param parentNode 父节点
|
||||||
for (const d of data) {
|
*/
|
||||||
const parentId = d[config.parentId]
|
export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => {
|
||||||
if (childrenListMap[parentId] == null) {
|
treeDatas.forEach((element) => {
|
||||||
childrenListMap[parentId] = []
|
const newNode = callBack(element, parentNode) || element
|
||||||
}
|
if (element.children) {
|
||||||
nodeIds[d[config.id]] = d
|
eachTree(element.children, callBack, newNode)
|
||||||
childrenListMap[parentId].push(d)
|
}
|
||||||
}
|
})
|
||||||
|
}
|
||||||
for (const d of data) {
|
|
||||||
const parentId = d[config.parentId]
|
/**
|
||||||
if (nodeIds[parentId] == null) {
|
* 构造树型结构数据
|
||||||
tree.push(d)
|
* @param {*} data 数据源
|
||||||
}
|
* @param {*} id id字段 默认 'id'
|
||||||
}
|
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||||
|
* @param {*} children 孩子节点字段 默认 'children'
|
||||||
for (const t of tree) {
|
*/
|
||||||
adaptToChildrenList(t)
|
export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => {
|
||||||
}
|
if (!Array.isArray(data)) {
|
||||||
|
console.warn('data must be an array')
|
||||||
function adaptToChildrenList(o) {
|
return []
|
||||||
if (childrenListMap[o[config.id]] !== null) {
|
}
|
||||||
o[config.childrenList] = childrenListMap[o[config.id]]
|
const config = {
|
||||||
}
|
id: id || 'id',
|
||||||
if (o[config.childrenList]) {
|
parentId: parentId || 'parentId',
|
||||||
for (const c of o[config.childrenList]) {
|
childrenList: children || 'children'
|
||||||
adaptToChildrenList(c)
|
}
|
||||||
}
|
|
||||||
}
|
const childrenListMap = {}
|
||||||
}
|
const nodeIds = {}
|
||||||
|
const tree: any[] = []
|
||||||
return tree
|
|
||||||
}
|
for (const d of data) {
|
||||||
|
const parentId = d[config.parentId]
|
||||||
/**
|
if (childrenListMap[parentId] == null) {
|
||||||
* 构造树型结构数据
|
childrenListMap[parentId] = []
|
||||||
* @param {*} data 数据源
|
}
|
||||||
* @param {*} id id字段 默认 'id'
|
nodeIds[d[config.id]] = d
|
||||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
childrenListMap[parentId].push(d)
|
||||||
* @param {*} children 孩子节点字段 默认 'children'
|
}
|
||||||
* @param {*} rootId 根Id 默认 0
|
|
||||||
*/
|
for (const d of data) {
|
||||||
// @ts-ignore
|
const parentId = d[config.parentId]
|
||||||
export const handleTree2 = (data, id, parentId, children, rootId) => {
|
if (nodeIds[parentId] == null) {
|
||||||
id = id || 'id'
|
tree.push(d)
|
||||||
parentId = parentId || 'parentId'
|
}
|
||||||
// children = children || 'children'
|
}
|
||||||
rootId =
|
|
||||||
rootId ||
|
for (const t of tree) {
|
||||||
Math.min(
|
adaptToChildrenList(t)
|
||||||
...data.map((item) => {
|
}
|
||||||
return item[parentId]
|
|
||||||
})
|
function adaptToChildrenList(o) {
|
||||||
) ||
|
if (childrenListMap[o[config.id]] !== null) {
|
||||||
0
|
o[config.childrenList] = childrenListMap[o[config.id]]
|
||||||
// 对源数据深度克隆
|
}
|
||||||
const cloneData = JSON.parse(JSON.stringify(data))
|
if (o[config.childrenList]) {
|
||||||
// 循环所有项
|
for (const c of o[config.childrenList]) {
|
||||||
const treeData = cloneData.filter((father) => {
|
adaptToChildrenList(c)
|
||||||
const branchArr = cloneData.filter((child) => {
|
}
|
||||||
// 返回每一项的子级数组
|
}
|
||||||
return father[id] === child[parentId]
|
}
|
||||||
})
|
|
||||||
branchArr.length > 0 ? (father.children = branchArr) : ''
|
return tree
|
||||||
// 返回第一层
|
}
|
||||||
return father[parentId] === rootId
|
|
||||||
})
|
/**
|
||||||
return treeData !== '' ? treeData : data
|
* 构造树型结构数据
|
||||||
}
|
* @param {*} data 数据源
|
||||||
|
* @param {*} id id字段 默认 'id'
|
||||||
/**
|
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||||
* 校验选中的节点,是否为指定 level
|
* @param {*} children 孩子节点字段 默认 'children'
|
||||||
*
|
* @param {*} rootId 根Id 默认 0
|
||||||
* @param tree 要操作的树结构数据
|
*/
|
||||||
* @param nodeId 需要判断在什么层级的数据
|
// @ts-ignore
|
||||||
* @param level 检查的级别, 默认检查到二级
|
export const handleTree2 = (data, id, parentId, children, rootId) => {
|
||||||
* @return true 是;false 否
|
id = id || 'id'
|
||||||
*/
|
parentId = parentId || 'parentId'
|
||||||
export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => {
|
// children = children || 'children'
|
||||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
rootId =
|
||||||
console.warn('tree must be an array')
|
rootId ||
|
||||||
return false
|
Math.min(
|
||||||
}
|
...data.map((item) => {
|
||||||
|
return item[parentId]
|
||||||
// 校验是否是一级节点
|
})
|
||||||
if (tree.some((item) => item.id === nodeId)) {
|
) ||
|
||||||
return false
|
0
|
||||||
}
|
// 对源数据深度克隆
|
||||||
|
const cloneData = JSON.parse(JSON.stringify(data))
|
||||||
// 递归计数
|
// 循环所有项
|
||||||
let count = 1
|
const treeData = cloneData.filter((father) => {
|
||||||
|
const branchArr = cloneData.filter((child) => {
|
||||||
// 深层次校验
|
// 返回每一项的子级数组
|
||||||
function performAThoroughValidation(arr: any[]): boolean {
|
return father[id] === child[parentId]
|
||||||
count += 1
|
})
|
||||||
for (const item of arr) {
|
branchArr.length > 0 ? (father.children = branchArr) : ''
|
||||||
if (item.id === nodeId) {
|
// 返回第一层
|
||||||
return true
|
return father[parentId] === rootId
|
||||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
})
|
||||||
if (performAThoroughValidation(item.children)) {
|
return treeData !== '' ? treeData : data
|
||||||
return true
|
}
|
||||||
}
|
|
||||||
}
|
/**
|
||||||
}
|
* 校验选中的节点,是否为指定 level
|
||||||
return false
|
*
|
||||||
}
|
* @param tree 要操作的树结构数据
|
||||||
|
* @param nodeId 需要判断在什么层级的数据
|
||||||
for (const item of tree) {
|
* @param level 检查的级别, 默认检查到二级
|
||||||
count = 1
|
* @return true 是;false 否
|
||||||
if (performAThoroughValidation(item.children)) {
|
*/
|
||||||
// 找到后对比是否是期望的层级
|
export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => {
|
||||||
if (count >= level) {
|
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||||
return true
|
console.warn('tree must be an array')
|
||||||
}
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// 校验是否是一级节点
|
||||||
return false
|
if (tree.some((item) => item.id === nodeId)) {
|
||||||
}
|
return false
|
||||||
|
}
|
||||||
/**
|
|
||||||
* 获取节点的完整结构
|
// 递归计数
|
||||||
* @param tree 树数据
|
let count = 1
|
||||||
* @param nodeId 节点 id
|
|
||||||
*/
|
// 深层次校验
|
||||||
export const treeToString = (tree: any[], nodeId) => {
|
function performAThoroughValidation(arr: any[]): boolean {
|
||||||
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
count += 1
|
||||||
console.warn('tree must be an array')
|
for (const item of arr) {
|
||||||
return ''
|
if (item.id === nodeId) {
|
||||||
}
|
return true
|
||||||
// 校验是否是一级节点
|
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||||
const node = tree.find((item) => item.id === nodeId)
|
if (performAThoroughValidation(item.children)) {
|
||||||
if (typeof node !== 'undefined') {
|
return true
|
||||||
return node.name
|
}
|
||||||
}
|
}
|
||||||
let str = ''
|
}
|
||||||
|
return false
|
||||||
function performAThoroughValidation(arr) {
|
}
|
||||||
for (const item of arr) {
|
|
||||||
if (item.id === nodeId) {
|
for (const item of tree) {
|
||||||
str += ` / ${item.name}`
|
count = 1
|
||||||
return true
|
if (performAThoroughValidation(item.children)) {
|
||||||
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
// 找到后对比是否是期望的层级
|
||||||
str += ` / ${item.name}`
|
if (count >= level) {
|
||||||
if (performAThoroughValidation(item.children)) {
|
return true
|
||||||
return true
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const item of tree) {
|
/**
|
||||||
str = `${item.name}`
|
* 获取节点的完整结构
|
||||||
if (performAThoroughValidation(item.children)) {
|
* @param tree 树数据
|
||||||
break
|
* @param nodeId 节点 id
|
||||||
}
|
*/
|
||||||
}
|
export const treeToString = (tree: any[], nodeId) => {
|
||||||
return str
|
if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) {
|
||||||
}
|
console.warn('tree must be an array')
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
// 校验是否是一级节点
|
||||||
|
const node = tree.find((item) => item.id === nodeId)
|
||||||
|
if (typeof node !== 'undefined') {
|
||||||
|
return node.name
|
||||||
|
}
|
||||||
|
let str = ''
|
||||||
|
|
||||||
|
function performAThoroughValidation(arr) {
|
||||||
|
for (const item of arr) {
|
||||||
|
if (item.id === nodeId) {
|
||||||
|
str += ` / ${item.name}`
|
||||||
|
return true
|
||||||
|
} else if (typeof item.children !== 'undefined' && item.children.length !== 0) {
|
||||||
|
str += ` / ${item.name}`
|
||||||
|
if (performAThoroughValidation(item.children)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const item of tree) {
|
||||||
|
str = `${item.name}`
|
||||||
|
if (performAThoroughValidation(item.children)) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|||||||
50
src/utils/waveCache.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { getWaveRawList } from './waveRawStore'
|
||||||
|
|
||||||
|
const MAX_CACHE_SIZE = 6
|
||||||
|
|
||||||
|
const cache = new Map<string, unknown>()
|
||||||
|
|
||||||
|
function dataFingerprint(data: unknown[][] | undefined): string {
|
||||||
|
if (!data?.length) return '0'
|
||||||
|
const first = data[0]
|
||||||
|
const last = data[data.length - 1]
|
||||||
|
return `${data.length}:${first?.[0]}:${last?.[0]}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function buildWaveCacheKey(
|
||||||
|
type: 'shu' | 'rms',
|
||||||
|
wp: Record<string, any> | undefined,
|
||||||
|
value: number,
|
||||||
|
isOpen: boolean,
|
||||||
|
boxoList: Record<string, any>
|
||||||
|
): string {
|
||||||
|
if (!wp) return ''
|
||||||
|
const rawList = wp.waveStoreKey
|
||||||
|
? getWaveRawList(type, wp.waveStoreKey)
|
||||||
|
: ((type === 'shu' ? wp.listWaveData : wp.listRmsData) as unknown[][] | undefined)
|
||||||
|
const waveFp = dataFingerprint(rawList)
|
||||||
|
const boxoFp = boxoList?.startTime ?? boxoList?.lineName ?? boxoList?.equipmentName ?? ''
|
||||||
|
return `${type}|${wp.time}|${wp.waveType}|${wp.iphasic}|${value}|${isOpen}|${waveFp}|${boxoFp}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getWaveCache<T>(key: string): T | null {
|
||||||
|
if (!key || !cache.has(key)) return null
|
||||||
|
const value = cache.get(key) as T
|
||||||
|
cache.delete(key)
|
||||||
|
cache.set(key, value)
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setWaveCache(key: string, value: unknown): void {
|
||||||
|
if (!key) return
|
||||||
|
if (cache.has(key)) cache.delete(key)
|
||||||
|
cache.set(key, value)
|
||||||
|
while (cache.size > MAX_CACHE_SIZE) {
|
||||||
|
const oldest = cache.keys().next().value
|
||||||
|
if (oldest !== undefined) cache.delete(oldest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearWaveCache(): void {
|
||||||
|
cache.clear()
|
||||||
|
}
|
||||||