577 Commits

Author SHA1 Message Date
466d552165 签出调整 2025-11-26 10:53:52 +08:00
9d23303919 Merge remote-tracking branch 'origin/qr_branch' into qr_branch 2025-11-26 08:57:28 +08:00
83cdc4ba30 签出调整 2025-11-26 08:56:58 +08:00
caozehui
29efbae717 源未知异常处理 2025-11-06 08:42:04 +08:00
caozehui
a5177860de 微调 2025-09-03 14:23:05 +08:00
caozehui
66019e0d3c 闪变添加4000变动频度 2025-08-04 10:02:22 +08:00
caozehui
0ca992134f 微调 2025-08-01 09:44:00 +08:00
caozehui
128b02c145 微调 2025-08-01 08:46:44 +08:00
caozehui
bbc08679b9 微调 2025-08-01 08:42:26 +08:00
caozehui
bf8b8c9f0f NPQS-581表单默认加密、密钥和识别码为万能的 2025-07-31 14:16:27 +08:00
caozehui
00893d2d1f 微调 2025-07-31 09:40:12 +08:00
327801d040 出厂检测报告改造 2025-07-24 16:30:19 +08:00
caozehui
9e8e44b886 二楼检测项为空问题 2025-07-18 14:33:12 +08:00
sjl
d2f0382bd9 新增场景切换 2025-07-01 14:58:11 +08:00
sjl
9fecf0ce3f 用户管理去除时间查询 2025-07-01 10:47:59 +08:00
sjl
290586d0ff 全局误差小数位4-6位 2025-06-30 10:06:19 +08:00
sjl
ddc45af223 优化计划弹框 2025-06-27 10:57:57 +08:00
sjl
0e6f123306 新增计划初始化 2025-06-27 10:53:56 +08:00
sjl
7b93363b23 通用配置误差保留小数位 2025-06-27 09:01:06 +08:00
caozehui
2fd0dcb8a3 微调 2025-06-27 08:40:27 +08:00
caozehui
86ee05f8af 微调 2025-06-26 14:01:04 +08:00
caozehui
38814b9f44 手动检测根据检测内容不同动态决定是否进行初始化操作 2025-06-26 13:17:11 +08:00
caozehui
fb5d13671d Merge remote-tracking branch 'origin/master' 2025-06-25 09:22:14 +08:00
caozehui
310a769092 微调 2025-06-25 09:21:58 +08:00
sjl
8c63edabdc 楼下场景不用报告模版 2025-06-24 11:03:55 +08:00
caozehui
5363625a2f 微调 2025-06-24 09:22:36 +08:00
efcd6e1cfe 临时提交(自动检测步骤) 2025-06-23 13:19:38 +08:00
acc4d0ca67 被检设备表格增加IP字段 2025-06-20 14:58:28 +08:00
772f38feca 代码提交 2025-06-20 12:11:57 +08:00
sjl
1eb141e559 新增检测计划默认显示,为空判断 2025-06-11 16:01:23 +08:00
caozehui
16b446bf20 微调 2025-06-04 22:15:37 +08:00
sjl
bc0de34c15 预检测不显示温度框 2025-06-04 16:38:02 +08:00
sjl
15f2c1ee41 用户,角色超级管理员不可编辑 2025-05-29 10:49:26 +08:00
sjl
81a944062a Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-05-29 10:15:10 +08:00
sjl
3c19b05f4b 间谐波次数,IP地址 2025-05-29 10:15:03 +08:00
caozehui
c1f53cdc69 微调 2025-05-27 09:07:59 +08:00
sjl
6ef2a6049b 系数校准二次确认,输入框长度限值 2025-05-26 15:36:06 +08:00
caozehui
9989cc98cb 微调 2025-05-26 14:41:06 +08:00
caozehui
e192158deb 微调 2025-05-23 10:15:05 +08:00
caozehui
2e5d551e5d 添加脚本与ICD检验时出现10500错误 2025-05-22 18:43:33 +08:00
caozehui
4622eb36d9 ABC三项可以分开单独展示部分相的数据 2025-05-22 08:45:55 +08:00
caozehui
9c53b7c18e 微调 2025-05-21 15:29:39 +08:00
caozehui
7b3805060f 微调 2025-05-19 09:15:48 +08:00
caozehui
629600bc00 归档前如果设备没有生成报告则自动生成报告 2025-05-16 10:33:43 +08:00
caozehui
8b144b63fc 批量生成报告 2025-05-15 16:08:35 +08:00
caozehui
098ab3a41d 省级平台在正式检测时增加温度、相对湿度参数 2025-05-15 08:57:24 +08:00
caozehui
2a53f577aa 检测计划新增数据处理原则字段、全局配置中移除数据处理原则字段 2025-05-14 08:58:21 +08:00
caozehui
f8b7c224b7 检测计划数据源字段显示bug、脚本大项启用/禁用功能 2025-05-12 15:57:19 +08:00
caozehui
f0b3bdd37c 预检测出现连接超时错误提示 2025-05-12 14:38:25 +08:00
caozehui
bb35eb749b 不合格项复检bug 2025-05-09 08:51:54 +08:00
caozehui
b3750d6a7f 微调 2025-05-06 15:22:26 +08:00
caozehui
33ebb91ab6 微调 2025-05-06 15:14:58 +08:00
sjl
3e00f2fee7 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-05-06 11:00:23 +08:00
sjl
68e9856641 省级平台不展示系数校准 2025-05-06 11:00:12 +08:00
caozehui
51b2e80493 微调 2025-05-06 10:19:41 +08:00
sjl
cf77572f41 设备类型报告模版只在楼下厂家展示 2025-05-06 10:08:57 +08:00
GGJ
fe6524404c 微调 2025-04-29 10:47:25 +08:00
caozehui
ccda7218f4 检测计划数据源字段调整、绑定设备样式调整 2025-04-28 09:18:52 +08:00
caozehui
ddd0e6a22b (间)谐波含有率可以为小数 2025-04-27 16:11:48 +08:00
caozehui
ed85453de1 误差体系切换时-生成报告 2025-04-25 14:32:17 +08:00
caozehui
04939606fc 间谐波电流、间谐波电流复制bug,tooltip位置调整 2025-04-24 16:16:04 +08:00
caozehui
2df455b667 暂态设定幅值最大为180% 2025-04-24 10:18:27 +08:00
caozehui
8fb214d7a7 微调 2025-04-23 15:28:35 +08:00
caozehui
4f2c8a8016 微调 2025-04-23 10:45:46 +08:00
caozehui
c2974dbe0d 微调 2025-04-22 15:52:03 +08:00
caozehui
3891e5459a 误差体系修改 2025-04-22 14:21:24 +08:00
caozehui
9ed47ac5bc 检测结果数据显示问题 2025-04-22 14:12:07 +08:00
caozehui
114fcd140d 微调 2025-04-22 13:49:59 +08:00
caozehui
19a30894f8 微调 2025-04-21 09:11:31 +08:00
caozehui
2134fea518 微调 2025-04-21 09:10:24 +08:00
caozehui
82f495ce3b 调整窗口大小 2025-04-18 13:42:48 +08:00
caozehui
f2ecff54a3 微调 2025-04-18 11:07:04 +08:00
caozehui
f56004ac15 微调 2025-04-17 14:47:32 +08:00
caozehui
5303c47248 微调 2025-04-17 10:21:38 +08:00
GGJ
37731592f7 微调 2025-04-16 10:17:37 +08:00
caozehui
c9e41e0c82 日志导出csv、报告模板编辑框样式调整 2025-04-15 09:45:00 +08:00
caozehui
4a80a88e6e 微调 2025-04-14 19:51:06 +08:00
caozehui
30b219e14d 微调 2025-04-14 14:43:29 +08:00
caozehui
ecec9adeea icd校验 2025-04-14 13:22:46 +08:00
caozehui
1853152138 日志分页查询及展示 2025-04-11 14:34:56 +08:00
GGJ
5619413f37 修改点击使能默认够选通道使能,修改暂态使能持续时间保持一致 2025-04-10 11:11:23 +08:00
caozehui
5b736bc475 微调 2025-04-10 10:50:53 +08:00
caozehui
2aa37c3fe3 微调 2025-04-09 20:42:17 +08:00
caozehui
4e0cb72f32 微调 2025-04-09 20:06:08 +08:00
caozehui
ce74ec4db7 bug修复 2025-04-09 19:30:00 +08:00
caozehui
9938306884 微调 2025-04-09 14:30:00 +08:00
caozehui
ef63fcf807 bug修复 2025-04-08 09:51:35 +08:00
caozehui
08cffa4256 bug修复 2025-04-08 09:43:12 +08:00
caozehui
e1a740f8bf 文件大小提示 2025-03-31 18:54:13 +08:00
caozehui
56d035253b 微调 2025-03-31 13:22:57 +08:00
caozehui
e7348107d0 解决forge库在桌面端无法使用的问题 2025-03-28 09:38:59 +08:00
caozehui
ea38b4eb21 微调 2025-03-28 09:31:46 +08:00
GGJ
67ef976739 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-27 18:34:51 +08:00
GGJ
60145ec4f7 修改参考设定值添加单位 2025-03-27 18:34:40 +08:00
caozehui
81600ddc69 引入获取是否自动生成报告接口 2025-03-27 16:20:16 +08:00
caozehui
e0941d628b 引入获取是否自动生成报告接口 2025-03-27 15:54:27 +08:00
caozehui
760dcbf723 微调 2025-03-27 14:59:01 +08:00
caozehui
b75ecb8c66 微调 2025-03-26 15:42:40 +08:00
caozehui
39f4cfa670 微调 2025-03-25 15:49:32 +08:00
caozehui
862251b83c 微调 2025-03-25 15:08:25 +08:00
caozehui
312490ce59 微调 2025-03-24 19:56:11 +08:00
caozehui
d7df999cf2 登录接口加密传输登录信息 2025-03-24 19:22:56 +08:00
caozehui
e0b1b5907b 微调 2025-03-24 15:41:53 +08:00
sjl
f06ca03881 微调 2025-03-24 14:59:45 +08:00
caozehui
a9b80ed33c 微调 2025-03-24 10:46:16 +08:00
sjl
834230b26a 报告模版 2025-03-24 08:56:08 +08:00
caozehui
403ddbfb6e 微调 2025-03-20 19:42:46 +08:00
caozehui
ffb44ea909 微调 2025-03-20 16:31:15 +08:00
sjl
b729e4efa1 微调 2025-03-19 13:30:11 +08:00
sjl
962c286fd5 主题切换 2025-03-19 10:26:41 +08:00
caozehui
c215f51554 微调 2025-03-18 19:38:27 +08:00
GGJ
859c85b427 检测脚本添加 额定电压 额定电流字段 2025-03-18 16:28:22 +08:00
sjl
5fe637e84f 微调 2025-03-17 16:03:53 +08:00
sjl
5f68071c77 微调颜色 2025-03-17 15:55:30 +08:00
caozehui
1675a5af31 微调 2025-03-17 14:33:19 +08:00
caozehui
ec1d09dbd0 微调 2025-03-17 13:30:00 +08:00
caozehui
eda7b516f6 微调 2025-03-17 13:24:35 +08:00
sjl
630eb48d28 微调 2025-03-17 13:17:12 +08:00
caozehui
0d2f8a7788 微调 2025-03-14 16:30:45 +08:00
GGJ
230c68f454 修改他不删除后编辑检测监本还存在问题 2025-03-14 16:23:27 +08:00
GGJ
68934060e6 修改参考设定值0不显示 2025-03-14 16:10:00 +08:00
GGJ
846e7514b7 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-14 15:03:45 +08:00
GGJ
410cfb0f7a 检测脚本添加额定电压、额定电流 修改bug 2025-03-14 15:03:36 +08:00
caozehui
c892410b07 微调 2025-03-14 14:45:39 +08:00
sjl
7caa4a5303 微调 2025-03-14 12:27:04 +08:00
sjl
c17efbf9f6 微调 2025-03-14 12:13:34 +08:00
c46abeecf5 websocket代码提交 2025-03-14 11:35:55 +08:00
caozehui
0947097932 微调 2025-03-14 11:23:49 +08:00
caozehui
50fc02d4eb 微调 2025-03-13 14:40:33 +08:00
caozehui
a122e9e1b3 微调 2025-03-12 15:01:58 +08:00
sjl
d7cfcc7855 微调 2025-03-12 11:17:12 +08:00
sjl
05948aebf5 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-12 09:53:01 +08:00
sjl
cca214aaf7 程控源 2025-03-12 09:52:52 +08:00
caozehui
0111954c5e 微调 2025-03-11 19:07:47 +08:00
sjl
ce31499964 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-11 18:58:39 +08:00
sjl
059864d193 微调 2025-03-11 18:58:26 +08:00
caozehui
6d2fb4dde8 微调 2025-03-11 18:29:09 +08:00
caozehui
49059d9c59 微调 2025-03-11 18:19:18 +08:00
caozehui
d2f7041988 微调 2025-03-11 18:10:10 +08:00
caozehui
f94372d20b 微调 2025-03-11 16:13:03 +08:00
sjl
9af98b034f 微调 2025-03-11 14:16:21 +08:00
sjl
341b8df5a9 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-11 11:31:02 +08:00
sjl
7470f697bd 微调 2025-03-11 11:30:52 +08:00
caozehui
c058b99a0d 微调 2025-03-11 11:30:10 +08:00
caozehui
d5eed13f38 测试项为1条时也展示出来 2025-03-11 11:04:02 +08:00
caozehui
c27ee88182 微调 2025-03-10 20:14:35 +08:00
sjl
e2559ffa65 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-10 20:00:03 +08:00
sjl
a0bd32453c 微调 2025-03-10 19:59:55 +08:00
sjl
54e7a91841 微调 2025-03-10 19:58:53 +08:00
caozehui
042f6eef51 脚本切换 2025-03-10 19:53:52 +08:00
GGJ
c9857326c6 修改 检测脚本参考值 2025-03-10 16:11:08 +08:00
GGJ
9c4e0094f9 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-10 16:00:15 +08:00
GGJ
781b27af51 修改间谐波值 2025-03-10 16:00:07 +08:00
caozehui
37e257afc8 Loading加载效果 2025-03-10 11:39:10 +08:00
GGJ
4d4fdd6190 修改测试bug 2025-03-10 11:18:32 +08:00
caozehui
0fd2d8252d 微调 2025-03-10 10:50:53 +08:00
caozehui
3cf5019880 源程控-时间展示 2025-03-10 10:10:32 +08:00
caozehui
258d3d692f 源参数默认展开 2025-03-10 10:09:15 +08:00
caozehui
667ed3bcc0 微调 2025-03-08 18:27:10 +08:00
caozehui
a882189022 微调 2025-03-08 18:13:16 +08:00
caozehui
686e009243 微调 2025-03-08 18:07:47 +08:00
caozehui
30d5f3390c Merge branch 'release' 2025-03-08 18:06:50 +08:00
caozehui
3398b414ca 微调 2025-03-08 16:56:57 +08:00
caozehui
b6a2c42feb Merge remote-tracking branch 'origin/release' into release
# Conflicts:
#	frontend/src/views/machine/controlSource/index.vue
2025-03-08 16:05:56 +08:00
caozehui
cb5a9050f2 微调 2025-03-08 16:04:43 +08:00
caozehui
661b27abd0 微调 2025-03-08 16:04:08 +08:00
caozehui
59a24c9ea2 Merge branch 'release' 2025-03-08 16:02:09 +08:00
caozehui
6cf5da5d48 微调 2025-03-08 16:01:41 +08:00
caozehui
537f5e2f4c Merge branch 'release'
# Conflicts:
#	frontend/src/views/machine/controlSource/index.vue
2025-03-08 14:39:20 +08:00
caozehui
70531a0729 微调 2025-03-08 14:36:48 +08:00
caozehui
ded15e5c8b 微调 2025-03-08 10:50:39 +08:00
caozehui
3021f7e4d3 微调 2025-03-08 10:49:42 +08:00
caozehui
876d9cfa00 微调 2025-03-08 10:48:25 +08:00
caozehui
8f28825162 微调 2025-03-08 10:47:19 +08:00
caozehui
0e6612f6bd 微调 2025-03-08 10:15:11 +08:00
caozehui
39183fde5d 微调 2025-03-07 16:26:14 +08:00
caozehui
b967419cb1 微调 2025-03-07 15:43:36 +08:00
sjl
0712698638 微调 2025-03-07 14:44:12 +08:00
sjl
d3a74e830f 微调 2025-03-07 14:00:20 +08:00
sjl
f68da773ab 微调 2025-03-07 13:17:11 +08:00
sjl
8db814dba4 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-03-07 10:17:14 +08:00
sjl
7dcff99de5 微调 2025-03-07 10:17:06 +08:00
caozehui
97100dfa63 复制-二次弹窗确认 2025-03-07 09:02:19 +08:00
caozehui
d41707fcf9 微调 2025-03-06 15:50:45 +08:00
sjl
2377916f29 微调 2025-03-05 11:19:16 +08:00
caozehui
be2f40715a 微调 2025-03-05 10:42:25 +08:00
sjl
489c0882ac 微调 2025-03-05 09:32:13 +08:00
sjl
492db88b45 检测脚本查看隐藏显示 2025-03-04 16:01:34 +08:00
caozehui
3b198eb4ed 微调 2025-03-04 14:12:50 +08:00
caozehui
5efc27d4b6 微调 2025-03-04 10:28:09 +08:00
sjl
ec9f270d04 检测脚本详情查看 2025-03-04 09:35:41 +08:00
caozehui
afd2d467f3 微调 2025-03-03 13:33:17 +08:00
caozehui
ff0798450d 微调 2025-03-03 13:29:48 +08:00
caozehui
fbefc70368 微调 2025-03-03 13:25:19 +08:00
caozehui
faa0bc54a6 不合格项复检 2025-03-03 11:35:12 +08:00
caozehui
bf5f4eab77 Merge branch 'master' into dev 2025-02-28 15:38:08 +08:00
GGJ
188456c970 添加查看页面 2025-02-28 13:58:15 +08:00
caozehui
c06334e96f Merge branch 'master' into dev
# Conflicts:
#	frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue
2025-02-28 09:03:05 +08:00
GGJ
82e8bf2e0b 优化检测脚本样式 2025-02-28 09:00:15 +08:00
GGJ
30382fb34d 添加一键重算功能 2025-02-27 16:24:13 +08:00
GGJ
c7e5ee0862 优化检测脚本页面 2025-02-27 15:09:09 +08:00
caozehui
d6ac63586b 合并master分支 2025-02-27 14:45:22 +08:00
caozehui
e0fd42199f 微调 2025-02-27 14:34:47 +08:00
caozehui
d9e3168484 Merge branch 'master' into dev
# Conflicts:
#	frontend/src/views/home/components/test.vue
#	frontend/src/views/home/components/testPopup.vue
2025-02-27 13:52:17 +08:00
caozehui
dc7e91ca66 微调 2025-02-27 10:07:41 +08:00
caozehui
692358d278 微调 2025-02-27 08:48:13 +08:00
GGJ
3750031d6b Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-02-27 08:42:37 +08:00
GGJ
0bae200241 优化检测脚本页面
录入检测脚本
2025-02-27 08:41:33 +08:00
sjl
61bd1a0d6a 微调 2025-02-26 19:49:23 +08:00
sjl
37cf3dfdd7 测试 2025-02-26 19:44:27 +08:00
caozehui
8be96ca64e 微调 2025-02-26 19:31:34 +08:00
sjl
d225391248 日志测试 2025-02-26 19:20:02 +08:00
sjl
f2fd0b078e 日志测试 2025-02-26 19:05:56 +08:00
caozehui
f71963ea3b 微调 2025-02-26 19:02:43 +08:00
sjl
6a635246bb 日志测试 2025-02-26 19:00:37 +08:00
caozehui
d338ca6b25 微调 2025-02-26 18:55:50 +08:00
caozehui
193c3b963c 微调 2025-02-26 18:07:57 +08:00
sjl
cad4965b1b 微调 2025-02-26 16:23:27 +08:00
caozehui
79306d846f 微调 2025-02-26 15:58:16 +08:00
caozehui
f4ea510c5d 测试1 2025-02-26 15:56:03 +08:00
sjl
07cc26fa8d 微调 2025-02-26 13:58:56 +08:00
sjl
f87e268242 微调 2025-02-26 13:57:42 +08:00
caozehui
1aeceffe0b 测试1 2025-02-26 13:57:07 +08:00
caozehui
fc97087767 测试1 2025-02-26 13:22:01 +08:00
sjl
61be97b04b Merge branch 'dev' of http://192.168.1.22:3000/frontend/pqs-9100_client into dev 2025-02-26 11:40:41 +08:00
sjl
934162875c 微调 2025-02-26 11:40:31 +08:00
caozehui
4b3991099a 微调 2025-02-26 11:25:20 +08:00
caozehui
b14a961c1a 微调 2025-02-26 11:13:28 +08:00
sjl
cbe41d80ce 合并frontend/src/views/home/components/testPopup.vue 2025-02-26 10:54:43 +08:00
sjl
28203f2621 微调 2025-02-26 10:52:39 +08:00
caozehui
b8492dfbe6 微调 2025-02-26 10:42:01 +08:00
caozehui
15faac8079 正式检测-移除重新检测按钮 2025-02-26 10:05:43 +08:00
caozehui
ad850ca4ee 微调 2025-02-26 10:00:44 +08:00
caozehui
6c05c6e06e 微调 2025-02-26 09:14:27 +08:00
caozehui
8b2cda80b1 微调 2025-02-25 16:37:59 +08:00
caozehui
3f7756b417 微调 2025-02-25 16:18:22 +08:00
caozehui
5004e319b6 微调 2025-02-25 15:11:23 +08:00
caozehui
19035f2dc9 微调 2025-02-25 15:03:45 +08:00
caozehui
9d8a5c76b2 微调 2025-02-25 14:52:06 +08:00
caozehui
6300eb2f43 微调 2025-02-25 14:13:59 +08:00
sjl
da58ffb621 微调 2025-02-25 14:01:07 +08:00
sjl
1500fafb92 微调 2025-02-25 14:00:40 +08:00
sjl
df53eea432 微调 2025-02-25 13:53:47 +08:00
sjl
cc1771c208 微调 2025-02-25 13:52:57 +08:00
caozehui
5e881c0804 微调 2025-02-25 13:48:44 +08:00
caozehui
5666e01ae0 微调 2025-02-25 13:47:33 +08:00
caozehui
4acec8a2d6 微调 2025-02-25 13:46:01 +08:00
sjl
426a511099 微调 2025-02-25 11:20:19 +08:00
caozehui
89303b44ae 微调 2025-02-25 11:00:04 +08:00
caozehui
ffb82066bb 正式检测设备连接超时,停止检测 2025-02-25 10:46:12 +08:00
caozehui
f46b8c0a56 微调 2025-02-25 10:29:29 +08:00
caozehui
280289af37 手动检测功能修改、一键检测功能修改(均未完成) 2025-02-25 10:17:33 +08:00
GGJ
a0c7f79302 修改检测脚本闪变编辑逻辑 2025-02-25 08:58:03 +08:00
GGJ
bd1eecc106 优化检测脚本页面 2025-02-24 16:45:39 +08:00
sjl
1a23bcb510 检测计划未检下拉框不可编辑 2025-02-24 16:30:52 +08:00
sjl
942c28d3bd 微调 2025-02-24 08:54:22 +08:00
GGJ
034b31ba47 联调检测脚本 2025-02-24 08:38:54 +08:00
sjl
7a76c2da8a 微调 2025-02-21 14:57:52 +08:00
caozehui
1a9d8e8606 检测通道数量微调 2025-02-21 09:05:06 +08:00
GGJ
14583d919d 联调检测脚本修改功能 2025-02-20 16:39:15 +08:00
caozehui
629fd174e4 微调 2025-02-20 15:01:15 +08:00
sjl
9080fe06a4 角标对齐 2025-02-20 10:21:36 +08:00
sjl
0e183bb5c1 检测源删除 2025-02-20 10:10:28 +08:00
GGJ
8caf856d2d 联调检测脚本页面 2025-02-19 16:54:54 +08:00
caozehui
d28669e6b0 正式检测-时间显示调整 2025-02-19 13:17:19 +08:00
700884d01a websocket代码提交 2025-02-19 11:28:52 +08:00
c06bd9fa24 websocket代码提交 2025-02-19 11:00:09 +08:00
GGJ
ce92a1d645 联调 新增检测脚本 2025-02-18 16:36:54 +08:00
caozehui
4f622da52c 调整检测计划导入、导出功能适应二楼装备 2025-02-18 15:58:38 +08:00
7d3e86a5fc websocket代码提交 2025-02-18 14:59:13 +08:00
sjl
c66d181b98 检测计划取消勾选 2025-02-18 09:00:23 +08:00
GGJ
f860630bfb 修改检测脚本新增页面路由权限 2025-02-18 08:51:20 +08:00
caozehui
6db4d79839 调整 2025-02-18 08:48:59 +08:00
GGJ
e2924d5e57 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
# Conflicts:
#	frontend/src/views/machine/testScript/components/testScriptPopup.vue
#	frontend/src/views/machine/testScript/index.vue
2025-02-17 16:46:20 +08:00
GGJ
92b9a82f21 修改检测脚本页面 2025-02-17 16:44:02 +08:00
sjl
c3f89ca1f8 微调 2025-02-17 16:32:02 +08:00
sjl
8c435c91dd Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-02-17 16:29:06 +08:00
sjl
6e6cfa5be0 微调 2025-02-17 16:28:59 +08:00
caozehui
ea203d0ccc 调整统计分析功能 2025-02-17 16:26:23 +08:00
caozehui
370cd52774 调整静态路由 2025-02-17 13:37:27 +08:00
caozehui
942bae3045 微调 2025-02-17 11:30:56 +08:00
caozehui
356548c8fb 显示时间 2025-02-17 10:16:48 +08:00
GGJ
5c012c2bc9 修改 检测脚本新增页面 2025-02-17 09:00:27 +08:00
GGJ
9c9b8015a0 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-02-17 08:40:19 +08:00
GGJ
bba0ced7f9 修改 测试脚本页面 2025-02-17 08:39:18 +08:00
caozehui
e8de7b56d9 微调 2025-02-14 16:22:45 +08:00
caozehui
95022f62a8 数据分析 2025-02-14 13:30:50 +08:00
sjl
1d918f3335 微调 2025-02-14 11:44:19 +08:00
caozehui
f992637ad2 微调 2025-02-14 10:59:21 +08:00
caozehui
40f18bbdf8 微调 2025-02-14 10:39:00 +08:00
caozehui
3bb9cec08a 微调 2025-02-14 10:31:16 +08:00
caozehui
6842260f59 微调 2025-02-14 09:57:26 +08:00
sjl
305c30d725 微调 2025-02-14 09:16:07 +08:00
caozehui
e799dd2f08 移除headers中的Refresh-Token,添加Is-Refresh-Token 2025-02-13 21:02:34 +08:00
GGJ
1e83172e9a 修改检测脚本页面 2025-02-13 16:15:26 +08:00
sjl
475d236b7e 微调 2025-02-13 15:40:13 +08:00
sjl
ddeb84fcfe 微调 2025-02-11 14:25:12 +08:00
sjl
b3aeebb7c7 icd管理 2025-02-11 11:26:50 +08:00
sjl
b11f4839f4 微调 2025-02-11 10:59:41 +08:00
sjl
4adc28a055 设备类型 2025-02-11 10:40:34 +08:00
sjl
e46e9e1d3a 设备类型CRUD 2025-02-11 10:32:09 +08:00
sjl
4fcb26bbde Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-02-11 10:31:57 +08:00
caozehui
6bd0e891fa 改为12通道 2025-02-11 09:10:50 +08:00
sjl
15f1308557 设备类型 2025-02-10 16:35:14 +08:00
caozehui
9689197db9 微调 2025-02-10 15:41:59 +08:00
caozehui
4ad490657f 微调 2025-02-10 15:16:13 +08:00
caozehui
9f8f8244e3 微调 2025-02-08 15:36:56 +08:00
sjl
9206be2562 登录失效 2025-02-07 14:28:15 +08:00
caozehui
6065fd1f67 双token(未做完) 2025-02-07 10:39:30 +08:00
sjl
c16560a0ca 微调 2025-01-23 10:05:47 +08:00
caozehui
440cfe1ac5 源未开启外联机错误弹窗出现2次 2025-01-23 09:33:00 +08:00
sjl
1ad1a0198e 微调 2025-01-22 16:28:09 +08:00
caozehui
b603ac9bdb 源未开启外联机错误 2025-01-22 14:31:53 +08:00
caozehui
68aa4c409b 三项不平衡原始数据表头修改 2025-01-22 14:03:50 +08:00
sjl
f22b4e7fb8 微调 2025-01-22 12:09:32 +08:00
caozehui
400328d5fa 引入导出原始数据接口 2025-01-21 14:52:44 +08:00
caozehui
cce3e6861a 查看结果弹窗-通道下拉框 2025-01-21 11:06:22 +08:00
sjl
55368ce9b8 微调 2025-01-21 09:05:35 +08:00
caozehui
c6ef54f7d3 正式检测-预检测阶段错误码处理、频率、三项电压不平衡表头修改 2025-01-20 15:24:29 +08:00
GGJ
6f97c48226 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-17 15:06:58 +08:00
GGJ
5f45bc98fb 修改 WebSocket 关闭浏览器心跳问题 2025-01-17 15:06:44 +08:00
sjl
5738594be2 微调 2025-01-17 14:57:17 +08:00
sjl
ce47831992 socket连接不上处理 2025-01-17 09:59:23 +08:00
634c2d84fc Merge remote-tracking branch 'origin/master' 2025-01-17 09:35:58 +08:00
70855c5a21 websocket代码提交 2025-01-17 09:35:44 +08:00
sjl
b1e5e70411 微调 2025-01-17 09:25:52 +08:00
sjl
bf2e3219fc Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-17 09:15:58 +08:00
sjl
2f5aeb9ffc 微调 2025-01-17 09:15:52 +08:00
9e8ed310fc websocket代码提交 2025-01-17 09:14:19 +08:00
07a5e32579 批量导入被检设备 2025-01-16 19:45:48 +08:00
sjl
fe1bb04922 微调 2025-01-16 16:32:06 +08:00
a75e964adc 正式检测代码提交 2025-01-16 15:57:29 +08:00
sjl
87d22032e6 微调 2025-01-16 15:43:58 +08:00
sjl
55ae64b3e1 微调 2025-01-16 14:24:55 +08:00
caozehui
891c6d8e93 检测结果查看,相角类的放在最后展示 2025-01-16 10:00:49 +08:00
caozehui
ba7747dfe9 暂停时间过长页面效果 2025-01-16 08:51:47 +08:00
b148c04059 正式检测代码提交 2025-01-15 21:08:07 +08:00
sjl
4e179d61b5 微调 2025-01-15 20:37:58 +08:00
sjl
b23ee84543 微调 2025-01-15 20:32:14 +08:00
sjl
d02f85cea5 微调 2025-01-15 20:23:05 +08:00
ab02f8f1b3 正式检测代码提交 2025-01-15 19:27:33 +08:00
8fc1d1ffc9 微调报告 2025-01-15 18:01:12 +08:00
caozehui
44b1da94c1 二楼使用设备导入导出 2025-01-15 16:02:04 +08:00
sjl
c2b63a7a3f 微调 2025-01-15 13:46:11 +08:00
sjl
56619c9140 微调 2025-01-15 13:26:05 +08:00
caozehui
99bbb5434d 切换通道左侧树问题、点击左侧树测试项类别清空、点击左侧树赋值ScriptType 2025-01-15 10:49:28 +08:00
GGJ
40c9c5fdad 修改打包后svg无法显示问题 2025-01-15 10:29:19 +08:00
caozehui
3ea2c93e43 T相显示为检测名称 2025-01-15 10:14:33 +08:00
sjl
6369c8ee63 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-15 09:36:12 +08:00
sjl
da4bbf1e2c 微调 2025-01-15 09:36:04 +08:00
sjl
14e5535fd8 微调 2025-01-15 09:35:36 +08:00
caozehui
4e53bb3b27 10552错误重新检测、相序校验25003错误 2025-01-15 09:33:07 +08:00
GGJ
e793fdbe42 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-15 09:07:23 +08:00
GGJ
0e41a5b9f1 修改tab刷新位置问题 2025-01-15 09:07:12 +08:00
caozehui
ac9dfd1669 测试小项日志展示 2025-01-15 08:59:47 +08:00
caozehui
72eb3e189b 暂停页面效果调整 2025-01-15 08:53:45 +08:00
GGJ
0cace11975 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-15 08:42:59 +08:00
GGJ
b8e502b168 修改页面缓存 2025-01-15 08:42:41 +08:00
caozehui
15502d0107 暂停页面效果调整 2025-01-14 21:07:52 +08:00
GGJ
cb4e4646bd Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-14 19:26:29 +08:00
GGJ
93ce1b4994 修改登录页样式 2025-01-14 19:26:22 +08:00
sjl
1c452b5574 微调 2025-01-14 19:05:08 +08:00
caozehui
876c06ef54 暂停页面效果调整 2025-01-14 18:58:13 +08:00
sjl
37d65a944d 微调 2025-01-14 16:24:29 +08:00
caozehui
7bc9321c86 Merge remote-tracking branch 'origin/master' 2025-01-14 16:22:05 +08:00
caozehui
ee564dccb6 暂停正式检测 2025-01-14 16:21:50 +08:00
GGJ
cdbb386c7c Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-14 16:19:51 +08:00
GGJ
325ade7cdc 修改样式 2025-01-14 16:19:15 +08:00
caozehui
fcd8c1a0dd 修复数据查询弹窗,左侧切换,检测项目切换时,数据错误 2025-01-14 16:16:30 +08:00
sjl
fa1cb02a51 微调 2025-01-14 16:03:37 +08:00
caozehui
40fe12cd96 相别名称修改,数据查询弹窗,数据为空时处理 2025-01-14 15:34:35 +08:00
sjl
d83c04dc8b Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-14 15:14:44 +08:00
sjl
23b2974597 微调 2025-01-14 15:14:37 +08:00
caozehui
f5e78316ef 被检测设备-模式字段隐藏 2025-01-14 14:40:35 +08:00
caozehui
cc2020f3d6 暂停调整 2025-01-14 14:17:05 +08:00
sjl
26cda335c5 微调 2025-01-14 11:43:35 +08:00
caozehui
171533cef0 调整优先级 2025-01-14 10:36:42 +08:00
sjl
69de6dd7a3 设备名称 2025-01-14 10:03:44 +08:00
sjl
9039ed4bdc Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-13 23:17:31 +08:00
sjl
131d3b7018 微调 2025-01-13 23:17:24 +08:00
caozehui
454aabdc97 右上角错误提示 2025-01-13 22:59:03 +08:00
caozehui
089c97d859 微调 2025-01-13 22:53:38 +08:00
caozehui
9ff5423368 完善归档接口 2025-01-13 22:50:55 +08:00
sjl
f29d6e8d88 归档 2025-01-13 22:47:15 +08:00
sjl
5199ee2db0 微调 2025-01-13 22:42:14 +08:00
caozehui
6de9e22b4c 谐波次数切换时,原始数据显示为T项NaN问题 2025-01-13 22:05:46 +08:00
caozehui
52968d9aaa 调整检测结果,可筛选测试项 2025-01-13 21:50:24 +08:00
sjl
b584142f5e 微调 2025-01-13 21:38:52 +08:00
sjl
edea30a406 刷新 2025-01-13 21:26:12 +08:00
sjl
1f3024eb91 刷新饼图 2025-01-13 21:06:24 +08:00
8b9abba74b 微调 2025-01-13 20:19:04 +08:00
sjl
4dec1392f7 设备类型接口 2025-01-13 19:28:51 +08:00
sjl
e54cbfbc0a 设备icd 2025-01-13 18:32:42 +08:00
caozehui
505cd93446 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	frontend/src/api/device/device/index.ts
2025-01-13 18:21:24 +08:00
caozehui
f3ee11ebab 引入归档接口 2025-01-13 18:20:35 +08:00
sjl
45295ef898 微调 2025-01-13 18:13:55 +08:00
sjl
0635dda6a0 微调 2025-01-13 18:12:36 +08:00
caozehui
f58f7b97e5 展示单位调整 2025-01-13 15:03:24 +08:00
caozehui
7556f0e5bc 原始数据导出按钮、返回左侧树形列表接口调整 2025-01-13 14:22:54 +08:00
caozehui
17fe29cb1b 谐波次数、弹窗位置 2025-01-13 13:57:24 +08:00
caozehui
4bb4eb80d9 报告生成 2025-01-13 09:59:05 +08:00
ae1507e775 添加下载 2025-01-13 09:35:41 +08:00
sjl
85d8a57bf7 微调 2025-01-13 08:56:13 +08:00
caozehui
42cf23a516 微调 2025-01-10 14:19:29 +08:00
caozehui
858cf75b46 处理右侧原始数据表格行数错误问题 2025-01-10 14:15:07 +08:00
caozehui
de8a392d2c 处理源未知异常、检测结果最大误差回显 2025-01-10 13:49:09 +08:00
caozehui
b614767b2d 处理装置配置异常 2025-01-10 11:03:29 +08:00
caozehui
5ebb8549bf 调整优先级 2025-01-10 10:47:08 +08:00
caozehui
ead1feb379 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	frontend/src/views/home/components/test.vue
2025-01-10 09:36:00 +08:00
caozehui
1474c15bd9 放开数据异常按钮弹窗 2025-01-10 09:34:22 +08:00
caozehui
f24f87dcc8 放开数据异常按钮弹窗 2025-01-10 09:20:32 +08:00
caozehui
d416f46b3a 微调 2025-01-10 09:15:59 +08:00
352df35205 正式检测代码提交 2025-01-09 20:02:34 +08:00
caozehui
e5f201515e 引入暂停、继续检测接口 2025-01-09 16:27:05 +08:00
caozehui
40520a7d30 修改正式检测结果展示错误 2025-01-09 15:49:32 +08:00
caozehui
cffbfe1380 预检测失败处理、正式检测-只检测某一个大项,日志bug 2025-01-09 14:45:43 +08:00
caozehui
839777ea4d 微调 2025-01-09 14:18:50 +08:00
sjl
5be1d22115 微调 2025-01-09 13:56:56 +08:00
caozehui
80d1912fd5 微调 2025-01-09 11:13:34 +08:00
caozehui
b94e0323d9 微调 2025-01-08 21:02:36 +08:00
caozehui
90f4e53e9f 微调 2025-01-08 20:57:11 +08:00
caozehui
7ebad7d6b9 微调 2025-01-08 19:11:34 +08:00
caozehui
34534a1dbf 微调 2025-01-08 18:52:17 +08:00
645fac0681 正式检测代码提交 2025-01-08 15:15:49 +08:00
0a23700403 正式检测代码提交 2025-01-08 15:15:25 +08:00
caozehui
c00f8843c0 微调 2025-01-08 14:48:19 +08:00
caozehui
8869974471 Merge remote-tracking branch 'origin/master' 2025-01-08 14:34:52 +08:00
caozehui
8125d60105 微调 2025-01-08 14:33:47 +08:00
sjl
5a32d5b7a8 系数校准多装置按行展示 2025-01-08 11:40:12 +08:00
caozehui
a1d113562b 微调 2025-01-08 11:02:16 +08:00
caozehui
4a7535e4f5 微调 2025-01-08 10:01:56 +08:00
caozehui
de5548bbbd 微调 2025-01-08 09:46:47 +08:00
caozehui
87c46e8477 微调 2025-01-07 20:24:44 +08:00
caozehui
edda224847 微调 2025-01-07 19:47:38 +08:00
caozehui
5ac6bbf04b 微调 2025-01-07 19:03:00 +08:00
caozehui
b0a5329937 微调 2025-01-07 17:44:25 +08:00
caozehui
7a0626413d 微调 2025-01-07 17:34:15 +08:00
fe04ad1573 正式检测代码提交 2025-01-07 16:27:51 +08:00
caozehui
689cc39bbc 返回结果 2025-01-07 14:54:44 +08:00
caozehui
ba0c577514 修改检测结果弹窗框 2025-01-07 11:19:33 +08:00
caozehui
a629907196 微调 2025-01-07 09:46:35 +08:00
caozehui
bf60bcfe12 微调 2025-01-07 09:01:10 +08:00
caozehui
27eb9a7d93 右侧表格1 2025-01-06 19:20:36 +08:00
caozehui
336ee843cc 微调 2025-01-06 14:50:36 +08:00
sjl
9eac101794 系数校准不合格提示 2025-01-06 14:27:57 +08:00
sjl
085fcc62aa Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-06 14:07:28 +08:00
sjl
99e6abbcfd 微调 2025-01-06 14:07:21 +08:00
a4b96066e0 样式调整 2025-01-06 14:02:22 +08:00
sjl
c4e2da8d67 主界面,系数校准界面调整 2025-01-06 09:21:24 +08:00
caozehui
1be15ee849 修改右侧表格结构 2025-01-06 08:51:14 +08:00
caozehui
99bc54349b 微调 2025-01-05 14:52:37 +08:00
caozehui
bf823ddff0 微调 2025-01-04 16:33:23 +08:00
caozehui
23e72f38a6 微调 2025-01-04 14:09:01 +08:00
caozehui
2d993b2f73 存在已经初始化步骤,重新检测 2025-01-04 10:49:05 +08:00
9703d35a3a 正式检测代码提交 2025-01-04 09:58:39 +08:00
caozehui
d10a7a4884 微调 2025-01-03 18:57:35 +08:00
caozehui
938b9054d3 微调 2025-01-03 11:27:36 +08:00
caozehui
8a5bcca901 微调 2025-01-02 20:27:36 +08:00
caozehui
410cd53e51 正式检测-预检测提示及日志功能 2025-01-02 18:00:58 +08:00
sjl
4031724fa9 tab页面自动切换 2025-01-02 14:17:41 +08:00
sjl
e95552e6b9 微调 2025-01-02 13:12:13 +08:00
sjl
012f7e3346 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2025-01-02 09:02:54 +08:00
sjl
cbe6c4a98d 微调 2025-01-02 09:02:46 +08:00
caozehui
aa52778e99 微调 2024-12-31 19:54:27 +08:00
caozehui
5e8dda0b75 微调 2024-12-31 19:03:52 +08:00
caozehui
081aeacff7 微调 2024-12-31 14:27:36 +08:00
caozehui
65e54ee2b5 正式检测-左侧检测大项动态获取 2024-12-30 20:55:11 +08:00
sjl
0fd6ebf810 系数校准调整 2024-12-30 19:59:15 +08:00
sjl
fa4b5d26e5 系数校准 2024-12-30 19:17:39 +08:00
sjl
23f45b38cb Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-30 14:43:20 +08:00
sjl
d76b055730 系数校准 2024-12-30 14:43:13 +08:00
caozehui
c334c07b39 微调 2024-12-30 14:41:34 +08:00
caozehui
45a5dcb068 微调 2024-12-28 16:50:32 +08:00
caozehui
3d9ba8b1cb 微调 2024-12-27 14:29:21 +08:00
caozehui
c6836cad06 微调 2024-12-27 13:36:20 +08:00
caozehui
e70d1cb3f2 处理正式检测bug 2024-12-27 10:31:15 +08:00
caozehui
af454e1a56 修改正式检测样式 2024-12-26 10:49:55 +08:00
sjl
6ce58e86ad 微调 2024-12-26 09:28:19 +08:00
2e17531c52 预见测代码 2024-12-25 20:29:27 +08:00
caozehui
6b76d89507 微调 2024-12-25 18:04:16 +08:00
caozehui
e4025e39cb 微调 2024-12-25 13:22:54 +08:00
sjl
af12dc8d0a frontend/src/views/machine/errorSystem/components/errorSystemDetailTable.vue 2024-12-24 20:25:10 +08:00
sjl
f0edeaee85 误差体系禁用 2024-12-24 20:22:36 +08:00
caozehui
5cbdadecc4 微调 2024-12-24 19:21:43 +08:00
caozehui
30c1f90513 微调 2024-12-24 11:29:31 +08:00
c241d8b819 预见测代码 2024-12-24 08:55:04 +08:00
24f12a3590 预见测代码 2024-12-23 21:02:00 +08:00
sjl
f17f5c9925 误差体系 2024-12-23 16:12:46 +08:00
sjl
99877b1c98 系数校准动态通道数 2024-12-23 15:08:14 +08:00
sjl
fdf91965d9 微调 2024-12-23 14:05:53 +08:00
caozehui
fd21d32f4a 微调 2024-12-23 13:23:28 +08:00
caozehui
0a4385f29b 微调 2024-12-21 12:41:06 +08:00
caozehui
63c6693d04 微调 2024-12-20 20:34:39 +08:00
caozehui
ff7084a332 微调 2024-12-20 20:20:08 +08:00
caozehui
b63e8897f5 微调 2024-12-20 20:14:52 +08:00
caozehui
dc3976f525 微调 2024-12-20 19:14:07 +08:00
caozehui
9b8765f001 引入store存放检测设备的相关信息 2024-12-20 18:19:18 +08:00
bbe23e1b14 预见测代码 2024-12-20 16:32:03 +08:00
sjl
5f0b36b3bb Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-20 10:43:58 +08:00
sjl
f0b75eae2f frontend/src/views/home/components/test.vue
frontend/src/views/home/components/timeTest.vue
2024-12-20 10:43:43 +08:00
caozehui
45e62b2750 微调 2024-12-20 10:43:17 +08:00
sjl
d11e4822ed 系数校准 2024-12-20 10:21:36 +08:00
caozehui
93b67fe845 修改正式检测,使其能按照通道进行页面展示 2024-12-20 10:19:58 +08:00
caozehui
ebc2ac1a41 微调 2024-12-18 20:26:18 +08:00
caozehui
4fd2f10ec6 正式检测页面修改 2024-12-18 18:53:55 +08:00
caozehui
2715871017 正式检测页面修改 2024-12-18 15:56:59 +08:00
sjl
4cfca89895 样式调整 2024-12-18 15:49:29 +08:00
53ead0e62f 下拉框添加模糊匹配 2024-12-18 14:55:14 +08:00
caozehui
b00967159a Merge remote-tracking branch 'origin/master' 2024-12-17 14:08:35 +08:00
caozehui
1b37684e3c 微调 2024-12-17 14:08:13 +08:00
sjl
48f393be25 主页模式切换 2024-12-17 14:08:01 +08:00
sjl
645fb83bce 微调 2024-12-17 13:57:45 +08:00
caozehui
fe8bc407d3 饼图数据默认,饼图数据计算方式调整 2024-12-17 13:57:18 +08:00
sjl
d20cab57be 微调 2024-12-17 13:38:59 +08:00
sjl
68df3d5e23 # frontend/src/views/home/components/table.vue
#	frontend/src/views/home/tabs/dashboard.vue
2024-12-17 11:36:02 +08:00
sjl
8984bc577e 微调 2024-12-17 11:34:54 +08:00
caozehui
07d02307e2 默认选中第一条检测计划 2024-12-17 11:12:21 +08:00
sjl
a027dc75c3 左侧树点击刷新饼图和表格 2024-12-16 16:33:18 +08:00
sjl
5da07d8631 微调 2024-12-16 15:25:30 +08:00
sjl
d061fc9b32 检测计划列表 2024-12-16 14:09:21 +08:00
caozehui
ae47d429ba 微调 2024-12-16 11:34:12 +08:00
caozehui
396d6a7336 微调 2024-12-16 10:54:40 +08:00
sjl
fdf826d5f8 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-13 16:35:55 +08:00
sjl
0db5fa650f 微调 2024-12-13 16:35:27 +08:00
GYYM
53b4616a87 微调 2024-12-13 08:56:42 +08:00
GYYM
b923b7c35d 饼图样式调整 2024-12-12 13:23:09 +08:00
sjl
8bd5351d29 检测计划表格误差体系,检测源跳转 2024-12-12 11:38:42 +08:00
GYYM
726f7841e8 日志显示内容微调 2024-12-11 19:12:04 +08:00
sjl
47883ce426 微调 2024-12-11 20:24:00 +08:00
GYYM
2459fc1848 正式检测日志修改 2024-12-11 18:48:54 +08:00
sjl
cbc11f636a Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-11 19:39:16 +08:00
sjl
5dbd6eb8be 检测计划 2024-12-11 19:39:09 +08:00
GYYM
167716e61b 首页、守时检测页样式调整 2024-12-11 17:46:59 +08:00
GYYM
6d7f045bce 归档页调整 2024-12-09 16:17:04 +08:00
GYYM
a73417ea02 修改未检状态的描述 2024-12-06 15:06:38 +08:00
GYYM
9c3850db98 文字修改 2024-12-06 09:21:55 +08:00
393ad5fa0b 单元格样式调整 2024-12-06 09:18:13 +08:00
sjl
9e8fe2c91f Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-06 09:11:55 +08:00
sjl
b57a7edf28 微调弹出框 2024-12-06 09:11:44 +08:00
GYYM
85cc5ebb27 修改不合格项表头的提示方式 2024-12-06 09:10:39 +08:00
GGJ
0cd32fbb5f 修改表格样式 2024-12-06 09:07:16 +08:00
GYYM
2833e65f57 修改正式检测首列的显示样式 2024-12-05 22:15:12 +08:00
GYYM
5a29403636 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-05 21:34:10 +08:00
GYYM
9c0b9a7c93 样式调整 2024-12-05 21:33:52 +08:00
sjl
69a4cbbbc2 微调 2024-12-05 20:29:28 +08:00
sjl
e2b2382cc4 误差体系 2024-12-05 20:11:26 +08:00
sjl
f8a4d05f57 误差体系 2024-12-05 20:06:59 +08:00
caozehui
d996c43f9f Merge remote-tracking branch 'origin/master' 2024-12-05 19:31:56 +08:00
caozehui
c195a58eb4 微调 2024-12-05 19:31:43 +08:00
GGJ
b1c9375873 修改样式 2024-12-05 18:14:43 +08:00
GYYM
6010cbf20a 微调 2024-12-05 17:30:25 +08:00
sjl
11c32ed360 3列弹出框 2024-12-05 16:23:20 +08:00
GYYM
0494822ff4 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-05 15:26:06 +08:00
GYYM
2611f43d1f 微调 2024-12-05 15:25:49 +08:00
GGJ
ea4edfadd0 修改样式 2024-12-05 15:22:46 +08:00
caozehui
8e2a22cf61 微调 2024-12-05 14:37:50 +08:00
sjl
3a1cfe0f31 微调 2024-12-05 13:59:15 +08:00
sjl
5bdc44b301 微调 2024-12-05 13:51:47 +08:00
GYYM
92a1736667 守时微调 2024-12-05 13:46:53 +08:00
caozehui
57f9238033 Merge remote-tracking branch 'origin/master' 2024-12-05 13:43:19 +08:00
caozehui
1b171d4b8d 微调 2024-12-05 13:43:05 +08:00
GYYM
c5acb84d97 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-05 11:21:28 +08:00
GYYM
63a1e9ec56 微调 2024-12-05 11:21:10 +08:00
sjl
f06a8d6b15 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-05 11:07:57 +08:00
GGJ
92df927453 修改样式问题 2024-12-05 11:07:54 +08:00
sjl
2878dce69d 模式切换 2024-12-05 11:07:45 +08:00
caozehui
7d5d128b54 微调 2024-12-05 09:55:35 +08:00
GYYM
6e9e3db358 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-04 21:37:25 +08:00
GYYM
a415ffa12a 样式调整 2024-12-04 21:36:12 +08:00
sjl
9e8cdaead6 Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client 2024-12-04 20:00:15 +08:00
sjl
e5d4aae846 微调 2024-12-04 20:00:04 +08:00
caozehui
d6af35828d 样式调整 2024-12-04 19:54:56 +08:00
GYYM
aa86c5e662 微调 2024-12-04 10:20:55 +08:00
GYYM
f99aa94b8f 数据内容微调 2024-12-04 09:44:26 +08:00
sjl
f5c226ba28 微调通用配置 2024-12-04 09:08:48 +08:00
sjl
741020fe79 微调 2024-12-04 08:49:42 +08:00
GYYM
33004e081d 样式调整 2024-12-03 17:13:47 +08:00
180 changed files with 22945 additions and 9854 deletions

View File

@@ -1,112 +0,0 @@
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from "axios";
import { showFullScreenLoading, tryHideFullScreenLoading } from "@/components/Loading/fullScreen";
import { LOGIN_URL } from "@/config";
import { ElMessage } from "element-plus";
import { ResultData } from "@/api/interface";
import { ResultEnum } from "@/enums/httpEnum";
import { checkStatus } from "./helper/checkStatus";
import { useUserStore } from "@/stores/modules/user";
import router from "@/routers";
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
loading?: boolean;
}
const config = {
// 默认地址请求地址,可在 .env.** 文件中修改
baseURL: import.meta.env.VITE_API_URL as string,
// 设置超时时间
timeout: ResultEnum.TIMEOUT as number,
// 跨域时候允许携带凭证
withCredentials: true,
// post请求指定数据类型以及编码
headers: { 'Content-Type': 'application/json;charset=utf-8' }
};
class RequestHttp {
service: AxiosInstance;
public constructor(config: AxiosRequestConfig) {
// 创建实例
this.service = axios.create(config);
/**
* @description 请求拦截器
* 客户端发送请求 -> [请求拦截器] -> 服务器
* token校验(JWT) : 接受服务器返回的 token,存储到 vuex/pinia/本地储存当中
*/
this.service.interceptors.request.use(
(config: CustomAxiosRequestConfig) => {
const userStore = useUserStore();
// 当前请求不需要显示 loading在 api 服务中通过指定的第三个参数: { loading: false } 来控制
config.loading ?? (config.loading = true);
config.loading && showFullScreenLoading();
if (config.headers && typeof config.headers.set === "function") {
config.headers.set("x-access-token", userStore.token);
}
return config;
},
(error: AxiosError) => {
return Promise.reject(error);
}
);
/**
* @description 响应拦截器
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
*/
this.service.interceptors.response.use(
(response: AxiosResponse) => {
const { data } = response;
const userStore = useUserStore();
tryHideFullScreenLoading();
// 登陆失效
if (data.code == ResultEnum.OVERDUE) {
userStore.setToken("");
router.replace(LOGIN_URL);
ElMessage.error(data.message);
return Promise.reject(data);
}
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
if (data.code && data.code !== ResultEnum.SUCCESS) {
ElMessage.error(data.message);
return Promise.reject(data);
}
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
return data;
},
async (error: AxiosError) => {
const { response } = error;
tryHideFullScreenLoading();
// 请求超时 && 网络错误单独判断,没有 response
if (error.message.indexOf("timeout") !== -1) ElMessage.error("请求超时!请您稍后重试");
if (error.message.indexOf("Network Error") !== -1) ElMessage.error("网络错误!请您稍后重试");
// 根据服务器响应的错误状态码,做不同的处理
if (response) checkStatus(response.status);
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
if (!window.navigator.onLine) router.replace("/500");
return Promise.reject(error);
}
);
}
/**
* @description 常用请求方法封装
*/
get<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
return this.service.get(url, { params, ..._object });
}
post<T>(url: string, params?: object | string, _object = {}): Promise<ResultData<T>> {
return this.service.post(url, params, _object);
}
put<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
return this.service.put(url, params, _object);
}
delete<T>(url: string, params?: any, _object = {}): Promise<ResultData<T>> {
return this.service.delete(url, { params, ..._object });
}
download(url: string, params?: object, _object = {}): Promise<BlobPart> {
return this.service.post(url, params, { ..._object, responseType: "blob" });
}
}
export default new RequestHttp(config);

12
.vscode/settings.json vendored
View File

@@ -1,18 +1,28 @@
{ {
"cSpell.words": [ "cSpell.words": [
"Analyse",
"CHNFACTOR",
"CHNPACTOR",
"Chns", "Chns",
"Combox", "Combox",
"Datasource",
"daterange", "daterange",
"devicedata", "devicedata",
"errordata", "errordata",
"errordetail", "errordetail",
"Interharmonic",
"IRMS",
"logdata", "logdata",
"MSQI",
"Pids", "Pids",
"plandata", "plandata",
"PQDIF", "PQDIF",
"Preinvestment",
"resourcedata", "resourcedata",
"resourcename", "resourcename",
"rmark", "rmark",
"showtest" "showtest",
"UNBAN",
"VRMS"
] ]
} }

View File

@@ -25,10 +25,10 @@ module.exports = (appInfo) => {
*/ */
config.windowsOption = { config.windowsOption = {
title: '自动检测平台', title: '自动检测平台',
width: 1280, width: 1600,
height: 850, height: 950,
minWidth: 1280, minWidth: 1600,
minHeight: 850, minHeight: 950,
webPreferences: { webPreferences: {
//webSecurity: false, //webSecurity: false,
contextIsolation: false, // false -> 可在渲染进程中使用electron的apitrue->需要bridge.js(contextBridge) contextIsolation: false, // false -> 可在渲染进程中使用electron的apitrue->需要bridge.js(contextBridge)

View File

@@ -19,6 +19,7 @@ VITE_API_URL=/api
# 开发环境跨域代理,支持配置多个 # 开发环境跨域代理,支持配置多个
#VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]] VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] #VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文

View File

@@ -22,4 +22,5 @@ VITE_DROP_CONSOLE=true
VITE_PWA=true VITE_PWA=true
# 线上环境接口地址 # 线上环境接口地址
#VITE_API_URL="/api" # 打包时用
VITE_API_URL="http://192.168.1.125:18092/" VITE_API_URL="http://192.168.1.125:18092/"

11
frontend/.prettierrc Normal file
View File

@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 4,
"printWidth": 120,
"useTabs": false,
"semi": false,
"arrowParens": "avoid",
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "ignore"
}

View File

@@ -22,9 +22,11 @@
"echarts": "^5.4.3", "echarts": "^5.4.3",
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"element-plus": "^2.7.8", "element-plus": "^2.7.8",
"html2canvas": "^1.4.1",
"md5": "^2.3.0", "md5": "^2.3.0",
"mitt": "^3.0.1", "mitt": "^3.0.1",
"mkdirp": "^3.0.1", "mkdirp": "^3.0.1",
"node-forge": "^1.3.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.2.1", "pinia": "^2.2.1",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
@@ -41,11 +43,14 @@
"devDependencies": { "devDependencies": {
"@rushstack/eslint-patch": "^1.8.0", "@rushstack/eslint-patch": "^1.8.0",
"@tsconfig/node20": "^20.1.4", "@tsconfig/node20": "^20.1.4",
"@types/html2canvas": "^1.0.0",
"@types/md5": "^2.3.2", "@types/md5": "^2.3.2",
"@types/node": "^20.14.14", "@types/node": "^20.14.14",
"@types/node-forge": "^1.3.11",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/qs": "^6.9.8", "@types/qs": "^6.9.8",
"@types/sortablejs": "^1.15.2", "@types/sortablejs": "^1.15.2",
"@types/xlsx": "^0.0.36",
"@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0", "@typescript-eslint/parser": "^6.7.0",
"@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue": "^5.0.5",
@@ -71,7 +76,7 @@
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-eslint": "^1.8.1", "vite-plugin-eslint": "^1.8.1",
"vite-plugin-html": "^3.2.0", "vite-plugin-html": "^3.2.0",
"vite-plugin-node-polyfills": "^0.22.0", "vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^0.16.5", "vite-plugin-pwa": "^0.16.5",
"vite-plugin-svg-icons": "^2.0.1", "vite-plugin-svg-icons": "^2.0.1",
"vue-tsc": "^2.0.21" "vue-tsc": "^2.0.21"

View File

@@ -5,7 +5,7 @@
:size='assemblySize' :size='assemblySize'
:button='buttonConfig' :button='buttonConfig'
> >
<router-view :key='$route.fullPath' /> <router-view />
</el-config-provider> </el-config-provider>
</template> </template>

View File

@@ -0,0 +1,205 @@
export namespace CheckData {
export interface DataCheck {
scriptName: string,
errorSysId: string,
dataRule: string,
deviceName: string,
chnNum: string,
}
export interface PhaseCheckResult {
// 检测源定值-标准值
resultData: number,
// 装置原始数据-被检值
data: number,
// 误差值
errorData: number,
// 第几次谐波
num?: number,
//符合、不符合
isData?: number,
//最大误差值
radius?: string,
unit?: string,
}
/**
* 用于定义 查看(设备)通道检测结果响应数据 类型
*/
export interface ResCheckResult {
dataA?: PhaseCheckResult | null,
dataB?: PhaseCheckResult | null,
dataC?: PhaseCheckResult | null,
dataT?: PhaseCheckResult | null,
// 第几次谐波
//num: number | null,
//符合、不符合
isData?: number,
//最大误差值
radius?: string,
//单位
unit?: string,
}
/**
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
*/
export interface CheckResult {
stdA?: string,
dataA?: string,
errorA?: string,
maxErrorA?: string,
isDataA?: number,
unitA?: string,
stdB?: string,
dataB?: string,
errorB?: string,
maxErrorB?: string,
isDataB?: number,
unitB?: string,
stdC?: string,
dataC?: string,
errorC?: string,
maxErrorC?: string,
isDataC?: number,
unitC?: string,
stdT?: string,
dataT?: string,
errorT?: string,
maxErrorT?: string,
isDataT?: number,
unitT?: string,
//最大误差值
maxError?: string,
unit?: string,
//符合、不符合
result?: number,
}
/**
* 用于定义 具体通道的原始数据类型
*/
export interface RawDataItem {
time?: string,
harmNum?: number | null,
dataA?: string,
dataB?: string,
dataC?: string,
dataT?: string,
unit?: string | null
}
export interface Device {
deviceId: string; //装置序号Id
deviceName: string; //设备名称
chnNum: number; //设备通道数
planId: string; //计划Id
devType: string; //设备类型
devVolt: number; //设备电压
devCurr: number; //设备电流
factorFlag: number; //是否支持系数校准
checkResult:number; //检测结果
}
// 用来描述检测脚本类型
export interface ScriptItem {
id: string,
code: string,
scriptName: string,
}
// 用来描述 检测数据-左侧树结构
export interface TreeItem {
id: string | null,
scriptTypeName: string | null,
sourceDesc: string | null,
harmNum: number | null,
index: number | null,
fly: number | null,
children: TreeItem[] | null,
}
// 用来描述 通道检测结果
export enum ChnCheckResultEnum {
UNKNOWN = -1,
LOADING = 0,
SUCCESS = 1,
FAIL = 2,
TIMEOUT = 3,
ERRORDATA = 4,
NOT_PART_IN_ERROR = 5
}
export interface DeviceCheckResult {
deviceId: string,
deviceName: string,
chnResult: ChnCheckResultEnum[] //通道检测结果
}
//用来描述 某个脚本测试项对所有通道的检测结果
export interface ScriptChnItem {
scriptType: string
scriptName?: string //可以不要该属性,有点多余
// 设备
devices: Array<DeviceCheckResult>
}
export enum ButtonColorEnum {
INFO = '#909399',
LOADING = 'var(--el-color-primary)',
SUCCESS = '#91cc75',
WARNING = '#e6a23c',
DANGER = '#f56c6c',
}
/**
* 用于描述 (设备)通道检测结果展示的按钮类型
*/
export interface ButtonResult {
color: ButtonColorEnum
icon: 'More' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled' | 'Minus'
}
/**
* 用于描述 脚本检测结果展示的按钮类型
*/
export interface ScriptChnViewItem {
scriptType: string,
scriptName?: string //脚本项名称,可以不要该属性,有点多余
// 设备
devices: Array<{
deviceId: string,
deviceName: string,
chnResult: ButtonResult[],
}>
}
/**
* 定义检测日志类型
*/
export interface LogItem {
type: 'info' | 'warning' | 'error'
log: string
}
/**
* 定义手动检测时,勾选的测试项
*/
export interface SelectTestItem {
preTest: boolean,
timeTest: boolean,
channelsTest: boolean,
test: boolean
}
}

View File

@@ -0,0 +1,99 @@
import http from "@/api";
import {CheckData} from "@/api/check/interface";
export const getBigTestItem = (params: {
reCheckType: number,
planId: string,
devIds: string[],
}) => {
return http.post(`/adPlan/getBigTestItem`, params, {loading: false});
}
/**
* 获取弹出框表单数据
* @param params 当为scriptType为null时表示查询所有脚本类型否则只查询指定脚本类型。当为chnNum为-1时表示查询所有通道否则只查询指定通道。
*/
export const getFormData = (params: {
planId: string,
deviceId: string,
chnNum: string,
scriptType: string | null
}) => {
return http.post("/result/formContent/", params, {loading: false});
}
/**
* 获取树形结构数据
* @param params
*/
export const getTreeData = (params: {
scriptId?: string,
devId?: string,
devNum?: string,
scriptType?: string | null,
code?: string,
}) => {
return http.post<CheckData.TreeItem[]>("/result/treeData/", params, {loading: false});
}
/**
* 获取检查数据
* @param params
*/
export const getTableData = (params: {
scriptType: string | null,
scriptId: string,
devId: string,
devNum: string,
code: string,
index: number,
}) => {
return http.post("/result/resultData/", params, {loading: false});
}
export const exportRawData = (params: {
scriptType: string | null,
scriptId: string,
devId: string,
devNum: string,
code: string,
index: number,
}) => {
return http.download("/result/exportRawData", params, {loading: false});
}
/**
* 重新计算
* @param params
*/
export const reCalculate = (params: {
planId: string,
scriptId: string,
errorSysId: string,
deviceId: string,
code: string
}) => {
return http.post("/result/reCalculate", params, {loading: true});
}
/**
* 更换误差体系
* @param params
*/
export const changeErrorSystem = (params: {
planId: string,
scriptId: string,
errorSysId: string,
deviceId: string,
code: string
}) => {
return http.post("/result/changeErrorSystem", params, {loading: true});
}
/**
* 删除(误差体系切换时产生的)临时表
* @param code
*/
export const deleteTempTable = (code: string) => {
return http.get(`/result/deleteTempTable?code=${code}`, null, {loading: false})
}

View File

@@ -0,0 +1,24 @@
import type { controlSource } from '@/api/device/interface/controlSource'
import http from '@/api'
/**
* @name 程控源管理模块
*/
//通讯校验
export const checkSimulate = (params: controlSource.ResControl) => {
return http.post(`/prepare/ytxCheckSimulate`,params)
}
//启动
export const startSimulateTest = (params: controlSource.ResControl) => {
return http.post(`prepare/startSimulateTest`,params,{loading:false})
}
//停止
export const closeSimulateTest = (params: controlSource.ResControl) => {
return http.post(`/prepare/closeSimulateTest`,params,{loading:false})
}

View File

@@ -0,0 +1,29 @@
import type { DevType } from '@/api/device/interface/devType'
import http from '@/api'
/**
* @name 设备类型管理模块
*/
//获取设备类型
export const getDevTypeList = (params: DevType.ReqPqDevTypeParams) => {
return http.post(`/devType/list`, params)
}
//添加设备类型
export const addDevType = (params: DevType.ResPqDevType) => {
return http.post(`/devType/add`, params)
}
//编辑设备类型
export const updateDevType = (params: DevType.ResPqDevType) => {
return http.post(`/devType/update`, params)
}
//删除设备类型
export const deleteDevType = (params: string[]) => {
return http.post(`/devType/delete`, params)
}

View File

@@ -48,64 +48,64 @@ const data = [
{ {
id: '1', //装置序号ID id: '1', //装置序号ID
name: '240001', //设备名称 name: '240001', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '2', //装置序号ID id: '2', //装置序号ID
name: '240002', //设备名称 name: '240002', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '3', //装置序号ID id: '3', //装置序号ID
name: '240003', //设备名称 name: '240003', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '4', //装置序号ID id: '4', //装置序号ID
name: '240004', //设备名称 name: '240004', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '5', //装置序号ID id: '5', //装置序号ID
name: '240005', //设备名称 name: '240005', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '有不合格项', //检测结果 check_Result: '不符合', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 1, //复检次数
}, },
{ {
id: '6', //装置序号ID id: '6', //装置序号ID
name: '240006', //设备名称 name: '240006', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '有不合格项', //检测结果 check_Result: '不符合', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -114,9 +114,9 @@ const data = [
{ {
id: '7', //装置序号ID id: '7', //装置序号ID
name: '240007', //设备名称 name: '240007', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '全部合格', //检测结果 check_Result: '符合', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -125,20 +125,20 @@ const data = [
{ {
id: '8', //装置序号ID id: '8', //装置序号ID
name: '240008', //设备名称 name: '240008', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '全部合格', //检测结果 check_Result: '符合', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 1, //复检次数
}, },
{ {
id: '9', //装置序号ID id: '9', //装置序号ID
name: '240009', //设备名称 name: '240009', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '有不合格项', //检测结果 check_Result: '不符合', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -147,9 +147,9 @@ const data = [
{ {
id: '10', //装置序号ID id: '10', //装置序号ID
name: '240010', //设备名称 name: '240010', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '全部合格', //检测结果 check_Result: '符合', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -158,9 +158,9 @@ const data = [
{ {
id: '11', //装置序号ID id: '11', //装置序号ID
name: '240011', //设备名称 name: '240011', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '全部合格', //检测结果 check_Result: '符合', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '已归档', //归档状态 document_State: '已归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -169,9 +169,9 @@ const data = [
{ {
id: '12', //装置序号ID id: '12', //装置序号ID
name: '240012', //设备名称 name: '240012', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '全部合格', //检测结果 check_Result: '符合', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '已归档', //归档状态 document_State: '已归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -180,89 +180,89 @@ const data = [
{ {
id: '13', //装置序号ID id: '13', //装置序号ID
name: '240013', //设备名称 name: '240013', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '14', //装置序号ID id: '14', //装置序号ID
name: '240014', //设备名称 name: '240014', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '15', //装置序号ID id: '15', //装置序号ID
name: '240013', //设备名称 name: '240015', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '16', //装置序号ID id: '16', //装置序号ID
name: '240014', //设备名称 name: '240016', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '17', //装置序号ID id: '17', //装置序号ID
name: '240017', //设备名称 name: '240017', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '18', //装置序号ID id: '18', //装置序号ID
name: '240018', //设备名称 name: '240018', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '19', //装置序号ID id: '19', //装置序号ID
name: '240019', //设备名称 name: '240019', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '20', //装置序号ID id: '20', //装置序号ID
name: '240020', //设备名称 name: '240020', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果 check_Result: '未检', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
] ]

View File

@@ -29,11 +29,38 @@ export const deletePqDev = (params: string[]) => {
export const exportPqDev = (params: Device.ReqPqDevParams) => { export const exportPqDev = (params: Device.ReqPqDevParams) => {
return http.download(`/pqDev/export`, params) return http.download(`/pqDev/export`, params)
} }
// 下载导入文件模板
export const downloadTemplate = () => { export const downloadTemplate = () => {
return http.download(`/pqDev/downloadTemplate`) return http.download(`/pqDev/downloadTemplate`)
} }
//导入被检设备 //导入被检设备
export const importPqDev = (params: Device.ReqPqDevParams) => { export const importPqDev = (params: Device.ReqPqDevParams) => {
return http.upload(`/pqDev/import`, params) return http.uploadExcel(`/pqDev/import`, params)
} }
//导入比对式被检设备
export const importContrastPqDev = (params: Device.ReqPqDevParams) => {
return http.upload(`/pqDev/importContrast`, params)
}
// //导出灿能二楼设备
// export const exportCNDev = (params: Device.ReqPqDevParams) => {
// return http.download(`/pqDev/exportCNDev`, params)
// }
//
// // 下载灿能二楼设备导入文件模板
// export const downloadCNDevTemplate = () => {
// return http.download(`/pqDev/downloadCNDevTemplate`)
// }
//
// //导入灿能二楼设备
// export const importCNDev = (params: Device.ReqPqDevParams) => {
// return http.uploadExcel(`/pqDev/importCNDev`, params)
// }
//根据设备类型决定电源、icd、模板、通道数、额定电压、额定电流
export const getPqDev = () => {
return http.get(`/devType/listAll`)
}

View File

@@ -30,177 +30,202 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
}, },
]) ])
const errordetail = ref<ErrorSystem.Error_detail[]>([ const errorADetail = ref<ErrorSystem.Error_detail[]>([
{ {
measured: '电压偏差', col1: '电压偏差',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: '10%~150%标称电压', condition: '10%~150%标称电压',
maxErrorValue: '±0.1%Un' maxErrorValue: '±0.1%Un'
}, },
{ {
measured: '频率偏差', col1:'频率偏差',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'频率', measurementType:'频率',
condition: '42.5~57.5 Hz', condition: '42.5~57.5 Hz',
maxErrorValue: '±0.01Hz' maxErrorValue: '±0.01Hz'
}, },
{ {
measured: '三相不平衡度', col1:'三相不平衡度',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: '0.5%~5%', condition: '0.5%~5%',
maxErrorValue: '±0.15%' maxErrorValue: '±0.15%'
}, },
{ {
measured: '三相不平衡度', col1:'三相不平衡度',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: '5%(不包含)~ 40%', condition: '5%(不包含)~ 40%',
maxErrorValue: '±0.3%' maxErrorValue: '±0.3%'
}, },
{ {
measured: '三相不平衡度', col1:'三相不平衡度',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: '', condition: '',
maxErrorValue: '±1%' maxErrorValue: '±1%'
}, },
{ {
measured: '电压波动幅值', col1:'电压波动',
col2: '电压幅值',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: '', condition: '',
maxErrorValue: '±0.2%Un' maxErrorValue: '±0.2%Un'
}, },
{ {
measured: '电压波动持续时间', col1:'电压波动',
col2: '持续时间',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'时间', measurementType:'时间',
condition: '', condition: '',
maxErrorValue: '±1周波' maxErrorValue: '±1周波'
}, },
{ {
measured: '闪变', col1:'闪变',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'短时间闪变', measurementType:'短时间闪变',
condition: 'Pst0.2~10', condition: 'Pst0.2~10',
maxErrorValue: '±5%' maxErrorValue: '±5%'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: 'Uh≥1%Un', condition: 'Uh≥1%Un',
maxErrorValue: '±5%Uh' maxErrorValue: '±5%Uh'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: 'Uh1%Un', condition: 'Uh1%Un',
maxErrorValue: '±0.05%Un' maxErrorValue: '±0.05%Un'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: 'In≥3%In', condition: 'In≥3%In',
maxErrorValue: '±5%Ih' maxErrorValue: '±5%Ih'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: 'In3%In', condition: 'In3%In',
maxErrorValue: '±0.15%In' maxErrorValue: '±0.15%In'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'相角', measurementType:'相角',
condition: '', condition: '',
maxErrorValue: 'h≤5,±1°*h' maxErrorValue: 'h≤5,±1°*h'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'相角', measurementType:'相角',
condition: '', condition: '',
maxErrorValue: 'h>5,±5°' maxErrorValue: 'h>5,±5°'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'功率', measurementType:'功率',
condition: 'Ph≥150W', condition: 'Ph≥150W',
maxErrorValue: '±1%Ph' maxErrorValue: '±1%Ph'
}, },
{ {
measured: '谐波和间谐波', col1:'谐波和间谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'功率', measurementType:'功率',
condition: 'Ph150W', condition: 'Ph150W',
maxErrorValue: '±1.5W' maxErrorValue: '±1.5W'
}, },
{ {
measured: '高频次谐波', col1:'高频次谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: 'Uh≥1%Un', condition: 'Uh≥1%Un',
maxErrorValue: '±5%Uh' maxErrorValue: '±5%Uh'
}, },
{ {
measured: '高频次谐波', col1:'高频次谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: 'Uh1%Un', condition: 'Uh1%Un',
maxErrorValue: '±0.05%Un' maxErrorValue: '±0.05%Un'
}, },
{ {
measured: '高频次谐波', col1:'高频次谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: 'In≥3%In', condition: 'In≥3%In',
maxErrorValue: '±5%Ih' maxErrorValue: '±5%Ih'
}, },
{ {
measured: '高频次谐波', col1:'高频次谐波',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: 'In3%In', condition: 'In3%In',
maxErrorValue: '±0.15%In' maxErrorValue: '±0.15%In'
}, },
{ {
measured: '功率', col1:'功率',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'功率', measurementType:'功率',
condition: '', condition: '',
maxErrorValue: '±0.5%' maxErrorValue: '±0.5%'
}, },
{ {
measured: '电流', col1:'电流',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: 'I≥0.05In', condition: 'I≥0.05In',
maxErrorValue: '±0.5%' maxErrorValue: '±0.5%'
}, },
{ {
measured: '电流', col1:'电流',
col2: '',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电流', measurementType:'电流',
condition: '0.01In≤I0.05In', condition: '0.01In≤I0.05In',
maxErrorValue: '±1%' maxErrorValue: '±1%'
}, },
{ {
measured: '暂态电压幅值', col1: '电压暂降、电压暂升和短时中断',
col2: '电压幅值',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'电压', measurementType:'电压',
condition: '', condition: '',
maxErrorValue: '±0.2%Un' maxErrorValue: '±0.2%Un'
}, },
{ {
measured: '暂态持续时间', col1: '电压暂降、电压暂升和短时中断',
col2: '持续时间',
deviceLevel: 'A', deviceLevel: 'A',
measurementType:'时间', measurementType:'时间',
condition: '', condition: '',
@@ -208,5 +233,191 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
}, },
]) ])
const errorSDetail = ref<ErrorSystem.Error_detail[]>([
{
col1: '电压偏差',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: '20%~120%标称电压',
maxErrorValue: '±0.5%'
},
{
col1:'频率偏差',
col2: '',
deviceLevel: 'S',
measurementType:'频率',
condition: '42.5~57.5 Hz',
maxErrorValue: '±0.05Hz'
},
{
col1:'三相不平衡度',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: '1%~5%',
maxErrorValue: '±0.2%'
},
{
col1:'三相不平衡度',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: '5%(不包含)~ 40%',
maxErrorValue: '±0.6%'
},
{
col1:'三相不平衡度',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: '',
maxErrorValue: '±1%'
},
{
col1:'电压波动',
col2: '电压幅值',
deviceLevel: 'S',
measurementType:'电压',
condition: '',
maxErrorValue: '±1.0%Un'
},
{
col1:'电压波动',
col2: '持续时间',
deviceLevel: 'S',
measurementType:'时间',
condition: '使用半波刷新方均根值',
maxErrorValue: '±1周波'
},
{
col1:'电压波动',
col2: '持续时间',
deviceLevel: 'S',
measurementType:'时间',
condition: '使用全波刷新方均根值',
maxErrorValue: '±2周波'
},
{
col1:'闪变',
col2: '',
deviceLevel: 'S',
measurementType:'短时间闪变',
condition: 'Pst0.4~4',
maxErrorValue: '±10%'
},
{
col1:'谐波和间谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: 'Uh≥3%Un',
maxErrorValue: '±5%Uh'
},
{
col1:'谐波和间谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: 'Uh3%Un',
maxErrorValue: '±0.15%Un'
},
{
col1:'谐波和间谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: 'In≥10%In',
maxErrorValue: '±5%Ih'
},
{
col1:'谐波和间谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: 'In10%In',
maxErrorValue: '±0.5%In'
},
{
col1:'高频次谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: 'Uh≥3%Un',
maxErrorValue: '±5%Uh'
},
{
col1:'高频次谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电压',
condition: 'Uh3%Un',
maxErrorValue: '±0.15%Un'
},
{
col1:'高频次谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: 'In≥10%In',
maxErrorValue: '±5%Ih'
},
{
col1:'高频次谐波',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: 'In10%In',
maxErrorValue: '±0.5%In'
},
{
col1:'功率',
col2: '',
deviceLevel: 'S',
measurementType:'功率',
condition: '',
maxErrorValue: '±0.5%'
},
{
col1:'电流',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: 'I≥0.05In',
maxErrorValue: '±0.5%'
},
{
col1:'电流',
col2: '',
deviceLevel: 'S',
measurementType:'电流',
condition: '0.01In≤I0.05In',
maxErrorValue: '±1%'
},
{
col1: '电压暂降、电压暂升和短时中断',
col2: '电压幅值',
deviceLevel: 'S',
measurementType:'电压',
condition: '',
maxErrorValue: '±1.0%Un'
},
{
col1: '电压暂降、电压暂升和短时中断',
col2: '持续时间',
deviceLevel: 'S',
measurementType:'时间',
condition: '使用半波刷新方均根值',
maxErrorValue: '±1周波'
},
{
col1: '电压暂降、电压暂升和短时中断',
col2: '持续时间',
deviceLevel: 'S',
measurementType:'时间',
condition: '使用全波刷新方均根值',
maxErrorValue: '±2周波'
},
])
export default {errordata,errordetail} export default {errordata,errorADetail,errorSDetail}

View File

@@ -30,5 +30,7 @@ export const deletePqErrSys = (params: string[]) => {
return http.post(`/pqErrSys/delete`, params) return http.post(`/pqErrSys/delete`, params)
} }
//复制误差体系
export const copyPqErrSys = (params: ErrorSystem.ErrorSystemList) => {
return http.get(`/pqErrSys/copy?id=${params.id}`)
}

View File

@@ -0,0 +1,38 @@
import type { ICD } from '@/api/device/interface/icd'
import http from '@/api'
import { pa } from 'element-plus/es/locale/index.mjs'
/**
* @name ICD管理模块
*/
//获取ICD分页
export const getICDList = (params: ICD.ReqICDParams) => {
return http.post(`/icd/list`,params)
}
//获取ICD
export const getICDAllList = (params: ICD.ResICD) => {
return http.get(`/icd/listAll`,params)
}
//添加ICD
export const addICD = (params: ICD.ResICD) => {
return http.post(`/icd/add`, params)
}
//编辑ICD
export const updateICD = (params: ICD.ResICD) => {
return http.post(`/icd/update`, params)
}
//删除ICD
export const deleteICD = (params: string[]) => {
return http.post(`/icd/delete`, params)
}

View File

@@ -0,0 +1,15 @@
import type { ReqPage,ResPage } from '@/api/interface'
// 被检设备模块
export namespace controlSource {
/**
* 被检设备新增、修改、根据id查询返回的对象
*/
export interface ResControl {
userPageId: string;
scriptId: string;
scriptIndex: number;
sourceId: string;
}
}

View File

@@ -0,0 +1,40 @@
import type { ReqPage, ResPage } from '@/api/interface'
// 设备类型模块
export namespace DevType {
/**
* 设备类型数据表格分页查询参数
*/
export interface ReqPqDevTypeParams extends ReqPage {
id: string; // 装置序号id 必填
devType?: string; // 设备名称
createTime?: string; //创建时间
}
/**
* 设备类型新增、修改、根据id查询返回的对象
*/
export interface ResPqDevType {
id: string; //设备类型ID
name: string;//设备类型名称
icd: string| null;//设备关联的ICD
power: string| null;//工作电源
devVolt: number; //额定电压V
devCurr: number; //额定电流A
devChns: number; //设备通道数
reportName: string| null;//报告模版名称
state: number;
createBy?: string| null; //创建用户
createTime?: string| null; //创建时间
updateBy?: string| null; //更新用户
updateTime?: string| null; //更新时间
}
/**
* 设备类型表格查询分页返回的对象;
*/
export interface ResPqDevTypePage extends ResPage<ResPqDevType> {
}
}

View File

@@ -4,12 +4,25 @@ import type { ReqPage,ResPage } from '@/api/interface'
export namespace Device { export namespace Device {
/** /**
* 电能质量指标字典数据表格分页查询参数 * 被检设备表格分页查询参数
*/ */
export interface ReqPqDevParams extends ReqPage { export interface ReqPqDevParams extends ReqPage {
id: string; // 装置序号id 必填 id: string; // 装置序号id 必填
name: string; //设备名称
devType?: string; // 设备名称 devType?: string; // 设备名称
createTime?: string; //创建时间 createTime?: string; //创建时间
pattern: string;
}
/**
* 被检设备表格分页查询参数
*/
export interface ReqDevReportParams extends ReqPage {
planId?: string; // 计划id
devId?: string; // 装置id
scriptId?: string; // 脚本id
planCode?: string;
devIdList?: string[]; // 装置id列表
} }
/** /**
@@ -23,7 +36,7 @@ export namespace Device {
devChns: number; //设备通道数 devChns: number; //设备通道数
devVolt: number; //额定电压V devVolt: number; //额定电压V
devCurr: number; //额定电流A devCurr: number; //额定电流A
manufacturer: string;//生产厂家 manufacturer?: string | null;//生产厂家
createDate: string; //生产日期 createDate: string; //生产日期
createId: string; //出厂编号 createId: string; //出厂编号
hardwareVersion: string; //固件版本 hardwareVersion: string; //固件版本
@@ -34,7 +47,7 @@ export namespace Device {
encryptionFlag: number; //装置是否为加密版本 encryptionFlag: number; //装置是否为加密版本
series?: string | null; //装置识别码3ds加密 series?: string | null; //装置识别码3ds加密
devKey?: string | null; //装置秘钥3ds加密 devKey?: string | null; //装置秘钥3ds加密
sampleID?: string| null; //样品编号 sampleId?: string | null; //样品编号
arrivedDate?: string; //送样日期 arrivedDate?: string; //送样日期
cityName?: string | null; //所属地市名称 cityName?: string | null; //所属地市名称
gDName?: string | null; //所属供电公司名称 gDName?: string | null; //所属供电公司名称
@@ -42,18 +55,39 @@ export namespace Device {
checkState?: number | null; //检测状态 checkState?: number | null; //检测状态
checkResult?: number | null; //检测结果 checkResult?: number | null; //检测结果
reportState?: number | null; //报告状态 reportState?: number | null; //报告状态
documentState?: number| null; //归档状态
reportPath?: string | null; //报告路径 reportPath?: string | null; //报告路径
qRCode?: string | null; //设备关键信息二维码 qRCode?: string | null; //设备关键信息二维码
reCheckNum: number; //复检次数 reCheckNum: number; //复检次数
planId?: string;//检测计划Id
timeCheckResult?: number;//守时检测结果(0:不符合1:符合)
factorFlag?: number;//是否支持系数校准(0:不支持,1:支持)
factorCheckResult?: number;//系数校准结果(0:不合格1:合格2/表示没有做系数校准)
state: number; //状态 state: number; //状态
createBy?: string | null; //创建用户 createBy?: string | null; //创建用户
createTime?: string | null; //创建时间 createTime?: string | null; //创建时间
updateBy?: string | null; //更新用户 updateBy?: string | null; //更新用户
updateTime?: string | null; //更新时间 updateTime?: string | null; //更新时间
icdId: string | null;
power: string | null;//工作电源
preinvestmentPlan: string | null;
delegate: string | null; //委托方
} }
export interface ResDev {
id: string;
name: string,
icd: string,
power: string,
devVolt: number,
devCurr: number,
devChns: number,
}
export interface ResTH {
temperature :number | null;//温度
humidity:number | null;//湿度
}
/** /**
* 被检设备表格查询分页返回的对象; * 被检设备表格查询分页返回的对象;
*/ */

View File

@@ -22,25 +22,29 @@ export namespace ErrorSystem {
// 查看详细误差体系 // 查看详细误差体系
export interface ErrorSystemDetail { export interface ErrorSystemDetail {
nextId: number; sort: number;
id:string;//误差体系子表ID id:string;//误差体系子表ID
errorSysId:string;//所属误差体系ID errorSysId:string;//所属误差体系ID
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段) errorType: string;//误差类型,树形字典表(没有树形表则需要拆分字段)
startValue?:number;//误差判断起始值(误差范围) scriptType: string;//脚本类型
startValue?:number | null;//误差判断起始值(误差范围)
startFlag?:number;//是否包含起始值 startFlag?:number;//是否包含起始值
endValue?:number;//;误差判断结束值(误差范围) endValue?:number | null;//;误差判断结束值(误差范围)
endFlag?:number;//是否包含结束值 endFlag?:number;//是否包含结束值
conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值) conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
maxErrorValue:number;//误差最大值 maxErrorValue:number;//误差最大值
errorValueType:string;//误差值类型(包括值类型绝对值、相对值1、相对值2 errorValueType:any;//误差值类型(0标称值、1标准值、2值类型
valueType:number;//值类型1绝对值、2相对值
errorUnit:string;//误差单位
} }
//查看详细误差体系 //查看详细误差体系
// export interface Error_detail { export interface Error_detail {
// measured: string; col1: string;
// deviceLevel: string; col2: string;
// measurementType:string; deviceLevel: string;
// condition: string; measurementType:string;
// maxErrorValue: string; condition: string;
// } maxErrorValue: string;
}
} }

View File

@@ -0,0 +1,35 @@
import type { ReqPage, ResPage } from '@/api/interface'
// ICD模块
export namespace ICD {
/**
* ICD表格分页查询参数
*/
export interface ReqICDParams extends ReqPage {
id: string; // 装置序号id 必填
devType?: string; // 设备名称
createTime?: string; //创建时间
}
/**
* ICD新增、修改、根据id查询返回的对象
*/
export interface ResICD {
id: string; //icdID
name: string;//icd名称
path: string;//icd存储地址
state: number;
createBy?: string| null; //创建用户
createTime?: string| null; //创建时间
updateBy?: string| null; //更新用户
updateTime?: string| null; //更新时间
}
/**
* ICD表格查询分页返回的对象
*/
export interface ResICDPage extends ResPage<ResICD> {
}
}

View File

@@ -0,0 +1,39 @@
import type { ReqPage, ResPage } from '@/api/interface'
import type { UploadFile } from 'element-plus';
// 报告模版接口
export namespace PqReport {
/**
* 报告模版表格分页查询参数
*/
export interface ReqReportParams extends ReqPage {
id: string; // 装置序号id 必填
name?: string; // 设备名称
createTime?: string; //创建时间
}
/**
* 报告模版新增、修改、根据id查询返回的对象
*/
export interface ResReport {
id: string; //报告模板id
name: string;//报告模板名称
version:string;//版本号
baseFile?:string;//基础模板文件路径
detailFile?:string;//检测项模版文件路径
description:string;//描述信息
state:number;//状态:8-删除 1-正常
createBy?: string| null; //创建用户
createTime?: string| null; //创建时间
updateBy?: string| null; //更新用户
updateTime?: string| null; //更新时间
}
/**
* 报告模版表格查询分页返回的对象;
*/
export interface ResReportPage extends ResPage<ResReport> {
}
}

View File

@@ -2,37 +2,37 @@ import type { ReqPage, ResPage } from '@/api/interface'
// 检测脚本模块 // 检测脚本模块
export namespace TestScript { export namespace TestScript {
/** /**
* 检测脚本表格分页查询参数 * 检测脚本表格分页查询参数
*/ */
export interface ReqTestScriptParams extends ReqPage { export interface ReqTestScriptParams extends ReqPage {
id: string; // 装置序号id 必填 id: string // 装置序号id 必填
name: string; name: string
type: string; type: string
pattern: string
} }
// 检测脚本接口 // 检测脚本接口
export interface ResTestScript { export interface ResTestScript {
id?: string; //检测脚本ID id?: string //检测脚本ID
name: string; //检测脚本名称 name: string //检测脚本名称
type: string; //检测脚本类型(字典表Code字段脚本还是模板) type: string //设定0为脚本1为模板
pattern: string;//检测脚本模式(字典表Code字段数字、模拟、比对) pattern: string //检测脚本模式(字典表Code字段数字、模拟、比对)
valueType?: string;//脚本值类型(字典表Code字段相对值脚本、绝对值脚本、无) valueType?: string //脚本值类型(字典表Code字段相对值脚本、绝对值脚本、无)
standardName: string;//参照标准名称 standardName: string //参照标准名称
standardTime: string;//标准推行时间 standardTime: string //标准推行时间
state:number;// state?: number //
createBy?: string; createBy?: string
createTime?: string; createTime?: string
updateBy?: string; updateBy?: string
updateTime?: string; updateTime?: string
selectedValue?: string
ratedCurr?: number
ratedVolt?: number
} }
/** /**
* 检测脚本查询分页返回的对象; * 检测脚本查询分页返回的对象;
*/ */
export interface ResTestScriptPage extends ResPage<ResTestScript> { export interface ResTestScriptPage extends ResPage<ResTestScript> {}
}
} }

View File

@@ -15,7 +15,7 @@ export namespace TestSource {
// 检测源接口 // 检测源接口
export interface ResTestSource { export interface ResTestSource {
id: string; //检测源ID id: string; //检测源ID
name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成) name?: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
pattern: string;//检测源模式(字典表Code字段数字、模拟、比对) pattern: string;//检测源模式(字典表Code字段数字、模拟、比对)
type: string; //检测源类型(字典表Code字段标准源、高精度设备) type: string; //检测源类型(字典表Code字段标准源、高精度设备)
devType: string;//检测源设备类型(字典表Code字段) devType: string;//检测源设备类型(字典表Code字段)
@@ -34,9 +34,9 @@ export namespace TestSource {
} }
export interface ParameterType{ export interface ParameterType{
id:string; id:string;
sourceParamType:string; type:string;
sourceParamDesc:string; desc:string;
sourceParamValue:string; value:string|null;
sort:number; sort:number;
pId:string; pId:string;
children?:ParameterType[]; children?:ParameterType[];

View File

@@ -0,0 +1,51 @@
import type {PqReport} from '@/api/device/interface/report'
import http from '@/api'
/**
* @name 报告模版模块
*/
//获取报告模版
export const getPqReportList = (params: PqReport.ReqReportParams) => {
return http.post(`/report/list`, params)
}
//新增报告模版
export const addPqReport = (params: PqReport.ResReport) => {
return http.upload(`/report/add`, params)
}
//删除报告模版
export const deletePqReport = (params: string[]) => {
return http.post(`/report/delete`, params)
}
//查询报告模板详情
export const getPqReportById = (params: PqReport.ResReport) => {
return http.get(`/report/getById?id=${params.id}`)
}
//修改报告模板
export const updatePqReport = (params: PqReport.ResReport) => {
return http.upload(`/report/update`, params)
}
//查询所有报告模板名称
export const getPqReportAllName = () => {
return http.get(`/report/listAllName`)
}
//根据名称查询指定报告模板的所有版本
export const getPqReportAllVersion = (params:any) => {
return http.get(`/report/listAllVersion?name=${params.name}`)
}
//被检设备归档
export const documentedPqDev = (ids: string[]) => {
return http.post(`/report/documented`, ids)
}
//上传报告到云端
export const uploadReportToCloud = (deviceIds: string[]) => {
return http.post(`/report/uploadReportToCloud`, deviceIds)
}

View File

@@ -1,15 +1,23 @@
import type { TestScript } from '@/api/device/interface/testScript' import type { TestScript } from '@/api/device/interface/testScript'
import http from '@/api' import http from '@/api'
import { Loading } from '@element-plus/icons-vue'
/** /**
* @name 检测脚本管理模块 * @name 检测脚本管理模块
*/ */
// 新增脚本
export const pqScriptAdd = (params: TestScript.ResTestScript) => {
return http.post(`/pqScript/add`, params)
}
// 修改脚本
export const pqScriptUpdate = (params: TestScript.ResTestScript) => {
return http.post(`/pqScript/update`, params)
}
// 获取检测脚本列表 // 获取检测脚本列表
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => { export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
return http.post(`/pqScript/list`, params) return http.post(`/pqScript/list`, params)
} }
//升级为模版 //升级为模版
export const updatePqScript = (params: TestScript.ResTestScript) => { export const updatePqScript = (params: TestScript.ResTestScript) => {
return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`) return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
@@ -19,3 +27,27 @@ export const updatePqScript = (params: TestScript.ResTestScript) => {
export const deletePqScript = (params: string[]) => { export const deletePqScript = (params: string[]) => {
return http.post(`/pqScript/delete`, params) return http.post(`/pqScript/delete`, params)
} }
//添加检测脚本
export const addScriptDtls = (params: any) => {
return http.post(`/pqScript/addScriptDtls`, params)
}
//根据脚本id查询检测脚本详情
export const dlsDetails = (params: any) => {
return http.post(`/pqScript/dlsDetails`, params)
}
// 删除脚本
export const deleteDtls = (params: any) => {
return http.post(`/pqScript/deleteDtls`, params)
}
// 启用关闭脚本
export const updateDtls = (params: any) => {
return http.post(`/pqScript/updateDtls`, params)
}
// 根据通讯参数生成装置下发原始数据公式
export const scriptDtlsCheckDataList = (params: any) => {
return http.post(`/pqScript/scriptDtlsCheckDataList`, params,{loading: false})
}
// 通讯脚本回显
export const checkDataList = (params: any) => {
return http.post(`/pqScript/checkDataList`, params, { loading: true })
}

View File

@@ -10,9 +10,9 @@ export const checkStatus = (status: number) => {
case 400: case 400:
ElMessage.error("请求失败!请您稍后重试"); ElMessage.error("请求失败!请您稍后重试");
break; break;
case 401: // case 401:
ElMessage.error("登录失效!请您重新登录"); // ElMessage.error("登录失效!请您重新登录");
break; // break;
case 403: case 403:
ElMessage.error("当前账号无权限访问!"); ElMessage.error("当前账号无权限访问!");
break; break;

View File

@@ -0,0 +1,6 @@
import http from "@/api";
//系数校准发送基本信息
export const getCoefficientCheck = (params: any) => {
return http.post(`/prepare/coefficientCheck`, params,{loading: false})
}

View File

@@ -0,0 +1,31 @@
// 系数校准模块
export namespace ChannelsTest {
// 系数校准列表
export interface CoefficientVO {
devName?: string;//设备名称
type?:string;//区分大小电压
monitorNum: string;//监测点序号
desc: string;//描述
aVuData:string;//电压通道A数据
aVuXi:string;//电压通道A系数
bVuData:string;//电压通道B数据
bVuXi:string;//电压通道B系数
cVuData:string;//电压通道C数据
cVuXi:string;//电压通道C系数
aIeData:string;//电流通道A数据
aIeXi:string;//电流通道A系数
bIeData:string;//电流通道B数据
bIeXi:string;//电流通道B系数
cIeData:string;//电流通道C数据
cIeXi:string;//电流通道C系数
loading: boolean;
aV:string;
bV:string;
cV:string;
aI:string;
bI:string;
cI:string;
}
}

View File

@@ -1,3 +1,4 @@
import { ElMessage, ElTreeSelect } from 'element-plus';
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios' import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios'
import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen' import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen'
import { LOGIN_URL } from '@/config' import { LOGIN_URL } from '@/config'
@@ -7,6 +8,7 @@ import { ResultEnum } from '@/enums/httpEnum'
import { checkStatus } from './helper/checkStatus' import { checkStatus } from './helper/checkStatus'
import { useUserStore } from '@/stores/modules/user' import { useUserStore } from '@/stores/modules/user'
import router from '@/routers' import router from '@/routers'
import {refreshToken} from '@/api/user/login'
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig { export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
loading?: boolean; loading?: boolean;
@@ -37,12 +39,14 @@ class RequestHttp {
*/ */
this.service.interceptors.request.use( this.service.interceptors.request.use(
(config: CustomAxiosRequestConfig) => { (config: CustomAxiosRequestConfig) => {
isFirst = true
const userStore = useUserStore() const userStore = useUserStore()
// 当前请求不需要显示 loading在 api 服务中通过指定的第三个参数: { loading: false } 来控制 // 当前请求不需要显示 loading在 api 服务中通过指定的第三个参数: { loading: false } 来控制
config.loading ?? (config.loading = true) config.loading ?? (config.loading = true)
config.loading && showFullScreenLoading() config.loading && showFullScreenLoading()
if (config.headers && typeof config.headers.set === 'function') { if (config.headers && typeof config.headers.set === 'function') {
config.headers.set('Authorization', 'Bearer '+userStore.token) config.headers.set('Authorization', 'Bearer ' + userStore.accessToken)
config.headers.set('Is-Refresh-Token', userStore.isRefreshToken+"")
} }
return config return config
}, },
@@ -51,34 +55,82 @@ class RequestHttp {
}, },
) )
let isFirst = true
/** /**
* @description 响应拦截器 * @description 响应拦截器
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息 * 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
*/ */
this.service.interceptors.response.use( this.service.interceptors.response.use(
(response: AxiosResponse) => { async (response: AxiosResponse) => {
const { data } = response const { data } = response
const userStore = useUserStore() const userStore = useUserStore()
tryHideFullScreenLoading() tryHideFullScreenLoading()
if(data.code === ResultEnum.ACCESSTOKEN_EXPIRED){
// 用长token去换短token
userStore.setAccessToken(userStore.refreshToken)
userStore.setIsRefreshToken(true)
const result = await refreshToken()
if (result) { //获取新token成功的话
// 有新的token后重新请求
userStore.setAccessToken(result.data.accessToken)
userStore.setRefreshToken(result.data.refreshToken)
userStore.setIsRefreshToken(false)
userStore.setExp(1000 * 60 * 60 * 24 * 30)
response.config.headers.Authorization = `Bearer ${result.data.accessToken}`//重新请求前需要将更新后的新token更换掉之前无效的token,不然会死循环
const resp = await this.service.request(response.config)
return resp
} else {
// 刷新失效,跳转登录页
}
}
// 登陆失效 // 登陆失效
if (data.code == ResultEnum.OVERDUE) { if (data.code === ResultEnum.OVERDUE) {
userStore.setToken('') console.log("登陆失效")
userStore.setUserInfo({name: ''}) userStore.setAccessToken('')
router.replace(LOGIN_URL) userStore.setRefreshToken('')
userStore.setIsRefreshToken(false)
userStore.setUserInfo({ id:'',name: '' })
userStore.setExp(0)
await router.replace(LOGIN_URL)
if(isFirst){//临时处理token失效弹窗多次
ElMessage.error(data.message) ElMessage.error(data.message)
isFirst = false
}
return Promise.reject(data) return Promise.reject(data)
} }
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错) // 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
if (data.code && data.code !== ResultEnum.SUCCESS) { if (data.code && data.code !== ResultEnum.SUCCESS) {
if(data.message.includes('&')){
let formattedMessage = data.message.split('&').join('<br>');
if (data.message.includes(':')) {
formattedMessage = formattedMessage.replace(':', '')
}
ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true });
return Promise.reject(data)
}
ElMessage.error(data.message) ElMessage.error(data.message)
return Promise.reject(data) return Promise.reject(data)
} }
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑) // 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
if (userStore.exp <= Date.now() && userStore.exp !== 0) {
userStore.setAccessToken('')
userStore.setRefreshToken('')
userStore.setIsRefreshToken(false)
userStore.setUserInfo({ id:'',name: '' })
userStore.setExp(0)
ElMessage.error('登录已过期,请重新登录!')
await router.replace(LOGIN_URL)
return Promise.reject(data)
}
return data return data
}, },
async (error: AxiosError) => { async (error: AxiosError) => {
const { response } = error const { response } = error
tryHideFullScreenLoading() tryHideFullScreenLoading()
console.log('error', error.message)
// 请求超时 && 网络错误单独判断,没有 response // 请求超时 && 网络错误单独判断,没有 response
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试') if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试')
if (error.message.indexOf('Network Error') !== -1) ElMessage.error('网络错误!请您稍后重试') if (error.message.indexOf('Network Error') !== -1) ElMessage.error('网络错误!请您稍后重试')
@@ -115,9 +167,24 @@ class RequestHttp {
} }
upload(url: string, params?: object, _object = {}): Promise<BlobPart> { upload(url: string, params?: object, _object = {}): Promise<BlobPart> {
return this.service.post(url, params, { ..._object, headers: { 'Content-Type': 'multipart/form-data' } }) return this.service.post(url, params, {
..._object,
headers: { 'Content-Type': 'multipart/form-data' }
})
} }
/**
* 针对excel的上传默认返回的是blob类型Excel没问题时返回json特殊处理
*/
uploadExcel(url: string, params?: object, _object = {}): Promise<BlobPart> {
return this.service.post(url, params, {
..._object,
headers: { 'Content-Type': 'multipart/form-data' },
responseType: 'blob',
})
}
} }
export default new RequestHttp(config) export default new RequestHttp(config)

View File

@@ -2,75 +2,62 @@
"code": "A0000", "code": "A0000",
"data": [ "data": [
{ {
"id": "0", "id": "1",
"pid": "0",
"name": "频率准确度检测", "name": "频率准确度检测",
"children": [ "children": [
{ {
"pid": 0, "id": "1-1",
"id": "0-1", "pid": "1",
"name": "额定工作条件下的检测", "name": "额定工作条件下的检测",
"children": [ "children": [
{ {
"scriptIdx":1, "id": "1-1-1",
"isChildNode":true, "pid": "1-1",
"pid": "0-1",
"id": "0-1-1",
"name": "输入:频率 42.5Hz..." "name": "输入:频率 42.5Hz..."
}, },
{ {
"scriptIdx":2, "id": "1-1-2",
"isChildNode":true, "pid": "1-1",
"pid": "0-1",
"id": "0-1-2",
"name": "输入:频率 50.0Hz..." "name": "输入:频率 50.0Hz..."
}, },
{ {
"scriptIdx":3, "id": "1-1-3",
"isChildNode":true, "pid": "1-1",
"pid": "0-1", "name": "输入:频率 50.05Hz...."
"id": "0-1-3",
"name": "输入:频率 50.05Hz..."
} }
] ]
}, },
{ {
"pid": 0, "id": "1-2",
"id": "0-2", "pid": "1",
"name": "电压对频率测量的影响", "name": "电压对频率测量的影响",
"children": [ "children": [
{ {
"scriptIdx":4, "id": "1-2-1",
"isChildNode":true, "pid": "1-2",
"pid": "0-2",
"id": "0-2-1",
"name": "输入:频率 50.05Hz Ua =10%Un..." "name": "输入:频率 50.05Hz Ua =10%Un..."
}, },
{ {
"scriptIdx":5, "id": "1-2-1",
"isChildNode":true, "pid": "1-2",
"pid": "0-2",
"id": "0-2-1",
"name": "输入:频率 51.05Hz Ua =10%Un..." "name": "输入:频率 51.05Hz Ua =10%Un..."
}, },
{ {
"scriptIdx":6, "id": "1-2-2",
"isChildNode":true, "pid": "1-2",
"pid": "0-2",
"id": "0-2-2",
"name": "输入:频率 52.05Hz Ua =10%Un..." "name": "输入:频率 52.05Hz Ua =10%Un..."
} }
] ]
}, },
{ {
"pid": 0, "id": "1-3",
"id": "0-3", "pid": "1",
"name": "谐波对频率测量的影响", "name": "谐波对频率测量的影响",
"children": [ "children": [
{ {
"scriptIdx":7, "id": "1-3-1",
"isChildNode":true, "pid": "1-3",
"pid": "0-3",
"id": "0-3-1",
"name": "输入:频率 50.05Hz Ua =100%Un..." "name": "输入:频率 50.05Hz Ua =100%Un..."
} }
] ]
@@ -78,145 +65,125 @@
] ]
}, },
{ {
"id": "1", "id": "2",
"pid": "0",
"name": "电压准确度检测", "name": "电压准确度检测",
"children": [ "children": [
{ {
"pid": 1, "pid": "2",
"id": "1-1",
"name": "额定工作条件下的检测",
"children": [
{
"scriptIdx":8,
"isChildNode":true,
"pid": "1-1",
"id": "1-1-1",
"name": "输入:频率 42.5Hz..."
},
{
"scriptIdx":9,
"isChildNode":true,
"pid": "1-1",
"id": "1-1-2",
"name": "输入:频率 50.0Hz..."
},
{
"scriptIdx":10,
"isChildNode":true,
"pid": "1-1",
"id": "1-1-3",
"name": "输入:频率 50.05Hz..."
}
]
},
{
"pid": 0,
"id": "1-2",
"name": "电压对频率测量的影响",
"children": [
{
"scriptIdx":11,
"isChildNode":true,
"pid": "1-2",
"id": "1-2-1",
"name": "输入:频率 50.05Hz Ua =10%Un..."
},
{
"scriptIdx":12,
"isChildNode":true,
"pid": "1-2",
"id": "1-2-1",
"name": "输入:频率 51.05Hz Ua =10%Un..."
},
{
"scriptIdx":13,
"isChildNode":true,
"pid": "1-2",
"id": "1-2-2",
"name": "输入:频率 52.05Hz Ua =10%Un..."
}
]
},
{
"pid": 0,
"id": "0-3",
"name": "谐波对频率测量的影响",
"children": [
{
"scriptIdx":14,
"isChildNode":true,
"pid": "0-3",
"id": "0-3-1",
"name": "输入:频率 50.05Hz Ua =100%Un..."
}
]
}
]
},
{
"id": "2",
"name": "谐波准确度检测",
"children": [
{
"pid": 2,
"id": "2-1", "id": "2-1",
"name": "额定工作条件下的检测", "name": "额定工作条件下的检测",
"children": [ "children": [
{ {
"scriptIdx":15,
"pid": "2-1",
"id": "2-1-1", "id": "2-1-1",
"pid": "2-1",
"name": "输入:频率 42.5Hz..." "name": "输入:频率 42.5Hz..."
}, },
{ {
"scriptIdx":16,
"pid": "2-1",
"id": "2-1-2", "id": "2-1-2",
"pid": "2-1",
"name": "输入:频率 50.0Hz..." "name": "输入:频率 50.0Hz..."
}, },
{ {
"scriptIdx":17,
"pid": "2-1",
"id": "2-1-3", "id": "2-1-3",
"pid": "2-1",
"name": "输入:频率 50.05Hz..." "name": "输入:频率 50.05Hz..."
} }
] ]
}, },
{ {
"pid": 2, "pid": "2",
"id": "2-2", "id": "2-2",
"name": "电压对频率测量的影响", "name": "电压对频率测量的影响",
"children": [ "children": [
{ {
"scriptIdx":18,
"pid": "2-2",
"id": "2-2-1", "id": "2-2-1",
"pid": "2-2",
"name": "输入:频率 50.05Hz Ua =10%Un..." "name": "输入:频率 50.05Hz Ua =10%Un..."
}, },
{ {
"scriptIdx":19,
"pid": "2-2",
"id": "2-2-1", "id": "2-2-1",
"pid": "2-2",
"name": "输入:频率 51.05Hz Ua =10%Un..." "name": "输入:频率 51.05Hz Ua =10%Un..."
}, },
{ {
"scriptIdx":20,
"pid": "2-2",
"id": "2-2-2", "id": "2-2-2",
"pid": "2-2",
"name": "输入:频率 52.05Hz Ua =10%Un..." "name": "输入:频率 52.05Hz Ua =10%Un..."
} }
] ]
}, },
{ {
"pid": 2, "pid": "2",
"id": "2-3", "id": "2-3",
"name": "谐波对频率测量的影响", "name": "谐波对频率测量的影响",
"children": [ "children": [
{ {
"scriptIdx":21,
"pid": "2-3",
"id": "2-3-1", "id": "2-3-1",
"pid": "2-3",
"name": "输入:频率 50.05Hz Ua =100%Un..."
}
]
}
]
},
{
"id": "3",
"pid": "0",
"name": "谐波准确度检测",
"children": [
{
"id": "3-1",
"pid": "3",
"name": "额定工作条件下的检测",
"children": [
{
"id": "3-1-1",
"pid": "3-1",
"name": "输入:频率 42.5Hz..."
},
{
"id": "3-1-2",
"pid": "3-1",
"name": "输入:频率 50.0Hz..."
},
{
"id": "3-1-3",
"pid": "3-1",
"name": "输入:频率 50.05Hz..."
}
]
},
{
"id": "3-2",
"pid": "3",
"name": "电压对频率测量的影响",
"children": [
{
"id": "3-2-1",
"pid": "3-2",
"name": "输入:频率 50.05Hz Ua =10%Un..."
},
{
"id": "3-2-1",
"pid": "3-2",
"name": "输入:频率 51.05Hz Ua =10%Un..."
},
{
"id": "3-2-2",
"pid": "3-2",
"name": "输入:频率 52.05Hz Ua =10%Un..."
}
]
},
{
"id": "3-3",
"pid": "3",
"name": "谐波对频率测量的影响",
"children": [
{
"id": "3-3-1",
"pid": "3-3",
"name": "输入:频率 50.05Hz Ua =100%Un..." "name": "输入:频率 50.05Hz Ua =100%Un..."
} }
] ]

View File

@@ -1,72 +1,49 @@
import type { ReqPage } from '@/api/interface' import type { ReqPage } from '@/api/interface'
import type { DatetimeFormatProps } from 'vue-i18n';
// 检测计划模块 // 检测计划模块
export namespace Plan { export namespace Plan {
// 检测计划接口 // 检测计划接口
export interface PlanBO { export interface ResPlan {
id?: string; //检测计划ID id: string; //检测计划ID
name: string; //检测计划名称 name: string; //检测计划名称
pattern: string; //模式,字典表(数字、模拟、比对) pattern?: string; //模式,字典表(数字、模拟、比对)
father_Plan_Id?: string; //父计划ID fatherPlanId?: string; //父计划ID
dataSource_Id: string[]; //数据源ID dataSourceId: string; //数据源ID
script_Id: string; //检测脚本ID scriptId: string; //检测脚本ID
error_Sys_Id: string;//误差体系ID errorSysId: string;//误差体系ID
test_State: string; //检测状态 timeCheck:number;//守时检测:0否1。是
report_State: string; //报告生成状态 testState: number; //检测状态:0:未检、1检测中、2检测完成,默认为 0
result: string;//检测结果 reportState: number; //报告生成状态:0:未生成、1部分生成、2全部生成,默认为 0
create_Time?: string;//创建时间 result: number;//检测结果:0:不符合、1:符合、2/,默认为 2
code:number; //自动生成,用于生成数据表后缀
state: number;//;状态0-删除 1-正常
createBy?:string; //创建用户
createTime?:string; //创建时间
updateBy?:string; //更新用户
updateTime?:string; //更新时间
associateReport:number;//是否关联报告模板 0否 1是
reportTemplateName:string;
reportTemplateVersion:string;
dataRule:string //数据处理原则
} }
// 检测计划 + 分页 // 检测计划 + 分页
export interface ReqPlanParams extends ReqPage,PlanBO { export interface ReqPlanParams extends ReqPage,ResPlan {
} }
// 检测计划 + 检测源
export interface PlanAndSourceBO extends PlanBO {
testSourceName: string;//计划所属检测源
source_Id: string[];
device_Id?: string[];
testSourceList?: string[];//临时测试
dataSource_Ids:string;
}
// // 检测计划列表
// export interface PlanList {
// id: string; //检测计划ID
// name: string; //检测计划名称
// pattern: string; //模式,字典表(数字、模拟、比对)
// father_Plan_Id: string; //父计划ID
// dataSource_Id: string; //数据源ID
// script_Id: string; //检测脚本ID
// error_Sys_Id: string;//误差体系ID
// test_State: string; //检测状态
// report_State: string; //报告生成状态
// result: string;//检测结果
// state: number; //状态
// create_By?: string; //创建用户
// create_Time?: string;//创建时间
// update_By?: string; //更新用户
// update_Time?: string; //更新时间
// }
// // 被检设备参数 export interface ReqPlan extends ResPlan {
// export interface ReqPlanParams extends ReqPage { datasourceIds:string;
// id: string; //检测计划ID sourceIds: string;
// name: string; //检测计划名称 planId:string;
// pattern: string; //模式,字典表(数字、模拟、比对) scriptName: string ;
// father_Plan_Id: string; //父计划ID errorSysName: string;
// dataSource_Id: string; //数据源ID sourceName: string ;
// script_Id: string; //检测脚本ID devIds: string[];
// error_Sys_Id: string;//误差体系ID }
// test_State: string; //检测状态
// report_State: string; //报告生成状态
// result: string;//检测结果
// state: number; //状态
// create_By?: string; //创建用户
// create_Time?: string;//创建时间
// update_By?: string; //更新用户
// update_Time?: string; //更新时间
// }
} }

View File

@@ -1,27 +1,92 @@
import { ResPage } from '@/api/interface' import type { Plan } from './interface'
import { Plan } from './interface'
import { ADMIN as rePrefix } from '@/api/config/serviceName'
import http from '@/api' import http from '@/api'
import type { ErrorSystem } from '../device/interface/error'
import type { Device } from '../device/interface/device'
import { ReqDevReportParams } from '@/api/device/interface/device'
/** /**
* @name 检测计划管理模块 * @name 检测计划管理模块
*/ */
// 获取检测计划列表 // 获取检测计划列表
export const getPlanList = (params: Plan.ReqPlanParams) => { export const getPlanList = (params: Plan.ReqPlanParams) => {
return http.post<ResPage<Plan.PlanBO>>(`/plan/list`, params) return http.post(`/adPlan/list`, params)
} }
// 新增检测计划 // 新增检测计划
export const addPlan = (params: Plan.PlanBO) => { export const addPlan = (params: any) => {
return http.post(`/role/add`, params) return http.post(`/adPlan/add`, params)
} }
// 编辑检测计划 // 编辑检测计划
export const editPlan = (params: Plan.PlanBO) => { export const updatePlan = (params: any) => {
return http.post(`/role/edit`, params) return http.post(`/adPlan/update`, params)
} }
// 删除检测计划 // 删除检测计划
export const deletePlan = (params: { id: string[] }) => { export const deletePlan = (params: { id: string[] }) => {
return http.post(`/role/del`, params) return http.post(`/adPlan/delete`, params)
} }
// 获取指定模式下所有检测源
export const getTestSourceList = (params: Plan.ReqPlan) => {
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
}
// 获取指定模式下所有检测脚本
export const getPqScriptList = (params: Plan.ReqPlan) => {
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
}
//获取所有误差体系
export const getPqErrSysList = () => {
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
}
//获取指定模式下所有未绑定的设备
export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
}
//根据检测计划id查询出所有已绑定的设备
export const getBoundPqDevList = (params: any) => {
return http.post(`/pqDev/listByPlanId`, params)
}
//检测计划绑定设备
// export const BindPqDevList = (params: any) => {
// return http.post(`/pqDev/bindDev`,params)
// }
// 按照模式查询检测计划(用于首页展示)
export const getPlanListByPattern = (params: Plan.ReqPlan) => {
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
}
// 导出检测计划
export const exportPlan = (params: Device.ReqPqDevParams) => {
return http.download(`/adPlan/export`, params)
}
// 下载模板
export const downloadTemplate = (params: { patternId: string }) => {
return http.download(`/adPlan/downloadTemplate`, params)
}
// 导入检测计划
export const importPlan = (params: Device.ReqPqDevParams) => {
return http.uploadExcel(`/adPlan/import`, params)
}
// 装置检测报告生成
export const generateDevReport = (params: Device.ReqDevReportParams) => {
return http.post(`/report/generateReport`, params)
}
// 装置检测报告下载
export const downloadDevData = (params: Device.ReqDevReportParams) => {
return http.download(`/report/downloadReport`, params)
}
export const staticsAnalyse = (params: { id: string[] }) => {
return http.download('/adPlan/analyse', params)
}

View File

@@ -58,11 +58,15 @@ const dictReportState: Dict[] = [
const dictResult: Dict[] = [ const dictResult: Dict[] = [
{ {
id: "0", id: "0",
label: '符合', label: '符合',
}, },
{ {
id: "1", id: "1",
label: '符合', label: '符合',
},
{
id: "2",
label: '/',
}, },
] ]
@@ -170,35 +174,35 @@ const testFatherPlanList: Dict[] = [
const sourceDataList: Dict[] = [ const sourceDataList: Dict[] = [
{ {
id: "1", id: "1",
label: '标准源-福禄克-6100A', label: '标准源-FLUKE.6100A电能功率标准源-1',
}, },
{ {
id: "2", id: "2",
label: '标准源-昂立-PF2', label: '标准源-ANGLI-FP2高性能数字信号源-1',
}, },
{ {
id: "3", id: "3",
label: '标准源-丹迪克-DKLN1', label: '标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
}, },
{ {
id: "4", id: "4",
label: '标准源-博电源-PQC600A', label: '标准源-PQC600A高精度电能功率标准源-1',
}, },
{ {
id: "5", id: "5",
label: '高精度设备-PQV520-1', label: '高精度设备-PQV-520便携式电能质量监测装置-1',
}, },
{ {
id: "6", id: "6",
label: '高精度设备-PQV520-2', label: '高精度设备-PQV-520便携式电能质量监测装置-2',
}, },
{ {
id: "7", id: "7",
label: '高精度设备-PQV520-3', label: '高精度设备-PQV-520便携式电能质量监测装置-3',
}, },
{ {
id: "8", id: "8",
label: '高精度设备-PQV520-4', label: '高精度设备-PQV-520便携式电能质量监测装置-4',
}, },
] ]
@@ -206,46 +210,80 @@ const sourceDataList: Dict[] = [
const deviceDataList: Dict[] = [ const deviceDataList: Dict[] = [
{ {
id: "1", id: "1",
label: '模拟装置1', label: '240001',
}, },
{ {
id: "2", id: "2",
label: '模拟装置2', label: '240002',
}, },
{ {
id: "3", id: "3",
label: '模拟装置3', label: '240003',
}, },
{ {
id: "4", id: "4",
label: '模拟装置4', label: '240004',
}, },
{ {
id: "5", id: "5",
label: '中电送检装置', label: '240005',
}, },
{ {
id: "6", id: "6",
label: '易司拓测试装置', label: '240006',
}, },
{ {
id: "7", id: "7",
label: '山大电力测试装置1', label: '240007',
}, },
{ {
id: "8", id: "8",
label: '山大电力测试装置2', label: '240008',
}, },
] ]
// const deviceDataList: Dict[] = [
// {
// id: "1",
// label: '模拟装置1',
// },
// {
// id: "2",
// label: '模拟装置2',
// },
// {
// id: "3",
// label: '模拟装置3',
// },
// {
// id: "4",
// label: '模拟装置4',
// },
// {
// id: "5",
// label: '中电送检装置',
// },
// {
// id: "6",
// label: '易司拓测试装置',
// },
// {
// id: "7",
// label: '山大电力测试装置1',
// },
// {
// id: "8",
// label: '山大电力测试装置2',
// },
// ]
const planData = ref<Plan.PlanAndSourceBO[]>([ const planData = ref<Plan.PlanAndSourceBO[]>([
{ {
'id': '1', 'id': '1',
'name': '检测计划1', 'name': '沧州110kV东光站装置送检',
'pattern':'1', 'pattern':'1',
"source_Id" : ['1'], "source_Id" : ['1'],
"testSourceName":'标准源-福禄克-6100A', "testSourceName":'标准源-FLUKE.6100A电能功率标准源-1',
'dataSource_Id':['1'], 'dataSource_Id':['1'],
'dataSource_Ids':'实时数据', 'dataSource_Ids':'实时数据',
'script_Id':'1', 'script_Id':'1',
@@ -256,32 +294,32 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
}, },
{ {
'id': '2', 'id': '2',
'name': '检测计划2', 'name': '邯郸2台安徽振兴终端送检',
'pattern':'1', 'pattern':'1',
"source_Id" : ['5','6','7','8'], "source_Id" : ['5','6','7','8'],
"testSourceName":'高精度设备-PQV520-1', "testSourceName":'高精度设备-PQV-520便携式电能质量监测装置-1',
'father_Plan_Id':'1', 'father_Plan_Id':'1',
'dataSource_Id':['5'], 'dataSource_Id':['1'],
'dataSource_Ids':'分钟统计数据CP95值', 'dataSource_Ids':'实时数据',
'script_Id':'2', 'script_Id':'2',
'error_Sys_Id':'2', 'error_Sys_Id':'2',
'test_State':'2', 'test_State':'2',
'report_State':'2', 'report_State':'2',
'result':'0', 'result':'0',
"testSourceList":[ "testSourceList":[
'高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-4' '高精度设备-PQV-520便携式电能质量监测装置-2','高精度设备-PQV-520便携式电能质量监测装置-3','高精度设备-PQV-520便携式电能质量监测装置-4'
] ]
}, },
{ {
'id': '3', 'id': '3',
'name': '检测子计划3', 'name': '浙江分布式光伏电能质量试点',
'pattern':'1', 'pattern':'1',
"source_Id" : ['3'], "source_Id" : ['3'],
"testSourceName":'标准源-丹迪克-DKLN1', "testSourceName":'标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
'father_Plan_Id':'1', 'father_Plan_Id':'1',
'dataSource_Id':['1'], 'dataSource_Id':['1'],
'dataSource_Ids':'实时数据', 'dataSource_Ids':'实时数据',
'script_Id':'3', 'script_Id':'4',
'error_Sys_Id':'3', 'error_Sys_Id':'3',
'test_State':'1', 'test_State':'1',
'report_State':'1', 'report_State':'1',

View File

@@ -2,12 +2,12 @@
"code": "200", "code": "200",
"data": [ "data": [
{ {
"name": "未检", "name": "未检",
"children": [ "children": [
{ {
"id": 4, "id": 4,
"pid": 1, "pid": 1,
"name": "邯郸220kV团城站等4座站电能质量检测" "name": "邯郸220kV团城站电能质量检测"
}, },
{ {
"id": 5, "id": 5,
@@ -17,7 +17,7 @@
{ {
"id": 6, "id": 6,
"pid": 1, "pid": 1,
"name": "深圳市中电软件有限公司委托送检" "name": "深圳市中电公司委托送检"
} }
], ],
"id": 1 "id": 1
@@ -28,17 +28,17 @@
{ {
"id": 7, "id": 7,
"pid": 2, "pid": 2,
"name": "沧州220kV留古等4座变电站电能质量检测" "name": "沧州220kV留古站电能质量检测"
}, },
{ {
"id": 8, "id": 8,
"pid": 2, "pid": 2,
"name": "沧州供电公司110kV东光站等10台装置送检" "name": "沧州110kV东光站装置送检"
}, },
{ {
"id": 9, "id": 9,
"pid": 2, "pid": 2,
"name": "保定分布式光伏电能质量监测试点" "name": "浙江分布式光伏电能质量试点"
} }
], ],
"id": 2 "id": 2
@@ -54,7 +54,7 @@
{ {
"id": 11, "id": 11,
"pid": 3, "pid": 3,
"name": "北京2024现场检测" "name": "深圳2台中电终端委托送检"
} }
], ],
"id": 3 "id": 3

View File

@@ -0,0 +1,34 @@
import http from '@/api'
export const startPreTest = (params) => {
return http.post(`/prepare/startPreTest`, params, {loading: false})
}
export const closePreTest = (params) => {
return http.post(`/prepare/closePreTest`, params,{ loading: false })
}
/**
* 开始正式检测
* @param params
*/
// export const startTest = (params) => {
// return http.post(`/prepare/startTest`, params, {loading: false})
// }
/**
* 暂停正式检测
* @param params
*/
export const pauseTest = () => {
return http.get(`/prepare/closePreTest`, {loading: false})
}
/**
* 继续正式检测
* @param params
*/
export const resumeTest = (params) => {
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
}

View File

@@ -1,3 +1,4 @@
import http from '@/api' import http from '@/api'
import {type Base} from '@/api/system/base/interface' import {type Base} from '@/api/system/base/interface'
@@ -12,6 +13,10 @@ export const updateTestConfig = (params: Base.ResTestConfig) => {
return http.post(`/sysTestConfig/update`, params) return http.post(`/sysTestConfig/update`, params)
} }
//场景切换
export const updateScene = (params: any) => {
return http.post(`/sysTestConfig/update`,params)
}

View File

@@ -8,8 +8,8 @@ export namespace Base {
id: string; //系统配置表Id id: string; //系统配置表Id
autoGenerate:number;//检测报告是否自动生成0 否1是 autoGenerate:number;//检测报告是否自动生成0 否1是
maxTime:number;//最大复检次数默认3次 maxTime:number;//最大复检次数默认3次
dataRule:string;//数据处理原则,关联字典所有值、部分值、cp95值、平均值、任意值默认任意值
state: number; //状态 state: number; //状态
scale:number;//小数位
createBy?: string| null; //创建用户 createBy?: string| null; //创建用户
createTime?: string| null; //创建时间 createTime?: string| null; //创建时间
updateBy?: string| null; //更新用户 updateBy?: string| null; //更新用户

View File

@@ -216,7 +216,7 @@ const dictData: Dict[] = [
children: [ children: [
{ {
id: "0", id: "0",
label: 'FLUKE6100A电能功率标准源', label: 'FLUKE.6100A电能功率标准源',
code: 0, code: 0,
}, },
{ {
@@ -236,7 +236,7 @@ const dictData: Dict[] = [
}, },
{ {
id: "4", id: "4",
label: 'PQV-520电能质量测装置', label: 'PQV-520便携式电能质量测装置',
code: 4, code: 4,
}, },
], ],

View File

@@ -1,10 +1,16 @@
import http from '@/api' import http from '@/api'
import { type Dict } from '@/api/system/dictionary/interface' import { type Dict } from '@/api/system/dictionary/interface'
import { c } from 'vite/dist/node/types.d-aGj9QkWt'
//获取字典类型 //获取字典类型
export const getDictTreeList = (params: Dict.ResDictTree) => { export const getDictTreeByCode = (params: Dict.ResDictTree) => {
const name = params.name || ''; const code = params.code || ''
return http.get(`/dictTree/getTree?keyword=${name}`, params) return http.get(`/dictTree/getTreeByCode?code=${code}`, { loading: true })
}
export const getDictTreeByName = (params: Dict.ResDictTree) => {
const name = params.name || ''
return http.get(`/dictTree/getTreeByName?name=${name}`)
} }
//添加字典类型 //添加字典类型
@@ -21,4 +27,3 @@ export const updateDictTree = (params: Dict.ResDictTree) => {
export const deleteDictTree = (params: Dict.ResDictTree) => { export const deleteDictTree = (params: Dict.ResDictTree) => {
return http.post(`/dictTree/delete?id=${params.id}`) return http.post(`/dictTree/delete?id=${params.id}`)
} }

View File

@@ -62,6 +62,7 @@ export namespace Dict {
name: string; // 名称 name: string; // 名称
code: string; // 编码 code: string; // 编码
sort: number; // 排序 sort: number; // 排序
openValue?: number | null;
level?: number | null; // 事件等级0-普通1-中等2-严重 (默认为0) level?: number | null; // 事件等级0-普通1-中等2-严重 (默认为0)
algoDescribe?: number | null; // 与高级算法内部Id描述对应 algoDescribe?: number | null; // 与高级算法内部Id描述对应
value?: string | null; // 字典针对电压等级 value?: string | null; // 字典针对电压等级
@@ -116,10 +117,10 @@ export namespace Dict {
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储; storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
curSts?:number | null;//sts、do的当前值 curSts?:number | null;//sts、do的当前值
ctlSts?:number;//do的是否可远程控制 1:是 0:否; ctlSts?:number;//do的是否可远程控制 1:是 0:否;
maxNum?:number ;//设置最大值 maxNum?:number | null;//设置最大值
minNum?: number;//设置最小值 minNum?: number| null;//设置最小值
setValue?:string | null;//参数为enum可设置的所有值序列 setValue?:string | null;//参数为enum可设置的所有值序列
strlen?:number ;//参数string可设置字符串的长度上 限 strlen?:number | null;//参数string可设置字符串的长度上 限
defaultValue?:string | null; //参数缺省值、告警code值 defaultValue?:string | null; //参数缺省值、告警code值
resourcesId?:string ; //报表数据来源(统计表表名) resourcesId?:string ; //报表数据来源(统计表表名)
limitName?:string | null; //限值字段名称 limitName?:string | null; //限值字段名称

View File

@@ -0,0 +1,16 @@
import type {AuditLog } from '@/api/system/log/interface/log.ts'
import http from '@/api'
/**
* @name 审计日志管理模块
*/
//获取审计日志
export const getAuditLog = (params: AuditLog.ReqAuditLogParams) => {
return http.post(`/sysLog/list`, params)
}
export const exportCsv = (params: AuditLog.ReqAuditLogParams) => {
return http.download(`/sysLog/exportCSV`, params)
}

View File

@@ -1,15 +1,36 @@
import type { ReqPage, ResPage } from '@/api/interface'
// 审计日志管理模块 // 审计日志管理模块
export namespace Sys_Log_Audit { export namespace AuditLog {
// 日志列表
export interface Audit_LogList { /**
id: string;//日志表Id * 设备类型数据表格分页查询参数
operate_Type:string;//日志类型 */
export interface ReqAuditLogParams extends ReqPage {
id: string; //审计日志Id 必填
createTime?: string; //创建时间
}
/**
* 设备类型新增、修改、根据id查询返回的对象
*/
export interface ResAuditLog {
id: string;//审计日志Id
operate_Type:string;//操作类型
ip:string;//操作IP ip:string;//操作IP
result: string;//事件结果 result: string;//事件结果
remark: string;//事件描述 remark: string;//事件描述
level:number;//告警等级
warn:number;//告警标志 warn:number;//告警标志
create_By:string;//创建用户 create_By:string;//创建用户
create_Time:string;//创建时间 create_Time:string;//创建时间
sort:number;//排序
} }
/**
* 设备类型表格查询分页返回的对象;
*/
export interface ResAuditLogPage extends ResPage<ResAuditLog> {
}
} }

View File

@@ -5,10 +5,13 @@ export namespace Login {
export interface ReqLoginForm { export interface ReqLoginForm {
username: string; username: string;
password: string; password: string;
checked: boolean;
} }
export interface ResLogin { export interface ResLogin {
accessToken: string; accessToken: string;
refreshToken: string;
userInfo:{ userInfo:{
id: string;
name: string; name: string;
} }
} }

View File

@@ -2,11 +2,12 @@ import type { Login } from '@/api/user/interface/user'
import {ADMIN as rePrefix} from '@/api/system/config/serviceName' import {ADMIN as rePrefix} from '@/api/system/config/serviceName'
import http from '@/api' import http from '@/api'
import type {Dict} from '@/api/interface' import type {Dict} from '@/api/interface'
/** /**
* @name 登录模块 * @name 登录模块
*/ */
// 用户登录 // 用户登录
export const loginApi = (params: Login.ReqLoginForm) => { export const loginApi = (params: { username: string; password: string}) => {
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, {loading: false}) return http.post<Login.ResLogin>(`${rePrefix}/login`, params, {loading: false})
// return http.post<Login.ResLogin>(`/Register1`, params, { loading: false }) // return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
} }
@@ -30,3 +31,29 @@ export const getDictList = () =>{
return http.get<Dict>('/dictData/dictDataCache') return http.get<Dict>('/dictData/dictDataCache')
} }
//token刷新
export const refreshToken = () => {
return http.get<Login.ResLogin>(`${rePrefix}/refreshToken`,
{},
{loading: false}
)
}
//获取场景
export const getCurrentScene = () => {
return http.get('/sysTestConfig/getCurrentScene', {}, {loading: false})
}
/**
* 获取RSA公钥
*/
export const getPublicKey = (username: string) => {
return http.get(`/admin/getPublicKey?username=${username}`, {}, {loading: false})
}
/**
* 获取是否在检测中自动生成报告
*/
export const getAutoGenerate = () => {
return http.get('/sysTestConfig/getAutoGenerate', {}, {loading: false})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -1,53 +1,53 @@
<template> <template>
<el-dialog v-model="dialogVisible" :title="`批量添加${parameter.title}`" :destroy-on-close="true" width="580px" draggable> <el-dialog v-model='dialogVisible' :title='`批量添加${parameter.title}`' :destroy-on-close='true' width='580px'
<el-form class="drawer-multiColumn-form" label-width="100px"> draggable>
<el-form-item label="模板下载 :"> <el-form class='drawer-multiColumn-form' label-width='100px'>
<el-button type="primary" :icon="Download" @click="downloadTemp"> 点击下载 </el-button> <el-form-item label='模板下载 :'>
<el-button type='primary' :icon='Download' @click='downloadTemp'> 点击下载</el-button>
</el-form-item> </el-form-item>
<el-form-item label="文件上传 :"> <el-form-item label='文件上传 :'>
<el-upload <el-upload
action="#" action='#'
class="upload" class='upload'
:drag="true" :drag='true'
:limit="excelLimit" :limit='excelLimit'
:multiple="true" :multiple='true'
:show-file-list="true" :show-file-list='true'
:http-request="uploadExcel" :http-request='uploadExcel'
:before-upload="beforeExcelUpload" :before-upload='beforeExcelUpload'
:on-exceed="handleExceed" :on-exceed='handleExceed'
:on-success="excelUploadSuccess"
:on-error="excelUploadError"
:accept="parameter.fileType!.join(',')" :accept="parameter.fileType!.join(',')"
> >
<slot name="empty"> <slot name='empty'>
<el-icon class="el-icon--upload"> <el-icon class='el-icon--upload'>
<upload-filled /> <upload-filled />
</el-icon> </el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class='el-upload__text'>将文件拖到此处<em>点击上传</em></div>
</slot> </slot>
<template #tip> <template #tip>
<slot name="tip"> <slot name='tip'>
<div class="el-upload__tip">请上传 .xls , .xlsx 标准格式文件文件最大为 {{ parameter.fileSize }}M</div> <div class='el-upload__tip'>请上传 .xls , .xlsx 标准格式文件文件最大为 {{ parameter.fileSize }}M</div>
</slot> </slot>
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item v-if="parameter.showCover" label="数据覆盖 :"> <el-form-item v-if='parameter.showCover' label='数据覆盖 :'>
<el-switch v-model="isCover" /> <el-switch v-model='isCover' />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts" name="ImportExcel"> <script setup lang='ts' name='ImportExcel'>
import { ref } from "vue"; import { ref } from 'vue'
import { useDownload } from "@/hooks/useDownload"; import { useDownload } from '@/hooks/useDownload'
import { Download } from "@element-plus/icons-vue"; import { Download } from '@element-plus/icons-vue'
import { ElNotification, UploadRequestOptions, UploadRawFile } from "element-plus"; import { ElNotification, UploadRequestOptions, UploadRawFile, ElMessage } from 'element-plus'
export interface ExcelParameterProps { export interface ExcelParameterProps {
title: string; // 标题 title: string; // 标题
showCover?: boolean; // 是否显示”数据覆盖“选项 showCover?: boolean; // 是否显示”数据覆盖“选项
patternId?: string; // 模式ID
fileSize?: number; // 上传文件的大小 fileSize?: number; // 上传文件的大小
fileType?: File.ExcelMimeType[]; // 上传文件的类型 fileType?: File.ExcelMimeType[]; // 上传文件的类型
tempApi?: (params: any) => Promise<any>; // 下载模板的Api tempApi?: (params: any) => Promise<any>; // 下载模板的Api
@@ -56,96 +56,132 @@ export interface ExcelParameterProps {
} }
// 是否覆盖数据 // 是否覆盖数据
const isCover = ref(false); const isCover = ref(false)
// 最大文件上传数 // 最大文件上传数
const excelLimit = ref(1); const excelLimit = ref(1)
// dialog状态 // dialog状态
const dialogVisible = ref(false); const dialogVisible = ref(false)
// 父组件传过来的参数 // 父组件传过来的参数
const parameter = ref<ExcelParameterProps>({ const parameter = ref<ExcelParameterProps>({
title: "", title: '',
fileSize: 5, fileSize: 5,
fileType: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"] fileType: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
}); })
// 接收父组件参数 // 接收父组件参数
const acceptParams = (params: ExcelParameterProps) => { const acceptParams = (params: ExcelParameterProps) => {
parameter.value = { ...parameter.value, ...params }; parameter.value = { ...parameter.value, ...params }
dialogVisible.value = true; dialogVisible.value = true
}; }
// Excel 导入模板下载 // Excel 导入模板下载
const downloadTemp = () => { const downloadTemp = () => {
if (!parameter.value.tempApi) return; if (!parameter.value.tempApi) return
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`,{},true); useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, {'patternId':parameter.value.patternId}, false)
}; }
// 文件上传 // 文件上传
const uploadExcel = async (param: UploadRequestOptions) => { const uploadExcel = async (param: UploadRequestOptions) => {
debugger let excelFormData = new FormData()
let excelFormData = new FormData(); excelFormData.append('file', param.file)
excelFormData.append("file", param.file); if (parameter.value.patternId) {
isCover.value && excelFormData.append("isCover", isCover.value as unknown as Blob); excelFormData.append('patternId', parameter.value.patternId)
await parameter.value.importApi!(excelFormData); }
parameter.value.getTableList && parameter.value.getTableList(); isCover.value && excelFormData.append('isCover', isCover.value as unknown as Blob)
dialogVisible.value = false; //await parameter.value.importApi!(excelFormData);
}; await parameter.value.importApi!(excelFormData)
.then(res => handleImportResponse(res))
parameter.value.getTableList && parameter.value.getTableList()
dialogVisible.value = false
}
async function handleImportResponse(res: any) {
console.log(res)
if (res.type === 'application/json') {
const fileReader = new FileReader()
fileReader.onloadend = () => {
try {
const jsonData = JSON.parse(fileReader.result)
if (jsonData.code === 'A0000') {
ElMessage.success('导入成功')
} else {
ElMessage.error(jsonData.message)
}
} catch (err) {
console.log(err)
}
}
fileReader.readAsText(res)
} else {
ElMessage.error('导入失败,请查看下载附件!')
let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = '导入失败数据'
document.body.appendChild(link)
link.click()
link.remove()
}
}
/** /**
* @description 文件上传之前判断 * @description 文件上传之前判断
* @param file 上传的文件 * @param file 上传的文件
* */ * */
const beforeExcelUpload = (file: UploadRawFile) => { const beforeExcelUpload = (file: UploadRawFile) => {
const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType); const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType)
const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!; const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!
if (!isExcel) if (!isExcel)
ElNotification({ ElNotification({
title: "温馨提示", title: '温馨提示',
message: "上传文件只能是 xls / xlsx 格式!", message: '上传文件只能是 xls / xlsx 格式!',
type: "warning" type: 'warning',
}); })
if (!fileSize) if (!fileSize)
setTimeout(() => { setTimeout(() => {
ElNotification({ ElNotification({
title: "温馨提示", title: '温馨提示',
message: `上传文件大小不能超过 ${parameter.value.fileSize}MB`, message: `上传文件大小不能超过 ${parameter.value.fileSize}MB`,
type: "warning" type: 'warning',
}); })
}, 0); }, 0)
return isExcel && fileSize; return isExcel && fileSize
}; }
// 文件数超出提示 // 文件数超出提示
const handleExceed = () => { const handleExceed = () => {
ElNotification({ ElNotification({
title: "温馨提示", title: '温馨提示',
message: "最多只能上传一个文件!", message: '最多只能上传一个文件!',
type: "warning" type: 'warning',
}); })
}; }
// 上传错误提示 // 上传错误提示
const excelUploadError = () => { // const excelUploadError = () => {
ElNotification({ // ElNotification({
title: "温馨提示", // title: '温馨提示',
message: `批量添加${parameter.value.title}失败,请您重新上传!`, // message: `批量添加${parameter.value.title}失败,请您重新上传!`,
type: "error" // type: 'error',
}); // })
}; // }
// 上传成功提示 // 上传成功提示
const excelUploadSuccess = () => { // const excelUploadSuccess = () => {
ElNotification({ // ElNotification({
title: "温馨提示", // title: '温馨提示',
message: `批量添加${parameter.value.title}成功!`, // message: `批量添加${parameter.value.title}成功!`,
type: "success" // type: 'success',
}); // })
}; // }
defineExpose({ defineExpose({
acceptParams acceptParams,
}); })
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
@import "./index.scss"; @import "./index.scss";
</style> </style>

View File

@@ -8,9 +8,8 @@
:search-param='searchParam' :search-param='searchParam'
:search-col='searchCol' :search-col='searchCol'
/> />
<!-- 表格主体 --> <!-- 表格主体 -->
<div class='card table-main'> <div class='table-main' :class='{ card: showCard }' >
<!-- 表格头部 操作按钮 --> <!-- 表格头部 操作按钮 -->
<div class='table-header'> <div class='table-header'>
<div class='header-button-lf'> <div class='header-button-lf'>
@@ -43,10 +42,11 @@
> >
<!-- 默认插槽 --> <!-- 默认插槽 -->
<slot /> <slot />
<template v-for='item in tableColumns' :key='item'> <template v-for='item in tableColumns' :key='item'>
<!-- selection || radio || index || expand || sort --> <!-- selection || radio || index || expand || sort -->
<el-table-column <el-table-column
v-if='item.type && columnTypes.includes(item.type)' v-if='item.type && columnTypes.includes(item.type) && item.isShow'
v-bind='item' v-bind='item'
:align="item.align ?? 'center'" :align="item.align ?? 'center'"
:reserve-selection="item.type == 'selection'" :reserve-selection="item.type == 'selection'"
@@ -126,6 +126,7 @@ export interface ProTableProps {
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传 requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传 dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
title?: string; // 表格标题 ==> 非必传 title?: string; // 表格标题 ==> 非必传
showCard?: boolean; // 下个是否需要卡片
pagination?: boolean; // 是否需要分页组件 ==> 非必传默认为true pagination?: boolean; // 是否需要分页组件 ==> 非必传默认为true
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{} initParam?: any; // 初始化请求参数 ==> 非必传(默认为{}
border?: boolean; // 是否带有纵向边框 ==> 非必传默认为true border?: boolean; // 是否带有纵向边框 ==> 非必传默认为true
@@ -141,6 +142,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
pagination: true, pagination: true,
initParam: {}, initParam: {},
border: true, border: true,
showCard: true,
toolButton: true, toolButton: true,
rowKey: 'id', rowKey: 'id',
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }), searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),

View File

@@ -13,7 +13,7 @@
<el-button :icon='customIcons[iconValue]' /> <el-button :icon='customIcons[iconValue]' />
</template> </template>
</el-input> </el-input>
<el-dialog v-model='dialogVisible' :title='placeholder' top='50px' width='66%'> <el-dialog v-model='dialogVisible' :title='placeholder' top='5%' width='30%' >
<el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' /> <el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' />
<el-scrollbar v-if='Object.keys(iconsList).length'> <el-scrollbar v-if='Object.keys(iconsList).length'>
<div class='icon-list'> <div class='icon-list'>

View File

@@ -126,6 +126,15 @@ const handleChange = (unit: string) => {
endDate.value = new Date() endDate.value = new Date()
} }
timeUnit.value = unit timeUnit.value = unit
// 确保开始时间和结束时间不为空
if (!startDate.value) {
startDate.value = new Date()
}
if (!endDate.value) {
endDate.value = new Date()
}
emitDateChange() // 变化时也发出更新事件 emitDateChange() // 变化时也发出更新事件
updateNextButtonStatus() updateNextButtonStatus()
} }
@@ -172,7 +181,13 @@ const updateDateRange = () => {
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 // endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
// } // }
} }
// 确保开始时间和结束时间不为空
if (!startDate.value) {
startDate.value = new Date()
}
if (!endDate.value) {
endDate.value = new Date()
}
updateNextButtonStatus() updateNextButtonStatus()
} }
@@ -285,7 +300,10 @@ const disableEndDate = (date: Date) => {
// 格式化日期yyyy-mm-dd // 格式化日期yyyy-mm-dd
function formatDate(date:Date) { function formatDate(date: Date | null): string {
if (!date) {
return '';
}
const year = date.getFullYear(); const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0');

View File

@@ -0,0 +1,282 @@
<template>
<div class="chart">
<div ref="chartRef" class="my-chart" />
</div>
</template>
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref, defineExpose, watch, nextTick } from 'vue'
// import echarts from './echarts'
import * as echarts from 'echarts' // 全引入
// import 'echarts/lib/component/dataZoom'
const color = [
'var(--el-color-primary)',
'#07CCCA',
'#00BFF5',
'#FFBF00',
'#77DA63',
'#D5FF6B',
'#Ff6600',
'#FF9100',
'#5B6E96',
'#66FFCC',
'#B3B3B3'
]
const chartRef = ref<HTMLDivElement>()
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
let chart: echarts.ECharts | any = null
const resizeHandler = () => {
// 不在视野中的时候不进行resize
if (!chartRef.value) return
if (chartRef.value.offsetHeight == 0) return
chart.getZr().painter.getViewportRoot().style.display = 'none'
requestAnimationFrame(() => {
chart.resize()
chart.getZr().painter.getViewportRoot().style.display = ''
})
}
const initChart = () => {
if (!props.isInterVal && !props.pieInterVal) {
chart?.dispose()
}
// chart?.dispose()
chart = echarts.init(chartRef.value as HTMLDivElement)
const options = {
title: {
left: 'center',
// textStyle: {
color: '#000',
fontSize: 18,
// },
...(props.options?.title || null)
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
color: '#fff',
fontSize: 16
}
},
textStyle: {
color: '#fff',
fontStyle: 'normal',
opacity: 0.35,
fontSize: 14
},
backgroundColor: 'rgba(0,0,0,0.55)',
borderWidth: 0,
confine: true,
...(props.options?.tooltip || null)
},
legend: {
right: 20,
top: 0,
itemGap: 10,
itemStyle: {},
// textStyle: {
fontSize: 12,
padding: [2, 0, 0, 0], //[上、右、下、左]
// },
itemWidth: 15,
itemHeight: 10,
...(props.options?.legend || null)
},
grid: {
top: '60px',
left: '30px',
right: '70px',
bottom: props.options?.options?.dataZoom === null ? '10px' : '40px',
containLabel: true,
...(props.options?.grid || null)
},
xAxis: props.options?.xAxis ? handlerXAxis() : null,
yAxis: props.options?.yAxis ? handlerYAxis() : null,
dataZoom: props.options?.dataZoom || [
{
type: 'inside',
height: 13,
start: 0,
bottom: '20px',
end: 100
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100
}
],
color: props.options?.color || color,
series: props.options?.series,
...props.options?.options
}
// console.log(options.series,"获取x轴");
handlerBar(options)
// 处理柱状图
chart.setOption(options, true)
setTimeout(() => {
chart.resize()
}, 0)
}
const handlerBar = (options: any) => {
if (Array.isArray(options.series)) {
options.series.forEach((item: any) => {
if (item.type === 'bar') {
item.barMinHeight = 10
item.barMaxWidth = 20
item.itemStyle = Object.assign(
{
color: (params: any) => {
if (params.value == 0 || params.value == 3.14159) {
return '#ccc'
} else {
return props.options?.color
? props.options?.color[params.seriesIndex]
: color[params.seriesIndex]
}
}
},
item.itemStyle
)
}
})
}
}
const handlerYAxis = () => {
let temp = {
type: 'value',
nameGap: 15,
nameTextStyle: {
color: '#000'
},
splitNumber: 5,
minInterval: 1,
axisLine: {
show: true,
lineStyle: {
color: '#000'
}
},
axisLabel: {
color: '#000',
fontSize: 14,
formatter: function (value) {
return value.toFixed(0) // 格式化显示为一位小数
}
},
splitLine: {
lineStyle: {
// 使用深浅的间隔色
color: ['#ccc'],
type: 'dashed',
opacity: 0.5
}
}
}
// props.options?.xAxis 是数组还是对象
if (Array.isArray(props.options?.yAxis)) {
return props.options?.yAxis.map((item: any) => {
return {
...temp,
...item
}
})
} else {
return {
...temp,
...props.options?.yAxis
}
}
}
const handlerXAxis = () => {
let temp = {
type: 'category',
axisTick: { show: false },
nameTextStyle: {
color: '#000'
},
axisLine: {
// lineStyle: {
color: '#000'
// }
},
axisLabel: {
// textStyle: {
fontFamily: 'dinproRegular',
color: '#000',
fontSize: '12'
// }
}
// boundaryGap: false,
}
// props.options?.xAxis 是数组还是对象
if (Array.isArray(props.options?.xAxis)) {
return props.options?.xAxis.map((item: any) => {
return {
...temp,
...item
}
})
} else {
return {
...temp,
...props.options?.xAxis
}
}
}
let throttle: ReturnType<typeof setTimeout>
// 动态计算table高度
const resizeObserver = new ResizeObserver(entries => {
for (const entry of entries) {
if (throttle) {
clearTimeout(throttle)
}
throttle = setTimeout(() => {
resizeHandler()
}, 100)
}
})
onMounted(() => {
initChart()
resizeObserver.observe(chartRef.value!)
})
defineExpose({ initChart })
onBeforeUnmount(() => {
resizeObserver.unobserve(chartRef.value!)
chart?.dispose()
})
watch(
() => props.options,
(newVal, oldVal) => {
initChart()
}
)
</script>
<style lang="scss" scoped>
.chart {
width: 100%;
height: 100%;
position: relative;
.el-button {
position: absolute;
right: 0px;
top: -60px;
}
.my-chart {
height: 100%;
width: 100%;
}
}
</style>

View File

@@ -4,6 +4,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as echarts from "echarts"; import * as echarts from "echarts";
import { ref } from "vue";
const chartsRef = ref(); const chartsRef = ref();
const props = defineProps({ const props = defineProps({
//饼图数据 //饼图数据
@@ -21,11 +22,16 @@ const props = defineProps({
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
}); });
const customData: any = ref({}), const customData: any = ref({}),
legendData: any = ref({}), legendData: any = ref({}),
chart: any = ref(); chart: any = ref();
const labelIsShow = ref(true)//引导线台数和鼠标点击饼图是否弹出提示显示
const init = () => { const init = () => {
customData.value = { customData.value = {
title: "", //标题 title: "", //标题
textAlign: "left", //标题位置可选属性left 可选属性值 left,right,center textAlign: "left", //标题位置可选属性left 可选属性值 left,right,center
@@ -34,13 +40,16 @@ const init = () => {
isRadius: false, //是否圆角 isRadius: false, //是否圆角
isSpace: false, //是否显示间隔 isSpace: false, //是否显示间隔
isLabelLine: true, //是否显示引导线 isLabelLine: true, //是否显示引导线
titleFontSize: '14px', //标题字体大小
...props.customData, ...props.customData,
}; };
legendData.value = { legendData.value = {
icon: "roundRect", // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon) icon: "roundRect", // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
orient: "vertical", //图例排列方向 orient: "vertical", //图例排列方向
left: "right", //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值, left: "right", //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
itemGap: 1, // 设置图例项之间的间隔为20 itemGap: 10, // 设置图例项之间的间隔为20
...props.legendData, ...props.legendData,
}; };
chart.value = chartsRef.value && echarts.init(chartsRef.value); chart.value = chartsRef.value && echarts.init(chartsRef.value);
@@ -48,10 +57,27 @@ const init = () => {
title: { title: {
text: customData.value.title, text: customData.value.title,
left: customData.value.textAlign, left: customData.value.textAlign,
textStyle: {
fontSize: customData.value.titleFontSize, // 使用 titleFontSize 属性
},
}, },
legend:legendData.value, legend:legendData.value,
// legend: {
// icon: legendData.value.icon, // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
// orient: "vertical", //图例排列方向
// left: legendData.value.left, //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
// itemGap: 1, // 设置图例项之间的间隔为20
// formatter: function (name) {
// const item = props.chartsData.filter(item=>item.name==name)
// console.log(item)
// if(item)
// return item[0].value;
// },
// },
tooltip: { tooltip: {
show: true, show: labelIsShow.value,
trigger: "item", trigger: "item",
formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ", formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ",
borderWidth: 1, borderWidth: 1,
@@ -61,7 +87,13 @@ const init = () => {
type: "pie", type: "pie",
radius: customData.value.isRing ? ["55", "75"] : "80%", radius: customData.value.isRing ? ["55", "75"] : "80%",
data: props.chartsData, data: props.chartsData,
center: ["55%", "50%"], // 设置饼图的中心位置 formatter: function (name: any) {
const item = props.chartsData.filter(item=>item.name==name)
//console.log(item)
if(item)
return item[0].value;
},
center: ["55%", "55%"], // 设置饼图的中心位置
// padAngle: 2, // padAngle: 2,
minAngle: 15, //最小角度 minAngle: 15, //最小角度
startAngle: 270, //起始角度 startAngle: 270, //起始角度
@@ -74,12 +106,15 @@ const init = () => {
}, },
label: { label: {
normal: { normal: {
show: true, show: labelIsShow.value,
position: "inside", position: "outside",
textStyle: { textStyle: {
color: "#fff", //color: "#fff",
fontSize: 12, fontSize: 12,
}, },
formatter: function (data) {
return labelIsShow.value ? data.value + '台' : '';
}
}, },
}, },
itemStyle: { itemStyle: {
@@ -93,6 +128,7 @@ const init = () => {
}, },
], ],
}; };
option && chart.value && chart.value.setOption(option); option && chart.value && chart.value.setOption(option);
setTimeout(() => { setTimeout(() => {
chart.value.resize(); chart.value.resize();
@@ -108,7 +144,7 @@ const reSize = (widthValue: number,heightValue: number,silentValue: boolean) =>
} }
}; };
const resizeCharts = () => { const resizeCharts = () => {
console.log(chart.value,111111); //console.log(chart.value,111111);
if (chart.value) { if (chart.value) {
chart.value.resize(); chart.value.resize();
@@ -128,6 +164,12 @@ watch(
() => props.chartsData, () => props.chartsData,
(val, oldVal) => { (val, oldVal) => {
if (val) { if (val) {
const item = props.chartsData.find(item => item.value === 0);
if(item != undefined){
labelIsShow.value = false;
}else{
labelIsShow.value = true;
}
init(); init();
} }
}, },

View File

@@ -3,11 +3,13 @@
// 首页地址(默认) // 首页地址(默认)
export const HOME_URL: string = "/home/index"; export const HOME_URL: string = "/home/index";
// export const HOME_URL: string = "/machine/controlSource";
// 登录页地址(默认) // 登录页地址(默认)
export const LOGIN_URL: string = "/login"; export const LOGIN_URL: string = "/login";
// 默认主题颜色 // 默认主题颜色
export const DEFAULT_PRIMARY: string = "#003078"; export const DEFAULT_PRIMARY: string = "#526ADE";
// 路由白名单地址(本地存在的路由 staticRouter.ts 中) // 路由白名单地址(本地存在的路由 staticRouter.ts 中)
export const ROUTER_WHITE_LIST: string[] = ["/500"]; export const ROUTER_WHITE_LIST: string[] = ["/500"];
@@ -17,3 +19,5 @@ export const AMAP_MAP_KEY: string = "";
// 百度地图 key // 百度地图 key
export const BAIDU_MAP_KEY: string = ""; export const BAIDU_MAP_KEY: string = "";

View File

@@ -13,9 +13,11 @@ const auth: Directive = {
// console.log('1234',authStore.routeName) // console.log('1234',authStore.routeName)
// console.log('123',currentPageRoles) // console.log('123',currentPageRoles)
if (value instanceof Array && value.length) { if (value instanceof Array && value.length) {
//console.log('123456',value)
const hasPermission = value.every(item => currentPageRoles.includes(item)) const hasPermission = value.every(item => currentPageRoles.includes(item))
if (!hasPermission) el.remove() if (!hasPermission) el.remove()
} else { } else {
//console.log('12345',value)
if (!currentPageRoles.includes(value)) el.remove() if (!currentPageRoles.includes(value)) el.remove()
} }
}, },

View File

@@ -4,7 +4,8 @@
export enum ResultEnum { export enum ResultEnum {
SUCCESS = "A0000", SUCCESS = "A0000",
ERROR = 500, ERROR = 500,
OVERDUE = "401", ACCESSTOKEN_EXPIRED = "A0024",
OVERDUE = "A0025",
TIMEOUT = 30000, TIMEOUT = 30000,
TYPE = "success" TYPE = "success"
} }

View File

@@ -27,6 +27,7 @@ export const useTheme = () => {
// 修改主题颜色 // 修改主题颜色
const changePrimary = (val: string | null) => { const changePrimary = (val: string | null) => {
if (!val) { if (!val) {
val = DEFAULT_PRIMARY; val = DEFAULT_PRIMARY;
ElMessage({ type: "success", message: `主题颜色已重置为 ${DEFAULT_PRIMARY}` }); ElMessage({ type: "success", message: `主题颜色已重置为 ${DEFAULT_PRIMARY}` });
@@ -40,10 +41,13 @@ export const useTheme = () => {
for (let i = 1; i <= 9; i++) { for (let i = 1; i <= 9; i++) {
const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`; const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`;
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor); document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor);
// const colorValue = document.documentElement.style.getPropertyValue(`--el-color-primary-light-${i}`).trim();
// console.log(`--el-color-primary-light-${i}: ${colorValue}`);
} }
globalStore.setGlobalState("primary", val); globalStore.setGlobalState("primary", val);
};
}
// 灰色和弱色切换 // 灰色和弱色切换
const changeGreyOrWeak = (type: Theme.GreyOrWeakType, value: boolean) => { const changeGreyOrWeak = (type: Theme.GreyOrWeakType, value: boolean) => {
const body = document.body as HTMLElement; const body = document.body as HTMLElement;

View File

@@ -26,6 +26,8 @@ export default {
changePassword: "Change Password", changePassword: "Change Password",
changeMode:"Change Mode", changeMode:"Change Mode",
versionRegister:"Version Register", versionRegister:"Version Register",
changeTheme: "Change Theme",
changeScene: "Change Scene",
logout: "Logout" logout: "Logout"
} }
}; };

View File

@@ -26,6 +26,8 @@ export default {
changePassword: "修改密码", changePassword: "修改密码",
changeMode:"模式切换", changeMode:"模式切换",
versionRegister:"版本注册", versionRegister:"版本注册",
changeTheme:"主题切换",
changeScene: "场景切换",
logout: "退出登录" logout: "退出登录"
} }
}; };

View File

@@ -39,7 +39,9 @@
} }
.el-menu-item:hover { .el-menu-item:hover {
color: #fff; //一级导航划过颜色 color: #fff; //一级导航划过颜色
background-color: #5274a5 !important; //一级导航划过背景色 //background-color: #5274a5 !important; //一级导航划过背景色
background-color:var(--el-color-primary-light-3) !important;
} }
.el-sub-menu__hide-arrow { .el-sub-menu__hide-arrow {
width: 65px; width: 65px;
@@ -47,7 +49,9 @@
} }
.el-menu-item.is-active { .el-menu-item.is-active {
color: #fff !important; //一级导航文字选中颜色 color: #fff !important; //一级导航文字选中颜色
background-color: #5274a5 !important; //一级导航选中背景色 //background-color: #5274a5 !important; //一级导航选中背景色
background-color: var(--el-color-primary-light-3) !important;
border-bottom: 0 !important; border-bottom: 0 !important;
} }
.el-sub-menu__title { .el-sub-menu__title {
@@ -67,7 +71,9 @@
color: #fff !important; //二级导航文字选中颜色 color: #fff !important; //二级导航文字选中颜色
// background-color: var(--el-color-primary) !important; // background-color: var(--el-color-primary) !important;
// background-color: #5274a5 !important;//二级导航选中背景色 // background-color: #5274a5 !important;//二级导航选中背景色
background-color: #5274a5 !important;
//background-color: #7588e5 !important;
background-color: var(--el-color-primary-light-3) !important;
border-bottom-color: var(--el-color-primary) !important; border-bottom-color: var(--el-color-primary) !important;
} }
} }

View File

@@ -18,14 +18,14 @@
<!-- </el-button> --> <!-- </el-button> -->
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="title = '模拟式模块'" <el-dropdown-item @click="handelOpen('模拟式')"
>模拟式模块</el-dropdown-item >模拟式模块</el-dropdown-item
> >
<el-dropdown-item @click="title = '数字式模块'" <el-dropdown-item @click="handelOpen('数字式')"
>数字式模块</el-dropdown-item >数字式模块</el-dropdown-item
> >
<el-dropdown-item @click="title = '比对式模块'" <el-dropdown-item @click="handelOpen('比对式')"
>比对式模块</el-dropdown-item disabled>比对式模块</el-dropdown-item
> >
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@@ -39,26 +39,30 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, computed, onMounted, watch } from "vue"; import { ref, reactive, computed, onMounted, watch } from "vue";
const title = ref("模拟式模块"); import { useAuthStore } from "@/stores/modules/auth";
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { useRouter } from "vue-router";
const router = useRouter();
const authStore = useAuthStore();
const modeStore = useModeStore(); const modeStore = useModeStore();
watch(() => modeStore.currentMode, (newVal) => {
//console.log('当前模式:', newVal); const title = computed(() => {
switch (newVal) { return modeStore.currentMode=== ''? '模拟式模块' : modeStore.currentMode+'模块';
case '模拟式':
title.value = '模拟式模块';
break;
case '数字式':
title.value = '数字式模块';
break;
case '比对式':
title.value = '比对式模块';
break;
default:
title.value = '模拟式模块';
}
}); });
const handelOpen = async (item: string) => {
await authStore.setShowMenu();
modeStore.setCurrentMode(item); // 将模式code存入 store
//if (router.currentRoute.value.path === '/home/index') {
// 强制刷新页面
window.location.reload();
//} else {
// router.push({ path: '/home/index' });
//}
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "./index.scss"; @import "./index.scss";
@@ -100,10 +104,11 @@ watch(() => modeStore.currentMode, (newVal) => {
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: right;
line-height: 40px; line-height: 40px;
a { a {
color: #fff; color: #fff;
margin-right: 25px; // 增加右边距
} }
} }
} }

View File

@@ -1,4 +1,12 @@
<template> <template>
<!-- <div class="userInfo">-->
<!-- <div class="icon">-->
<!-- <Avatar/>-->
<!-- </div>-->
<!-- <div class="username">-->
<!-- {{ username }}-->
<!-- </div>-->
<!-- </div>-->
<el-dropdown trigger="click"> <el-dropdown trigger="click">
<div class="userInfo"> <div class="userInfo">
<div class="icon"> <div class="icon">
@@ -10,18 +18,42 @@
</div> </div>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item @click="openDialog('themeRef')">
<el-icon><Sunny /></el-icon>{{ t("header.changeTheme") }}
</el-dropdown-item>
<el-dropdown-item @click="openDialog('infoRef')"> <el-dropdown-item @click="openDialog('infoRef')">
<el-icon><User /></el-icon>{{ $t("header.personalData") }} <el-icon><User /></el-icon>{{ t("header.personalData") }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="openDialog('passwordRef')"> <el-dropdown-item @click="openDialog('passwordRef')">
<el-icon><Edit /></el-icon>{{ $t("header.changePassword") }} <el-icon><Edit /></el-icon>{{ t("header.changePassword") }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="changeMode"> <el-dropdown-item @click="changeMode">
<el-icon><Edit /></el-icon>{{ $t("header.changeMode") }} <el-icon><Switch /></el-icon>{{ t("header.changeMode") }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="openDialog('versionRegisterRef')"> <el-dropdown-item @click="openDialog('versionRegisterRef')">
<el-icon><SetUp /></el-icon>{{ $t("header.versionRegister") }} <el-icon><SetUp /></el-icon>{{ t("header.versionRegister") }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown trigger="hover" placement="left-start" v-if="userStore.userInfo.loginName == 'root'">
<div class="custom-dropdown-trigger">
<el-icon><Tools /></el-icon>
<span>{{ t("header.changeScene") }}</span>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
v-for="item in dictStore.getDictData('app_scene')"
:key="item.value"
:class="{
'custom-dropdown-item': true,
active: item.value === appSceneStore.currentScene
}"
@click="changeScene(item.value?? '')"
>
{{ item.name }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
@@ -34,6 +66,9 @@
<PasswordDialog ref="passwordRef"></PasswordDialog> <PasswordDialog ref="passwordRef"></PasswordDialog>
<!-- versionRegisterDialog --> <!-- versionRegisterDialog -->
<VersionDialog ref="versionRegisterRef"></VersionDialog> <VersionDialog ref="versionRegisterRef"></VersionDialog>
<!-- ThemeDialog -->
<ThemeDialog ref="themeRef"></ThemeDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -42,12 +77,13 @@ import { LOGIN_URL } from "@/config";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { logoutApi } from "@/api/user/login"; import { logoutApi } from "@/api/user/login";
import { useUserStore } from "@/stores/modules/user"; import { useUserStore } from "@/stores/modules/user";
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage, CHANGE_EVENT } from "element-plus";
import InfoDialog from "./InfoDialog.vue"; import InfoDialog from "./InfoDialog.vue";
import PasswordDialog from "./PasswordDialog.vue"; import PasswordDialog from "./PasswordDialog.vue";
import ThemeDialog from "./ThemeDialog.vue";
import VersionDialog from "@/views/system/versionRegister/index.vue"; import VersionDialog from "@/views/system/versionRegister/index.vue";
import { computed } from "vue"; import { computed } from "vue";
import { Avatar } from "@element-plus/icons-vue"; import { ArrowLeft, Avatar, Delete, Document, Sunny, Switch ,Tools} from "@element-plus/icons-vue";
import AssemblySize from "./components/AssemblySize.vue"; import AssemblySize from "./components/AssemblySize.vue";
import Language from "./components/Language.vue"; import Language from "./components/Language.vue";
import SearchMenu from "./components/SearchMenu.vue"; import SearchMenu from "./components/SearchMenu.vue";
@@ -56,13 +92,24 @@ import Message from "./components/Message.vue";
import Fullscreen from "./components/Fullscreen.vue"; import Fullscreen from "./components/Fullscreen.vue";
import { useAuthStore } from "@/stores/modules/auth"; import { useAuthStore } from "@/stores/modules/auth";
import {useDictStore} from "@/stores/modules/dict"; import {useDictStore} from "@/stores/modules/dict";
import { useModeStore } from "@/stores/modules/mode"; import { useModeStore,useAppSceneStore } from "@/stores/modules/mode";
const userStore = useUserStore(); const userStore = useUserStore();
const dictStore = useDictStore(); const dictStore = useDictStore();
const username = computed(() => userStore.userInfo.name); const username = computed(() => userStore.userInfo.name);
const router = useRouter(); const router = useRouter();
const authStore = useAuthStore(); const authStore = useAuthStore();
const modeStore = useModeStore(); const modeStore = useModeStore();
const AppSceneStore = useAppSceneStore();
import { useTheme } from "@/hooks/useTheme";
import { useI18n } from "vue-i18n";
import {updateScene} from '@/api/system/base/index'
const { changePrimary} = useTheme();
// 初始化 i18n
const { t } = useI18n(); // 使用 t 方法替代 $t
// 退出登录 // 退出登录
const logout = () => { const logout = () => {
@@ -74,10 +121,14 @@ const logout = () => {
// 1.执行退出登录接口 // 1.执行退出登录接口
await logoutApi(); await logoutApi();
// 2.清除 Token // 2.清除 Token
userStore.setToken(""); userStore.setAccessToken("");
userStore.setUserInfo({name: ""}); userStore.setRefreshToken("");
userStore.setExp(0)
userStore.setUserInfo({id: "", name: ""});
userStore.setIsRefreshToken(false)
dictStore.setDictData([]); dictStore.setDictData([]);
modeStore.setCurrentMode(''); modeStore.setCurrentMode('');
AppSceneStore.setCurrentMode('');
// 3.重定向到登陆页 // 3.重定向到登陆页
router.replace(LOGIN_URL); router.replace(LOGIN_URL);
ElMessage.success("退出登录成功!"); ElMessage.success("退出登录成功!");
@@ -90,12 +141,26 @@ const logout = () => {
const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null); const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null); const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null);
const versionRegisterRef = ref<InstanceType<typeof VersionDialog> | null>(null); const versionRegisterRef = ref<InstanceType<typeof VersionDialog> | null>(null);
const themeRef = ref<InstanceType<typeof ThemeDialog> | null>(null);
const openDialog = (ref: string) => { const openDialog = (ref: string) => {
if (ref == "infoRef") infoRef.value?.openDialog(); if (ref == "infoRef") infoRef.value?.openDialog();
if (ref == "passwordRef") passwordRef.value?.openDialog(); if (ref == "passwordRef") passwordRef.value?.openDialog();
if (ref == "versionRegisterRef") versionRegisterRef.value?.openDialog(); if (ref == "versionRegisterRef") versionRegisterRef.value?.openDialog();
if (ref == "themeRef") themeRef.value?.openDialog();
}; };
const appSceneStore = useAppSceneStore();
const changeScene = async (value: string) => {
appSceneStore.setCurrentMode(value);
await updateScene({scene :dictStore.getDictData('app_scene').find(item => item.value == value)?.id});
// 强制刷新页面
window.location.reload();
};
//模式切换 //模式切换
const changeMode = () => { const changeMode = () => {
authStore.changeModel(); authStore.changeModel();
@@ -135,4 +200,18 @@ const changeMode = () => {
// height: 100%; // height: 100%;
} }
} }
.custom-dropdown-trigger {
padding: 8px 15px;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
}
:deep(.el-dropdown-menu__item.custom-dropdown-item.active),
:deep(.el-dropdown-menu__item.custom-dropdown-item.active:hover) {
background-color: var(--el-color-primary-light-9) !important;
color: var(--el-color-primary)
}
</style> </style>

View File

@@ -0,0 +1,45 @@
<template>
<el-dialog v-model="dialogVisible" title="主题切换" width="500px" draggable>
<el-divider content-position="center">主题颜色</el-divider>
<div style="display: flex; justify-content: center;">
<el-color-picker v-model="color" />
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="sure">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useTheme } from "@/hooks/useTheme";
import { on } from "events";
const color = ref('')
const { changePrimary} = useTheme();
const dialogVisible = ref(false);
const openDialog = () => {
// 修复:使用可选链和空值合并运算符确保不会出现 null 或 undefined
const storedColor = JSON.parse(localStorage.getItem('cn-global') ?? '{}').primary;
color.value = storedColor ?? '#526ADE'; // 默认值为 '#526ADE'
dialogVisible.value = true;
};
const sure = () => {
changePrimary(color.value); // 切换主题
dialogVisible.value = false;
};
// onMounted(() => {
// // 修复:使用可选链和空值合并运算符确保不会出现 null 或 undefined
// const storedColor = JSON.parse(localStorage.getItem('cn-global') ?? '{}').primary;
// console.log('123',storedColor)
// color.value = storedColor ?? '#526ADE'; // 默认值为 '#526ADE'
// })
defineExpose({ openDialog });
</script>

View File

@@ -1,7 +1,7 @@
.el-main { .el-main {
box-sizing: border-box; box-sizing: border-box;
padding: 20px;//主体padding padding: 15px;//主体padding
overflow-x: hidden; overflow: hidden;
background-color: var(--el-bg-color-page); background-color: var(--el-bg-color-page);
} }
.el-footer { .el-footer {

View File

@@ -2,21 +2,16 @@
<Maximize v-show="maximize" /> <Maximize v-show="maximize" />
<Tabs v-if="tabs && showMenuFlag" /> <Tabs v-if="tabs && showMenuFlag" />
<el-main> <el-main>
<!-- style="height: calc(100vh - 157px);overflow-y:auto; overflow-x:hidden;" :style='{height:showMenuFlag?"calc(100vh - 157px)":" calc(100vh - 120px)"}' -->
<router-view v-slot="{ Component, route }" style="height:100%;"> <router-view v-slot="{ Component, route }" style="height:100%;">
<transition appear name="fade-transform" mode="out-in"> <!-- {{ keepAliveName}} -->
<keep-alive :include="keepAliveName"> <!-- <transition name="slide-right" mode="out-in"> -->
<component <keep-alive :include="tabsMenuList" >
:is="Component" <component :is="Component" :key="route.fullPath" />
v-if="isRouterShow"
:key="route.fullPath"
/>
</keep-alive> </keep-alive>
</transition> <!-- </transition> -->
</router-view> </router-view>
</el-main> </el-main>
<el-footer> <el-footer>
<!-- v-show="footer" -->
<Footer /> <Footer />
</el-footer> </el-footer>
</template> </template>
@@ -31,12 +26,15 @@ import Maximize from "./components/Maximize.vue";
import Tabs from "@/layouts/components/Tabs/index.vue"; import Tabs from "@/layouts/components/Tabs/index.vue";
import Footer from "@/layouts/components/Footer/index.vue"; import Footer from "@/layouts/components/Footer/index.vue";
import { useAuthStore } from "@/stores/modules/auth"; import { useAuthStore } from "@/stores/modules/auth";
import { useTabsStore } from '@/stores/modules/tabs'
const tabStore = useTabsStore()
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
const tabsMenuList = computed(() => tabStore.tabsMenuList.map(item => item.name))
const authStore = useAuthStore(); const authStore = useAuthStore();
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore); const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
const keepAliveStore = useKeepAliveStore(); const keepAliveStore = useKeepAliveStore();
const { keepAliveName } = storeToRefs(keepAliveStore); const { keepAliveName } = storeToRefs(keepAliveStore);
// console.log("🚀 ~ keepAliveName:", keepAliveName)
//是否显示导航栏 //是否显示导航栏
const showMenuFlag = computed(() => authStore.showMenuFlagGet); const showMenuFlag = computed(() => authStore.showMenuFlagGet);
// 注入刷新页面方法 // 注入刷新页面方法
@@ -65,6 +63,7 @@ watch(
{ immediate: true } { immediate: true }
); );
// 监听窗口大小变化,折叠侧边栏 // 监听窗口大小变化,折叠侧边栏
const screenWidth = ref(0); const screenWidth = ref(0);
const listeningWindow = useDebounceFn(() => { const listeningWindow = useDebounceFn(() => {

View File

@@ -33,14 +33,19 @@ const handleClickMenu = (subItem: Menu.MenuOptions) => {
// color: var(--el-menu-hover-text-color) !important; // color: var(--el-menu-hover-text-color) !important;
// background-color: transparent !important; // background-color: transparent !important;
color: #fff !important;//一级导航文字选中颜色 color: #fff !important;//一级导航文字选中颜色
background-color: #5274a5 !important; //一级导航选中背景色 //background-color: #5274a5 !important; //一级导航选中背景色
background-color: var(--el-color-primary-light-3) !important;
} }
.el-menu--collapse { .el-menu--collapse {
.is-active { .is-active {
.el-sub-menu__title { .el-sub-menu__title {
color: #ffffff !important; color: #ffffff !important;
// background-color: var(--el-color-primary) !important; // background-color: var(--el-color-primary) !important;
background-color: #5274a5 !important; //background-color: #5274a5 !important;
background-color: var(--el-color-primary-light-3) !important;
border-bottom: 0 !important; border-bottom: 0 !important;
} }
} }
@@ -53,7 +58,9 @@ const handleClickMenu = (subItem: Menu.MenuOptions) => {
// color: var(--el-menu-active-color) !important; // color: var(--el-menu-active-color) !important;
// background-color: var(--el-menu-active-bg-color) !important; // background-color: var(--el-menu-active-bg-color) !important;
color: #fff !important;//一级导航文字选中颜色 color: #fff !important;//一级导航文字选中颜色
background-color: #5274a5 !important; //一级导航选中背景色 //background-color: #5274a5 !important; //一级导航选中背景色
background-color: var(--el-color-primary-light-3) !important;
&::before { &::before {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@@ -1,12 +1,17 @@
<template> <template>
<div class='tabs-box'> <div class="tabs-box">
<div class='tabs-menu'> <div class="tabs-menu">
<el-tabs v-model='tabsMenuValue' type='card' @tab-click='tabClick' @tab-remove='tabRemove'> <el-tabs v-model="tabsMenuValue" type="card" @tab-click="tabClick" @tab-remove="tabRemove">
<el-tab-pane v-for='item in tabsMenuList' :key='item.path' :label='item.title' :name='item.path' <el-tab-pane
:closable='item.close'> v-for="item in tabsMenuList"
:key="item.path"
:label="item.title"
:name="item.path"
:closable="item.close"
>
<template #label> <template #label>
<el-icon v-show='item.icon && tabsIcon' class='tabs-icon'> <el-icon v-show="item.icon && tabsIcon" class="tabs-icon">
<component :is='item.icon'></component> <component :is="item.icon"></component>
</el-icon> </el-icon>
{{ item.title }} {{ item.title }}
</template> </template>
@@ -17,7 +22,7 @@
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import { ref, computed, watch, onMounted } from 'vue' import { ref, computed, watch, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
@@ -42,7 +47,6 @@ onMounted(() => {
initTabs() initTabs()
}) })
// 监听路由的变化(防止浏览器后退/前进不变化 tabsMenuValue // 监听路由的变化(防止浏览器后退/前进不变化 tabsMenuValue
watch( watch(
() => route.fullPath, () => route.fullPath,
@@ -58,12 +62,12 @@ watch(
path: route.fullPath, path: route.fullPath,
name: route.name as string, name: route.name as string,
close: !route.meta.isAffix, close: !route.meta.isAffix,
isKeepAlive: route.meta.isKeepAlive as boolean, isKeepAlive: route.meta.isKeepAlive as boolean
} }
tabStore.addTabs(tabsParams) tabStore.addTabs(tabsParams)
} }
}, },
{ immediate: true }, { immediate: true }
) )
// 初始化需要固定的 tabs // 初始化需要固定的 tabs
@@ -77,6 +81,7 @@ const initTabs = () => {
name: item.name, name: item.name,
close: !item.meta.isAffix, close: !item.meta.isAffix,
isKeepAlive: item.meta.isKeepAlive, isKeepAlive: item.meta.isKeepAlive,
unshift: true
} }
tabStore.addTabs(tabsParams) tabStore.addTabs(tabsParams)
} }
@@ -93,22 +98,25 @@ const tabsDrop = () => {
const currRow = tabsList.splice(oldIndex as number, 1)[0] const currRow = tabsList.splice(oldIndex as number, 1)[0]
tabsList.splice(newIndex as number, 0, currRow) tabsList.splice(newIndex as number, 0, currRow)
tabStore.setTabs(tabsList) tabStore.setTabs(tabsList)
}, }
}) })
} }
// Tab Click // Tab Click
const tabClick = (tabItem: TabsPaneContext) => { const tabClick = (tabItem: TabsPaneContext) => {
const fullPath = tabItem.props.name as string const fullPath = tabItem.props.name as string
// console.log("🚀 ~ tabClick ~ fullPath:", tabItem)
router.push(fullPath) router.push(fullPath)
} }
// Remove Tab // Remove Tab
const tabRemove = (fullPath: TabPaneName) => { const tabRemove = (fullPath: TabPaneName) => {
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath)
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath || '/machine/testScriptAdd' == route.fullPath)
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

@@ -46,7 +46,7 @@
border-radius: 3px; border-radius: 3px;
} }
.layout-light { .layout-light {
background-color: var(--el-color-primary-light-5); background-color: var(--el-color-primary-light-3);
border-radius: 3px; border-radius: 3px;
} }
.layout-content { .layout-content {

View File

@@ -65,5 +65,6 @@ const setupAll = async () => {
//挂载app //挂载app
setupAll().then(() => { setupAll().then(() => {
app.mount('#app') app.mount('#app')
}) })

View File

@@ -30,6 +30,7 @@ const routerMode = {
* @param meta.isKeepAlive ==> 当前路由是否缓存 * @param meta.isKeepAlive ==> 当前路由是否缓存
* */ * */
const router = createRouter({ const router = createRouter({
history: routerMode[mode](), history: routerMode[mode](),
routes: [...staticRouter], routes: [...staticRouter],
// 不区分路由大小写,非严格模式下提供了更宽松的路径匹配 // 不区分路由大小写,非严格模式下提供了更宽松的路径匹配
@@ -46,14 +47,13 @@ router.beforeEach(async (to, from, next) => {
const authStore = useAuthStore() const authStore = useAuthStore()
// 1.NProgress 开始 // 1.NProgress 开始
NProgress.start() NProgress.start()
// 2.动态设置标题 // 2.动态设置标题
const title = import.meta.env.VITE_GLOB_APP_TITLE const title = import.meta.env.VITE_GLOB_APP_TITLE
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title document.title = to.meta.title ? `${to.meta.title} - ${title}` : title
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页 // 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
if (to.path.toLocaleLowerCase() === LOGIN_URL) { if (to.path.toLocaleLowerCase() === LOGIN_URL) {
if (userStore.token) return next(from.fullPath) if (userStore.accessToken) return next(from.fullPath)
resetRouter() resetRouter()
return next() return next()
} }
@@ -62,17 +62,16 @@ router.beforeEach(async (to, from, next) => {
if (ROUTER_WHITE_LIST.includes(to.path)) return next() if (ROUTER_WHITE_LIST.includes(to.path)) return next()
// 5.判断是否有 Token没有重定向到 login 页面 // 5.判断是否有 Token没有重定向到 login 页面
if (!userStore.token) return next({ path: LOGIN_URL, replace: true }) if (!userStore.accessToken) return next({ path: LOGIN_URL, replace: true })
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由 // 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
if (!authStore.authMenuListGet.length) { if (!authStore.authMenuListGet.length) {
await initDynamicRouter() await initDynamicRouter()
return next({ ...to, replace: true }) return next({ ...to, replace: true })
} }
//console.log(to)
// 7.存储 routerName 做按钮权限筛选 // 7.存储 routerName 做按钮权限筛选
authStore.setRouteName(to.name as string) authStore.setRouteName(to.name as string)
// 8.正常访问页面 // 8.正常访问页面
next() next()
}) })

View File

@@ -28,7 +28,9 @@ export const initDynamicRouter = async () => {
type: "warning", type: "warning",
duration: 3000 duration: 3000
}); });
userStore.setToken(""); userStore.setAccessToken("");
userStore.setRefreshToken("");
userStore.setExp(0)
router.replace(LOGIN_URL); router.replace(LOGIN_URL);
return Promise.reject("No permission"); return Promise.reject("No permission");
} }
@@ -36,9 +38,11 @@ export const initDynamicRouter = async () => {
// 3.添加动态路由 // 3.添加动态路由
authStore.flatMenuListGet.forEach(item => { authStore.flatMenuListGet.forEach(item => {
item.children && delete item.children; item.children && delete item.children;
if (item.component && typeof item.component == "string") { if (item.component && typeof item.component == "string") {
item.component = modules["/src/views" + item.component + ".vue"]; item.component = modules["/src/views" + item.component + ".vue"];
} }
if (item.meta.isFull) { if (item.meta.isFull) {
router.addRoute(item as unknown as RouteRecordRaw); router.addRoute(item as unknown as RouteRecordRaw);
} else { } else {
@@ -47,7 +51,9 @@ export const initDynamicRouter = async () => {
}); });
} catch (error) { } catch (error) {
// 当按钮 || 菜单请求出错时,重定向到登陆页 // 当按钮 || 菜单请求出错时,重定向到登陆页
userStore.setToken(""); userStore.setAccessToken("");
userStore.setRefreshToken("");
userStore.setExp(0)
router.replace(LOGIN_URL); router.replace(LOGIN_URL);
return Promise.reject(error); return Promise.reject(error);
} }

View File

@@ -1,122 +1,139 @@
import { RouteRecordRaw } from "vue-router"; import { RouteRecordRaw } from 'vue-router'
import { HOME_URL, LOGIN_URL } from "@/config"; import { HOME_URL, LOGIN_URL } from '@/config'
export const Layout = () => import('@/layouts/index.vue'); export const Layout = () => import('@/layouts/index.vue')
/** /**
* staticRouter (静态路由) * staticRouter (静态路由)
*/ */
export const staticRouter: RouteRecordRaw[] = [ export const staticRouter: RouteRecordRaw[] = [
{ {
path: "/", path: '/',
redirect: HOME_URL, redirect: HOME_URL
}, },
{ {
path: LOGIN_URL, path: LOGIN_URL,
name: "login", name: 'login',
component: () => import("@/views/login/index.vue"), component: () => import('@/views/login/index.vue'),
meta: { meta: {
title: "登录", title: '登录'
}, }
}, },
{ {
path: "/layout", path: '/layout',
name: "layout", name: 'layout',
component: Layout, component: Layout,
children: [ children: [
{ {
path: "/plan", path: '/plan',
name: "plan", name: 'plan',
redirect: "/plan/planList", redirect: '/plan/planList',
children: [ children: [
{ // {
path: "/plan/planList", // path: "/plan/planList",
name: "planList", // name: "planList",
component: () => import("@/views/plan/planList/index.vue"), // component: () => import("@/views/plan/planList/index.vue"),
meta: { // meta: {
title: "检测计划列表", // title: "检测计划列表",
icon: "List", // icon: "List",
isLink: "", // isLink: "",
isHide: false, // isHide: false,
isFull: false, // isFull: false,
isAffix: false, // isAffix: false,
isKeepAlive: false, // isKeepAlive: true,//缓存改成true
}, // },
}, // },
{ // {
path: "/plan/singlePlanList", // path: "/plan/singlePlanList",
name: "singlePlanList", // name: "singlePlanList",
component: () => import("@/views/plan/singlePlanList/index.vue"), // component: () => import("@/views/plan/singlePlanList/index.vue"),
meta: { // meta: {
title: "单个计划列表", // title: "单个计划列表",
icon: "List", // icon: "List",
isLink: "", // isLink: "",
isHide: false, // isHide: false,
isFull: false, // isFull: false,
isAffix: false, // isAffix: false,
isKeepAlive: false, // isKeepAlive: true,
}, // },
}, // },
{ // {
path: "/plan/preTest", // path: "/plan/preTest",
name: "preTest", // name: "preTest",
component: () => import("@/views/plan/preTest/index.vue"), // component: () => import("@/views/plan/preTest/index.vue"),
meta: { // meta: {
title: "预检测", // title: "预检测",
icon: "List", // icon: "List",
isLink: "", // isLink: "",
isHide: false, // isHide: false,
isFull: false, // isFull: false,
isAffix: false, // isAffix: false,
isKeepAlive: false, // isKeepAlive: false,
}, // },
}, // },
{ // {
path: "/plan/autoTest", // path: "/plan/autoTest",
name: "autoTest", // name: "autoTest",
component: () => import("@/views/plan/autoTest/index.vue"), // component: () => import("@/views/plan/autoTest/index.vue"),
meta: { // meta: {
title: "自动检测", // title: "自动检测",
icon: "List", // icon: "List",
isLink: "", // isLink: "",
hideTab:true, // hideTab:true,
parentPath:'/system/proTable', // parentPath:'/system/proTable',
isHide: false, // isHide: false,
isFull: false, // isFull: false,
isAffix: false, // isAffix: false,
isKeepAlive: false, // isKeepAlive: true,
}, // },
}, // },
// 错误页面路由 // 错误页面路由
{ {
path: "/403", path: '/403',
name: "403", name: '403',
component: () => import("@/components/ErrorMessage/403.vue"), component: () => import('@/components/ErrorMessage/403.vue'),
meta: { meta: {
title: "403页面", title: '403页面'
}, }
}, },
{ {
path: "/404", path: '/404',
name: "404", name: '404',
component: () => import("@/components/ErrorMessage/404.vue"), component: () => import('@/components/ErrorMessage/404.vue'),
meta: { meta: {
title: "404页面", title: '404页面'
}, }
}, },
{ {
path: "/500", path: '/500',
name: "500", name: '500',
component: () => import("@/components/ErrorMessage/500.vue"), component: () => import('@/components/ErrorMessage/500.vue'),
meta: { meta: {
title: "500页面", title: '500页面'
}, }
}, },
// Resolve refresh page, route warnings // Resolve refresh page, route warnings
{ {
path: "/:pathMatch(.*)*", path: '/:pathMatch(.*)*',
component: () => import("@/components/ErrorMessage/404.vue"), component: () => import('@/components/ErrorMessage/404.vue')
},
],
} }
], ]
}, },
]; {
path: '/machine/testScriptAdd',
name: 'testScriptAdd',
component: () => import('@/views/machine/testScript/components/testScriptPopup.vue'),
meta: {
title: '检测脚本配置',
icon: 'List',
isLink: '',
hideTab: true,
parentPath: '/machine/testScript',
isHide: false,
isFull: false,
isAffix: false,
isKeepAlive: true
}
}
]
}
]

View File

@@ -17,3 +17,5 @@ export const USER_STORE_KEY = "cn-user";
// pinia中dict store的key // pinia中dict store的key
export const DICT_STORE_KEY = "cn-dictData"; export const DICT_STORE_KEY = "cn-dictData";
export const CHECK_STORE_KEY = "cn-check";

View File

@@ -27,8 +27,10 @@ export interface GlobalState {
/* UserState */ /* UserState */
export interface UserState { export interface UserState {
token: string; accessToken: string;
userInfo: { name: string }; refreshToken: string;
isRefreshToken: boolean;
userInfo: { id: string, name: string,loginName:string };
} }
/* tabsMenuProps */ /* tabsMenuProps */
@@ -39,6 +41,7 @@ export interface TabsMenuProps {
name: string; name: string;
close: boolean; close: boolean;
isKeepAlive: boolean; isKeepAlive: boolean;
unshift?: boolean;
} }
/* TabsState */ /* TabsState */

View File

@@ -0,0 +1,63 @@
import {defineStore} from "pinia";
import {CHECK_STORE_KEY} from "@/stores/constant";
import type {CheckData} from "@/api/check/interface";
import type {Plan} from '@/api/plan/interface'
import {useAppSceneStore} from "@/stores/modules/mode";
import { set } from "lodash";
const AppSceneStore = useAppSceneStore()
export const useCheckStore = defineStore("check", {
id: CHECK_STORE_KEY,
state: () => ({
devices: Array<CheckData.Device>(),
plan: Object<Plan.ResPlan>(),
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: false, channelsTest: false, test: true}),
checkType:1, // 0:手动检测 1:自动检测
reCheckType: 1, // 0:不合格项复检 1:全部复检
showDetailType: 0 ,// 0:数据查询 1:误差体系跟换 2正式检测
temperature: 0,
humidity: 0
}),
getters: {},
actions: {
addDevices(device: CheckData.Device[]) {
this.devices.push(...device);
},
setPlan(plan: Plan.ResPlan) {
this.plan = plan
},
clearDevices() {
this.devices = [];
},
initSelectTestItems() {
this.selectTestItems.preTest = true
if (AppSceneStore.currentScene === '1') {
this.selectTestItems.channelsTest = true
} else {
this.selectTestItems.channelsTest = false
}
this.selectTestItems.test = true
},
setSelectTestItems(selectTestItems: CheckData.SelectTestItem) {
this.selectTestItems = selectTestItems
},
setCheckType(checkType: number) {
this.checkType = checkType
},
setReCheckType(reCheckType: number) {
this.reCheckType = reCheckType
},
setShowDetailType(showDetailType: number) {
this.showDetailType = showDetailType
},
setTemperature(temperature: number) {
this.temperature = temperature
},
setHumidity(humidity: number) {
this.humidity = humidity
}
}
});

View File

@@ -31,7 +31,7 @@ export const useGlobalStore = defineStore({
// 折叠菜单 // 折叠菜单
isCollapse: false, isCollapse: false,
// 菜单手风琴 // 菜单手风琴
accordion: true, accordion: false,
// 面包屑导航 // 面包屑导航
breadcrumb: true, breadcrumb: true,
// 面包屑导航图标 // 面包屑导航图标
@@ -42,12 +42,14 @@ export const useGlobalStore = defineStore({
tabsIcon: true, tabsIcon: true,
// 页脚 // 页脚
footer: false footer: false
}), }),
getters: {}, getters: {},
actions: { actions: {
// Set GlobalState // Set GlobalState
setGlobalState(...args: ObjToKeyValArray<GlobalState>) { setGlobalState(...args: ObjToKeyValArray<GlobalState>) {
this.$patch({ [args[0]]: args[1] }); this.$patch({ [args[0]]: args[1] });
console.log(DEFAULT_PRIMARY);
} }
}, },
persist: piniaPersistConfig(GLOBAL_STORE_KEY) persist: piniaPersistConfig(GLOBAL_STORE_KEY)

View File

@@ -24,3 +24,16 @@ export const useModeStore = defineStore('mode', {
}, },
}, },
}); });
export const useAppSceneStore = defineStore('scene', {
state: () => ({
currentScene: localStorage.getItem('currentScene') || '' as string,
}),
actions: {
setCurrentMode(sceneName: string) {
this.currentScene = sceneName;
localStorage.setItem('currentScene', sceneName); // 保存到 localStorage
},
},
});

View File

@@ -16,8 +16,14 @@ export const useTabsStore = defineStore({
actions: { actions: {
// Add Tabs // Add Tabs
async addTabs(tabItem: TabsMenuProps) { async addTabs(tabItem: TabsMenuProps) {
if (this.tabsMenuList.every(item => item.path !== tabItem.path)) { if (this.tabsMenuList.every(item => item.path !== tabItem.path)) {
if (tabItem?.unshift) {
this.tabsMenuList.unshift(tabItem);
}else{
this.tabsMenuList.push(tabItem); this.tabsMenuList.push(tabItem);
}
} }
if (!keepAliveStore.keepAliveName.includes(tabItem.name) && tabItem.isKeepAlive) { if (!keepAliveStore.keepAliveName.includes(tabItem.name) && tabItem.isKeepAlive) {
keepAliveStore.addKeepAliveName(tabItem.name); keepAliveStore.addKeepAliveName(tabItem.name);

View File

@@ -6,19 +6,31 @@ import { USER_STORE_KEY } from "@/stores/constant";
export const useUserStore = defineStore({ export const useUserStore = defineStore({
id: USER_STORE_KEY, id: USER_STORE_KEY,
state: (): UserState => ({ state: (): UserState => ({
token: "", accessToken: "",
userInfo: { name: "admin" }, refreshToken: "",
isRefreshToken:false,
exp: Number(0),
userInfo: {id:"", name: "" ,loginName:""},
}), }),
getters: {}, getters: {},
actions: { actions: {
// Set Token // Set Token
setToken(token: string) { setAccessToken(accessToken: string) {
this.token = token; this.accessToken = accessToken;
},
setRefreshToken(refreshToken: string) {
this.refreshToken = refreshToken;
},
setIsRefreshToken(isRefreshToken: boolean) {
this.isRefreshToken = isRefreshToken;
}, },
// Set setUserInfo // Set setUserInfo
setUserInfo(userInfo: UserState["userInfo"]) { setUserInfo(userInfo: UserState["userInfo"]) {
this.userInfo = userInfo; this.userInfo = userInfo;
}, },
setExp(exp: number) {
this.exp = exp;
}
}, },
persist: piniaPersistConfig(USER_STORE_KEY), persist: piniaPersistConfig(USER_STORE_KEY),
}); });

View File

@@ -1,3 +1,5 @@
/* flex */ /* flex */
.flx-center { .flx-center {
display: flex; display: flex;
@@ -77,8 +79,8 @@
/* scroll bar */ /* scroll bar */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 8px;
height: 200px; height: 8px;
// background-color: var(--el-color-primary); // background-color: var(--el-color-primary);
} }
/* 滚动条实际可拖动部分的颜色 */ /* 滚动条实际可拖动部分的颜色 */

View File

@@ -143,13 +143,17 @@
} }
} }
.el-table__body {
// border-left: 1px solid var(--el-table-border-color)
}
// el-table 表格样式 // el-table 表格样式
.el-table { .el-table {
// border: 1px solid var(--el-table-border-color);
// flex: 1; // flex: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-left: 1px solid var(--el-table-border-color) // 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
// 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
table { table {
width: 100%; width: 100%;
} }
@@ -398,7 +402,7 @@
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 8px !important; width: 8px !important;
height: 200px !important; height: 8px !important;
// background-color: var(--el-color-primary); // background-color: var(--el-color-primary);
z-index: 3001; z-index: 3001;
} }
@@ -441,7 +445,7 @@
.dialog-small { .dialog-small {
.el-dialog__body { .el-dialog__body {
max-height: 260px; max-height: 350px;
} }
} }
@@ -457,6 +461,81 @@
} }
} }
.cn-render-buttons {
cursor: pointer;
display: inline-block;
margin-left: 13px;
line-height: 18px;
padding: 2px;
.icon {
font-size: 12px !important;
// color: var(--ba-bg-color-overlay) !important;
}
}
.el-message-box {
padding: 0px !important;
.el-message-box__header {
background-color: var(--el-color-primary);
.el-message-box__title {
color: #fff;
padding: 10px 10px 0;
}
}
.el-message-box__headerbtn {
top: 5px;
}
.el-message-box__close {
svg {
color: #fff;
}
:hover {
color: #409eff;
}
}
.el-message-box__content {
padding: 10px;
border-bottom: 1px solid #cccccc;
}
.el-message-box__btns {
padding: 10px;
}
}
.form-one {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.el-form-item {
display: flex;
width: 98%;
margin-bottom: 15px !important;
.el-form-item__content {
flex: 1;
.el-select,
.el-cascader,
.el-input__inner,
.el-date-editor {
width: 100%;
}
}
}
}
.form-two { .form-two {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -479,14 +558,48 @@
} }
} }
.cn-render-buttons { .form-three {
cursor: pointer; display: flex;
display: inline-block; flex-wrap: wrap;
margin-left: 13px; // justify-content: space-between;
line-height: 18px; .el-form-item {
padding: 2px; display: flex;
.icon { width: 32.3%;
font-size: 12px !important;
// color: var(--ba-bg-color-overlay) !important; .el-form-item__content {
flex: 1;
.el-select,
.el-cascader,
.el-input__inner,
.el-date-editor {
width: 100%;
} }
} }
}
}
.form-four {
display: flex;
flex-wrap: wrap;
// justify-content: space-between;
.el-form-item {
display: flex;
width: 24%;
.el-form-item__content {
flex: 1;
.el-select,
.el-cascader,
.el-input__inner,
.el-date-editor {
width: 100%;
}
}
}
}
.el-table__cell {
border-right: 1px solid #ebeef5 !important;
border-left: 1px solid #ebeef5 !important;
}

View File

@@ -37,6 +37,7 @@ export function rgbToHex(r: any, g: any, b: any) {
* @returns {String} 返回处理后的颜色值 * @returns {String} 返回处理后的颜色值
*/ */
export function getDarkColor(color: string, level: number) { export function getDarkColor(color: string, level: number) {
let reg = /^\#?[0-9A-Fa-f]{6}$/; let reg = /^\#?[0-9A-Fa-f]{6}$/;
if (!reg.test(color)) return ElMessage.warning("输入错误的hex颜色值"); if (!reg.test(color)) return ElMessage.warning("输入错误的hex颜色值");
let rgb = hexToRgb(color); let rgb = hexToRgb(color);
@@ -51,6 +52,7 @@ export function getDarkColor(color: string, level: number) {
* @returns {String} 返回处理后的颜色值 * @returns {String} 返回处理后的颜色值
*/ */
export function getLightColor(color: string, level: number) { export function getLightColor(color: string, level: number) {
let reg = /^\#?[0-9A-Fa-f]{6}$/; let reg = /^\#?[0-9A-Fa-f]{6}$/;
if (!reg.test(color)) return ElMessage.warning("输入错误的hex颜色值"); if (!reg.test(color)) return ElMessage.warning("输入错误的hex颜色值");
let rgb = hexToRgb(color); let rgb = hexToRgb(color);

View File

@@ -4,24 +4,24 @@ import { ElNotification } from "element-plus";
* @description 全局代码错误捕捉 * @description 全局代码错误捕捉
* */ * */
const errorHandler = (error: any) => { const errorHandler = (error: any) => {
// 过滤 HTTP 请求错误 // // 过滤 HTTP 请求错误
if (error.status || error.status == 0) return false; // if (error.status || error.status == 0) return false;
let errorMap: { [key: string]: string } = { // let errorMap: { [key: string]: string } = {
InternalError: "Javascript引擎内部错误", // InternalError: "Javascript引擎内部错误",
ReferenceError: "未找到对象", // ReferenceError: "未找到对象",
TypeError: "使用了错误的类型或对象", // TypeError: "使用了错误的类型或对象",
RangeError: "使用内置对象时,参数超范围", // RangeError: "使用内置对象时,参数超范围",
SyntaxError: "语法错误", // SyntaxError: "语法错误",
EvalError: "错误的使用了Eval", // EvalError: "错误的使用了Eval",
URIError: "URI错误" // URIError: "URI错误"
}; // };
let errorName = errorMap[error.name] || "未知错误"; // let errorName = errorMap[error.name] || "未知错误";
ElNotification({ // ElNotification({
title: errorName, // title: errorName,
message: error, // message: error,
type: "error", // type: "error",
duration: 3000 // duration: 3000
}); // });
}; };
export default errorHandler; export default errorHandler;

View File

@@ -0,0 +1,185 @@
import {ElMessage} from "element-plus";
export default class SocketService {
static instance = null;
static get Instance() {
if (!this.instance) {
this.instance = new SocketService();
}
return this.instance;
}
// 和服务端连接的socket对象
ws = null;
// 存储回调函数
callBackMapping = {};
// 标识是否连接成功
connected = false;
// 记录重试的次数
sendRetryCount = 0;
// 重新连接尝试的次数
connectRetryCount = 0;
work:any;
workerBlobUrl:any;
lastActivityTime= 0; // 上次活动时间戳
lastResponseHeartTime = Date.now();//最后一次收到心跳回复时间
reconnectDelay= 5000; // 重新连接延迟,单位毫秒
// 定义连接服务器的方法
connect() {
// 连接服务器
if (!window.WebSocket) {
return console.log('您的浏览器不支持WebSocket');
}
// let token = $.cookie('123');
// let token = '4E6EF539AAF119D82AC4C2BC84FBA21F';
const url = 'ws://127.0.0.1:7777/hello?name=cdf'
this.ws = new WebSocket(url);
// 连接成功的事件
this.ws.onopen = () => {
ElMessage.success("webSocket连接服务端成功了");
console.log('连接服务端成功了');
this.connected = true;
// 重置重新连接的次数
this.connectRetryCount = 0;
this.updateLastActivityTime();
this.startHeartbeat();
};
// 1.连接服务端失败
// 2.当连接成功之后, 服务器关闭的情况
this.ws.onclose = () => {
console.log('连接webSocket服务端关闭');
this.connected = false;
this.connectRetryCount++;
this.clearHeartbeat();
/* setTimeout(() => {
this.connect();
}, 500 * this.connectRetryCount);*/
};
this.ws.onerror = () => {
ElMessage.error("webSocket连接异常");
};
// 得到服务端发送过来的数据
this.ws.onmessage = (event) => {
// console.log('🚀 ~ SocketService ~ connect ~ event:', event)
if(event.data == 'over') {
//心跳消息处理
this.lastResponseHeartTime = Date.now();
this.updateLastActivityTime(); // 收到心跳响应时更新活动时间
}else {
let message: { [key: string]: any };
try {
console.log('Received message:',event.data)
message = JSON.parse(event.data);
} catch (e) {
return console.error("消息解析失败", event.data, e);
}
/* 通过接受服务端发送的type字段来回调函数 */
if (message?.type && this.callBackMapping[message.type]) {
this.callBackMapping[message.type](message);
} else {
console.log("抛弃====>")
console.log(event.data)
/* 丢弃或继续写你的逻辑 */
}
}
};
}
startHeartbeat() {
this.lastResponseHeartTime = Date.now();
const _this = this
_this.workerBlobUrl = window.URL.createObjectURL(new Blob(['(function(e){setInterval(function(){this.postMessage(null)},9000)})()']));
this.work = new Worker(_this.workerBlobUrl);
this.work.onmessage = function(e){
//判断多久没收到心跳响应
if(_this.lastActivityTime - _this.lastResponseHeartTime > 30000){
//说明已经三轮心跳没收到回复了,关闭检测,提示用户。
ElMessage.error("业务主体模块发生未知异常,请尝试重新启动!");
_this.clearHeartbeat();
return;
}
_this.sendHeartbeat();
}
}
sendHeartbeat() {
console.log(new Date()+"进入心跳消息发送。。。。。。。。。。。。。")
this.ws.send('alive');
this.updateLastActivityTime(); // 发送心跳后更新活动时间
}
updateLastActivityTime() {
this.lastActivityTime = Date.now();
}
clearHeartbeat() {
const _this = this
if (_this.work) {
_this.work.terminate();
_this.work = null;
}
if (_this.workerBlobUrl) {
window.URL.revokeObjectURL(_this.workerBlobUrl); // 释放临时的Blob URL
_this.workerBlobUrl = null;
}
}
// 回调函数的注册
registerCallBack(socketType, callBack) {
this.callBackMapping[socketType] = callBack;
}
// 取消某一个回调函数
unRegisterCallBack(socketType) {
this.callBackMapping[socketType] = null;
}
// 发送数据的方法
send(data) {
// 判断此时此刻有没有连接成功
if (this.connected) {
this.sendRetryCount = 0;
try {
this.ws.send(JSON.stringify(data));
} catch (e) {
this.ws.send(data);
}
} else {
this.sendRetryCount++;
setTimeout(() => {
this.send(data);
}, this.sendRetryCount * 500);
}
}
// 断开方法
closeWs() {
if (this.connected) {
this.ws.close()
}
console.log('执行WS关闭命令..');
}
}

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle"> <el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle">
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' > <el-form :model="formContent" ref='dialogFormRef' :rules='rules' class="form-two">
<el-form-item label="上级菜单" prop="pid" :label-width="100"> <el-form-item label="上级菜单" prop="pid" :label-width="100">
<el-tree-select <el-tree-select
v-model="displayPid" v-model="displayPid"
@@ -14,12 +14,12 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name" :label-width="100"> <el-form-item label="名称" prop="name" :label-width="100">
<el-input v-model="formContent.name" /> <el-input v-model="formContent.name" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code" :label-width="100"> <el-form-item label="编码" prop="code" :label-width="100">
<el-input v-model="formContent.code" /> <el-input v-model="formContent.code" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="图标" prop="icon" :label-width="100"> <el-form-item v-if="!formContent.type" label="图标" prop="icon" :label-width="100">
<IconSelect <IconSelect
v-model="formContent.icon" v-model="formContent.icon"
:iconValue="formContent.icon" :iconValue="formContent.icon"
@@ -27,11 +27,11 @@
placeholder="选择一个图标" placeholder="选择一个图标"
/> />
</el-form-item> </el-form-item>
<el-form-item label="路由地址" prop="path" :label-width="100"> <el-form-item v-if="!formContent.type" label="路由地址" prop="path" :label-width="100" >
<el-input v-model="formContent.path" /> <el-input v-model="formContent.path" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="组件地址" prop="component" :label-width="100"> <el-form-item v-if="!formContent.type" label="组件地址" prop="component" :label-width="100">
<el-input v-model="formContent.component" /> <el-input v-model="formContent.component" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort" :label-width="100"> <el-form-item label="排序" prop="sort" :label-width="100">
<el-input-number v-model="formContent.sort" :min='1' :max='999' /> <el-input-number v-model="formContent.sort" :min='1' :max='999' />
@@ -199,6 +199,8 @@ const displayPid = computed({
functionList.value = response.data as unknown as Function.ResFunction[] functionList.value = response.data as unknown as Function.ResFunction[]
titleType.value = sign titleType.value = sign
dialogVisible.value = true dialogVisible.value = true
rules.value.path = [{ required: true, trigger: 'blur', message: '路由地址必填!' }];
rules.value.component = [{ required: true, trigger: 'blur', message: '组件地址必填!' }];
if (formContent.value.pid ==='0') { if (formContent.value.pid ==='0') {
formContent.value.pid = ''; formContent.value.pid = '';

View File

@@ -34,6 +34,9 @@
import ResourcePopup from './components/resourcePopup.vue' import ResourcePopup from './components/resourcePopup.vue'
import {deleteFunction,getFunctionList} from '@/api/user/function/index' import {deleteFunction,getFunctionList} from '@/api/user/function/index'
import * as Icons from '@element-plus/icons-vue' import * as Icons from '@element-plus/icons-vue'
defineOptions({
name: 'resource'
})
const dictStore = useDictStore() const dictStore = useDictStore()
const resourcePopup = ref() const resourcePopup = ref()
// ProTable 实例 // ProTable 实例

View File

@@ -8,11 +8,11 @@
:rules='rules' :rules='rules'
> >
<el-form-item label="名称" prop='name' :label-width="100" > <el-form-item label="名称" prop='name' :label-width="100" >
<el-input v-model="formContent.name" placeholder="请输入名称" autocomplete="off" :disabled="rootIsEdit"/> <el-input v-model="formContent.name" placeholder="请输入名称" autocomplete="off" :disabled="rootIsEdit" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop='code' :label-width="100"> <el-form-item label="编码" prop='code' :label-width="100">
<el-input v-model="formContent.code" placeholder="请输入编码" autocomplete="off" :disabled="rootIsEdit"/> <el-input v-model="formContent.code" placeholder="请输入编码" autocomplete="off" :disabled="rootIsEdit" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label='类型' prop='type' :label-width="100"> <el-form-item label='类型' prop='type' :label-width="100">
<el-select v-model="formContent.type" clearable placeholder="请选择类型" :disabled="rootIsEdit"> <el-select v-model="formContent.type" clearable placeholder="请选择类型" :disabled="rootIsEdit">

View File

@@ -146,7 +146,6 @@ const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFu
const allIds = getAllIds(AllFunction); const allIds = getAllIds(AllFunction);
// 匹配 roleFunctions 中的 id 并设置 checkedKeys // 匹配 roleFunctions 中的 id 并设置 checkedKeys
const checkedKeys = allIds.filter(id => roleFunctions.some(roleFunc => roleFunc.id === id)); const checkedKeys = allIds.filter(id => roleFunctions.some(roleFunc => roleFunc.id === id));
// 过滤出叶子节点 // 过滤出叶子节点
const leafCheckedKeys = filterLeafNodes(AllFunction, checkedKeys); const leafCheckedKeys = filterLeafNodes(AllFunction, checkedKeys);

View File

@@ -8,17 +8,17 @@
<!-- :requestApi="getRoleList" --> <!-- :requestApi="getRoleList" -->
<!-- 表格 header 按钮 --> <!-- 表格 header 按钮 -->
<template #tableHeader='scope'> <template #tableHeader='scope'>
<el-button v-auth.role="'add'" type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增</el-button> <el-button v-auth.role="'add'" type='primary' :icon='CirclePlus' @click="openDrawer('add')">新增</el-button>
<el-button v-auth.role="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected' <el-button v-auth.role="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'> @click='batchDelete(scope.selectedListIds)'>
批量删除 删除
</el-button> </el-button>
</template> </template>
<!-- 表格操作 --> <!-- 表格操作 -->
<template #operation='scope'> <template #operation='scope'>
<el-button v-auth.role="'edit'" type='primary' link :icon='EditPen' @click="openDrawer('编辑角色', scope.row)">编辑</el-button> <el-button v-auth.role="'edit'" type='primary' link :icon='EditPen' @click="openDrawer('edit', scope.row)" :disabled="scope.row.code == 'root'">编辑</el-button>
<el-button v-auth.role="'delete'" v-if="scope.row.type !== 0 && scope.row.type !== 1" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button> <el-button v-auth.role="'delete'" type='primary' link :icon='Delete' @click='deleteAccount(scope.row)' :disabled="scope.row.code == 'root'">删除</el-button>
<el-button v-auth.role="'SetPermissions'" type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)">设置权限</el-button> <el-button v-auth.role="'SetPermissions'" type='primary' link :icon='Share' @click="openDrawer('设置权限', scope.row)" :disabled="scope.row.code == 'root'">设置权限</el-button>
</template> </template>
</ProTable> </ProTable>
@@ -39,6 +39,9 @@ import RolePopup from './components/rolePopup.vue'
import RoleResourcePopup from './components/roleResourcePopup.vue' import RoleResourcePopup from './components/roleResourcePopup.vue'
import { onMounted, reactive, ref } from 'vue' import { onMounted, reactive, ref } from 'vue'
import {useDictStore} from '@/stores/modules/dict' import {useDictStore} from '@/stores/modules/dict'
defineOptions({
name: 'role'
})
const rolePopup = ref() const rolePopup = ref()
const roleResourcePopup = ref() const roleResourcePopup = ref()
const dictStore = useDictStore() const dictStore = useDictStore()
@@ -91,6 +94,22 @@ const columns = reactive<ColumnProps<Role.RoleBO>[]>([
search: { el: 'input' }, search: { el: 'input' },
minWidth: 200, minWidth: 200,
}, },
{
prop: 'type',
label: '类型',
minWidth: 200,
render: (scope) => {
const typeMap: { [key: number]: { label: string; type: string } } = {
0: { label: '超级管理员', type: 'primary' },
1: { label: '管理员角色', type: 'success' },
2: { label: '普通角色', type: 'info' },
};
const typeInfo = typeMap[scope.row.type] || { label: '未知', type: 'danger' };
return (
<el-tag type={typeInfo.type}>{typeInfo.label}</el-tag>
);
},
},
{ {
prop: 'remark', prop: 'remark',
label: '描述', label: '描述',

View File

@@ -7,13 +7,13 @@
:rules='rules' :rules='rules'
> >
<el-form-item label="原密码" prop='oldPassword' :label-width="100"> <el-form-item label="原密码" prop='oldPassword' :label-width="100">
<el-input type="oldPassword" v-model="formContent.oldPassword" show-password placeholder="请输入原密码" autocomplete="off" /> <el-input type="oldPassword" v-model="formContent.oldPassword" show-password placeholder="请输入原密码" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="新密码" prop='newPassword' :label-width="100"> <el-form-item label="新密码" prop='newPassword' :label-width="100">
<el-input type="newPassword" v-model="formContent.newPassword" show-password placeholder="请输入新密码" autocomplete="off" /> <el-input type="newPassword" v-model="formContent.newPassword" show-password placeholder="请输入新密码" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="确认密码" prop='surePassword' :label-width="100"> <el-form-item label="确认密码" prop='surePassword' :label-width="100">
<el-input type="surePassword" v-model="formContent.surePassword" show-password placeholder="请再次输入确认密码" autocomplete="off" /> <el-input type="surePassword" v-model="formContent.surePassword" show-password placeholder="请再次输入确认密码" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>

View File

@@ -7,13 +7,13 @@
:rules='rules' :rules='rules'
> >
<el-form-item label="用户名" prop='name' :label-width="100"> <el-form-item label="用户名" prop='name' :label-width="100">
<el-input v-model="formContent.name" placeholder="请输入用户名" autocomplete="off" /> <el-input v-model="formContent.name" placeholder="请输入用户名" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="登录名" prop='loginName' :label-width="100" > <el-form-item label="登录名" prop='loginName' :label-width="100" >
<el-input v-model="formContent.loginName" placeholder="请输入登录名" autocomplete="off" :disabled="LoginNameIsShow"/> <el-input v-model="formContent.loginName" placeholder="请输入登录名" autocomplete="off" :disabled="LoginNameIsShow" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop='password' :label-width="100" v-if="IsPasswordShow"> <el-form-item label="密码" prop='password' :label-width="100" v-if="IsPasswordShow">
<el-input type="password" v-model="formContent.password" show-password placeholder="请输入密码" autocomplete="off" /> <el-input type="password" v-model="formContent.password" show-password placeholder="请输入密码" autocomplete="off" maxlength="32" show-word-limit/>
</el-form-item> </el-form-item>
<el-form-item label='角色' :label-width='100' prop='roles'> <el-form-item label='角色' :label-width='100' prop='roles'>
<el-select v-model="formContent.roleIds" multiple placeholder="请选择角色"> <el-select v-model="formContent.roleIds" multiple placeholder="请选择角色">

View File

@@ -9,16 +9,16 @@
<!-- 表格 header 按钮 --> <!-- 表格 header 按钮 -->
<template #tableHeader='scope'> <template #tableHeader='scope'>
<el-button v-auth.user="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button> <el-button v-auth.user="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button v-auth.user="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected' <el-button v-auth.user="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'> @click='batchDelete(scope.selectedListIds)'>
批量删除 删除
</el-button> </el-button>
</template> </template>
<!-- 表格操作 --> <!-- 表格操作 -->
<template #operation='scope'> <template #operation='scope'>
<el-button v-auth.user="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button> <el-button v-auth.user="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)" :disabled="scope.row.loginName == 'root'">编辑</el-button>
<el-button v-auth.user="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button> <el-button v-auth.user="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)' :disabled="scope.row.loginName == 'root'">删除</el-button>
<el-button v-auth.user="'editPassWord'" type='primary' link :icon='Delete' @click='EditPassWord(scope.row)'>修改密码</el-button> <el-button v-auth.user="'editPassWord'" type='primary' link :icon='Delete' @click='EditPassWord(scope.row)' :disabled="scope.row.loginName == 'root'">修改密码</el-button>
</template> </template>
</ProTable> </ProTable>
@@ -43,6 +43,9 @@
import {getUserList, deleteUser,getRoleList} from '@/api/user/user' import {getUserList, deleteUser,getRoleList} from '@/api/user/user'
import { onMounted, reactive, ref } from 'vue' import { onMounted, reactive, ref } from 'vue'
import { type Role } from '@/api/user/interface/role' import { type Role } from '@/api/user/interface/role'
defineOptions({
name: 'user'
})
const roleList = ref<Role.RoleBO[]>([]) const roleList = ref<Role.RoleBO[]>([])
const dictStore = useDictStore() const dictStore = useDictStore()
const userPopup = ref() const userPopup = ref()
@@ -61,8 +64,8 @@
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList" // 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
const getTableList = (params: any) => { const getTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params)) let newParams = JSON.parse(JSON.stringify(params))
newParams.searchEndTime = endDate.value // newParams.searchEndTime = endDate.value
newParams.searchBeginTime = startDate.value // newParams.searchBeginTime = startDate.value
return getUserList(newParams) return getUserList(newParams)
} }
@@ -88,6 +91,7 @@
render: (scope) => { render: (scope) => {
const roleNames = scope.row.roleNames; const roleNames = scope.row.roleNames;
const roleArray = Array.isArray(roleNames) ? roleNames : [roleNames]; const roleArray = Array.isArray(roleNames) ? roleNames : [roleNames];
if (roleArray.length > 1) { if (roleArray.length > 1) {
return roleArray.join(', '); return roleArray.join(', ');
} }
@@ -108,19 +112,19 @@
prop: 'loginTime', prop: 'loginTime',
label: '最后一次登录时间', label: '最后一次登录时间',
minWidth: 180, minWidth: 180,
search: { // search: {
render: () => { // render: () => {
return ( // return (
<div class='flx-flex-start'> // <div class='flx-flex-start'>
<TimeControl // <TimeControl
include={['日', '周', '月', '自定义']} // include={['日', '周', '月', '自定义']}
default={'月'} // default={'月'}
onUpdate-dates={handleDateChange} // onUpdate-dates={handleDateChange}
/> // />
</div> // </div>
) // )
}, // },
}, // },
}, },
{ {
prop: 'state', prop: 'state',

View File

@@ -1,80 +0,0 @@
<!--双列-->
<template>
<el-dialog v-model='dialogVisible' :title='title' v-bind='dialogMiddle' >
<el-scrollbar>
<el-form :inline="false" label-width="auto" ref="formRef" class='form-two'>
<el-form-item label="姓名" prop="username" >
<el-input
></el-input>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input
></el-input>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input
></el-input>
</el-form-item>
<el-form-item label="身份证号" prop="id">
<el-input
></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input
></el-input>
</el-form-item>
<el-form-item label="居住地址" prop="address">
<el-input
></el-input>
</el-form-item>
<el-form-item label="手机" prop="phone">
<el-input
></el-input>
</el-form-item>
<el-form-item label="来源" prop="source">
<el-input
></el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<div class='dialog-footer'>
<el-button @click='close()'>取消</el-button>
<el-button type='primary' @click='confirmForm()'>确定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang='ts'>
import { dialogMiddle } from '@/utils/elementBind'
const dialogVisible = ref(false)
const title = ref('单列弹出框')
const open = (textTitle: string) => {
dialogVisible.value = true
title.value = textTitle
}
const close = () => {
dialogVisible.value = false
}
const confirmForm = () => {
ElMessage.info('业务数据提交')
}
defineExpose({ open })
</script>
<style>
</style>

View File

@@ -1,210 +0,0 @@
<template>
<div class='table-box' ref='popupBaseView'>
<ProTable
ref='proTable'
:columns='columns'
:data='userData'
>
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增')">新增用户</el-button>
<el-button type='primary' :icon='Upload' plain @click='batchAdd'>批量添加用户</el-button>
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出用户数据</el-button>
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'>
批量删除用户
</el-button>
</template>
<!-- 表格操作 -->
<template #operation='scope'>
<el-button type='primary' link :icon='View'
@click="openDrawer('查看', scope.row)">查看
</el-button>
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
<el-button type='primary' link :icon='Refresh' @click='resetPass(scope.row)'>重置密码</el-button>
<el-button type='primary' link :icon='CirclePlus' @click='deleteAccount()'>下钻</el-button>
</template>
</ProTable>
</div>
<single-column ref='singleColumn' />
<double-column ref='doubleColumn' />
<open :width='viewWidth' :height='viewHeight' ref='openView' />
</template>
<script setup lang='tsx' name='useProTable'>
import { ref, reactive } from 'vue'
import { User } from '@/api/user/interface'
import { useHandleData } from '@/hooks/useHandleData'
import { useDownload } from '@/hooks/useDownload'
import { useAuthButtons } from '@/hooks/useAuthButtons'
import ProTable from '@/components/ProTable/index.vue'
import ImportExcel from '@/components/ImportExcel/index.vue'
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
import { CirclePlus, Delete, EditPen, Download, Upload, View, Refresh } from '@element-plus/icons-vue'
import userDataList from '@/api/user/userData'
import { useDictStore } from '@/stores/modules/dict'
import SingleColumn from '@/views/demo/proTable/singleColumn.vue'
import Open from '@/views/demo/proTable/Open.vue'
import DoubleColumn from '@/views/demo/proTable/doubleColumn.vue'
import { useViewSize } from '@/hooks/useViewSize'
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
const dictStore = useDictStore()
import {
getUserList,
deleteUser,
changeUserStatus,
exportUserInfo,
BatchAddUser,
} from '@/api/user/user'
import { ElMessageBox } from 'element-plus'
const userData = userDataList
const singleColumn = ref()
const doubleColumn = ref()
const openView = ref()
// ProTable 实例
const proTable = ref<ProTableInstance>()
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
const initParam = reactive({ type: 1 })
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
const dataCallback = (data: any) => {
return {
list: data.list,
total: data.total,
}
}
// 如果你想在请求之前对当前请求参数做一些操作可以自定义如下函数params 为当前所有的请求参数(包括分页),最后返回请求列表接口
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
const getTableList = (params: any) => {
let newParams = JSON.parse(JSON.stringify(params))
newParams.createTime && (newParams.startTime = newParams.createTime[0])
newParams.createTime && (newParams.endTime = newParams.createTime[1])
delete newParams.createTime
return getUserList(newParams)
}
// 页面按钮权限(按钮权限既可以使用 hooks也可以直接使用 v-auth 指令指令适合直接绑定在按钮上hooks 适合根据按钮权限显示不同的内容)
const { BUTTONS } = useAuthButtons()
// 表格配置项
const columns = reactive<ColumnProps<User.ResUserList>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
prop: 'username',
label: '姓名',
width: 120,
search: { el: 'input' },
},
{
prop: 'gender',
label: '性别',
// 字典数据(本地数据)
enum: dictStore.getDictData('sex'),
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'code' },
},
{
prop: 'age',
label: '年龄',
search: {
// 自定义 search 显示内容
render: ({ searchParam }) => {
return (
<div class='flx-center'>
<el-input vModel_trim={searchParam.minAge} placeholder='最小年龄' />
<span class='mr10 ml10'>-</span>
<el-input vModel_trim={searchParam.maxAge} placeholder='最大年龄' />
</div>
)
},
},
},
{ prop: 'idCard', label: '身份证号' },
{ prop: 'email', label: '邮箱' },
{ prop: 'address', label: '居住地址', width: 120 },
{
prop: 'status',
label: '状态',
enum: dictStore.getDictData('status'),
search: { el: 'tree-select', props: { filterable: true } },
fieldNames: { label: 'userLabel', value: 'userStatus' },
render: scope => {
return (
<>
{BUTTONS.value.status ? (
<el-switch
model-value={scope.row.status}
active-text={scope.row.status ? '启用' : '禁用'}
active-value={1}
inactive-value={0}
onClick={() => changeStatus(scope.row)}
/>
) : (
<el-tag type={scope.row.status ? 'success' : 'danger'}>{scope.row.status ? '启用' : '禁用'}</el-tag>
)}
</>
)
},
},
{
prop: 'createTime',
label: '创建时间',
width: 180,
search: {
el: 'date-picker',
span: 1,
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
defaultValue: ['2024-11-12', '2024-12-12'],
},
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
])
// 下钻
const deleteAccount = async () => {
openView.value.open('测试弹出框')
}
// 批量删除用户信息
const batchDelete = async (id: string[]) => {
await useHandleData(deleteUser, { id }, '删除所选用户信息')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
// 重置用户密码
const resetPass = async (params: User.ResUserList) => {
// await useHandleData(resetUserPassWord, { id: params.id }, `重置【${params.username}】用户密码`)
// proTable.value?.getTableList()
doubleColumn.value.open('双列弹出框')
}
// 切换用户状态
const changeStatus = async (row: User.ResUserList) => {
await useHandleData(changeUserStatus, {
id: row.id,
status: row.status == 1 ? 0 : 1,
}, `切换【${row.username}】用户状态`)
proTable.value?.getTableList()
}
// 导出用户列表
const downloadFile = async () => {
ElMessageBox.confirm('确认导出用户数据?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportUserInfo, '用户列表', proTable.value?.searchParam),
)
}
// 批量添加用户
const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
const batchAdd = () => {
const params = {
title: '用户',
tempApi: exportUserInfo,
importApi: BatchAddUser,
getTableList: proTable.value?.getTableList,
}
dialogRef.value?.acceptParams(params)
}
// 打开 drawer(新增、查看、编辑)
const openDrawer = (title: string, row: Partial<User.ResUserList> = {}) => {
singleColumn.value.open('单列弹出框')
}
</script>

View File

@@ -1,177 +0,0 @@
<!--单列-->
<template>
<el-dialog class='table-box'
v-model='dialogVisible'
top='114px'
:style="{height:height+'px',maxHeight:height+'px',overflow:'hidden'}"
:title='title'
:width='width'
:modal='false'>
<div class='table-box' :style="{height:(height-64)+'px',maxHeight:(height-64)+'px',overflow:'hidden'}">
<ProTable
ref='proTable'
:columns='columns'
:data='userData'
>
<!-- 表格 header 按钮 -->
<template #tableHeader='scope'>
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增')">新增用户</el-button>
</template>
<!-- 表格操作 -->
<template #operation='scope'>
<el-button type='primary' link :icon='View'
@click="openDrawer('查看', scope.row)">查看
</el-button>
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
<el-button type='primary' link :icon='Refresh' @click='resetPass(scope.row)'>重置密码</el-button>
<el-button type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
</template>
</ProTable>
</div>
</el-dialog>
</template>
<script setup lang='tsx'>
import { CirclePlus, Delete, EditPen, Refresh, View } from '@element-plus/icons-vue'
import ProTable from '@/components/ProTable/index.vue'
import { useHandleData } from '@/hooks/useHandleData'
import { useAuthButtons } from '@/hooks/useAuthButtons'
import { reactive } from 'vue'
import { ColumnProps } from '@/components/ProTable/interface'
import { User } from '@/api/user/interface'
import { useDictStore } from '@/stores/modules/dict'
const dictStore = useDictStore()
import {
changeUserStatus,
} from '@/api/user/user'
import userDataList from '@/api/user/userData'
const userData = userDataList
const proTable = ref()
const dialogVisible = ref(false)
const title = ref('单列弹出框')
const { BUTTONS } = useAuthButtons()
// 表格配置项
const columns = reactive<ColumnProps<User.ResUserList>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{
prop: 'username',
label: '姓名',
width: 120,
search: { el: 'input' },
},
{
prop: 'gender',
label: '性别',
// 字典数据(本地数据)
enum: dictStore.getDictData('sex'),
search: { el: 'select', props: { filterable: true } },
fieldNames: { label: 'label', value: 'code' },
},
{
prop: 'age',
label: '年龄',
search: {
// 自定义 search 显示内容
render: ({ searchParam }) => {
return (
<div class='flx-center'>
<el-input vModel_trim={searchParam.minAge} placeholder='最小年龄' />
<span class='mr10 ml10'>-</span>
<el-input vModel_trim={searchParam.maxAge} placeholder='最大年龄' />
</div>
)
},
},
},
{ prop: 'idCard', label: '身份证号', search: { el: 'input' } },
{ prop: 'email', label: '邮箱' },
{ prop: 'address', label: '居住地址', width: 120 },
{
prop: 'status',
label: '状态',
enum: dictStore.getDictData('status'),
search: { el: 'tree-select', props: { filterable: true } },
fieldNames: { label: 'userLabel', value: 'userStatus' },
render: scope => {
return (
<>
{BUTTONS.value.status ? (
<el-switch
model-value={scope.row.status}
active-text={scope.row.status ? '启用' : '禁用'}
active-value={1}
inactive-value={0}
onClick={() => changeStatus(scope.row)}
/>
) : (
<el-tag type={scope.row.status ? 'success' : 'danger'}>{scope.row.status ? '启用' : '禁用'}</el-tag>
)}
</>
)
},
},
{
prop: 'createTime',
label: '创建时间',
width: 180,
search: {
el: 'date-picker',
span: 1,
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
defaultValue: ['2024-11-12', '2024-12-12'],
},
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
])
const open = (textTitle: string) => {
dialogVisible.value = true
title.value = textTitle
}
defineExpose({ open })
const props = defineProps({
width: {
type: Number,
default: 800,
},
height: {
type: Number,
default: 744,
},
})
// 切换用户状态
const changeStatus = async (row: User.ResUserList) => {
await useHandleData(changeUserStatus, {
id: row.id,
status: row.status == 1 ? 0 : 1,
}, `切换【${row.username}】用户状态`)
proTable.value?.getTableList()
}
// 删除用户信息
const deleteAccount = async (params: User.ResUserList) => {
}
// 重置用户密码
const resetPass = async (params: User.ResUserList) => {
}
// 打开 drawer(新增、查看、编辑)
const openDrawer = (title: string, row: Partial<User.ResUserList> = {}) => {
}
</script>
<style>
</style>

View File

@@ -1,169 +0,0 @@
<!--单列-->
<template>
<el-dialog v-model='dialogVisible' :title='title' v-bind='dialogSmall'>
<el-scrollbar>
<el-form
:model='form'
:inline='false'
label-width='auto'
ref='formRuleRef'
:rules='rules'
>
<el-form-item label='姓名' prop='username'>
<el-input
v-model='form.username'
placeholder='请输入姓名'
></el-input>
</el-form-item>
<el-form-item label='性别' prop='gender'>
<el-radio-group v-model='form.gender'>
<el-radio-button :label='0'></el-radio-button>
<el-radio-button :label='1'></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label='年龄' prop='age'>
<el-input
v-model='form.age'
placeholder='年龄'
></el-input>
</el-form-item>
<el-form-item label='身份证号' prop='idCard'>
<el-input
v-model='form.idCard'
placeholder='身份证号'
></el-input>
</el-form-item>
<el-form-item label='邮箱' prop='email'>
<el-input
v-model='form.email'
placeholder='邮箱'
></el-input>
</el-form-item>
<el-form-item label='居住地址' prop='address'>
<el-input
v-model='form.address'
placeholder='居住地址'
></el-input>
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<div class='dialog-footer'>
<el-button @click='close()'>取消</el-button>
<el-button type='primary' @click='confirmForm()'>确定</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang='ts'>
import { dialogSmall } from '@/utils/elementBind'
import { FormInstance, FormItemRule } from 'element-plus'
interface userForm {
id?: string; //用户ID作为唯一标识
username: string; //用户名
gender: number; // 性别
age: number; // 年龄
idCard: string; // 身份证
email: string; // 邮箱
address?: string; // 地址
}
const form: Ref<userForm> = ref({
username: '',
gender: 0,
age: 1,
idCard: '',
email: '',
})
const formRuleRef = ref<FormInstance>()
//定义校验规则
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
username: [{ required: true, message: '用户名必填!', trigger: 'blur' }],
age: [
{ required: true, message: '年龄必填!', trigger: 'blur' },
// 指定正则,此处是数字正则
{ pattern: /^[1-9][0-9]?$|^100$/, message: '年龄必须在1到100之间', trigger: 'blur' },
],
idCard: [
{ required: true, message: '身份证必填!', trigger: 'blur' },
// 指定正则,此处是身份证正则
{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确的身份证号码', trigger: 'blur' },
],
email: [
{ required: true, message: '邮箱必填!', trigger: 'blur' },
// 指定校验类型
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] },
],
})
/**
* 重置表单
*/
const resetForm = () => {
form.value = {
username: '',
gender: 0,
age: 1,
idCard: '',
email: '',
address: '',
}
}
const dialogVisible = ref(false)
const title = ref('单列弹出框')
const open = (textTitle: string) => {
dialogVisible.value = true
title.value = textTitle
}
// 关闭弹出框
const close = () => {
//重置表单内容
//取消表单校验状态
formRuleRef.value && formRuleRef.value.resetFields()
dialogVisible.value = false
resetForm()
}
/**
* 校验表单数据
* 数据没问题,提交数据,并根据业务情况请求新增接口还是修改接口
*/
const confirmForm = () => {
ElMessage.info('业务数据提交')
try {
formRuleRef.value?.validate((valid: boolean) => {
if (valid) {
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(form.value))
if ('是否新增') {
// 执行新增接口
} else {
// 执行修改接口
}
} else {
ElMessage.error('表单验证失败!')
}
})
} catch (error) {
console.error('验证过程中发生错误', error)
}
}
defineExpose({ open })
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,127 +1,343 @@
<template> <template>
<div class="table-container table-main">
<div class="table-container"> <el-table :data="tableData"
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" > :header-cell-style="{ textAlign: 'center' } "
:cell-style="{ textAlign: 'center' }"
<el-table-column prop="id" label="序号" width="70" /> style="width: 100%"
<el-table-column prop="updateTime" label="上送时刻" /> max-height="400px"
<el-table-column prop="deviceName" label="设备名称" /> :span-method="objectSpanMethod">
<el-table-column prop="MonitorIdx" label="监测点序号" /> <el-table-column prop="monitorNum" label="监测点序号" width="80"/>
<el-table-column prop="desc" label="描述" width="90"/>
<el-table-column label="电压通道" > <el-table-column label="电压通道" >
<el-table-column prop="Ua" label="L1"> <el-table-column prop="Ua" label="A相">
<el-table-column prop="aVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.aVuData }}
</span>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="Ub" label="L2"> <el-table-column prop="aVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.aVuXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
误差值{{ scope.row.aV + 'V'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.aVuXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.aVuXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
误差值{{ scope.row.aV + 'V'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.aVuXi }}</el-tag>
</el-tooltip>
<!-- <el-tag type="danger" v-if="scope.row.aVuXi === '不合格'">
{{ scope.row.aVuXi }}
</el-tag> -->
<el-icon v-else-if="scope.row.aVuXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<!-- <span v-else>
{{ scope.row.aVuXi }}
</span> -->
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ub" label="B相">
<el-table-column prop="bVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.bVuData }}
</span>
</template>
</el-table-column>
<el-table-column prop="bVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.bVuXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
误差值{{ scope.row.bV + 'V'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.bVuXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.bVuXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
误差值{{ scope.row.bV + 'V'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.bVuXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.bVuXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Uc" label="C相">
<el-table-column prop="cVuData" label="被检值(V)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.cVuData }}
</span>
</template>
</el-table-column>
<el-table-column prop="cVuXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.cVuXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
误差值{{ scope.row.cV + 'V'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.cVuXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.cVuXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'}}<br/>
误差值{{ scope.row.cV + 'V'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.cVuXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.cVuXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="Uc" label="L3">
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="电流通道" > <el-table-column label="电流通道" >
<el-table-column prop="Ia" label="L1"> <el-table-column prop="Ia" label="A相">
<el-table-column prop="aIeData" label="被检值(A)" width="100px">
</el-table-column>
<el-table-column prop="Ib" label="L2">
</el-table-column>
<el-table-column prop="Ic" label="L3">
</el-table-column>
</el-table-column>
<el-table-column label="校准结果">
<template #default="scope"> <template #default="scope">
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag> <el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.aIeData }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="aIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.aIeXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{-0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.aI + '%'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.aIeXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.aIeXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ -0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.aI + '%'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.aIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.aIeXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ib" label="B相">
<el-table-column prop="bIeData" label="被检值(A)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.bIeData }}
</span>
</template>
</el-table-column>
<el-table-column prop="bIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.bIeXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ -0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.bI + '%'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.bIeXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.bIeXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ -0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.bI + '%'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.bIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.bIeXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
</template>
</el-table-column>
</el-table-column>
<el-table-column prop="Ic" label="C相">
<el-table-column prop="cIeData" label="被检值(A)" width="100px">
<template #default="scope">
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
<span v-else>
{{ scope.row.cIeData }}
</span>
</template>
</el-table-column>
<el-table-column prop="cIeXi" label="检测结果" width="90px">
<template #default="scope">
<el-tooltip
v-if="scope.row.cIeXi === '不合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ -0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.cI + '%'}}
</template>
<el-tag type="danger" class="tooltip-content">
{{ scope.row.cIeXi }}
</el-tag>
</el-tooltip>
<el-tooltip
v-else-if="scope.row.cIeXi === '合格'"
class="item"
effect="dark"
placement="bottom-start"
>
<template #content>
误差范围 {{ -0.5 + "%~" +0.5 + "%" }}<br/>
误差值{{ scope.row.cI + '%'}}
</template>
<el-tag type="success" class="tooltip-content">{{ scope.row.cIeXi }}</el-tag>
</el-tooltip>
<el-icon v-else-if="scope.row.cIeXi === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading />
</el-icon>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>
<script lang="ts" setup name="ErrorSystemDialog"> <script lang="ts" setup name="ErrorSystemDialog">
import{ElMessage, FormInstance,FormItemRule}from'element-plus' import { defineProps, type PropType } from 'vue';
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue'; import { ElIcon, ElLoading, ElTag } from 'element-plus';
import { dialogBig,dialogMiddle} from '@/utils/elementBind' import type { ChannelsTest } from '@/api/home/interface/channelsTest';
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件 import { number } from 'echarts';
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict' interface Props {
const dictStore = useDictStore() tableData: ChannelsTest.CoefficientVO[];
const props = defineProps<{ big_V_loading: boolean;
tableData: { curV: number;
id: string; }
updateTime: string;
deviceName:string; const props = withDefaults(defineProps<Props>(), {
MonitorIdx:number; tableData: () => [],
Ua:number; big_V_loading: false,
Ub:number; curV: 0,
Uc:number; });
Ia:number;
Ib:number; function objectSpanMethod({ row, column, rowIndex, columnIndex }: { row: any, column: any, rowIndex: number, columnIndex: number }) {
Ic:number; if (columnIndex === 0) {
Result: string; if (rowIndex % 4 === 0) {
return {
rowspan: 4,
colspan: 1,
}; };
}>(); } else {
return {
rowspan: 0,
// const tableData = ref([ colspan: 0,
// { };
// id: '1', }
// updateTime: '2024-10-10 10:30:00', }
// deviceName:'被检设备1', if (columnIndex === 1) {
// MonitorIdx: 1, if (rowIndex % 2 === 0) {
// Ua:1.0003, return {
// Ub:1.0003, rowspan: 2,
// Uc:0.0096, colspan: 1,
// Ia:1.0003, };
// Ib:1.0003, } else {
// Ic:1.0008, return {
// Result: '合格', rowspan: 0,
// }, colspan: 0,
// { };
// id: '2', }
// updateTime: '2024-10-10 10:30:00', }
// deviceName:'被检设备1', }
// MonitorIdx: 2,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// {
// id: '3',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 3,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// {
// id: '4',
// updateTime: '2024-10-10 10:30:00',
// deviceName:'被检设备1',
// MonitorIdx: 4,
// Ua:1.0003,
// Ub:1.0003,
// Uc:0.0096,
// Ia:1.0003,
// Ib:1.0003,
// Ic:1.0008,
// Result: '合格',
// },
// ])
</script> </script>
@@ -157,4 +373,31 @@
overflow-y: auto; /* 允许垂直滚动 */ overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */ overflow-x: hidden; /* 隐藏水平滚动条 */
} }
/* 确保 el-icon-loading 的动画效果没有被覆盖 */
.loading-box {
animation: rotate 2s linear infinite;
}
.icon-margin {
margin-left: 0px;
}
.icon-align {
vertical-align: 0px;
}
.tooltip-content {
cursor: pointer;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style> </style>

View File

@@ -2,60 +2,62 @@
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px"> <el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px">
<div class="change-errsys-dialog"> <div class="change-errsys-dialog">
<div class="change-errsys-title"> <div class="change-errsys-title">
<el-form :model='formContent'> <el-form :model='formContent' label-width="auto" class="form-three">
<el-row :gutter="24" >
<el-col :span="8"> <el-form-item label="设备名称">
<el-form-item label="设备名称:" >
<el-input v-model='deviceName' :disabled="true" /> <el-input v-model='deviceName' :disabled="true" />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="检测脚本">
<el-col :span="8">
<el-form-item label="检测脚本:" >
<el-input v-model='testScriptName' :disabled="true" /> <el-input v-model='testScriptName' :disabled="true" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="8"> <el-form-item label="数据原则">
<el-form-item label="数据处理原则:" >
<el-input v-model='dataRule' :disabled="true" /> <el-input v-model='dataRule' :disabled="true" />
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" >
<el-col :span="8">
<el-form-item label="误差体系"> <el-form-item label="误差体系">
<el-select v-model="error_Sys_Id" autocomplete="off"> <el-select v-model="error_Sys_Id" autocomplete="off">
<el-option <el-option v-for="plan in testErrSystDataList" :key="plan.id" :label="plan.label" :value="plan.id"
v-for="plan in testErrSystDataList" :disabled="plan.label === errorSysName">
:key="plan.id"
:label="plan.label"
:value="plan.id"
:disabled = "plan.label === errorSysName"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="8">
<el-form-item > <el-form-item label=" ">
<el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button> <el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button>
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled" @click="openReportDlg">报告生成</el-button> <el-button type="primary" :icon="Postcard" :disabled="reportDisabled"
@click="openReportDlg">报告生成</el-button>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
<div class="change-errsys-content"> <div class="change-errsys-content">
<div class="tabs-title"> <div class="tabs-title">
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button> <!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
<el-button type="primary" v-if="activeIndex >= activeTotalNum">合格92项/共103项</el-button> <el-button type="primary" v-if="activeIndex >= activeTotalNum" disabled>合格92项/共103项</el-button> -->
<span style=" font-size: 18px;font-weight: 600;">
数据已合格 <span style="color: #91cc75">{{ qualified }}</span> / <span style="color: green">{{ 103 }}</span>
</span>
</div> </div>
<div class="dialog-content"> <div class="dialog-content">
<el-table :data="tableData" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border> <el-table :data="tableData" :cell-class-name="tableCell" row-key="id" height="450px"
:header-cell-style="{ background: 'var(--el-color-primary)', color: '#eee', textAlign: 'center' }" style="width: 100%"
border>
<el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" /> <el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" />
<el-table-column label="被检通道1" :min-width="minwidth" align="center">
<el-table-column label="被检通道1" align="center"> <template #header>
<span>被检通道1</span>
<el-tooltip content = "240001被检通道1" placement="top" style="align-items: bottom;">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<!-- <el-tooltip content = "info" placement="top">
<i class="el-icon-info"></i>
</el-tooltip> -->
<el-tooltip :content="scope.row.resultType1==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType1==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
:disabled = "scope.row.resultType1=='info'" :disabled = "scope.row.resultType1=='info'"
@@ -67,10 +69,15 @@
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道2" align="center"> <el-table-column label="被检通道2" :min-width="minwidth" align="center">
<template #header>
<span>被检通道2</span>
<el-tooltip content = "240001被检通道2" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType2==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType2==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -85,7 +92,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道3" align="center"> <el-table-column label="被检通道3" :min-width="minwidth" align="center">
<template #header>
<span>被检通道3</span>
<el-tooltip content = "240001被检通道3" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType3==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType3==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -100,7 +113,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道4" align="center"> <el-table-column label="被检通道4" :min-width="minwidth" align="center">
<template #header>
<span>被检通道4</span>
<el-tooltip content = "240001被检通道4" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType4==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType4==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -115,7 +134,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column p label="被检通道5" align="center"> <el-table-column p label="被检通道5" :min-width="minwidth" align="center">
<template #header>
<span>被检通道5</span>
<el-tooltip content = "240002被检通道1" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType5==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType5==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -130,7 +155,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道6" align="center"> <el-table-column label="被检通道6" :min-width="minwidth" align="center">
<template #header>
<span>被检通道6</span>
<el-tooltip content = "240002被检通道2" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType6==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType6==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -146,7 +177,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道7" align="center"> <el-table-column label="被检通道7" :min-width="minwidth" align="center">
<template #header>
<span>被检通道7</span>
<el-tooltip content = "240002被检通道3" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType7==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType7==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -161,7 +198,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="被检通道8" align="center"> <el-table-column label="被检通道8" :min-width="minwidth" align="center">
<template #header>
<span>被检通道8</span>
<el-tooltip content = "240002被检通道4" placement="top">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template #default="scope"> <template #default="scope">
<el-tooltip :content="scope.row.resultType8==='info' ? '暂无数据' : '点击查看详情'" placement="top"> <el-tooltip :content="scope.row.resultType8==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button <el-button
@@ -176,6 +219,7 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column v-for="(item, index) in monitorList" :key="index" :prop="item.prop" :label="item.label"> <!-- <el-table-column v-for="(item, index) in monitorList" :key="index" :prop="item.prop" :label="item.label">
</el-table-column> --> </el-table-column> -->
@@ -193,10 +237,8 @@
</div> </div>
</div> </div>
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup> <ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
<dataCheckSingleChannelSingleTestPopup <dataCheckSingleChannelSingleTestPopup :visible="dataCheckSingleChannelSingleTestDialogVisable"
:visible="dataCheckSingleChannelSingleTestDialogVisable" @update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"></dataCheckSingleChannelSingleTestPopup>
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"
></dataCheckSingleChannelSingleTestPopup>
</el-dialog> </el-dialog>
</template> </template>
@@ -223,23 +265,22 @@ import ReportPopup from './reportPopup.vue'
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue' import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
const qualified = ref(0)
const reportDisabled = ref(true) const reportDisabled = ref(true)
const reportDialogVisible = ref(false) const reportDialogVisible = ref(false)
const deviceName = ref('被检设备1'); const deviceName = ref('240001');
const error_Sys_Id = ref('2'); const error_Sys_Id = ref('1');
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式'); const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
const errorSysName = ref('Q/GDW 10650.2 - 2021'); const errorSysName = ref('Q/GDW 10650.2 - 2021');
const dataRule = ref('所有值'); const dataRule = ref('所有值');
const scriptSwitch = ref(true); const scriptSwitch = ref(true);
const currentScriptDsc = ref('频率准确度检测频率42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°'); const currentScriptDsc = ref('电压准确度检测频率42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
const defaultProps = { const defaultProps = {
children: "children", children: "children",
label: "name", label: "name",
pid: "pid", pid: "pid",
}; };
const judge = (label:string) => const judge = (label: string) => {
{
console.log(label, errorSysName.value) console.log(label, errorSysName.value)
if (label === errorSysName.value) if (label === errorSysName.value)
return true return true
@@ -302,8 +343,11 @@ const props = defineProps<{
const handleCancel = () => { const handleCancel = () => {
emit('update:visible', false); // 关闭对话框 emit('update:visible', false); // 关闭对话框
//clearInterval(timer.value); //clearInterval(timer.value);
reportDisabled.value = true;
activeIndex.value = 0; activeIndex.value = 0;
qualified.value = 0;
tableData.value.length = 0; tableData.value.length = 0;
columnList.value.length = 0;
tableData.value = JSON.parse(JSON.stringify(operatorTableData.value)); tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
}; };
@@ -378,9 +422,9 @@ const scrollContainer = ref<HTMLElement | null>(null); // 声明 scrollContainer
const scrollToBottom = () => { const scrollToBottom = () => {
if (scrollContainer.value) { if (scrollContainer.value) {
console.log(scrollContainer.value) //console.log(scrollContainer.value)
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight; scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
console.log(scrollContainer.value) //console.log(scrollContainer.value)
} }
}; };
@@ -390,8 +434,7 @@ function getRandomInt(max: number): number {
const updateLog = () => { const updateLog = () => {
const currentTime = ref(new Date().toLocaleString()); const currentTime = ref(new Date().toLocaleString());
switch(activeIndex.value) switch (activeIndex.value) {
{
case 1: case 1:
testLogList.value.length = 0; // 清空数组 testLogList.value.length = 0; // 清空数组
testLogList.value.push({ testLogList.value.push({
@@ -442,9 +485,23 @@ const testLogList = ref([
log: '暂无数据,等待检测开始', log: '暂无数据,等待检测开始',
}, },
]) ])
const columnList = ref([]);
const tableKey = ref(0); const tableKey = ref(0);
function tableCell ({row,columnIndex}){
let items = columnList?.value.filter((item) => item === row.id)
if(columnIndex === 0 && items.length > 0)
{
// console.log(row.id,items.length,columnList?.value)
return 'warning-row'
}
if(columnIndex === 0)
{
return 'header-row'
}
}
const tableRowClassName = ({ const tableRowClassName = ({
row, row,
rowIndex, rowIndex,
@@ -475,20 +532,18 @@ const dataCheckSingleChannelSingleTestDialogVisable = ref(false);
function traverseTableData(data: any[], id: string): void { function traverseTableData(data: any[], id: string): void {
data.forEach(item => { data.forEach(item => {
// 处理当前节点的数据 // 处理当前节点的数据
if(item.id === id) if (item.id === id) {
{ for (let i = 1; i <= 8; i++) {
for(let i = 1;i<=8;i++)
{
let field1 = "resultType" + i let field1 = "resultType" + i
let field2 = "resultValue" + i let field2 = "resultValue" + i
if(getRandomInt(10)>8 && activeIndex.value>2) if (getRandomInt(10) > 8 && activeIndex.value > 2) {
{
item[field1] = "danger"; item[field1] = "danger";
item[field2] = "×"; item[field2] = "×";
columnList.value.push(activeIndex.value.toString());
// console.log(id,activeIndex.value,columnList.value)
} }
else else {
{
item[field1] = "success"; item[field1] = "success";
item[field2] = "√"; item[field2] = "√";
} }
@@ -506,7 +561,7 @@ function traverseTableData(data: any[],id: string): void {
const updateTableData = (id: string) => { const updateTableData = (id: string) => {
traverseTableData(tableData.value, id); traverseTableData(tableData.value, id);
console.log(id) // console.log(id)
}; };
let timer: any = ref(""); let timer: any = ref("");
@@ -527,7 +582,7 @@ const handleFinishTest = () => {
}; };
const handleClick = (row: any) => { const handleClick = (row: any) => {
console.log(111,row) // console.log(111, row)
dataCheckSingleChannelSingleTestDialogVisable.value = true; dataCheckSingleChannelSingleTestDialogVisable.value = true;
}; };
@@ -1830,13 +1885,11 @@ const startTimer = () => {
//if (timer.value !== null) return; // 如果定时器已经启动,则不再重复启动 //if (timer.value !== null) return; // 如果定时器已经启动,则不再重复启动
timer.value = setInterval(() => { timer.value = setInterval(() => {
console.log(activeIndex.value,111) // console.log(activeIndex.value, 111)
if(activeIndex.value <= activeTotalNum.value) if (activeIndex.value <= activeTotalNum.value) {
{
activeIndex.value++; activeIndex.value++;
switch(activeIndex.value) switch (activeIndex.value) {
{
case 1: case 1:
updateTableData("1-1-1") updateTableData("1-1-1")
updateTableData("1-1-2") updateTableData("1-1-2")
@@ -1889,14 +1942,13 @@ const startTimer = () => {
// } // }
} }
else else {
{ // console.log(activeIndex.value, 222)
console.log(activeIndex.value,222)
clearInterval(timer.value) clearInterval(timer.value)
reportDisabled.value = false; reportDisabled.value = false;
console.log(activeIndex.value,333) // console.log(activeIndex.value, 333)
} }
qualified.value = 92
}, 100); }, 100);
}; };
@@ -1915,7 +1967,21 @@ const resumeTimer = () => {
</script> </script>
<style scoped> <style scoped lang="scss">
:deep(.el-table .header-row) {
// background-color:var(--el-color-warning-light-9);
background-color:#f5f7fa;
// color:red;
// font-size:30px;
// --el-table-tr-bg-color: var(--el-color-warning-light-9);
}
:deep(.el-table .warning-row) {
// background-color:var(--el-color-warning-light-9);
//background-color:#bed96557;
color:red;
// font-size:30px;
// --el-table-tr-bg-color: var(--el-color-warning-light-9);
}
.change-errsys-dialog { .change-errsys-dialog {
display: flex; display: flex;
@@ -1938,5 +2004,14 @@ const resumeTimer = () => {
justify-content: flex-end; justify-content: flex-end;
margin-bottom: 10px; margin-bottom: 10px;
} }
</style>
<style lang="scss" scoped>
:deep(.el-button--small) {
height: 20px !important;
width: 20px !important;
}
:deep(.el-table--default td) {
padding: 5px 0 !important;
}
</style> </style>

View File

@@ -2,31 +2,21 @@
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" width="1065px" draggable> <el-dialog title="数据查询" :model-value='visible' @close="handleCancel" width="1065px" draggable>
<div class="data-check-dialog"> <div class="data-check-dialog">
<div class="data-check-title"> <div class="data-check-title">
<el-form :model='formContent'> <el-form :model='formContent' label-width="auto" class="form-three ">
<el-row :gutter="24" > <el-form-item label="检测脚本">
<el-col :span="8">
<el-form-item label="检测脚本:" >
<el-input v-model='testScriptName' :disabled="true" /> <el-input v-model='testScriptName' :disabled="true" />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="误差体系">
<el-col :span="8">
<el-form-item label="误差体系:" >
<el-input v-model='errorSysName' :disabled="true" /> <el-input v-model='errorSysName' :disabled="true" />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="数据原则">
<el-col :span="8">
<el-form-item label="数据处理原则:" >
<el-input v-model='dataRule' :disabled="true" /> <el-input v-model='dataRule' :disabled="true" />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="设备名称">
</el-row>
<el-row :gutter="24" >
<el-col :span="8">
<el-form-item label="设备名称:" >
<el-input v-model='deviceName' :disabled="true" /> <el-input v-model='deviceName' :disabled="true" />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="8"> <!-- <el-col :span="8">
<el-form-item label='复检次数:'> <el-form-item label='复检次数:'>
<el-select v-model="reCheckIdx"> <el-select v-model="reCheckIdx">
<el-option <el-option
@@ -37,47 +27,43 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<el-col :span="8"> <el-form-item label='通道号'>
<el-form-item label='通道号:'>
<el-select v-model="monitorIdx"> <el-select v-model="monitorIdx">
<el-option <el-option v-for="item in monitorIdxList" :key="item.value" :label="item.value"
v-for="item in monitorIdxList" :value="item.value" />
:key="item.value"
:label="item.value"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</div> </div>
<div class="data-check-content"> <div class="data-check-content">
<div class="content-left-tree"> <div class="content-left-tree">
<div class="content-left-tree-switch"> <div class="content-left-tree-switch">
<el-switch <!-- <el-switch
v-model="scriptSwitch" v-model="scriptSwitch"
class="ml-2" class="ml-2"
inline-prompt inline-prompt
style="--el-switch-on-color: #003078; --el-switch-off-color: #5a79a9" style="--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #5a79a9"
active-text="不合格测试项" active-text="不合格测试项"
inactive-text="全部测试项" inactive-text="全部测试项"
/> /> -->
<el-radio-group v-model="scriptSwitch">
<el-radio-button label="不合格测试项" value="0" />
<el-radio-button label="全部测试项" value="1" />
</el-radio-group>
</div> </div>
<div> <div class="content-tree">
<el-tree <el-tree :default-expanded-keys="['0', '0-1', '0-2', '0-3', '1']" node-key="id" :data="data"
:default-expanded-keys="['0','0-1','0-2','0-3','1']" :props="defaultProps" @node-click="handleNodeClick" />
node-key="id"
:data="data"
:props="defaultProps"
@node-click="handleNodeClick"
/>
</div> </div>
</div> </div>
<div class="content-right"> <div class="content-right">
<div class="content-right-title"> <div class="content-right-title">
<el-divider >当前检测项目</el-divider> <!-- <el-divider>当前检测项目</el-divider> -->
<div>
当前检测项目
</div>
<span>{{ currentScriptDsc }}</span> <span>{{ currentScriptDsc }}</span>
</div> </div>
<div class="content-right-Tabs"> <div class="content-right-Tabs">
@@ -114,16 +100,16 @@ import { type Monitor } from '@/api/device/interface/monitor'
import { data } from "@/api/plan/autoTest.json"; import { data } from "@/api/plan/autoTest.json";
import DataCheckResultTable from './dataCheckResultTable.vue' import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue' import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
const formContent = ref({})
const activeName = ref('rawDataTab') const activeName = ref('rawDataTab')
const deviceName = ref('被检设备1'); const deviceName = ref('240001');
const monitorIdx = ref('1'); const monitorIdx = ref('1');
const reCheckIdx = ref('3'); const reCheckIdx = ref('3');
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式'); const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
const errorSysName = ref('Q/GDW 10650.2-2021'); const errorSysName = ref('Q/GDW 10650.2-2021');
const dataRule = ref('所有值'); const dataRule = ref('所有值');
const scriptSwitch = ref(true); const scriptSwitch = ref("0");
const currentScriptDsc = ref('频率准确度检测频率42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°'); const currentScriptDsc = ref('电压准确度检测频率42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
const defaultProps = { const defaultProps = {
children: "children", children: "children",
label: "name", label: "name",
@@ -159,7 +145,7 @@ const monitorIdxList = [
}, },
] ]
const handleNodeClick = (data) => { const handleNodeClick = (data) => {
console.log(data); // console.log(data);
}; };
const MonIsShow = ref(false) const MonIsShow = ref(false)
const DevIsShow = ref(false) const DevIsShow = ref(false)
@@ -185,7 +171,6 @@ const props = defineProps<{
}; };
</script> </script>
<style scoped> <style scoped>
.data-check-dialog { .data-check-dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -200,23 +185,45 @@ const props = defineProps<{
.data-check-content { .data-check-content {
display: flex; display: flex;
flex-direction: row; /* flex-direction: row; */
} }
.content-left-tree { .content-left-tree {
width: 20%; width: 240px;
max-height: 475px; max-height: 445px;
overflow-y: auto; /* overflow-y: auto; */
padding: 10px 0;
border: 1px solid #ccc;
/* background-color: gray; */ /* background-color: gray; */
} }
.content-tree {
max-height: 405px;
margin-top: 10px;
overflow-y: auto;
}
.content-left-tree-switch { .content-left-tree-switch {
text-align: right; text-align: right;
margin-right: 10px; margin-right: 10px;
} }
.content-right { .content-right {
margin-left: 20px; margin-left: 10px;
flex: 1;
} }
.content-right-Tabs { .content-right-Tabs {
margin-top: 15px; margin-top: 15px;
} }
:deep(.el-divider--horizontal) {
margin: 15px 0;
}
.content-right-title{
div{
font-size: 16px;
font-weight: 600;
}
}
</style> </style>

Some files were not shown because too many files have changed in this diff Show More