소스 검색

增加上传图片功能修复已知问题

master
dong 1 년 전
부모
커밋
87298c5429
49개의 변경된 파일3479개의 추가작업 그리고 1121개의 파일을 삭제
  1. 1
    1
      .env.development
  2. 5
    1
      .vscode/settings.json
  3. 0
    254
      CHANGELOG.md
  4. 94
    16
      src/api/home/Multisite.ts
  5. 1
    0
      src/api/index.ts
  6. 22
    1
      src/api/interface/index.ts
  7. 1
    1
      src/api/modules/upload.ts
  8. 6
    6
      src/components/Upload/Img.vue
  9. 5
    3
      src/components/Upload/Imgs.vue
  10. 13
    10
      src/layouts/components/Header/components/Avatar.vue
  11. 1
    1
      src/layouts/components/Header/components/Message.vue
  12. 1
    0
      src/layouts/components/Header/components/PasswordDialog.vue
  13. 1
    0
      src/stores/interface/index.ts
  14. 5
    1
      src/stores/modules/user.ts
  15. 6
    0
      src/styles/element.scss
  16. 0
    183
      src/views/Administration/addition copy.vue
  17. 0
    1
      src/views/Administration/addition.scss
  18. 122
    94
      src/views/Administration/addition.vue
  19. 200
    2
      src/views/Administration/index.scss
  20. 348
    49
      src/views/Administration/index.vue
  21. 7
    0
      src/views/Alarm/index.scss
  22. 11
    5
      src/views/Alarm/index.vue
  23. 1
    1
      src/views/department/index.vue
  24. 73
    0
      src/views/equipment/index.scss
  25. 282
    0
      src/views/equipment/index.vue
  26. 152
    17
      src/views/home/index.vue
  27. 15
    0
      src/views/incomeforms/index.scss
  28. 469
    74
      src/views/incomeforms/index.vue
  29. 31
    0
      src/views/monitor/add.scss
  30. 204
    0
      src/views/monitor/add.vue
  31. 24
    0
      src/views/monitor/index.scss
  32. 98
    88
      src/views/monitor/index.vue
  33. 44
    0
      src/views/monitor/job.scss
  34. 201
    0
      src/views/monitor/job.vue
  35. 7
    0
      src/views/overview/index.scss
  36. 147
    151
      src/views/overview/index.vue
  37. 2
    2
      src/views/post/index.vue
  38. 79
    38
      src/views/powerStation/addition.vue
  39. 5
    0
      src/views/powerStation/index.scss
  40. 91
    22
      src/views/powerStation/index.vue
  41. 15
    0
      src/views/reportforms/index.scss
  42. 504
    83
      src/views/reportforms/index.vue
  43. 2
    0
      src/views/role/index.vue
  44. 7
    3
      src/views/station/index.vue
  45. 10
    0
      src/views/system/index.scss
  46. 24
    12
      src/views/system/index.vue
  47. 1
    1
      src/views/user/index.vue
  48. 46
    0
      src/views/userinformation/index.scss
  49. 95
    0
      src/views/userinformation/index.vue

+ 1
- 1
.env.development 파일 보기

@@ -17,7 +17,7 @@ VITE_API_URL = /api
17 17
 
18 18
 # 开发环境接口地址
19 19
 # 开发环境跨域代理,支持配置多个 http://192.168.8.198:8888
20
-# VITE_PROXY = [["/api","http://192.168.8.172:8888"]]
20
+# VITE_PROXY = [["/api","http://192.168.8.131:8888"]]
21 21
 # VITE_PROXY = [["/api","http://zlink.bjdexn.cn:8888"]]
22 22
 
23 23
 VITE_PROXY = [["/api","https://esos-iot.bjdexn.cn"]]

+ 5
- 1
.vscode/settings.json 파일 보기

@@ -63,8 +63,10 @@
63 63
     "Gitee",
64 64
     "hexs",
65 65
     "iconfont",
66
+    "imonth",
66 67
     "incomeforms",
67 68
     "informationtype",
69
+    "insertschedule",
68 70
     "juejin",
69 71
     "liquidfill",
70 72
     "longpress",
@@ -83,6 +85,7 @@
83 85
     "reportforms",
84 86
     "reportpowerday",
85 87
     "screenfull",
88
+    "selectaccount",
86 89
     "Singlevalue",
87 90
     "sortablejs",
88 91
     "sousuo",
@@ -122,5 +125,6 @@
122 125
     "src\\views\\monitor\\index.vue": ["末次数据时间:{{ pcslist.ts }}"],
123 126
     "src\\views\\department\\addition.vue": ["女"]
124 127
   },
125
-  "i18n-ally.extract.ignored": ["设备状态"]
128
+  "i18n-ally.extract.ignored": ["设备状态"],
129
+  "vue3snippets.enable-compile-vue-file-on-did-save-code": false
126 130
 }

+ 0
- 254
CHANGELOG.md 파일 보기

@@ -1,254 +0,0 @@
1
-# Changelog
2
-
3
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
-
5
-## [1.2.0](https://github.com/HalseySpicy/Geeker-Admin/compare/v1.1.0...v1.2.0) (2023-09-15)
6
-
7
-
8
-### Features
9
-
10
-* 🚀 update and optimize project content ([17bc017](https://github.com/HalseySpicy/Geeker-Admin/commit/17bc017c5abbd2c87813d6c6f9d587ddf9d57da7))
11
-* 🚀 upgrade plugins and add tab functionality ([f21a41d](https://github.com/HalseySpicy/Geeker-Admin/commit/f21a41d8df44efe5216dec39bf4abf0ea86a7781))
12
-
13
-## [1.1.0](https://github.com/HalseySpicy/Geeker-Admin/compare/v1.0.0...v1.1.0) (2023-07-09)
14
-
15
-### Features
16
-
17
-- 🚀 add proTable instance type ([8262f04](https://github.com/HalseySpicy/Geeker-Admin/commit/8262f045734d055148720738a80fee0e0c779ceb))
18
-- 🚀 optimize code and add VitePWA ([523f676](https://github.com/HalseySpicy/Geeker-Admin/commit/523f676feee5105eae15d05b57063227be26d3df))
19
-- 🚀 optimize code and update plugins ([5cff3c7](https://github.com/HalseySpicy/Geeker-Admin/commit/5cff3c7e50331ede07d57613cc49658904e7cf1a))
20
-- 🚀 optimize irregular code ([d406ef2](https://github.com/HalseySpicy/Geeker-Admin/commit/d406ef2bb5e0d0522f5e0ce38c3b9d0aa47c7cd2))
21
-- 🚀 proTable radio selection example ([f58291f](https://github.com/HalseySpicy/Geeker-Admin/commit/f58291f96468b816607c31df87326ebd7d0a5c5a))
22
-- 🚀 proTable search component custom rendering ([#189](https://github.com/HalseySpicy/Geeker-Admin/issues/189)) ([89f03db](https://github.com/HalseySpicy/Geeker-Admin/commit/89f03db2db41160b9ac5398d64712fabff399c4c))
23
-- 🚀 proTable supports static table data ([9a3e85d](https://github.com/HalseySpicy/Geeker-Admin/commit/9a3e85d21d6c8872bbc915c42d48eb8658a1db63))
24
-- 🚀 update Gitee address ([0608be9](https://github.com/HalseySpicy/Geeker-Admin/commit/0608be9ba6a9f01f73ed67671d340cf0c1d99261))
25
-- 🚀 update stylelint configuration ([d62aae8](https://github.com/HalseySpicy/Geeker-Admin/commit/d62aae868e7d6aad87f0ba8706ab9744d5da04dd))
26
-- 🚀 update theme, modify bugs ([7a3a7a3](https://github.com/HalseySpicy/Geeker-Admin/commit/7a3a7a3d665c0356c0272947292de750dd0be8d8))
27
-
28
-### Bug Fixes
29
-
30
-- 🧩 fix eslint error ([a980a1a](https://github.com/HalseySpicy/Geeker-Admin/commit/a980a1aa7808895af46c85e0e26a53f66d1119fa))
31
-
32
-## [1.0.0](https://github.com/HalseySpicy/Geeker-Admin/compare/v0.0.7...v1.0.0) (2023-04-15)
33
-
34
-### Features
35
-
36
-- 🚀 升级依赖插件 && 新增树型 ProTbale 示例(更多查看详情) ([ed0ea75](https://github.com/HalseySpicy/Geeker-Admin/commit/ed0ea757555f047f6890632e598ee3293d3598cd))
37
-- 🚀 升级依赖插件 && 修复 bug(查看详情) ([4febadc](https://github.com/HalseySpicy/Geeker-Admin/commit/4febadc10dd794ec8ea1c7864a3771b1b477f743))
38
-- 🚀 新增路由白名单访问控制 ([97dc264](https://github.com/HalseySpicy/Geeker-Admin/commit/97dc26484c6eead2ae4c8c79d50b550f24f19a02))
39
-- 🚀 优化 ProTable && 面包屑导航 ([905d7f1](https://github.com/HalseySpicy/Geeker-Admin/commit/905d7f1fd2b18d9650e6ba7d439dfdcf50363d11))
40
-- 🚀 优化代码 ([cd333df](https://github.com/HalseySpicy/Geeker-Admin/commit/cd333dfe5de2aa7fa415326e6a06b83d3bd260d5))
41
-- 🚀 优化代码和样式细节 ([5b4b926](https://github.com/HalseySpicy/Geeker-Admin/commit/5b4b9266de4f420f32fca70dadb76242d129e604))
42
-- 🚀 优化代码和样式细节 ([756094c](https://github.com/HalseySpicy/Geeker-Admin/commit/756094c402e14841c07cd6062b701929f7f31737))
43
-- 🚀 优化代码逻辑 && 更新微信群二维码 ([629e824](https://github.com/HalseySpicy/Geeker-Admin/commit/629e8243466fda5da9f0ec781aa0b584e49f4501))
44
-- 🚀 优化代码细节问题 ([a6a6ced](https://github.com/HalseySpicy/Geeker-Admin/commit/a6a6cedeb40f2f7901f0dcd0ec7f1c283a491c61))
45
-- 🚀 优化样式、代码细节 ([1b02f45](https://github.com/HalseySpicy/Geeker-Admin/commit/1b02f457162267b090ad946e0bad91e5d0dd14b1))
46
-- 🚀 allow nested tree enum data ([c2fa2be](https://github.com/HalseySpicy/Geeker-Admin/commit/c2fa2be54a6af0309ba45bd4ca68170c66edc357))
47
-- 🚀 refactoring project configuration ([7ede988](https://github.com/HalseySpicy/Geeker-Admin/commit/7ede988bae3ad0b33d9e5ac1ea6145c4d7aa89e6))
48
-- **ProTable:** 🚀 插槽引入 ElTable 的 scope,可获取$index 等 ([4cb7dba](https://github.com/HalseySpicy/Geeker-Admin/commit/4cb7dba40c10e693e324b7c647aa65917aeb0b02))
49
-
50
-### Bug Fixes
51
-
52
-- 🧩 修复 ImportExcel 组件 bug ([ab7e9dd](https://github.com/HalseySpicy/Geeker-Admin/commit/ab7e9dde400aa80ec2e9fa58d9f2168fc3d14f18))
53
-- 🧩 修复 ImportExcel 组件 bug ([803ba58](https://github.com/HalseySpicy/Geeker-Admin/commit/803ba58a2c3fae7f6d8783ca534e2b41c987f027))
54
-- 🧩 修复 ProTable 组件打印功能 bug ([a88b7df](https://github.com/HalseySpicy/Geeker-Admin/commit/a88b7df4623e30459ef3c92196b720efcb200f2f))
55
-- 🧩 修复 TreeFilter 组件默认值 bug ([8e515f0](https://github.com/HalseySpicy/Geeker-Admin/commit/8e515f0d4058f573cbd53281ef68aec38b8dacb9))
56
-- 🧩 修复 TreeFilter 组件默认值 bug ([f23a94d](https://github.com/HalseySpicy/Geeker-Admin/commit/f23a94d6edf442babdc4cd5a52ea63ebbbcac44f))
57
-- 🧩 修复 useDebounceFn 错误使用 ([99d4278](https://github.com/HalseySpicy/Geeker-Admin/commit/99d4278a29b7fa970caba55f43134cebd1d3bec6))
58
-- 🧩 修复多图片上传预览初始化异常 ([d1a917f](https://github.com/HalseySpicy/Geeker-Admin/commit/d1a917f10326b7742b4445c495de12603df658c1))
59
-- 🧩 修复分栏布局路径匹配 bug ([b06bd12](https://github.com/HalseySpicy/Geeker-Admin/commit/b06bd123fa6af0dcb7d5cc9bc9215f13b91ace5f))
60
-- 🧩 修复横向布局下最大化失效 ([e416ddb](https://github.com/HalseySpicy/Geeker-Admin/commit/e416ddb732ae336ca4e7e43ebdeb89b24085d1b1))
61
-- 🧩 修复路由重置 bug ([52b7e66](https://github.com/HalseySpicy/Geeker-Admin/commit/52b7e66febf1db9cd3325eb0e1e45213ff1528c2))
62
-- 🧩 修复弱类型检查错误 ([b32310e](https://github.com/HalseySpicy/Geeker-Admin/commit/b32310ed2f546e3efa918d5f7eee2c3868a98cb7))
63
-
64
-### 0.0.7 (2022-12-28)
65
-
66
-### Features
67
-
68
-- 🚀 二次封装 wangEditor 富文本编辑器(50%) ([4f8e266](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4f8e266b7dd25a7df18d302e88e14454bfa3816b))
69
-- 🚀 更新插件、优化代码(请查看详情) ([dac6dec](https://gitee.com/HalseySpicy/Geeker-Admin/commit/dac6dec75466c19731ad7cf083f8c39940342140))
70
-- 🚀 更新微信群二维码 ([7e890d0](https://gitee.com/HalseySpicy/Geeker-Admin/commit/7e890d0afe0a11170d73e3c2c4ef04d37a582e94))
71
-- 🚀 请求全局 loading 更改为可配置 ([a75d62f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a75d62f627195ac420cf24ad7f51245b2e5bf04e))
72
-- 🚀 升级 element-plus 到 2.25 ([e98c035](https://gitee.com/HalseySpicy/Geeker-Admin/commit/e98c035caa6d1ab04319673e0db65837c6887126))
73
-- 🚀 升级 vite、vue 版本 && 优化分栏布局样式 ([b2b1b59](https://gitee.com/HalseySpicy/Geeker-Admin/commit/b2b1b599bc1fa0f1c64c5c58fb31d3719f415301))
74
-- 🚀 使用属性透传重构 ProTable 组件 ([a428e89](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a428e89a3784c826eceaaee548b97975afbe1d45))
75
-- 🚀 添加 wangEditor 组件 ([d6d2fa7](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d6d2fa7d27887bb4a9e40e9d7037d4621812e16a))
76
-- 🚀 完成 wangEditor 富文本二次封装 ([7362bfb](https://gitee.com/HalseySpicy/Geeker-Admin/commit/7362bfbff19224045e3bb20fa939a78c556cc805))
77
-- 🚀 完善按钮、菜单权限示例 ([6793f0c](https://gitee.com/HalseySpicy/Geeker-Admin/commit/6793f0cd7372b8a080f6d2649b05cdd0c62bd853))
78
-- 🚀 新增 主题色、灰色模式、色弱模式 配置 ([7821157](https://gitee.com/HalseySpicy/Geeker-Admin/commit/7821157059ed9c21d2844f75049f8fa999b19944))
79
-- 🚀 新增 pro-form ([3ab5a5b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3ab5a5b4f63fca227944ab6cc7928f6bf1f88ed4))
80
-- 🚀 新增 protable 打印、列对齐方式功能 ([c22879e](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c22879e7e80ff9ef662c39daa25b11f5f17d17ca))
81
-- 🚀 新增 protbale 功能, 请查看详情 ([17f2bcd](https://gitee.com/HalseySpicy/Geeker-Admin/commit/17f2bcd67362365579ed8a572a3a9d17368ac64e))
82
-- 🚀 新增 SVG Icons ([977602c](https://gitee.com/HalseySpicy/Geeker-Admin/commit/977602c30b8997cb51426fe9498392edc249561d))
83
-- 🚀 新增 treeFilter 组件标题属性 ([20c755f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/20c755f59f3ae2b0380e6549bb56bb22317d750e))
84
-- 🚀 新增 treeFilter data 参数 ([4280766](https://gitee.com/HalseySpicy/Geeker-Admin/commit/428076635d7a0e9f80109274d9523cf91aa5a10c))
85
-- 🚀 新增暗黑模式 ([215e499](https://gitee.com/HalseySpicy/Geeker-Admin/commit/215e499634b516234e653eac27a611d5f51ea6da))
86
-- 🚀 新增菜单搜索功能 ([4aa0eef](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4aa0eefaf427a2aa1aebd2b78dc049ffa776e838))
87
-- 🚀 新增动态路由 ([551fefc](https://gitee.com/HalseySpicy/Geeker-Admin/commit/551fefc2e66b067d9e64d3b0cfbf47dfa1057d98))
88
-- 🚀 新增分栏布局 ([de37143](https://gitee.com/HalseySpicy/Geeker-Admin/commit/de37143e93c0cc5be2ff52466dce344ab9270f0d))
89
-- 🚀 新增功能 && 修复 bug(查看详情) ([1ab183f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/1ab183f1551cb8beb77243c2953b0119409dd6a5))
90
-- 🚀 新增功能 && 修复 bug(查看详情) ([4c0bc5f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4c0bc5fd3c111e1cac636cad104c83ffb1168679))
91
-- 🚀 新增功能(查看详情) ([cbd8dc2](https://gitee.com/HalseySpicy/Geeker-Admin/commit/cbd8dc2387576f525c0e49f81d540fbad3cb5e81))
92
-- 🚀 新增横向、纵向、经典布局切换 ([1046de4](https://gitee.com/HalseySpicy/Geeker-Admin/commit/1046de4c7d5f805b10c5cea5325b063e3d6dd84f))
93
-- 🚀 新增界面配置功能 ([39ffc5e](https://gitee.com/HalseySpicy/Geeker-Admin/commit/39ffc5e9a77da3294055f23f8c87a4a44f3622f7))
94
-- 🚀 新增路由相关功能 ([9679eed](https://gitee.com/HalseySpicy/Geeker-Admin/commit/9679eed1edd0c1f08c17465f590d4ca0365985ee)), closes [#71](https://gitee.com/HalseySpicy/Geeker-Admin/issues/71) [#72](https://gitee.com/HalseySpicy/Geeker-Admin/issues/72) [#49](https://gitee.com/HalseySpicy/Geeker-Admin/issues/49)
95
-- 🚀 新增请求示例,参见 loginApi ([d49b227](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d49b227762ae48c3ca08f0dec02a3667daac8532))
96
-- 🚀 新增图标选择组件 ([ce5e165](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ce5e165aed842074a9f7ac66ea97290710b541ee))
97
-- 🚀 新增图片上传组件 ([c50c421](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c50c421bc3c5f7af68184cda88262c6fb1bd07e0))
98
-- 🚀 新增图片上传组件属性 ([d7670ed](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d7670ed94608c5410f3102d7b9427d8d856204b1))
99
-- 🚀 新增系统管理模块 ([23748e1](https://gitee.com/HalseySpicy/Geeker-Admin/commit/23748e185e80e3b774b42114427934228a57d3aa))
100
-- 🚀 新增消息通知 ([66836b6](https://gitee.com/HalseySpicy/Geeker-Admin/commit/66836b69781ccc55402a3887d091149885864442))
101
-- 🚀 新增页面刷新功能 ([5223a41](https://gitee.com/HalseySpicy/Geeker-Admin/commit/5223a416d17568d5b2cae7b16b637e0f39134223))
102
-- 🚀 新增引导页 ([4fb6fb3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4fb6fb3a3eb34f82576e2378c311ff580f65226d))
103
-- 🚀 新增组件参数配置文档 ([0e11fc5](https://gitee.com/HalseySpicy/Geeker-Admin/commit/0e11fc59175d5d74730c3cb1fa2579effcca6e48))
104
-- 🚀 修改 keepAlive 逻辑 ([168ca13](https://gitee.com/HalseySpicy/Geeker-Admin/commit/168ca13e796c8cc366caa3d6e05090acdaefef75))
105
-- 🚀 修改 pinia 持久化插件 ([a7691ae](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a7691aea614a035c4d381838149e08ad8477e49f))
106
-- 🚀 优化代码注释 && 升级 element 到 2.2.6 ([b84512b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/b84512b3b102b00faa2f9241a32f5fbe27da4307))
107
-- 🚀 优化注释 && 代码细节问题 ([9d0ffa5](https://gitee.com/HalseySpicy/Geeker-Admin/commit/9d0ffa5ddecc4c73bec51208b05a6d44b1523b1f))
108
-- 🚀 预定义主题颜色 ([8219178](https://gitee.com/HalseySpicy/Geeker-Admin/commit/82191789bcf6d21c623aa61c5a64e502cea44c2c))
109
-- 🚀 增加 SearchForm 属性透传 ([eadb89b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/eadb89b687596980a82401f44c53430081078d04))
110
-- 🚀 增加表格 treeFilter、更新整体布局样式 ([719b78f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/719b78f317589b983bc4b852b3bfd63a60d42a46))
111
-- 🚀 增加布局方式切换,样式已完成 ([5745b93](https://gitee.com/HalseySpicy/Geeker-Admin/commit/5745b93a6cc00519c1a02977b8c0437502d867e6))
112
-- 🚀 增加分类筛选器 ([c95a1c0](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c95a1c054ee9eacae470bcaae7574d5c989b86a2))
113
-- 🚀 增加全局错误拦截 && 修改细节问题 请查看详情 ([0496184](https://gitee.com/HalseySpicy/Geeker-Admin/commit/04961847eb7df004d1e9f562e78ea3d5f851ea49))
114
-
115
-### Bug Fixes
116
-
117
-- 🧩 菜单搜索过滤掉 isHide 为 true 的菜单 ([c6bab35](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c6bab356f0cde7e3dc6f69dfac115239c2453776))
118
-- 🧩 解决 useTable 查询参数 bug ([a86e408](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a86e4089b6da8ab6a55bc84e069d665c06471676))
119
-- 🧩 去除登陆页默认账号 ([3dda3fe](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3dda3fee3fef38fdafcfdf3b1bf16e73033c6fe0))
120
-- 🧩 删除 protable 组件 image 配置属性 ([d699fe7](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d699fe7bd55eaaccfad9b94105c1b43ae64d1c34))
121
-- 🧩 修复 国际化 产生的 bug ([ec4f74a](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ec4f74ae654e7287fc08bb31fa3ee3d2c76164eb))
122
-- 🧩 修复 axios 请求超时未拦截错误 ([856468e](https://gitee.com/HalseySpicy/Geeker-Admin/commit/856468e84f8356d35c25097f3115dfe3d496914c))
123
-- 🧩 修复 bug ([3714abd](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3714abdc4826034791ccb3fc8249d946ec3a4e16))
124
-- 🧩 修复 Pro-Tabel 列设置 bug ([a3b86a0](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a3b86a06a6d9cd4b6f7ac6e108727a0b4852e9a0))
125
-- 🧩 修复 pro-table 格式报错问题 ([2ef11fd](https://gitee.com/HalseySpicy/Geeker-Admin/commit/2ef11fda6d373c3214df801ae789cafc1a033dcb))
126
-- 🧩 修复布局样式 bug ([2f1cd64](https://gitee.com/HalseySpicy/Geeker-Admin/commit/2f1cd6442f359909301e3d95b0ed4dc9d2dbe7c6))
127
-- 🧩 修复打包错误 ([243ebfc](https://gitee.com/HalseySpicy/Geeker-Admin/commit/243ebfc5280ddc013056c6708b44df35fe18f613))
128
-- 🧩 修复打包失败 ([31698fe](https://gitee.com/HalseySpicy/Geeker-Admin/commit/31698fea6478d60343a9ad49ae0fc6db7a42c184))
129
-- 🧩 修复打包失败问题 ([1778651](https://gitee.com/HalseySpicy/Geeker-Admin/commit/1778651781a1bb8bfe4ea61dafb9b48773fef5d7))
130
-- 🧩 修复分栏布局 bug ([113274a](https://gitee.com/HalseySpicy/Geeker-Admin/commit/113274a87e2dacf694648f3a304c7ac37e2262d0))
131
-- 🧩 修复经典布局展示 bug ([b95e237](https://gitee.com/HalseySpicy/Geeker-Admin/commit/b95e2376d06c6a6a35f72743e3fe8c1569fda008))
132
-- 🧩 修复路由跳转两次不能携带参数问题 ([8b583f3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/8b583f3d5f05b77ec2a35082557bae431441a586))
133
-- 🧩 修复请求 header 参数丢失 bug ([3598dbc](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3598dbc2a83aaacf9dada4e2c38a3ca27cbe4cfd))
134
-- 🧩 修复上传组件细节问题 ([8528358](https://gitee.com/HalseySpicy/Geeker-Admin/commit/8528358925ea809cf52f55015355345e87607351))
135
-- 🧩 修复 BUG ([4bf2988](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4bf29881dd41fad256f1beb5affcd5ba6599e17d))
136
-- 🧩 修复 BUG ([c93aaf7](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c93aaf700112decd158e9a5a9c1f83eff1773e91))
137
-- 🧩 修复 loading 请求 bug ([a3270ec](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a3270ecfa2e7c2484729ae6fd599febcc4f7be6b))
138
-- 🧩 修复 vercel 打包失败 ([e63dee1](https://gitee.com/HalseySpicy/Geeker-Admin/commit/e63dee1f9653f4f95d0330275c5f5e8b530564c9))
139
-- 🧩 修改 Pro-Table 表头渲染方式 ([aa57294](https://gitee.com/HalseySpicy/Geeker-Admin/commit/aa5729489942eaa6dca9928b70153af2de753a9c))
140
-- 🧩 修改 useTable 存在的 bug ([5bb55b3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/5bb55b32c0b46bbf55fa0d49efe3a15d0b1673a4))
141
-- 🧩 修改 useTable 钩子中的 bug ([675aed8](https://gitee.com/HalseySpicy/Geeker-Admin/commit/675aed806e62c236b40bc933402c86085289df4e))
142
-- 🧩 修改 useTable 携带默认查询参数 bug ([ee585b2](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ee585b29f3129b7143a10947fdd3184b197ad883))
143
-- 🧩 修改代码细节 && 优化注释 ([d86cb1f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d86cb1feb32e11a29e1c2bee54ea788c6c828d75))
144
-- 🧩 修改当菜单设置 isHide=true 时面包屑报错 ([66885c5](https://gitee.com/HalseySpicy/Geeker-Admin/commit/66885c5cc15c10ccadcd49a7bee27a821663e8a7))
145
-- 🧩 修改文件导出失败 bug ([208e720](https://gitee.com/HalseySpicy/Geeker-Admin/commit/208e720688969d2bc0fa0a6cc2bae3e3b991c806))
146
-- 🧩 修改 BUG ([540048a](https://gitee.com/HalseySpicy/Geeker-Admin/commit/540048a09be9b0df5443e275f38f43c80dcde51f))
147
-- 🧩 fix use pinia bug ([609aa69](https://gitee.com/HalseySpicy/Geeker-Admin/commit/609aa69aa9b3e0bb4e667ee7f76ab44051c2d2e8))
148
-- 修复登录后白屏 ([f986c5c](https://gitee.com/HalseySpicy/Geeker-Admin/commit/f986c5c44fc1df8d5c6a90e90239c06928e2f4a1))
149
-- **el-table:** 🧩 修复 el-table 在 safari 浏览器错乱 ([b776a48](https://gitee.com/HalseySpicy/Geeker-Admin/commit/b776a483636547c7cee723846ec33b2842550d13))
150
-
151
-### 0.0.6 (2022-08-22)
152
-
153
-### Features
154
-
155
-- 🚀 二次封装 wangEditor 富文本编辑器(50%) ([4f8e266](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4f8e266b7dd25a7df18d302e88e14454bfa3816b))
156
-- 🚀 请求全局 loading 更改为可配置 ([a75d62f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a75d62f627195ac420cf24ad7f51245b2e5bf04e))
157
-- 🚀 升级 element-plus 到 2.25 ([e98c035](https://gitee.com/HalseySpicy/Geeker-Admin/commit/e98c035caa6d1ab04319673e0db65837c6887126))
158
-- 🚀 添加 wangEditor 组件 ([d6d2fa7](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d6d2fa7d27887bb4a9e40e9d7037d4621812e16a))
159
-- 🚀 完成 wangEditor 富文本二次封装 ([7362bfb](https://gitee.com/HalseySpicy/Geeker-Admin/commit/7362bfbff19224045e3bb20fa939a78c556cc805))
160
-- 🚀 新增 主题色、灰色模式、色弱模式 配置 ([7821157](https://gitee.com/HalseySpicy/Geeker-Admin/commit/7821157059ed9c21d2844f75049f8fa999b19944))
161
-- 🚀 新增 pro-form ([3ab5a5b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3ab5a5b4f63fca227944ab6cc7928f6bf1f88ed4))
162
-- 🚀 新增 protbale 功能, 请查看详情 ([17f2bcd](https://gitee.com/HalseySpicy/Geeker-Admin/commit/17f2bcd67362365579ed8a572a3a9d17368ac64e))
163
-- 🚀 新增 SVG Icons ([977602c](https://gitee.com/HalseySpicy/Geeker-Admin/commit/977602c30b8997cb51426fe9498392edc249561d))
164
-- 🚀 新增 treeFilter data 参数 ([4280766](https://gitee.com/HalseySpicy/Geeker-Admin/commit/428076635d7a0e9f80109274d9523cf91aa5a10c))
165
-- 🚀 新增暗黑模式 ([215e499](https://gitee.com/HalseySpicy/Geeker-Admin/commit/215e499634b516234e653eac27a611d5f51ea6da))
166
-- 🚀 新增菜单搜索功能 ([4aa0eef](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4aa0eefaf427a2aa1aebd2b78dc049ffa776e838))
167
-- 🚀 新增界面配置功能 ([39ffc5e](https://gitee.com/HalseySpicy/Geeker-Admin/commit/39ffc5e9a77da3294055f23f8c87a4a44f3622f7))
168
-- 🚀 新增请求示例,参见 loginApi ([d49b227](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d49b227762ae48c3ca08f0dec02a3667daac8532))
169
-- 🚀 新增图标选择组件 ([ce5e165](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ce5e165aed842074a9f7ac66ea97290710b541ee))
170
-- 🚀 新增图片上传组件 ([c50c421](https://gitee.com/HalseySpicy/Geeker-Admin/commit/c50c421bc3c5f7af68184cda88262c6fb1bd07e0))
171
-- 🚀 新增图片上传组件属性 ([d7670ed](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d7670ed94608c5410f3102d7b9427d8d856204b1))
172
-- 🚀 新增引导页 ([4fb6fb3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/4fb6fb3a3eb34f82576e2378c311ff580f65226d))
173
-- 🚀 新增组件参数配置文档 ([0e11fc5](https://gitee.com/HalseySpicy/Geeker-Admin/commit/0e11fc59175d5d74730c3cb1fa2579effcca6e48))
174
-- 🚀 修改 pinia 持久化插件 ([a7691ae](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a7691aea614a035c4d381838149e08ad8477e49f))
175
-- 🚀 优化代码注释 && 升级 element 到 2.2.6 ([b84512b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/b84512b3b102b00faa2f9241a32f5fbe27da4307))
176
-- 🚀 优化注释 && 代码细节问题 ([9d0ffa5](https://gitee.com/HalseySpicy/Geeker-Admin/commit/9d0ffa5ddecc4c73bec51208b05a6d44b1523b1f))
177
-- 🚀 预定义主题颜色 ([8219178](https://gitee.com/HalseySpicy/Geeker-Admin/commit/82191789bcf6d21c623aa61c5a64e502cea44c2c))
178
-- 🚀 增加 SearchForm 属性透传 ([eadb89b](https://gitee.com/HalseySpicy/Geeker-Admin/commit/eadb89b687596980a82401f44c53430081078d04))
179
-- 🚀 增加表格 treeFilter、更新整体布局样式 ([719b78f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/719b78f317589b983bc4b852b3bfd63a60d42a46))
180
-
181
-### Bug Fixes
182
-
183
-- 🧩 解决 useTable 查询参数 bug ([a86e408](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a86e4089b6da8ab6a55bc84e069d665c06471676))
184
-- 🧩 去除登陆页默认账号 ([3dda3fe](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3dda3fee3fef38fdafcfdf3b1bf16e73033c6fe0))
185
-- 🧩 删除 protable 组件 image 配置属性 ([d699fe7](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d699fe7bd55eaaccfad9b94105c1b43ae64d1c34))
186
-- 🧩 修复 国际化 产生的 bug ([ec4f74a](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ec4f74ae654e7287fc08bb31fa3ee3d2c76164eb))
187
-- 🧩 修复 axios 请求超时未拦截错误 ([856468e](https://gitee.com/HalseySpicy/Geeker-Admin/commit/856468e84f8356d35c25097f3115dfe3d496914c))
188
-- 🧩 修复 Pro-Tabel 列设置 bug ([a3b86a0](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a3b86a06a6d9cd4b6f7ac6e108727a0b4852e9a0))
189
-- 🧩 修复 pro-table 格式报错问题 ([2ef11fd](https://gitee.com/HalseySpicy/Geeker-Admin/commit/2ef11fda6d373c3214df801ae789cafc1a033dcb))
190
-- 🧩 修复打包失败问题 ([1778651](https://gitee.com/HalseySpicy/Geeker-Admin/commit/1778651781a1bb8bfe4ea61dafb9b48773fef5d7))
191
-- 🧩 修复路由跳转两次不能携带参数问题 ([8b583f3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/8b583f3d5f05b77ec2a35082557bae431441a586))
192
-- 🧩 修复请求 header 参数丢失 bug ([3598dbc](https://gitee.com/HalseySpicy/Geeker-Admin/commit/3598dbc2a83aaacf9dada4e2c38a3ca27cbe4cfd))
193
-- 🧩 修复上传组件细节问题 ([8528358](https://gitee.com/HalseySpicy/Geeker-Admin/commit/8528358925ea809cf52f55015355345e87607351))
194
-- 🧩 修复 loading 请求 bug ([a3270ec](https://gitee.com/HalseySpicy/Geeker-Admin/commit/a3270ecfa2e7c2484729ae6fd599febcc4f7be6b))
195
-- 🧩 修改 Pro-Table 表头渲染方式 ([aa57294](https://gitee.com/HalseySpicy/Geeker-Admin/commit/aa5729489942eaa6dca9928b70153af2de753a9c))
196
-- 🧩 修改 useTable 存在的 bug ([5bb55b3](https://gitee.com/HalseySpicy/Geeker-Admin/commit/5bb55b32c0b46bbf55fa0d49efe3a15d0b1673a4))
197
-- 🧩 修改 useTable 钩子中的 bug ([675aed8](https://gitee.com/HalseySpicy/Geeker-Admin/commit/675aed806e62c236b40bc933402c86085289df4e))
198
-- 🧩 修改 useTable 携带默认查询参数 bug ([ee585b2](https://gitee.com/HalseySpicy/Geeker-Admin/commit/ee585b29f3129b7143a10947fdd3184b197ad883))
199
-- 🧩 修改代码细节 && 优化注释 ([d86cb1f](https://gitee.com/HalseySpicy/Geeker-Admin/commit/d86cb1feb32e11a29e1c2bee54ea788c6c828d75))
200
-- 🧩 修改文件导出失败 bug ([208e720](https://gitee.com/HalseySpicy/Geeker-Admin/commit/208e720688969d2bc0fa0a6cc2bae3e3b991c806))
201
-- 🧩 fix use pinia bug ([609aa69](https://gitee.com/HalseySpicy/Geeker-Admin/commit/609aa69aa9b3e0bb4e667ee7f76ab44051c2d2e8))
202
-- 修复登录后白屏 ([f986c5c](https://gitee.com/HalseySpicy/Geeker-Admin/commit/f986c5c44fc1df8d5c6a90e90239c06928e2f4a1))
203
-
204
-### [0.0.5](https://github.com/HalseySpicy/Geeker-Admin/compare/v0.0.4...v0.0.5) (2022-07-21)
205
-
206
-### Features
207
-
208
-- 🚀 新增请求示例,参见 loginApi ([d49b227](https://github.com/HalseySpicy/Geeker-Admin/commit/d49b227762ae48c3ca08f0dec02a3667daac8532))
209
-
210
-### Bug Fixes
211
-
212
-- 🧩 解决 useTable 查询参数 bug ([a86e408](https://github.com/HalseySpicy/Geeker-Admin/commit/a86e4089b6da8ab6a55bc84e069d665c06471676))
213
-- 🧩 修复 axios 请求超时未拦截错误 ([856468e](https://github.com/HalseySpicy/Geeker-Admin/commit/856468e84f8356d35c25097f3115dfe3d496914c))
214
-- 🧩 修复请求 header 参数丢失 bug ([3598dbc](https://github.com/HalseySpicy/Geeker-Admin/commit/3598dbc2a83aaacf9dada4e2c38a3ca27cbe4cfd))
215
-
216
-### [0.0.4](https://github.com/HalseySpicy/Geeker-Admin/compare/v0.0.3...v0.0.4) (2022-07-12)
217
-
218
-### Features
219
-
220
-- 🚀 新增 主题色、灰色模式、色弱模式 配置 ([7821157](https://github.com/HalseySpicy/Geeker-Admin/commit/7821157059ed9c21d2844f75049f8fa999b19944))
221
-- 🚀 新增 pro-form ([3ab5a5b](https://github.com/HalseySpicy/Geeker-Admin/commit/3ab5a5b4f63fca227944ab6cc7928f6bf1f88ed4))
222
-- 🚀 新增菜单搜索功能 ([4aa0eef](https://github.com/HalseySpicy/Geeker-Admin/commit/4aa0eefaf427a2aa1aebd2b78dc049ffa776e838))
223
-- 🚀 新增界面配置功能 ([39ffc5e](https://github.com/HalseySpicy/Geeker-Admin/commit/39ffc5e9a77da3294055f23f8c87a4a44f3622f7))
224
-- 🚀 预定义主题颜色 ([8219178](https://github.com/HalseySpicy/Geeker-Admin/commit/82191789bcf6d21c623aa61c5a64e502cea44c2c))
225
-- 🚀 增加 SearchForm 属性透传 ([eadb89b](https://github.com/HalseySpicy/Geeker-Admin/commit/eadb89b687596980a82401f44c53430081078d04))
226
-
227
-### Bug Fixes
228
-
229
-- 🧩 修复 pro-table 格式报错问题 ([2ef11fd](https://github.com/HalseySpicy/Geeker-Admin/commit/2ef11fda6d373c3214df801ae789cafc1a033dcb))
230
-- 🧩 修改文件导出失败 bug ([208e720](https://github.com/HalseySpicy/Geeker-Admin/commit/208e720688969d2bc0fa0a6cc2bae3e3b991c806))
231
-- 🧩 fix use pinia bug ([609aa69](https://github.com/HalseySpicy/Geeker-Admin/commit/609aa69aa9b3e0bb4e667ee7f76ab44051c2d2e8))
232
-
233
-### [0.0.2](https://github.com/HalseySpicy/Geeker-Admin/compare/v0.0.3...v0.0.2) (2022-06-29)
234
-
235
-### 0.0.2 (2022-06-20)
236
-
237
-### Features
238
-
239
-- 🚀 请求全局 loading 更改为可配置 ([a75d62f](https://github.com/HalseySpicy/Geeker-Admin/commit/a75d62f627195ac420cf24ad7f51245b2e5bf04e))
240
-- 🚀 升级 element-plus 到 2.2.5 ([e98c035](https://github.com/HalseySpicy/Geeker-Admin/commit/e98c035caa6d1ab04319673e0db65837c6887126))
241
-- 🚀 新增暗黑模式 ([215e499](https://github.com/HalseySpicy/Geeker-Admin/commit/215e499634b516234e653eac27a611d5f51ea6da))
242
-- 🚀 新增图标选择组件 ([ce5e165](https://github.com/HalseySpicy/Geeker-Admin/commit/ce5e165aed842074a9f7ac66ea97290710b541ee))
243
-- 🚀 修改 pinia 持久化插件 ([a7691ae](https://github.com/HalseySpicy/Geeker-Admin/commit/a7691aea614a035c4d381838149e08ad8477e49f))
244
-- 🚀 优化代码注释 && 升级 element 到 2.2.6 ([b84512b](https://github.com/HalseySpicy/Geeker-Admin/commit/b84512b3b102b00faa2f9241a32f5fbe27da4307))
245
-
246
-### Bug Fixes
247
-
248
-- 🧩 去除登陆页默认账号 ([3dda3fe](https://github.com/HalseySpicy/Geeker-Admin/commit/3dda3fee3fef38fdafcfdf3b1bf16e73033c6fe0))
249
-- 🧩 修复 Pro-Table 列设置 bug ([a3b86a0](https://github.com/HalseySpicy/Geeker-Admin/commit/a3b86a06a6d9cd4b6f7ac6e108727a0b4852e9a0))
250
-- 🧩 修复 loading 请求 bug ([a3270ec](https://github.com/HalseySpicy/Geeker-Admin/commit/a3270ecfa2e7c2484729ae6fd599febcc4f7be6b))
251
-- 🧩 修改 Pro-Table 表头渲染方式 ([aa57294](https://github.com/HalseySpicy/Geeker-Admin/commit/aa5729489942eaa6dca9928b70153af2de753a9c))
252
-- 🧩 修改 useTable 存在的 bug ([5bb55b3](https://github.com/HalseySpicy/Geeker-Admin/commit/5bb55b32c0b46bbf55fa0d49efe3a15d0b1673a4))
253
-- 🧩 修改 useTable 钩子中的 bug ([675aed8](https://github.com/HalseySpicy/Geeker-Admin/commit/675aed806e62c236b40bc933402c86085289df4e))
254
-- 🧩 修改 useTable 携带默认查询参数 bug ([ee585b2](https://github.com/HalseySpicy/Geeker-Admin/commit/ee585b29f3129b7143a10947fdd3184b197ad883))

+ 94
- 16
src/api/home/Multisite.ts 파일 보기

@@ -1,5 +1,5 @@
1 1
 import http from "@/api";
2
-import { Alarm, Station, other } from "../interface";
2
+import { Alarm, Resultjob, Station, other } from "../interface";
3 3
 import qs from "qs";
4 4
 // export const changeUserStatus = (params: { id: string; status: number }) => {
5 5
 //   return http.post(`/upload`,qs.stringify(params));
@@ -12,6 +12,10 @@ export const getuser = () => {
12 12
 export const gethomesite = () => {
13 13
   return http.post(`/muitiStation/overview`);
14 14
 };
15
+// 单站概览站点数据--------
16
+export const getmuitiStation = (id: any) => {
17
+  return http.post(`/muitiStation/${id}/overw`);
18
+};
15 19
 // 收益统计------------日份
16 20
 export const multiStationday = (params: {}) => {
17 21
   return http.post<Station.between[]>(`/stats/multStation/profit/between/day`, qs.stringify(params));
@@ -36,7 +40,6 @@ export const multiStationtopday = (params: {}) => {
36 40
 export const multiStationtopyearMonth = (params: {}) => {
37 41
   return http.post<Station.profitday[]>(`/stats/multStation/profit/top/between/yearMonth`, qs.stringify(params));
38 42
 };
39
-
40 43
 // 故障告警-------------
41 44
 export const alarmMultiStation = (params: {}) => {
42 45
   return http.post<Station.multiStation[]>(`/alarm/multiStation`, qs.stringify(params));
@@ -85,7 +88,6 @@ export const singlestationday = (params: {}, id: any) => {
85 88
 export const singlestationyearMonth = (params: {}, id: any) => {
86 89
   return http.post<Station.profitbetween>(`/stats/singleStation/${id}/profit/between/yearMonth`, qs.stringify(params));
87 90
 };
88
-
89 91
 // 单站橄榄放电统计---------日
90 92
 export const postsexportKwh = (params: {}, id: any) => {
91 93
   return http.post<Station.power[]>(`/stats/singleStation/${id}/singleStation/between/day`, qs.stringify(params));
@@ -172,20 +174,27 @@ export const BMSbatteryStackInfo = (params: {}, id: string, ids: string) => {
172 174
 };
173 175
 // 设备监控 空调标签数据
174 176
 export const getairConditionerInfo = (params: {}, id: string, ids: string) => {
175
-  return http.post(`device/station/${id}/${ids}/airConditionerInfo`, qs.stringify(params));
177
+  return http.post(`device/station/${id}/${ids}/airConditionerInfo`, qs.stringify(params), { loading: false });
176 178
 };
177 179
 // 电价管理
178 180
 export const electricitylist = (params: {}, id: string) => {
179 181
   return http.post<Station.electricity[]>(`/electricity/${id}/tariff/2024/list`, qs.stringify(params));
180 182
 };
181
-
183
+// 电价新增
184
+export const insertschedule = (params: {}, name: string) => {
185
+  return http.post(`/electricity/insertschedule?name=${name}`, params);
186
+};
182 187
 // 模板管理
183
-export const electricitytmplpage = (params: {}, id: string) => {
184
-  return http.post<Station.Tmpl>(`/electricity/${id}/tmpl/page`, qs.stringify(params));
188
+export const electricitytmplpage = (params: {}) => {
189
+  return http.post<Station.Tmpl>(`/electricity/tmpl/page`, qs.stringify(params));
190
+};
191
+// 模板管理-模版详情
192
+export const electricitytmplpagedetails = (params: {}, ids: string) => {
193
+  return http.post<Station.Tmpl>(`/electricity/tmpl/${ids}/detail`, qs.stringify(params));
185 194
 };
186
-// 模板管理详情
187
-export const electricitytmplpagedetails = (params: {}, id: any, ids: string) => {
188
-  return http.post<Station.Tmpl>(`/electricity/${id}/tmpl/${ids}/detail`, qs.stringify(params));
195
+// 电价配置-模版查看
196
+export const electricitytmptariff = (params: {}, ids: string) => {
197
+  return http.post<Station.Tmpl>(`/electricity/tariff/${ids}/detail`, qs.stringify(params));
189 198
 };
190 199
 // 电量报表按日
191 200
 export const reportpowerday = (params: {}) => {
@@ -272,7 +281,6 @@ export const singleincomeyearMonth = (params: {}, id: any) => {
272 281
 export const singleincomeyear = (params: {}, id: any) => {
273 282
   return http.post<Station.summary>(`/profit/report/singleStation/${id}/between/year`, qs.stringify(params));
274 283
 };
275
-
276 284
 // 导出电量报表汇总-按日
277 285
 export const Summaryexportday = (params: {}) => {
278 286
   return http.post<other.Data>(`/report/power/exportday`, qs.stringify(params));
@@ -289,21 +297,21 @@ export const Summaryexportyear = (params: {}) => {
289 297
 export const betweenbiaoExcel = (params: {}, id: any) => {
290 298
   return http.post<other.Data>(`/report/power/singleStation/${id}/betweenbiaoExcel`, qs.stringify(params));
291 299
 };
292
-// 导出电量报表单站-按
300
+// 导出电量报表单站-按
293 301
 export const betweenyearMonthExcel = (params: {}, id: any) => {
294 302
   return http.post<other.Data>(`/report/power/singleStation/${id}/betweenyearMonthExcel`, qs.stringify(params));
295 303
 };
296
-// 导出电量报表单站-按
304
+// 导出电量报表单站-按
297 305
 export const betweenyearExcel = (params: {}, id: any) => {
298 306
   return http.post<other.Data>(`/report/power/singleStation/${id}/betweenyearExcel`, qs.stringify(params));
299 307
 };
300 308
 // 导出收益报表汇总-按日
301 309
 export const reportsummarymonthEXcel = (params: {}) => {
302
-  return http.post<other.Data>(`/profit/report/reportsummarymonthEXcel`, qs.stringify(params));
310
+  return http.post<other.Data>(`/profit/report/reportsummarydayEXcel`, qs.stringify(params));
303 311
 };
304 312
 // 导出收益报表报表汇总-按月
305 313
 export const summaryearmonthEXcel = (params: {}) => {
306
-  return http.post<other.Data>(`/report/power/summaryearmonthEXcel`, qs.stringify(params));
314
+  return http.post<other.Data>(`/profit/report/reportsummarymonthEXcel`, qs.stringify(params));
307 315
 };
308 316
 // 导出收益报表报表汇总-按年
309 317
 export const reportsummaryyearEXcel = (params: {}) => {
@@ -463,7 +471,77 @@ export const updateMysqlTDengineURL = (params: {}) => {
463 471
 export const selectemssytemALLURL = (params: {}) => {
464 472
   return http.post(`/station/manage/selectemssytemALL`, qs.stringify(params));
465 473
 };
466
-// 新增保存-电站信息-设备信息
474
+// 新增-电站信息-设备信息
467 475
 export const insertpowerURL = (params: {}) => {
468 476
   return http.post(`/station/manage/insertpower`, qs.stringify(params));
469 477
 };
478
+// 编辑-电站信息-设备信息
479
+export const updatesingleeditURL = (params: {}) => {
480
+  return http.post(`/station/manage/updatesingle`, qs.stringify(params));
481
+};
482
+// 系统设置-设备管理-列表
483
+export const selectemssytemNameURL = (params: {}) => {
484
+  return http.post(`/emsSystem/singleStation/selectemssytemName`, qs.stringify(params));
485
+};
486
+// 系统设置-设备管理-编辑保存
487
+export const updateemssytemNameURL = (params: {}) => {
488
+  return http.post(`/emsSystem/singleStation/updateemssytemName`, qs.stringify(params));
489
+};
490
+// 系统设置-电价-添加电站和模版的中间表
491
+export const selectelectURL = (params: {}) => {
492
+  return http.post(`/electricity/selectelect`, qs.stringify(params));
493
+};
494
+
495
+// 系统设置-电价-查询全部的模版名称
496
+export const insertscheduletariffURL = (params: {}) => {
497
+  return http.post(`/electricity/insertscheduletariff`, qs.stringify(params));
498
+};
499
+// 系统设置-电价-查询全部的模版名称
500
+export const selectpoweroverviewURL = (params: {}) => {
501
+  return http.post<other.Select>(`/electricity/selectpoweroverview`, qs.stringify(params));
502
+};
503
+// 系统设置-上传图片
504
+export const uploadURL = (params: {}) => {
505
+  return http.post(`/station/manage/upload/webPost`, params);
506
+};
507
+// 修改用户信息
508
+export const updateURL = (params: {}) => {
509
+  return http.post(`/platform/user/profile/update`, qs.stringify(params));
510
+};
511
+// 查询全部的定时任务
512
+export const joblistURL = (params: {}) => {
513
+  return http.post<Resultjob>(`/platform/monitor/job/list`, qs.stringify(params));
514
+};
515
+// 查询全部的定时任务
516
+export const checkCronExpressionIsValid = (params: {}) => {
517
+  return http.post<Resultjob>(`/platform/monitor/job/checkCronExpressionIsValid`, qs.stringify(params));
518
+};
519
+// 新增保存调度
520
+export const monitorjobadd = (params: {}) => {
521
+  return http.post<Resultjob>(`/platform/monitor/job/add`, qs.stringify(params));
522
+};
523
+// 修改保存调度
524
+export const monitorjobedit = (params: {}) => {
525
+  return http.post<Resultjob>(`/platform/monitor/job/edit`, qs.stringify(params));
526
+};
527
+// 修改任务调度修改回显
528
+export const jobeditupdate = (id: any) => {
529
+  return http.get(`/platform/monitor/job/editupdate/${id}`);
530
+};
531
+// 定时任务删除
532
+export const jobremove = (params: {}) => {
533
+  return http.post(`/platform/monitor/job/remove`, qs.stringify(params));
534
+};
535
+// 定时任务状态修改
536
+export const jobchangeStatus = (params: {}) => {
537
+  return http.post(`/platform/monitor/job/changeStatus`, qs.stringify(params));
538
+};
539
+// 编辑电站信息
540
+
541
+export const editpowerURL = (id: any, params: {}) => {
542
+  return http.post(`/station/manage/editpower/${id}`, qs.stringify(params));
543
+};
544
+// 设备管理-编辑回显
545
+export const selectemsNameURL = (id: any, params: {}) => {
546
+  return http.post(`/emsSystem/singleStation/selectemsName/${id}`, qs.stringify(params));
547
+};

+ 1
- 0
src/api/index.ts 파일 보기

@@ -104,6 +104,7 @@ class RequestHttp {
104 104
           return Promise.reject(data);
105 105
         }
106 106
         // 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
107
+
107 108
         if (data.code && data.code !== ResultEnum.SUCCESS) {
108 109
           ElMessage.error(data.msg);
109 110
 

+ 22
- 1
src/api/interface/index.ts 파일 보기

@@ -3,9 +3,16 @@ export interface Result {
3 3
   code: string;
4 4
   msg: string;
5 5
 }
6
-
6
+// 请求响应参数(不包含rows)
7
+export interface Resultjob {
8
+  code: string;
9
+  msg: string;
10
+  rows: [];
11
+  total: number;
12
+}
7 13
 // 请求响应参数(包含data)
8 14
 export interface ResultData<T = any> extends Result {
15
+  total: number;
9 16
   data: T;
10 17
 }
11 18
 
@@ -102,6 +109,7 @@ export namespace Station {
102 109
   }
103 110
   // 电价配置
104 111
   export interface electricity {
112
+    start: number;
105 113
     currencyUnit: null;
106 114
     dataSource: number;
107 115
     imonth: number;
@@ -113,6 +121,7 @@ export namespace Station {
113 121
     stationTmplId: string;
114 122
     tmplId: null;
115 123
     tmplName: string;
124
+    tariffId: string;
116 125
   }
117 126
   // 模板管理表格数据
118 127
   export interface Tmpl {
@@ -418,4 +427,16 @@ export namespace other {
418 427
     url: string;
419 428
     visible: string;
420 429
   }
430
+  // 电价管理
431
+  export interface Scheduling {
432
+    imonth: number;
433
+    iyear: string;
434
+    startTime: string;
435
+    endTime: string;
436
+    periodType: string;
437
+  }
438
+
439
+  export interface Select {
440
+    [key: number]: Scheduling[];
441
+  }
421 442
 }

+ 1
- 1
src/api/modules/upload.ts 파일 보기

@@ -7,7 +7,7 @@ import http from "@/api";
7 7
  */
8 8
 // 图片上传
9 9
 export const uploadImg = (params: FormData) => {
10
-  return http.post<Upload.ResFileUrl>(PORT1 + `/file/upload/img`, params, { cancel: false });
10
+  return http.post<Upload.ResFileUrl>(`/platform/shu/upload/webPost`, params, { cancel: false });
11 11
 };
12 12
 
13 13
 // 视频上传

+ 6
- 6
src/components/Upload/Img.vue 파일 보기

@@ -25,10 +25,10 @@
25 25
             <el-icon><ZoomIn /></el-icon>
26 26
             <span>查看</span>
27 27
           </div>
28
-          <div v-if="!self_disabled" class="handle-icon" @click="deleteImg">
28
+          <!-- <div v-if="!self_disabled" class="handle-icon" @click="deleteImg">
29 29
             <el-icon><Delete /></el-icon>
30 30
             <span>删除</span>
31
-          </div>
31
+          </div> -->
32 32
         </div>
33 33
       </template>
34 34
       <template v-else>
@@ -105,7 +105,7 @@ const handleHttpUpload = async (options: UploadRequestOptions) => {
105 105
   try {
106 106
     const api = props.api ?? uploadImg;
107 107
     const { data } = await api(formData);
108
-    emit("update:imageUrl", data.fileUrl);
108
+    emit("update:imageUrl", data.url);
109 109
     // 调用 el-form 内部的校验方法(可自动校验)
110 110
     formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]);
111 111
   } catch (error) {
@@ -116,9 +116,9 @@ const handleHttpUpload = async (options: UploadRequestOptions) => {
116 116
 /**
117 117
  * @description 删除图片
118 118
  * */
119
-const deleteImg = () => {
120
-  emit("update:imageUrl", "");
121
-};
119
+// const deleteImg = () => {
120
+//   emit("update:imageUrl", "");
121
+// };
122 122
 
123 123
 /**
124 124
  * @description 编辑图片

+ 5
- 3
src/components/Upload/Imgs.vue 파일 보기

@@ -67,7 +67,7 @@ const props = withDefaults(defineProps<UploadFileProps>(), {
67 67
   fileList: () => [],
68 68
   drag: true,
69 69
   disabled: false,
70
-  limit: 5,
70
+  limit: 9,
71 71
   fileSize: 5,
72 72
   fileType: () => ["image/jpg", "image/jpeg", "image/png", "image/gif"],
73 73
   height: "150px",
@@ -142,9 +142,11 @@ const handleHttpUpload = async (options: UploadRequestOptions) => {
142 142
 const emit = defineEmits<{
143 143
   "update:fileList": [value: UploadUserFile[]];
144 144
 }>();
145
-const uploadSuccess = (response: { fileUrl: string } | undefined, uploadFile: UploadFile) => {
145
+const uploadSuccess = (response: { url: string } | undefined, uploadFile: UploadFile) => {
146
+  console.log(response);
147
+
146 148
   if (!response) return;
147
-  uploadFile.url = response.fileUrl;
149
+  uploadFile.url = response.url;
148 150
   emit("update:fileList", _fileList.value);
149 151
   // 调用 el-form 内部的校验方法(可自动校验)
150 152
   formItemContext?.prop && formContext?.validateField([formItemContext.prop as string]);

+ 13
- 10
src/layouts/components/Header/components/Avatar.vue 파일 보기

@@ -1,13 +1,11 @@
1 1
 <template>
2 2
   <el-dropdown trigger="click">
3
-    <div class="avatar">
4
-      <img src="@/assets/images/avatar.gif" alt="avatar" />
5
-    </div>
3
+    <div class="avatar"><img :src="avatar" alt="avatar" /></div>
6 4
     <template #dropdown>
7 5
       <el-dropdown-menu>
8
-        <!-- <el-dropdown-item @click="openDialog('infoRef')">
6
+        <el-dropdown-item @click="openDialog('infoRef')">
9 7
           <el-icon><User /></el-icon>{{ $t("header.personalData") }}
10
-        </el-dropdown-item> -->
8
+        </el-dropdown-item>
11 9
         <!-- 个人信息 -->
12 10
         <el-dropdown-item @click="openDialog('passwordRef')">
13 11
           <el-icon><Edit /></el-icon>{{ $t("header.changePassword") }}
@@ -19,21 +17,26 @@
19 17
     </template>
20 18
   </el-dropdown>
21 19
   <!-- infoDialog -->
22
-  <InfoDialog ref="infoRef"></InfoDialog>
20
+  <!-- <InfoDialog ref="infoRef"></InfoDialog> -->
23 21
   <!-- passwordDialog -->
24 22
   <PasswordDialog ref="passwordRef"></PasswordDialog>
25 23
 </template>
26 24
 <!--文件-->
27 25
 <script setup lang="ts">
28 26
 import { ref } from "vue";
27
+import { computed } from "vue";
28
+
29 29
 import { LOGIN_URL } from "@/config";
30 30
 import { useRouter } from "vue-router";
31 31
 // import { logoutApi } from "@/api/modules/login";
32
-// import { useUserStore } from "@/stores/modules/user";
33 32
 import { ElMessageBox, ElMessage } from "element-plus";
34
-import InfoDialog from "./InfoDialog.vue";
33
+// import InfoDialog from "./InfoDialog.vue";
35 34
 import PasswordDialog from "./PasswordDialog.vue";
36 35
 // import { useCookies } from "@vueuse/integrations/useCookies";
36
+import { useUserStore } from "@/stores/modules/user";
37
+
38
+const userStore = useUserStore();
39
+const avatar = computed(() => userStore.avatar);
37 40
 
38 41
 const router = useRouter();
39 42
 // const userStore = useUserStore();
@@ -64,10 +67,10 @@ const logout = () => {
64 67
 };
65 68
 
66 69
 // 打开修改密码和个人信息弹窗
67
-const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
70
+// const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
68 71
 const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null);
69 72
 const openDialog = (ref: string) => {
70
-  if (ref == "infoRef") infoRef.value?.openDialog();
73
+  if (ref == "infoRef") router.push("/userinformation");
71 74
   if (ref == "passwordRef") passwordRef.value?.openDialog();
72 75
 };
73 76
 </script>

+ 1
- 1
src/layouts/components/Header/components/Message.vue 파일 보기

@@ -62,7 +62,7 @@
62 62
     </el-popover>
63 63
   </div>
64 64
 </template>
65
-
65
+<!--    -->
66 66
 <script setup lang="ts">
67 67
 import { ref } from "vue";
68 68
 const activeName = ref("first");

+ 1
- 0
src/layouts/components/Header/components/PasswordDialog.vue 파일 보기

@@ -112,6 +112,7 @@ const getselectaccountNumber = async () => {
112 112
   userdata.value = data;
113 113
   loginForm.username = userdata.value.user.userName;
114 114
   userStore.setUserInfo({ name: loginForm.username });
115
+  userStore.setUseravatar(userdata.value.user.avatar);
115 116
 };
116 117
 // dialogVisible = false
117 118
 

+ 1
- 0
src/stores/interface/index.ts 파일 보기

@@ -29,6 +29,7 @@ export interface GlobalState {
29 29
 export interface UserState {
30 30
   token: string;
31 31
   userInfo: { name: string };
32
+  avatar: string;
32 33
 }
33 34
 
34 35
 /* tabsMenuProps */

+ 5
- 1
src/stores/modules/user.ts 파일 보기

@@ -6,7 +6,8 @@ export const useUserStore = defineStore({
6 6
   id: "geeker-user",
7 7
   state: (): UserState => ({
8 8
     token: "",
9
-    userInfo: { name: "" }
9
+    userInfo: { name: "" },
10
+    avatar: ""
10 11
   }),
11 12
   getters: {},
12 13
   actions: {
@@ -17,6 +18,9 @@ export const useUserStore = defineStore({
17 18
     // Set setUserInfo
18 19
     setUserInfo(userInfo: UserState["userInfo"]) {
19 20
       this.userInfo = userInfo;
21
+    },
22
+    setUseravatar(avatar: string) {
23
+      this.avatar = avatar;
20 24
     }
21 25
   },
22 26
   persist: piniaPersistConfig("geeker-user")

+ 6
- 0
src/styles/element.scss 파일 보기

@@ -260,3 +260,9 @@
260 260
 .el-pagination.is-background .el-pager li.is-active {
261 261
   background-color: #0052d9;
262 262
 }
263
+.Space_content {
264
+  display: inline-block;
265
+  width: auto;
266
+  min-width: 160px;
267
+  color: #000000;
268
+}

+ 0
- 183
src/views/Administration/addition copy.vue 파일 보기

@@ -1,183 +0,0 @@
1
-<template>
2
-  <div>
3
-    <div class="card content-box">
4
-      <div class="name">{{ supertype }}</div>
5
-      <el-divider />
6
-      <div class="user_box">
7
-        <div class="user_left">
8
-          <el-form ref="formRef" :model="numberValidateForm" label-width="auto" class="demo-ruleForm">
9
-            <div class="elform">
10
-              <el-form-item label="模板名称:" prop="postName" :rules="[{ required: true, message: '请输入模板名称' }]">
11
-                <el-input
12
-                  v-model.number="numberValidateForm.postName"
13
-                  style="width: 300px"
14
-                  size="large"
15
-                  type="text"
16
-                  placeholder="请输入模板名称"
17
-                  autocomplete="off"
18
-                />
19
-              </el-form-item>
20
-              <el-form-item label="电站名称:">
21
-                <el-input
22
-                  v-model.number="numberValidateForm.postCode"
23
-                  style="width: 300px"
24
-                  size="large"
25
-                  type="text"
26
-                  placeholder="请输入电站名称"
27
-                  autocomplete="off"
28
-                />
29
-              </el-form-item>
30
-            </div>
31
-            <div class="elform">
32
-              <el-form-item label="模板状态:">
33
-                <el-radio-group v-model="numberValidateForm.status">
34
-                  <el-radio value="0">正常</el-radio>
35
-                  <el-radio value="1">停用</el-radio>
36
-                </el-radio-group>
37
-              </el-form-item>
38
-            </div>
39
-
40
-            <div class="elform1">
41
-              <!-- <el-form-item label="标签:">
42
-                <el-input
43
-                  v-model.number="numberValidateForm.remark"
44
-                  style="width: 300px"
45
-                  size="large"
46
-                  type="text"
47
-                  placeholder="请输入标签"
48
-                  autocomplete="off"
49
-                />
50
-              </el-form-item> -->
51
-              <el-button type="primary" @click="addNewRow">新增行</el-button>
52
-              <el-table :data="tableData" style="width: 100%" v-loading="loading" border @row-click="handleRowClick">
53
-                <el-table-column prop="name" label="姓名"></el-table-column>
54
-                <el-table-column prop="age" label="年龄"></el-table-column>
55
-                <el-table-column prop="email" label="邮箱"></el-table-column>
56
-                <el-table-column label="操作">
57
-                  <template #default="{ row }">
58
-                    <el-button type="text" @click="editRow(row)">编辑</el-button>
59
-                    <el-button type="text" @click="deleteRow(row)">删除</el-button>
60
-                  </template>
61
-                </el-table-column>
62
-              </el-table>
63
-            </div>
64
-            <el-divider />
65
-            <el-form-item class="bottom">
66
-              <el-button type="primary" @click="submitForm(formRef)">保存</el-button>
67
-              <el-button @click="resetForm(formRef)">关闭</el-button>
68
-            </el-form-item>
69
-          </el-form>
70
-        </div>
71
-      </div>
72
-    </div>
73
-  </div>
74
-</template>
75
-
76
-<script setup lang="ts">
77
-import { platformpostadd, platformpostedit, platformshupostedit } from "@/api/home/Multisite";
78
-import { FormInstance } from "element-plus";
79
-import { onMounted, reactive, ref } from "vue";
80
-import { useRouter, useRoute } from "vue-router";
81
-import { nextTick } from "vue";
82
-
83
-const router = useRouter();
84
-const route = useRoute();
85
-
86
-const formRef = ref<FormInstance>();
87
-const supertype = ref(route.query.type);
88
-
89
-const numberValidateForm = reactive({
90
-  id: route.query.id,
91
-  parentId: "",
92
-  postName: "",
93
-  postCode: "",
94
-  postSort: "",
95
-  remark: "",
96
-  status: "0"
97
-});
98
-
99
-const submitForm = (formEl: FormInstance | undefined) => {
100
-  if (!formEl) return;
101
-  formEl.validate(async valid => {
102
-    if (valid) {
103
-      if (route.query.type == "岗位新增") {
104
-        const { data } = await platformpostadd(numberValidateForm);
105
-        console.log(data);
106
-      } else {
107
-        const { data } = await platformpostedit(numberValidateForm);
108
-        console.log(data);
109
-      }
110
-      router.back();
111
-    } else {
112
-      console.log("error submit!");
113
-      return false;
114
-    }
115
-  });
116
-};
117
-
118
-const resetForm = (formEl: FormInstance | undefined) => {
119
-  if (!formEl) return;
120
-  formEl.resetFields();
121
-  router.push("/post/index");
122
-};
123
-const yonghueditdata = ref();
124
-const getghuedit = async () => {
125
-  const { data } = await platformshupostedit(route.query.id);
126
-  yonghueditdata.value = data;
127
-  console.log(yonghueditdata.value);
128
-  numberValidateForm.postName = yonghueditdata.value.post.postName;
129
-  numberValidateForm.postCode = yonghueditdata.value.post.postCode;
130
-  numberValidateForm.postSort = yonghueditdata.value.post.postSort;
131
-  numberValidateForm.remark = yonghueditdata.value.post.remark;
132
-  numberValidateForm.status = yonghueditdata.value.post.status;
133
-};
134
-interface TableDataItem {
135
-  name: string;
136
-  age: number;
137
-  email: string;
138
-}
139
-const loading = ref(false);
140
-const addNewRow = () => {
141
-  const newRow = ref<TableDataItem>({
142
-    name: "",
143
-    age: 0,
144
-    email: ""
145
-  });
146
-  tableData.push(newRow.value);
147
-
148
-  nextTick(() => {
149
-    const tableBody = document.querySelector(".el-table__body-wrapper");
150
-    if (tableBody) {
151
-      tableBody.scrollTop = tableBody.scrollHeight;
152
-    }
153
-  });
154
-};
155
-const tableData = reactive<TableDataItem[]>([
156
-  { name: "张三", age: 30, email: "zhangsan@example.com" },
157
-  { name: "李四", age: 25, email: "lisi@example.com" },
158
-  { name: "王五", age: 28, email: "wangwu@example.com" }
159
-  // ...其他数据
160
-]);
161
-
162
-const editRow = (row: TableDataItem) => {
163
-  console.log(row);
164
-
165
-  // 编辑行的逻辑,可以根据实际情况进行实现
166
-};
167
-const deleteRow = (row: TableDataItem) => {
168
-  console.log(row);
169
-  // 删除行的逻辑,可以根据实际情况进行实现
170
-};
171
-const handleRowClick = (row: TableDataItem) => {
172
-  console.log(row);
173
-  // 点击行的处理逻辑,可以根据实际情况进行实现
174
-};
175
-onMounted(() => {
176
-  if (route.query.type == "岗位编辑") {
177
-    getghuedit();
178
-  }
179
-});
180
-</script>
181
-<style scoped lang="scss">
182
-@import "./addition.scss";
183
-</style>

+ 0
- 1
src/views/Administration/addition.scss 파일 보기

@@ -16,7 +16,6 @@
16 16
   display: flex;
17 17
   justify-content: space-between;
18 18
   width: 100%;
19
-  padding: 0 200px;
20 19
   margin-bottom: 10px;
21 20
 }
22 21
 .elformleft {

+ 122
- 94
src/views/Administration/addition.vue 파일 보기

@@ -6,37 +6,6 @@
6 6
       <div class="user_box">
7 7
         <div class="user_left">
8 8
           <el-form ref="formRef" :model="numberValidateForm" label-width="auto" class="demo-ruleForm">
9
-            <div class="elform">
10
-              <el-form-item label="模板名称:" prop="postName" :rules="[{ required: true, message: '请输入模板名称' }]">
11
-                <el-input
12
-                  v-model.number="numberValidateForm.postName"
13
-                  style="width: 300px"
14
-                  size="large"
15
-                  type="text"
16
-                  placeholder="请输入模板名称"
17
-                  autocomplete="off"
18
-                />
19
-              </el-form-item>
20
-              <el-form-item label="电站名称:">
21
-                <el-input
22
-                  v-model.number="numberValidateForm.postCode"
23
-                  style="width: 300px"
24
-                  size="large"
25
-                  type="text"
26
-                  placeholder="请输入电站名称"
27
-                  autocomplete="off"
28
-                />
29
-              </el-form-item>
30
-            </div>
31
-            <div class="elform">
32
-              <el-form-item label="模板状态:">
33
-                <el-radio-group v-model="numberValidateForm.status">
34
-                  <el-radio value="0">正常</el-radio>
35
-                  <el-radio value="1">停用</el-radio>
36
-                </el-radio-group>
37
-              </el-form-item>
38
-            </div>
39
-
40 9
             <div class="elform1">
41 10
               <!-- <el-form-item label="标签:">
42 11
                 <el-input
@@ -48,22 +17,73 @@
48 17
                   autocomplete="off"
49 18
                 />
50 19
               </el-form-item> -->
51
-              <el-button type="primary" @click="addNewRow">新增行</el-button>
20
+              <div class="elform">
21
+                <el-form-item label="模板名称:" prop="postName" :rules="[{ required: true, message: '请输入模板名称' }]">
22
+                  <el-input
23
+                    v-model.number="numberValidateForm.postName"
24
+                    style="width: 300px"
25
+                    size="large"
26
+                    type="text"
27
+                    placeholder="请输入模板名称"
28
+                    autocomplete="off"
29
+                  />
30
+                </el-form-item>
31
+                <el-button type="primary" @click="addNewRow">新增行</el-button>
32
+              </div>
52 33
               <div class="elform"></div>
53
-              <el-table :data="tableData" border style="width: 100%" @row-click="handleRowClick">
54
-                <el-table-column prop="date" label="日期" width="180">
34
+              <el-table :data="tableData" border style="width: 100%">
35
+                <el-table-column prop="startTime" label="开始时段">
36
+                  <template #default="scope">
37
+                    <!-- <el-input v-model="scope.row.startTime" @change="handleEdit(scope.$index, scope.row)"></el-input> -->
38
+                    <el-time-select
39
+                      v-model="scope.row.startTime"
40
+                      start="00:00"
41
+                      step="00:30"
42
+                      end="24:00"
43
+                      placeholder="选择开始时段"
44
+                    />
45
+                  </template>
46
+                </el-table-column>
47
+                <el-table-column prop="endTime" label="结束时段">
55 48
                   <template #default="scope">
56
-                    <el-input v-model="scope.row.date" @change="handleEdit(scope.$index, scope.row)"></el-input>
49
+                    <!-- <el-input v-model="scope.row.endTime" @change="handleEdit(scope.$index, scope.row)"></el-input> -->
50
+                    <el-time-select
51
+                      v-model="scope.row.endTime"
52
+                      start="00:00"
53
+                      step="00:30"
54
+                      end="24:00"
55
+                      placeholder="选择结束时段"
56
+                    />
57 57
                   </template>
58 58
                 </el-table-column>
59
-                <el-table-column prop="name" label="姓名" width="180">
59
+                <el-table-column prop="periodType" label="峰值">
60 60
                   <template #default="scope">
61
-                    <el-input v-model="scope.row.name" @change="handleEdit(scope.$index, scope.row)"></el-input>
61
+                    <!-- <el-input v-model="scope.row.periodType" @change="handleEdit(scope.$index, scope.row)"></el-input> -->
62
+                    <el-select
63
+                      v-model="scope.row.periodType"
64
+                      collapse-tags
65
+                      placeholder="选择尖峰平谷"
66
+                      popper-class="custom-header"
67
+                      :max-collapse-tags="1"
68
+                      size="large"
69
+                    >
70
+                      <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
71
+                    </el-select>
62 72
                   </template>
63 73
                 </el-table-column>
64
-                <el-table-column prop="address" label="地址">
74
+                <el-table-column prop="buyPrice" label="买入电价(元/kWh)">
65 75
                   <template #default="scope">
66
-                    <el-input v-model="scope.row.address" @change="handleEdit(scope.$index, scope.row)"></el-input>
76
+                    <el-input v-model="scope.row.buyPrice" type="number"></el-input>
77
+                  </template>
78
+                </el-table-column>
79
+                <el-table-column prop="salePrice" label="卖出电价(元/kWh)">
80
+                  <template #default="scope">
81
+                    <el-input v-model="scope.row.salePrice" type="number"></el-input>
82
+                  </template>
83
+                </el-table-column>
84
+                <el-table-column label="操作" width="80">
85
+                  <template #default="scope">
86
+                    <div @click="handleEdit(scope.$index)">删除</div>
67 87
                   </template>
68 88
                 </el-table-column>
69 89
               </el-table>
@@ -81,82 +101,99 @@
81 101
 </template>
82 102
 
83 103
 <script setup lang="ts">
84
-import { platformpostadd, platformpostedit, platformshupostedit } from "@/api/home/Multisite";
104
+import { insertschedule } from "@/api/home/Multisite";
85 105
 import { FormInstance } from "element-plus";
86
-import { onMounted, reactive, ref } from "vue";
106
+import { reactive, ref } from "vue";
87 107
 import { useRouter, useRoute } from "vue-router";
88 108
 import { nextTick } from "vue";
109
+import { ElMessage } from "element-plus";
89 110
 
90 111
 const router = useRouter();
91 112
 const route = useRoute();
92 113
 
93 114
 const formRef = ref<FormInstance>();
94 115
 const supertype = ref(route.query.type);
95
-
116
+const options = ref([
117
+  {
118
+    value: 1,
119
+    label: "尖"
120
+  },
121
+  {
122
+    value: 2,
123
+    label: "峰"
124
+  },
125
+  {
126
+    value: 3,
127
+    label: "平"
128
+  },
129
+  {
130
+    value: 4,
131
+    label: "谷"
132
+  }
133
+]);
96 134
 const numberValidateForm = reactive({
97
-  id: route.query.id,
98
-  parentId: "",
99
-  postName: "",
100
-  postCode: "",
101
-  postSort: "",
102
-  remark: "",
103
-  status: "0"
135
+  postName: ""
104 136
 });
105 137
 
106 138
 const submitForm = (formEl: FormInstance | undefined) => {
139
+  console.log(tableData);
107 140
   if (!formEl) return;
141
+
108 142
   formEl.validate(async valid => {
109 143
     if (valid) {
110
-      if (route.query.type == "岗位新增") {
111
-        const { data } = await platformpostadd(numberValidateForm);
112
-        console.log(data);
113
-      } else {
114
-        const { data } = await platformpostedit(numberValidateForm);
115
-        console.log(data);
116
-      }
117
-      router.back();
144
+      if (!validateData()) return;
145
+      const { data } = await insertschedule(tableData, numberValidateForm.postName);
146
+      console.log(data);
147
+      router.push({ path: "/Administration/index", query: { id: "模板管理" } });
118 148
     } else {
119 149
       console.log("error submit!");
120 150
       return false;
121 151
     }
122 152
   });
123 153
 };
154
+const validateData = () => {
155
+  if (tableData.length == 0) {
156
+    ElMessage({ type: "error", message: `请填写电价模板表格` });
157
+    return false;
158
+  }
159
+  for (const row of tableData) {
160
+    if (
161
+      row.startTime === undefined ||
162
+      row.endTime === undefined ||
163
+      row.periodType == "" ||
164
+      row.buyPrice == "" ||
165
+      row.salePrice == ""
166
+    ) {
167
+      // message.error("所有字段都必须填写");
168
+      ElMessage({ type: "error", message: `所有字段都必须填写` });
124 169
 
170
+      return false;
171
+    }
172
+  }
173
+  return true;
174
+};
125 175
 const resetForm = (formEl: FormInstance | undefined) => {
126 176
   if (!formEl) return;
127 177
   formEl.resetFields();
128
-  router.push("/Administration/index");
129
-};
130
-const yonghueditdata = ref();
131
-const getghuedit = async () => {
132
-  const { data } = await platformshupostedit(route.query.id);
133
-  yonghueditdata.value = data;
134
-  console.log(yonghueditdata.value);
135
-  numberValidateForm.postName = yonghueditdata.value.post.postName;
136
-  numberValidateForm.postCode = yonghueditdata.value.post.postCode;
137
-  numberValidateForm.postSort = yonghueditdata.value.post.postSort;
138
-  numberValidateForm.remark = yonghueditdata.value.post.remark;
139
-  numberValidateForm.status = yonghueditdata.value.post.status;
178
+  router.push({ path: "/Administration/index", query: { id: "模板管理" } });
140 179
 };
180
+
141 181
 interface TableData {
142
-  date: string;
143
-  name: string;
144
-  address: string;
182
+  startTime: string;
183
+  endTime: string;
184
+  periodType: string;
185
+  buyPrice: string;
186
+  salePrice: string;
145 187
 }
146
-const tableData = reactive<TableData[]>([
147
-  {
148
-    date: "2016-05-02",
149
-    name: "王小虎",
150
-    address: "上海市普陀区金沙江路 1518 弄"
151
-  }
152
-  // ...其他数据
153
-]);
188
+const tableData = reactive<TableData[]>([]);
154 189
 // 新增行
155 190
 const addNewRow = () => {
156 191
   const newRow = ref<TableData>({
157
-    date: "",
158
-    name: "",
159
-    address: ""
192
+    startTime: "",
193
+    endTime: "",
194
+    periodType: "",
195
+    buyPrice: "",
196
+    salePrice: ""
160 197
   });
161 198
   tableData.push(newRow.value);
162 199
 
@@ -167,19 +204,10 @@ const addNewRow = () => {
167 204
     }
168 205
   });
169 206
 };
170
-const handleEdit = (index: number, row: TableData) => {
207
+const handleEdit = (index: number) => {
171 208
   // 处理编辑逻辑,例如更新数据源或发送请求
172
-  console.log(index, row);
173
-};
174
-const handleRowClick = (row: TableData) => {
175
-  console.log(row);
176
-  // 点击行的处理逻辑,可以根据实际情况进行实现
209
+  tableData.splice(index, 1);
177 210
 };
178
-onMounted(() => {
179
-  if (route.query.type == "岗位编辑") {
180
-    getghuedit();
181
-  }
182
-});
183 211
 </script>
184 212
 <style scoped lang="scss">
185 213
 @import "./addition.scss";

+ 200
- 2
src/views/Administration/index.scss 파일 보기

@@ -2,9 +2,56 @@
2 2
 * {
3 3
   font-size: 14px;
4 4
 }
5
+.Space_content {
6
+  .select {
7
+    min-width: 100px;
8
+    .el-input__inner {
9
+      padding-right: 20px;
10
+      padding-left: 15px;
11
+      font-weight: 600;
12
+      background-color: transparent;
13
+      border: none;
14
+    }
15
+    &:hover {
16
+      cursor: pointer;
17
+      background-color: rgb(46 46 56 / 8%);
18
+      border-radius: 5px;
19
+    }
20
+    .el-icon-arrow-up::before {
21
+      color: #000000;
22
+      content: "\e78f";
23
+    }
24
+    .el-input__suffix {
25
+      top: -2px;
26
+      right: 0;
27
+    }
28
+    .el-input__prefix {
29
+      position: relative;
30
+      left: 0;
31
+      box-sizing: border-box;
32
+      height: 32px;
33
+      padding: 0 30px;
34
+      line-height: 35px;
35
+      visibility: hidden;
36
+    }
37
+    input {
38
+      position: absolute;
39
+    }
40
+  }
41
+  .el-input {
42
+    width: auto !important;
43
+  }
44
+}
5 45
 .title {
6 46
   display: flex;
7 47
   :deep(.el-select__wrapper) {
48
+    .el-select__prefix {
49
+      color: #000000 !important;
50
+    }
51
+    .el-select__selected-item {
52
+      font-size: 22px;
53
+    }
54
+
8 55
     background-color: rgb(0 0 0 / 0%);
9 56
     box-shadow: 0 0 0 0 !important;
10 57
 
@@ -24,7 +71,7 @@
24 71
   // 自定义el-select的下拉箭头
25 72
   :deep(.el-select__caret) {
26 73
     /* 为下拉小箭头留出一点位置,避免被文字覆盖 */
27
-    padding-right: 14px;
74
+    padding-right: 10px;
28 75
 
29 76
     /* 很关键:将默认的select选择框样式清除 */
30 77
     appearance: none;
@@ -108,9 +155,20 @@
108 155
   color: #0052d9;
109 156
   cursor: pointer;
110 157
 }
158
+.bodycheckbox {
159
+  margin-top: 16px;
160
+  margin-right: 12px;
161
+}
111 162
 .eltable {
112 163
   margin-top: 30px;
113 164
 }
165
+.eltable1 {
166
+  box-sizing: border-box;
167
+  margin-top: 30px;
168
+}
169
+.eltabledialog {
170
+  margin-top: 30px;
171
+}
114 172
 .eltable_right {
115 173
   display: flex;
116 174
   align-items: center;
@@ -127,6 +185,7 @@
127 185
 }
128 186
 .dialog_title {
129 187
   display: flex;
188
+  width: 100%;
130 189
   margin-top: 20px;
131 190
 }
132 191
 .more_name {
@@ -134,6 +193,7 @@
134 193
   color: #777777;
135 194
 }
136 195
 .more_theme {
196
+  width: 100%;
137 197
   color: #000000;
138 198
 }
139 199
 .dialog_name {
@@ -150,10 +210,148 @@
150 210
   margin-bottom: 10px;
151 211
 }
152 212
 .dialog_footer {
153
-  margin-top: 20px;
213
+  display: flex;
214
+  align-items: center;
215
+  justify-content: center;
154 216
 }
155 217
 .pagination {
156 218
   display: flex;
157 219
   justify-content: space-between;
158 220
   margin-top: 20px;
159 221
 }
222
+.templatebox {
223
+  width: 100%;
224
+}
225
+.overview_title {
226
+  display: flex;
227
+  width: 100%;
228
+  margin-top: 40px;
229
+}
230
+.overview_title1 {
231
+  display: flex;
232
+}
233
+.dialog {
234
+  display: flex;
235
+  align-items: center;
236
+  justify-content: center;
237
+  width: 100%;
238
+  margin-top: 40px;
239
+}
240
+.dialog_box {
241
+  box-sizing: border-box;
242
+  display: flex;
243
+  flex-direction: column;
244
+  width: 834px;
245
+  border-bottom: solid #222222 0.1px;
246
+  border-left: solid #222222 0.1px;
247
+}
248
+.overview_tiem {
249
+  display: flex;
250
+  flex-direction: column;
251
+  width: 100px;
252
+  margin-top: 40px;
253
+}
254
+.dialog_box1 {
255
+  display: flex;
256
+  align-items: center;
257
+  justify-content: center;
258
+  width: 100px;
259
+  height: 60px;
260
+  border-top: solid #222222 0.1px;
261
+  border-right: solid #222222 0.1px;
262
+}
263
+.overview_dox1 {
264
+  display: flex;
265
+  align-items: center;
266
+  justify-content: center;
267
+  width: 60px;
268
+  height: 60px;
269
+  border-top: solid #222222 0.1px;
270
+  border-right: solid #222222 0.1px;
271
+}
272
+.dialog_box11 {
273
+  display: flex;
274
+  border-top: solid #222222 0.1px;
275
+
276
+  // border-bottom: solid #222222 0.1px;
277
+}
278
+.dialog_box111 {
279
+  box-sizing: border-box;
280
+  display: flex;
281
+}
282
+.dialog_box12 {
283
+  display: flex;
284
+  flex-direction: column;
285
+}
286
+.dialog_box121 {
287
+  display: flex;
288
+}
289
+.overview_dox {
290
+  display: flex;
291
+  align-items: center;
292
+  justify-content: center;
293
+  width: 60px;
294
+  height: 60px;
295
+  background-color: #000000;
296
+}
297
+.overview_1dox {
298
+  display: flex;
299
+  align-items: center;
300
+  justify-content: center;
301
+  width: 60px;
302
+  height: 60px;
303
+  color: #000000;
304
+  background-color: #efb786;
305
+
306
+  // border-top: solid #222222 0.1px;
307
+  border-right: solid #222222 0.1px;
308
+}
309
+.overview_2dox {
310
+  display: flex;
311
+  align-items: center;
312
+  justify-content: center;
313
+  width: 60px;
314
+  height: 60px;
315
+  color: #000000;
316
+  background-color: #c35e0e;
317
+
318
+  // border-top: solid #222222 0.1px;
319
+  border-right: solid #222222 0.1px;
320
+}
321
+.overview_3dox {
322
+  display: flex;
323
+  align-items: center;
324
+  justify-content: center;
325
+  width: 60px;
326
+  height: 60px;
327
+  color: #000000;
328
+  background-color: #fde696;
329
+
330
+  // border-top: solid #222222 0.1px;
331
+
332
+  border-right: solid #222222 0.1px;
333
+}
334
+.overview_4dox {
335
+  display: flex;
336
+  align-items: center;
337
+  justify-content: center;
338
+  width: 60px;
339
+  height: 60px;
340
+  color: #000000;
341
+  background-color: #b6c6e8;
342
+
343
+  // border-top: solid #222222 0.1px;
344
+  border-right: solid #222222 0.1px;
345
+}
346
+.overview_5dox {
347
+  display: flex;
348
+  align-items: center;
349
+  justify-content: center;
350
+  width: 60px;
351
+  height: 60px;
352
+  color: #000000;
353
+  background-color: #cccccc;
354
+
355
+  // border-top: solid #222222 0.1px;
356
+  border-right: solid #222222 0.1px;
357
+}

+ 348
- 49
src/views/Administration/index.vue 파일 보기

@@ -2,15 +2,20 @@
2 2
   <div>
3 3
     <div class="title">
4 4
       <el-select
5
+        v-if="activeName == '电价配置'"
5 6
         v-model="Singlevalue"
6 7
         collapse-tags
7 8
         placeholder="选择电站"
8 9
         popper-class="custom-header"
9 10
         :max-collapse-tags="1"
10
-        style="width: 300px"
11 11
         size="large"
12
+        class="Space_content"
12 13
         @change="postersDevice"
13 14
       >
15
+        <template #prefix>
16
+          {{ (cities.find(s => s.id === Singlevalue) || {}).stationName }}
17
+        </template>
18
+
14 19
         <el-option v-for="(item, index) in cities" :key="index" :label="item.stationName" :value="item.id" />
15 20
       </el-select>
16 21
     </div>
@@ -21,38 +26,48 @@
21 26
             <el-card>
22 27
               <div class="price_allocation">
23 28
                 <el-icon><WarningFilled /></el-icon>&ensp;
24
-                为对应月份选择模板后,请点击“绑定”按钮以完成应用。更换模板前请先点击”解绑”按钮,才可重新选择
29
+                请点击“绑定”按钮为对应月份选择模板以完成应用。更换模板前请点击”解绑”按钮,才可重新“绑定”
25 30
               </div>
26 31
             </el-card>
27 32
 
28 33
             <div class="datepicker">
29
-              年份:
30
-              <el-date-picker
31
-                v-model="pickervalue"
32
-                type="year"
33
-                placeholder="选择时间"
34
-                size="large"
35
-                clearable
36
-                :disabled-date="pickerOptions"
37
-                @change="pickerincome"
38
-              />
34
+              <div>
35
+                年份:
36
+                <el-date-picker
37
+                  v-model="pickervalue"
38
+                  type="year"
39
+                  placeholder="选择时间"
40
+                  size="large"
41
+                  clearable
42
+                  :disabled-date="pickerOptions"
43
+                  @change="pickerincome"
44
+                />
45
+              </div>
46
+              <el-button type="primary" @click="onoverview()" size="large">总览</el-button>
39 47
             </div>
40 48
             <div class="all_ocation">
41 49
               <div class="allocation_1" v-for="(item, index) in tricitylist" :key="index">
42 50
                 <div class="header" :style="index % 4 == 0 ? 'border-left: 1px solid #ebeef5;' : ''">{{ item.imonth }}月</div>
43 51
                 <div class="body" :style="index % 4 == 0 ? 'border-left: 1px solid #ebeef5;' : ''">
44 52
                   <div class="body_content">{{ item.tmplName }}</div>
45
-                  <div class="bodycheck" @click="oncheck(item.stationTmplId)">查看</div>
53
+                  <div>
54
+                    <div>
55
+                      <el-button v-if="item.start == 1" type="primary" plain @click="configuration(item.tariffId)" size="small">
56
+                        查看
57
+                      </el-button>
58
+                    </div>
59
+                    <div class="bodycheckbox">
60
+                      <el-button type="primary" v-if="item.start == 1" plain @click="onUnbind(item)" size="small">
61
+                        解绑
62
+                      </el-button>
63
+                      <el-button type="primary" v-else plain @click="ondetermine(item)" size="small">绑定</el-button>
64
+                    </div>
65
+                  </div>
46 66
                 </div>
47 67
               </div>
48 68
             </div>
49 69
           </el-tab-pane>
50 70
           <el-tab-pane label="模板管理" name="模板管理">
51
-            <el-card>
52
-              <div class="price_allocation">
53
-                <el-icon><WarningFilled /></el-icon>&ensp; 点击“引用模板”按钮,可将“公共模板”中的电价模板直接引用至当前页面下!
54
-              </div>
55
-            </el-card>
56 71
             <div class="datepicker">
57 72
               <div>
58 73
                 <el-button type="primary" size="large" color="#0052d9" @click="newaddition">新增</el-button>
@@ -69,7 +84,7 @@
69 84
               </div>
70 85
             </div>
71 86
 
72
-            <div class="eltable">
87
+            <div class="eltable templatebox">
73 88
               <el-table :data="tmplpagedata.records" border style="width: 100%" :show-overflow-tooltip="true">
74 89
                 <el-table-column prop="name" label="模板名称" />
75 90
                 <el-table-column prop="isUsing" label="状态" align="center" width="140">
@@ -81,21 +96,13 @@
81 96
                 <el-table-column prop="tags" label="标签" />
82 97
                 <el-table-column prop="createUserName" label="创建人" width="140" />
83 98
                 <el-table-column prop="createTime" label="创建时间" />
84
-                <el-table-column prop="stationTmplId" label="操作" width="140">
99
+                <el-table-column prop="tariffId" label="操作" width="140">
85 100
                   <template #default="scope">
86 101
                     <el-button class="bodycheck" @click="oncheck(scope.row.id)">查看</el-button>
87 102
                   </template>
88 103
                 </el-table-column>
89 104
               </el-table>
90 105
             </div>
91
-            <!-- <div class="eltable_right">
92
-              共&ensp;{{ tmplpagedata.records.length }}&ensp;
93
-              <el-pagination
94
-                layout="prev, pager, next"
95
-                :total="tmplpagedata.records.length"
96
-                @change="changemultiStationpagebase"
97
-              />
98
-            </div> -->
99 106
             <div class="pagination">
100 107
               <div></div>
101 108
               <slot name="pagination">
@@ -112,8 +119,8 @@
112 119
     </div>
113 120
     <el-dialog v-model="dialogVisible" title="模板详情" width="1000" :before-close="handleClose" border>
114 121
       <div class="dialog_title">
115
-        <div class="more_name">电站名称:</div>
116
-        <div class="more_theme">{{ tytmplpagedetails.name }}</div>
122
+        <div class="more_name">模板名称:</div>
123
+        <div class="more_theme">{{ tytmplpagedetails.data[0].name }}</div>
117 124
       </div>
118 125
       <div class="dialog_title">
119 126
         <div class="more_name">模板状态:</div>
@@ -133,11 +140,12 @@
133 140
         <div class="more_name">模板标签:</div>
134 141
         <div class="more_theme">-</div>
135 142
       </div>
136
-      <div class="eltable">
137
-        <el-table :data="tytmplpagedetails.scheduleVOS" border style="width: 1000px">
143
+      <div class="eltable1">
144
+        <el-table :data="tytmplpagedetails.scheduleVOS" border style="height: 300px">
138 145
           <el-table-column label="开始时间——结束时间" width="180" align="center">
139 146
             <template #default="scope">
140
-              <span>{{ scope.row.startTime }}</span> - <span>{{ scope.row.endTime }}</span>
147
+              <span>{{ scope.row.startTime }}</span> -
148
+              <span>{{ scope.row.endTime }}</span>
141 149
             </template>
142 150
           </el-table-column>
143 151
 
@@ -159,17 +167,119 @@
159 167
         </div>
160 168
       </template>
161 169
     </el-dialog>
170
+    <el-dialog v-model="dialogtmptariff" title="模板详情" width="1000" :before-close="handleClose" border>
171
+      <div class="dialog_title">
172
+        <div class="more_name">模板名称:</div>
173
+        <div class="more_theme">{{ tytmpltariff.data[0].name }}</div>
174
+      </div>
175
+      <div class="dialog_title">
176
+        <div class="more_name">模板状态:</div>
177
+        <div class="more_theme">使用中</div>
178
+      </div>
179
+      <div class="dialog_title">
180
+        <div class="more_name">使用情况:</div>
181
+        <div class="more_theme">
182
+          <div class="dialog_11">
183
+            <div class="dialog_1" v-for="(item, index) in tytmpltariff.stationUsing" :key="index">
184
+              <span class="dialog_name">{{ item.tmplName }}</span>
185
+            </div>
186
+          </div>
187
+        </div>
188
+      </div>
189
+      <div class="dialog_title">
190
+        <div class="more_name">模板标签:</div>
191
+        <div class="more_theme">-</div>
192
+      </div>
193
+      <div class="eltable1">
194
+        <el-table :data="tytmpltariff.scheduleVOS" border style="height: 300px">
195
+          <el-table-column label="开始时间——结束时间" width="180" align="center">
196
+            <template #default="scope">
197
+              <span>{{ scope.row.startTime }}</span> -
198
+              <span>{{ scope.row.endTime }}</span>
199
+            </template>
200
+          </el-table-column>
201
+
202
+          <el-table-column prop="periodType" label="时段" width="180" align="center">
203
+            <template #default="scope">
204
+              <div v-if="scope.row.periodType == 2">峰</div>
205
+              <div v-if="scope.row.periodType == 1">尖</div>
206
+              <div v-if="scope.row.periodType == 4">谷</div>
207
+              <div v-if="scope.row.periodType == 3">平</div>
208
+            </template>
209
+          </el-table-column>
210
+          <el-table-column prop="buyPrice" label="买入电价(元/kWh)" align="center" />
211
+          <el-table-column prop="salePrice" label="卖出电价(元/kWh)" align="center" />
212
+        </el-table>
213
+      </div>
214
+      <template #footer>
215
+        <div class="dialog_footer">
216
+          <el-button type="primary" @click="dialogtmptariff = false" color="#0052d9"> 确定 </el-button>
217
+        </div>
218
+      </template>
219
+    </el-dialog>
220
+    <el-dialog v-model="overview" title="电价时段总览" top="5vh" :before-close="handoverview" border>
221
+      <div class="dialog">
222
+        <div class="dialog_box">
223
+          <div class="dialog_box111">
224
+            <div class="dialog_box1">时段</div>
225
+            <div class="overview_dox1" v-for="(itme, index) in headers" :key="index">{{ itme }}</div>
226
+          </div>
227
+          <div class="overview_title1" v-for="(item, index) in poweroverdata" :key="index">
228
+            <div class="dialog_box1">{{ item.time }}- {{ getNextTime(index) }}</div>
229
+            <div class="overview_title1">
230
+              <div class="dialog_box11" v-for="(items, a) in 12" :key="a">
231
+                <div class="overview_1dox" v-if="poweroverdata[index][items] == 1">高峰</div>
232
+                <div class="overview_2dox" v-if="poweroverdata[index][items] == 2">尖峰</div>
233
+                <div class="overview_3dox" v-if="poweroverdata[index][items] == 3">平段</div>
234
+                <div class="overview_4dox" v-if="poweroverdata[index][items] == 4">低谷</div>
235
+                <div class="overview_5dox" v-if="poweroverdata[index][items] == ''"></div>
236
+              </div>
237
+            </div>
238
+          </div>
239
+        </div>
240
+      </div>
241
+
242
+      <template #footer>
243
+        <div class="dialog_footer">
244
+          <el-button type="primary" @click="overview = false" color="#0052d9"> 确定 </el-button>
245
+        </div>
246
+      </template>
247
+    </el-dialog>
248
+    <!--    -->
249
+    <el-dialog v-model="binding" title="绑定" :before-close="handbinding" width="600" border>
250
+      <div class="overview_title">
251
+        <div>模板名称:</div>
252
+        <el-select v-model="onbindingvalue" filterable placeholder="请绑定模板名称" style="width: 300px" size="large">
253
+          <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
254
+        </el-select>
255
+      </div>
256
+
257
+      <template #footer>
258
+        <div class="dialog_footer">
259
+          <el-button type="primary" @click="onbinding" color="#0052d9"> 确定 </el-button>
260
+        </div>
261
+      </template>
262
+    </el-dialog>
162 263
   </div>
163 264
 </template>
164
-<!---  --->
265
+<!--    -->
165 266
 <script setup lang="ts">
166 267
 import { onMounted, Ref, ref } from "vue";
167
-import { stationstationName, electricitylist, electricitytmplpage, electricitytmplpagedetails } from "@/api/home/Multisite";
168
-import { Station } from "@/api/interface";
268
+import {
269
+  stationstationName,
270
+  electricitylist,
271
+  electricitytmplpage,
272
+  electricitytmplpagedetails,
273
+  insertscheduletariffURL,
274
+  selectelectURL,
275
+  selectpoweroverviewURL,
276
+  electricitytmptariff
277
+} from "@/api/home/Multisite";
278
+import { other, Station } from "@/api/interface";
169 279
 import Pagination from "@/components/ProTable/components/Pagination.vue";
170
-import { useRouter } from "vue-router";
280
+import { useRouter, useRoute } from "vue-router";
171 281
 const router = useRouter();
172
-
282
+const route = useRoute();
173 283
 const currentDate = ref();
174 284
 const Singlevalue = ref("");
175 285
 const cities: Ref<Station.todo[]> = ref([]);
@@ -198,15 +308,19 @@ const handleClick = async (val: any) => {
198 308
   }
199 309
 };
200 310
 // 电价配置
201
-const activeName = ref("电价配置");
311
+const activeName: Ref<any> = ref("");
312
+const currentYear = new Date().getFullYear();
313
+console.log(currentYear);
314
+
202 315
 const pickervalue = ref();
316
+pickervalue.value = currentYear + "";
203 317
 const pickerOptions = (time: { getTime: (arg0: Date) => number }) => {
204 318
   return time.getTime(new Date()) > Date.now();
205 319
 };
206 320
 // 选择日期
207 321
 const pickerincome = async (val: any) => {
208 322
   if (val == null) {
209
-    pickervalue.value = "";
323
+    pickervalue.value = currentYear;
210 324
   } else {
211 325
     pickervalue.value = formatDate(val);
212 326
   }
@@ -233,23 +347,54 @@ const tricitylist: Ref<Station.electricity[]> = ref([]);
233 347
 const getelectricitylist = async () => {
234 348
   const { data } = await electricitylist({}, Singlevalue.value);
235 349
   tricitylist.value = data;
350
+  getselectpoweroverview();
236 351
 };
237
-// 电价配置详情
352
+// 模板管理查看
353
+const dialogVisible = ref();
354
+const oncheck = (tariffId: any) => {
355
+  getelectricitytmplpagedetails(tariffId);
356
+  dialogVisible.value = true;
357
+};
358
+// 模板配置详情
238 359
 const tytmplpagedetails = ref();
239
-const getelectricitytmplpagedetails = async (stationTmplId?: any) => {
240
-  const { data } = await electricitytmplpagedetails({}, Singlevalue.value, stationTmplId);
360
+const getelectricitytmplpagedetails = async (tariffId?: any) => {
361
+  const { data } = await electricitytmplpagedetails({}, tariffId);
241 362
   tytmplpagedetails.value = data;
242 363
 };
364
+// 电价配置查看
365
+const dialogtmptariff = ref();
366
+const configuration = (tariffId: any) => {
367
+  onelectricitytmptariff(tariffId);
368
+  dialogtmptariff.value = true;
369
+};
370
+const tytmpltariff = ref();
371
+const onelectricitytmptariff = async (tariffId?: any) => {
372
+  const { data } = await electricitytmptariff({}, tariffId);
373
+  tytmpltariff.value = data;
374
+};
243 375
 
244
-const dialogVisible = ref();
245
-const oncheck = (stationTmplId: any) => {
246
-  getelectricitytmplpagedetails(stationTmplId);
247
-  dialogVisible.value = true;
376
+// 解绑弹窗
377
+const gettariffid = ref();
378
+const onUnbind = (itme: any) => {
379
+  gettariffid.value = itme.tariffId;
380
+  startvalue.value = 1;
381
+  onbindingvalue.value = itme.tmplId;
382
+  onbinding();
383
+};
384
+// 绑定弹窗
385
+const ondetermine = (itme: any) => {
386
+  gettariffid.value = itme.tariffId;
387
+  onbindingvalue.value = itme.tmplId;
388
+  startvalue.value = 0;
389
+
390
+  binding.value = true;
248 391
 };
249 392
 const handleClose = () => {
250 393
   dialogVisible.value = false;
394
+  dialogtmptariff.value = false;
251 395
 };
252 396
 // 模板管理表格数据
397
+//
253 398
 const tmplpagedata = ref();
254 399
 const keyword = ref("");
255 400
 const gettmplpage = async () => {
@@ -258,7 +403,7 @@ const gettmplpage = async () => {
258 403
     pn: pageable.value.pn,
259 404
     ps: pageable.value.ps
260 405
   };
261
-  const { data } = await electricitytmplpage(obj, Singlevalue.value);
406
+  const { data } = await electricitytmplpage(obj);
262 407
 
263 408
   tmplpagedata.value = data;
264 409
   pageable.value.total = tmplpagedata.value.total;
@@ -295,15 +440,169 @@ const newaddition = () => {
295 440
     }
296 441
   });
297 442
 };
443
+// 年份总览
444
+const overview = ref(false);
445
+const onoverview = () => {
446
+  overview.value = true;
447
+};
448
+const handoverview = () => {
449
+  overview.value = false;
450
+};
451
+// 绑定
452
+const binding = ref(false);
453
+const handbinding = () => {
454
+  binding.value = false;
455
+};
456
+// const value = ref("");
457
+const options = ref();
458
+// 绑定列表
459
+const onbindingvalue = ref("");
460
+
461
+const getselectelect = async () => {
462
+  let obj = {
463
+    name: ""
464
+  };
465
+  const { data } = await selectelectURL(obj);
466
+  options.value = data;
467
+};
468
+// 绑定确认弹窗
469
+const startvalue = ref();
470
+const onbinding = async () => {
471
+  let obj = {
472
+    tmplId: onbindingvalue.value,
473
+    start: startvalue.value,
474
+    tariffId: gettariffid.value
475
+  };
476
+  await insertscheduletariffURL(obj);
477
+  binding.value = false;
478
+  getelectricitylist();
479
+};
480
+// 电价总览
481
+let poweroverdata = ref();
482
+const headers = ref(["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"]); // 表头数据
483
+
484
+const getselectpoweroverview = async () => {
485
+  let obj = {
486
+    powerId: Singlevalue.value,
487
+    year: pickervalue.value
488
+  };
489
+  const { data } = await selectpoweroverviewURL(obj);
490
+  // poweroverdata.value = data.data;
491
+
492
+  const dato: other.Select = data;
493
+
494
+  const getdata = [
495
+    ...dato[1],
496
+    ...dato[2],
497
+    ...dato[3],
498
+    ...dato[4],
499
+    ...dato[5],
500
+    ...dato[6],
501
+    ...dato[7],
502
+    ...dato[8],
503
+    ...dato[9],
504
+    ...dato[10],
505
+    ...dato[11],
506
+    ...dato[12]
507
+  ];
508
+  interface TableRow {
509
+    time: string;
510
+    [key: number]: string; // 列以月份为键
511
+  }
512
+  // 处理数据
513
+  const timeSlots = [
514
+    "00:00",
515
+    "00:30",
516
+    "01:00",
517
+    "01:30",
518
+    "02:00",
519
+    "02:30",
520
+    "03:00",
521
+    "03:30",
522
+    "04:00",
523
+    "04:30",
524
+    "05:30",
525
+    "05:30",
526
+    "06:00",
527
+    "06:30",
528
+    "07:00",
529
+    "07:30",
530
+    "08:00",
531
+    "08:30",
532
+    "09:00",
533
+    "09:30",
534
+    "10:00",
535
+    "10:30",
536
+    "11:00",
537
+    "11:30",
538
+    "12:00",
539
+    "12:30",
540
+    "13:00",
541
+    "13:30",
542
+    "14:00",
543
+    "14:30",
544
+    "15:00",
545
+    "15:30",
546
+    "16:00",
547
+    "16:30",
548
+    "17:00",
549
+    "17:30",
550
+    "18:00",
551
+    "18:30",
552
+    "19:00",
553
+    "19:30",
554
+    "20:00",
555
+    "20:30",
556
+    "21:00",
557
+    "21:30",
558
+    "22:00",
559
+    "22:30",
560
+    "23:00",
561
+    "23:30"
562
+  ];
563
+  const months = Array.from({ length: 12 }, (_, i) => i + 1);
564
+  // 初始化表格
565
+  const table: TableRow[] = timeSlots.map(time => ({
566
+    time,
567
+    ...months.reduce((acc, month) => ({ ...acc, [month]: "" }), {})
568
+  }));
569
+
570
+  // 填充表格
571
+  getdata.forEach(item => {
572
+    const rowIndex = timeSlots.indexOf(item.startTime);
573
+    if (rowIndex !== -1) {
574
+      table[rowIndex][item.imonth] = item.periodType;
575
+    }
576
+  });
577
+  console.log(table);
578
+  poweroverdata.value = table;
579
+  // 输出结果
580
+};
581
+// 计算下一个时间的函数
582
+const getNextTime = (index: number) => {
583
+  const nextIndex = index + 1;
584
+  if (nextIndex < poweroverdata.value.length) {
585
+    return poweroverdata.value[nextIndex].time;
586
+  } else {
587
+    return "24:00";
588
+  }
589
+};
298 590
 onMounted(() => {
299 591
   const current = localStorage.getItem("currentDate");
300 592
   if (current) {
301 593
     currentDate.value = current;
302 594
   }
303 595
   poststationstationName();
596
+  if (route.query.id) {
597
+    activeName.value = route.query.id;
598
+    gettmplpage();
599
+  } else {
600
+    activeName.value = "电价配置";
601
+  }
602
+  getselectelect();
304 603
 });
305 604
 </script>
306 605
 <style scoped lang="scss">
307 606
 @import "./index.scss";
308 607
 </style>
309
-<!-- -->
608
+<!-- 电量配置 -- 模板查看 -->

+ 7
- 0
src/views/Alarm/index.scss 파일 보기

@@ -6,6 +6,13 @@
6 6
 .title {
7 7
   display: flex;
8 8
   :deep(.el-select__wrapper) {
9
+    .el-select__prefix {
10
+      color: #000000 !important;
11
+    }
12
+    .el-select__selected-item {
13
+      font-size: 22px;
14
+    }
15
+
9 16
     background-color: rgb(0 0 0 / 0%);
10 17
     box-shadow: 0 0 0 0 !important;
11 18
 

+ 11
- 5
src/views/Alarm/index.vue 파일 보기

@@ -7,24 +7,30 @@
7 7
         placeholder="选择电站"
8 8
         popper-class="custom-header"
9 9
         :max-collapse-tags="1"
10
-        style="width: 300px"
10
+        class="Space_content"
11 11
         size="large"
12 12
         @change="postemsDevice"
13 13
       >
14
-        <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
14
+        <el-option v-for="(item, index) in cities" :key="index" :label="item.stationName" :value="item.id" />
15
+        <template #prefix>
16
+          {{ (cities.find(s => s.id === Singlevalue) || {}).stationName }}
17
+        </template>
15 18
       </el-select>
16 19
       <div class="title_"></div>
17 20
       <el-select
18 21
         v-model="emsDeviceId"
19 22
         collapse-tags
20
-        placeholder="选择设备编号"
23
+        placeholder="选择编号"
21 24
         popper-class="custom-header"
22 25
         :max-collapse-tags="1"
23
-        style="width: 240px"
26
+        class="Space_content"
24 27
         size="large"
25 28
         @change="getstationrealtime"
26 29
       >
27
-        <el-option v-for="(item, index) in emsDevice" :key="index" :label="item.emsDeviceId" :value="item.id" />
30
+        <template #prefix>
31
+          {{ (emsDevice.find(s => s.id === emsDeviceId) || {}).id }}
32
+        </template>
33
+        <el-option v-for="item in emsDevice" :key="item.id" :label="item.emsDeviceId" :value="item.id" />
28 34
       </el-select>
29 35
     </div>
30 36
     <div class="faultalarm">

+ 1
- 1
src/views/department/index.vue 파일 보기

@@ -7,7 +7,7 @@
7 7
     <div class="card">
8 8
       <div class="screen">
9 9
         <div>
10
-          部门名称&ensp;&ensp;<el-input v-model="deptName" style="width: 375px" size="large" placeholder="输入角色名称" />
10
+          部门名称&ensp;&ensp;<el-input v-model="deptName" style="width: 375px" size="large" placeholder="输入部门名称" />
11 11
         </div>
12 12
 
13 13
         <div>

+ 73
- 0
src/views/equipment/index.scss 파일 보기

@@ -0,0 +1,73 @@
1
+.screen {
2
+  display: flex;
3
+  width: 100%;
4
+  margin-bottom: 20px;
5
+}
6
+.screen1 {
7
+  display: flex;
8
+  justify-content: space-between;
9
+  width: 100%;
10
+}
11
+.cardbottom {
12
+  margin-top: 20px;
13
+}
14
+.title {
15
+  display: flex;
16
+  align-items: center;
17
+  margin-bottom: 20px;
18
+  font-size: 18px;
19
+  .title_time {
20
+    margin-left: 10px;
21
+    font-size: 16px;
22
+  }
23
+}
24
+.pagination {
25
+  display: flex;
26
+  justify-content: space-between;
27
+  margin-top: 20px;
28
+}
29
+.btn-group {
30
+  display: flex;
31
+  gap: 10px; /* 按钮之间的间隔 */
32
+  align-items: center; /* 垂直居中按钮 */
33
+  justify-content: center; /* 水平居中按钮 */
34
+}
35
+.dialog_box {
36
+  display: flex;
37
+  align-items: center;
38
+  width: 100%;
39
+  padding: 20px 60px;
40
+  margin-top: 40px;
41
+}
42
+.dialog_box1 {
43
+  display: flex;
44
+  width: 100%;
45
+  padding: 20px 60px;
46
+  margin-top: 10px;
47
+}
48
+.dialog_box2 {
49
+  display: flex;
50
+  align-items: center;
51
+  width: 100%;
52
+  padding: 20px 60px;
53
+  margin-top: 10px;
54
+  margin-bottom: 10px;
55
+}
56
+.dialog_name {
57
+  display: flex;
58
+  margin-right: 20px;
59
+}
60
+.dialog_footer {
61
+  display: flex;
62
+  align-items: center;
63
+  justify-content: center;
64
+}
65
+.elimageurl {
66
+  display: flex;
67
+  overflow: hidden;
68
+  overflow: auto auto;
69
+}
70
+.Required {
71
+  width: 10px;
72
+  color: red;
73
+}

+ 282
- 0
src/views/equipment/index.vue 파일 보기

@@ -0,0 +1,282 @@
1
+<template>
2
+  <div>
3
+    <div class="title">
4
+      设备管理
5
+      <div class="title_time">{{ currentDate }}</div>
6
+    </div>
7
+    <div class="card">
8
+      <div class="screen">
9
+        <div>
10
+          选择电站&ensp;&ensp;<el-select v-model="Singlevalue" placeholder="选择电站" size="large" style="width: 240px">
11
+            <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
12
+          </el-select>
13
+        </div>
14
+        &ensp;&ensp; &ensp;&ensp;
15
+        <div>
16
+          设备名称&ensp;&ensp;<el-input v-model="emsdevicename" style="width: 300px" size="large" placeholder="输入设备名称" />
17
+        </div>
18
+        <!-- <div>
19
+          &ensp;&ensp;&ensp;&ensp;
20
+          岗位名称&ensp;&ensp;<el-input
21
+            v-model="postName"
22
+            style="width: 300px"
23
+            size="large"
24
+            placeholder="输入岗位名称"
25
+          />
26
+        </div> -->
27
+        &ensp;&ensp; &ensp;&ensp;
28
+        <div>
29
+          <el-button type="primary" size="large" color="#0052d9" @click="query(0)">查询</el-button>
30
+          <el-button size="large" @click="query(1)">重置</el-button>&ensp;&ensp;
31
+        </div>
32
+      </div>
33
+      <div class="screen1"></div>
34
+    </div>
35
+    <div class="card cardbottom">
36
+      <!-- <el-button type="primary" size="large" color="#0052d9" @click="newaddition">新增</el-button> -->
37
+
38
+      <div>&ensp;</div>
39
+      <el-table :data="tableData.records" style="width: 100%" border>
40
+        <el-table-column prop="eid" label="设备编号" />
41
+        <el-table-column prop="emsDeviceId" label="设备名称" />
42
+        <el-table-column prop="powerName" label="归属电站" />
43
+        <el-table-column prop="onlineStatus" label="绑定状态" align="center">
44
+          <template #default="scope">
45
+            <!-- <div v-if="scope.row.onlineStatus == 1">绑定</div>
46
+            <div v-else>未绑定</div> -->
47
+            <el-switch
48
+              v-model="scope.row.onlineStatus"
49
+              :active-value="1"
50
+              :inactive-value="0"
51
+              disabled
52
+              @change="changeswitch"
53
+              size="large"
54
+            />
55
+          </template>
56
+        </el-table-column>
57
+        <el-table-column prop="createTime" label="创建时间" />
58
+        <el-table-column prop="updateTime" label="修改时间" />
59
+        <!-- <el-table-column prop="updateTime" label="创建时间" /> -->
60
+        <el-table-column prop="onlineStatus" label="设备图片" align="center" width="200">
61
+          <template #default="scope">
62
+            <div class="elimageurl">
63
+              <div v-for="(item, index) in scope.row.url" :key="index">
64
+                <el-image
65
+                  style="width: 60px; height: 60px; margin-right: 10px"
66
+                  :src="item"
67
+                  :zoom-rate="1.2"
68
+                  :max-scale="7"
69
+                  :min-scale="0.2"
70
+                  :preview-teleported="true"
71
+                  :preview-src-list="scope.row.url"
72
+                  :initial-index="index"
73
+                  fit="cover"
74
+                />
75
+              </div>
76
+            </div>
77
+
78
+            <!-- <img v-for="(item, index) in scope.row.url" :key="index" :src="item" alt="" style="height: 60px" /> -->
79
+          </template>
80
+        </el-table-column>
81
+        <el-table-column label="操作" align="center">
82
+          <template #default="scope">
83
+            <el-button color="#0052d9" type="primary" @click="newition(scope.row)"> 编辑 </el-button>
84
+            <el-button v-if="BUTTONS.equipmentedit" color="#0052d9" type="primary" @click="newition(scope.row)"> 编辑 </el-button>
85
+            <!-- <el-button @click="onremove(scope.row)">删除</el-button> -->
86
+          </template>
87
+        </el-table-column>
88
+      </el-table>
89
+      <!-- 分页组件 -->
90
+      <div class="pagination">
91
+        <div></div>
92
+        <slot name="pagination">
93
+          <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
94
+        </slot>
95
+      </div>
96
+    </div>
97
+    <el-dialog v-model="dialogVisible" title="修改" width="1000" :before-close="handleClose" border>
98
+      <div class="dialog_box">
99
+        <div class="dialog_name"><span class="Required">*</span> 设备名称</div>
100
+        <el-input v-model="emsdeviceidname" style="width: 300px" size="large" placeholder="输入设备名称" />
101
+      </div>
102
+      <div class="dialog_box1">
103
+        <div class="dialog_name">上传图片</div>
104
+        <div>
105
+          <UploadImgs v-model:file-list="absoluteStationPicUr1" width="300px" :limit="9">
106
+            <template #empty>
107
+              <el-icon><Picture /></el-icon>
108
+              <span>请上传电站图片</span>
109
+            </template>
110
+            <template #tip>图片类型 __ jpg jpeg png</template>
111
+          </UploadImgs>
112
+        </div>
113
+      </div>
114
+      <div class="dialog_box2">
115
+        <div class="dialog_name">绑定状态</div>
116
+        <el-switch v-model="powerswitch" :active-value="1" :inactive-value="0" @change="changeswitch" size="large" />
117
+      </div>
118
+      <div class="dialog_box2">
119
+        <div class="dialog_name">
120
+          <span v-if="powerswitch == 1" class="Required">*</span>
121
+          <div v-if="powerswitch != 1" class="Required"></div>
122
+          绑定设备
123
+        </div>
124
+        <el-select v-model="powersvalue" placeholder="选择电站" size="large" style="width: 300px">
125
+          <el-option v-for="item in powerstation" :key="item.id" :label="item.stationName" :value="item.id" />
126
+        </el-select>
127
+      </div>
128
+      <template #footer>
129
+        <div class="dialog_footer">
130
+          <el-button type="primary" @click="determine" size="large" color="#0052d9"> 确定 </el-button>
131
+        </div>
132
+      </template>
133
+    </el-dialog>
134
+  </div>
135
+</template>
136
+<!--    -->
137
+<script setup lang="ts">
138
+import { selectemssytemNameURL, stationstationName, updateemssytemNameURL, selectemsNameURL } from "@/api/home/Multisite";
139
+import Pagination from "@/components/ProTable/components/Pagination.vue";
140
+import { onMounted, ref, Ref } from "vue";
141
+import { Station } from "@/api/interface";
142
+import UploadImgs from "@/components/Upload/Imgs.vue";
143
+import { useAuthButtons } from "@/hooks/useAuthButtons";
144
+import { ElNotification } from "element-plus";
145
+
146
+const { BUTTONS } = useAuthButtons();
147
+// 绑定设备
148
+const Singlevalue = ref("");
149
+const cities: Ref<Station.todo[]> = ref([]);
150
+// 编辑绑定设备
151
+const powersvalue = ref("");
152
+const powerswitch = ref();
153
+const powerstation: Ref<Station.todo[]> = ref([]);
154
+const absoluteStationPicUr1 = ref();
155
+
156
+const poststationstationName = async () => {
157
+  const { data } = await stationstationName({});
158
+  const res = await stationstationName({});
159
+  powerstation.value = res.data;
160
+  cities.value = data;
161
+  cities.value.unshift({
162
+    id: "",
163
+    stationName: "全部",
164
+    energyMgrMode: 0,
165
+    priceCfgMode: 0,
166
+    sortNo: 0,
167
+    timezone: ""
168
+  });
169
+  Singlevalue.value = data[0].id;
170
+};
171
+const query = (val: any) => {
172
+  if (val == 0) {
173
+    getplatformuserlist();
174
+  } else {
175
+    (emsdevicename.value = ""), (Singlevalue.value = "");
176
+    getplatformuserlist();
177
+  }
178
+};
179
+// 编辑
180
+const emsdeviceidname = ref();
181
+const emsId = ref();
182
+const dialogVisible = ref();
183
+const selectems = ref();
184
+const newition = async (row: { url: never[]; emsDeviceId: any; eid: any }) => {
185
+  console.log(row.eid);
186
+  const { data } = await selectemsNameURL(row.eid, {});
187
+  console.log(data);
188
+  selectems.value = data;
189
+  let elementurl = [];
190
+  for (let index = 0; index < selectems.value.emsurl.length; index++) {
191
+    let element = {
192
+      url: selectems.value.emsurl[index]
193
+    };
194
+    elementurl.push(element);
195
+  }
196
+  console.log(elementurl);
197
+
198
+  absoluteStationPicUr1.value = elementurl; // 设备图片
199
+  emsdeviceidname.value = selectems.value.emsDeviceId; //设备名称
200
+  emsId.value = selectems.value.eid; // 设备id
201
+  powersvalue.value = selectems.value.pid; // 绑定电站
202
+  powerswitch.value = selectems.value.onlineStatus; // 绑定状态
203
+  dialogVisible.value = true;
204
+};
205
+
206
+const changeswitch = async (e: any) => {
207
+  if (e == 0) {
208
+    powersvalue.value = "";
209
+  }
210
+  console.log(e);
211
+};
212
+// 确定
213
+const determine = async () => {
214
+  if (powerswitch.value == 1) {
215
+    if (powersvalue.value == "") {
216
+      ElNotification({
217
+        title: "温馨提示",
218
+        message: "请选择电站并绑定!",
219
+        type: "warning"
220
+      });
221
+      return;
222
+    }
223
+  }
224
+  let obj = {
225
+    emsName: emsdeviceidname.value,
226
+    emsId: emsId.value,
227
+    imageurl: absoluteStationPicUr1.value.map((item: { url: any }) => item.url).join(","),
228
+    binding: powerswitch.value,
229
+    powerId: powersvalue.value
230
+  };
231
+  const { data } = await updateemssytemNameURL(obj);
232
+  console.log(data);
233
+  getplatformuserlist();
234
+  dialogVisible.value = false;
235
+};
236
+// 弹出取消
237
+const handleClose = () => {
238
+  dialogVisible.value = false;
239
+};
240
+const tableData = ref();
241
+const emsdevicename = ref("");
242
+const pageable = ref({
243
+  pn: 1,
244
+  ps: 10,
245
+  total: 0
246
+});
247
+const getplatformuserlist = async () => {
248
+  let obj = {
249
+    powerId: Singlevalue.value, //查询电站id
250
+    emsdeviceId: emsdevicename.value, // 设备名称
251
+    pn: pageable.value.pn,
252
+    ps: pageable.value.ps
253
+  };
254
+  const { data } = await selectemssytemNameURL(obj);
255
+  tableData.value = data;
256
+  pageable.value.total = tableData.value.total;
257
+};
258
+// 表格操作 Hooks
259
+const handleSizeChange = async (e: any) => {
260
+  pageable.value.ps = e;
261
+  getplatformuserlist();
262
+};
263
+const handleCurrentChange = async (e: any) => {
264
+  pageable.value.pn = e;
265
+
266
+  getplatformuserlist();
267
+};
268
+
269
+const currentDate = ref();
270
+onMounted(() => {
271
+  const current = localStorage.getItem("currentDate");
272
+  if (current) {
273
+    currentDate.value = current;
274
+  }
275
+  getplatformuserlist();
276
+  poststationstationName();
277
+});
278
+</script>
279
+<style scoped lang="scss">
280
+@import "./index.scss";
281
+</style>
282
+<!-- -->

+ 152
- 17
src/views/home/index.vue 파일 보기

@@ -18,12 +18,12 @@
18 18
               </div>
19 19
             </div>
20 20
             <div class="overview_line">
21
-              在线{{ multiStation.stationTotalCount }}个 \ 离线{{ multiStation.stationOfflineCount }}
21
+              在线 {{ multiStation.stationOnlineCount }} 个 \ 离线 {{ multiStation.stationOfflineCount }} 
22 22
             </div>
23 23
             <el-divider />
24 24
             <div class="overview_line">
25
-              装机功率: {{ (multiStation.installedPower * 1).toFixed(2) }}MWh | 装机容量:
26
-              {{ (multiStation.installedPower * 1).toFixed(2) }} MWh
25
+              装机功率: {{ formatAmountkwh(multiStation.installedPower) }} {{ formatCompany(multiStation.installedPower) }} |
26
+              装机容量: {{ formatAmountkwh(multiStation.installedCap) }} {{ formatCompany(multiStation.installedCap) }}
27 27
             </div>
28 28
           </div>
29 29
         </el-card>
@@ -35,15 +35,23 @@
35 35
               <div class="overview_title_name">今日充电量</div>
36 36
             </div>
37 37
             <div class="overview_title">
38
-              <div class="overview_titlename">{{ multiStation.dayImportKwh }} <span class="overview_unit"> MWh</span></div>
38
+              <div class="overview_titlename">
39
+                {{ formatAmountkwh(multiStation.dayImportKwh) }}
40
+                <span class="overview_unit"> {{ formatCompany(multiStation.dayImportKwh) }}</span>
41
+              </div>
39 42
               <div class="overview_img1">
40 43
                 <img src="../../assets/images/charging.png" alt="站点" />
41 44
               </div>
42 45
             </div>
43
-            <div class="overview_line">较昨日下降: {{ multiStation.importKwhDiffYDay }} MWh</div>
46
+            <div class="overview_line">
47
+              较昨日下降: {{ formatAmountkwh_(multiStation.importKwhDiffYDay) }}
48
+              {{ formatCompany_(multiStation.importKwhDiffYDay) }}
49
+            </div>
44 50
             <el-divider />
45 51
             <div class="overview_line">
46
-              月充电: {{ multiStation.monthImportKwh }}MWh | 累计充电: {{ multiStation.accumulativeImportKwh }} MWh
52
+              本月充电: {{ formatAmountkwh(multiStation.monthImportKwh) }} {{ formatCompany(multiStation.monthImportKwh) }} |
53
+              累计充电: {{ formatAmountkwh(multiStation.accumulativeImportKwh) }}
54
+              {{ formatCompany(multiStation.accumulativeImportKwh) }}
47 55
             </div>
48 56
           </div>
49 57
         </el-card>
@@ -55,15 +63,23 @@
55 63
               <div class="overview_title_name">今日放电量</div>
56 64
             </div>
57 65
             <div class="overview_title">
58
-              <div class="overview_titlename">{{ multiStation.dayExportKwh }}<span class="overview_unit"> MWh</span></div>
66
+              <div class="overview_titlename">
67
+                {{ formatAmountkwh(multiStation.dayExportKwh) }}
68
+                <span class="overview_unit"> {{ formatCompany(multiStation.dayExportKwh) }}</span>
69
+              </div>
59 70
               <div class="overview_img2">
60 71
                 <img src="../../assets/images/discharge.png" alt="站点" />
61 72
               </div>
62 73
             </div>
63
-            <div class="overview_line">较昨日下降: {{ multiStation.exportKwhDiffYDay }} MWh</div>
74
+            <div class="overview_line">
75
+              较昨日下降: {{ formatAmountkwh_(multiStation.exportKwhDiffYDay) }}
76
+              {{ formatCompany_(multiStation.exportKwhDiffYDay) }}
77
+            </div>
64 78
             <el-divider />
65 79
             <div class="overview_line">
66
-              月充电: {{ multiStation.monthExportKwh }} MWh | 累计充电: {{ multiStation.accumulativeExportKwh }} MWh
80
+              本月充电: {{ formatAmountkwh(multiStation.monthExportKwh) }} {{ formatCompany(multiStation.monthExportKwh) }} |
81
+              累计充电: {{ formatAmountkwh(multiStation.accumulativeExportKwh) }}
82
+              {{ formatCompany(multiStation.accumulativeExportKwh) }}
67 83
             </div>
68 84
           </div>
69 85
         </el-card>
@@ -75,15 +91,21 @@
75 91
               <div class="overview_title_name">今日收益</div>
76 92
             </div>
77 93
             <div class="overview_title">
78
-              <div class="overview_titlename">{{ multiStation.todayProfit }} <span class="overview_unit">元</span></div>
94
+              <div class="overview_titlename">
95
+                {{ formatAmount(multiStation.todayProfit) }}
96
+                <span class="overview_unit"> {{ formatAmounts(multiStation.todayProfit) }}</span>
97
+              </div>
79 98
               <div class="overview_img3">
80 99
                 <img src="../../assets/images/qian.png" alt="站点" />
81 100
               </div>
82 101
             </div>
83
-            <div class="overview_line">较昨日下降: {{ multiStation.profitDiffYDay }} 万元</div>
102
+            <div class="overview_line">
103
+              较昨日下降: {{ formatAmount1(multiStation.profitDiffYDay) }} {{ formatAmounts2(multiStation.profitDiffYDay) }}
104
+            </div>
84 105
             <el-divider />
85 106
             <div class="overview_line">
86
-              本月收益: {{ multiStation.monthProfit }}万元 | 总收益: {{ multiStation.totalProfit }}万元
107
+              本月收益: {{ formatAmount(multiStation.monthProfit) }} {{ formatAmounts(multiStation.monthProfit) }} | 总收益:
108
+              {{ formatAmount(multiStation.totalProfit) }} {{ formatAmounts(multiStation.totalProfit) }}
87 109
             </div>
88 110
           </div>
89 111
         </el-card>
@@ -113,6 +135,7 @@
113 135
                 end-placeholder="结束时间"
114 136
                 :default-value="value2"
115 137
                 :disabled-date="pickerOptions"
138
+                @change="pickerincome"
116 139
               />
117 140
             </div>
118 141
           </div>
@@ -133,7 +156,7 @@
133 156
     <el-card>
134 157
       <template #header>
135 158
         <div class="card-header">
136
-          <span>系统列表</span>
159
+          <span>设备列表</span>
137 160
         </div>
138 161
       </template>
139 162
       <div class="cardtable">
@@ -167,7 +190,7 @@
167 190
         </el-table-column>
168 191
 
169 192
         <el-table-column prop="overallEfficiency" label="综合效率(%)" />
170
-        <el-table-column prop="dischargeCompletionRate" label="放电达成率(%)" />
193
+        <!-- <el-table-column prop="dischargeCompletionRate" label="放电达成率(%)" /> -->
171 194
         <el-table-column prop="yesterdayProfit" label="昨日收益(元)" />
172 195
         <el-table-column prop="totalProfit" label="总收益(万元)" />
173 196
       </el-table>
@@ -178,12 +201,12 @@
178 201
     </el-card>
179 202
   </div>
180 203
 </template>
204
+<!--    -->
181 205
 <script setup lang="ts">
182 206
 import { onMounted, ref } from "vue";
183 207
 import type { TabsPaneContext } from "element-plus";
184 208
 import * as echarts from "echarts";
185 209
 import Pagination from "@/components/ProTable/components/Pagination.vue";
186
-
187 210
 import {
188 211
   gethomesite,
189 212
   multiStationday,
@@ -219,6 +242,118 @@ const options = ref([
219 242
     label: "离线"
220 243
   }
221 244
 ]);
245
+const formatAmountkwh = (amount: number) => {
246
+  if (amount == undefined) {
247
+    return "1000";
248
+  }
249
+  if (amount < 1000) {
250
+    return amount.toFixed(2);
251
+  } else {
252
+    return (amount / 1000).toFixed(2);
253
+  }
254
+};
255
+const formatCompany = (amount: number) => {
256
+  if (amount == undefined) {
257
+    return "kWh";
258
+  }
259
+  if (amount < 1000) {
260
+    return "kWh";
261
+  } else {
262
+    return "MWh";
263
+  }
264
+};
265
+const formatAmountkwh_ = (amount: number) => {
266
+  if (amount == undefined) {
267
+    return "1000";
268
+  }
269
+  if (amount > -1000) {
270
+    return amount.toFixed(2);
271
+  } else {
272
+    return (amount / 1000).toFixed(2);
273
+  }
274
+};
275
+const formatCompany_ = (amount: number) => {
276
+  if (amount == undefined) {
277
+    return "kWh";
278
+  }
279
+  if (amount > -1000) {
280
+    return "kWh";
281
+  } else {
282
+    return "MWh";
283
+  }
284
+};
285
+const formatAmount = (amount: number) => {
286
+  if (amount == undefined) {
287
+    return "0";
288
+  }
289
+  if (amount < 10000) {
290
+    return amount.toFixed(2);
291
+  } else {
292
+    return (amount / 10000).toFixed(2);
293
+  }
294
+};
295
+const formatAmounts = (amount: number) => {
296
+  if (amount == undefined) {
297
+    return "元";
298
+  }
299
+  if (amount < 10000) {
300
+    return "元";
301
+  } else {
302
+    return "万元";
303
+  }
304
+};
305
+const formatAmount1 = (amount: number) => {
306
+  console.log(amount > -10000);
307
+
308
+  if (amount == undefined) {
309
+    return "0";
310
+  }
311
+  if (amount > -10000) {
312
+    return amount.toFixed(2);
313
+  } else {
314
+    return (amount / 10000).toFixed(2);
315
+  }
316
+};
317
+const formatAmounts2 = (amount: number) => {
318
+  console.log(amount);
319
+
320
+  if (amount == undefined) {
321
+    return "元";
322
+  }
323
+  if (amount > -10000) {
324
+    return "元";
325
+  } else {
326
+    return "万元";
327
+  }
328
+};
329
+const pickerincome = (value: any) => {
330
+  value2.value = [formatDate(value[0]), formatDate(value[1])];
331
+  if (tabpropslabel.value == "收益统计") {
332
+    getmultiStation(); // 收益统计图
333
+    getmultiStationtopday(); // 收益排名图
334
+
335
+    getmultiStationMonth(); // 收益统计图
336
+    getmultiStationtopMonth(); // 收益排名图
337
+  } else {
338
+    getmultiStatiopower(); // 充放电统计图
339
+    getmultiStatiopowerMonth();
340
+  }
341
+};
342
+const formatDate = (dateString: string | number | Date) => {
343
+  const date = new Date(dateString);
344
+
345
+  // 提取年、月、日、时、分信息
346
+  const year = date.getFullYear();
347
+  const month = String(date.getMonth() + 1).padStart(2, "0"); // 月份从0开始,需要加1,并确保是两位数
348
+  const day = String(date.getDate()).padStart(2, "0"); // 确保是两位数
349
+  const hours = String(date.getHours()).padStart(2, "0"); // 确保是两位数
350
+  const minutes = String(date.getMinutes()).padStart(2, "0"); // 确保是两位数
351
+
352
+  // 拼接成 "YYYY-MM-DD HH:MM" 格式
353
+  const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`;
354
+
355
+  return formattedDate;
356
+};
222 357
 const handleClick = (tab: TabsPaneContext) => {
223 358
   // if (baroption.value) {
224 359
   //   baroption.value.dispose(); //地图图表
@@ -232,7 +367,7 @@ const handleClick = (tab: TabsPaneContext) => {
232 367
     getmultiStatiopower();
233 368
   }
234 369
 };
235
-// 查询最近数据
370
+//
236 371
 const recently = (val: any) => {
237 372
   // 获取当前日期
238 373
   recentlytype.value = val;
@@ -414,7 +549,7 @@ const baroptionchart = (dates: string[][], profits: { type: string }[]) => {
414 549
 
415 550
   baroptionvalue.setOption(option, true);
416 551
 };
417
-// 收益排名
552
+// 收益排名
418 553
 const getmultiStationtopday = async () => {
419 554
   const { data } = await multiStationtopday({ startDate: value2.value[0], endDate: value2.value[1] });
420 555
   let profitlist = [];

+ 15
- 0
src/views/incomeforms/index.scss 파일 보기

@@ -153,3 +153,18 @@
153 153
   width: 100%;
154 154
   min-height: 550px;
155 155
 }
156
+.tabpanesite {
157
+  display: flex;
158
+  align-items: center;
159
+  justify-content: space-between;
160
+}
161
+.dropdown {
162
+  display: flex;
163
+  align-items: center;
164
+  justify-content: center;
165
+  width: 100%;
166
+  margin: 20px 0;
167
+}
168
+.exportright {
169
+  margin-top: 40px;
170
+}

+ 469
- 74
src/views/incomeforms/index.vue 파일 보기

@@ -14,48 +14,84 @@
14 14
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
15 15
         <el-tab-pane label="站点汇总" name="站点汇总">
16 16
           <div class="tabdiv">
17
-            <div class="tabpane">
18
-              <div>时间范围:</div>
19
-              <div class="tabpane1">
20
-                <el-date-picker
21
-                  v-if="timetype != 'year'"
22
-                  v-model="timepicker"
23
-                  :type="timetype"
24
-                  start-placeholder="开始时间"
25
-                  end-placeholder="结束时间"
26
-                  :default-value="timepicker"
27
-                  :disabled-date="pickerOptions"
28
-                  @change="datepicker"
29
-                  size="large"
30
-                />
31
-                <YearPicker
32
-                  v-if="timetype == 'year'"
33
-                  style="width: 300px"
34
-                  ref="statisticPicker"
35
-                  :label-width="50"
36
-                  :init-year="dateValue"
37
-                  :start-year1="timepicker[0]"
38
-                  :end-year2="timepicker[1]"
39
-                  @update-time-range="updateStatisticYear"
40
-                />
41
-                <el-select
42
-                  v-model="daymonthyearvalue"
43
-                  placeholder="选择日期"
44
-                  size="large"
45
-                  style="width: 80px"
46
-                  @change="getdaymonthyear"
47
-                >
48
-                  <el-option v-for="item in daymonthyear" :key="item.value" :label="item.label" :value="item.value" />
49
-                </el-select>
17
+            <div class="tabpanesite">
18
+              <div class="tabpane">
19
+                <div>时间范围:</div>
20
+                <div class="tabpane1">
21
+                  <el-date-picker
22
+                    v-if="timetype != 'year'"
23
+                    v-model="timepicker"
24
+                    :type="timetype"
25
+                    start-placeholder="开始时间"
26
+                    end-placeholder="结束时间"
27
+                    :default-value="timepicker"
28
+                    :disabled-date="pickerOptions"
29
+                    @change="datepicker"
30
+                    size="large"
31
+                  />
32
+                  <YearPicker
33
+                    v-if="timetype == 'year'"
34
+                    style="width: 300px"
35
+                    ref="statisticPicker"
36
+                    :label-width="50"
37
+                    :init-year="dateValue"
38
+                    :start-year1="timepicker[0]"
39
+                    :end-year2="timepicker[1]"
40
+                    @update-time-range="updateStatisticYear"
41
+                  />
42
+                  <el-select
43
+                    v-model="daymonthyearvalue"
44
+                    placeholder="选择日期"
45
+                    size="large"
46
+                    style="width: 80px"
47
+                    @change="getdaymonthyear"
48
+                  >
49
+                    <el-option v-for="item in daymonthyear" :key="item.value" :label="item.label" :value="item.value" />
50
+                  </el-select>
51
+                </div>
52
+                &ensp;&ensp;
53
+                <el-button type="primary" size="large" color="#0052d9" @click="gatSummary">查询</el-button>
54
+                <el-button size="large" @click="onreset">重置</el-button>
55
+                <!-- <el-button v-if="BUTTONS.export" size="large" @click="onexport" type="primary" plain>导出</el-button> -->
56
+              </div>
57
+
58
+              <div v-if="BUTTONS.export" class="exportright">
59
+                <el-dropdown trigger="click" :hide-on-click="false" @visible-change="onclose">
60
+                  <el-button size="large" type="primary" plain>导出</el-button>
61
+                  <template #dropdown>
62
+                    <el-dropdown-menu v-for="(item, index) in columnList" :key="index">
63
+                      <el-dropdown-item>
64
+                        <el-checkbox @change="oncheck" v-model="item.ifcolumn" :label="item.label" size="large" />
65
+                        <template v-if="item.children">
66
+                          <template v-for="(items, i) in item.children" :key="i">
67
+                            <el-checkbox @change="onchildren" v-model="items.ifcolumn" :label="items.label" size="large" />
68
+                          </template>
69
+                        </template>
70
+                      </el-dropdown-item>
71
+                    </el-dropdown-menu>
72
+                    <div class="dropdown">
73
+                      <el-button @click="onexport" type="primary" plain>确定导出</el-button>
74
+                    </div>
75
+                  </template>
76
+                </el-dropdown>
50 77
               </div>
51
-              &ensp;&ensp;
52
-              <el-button type="primary" size="large" color="#0052d9" @click="gatSummary">查询</el-button>
53
-              <el-button size="large" @click="onreset">重置</el-button>
54
-              <el-button v-if="BUTTONS.export" size="large" @click="onexport" type="primary" plain>导出</el-button>
55 78
             </div>
56 79
             &ensp;&ensp;
57 80
 
58 81
             <el-table :data="tableData.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
82
+              <!-- <el-table-column type="selection" width="55" /> -->
83
+              <template v-for="(item, index) in columnList" :key="index">
84
+                <el-table-column v-if="item.ifcolumn" :label="item.label" :prop="item.prop" align="center">
85
+                  <template v-if="item.children">
86
+                    <template v-for="(items, i) in item.children" :key="i">
87
+                      <el-table-column v-if="items.ifcolumn" :label="items.label" :prop="items.prop" align="center">
88
+                      </el-table-column>
89
+                    </template>
90
+                  </template>
91
+                </el-table-column>
92
+              </template>
93
+              <!-- 
94
+            <el-table :data="tableData.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
59 95
               <el-table-column prop="stationName" label="站点名称" width="150" align="center" />
60 96
 
61 97
               <el-table-column label="充电量(kWh)" align="center">
@@ -73,6 +109,7 @@
73 109
                 <el-table-column prop="dischargeTotal" label="总" align="center" />
74 110
               </el-table-column>
75 111
               <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" />
112
+            </el-table> -->
76 113
             </el-table>
77 114
           </div>
78 115
         </el-tab-pane>
@@ -84,48 +121,80 @@
84 121
               <div :class="reportformsindex == 3 ? 'tabpane_2' : 'tabpane_1'" @click="onreportforms(3)">月报表</div>
85 122
               <div :class="reportformsindex == 4 ? 'tabpane_2' : 'tabpane_1'" @click="onreportforms(4)">年报表</div>
86 123
             </div>
87
-            <div class="selectsite">
88
-              <div class="tabpane_1">选择站点:</div>
89
-              <el-select v-model="Singlevalue" placeholder="Select" size="large" style="width: 240px" @change="postemsDevice">
90
-                <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
91
-              </el-select>
92
-              &ensp;&ensp;&ensp;&ensp; &ensp;&ensp;
93
-              <div class="tabpane_1">选择日期:</div>
94
-              <div>
95
-                <el-date-picker
96
-                  v-if="pickertype != 'year'"
97
-                  v-model="starttime"
98
-                  :type="pickertype"
99
-                  placeholder="选择时间"
100
-                  size="large"
101
-                  clearable
102
-                  :disabled-date="pickerOptions"
103
-                  @change="yearstarttime"
104
-                />
105
-                <YearPicker
106
-                  v-if="pickertype == 'year'"
107
-                  style="width: 300px"
108
-                  ref="statisticPicker"
109
-                  :label-width="50"
110
-                  :init-year="dateValue"
111
-                  :start-year1="starttime[0]"
112
-                  :end-year2="starttime[1]"
113
-                  @update-time-range="updateStatisticYear1"
114
-                />
124
+            <div class="tabpanesite">
125
+              <div class="selectsite">
126
+                <div class="tabpane_1">选择站点:</div>
127
+                <el-select v-model="Singlevalue" placeholder="选择站点" size="large" style="width: 240px" @change="postemsDevice">
128
+                  <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
129
+                </el-select>
130
+                &ensp;&ensp;&ensp;&ensp; &ensp;&ensp;
131
+                <div class="tabpane_1">选择日期:</div>
132
+                <div>
133
+                  <el-date-picker
134
+                    v-if="pickertype != 'year'"
135
+                    v-model="starttime"
136
+                    :type="pickertype"
137
+                    placeholder="选择时间"
138
+                    size="large"
139
+                    clearable
140
+                    :disabled-date="pickerOptions"
141
+                    @change="yearstarttime"
142
+                  />
143
+                  <YearPicker
144
+                    v-if="pickertype == 'year'"
145
+                    style="width: 300px"
146
+                    ref="statisticPicker"
147
+                    :label-width="50"
148
+                    :init-year="dateValue"
149
+                    :start-year1="starttime[0]"
150
+                    :end-year2="starttime[1]"
151
+                    @update-time-range="updateStatisticYear1"
152
+                  />
153
+                </div>
154
+                &ensp;&ensp;
155
+
156
+                <el-button type="primary" size="large" color="#0052d9" @click="onselectsite">查询</el-button>
157
+                <el-button size="large" @click="onselectreset">重置</el-button>
115 158
               </div>
116
-              &ensp;&ensp;
117 159
 
118
-              <el-button type="primary" size="large" color="#0052d9" @click="onselectsite">查询</el-button>
119
-              <el-button size="large" @click="onselectreset">重置</el-button>
120
-              <div style="margin-left: 14px" v-if="BUTTONS.export">
160
+              <!-- <div style="margin-left: 14px" v-if="BUTTONS.export">
121 161
                 <el-button size="large" @click="singleexport" type="primary" plain v-if="reportformsindex != 1">导出</el-button>
162
+              </div> -->
163
+              <div class="exportright" v-if="BUTTONS.export && reportformsindex != 1">
164
+                <el-dropdown trigger="click" :hide-on-click="false" @visible-change="onsingleclose">
165
+                  <el-button size="large" type="primary" plain>导出</el-button>
166
+                  <template #dropdown>
167
+                    <el-dropdown-menu v-for="(item, index) in singlecolumnList" :key="index">
168
+                      <el-dropdown-item>
169
+                        <el-checkbox @change="onsingle" v-model="item.ifcolumn" :label="item.label" size="large" />
170
+                        <template v-if="item.children">
171
+                          <template v-for="(items, i) in item.children" :key="i">
172
+                            <el-checkbox @change="onsinglechildren" v-model="items.ifcolumn" :label="items.label" size="large" />
173
+                          </template>
174
+                        </template>
175
+                      </el-dropdown-item>
176
+                    </el-dropdown-menu>
177
+                    <div class="dropdown">
178
+                      <el-button @click="singleexport" type="primary" plain>确定导出</el-button>
179
+                    </div>
180
+                  </template>
181
+                </el-dropdown>
122 182
               </div>
123 183
             </div>
124 184
 
125 185
             <div class="dailyreport">
126 186
               <el-table :data="betweenyear.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
127
-                <!-- <el-table-column prop="year" label="日期" width="150" align="center" /> -->
128
-                <el-table-column label="日期" width="150" align="center">
187
+                <template v-for="(item, index) in singlecolumnList" :key="index">
188
+                  <el-table-column v-if="item.ifcolumn" :label="item.label" :prop="item.prop" align="center">
189
+                    <template v-if="item.children">
190
+                      <template v-for="(items, i) in item.children" :key="i">
191
+                        <el-table-column v-if="items.ifcolumn" :label="items.label" :prop="items.prop" align="center">
192
+                        </el-table-column>
193
+                      </template>
194
+                    </template>
195
+                  </el-table-column>
196
+                </template>
197
+                <!-- <el-table-column label="日期" width="150" align="center">
129 198
                   <template #default="scope">
130 199
                     <div v-if="scope.row.ymd">{{ scope.row.ymd }}</div>
131 200
                     <div v-if="scope.row.ym">{{ scope.row.ym }}</div>
@@ -146,7 +215,7 @@
146 215
                   <el-table-column prop="dischargeValley" label="谷" align="center" />
147 216
                   <el-table-column prop="dischargeTotal" label="总" align="center" />
148 217
                 </el-table-column>
149
-                <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" />
218
+                <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" /> -->
150 219
               </el-table>
151 220
             </div>
152 221
           </div>
@@ -179,7 +248,164 @@ import { other, Station } from "@/api/interface";
179 248
 import { useAuthButtons } from "@/hooks/useAuthButtons";
180 249
 const { BUTTONS } = useAuthButtons();
181 250
 console.log(BUTTONS);
182
-
251
+// 表头
252
+const columnList = ref([
253
+  {
254
+    prop: "stationName",
255
+    label: "日期",
256
+    ifcolumn: true,
257
+    children: null
258
+  },
259
+  {
260
+    prop: "",
261
+    label: "充电量(kWh)",
262
+    ifcolumn: true,
263
+    children: [
264
+      {
265
+        prop: "chargeSharp",
266
+        label: "尖",
267
+        ifcolumn: true
268
+      },
269
+      {
270
+        prop: "chargePeak",
271
+        label: "峰",
272
+        ifcolumn: true
273
+      },
274
+      {
275
+        prop: "chargeShoulder",
276
+        label: "平",
277
+        ifcolumn: true
278
+      },
279
+      {
280
+        prop: "chargeValley",
281
+        label: "谷",
282
+        ifcolumn: true
283
+      },
284
+      {
285
+        prop: "chargeTotal",
286
+        label: "总",
287
+        ifcolumn: true
288
+      }
289
+    ]
290
+  },
291
+  {
292
+    prop: "",
293
+    label: "放电量(kWh)",
294
+    ifcolumn: true,
295
+    children: [
296
+      {
297
+        prop: "dischargeSharp",
298
+        label: "尖",
299
+        ifcolumn: true
300
+      },
301
+      {
302
+        prop: "dischargePeak",
303
+        label: "峰",
304
+        ifcolumn: true
305
+      },
306
+      {
307
+        prop: "dischargeShoulder",
308
+        label: "平",
309
+        ifcolumn: true
310
+      },
311
+      {
312
+        prop: "dischargeValley",
313
+        label: "谷",
314
+        ifcolumn: true
315
+      },
316
+      {
317
+        prop: "dischargeTotal",
318
+        label: "总",
319
+        ifcolumn: true
320
+      }
321
+    ]
322
+  },
323
+  {
324
+    prop: "overallEfficiency",
325
+    label: "综合效率(%)",
326
+    ifcolumn: true,
327
+    children: null
328
+  }
329
+]);
330
+// 单站报表表头
331
+const singlecolumnList = ref([
332
+  {
333
+    prop: "year",
334
+    label: "日期",
335
+    ifcolumn: true,
336
+    children: null
337
+  },
338
+  {
339
+    prop: "",
340
+    label: "充电量(kWh)",
341
+    ifcolumn: true,
342
+    children: [
343
+      {
344
+        prop: "chargeSharp",
345
+        label: "尖",
346
+        ifcolumn: true
347
+      },
348
+      {
349
+        prop: "chargePeak",
350
+        label: "峰",
351
+        ifcolumn: true
352
+      },
353
+      {
354
+        prop: "chargeShoulder",
355
+        label: "平",
356
+        ifcolumn: true
357
+      },
358
+      {
359
+        prop: "chargeValley",
360
+        label: "谷",
361
+        ifcolumn: true
362
+      },
363
+      {
364
+        prop: "chargeTotal",
365
+        label: "总",
366
+        ifcolumn: true
367
+      }
368
+    ]
369
+  },
370
+  {
371
+    prop: "",
372
+    label: "放电量(kWh)",
373
+    ifcolumn: true,
374
+    children: [
375
+      {
376
+        prop: "dischargeSharp",
377
+        label: "尖",
378
+        ifcolumn: true
379
+      },
380
+      {
381
+        prop: "dischargePeak",
382
+        label: "峰",
383
+        ifcolumn: true
384
+      },
385
+      {
386
+        prop: "dischargeShoulder",
387
+        label: "平",
388
+        ifcolumn: true
389
+      },
390
+      {
391
+        prop: "dischargeValley",
392
+        label: "谷",
393
+        ifcolumn: true
394
+      },
395
+      {
396
+        prop: "dischargeTotal",
397
+        label: "总",
398
+        ifcolumn: true
399
+      }
400
+    ]
401
+  },
402
+  {
403
+    prop: "overallEfficiency",
404
+    label: "综合效率(%)",
405
+    ifcolumn: true,
406
+    children: null
407
+  }
408
+]);
183 409
 const currentDate = ref();
184 410
 const activeName = ref("站点汇总");
185 411
 const handleClick = (val: any) => {
@@ -269,10 +495,151 @@ const gatSummary = () => {
269 495
 const onreset = () => {
270 496
   getdaymonthyear(1);
271 497
 };
498
+const onclose = (val: boolean) => {
499
+  console.log(val);
500
+  setTimeout(() => {
501
+    if (!val) {
502
+      for (const column of columnList.value) {
503
+        column.ifcolumn = true;
504
+
505
+        if (column.children) {
506
+          for (const child of column.children) {
507
+            child.ifcolumn = true;
508
+          }
509
+        }
510
+      }
511
+    }
512
+  }, 500); // 延迟 0.5毫秒
513
+};
514
+const onsingleclose = (val: boolean) => {
515
+  console.log(val);
516
+  setTimeout(() => {
517
+    if (!val) {
518
+      for (const column of singlecolumnList.value) {
519
+        column.ifcolumn = true;
520
+
521
+        if (column.children) {
522
+          for (const child of column.children) {
523
+            child.ifcolumn = true;
524
+          }
525
+        }
526
+      }
527
+    }
528
+  }, 500); // 延迟 0.5毫秒
529
+};
530
+// 点击父元素
531
+const oncheck = () => {
532
+  if (columnList.value) {
533
+    for (let index = 0; index < columnList.value.length; index++) {
534
+      const column = columnList.value[index];
535
+      if (column.children && column.prop == "") {
536
+        for (let i = 0; i < column.children.length; i++) {
537
+          const child = column.children[i];
538
+
539
+          if (child && !column.ifcolumn) {
540
+            child.ifcolumn = false;
541
+          } else {
542
+            child.ifcolumn = true;
543
+          }
544
+          if (child && child.ifcolumn) {
545
+            column.ifcolumn = true;
546
+          }
547
+        }
548
+      }
549
+    }
550
+  }
551
+};
552
+// 点击子元素
553
+const onchildren = () => {
554
+  if (columnList.value) {
555
+    for (let index = 0; index < columnList.value.length; index++) {
556
+      const column = columnList.value[index];
557
+      if (column.children && column.prop == "") {
558
+        for (let i = 0; i < column.children.length; i++) {
559
+          const child = column.children[i];
560
+          console.log(child);
561
+
562
+          if (child && !child.ifcolumn) {
563
+            column.ifcolumn = false;
564
+          } else {
565
+            column.ifcolumn = true;
566
+            return;
567
+          }
568
+        }
569
+      }
570
+    }
571
+  }
572
+};
573
+// 点击单站父元素多选
574
+const onsingle = () => {
575
+  if (singlecolumnList.value) {
576
+    for (let index = 0; index < singlecolumnList.value.length; index++) {
577
+      const column = singlecolumnList.value[index];
578
+      if (column && !column.ifcolumn) {
579
+        if (column.children && column.prop == "") {
580
+          for (let i = 0; i < column.children.length; i++) {
581
+            const child = column.children[i];
582
+            child.ifcolumn = false;
583
+          }
584
+        }
585
+      } else {
586
+        if (column.children && column.prop == "") {
587
+          for (let i = 0; i < column.children.length; i++) {
588
+            const child = column.children[i];
589
+            child.ifcolumn = true;
590
+          }
591
+        }
592
+      }
593
+    }
594
+  }
595
+};
596
+// 点击单站子元素
597
+const onsinglechildren = () => {
598
+  if (singlecolumnList.value) {
599
+    for (let index = 0; index < singlecolumnList.value.length; index++) {
600
+      const column = singlecolumnList.value[index];
601
+      if (column.children && column.prop == "") {
602
+        for (let i = 0; i < column.children.length; i++) {
603
+          const child = column.children[i];
604
+          console.log(child);
605
+
606
+          if (child && !child.ifcolumn) {
607
+            column.ifcolumn = false;
608
+          } else {
609
+            column.ifcolumn = true;
610
+            return;
611
+          }
612
+        }
613
+      }
614
+    }
615
+  }
616
+};
272 617
 // 导出
273 618
 const onexport = async () => {
619
+  let obj: string[] = []; // 假设 prop 是 string 类型,如果不是,请根据实际类型修改
620
+
621
+  if (columnList.value) {
622
+    for (const column of columnList.value) {
623
+      if (column?.ifcolumn) {
624
+        if (column.prop) {
625
+          obj.push(column.prop);
626
+        }
627
+        if (column.children) {
628
+          for (const child of column.children) {
629
+            if (child?.ifcolumn && child.prop) {
630
+              obj.push(child.prop);
631
+            }
632
+          }
633
+        }
634
+      }
635
+    }
636
+  }
637
+
638
+  const jsonString = obj.join(",");
274 639
   if (daymonthyearvalue.value == 1) {
275 640
     let obj = {
641
+      excel: jsonString,
642
+
276 643
       startDate: timepicker.value[0],
277 644
       endDate: timepicker.value[1]
278 645
     };
@@ -280,6 +647,8 @@ const onexport = async () => {
280 647
     downloadxlsx(timepicker.value[0], data);
281 648
   } else if (daymonthyearvalue.value == 2) {
282 649
     let obj = {
650
+      excel: jsonString,
651
+
283 652
       startYearMonth: timepicker.value[0],
284 653
       endYearMonth: timepicker.value[1]
285 654
     };
@@ -287,6 +656,8 @@ const onexport = async () => {
287 656
     downloadxlsx(timepicker.value[0], data);
288 657
   } else if (daymonthyearvalue.value == 3) {
289 658
     let obj = {
659
+      excel: jsonString,
660
+
290 661
       startYear: timepicker.value[0],
291 662
       endYear: timepicker.value[1]
292 663
     };
@@ -450,9 +821,29 @@ const onselectreset = async () => {
450 821
 };
451 822
 // 导出
452 823
 const singleexport = async () => {
453
-  console.log("导出");
824
+  let obj: string[] = []; // 假设 prop 是 string 类型,如果不是,请根据实际类型修改
825
+
826
+  if (singlecolumnList.value) {
827
+    for (const column of singlecolumnList.value) {
828
+      if (column?.ifcolumn) {
829
+        if (column.prop) {
830
+          obj.push(column.prop);
831
+        }
832
+        if (column.children) {
833
+          for (const child of column.children) {
834
+            if (child?.ifcolumn && child.prop) {
835
+              obj.push(child.prop);
836
+            }
837
+          }
838
+        }
839
+      }
840
+    }
841
+  }
842
+  const jsonString = obj.join(",");
454 843
   if (reportformsindex.value == 2) {
455 844
     let obj = {
845
+      excel: jsonString,
846
+
456 847
       startTime: starttime.value[0],
457 848
       endTime: starttime.value[1]
458 849
     };
@@ -460,6 +851,8 @@ const singleexport = async () => {
460 851
     downloadxlsx(starttime.value[0], data);
461 852
   } else if (reportformsindex.value == 3) {
462 853
     let obj = {
854
+      excel: jsonString,
855
+
463 856
       startYearMonth: starttime.value[0],
464 857
       endYearMonth: starttime.value[1]
465 858
     };
@@ -467,6 +860,8 @@ const singleexport = async () => {
467 860
     downloadxlsx(starttime.value[0], data);
468 861
   } else if (reportformsindex.value == 4) {
469 862
     let obj = {
863
+      excel: jsonString,
864
+
470 865
       startYear: starttime.value[0],
471 866
       endYear: starttime.value[1]
472 867
     };

+ 31
- 0
src/views/monitor/add.scss 파일 보기

@@ -0,0 +1,31 @@
1
+.name {
2
+  width: 100%;
3
+}
4
+.user_box {
5
+  width: 100%;
6
+}
7
+.demo-ruleForm {
8
+  display: flex;
9
+  flex-direction: column;
10
+  align-items: center;
11
+  justify-content: center;
12
+  width: 100%;
13
+}
14
+.elform {
15
+  box-sizing: border-box;
16
+  display: flex;
17
+  justify-content: space-between;
18
+  width: 100%;
19
+  padding: 0 200px;
20
+  margin-bottom: 10px;
21
+}
22
+.elformleft {
23
+  display: flex;
24
+  width: 100%;
25
+  margin-bottom: 20px;
26
+}
27
+.elform_tree {
28
+  width: 500px;
29
+  height: 300px;
30
+  border: 1px solid #e7e7e7;
31
+}

+ 204
- 0
src/views/monitor/add.vue 파일 보기

@@ -0,0 +1,204 @@
1
+<template>
2
+  <div>
3
+    <div class="card content-box">
4
+      <div class="name">{{ supertype }}</div>
5
+      <el-divider />
6
+      <div class="user_box">
7
+        <div class="user_left">
8
+          <el-form ref="formRef" :model="numberValidateForm" label-width="auto" class="demo-ruleForm">
9
+            <div class="elform">
10
+              <el-form-item label="任务名称:" prop="jobName" :rules="[{ required: true, message: '请输入任务名称:' }]">
11
+                <el-input
12
+                  v-model.number="numberValidateForm.jobName"
13
+                  style="width: 300px"
14
+                  size="large"
15
+                  type="text"
16
+                  placeholder="请输入任务名称:"
17
+                  autocomplete="off"
18
+                />
19
+              </el-form-item>
20
+              <el-form-item label="任务分组:">
21
+                <el-select v-model="numberValidateForm.jobGroup" placeholder="请选择分组" size="large" style="width: 300px">
22
+                  <el-option v-for="item in groupingdata" :key="item.value" :label="item.label" :value="item.value" />
23
+                </el-select>
24
+              </el-form-item>
25
+            </div>
26
+            <div class="elform">
27
+              <el-form-item
28
+                label="调用目标字符串:"
29
+                prop="invokeTarget"
30
+                :rules="[{ required: true, message: '请输入调用目标字符串' }]"
31
+              >
32
+                <el-input
33
+                  v-model="numberValidateForm.invokeTarget"
34
+                  style="width: 300px"
35
+                  size="large"
36
+                  type="text"
37
+                  placeholder="请输入调用目标字符串"
38
+                  autocomplete="off"
39
+                />
40
+              </el-form-item>
41
+              <el-form-item label="cron表达式:" prop="cronExpression" :rules="[{ required: true, message: '请输入cron表达式' }]">
42
+                <el-input
43
+                  v-model="numberValidateForm.cronExpression"
44
+                  style="width: 300px"
45
+                  size="large"
46
+                  type="text"
47
+                  placeholder="请输入cron表达式"
48
+                  autocomplete="off"
49
+                  @blur="onron"
50
+                />
51
+              </el-form-item>
52
+            </div>
53
+
54
+            <div class="elform">
55
+              <el-form-item label="执行策略:">
56
+                <el-radio-group v-model="numberValidateForm.misfirePolicy">
57
+                  <el-radio value="0">立即执行</el-radio>
58
+                  <el-radio value="1">执行一次</el-radio>
59
+                  <el-radio value="3">放弃执行</el-radio>
60
+                </el-radio-group>
61
+              </el-form-item>
62
+            </div>
63
+            <div class="elform">
64
+              <el-form-item label="并发执行:">
65
+                <el-radio-group v-model="numberValidateForm.concurrent">
66
+                  <el-radio value="0">允许</el-radio>
67
+                  <el-radio value="1">禁止</el-radio>
68
+                </el-radio-group>
69
+              </el-form-item>
70
+            </div>
71
+            <div class="elform">
72
+              <el-form-item label="状态:">
73
+                <el-radio-group v-model="numberValidateForm.status">
74
+                  <el-radio value="0">正常</el-radio>
75
+                  <el-radio value="1">暂停</el-radio>
76
+                </el-radio-group>
77
+              </el-form-item>
78
+            </div>
79
+            <div class="elform">
80
+              <el-form-item label="备注:">
81
+                <el-input
82
+                  v-model.number="numberValidateForm.remark"
83
+                  style="width: 600px"
84
+                  size="large"
85
+                  type="text"
86
+                  placeholder="请输入备注"
87
+                  autocomplete="off"
88
+                />
89
+              </el-form-item>
90
+            </div>
91
+
92
+            <el-divider />
93
+            <el-form-item class="bottom">
94
+              <el-button type="primary" @click="submitForm(formRef)">保存</el-button>
95
+              <el-button @click="resetForm(formRef)">关闭</el-button>
96
+            </el-form-item>
97
+          </el-form>
98
+        </div>
99
+      </div>
100
+    </div>
101
+  </div>
102
+</template>
103
+
104
+<script setup lang="ts">
105
+import { monitorjobadd, monitorjobedit, jobeditupdate, checkCronExpressionIsValid } from "@/api/home/Multisite";
106
+import { ElMessage, FormInstance } from "element-plus";
107
+import { onMounted, reactive, ref } from "vue";
108
+import { useRouter, useRoute } from "vue-router";
109
+const router = useRouter();
110
+const route = useRoute();
111
+
112
+const formRef = ref<FormInstance>();
113
+const supertype = ref(route.query.type);
114
+
115
+const numberValidateForm = reactive({
116
+  id: route.query.id,
117
+  jobName: "",
118
+  jobGroup: "",
119
+  invokeTarget: "",
120
+  cronExpression: "",
121
+  concurrent: "0",
122
+  misfirePolicy: "0",
123
+  status: "0",
124
+  remark: ""
125
+});
126
+const groupingdata = ref([
127
+  {
128
+    value: "",
129
+    label: "全部"
130
+  },
131
+  {
132
+    value: "DEFAULT",
133
+    label: "默认"
134
+  },
135
+  {
136
+    value: "SYSTEM",
137
+    label: "系统"
138
+  }
139
+]);
140
+const submitForm = (formEl: FormInstance | undefined) => {
141
+  if (!formEl) return;
142
+  formEl.validate(async valid => {
143
+    if (valid) {
144
+      if (!ExpressionIsValid.value) {
145
+        ElMessage.error("表达式不正确");
146
+        return false;
147
+      }
148
+      if (route.query.type == "任务新增") {
149
+        const { data } = await monitorjobadd(numberValidateForm);
150
+        console.log(data);
151
+      } else {
152
+        const { data } = await monitorjobedit(numberValidateForm);
153
+        console.log(data);
154
+      }
155
+      router.back();
156
+    } else {
157
+      console.log("error submit!");
158
+      return false;
159
+    }
160
+  });
161
+};
162
+const ExpressionIsValid = ref();
163
+
164
+const onron = async () => {
165
+  let obj = {
166
+    cronExpression: numberValidateForm.cronExpression
167
+  };
168
+  const data = await checkCronExpressionIsValid(obj);
169
+  // 这里可以使用正则表达式或其他逻辑验证cron表达式
170
+  ExpressionIsValid.value = data;
171
+  if (!data) {
172
+    ElMessage.error("表达式不正确");
173
+    return;
174
+  }
175
+};
176
+const resetForm = (formEl: FormInstance | undefined) => {
177
+  if (!formEl) return;
178
+  formEl.resetFields();
179
+  router.push("/monitor/job");
180
+};
181
+const yonghueditdata = ref();
182
+const getghuedit = async () => {
183
+  const { data } = await jobeditupdate(route.query.id);
184
+  yonghueditdata.value = data;
185
+  console.log(yonghueditdata.value);
186
+  numberValidateForm.jobName = yonghueditdata.value.job.jobName;
187
+  numberValidateForm.jobGroup = yonghueditdata.value.job.jobGroup;
188
+  numberValidateForm.invokeTarget = yonghueditdata.value.job.invokeTarget;
189
+  numberValidateForm.cronExpression = yonghueditdata.value.job.cronExpression;
190
+  numberValidateForm.status = yonghueditdata.value.job.status;
191
+  numberValidateForm.misfirePolicy = yonghueditdata.value.job.misfirePolicy;
192
+  numberValidateForm.concurrent = yonghueditdata.value.job.concurrent;
193
+  numberValidateForm.remark = yonghueditdata.value.job.remark;
194
+  onron();
195
+};
196
+onMounted(() => {
197
+  if (route.query.type == "任务编辑") {
198
+    getghuedit();
199
+  }
200
+});
201
+</script>
202
+<style scoped lang="scss">
203
+@import "./add.scss";
204
+</style>

+ 24
- 0
src/views/monitor/index.scss 파일 보기

@@ -2,6 +2,13 @@
2 2
 .title {
3 3
   display: flex;
4 4
   :deep(.el-select__wrapper) {
5
+    .el-select__prefix {
6
+      color: #000000 !important;
7
+    }
8
+    .el-select__selected-item {
9
+      font-size: 22px;
10
+    }
11
+
5 12
     background-color: rgb(0 0 0 / 0%);
6 13
     box-shadow: 0 0 0 0 !important;
7 14
 
@@ -224,6 +231,15 @@
224 231
   background: rgb(0 9 91 / 2%);
225 232
   border: 1px solid #e7e7e7;
226 233
 }
234
+.equipmentdata_divobx {
235
+  box-sizing: border-box;
236
+  display: flex;
237
+  align-items: center;
238
+  justify-content: space-between;
239
+  width: 24%;
240
+  height: 58px;
241
+  padding: 0 20px;
242
+}
227 243
 .equipmentdata_div4 {
228 244
   box-sizing: border-box;
229 245
   display: flex;
@@ -277,3 +293,11 @@
277 293
 :deep(.el-table__header) {
278 294
   background: rgb(241 242 245) !important;
279 295
 }
296
+.message-empty {
297
+  display: flex;
298
+  flex-direction: column;
299
+  align-items: center;
300
+  justify-content: center;
301
+  height: 260px;
302
+  line-height: 45px;
303
+}

+ 98
- 88
src/views/monitor/index.vue 파일 보기

@@ -7,11 +7,14 @@
7 7
         placeholder="选择电站"
8 8
         popper-class="custom-header"
9 9
         :max-collapse-tags="1"
10
-        style="width: 300px"
10
+        class="Space_content"
11 11
         size="large"
12 12
         @change="postemsDevice"
13 13
       >
14
-        <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
14
+        <el-option v-for="(item, index) in cities" :key="index" :label="item.stationName" :value="item.id" />
15
+        <template #prefix>
16
+          {{ (cities.find(s => s.id === Singlevalue) || {}).stationName }}
17
+        </template>
15 18
       </el-select>
16 19
       <div class="title_"></div>
17 20
       <el-select
@@ -20,16 +23,21 @@
20 23
         placeholder="选择编号"
21 24
         popper-class="custom-header"
22 25
         :max-collapse-tags="1"
23
-        style="width: 240px"
26
+        class="Space_content"
24 27
         size="large"
25 28
         @change="getstationrealtime"
26 29
       >
30
+        <template #prefix>
31
+          {{ (emsDevice.find(s => s.id === emsDeviceId) || {}).id }}
32
+        </template>
27 33
         <el-option v-for="item in emsDevice" :key="item.id" :label="item.emsDeviceId" :value="item.id" />
28 34
       </el-select>
29 35
     </div>
30
-    <!-- <div>
31
-    
32
-  </div> -->
36
+
37
+    <div class="message-empty" v-if="!deviceList[activeName].devices">
38
+      <img style="width: 300px; margin-top: 400px" src="@/assets/images/notData.png" alt="notData" />
39
+      <div>暂无消息</div>
40
+    </div>
33 41
     <div class="equipment">
34 42
       <el-card>
35 43
         <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handletabs">
@@ -178,21 +186,16 @@
178 186
             </div>
179 187
           </div>
180 188
           <!-- 2 -->
181
-          <div class="equipmentdata_equipment">
182
-            <!-- <div class="equipmentdata_div">
189
+          <!-- <div class="equipmentdata_equipment">
190
+            <div class="equipmentdata_div">
183 191
               <div class="equipment_title">总交流无功功率</div>
184 192
               <div>{{ pcslist.totalAcReactivePower ?? "-" }} kW</div>
185 193
             </div>
186 194
             <div class="equipmentdata_div">
187 195
               <div class="equipment_title">总交流视在功率</div>
188 196
               <div>{{ pcslist.totalAcApparentPower ?? "-" }} kW</div>
189
-            </div> -->
190
-            <div class="equipmentdata_div">
191
-              <!-- <div class="equipment_title">总交流功率因数</div> -->
192
-              <div class="equipment_title">交流电流</div>
193
-              <!-- <div>{{ pcslist.aphaseActivePower ?? "-" }}A</div> -->
194
-              <div>{{ (pcslist.acAbCurrent * 1).toFixed(2) ?? "-" }}A</div>
195 197
             </div>
198
+
196 199
             <div class="equipmentdata_div4">
197 200
               <div class="equipment_title">A相有功功率</div>
198 201
               <div>{{ pcslist.aphaseActivePower ?? "-" }} kW</div>
@@ -205,9 +208,9 @@
205 208
               <div class="equipment_title">C相有功功率</div>
206 209
               <div>{{ pcslist.cphaseActivePower ?? "-" }} kW</div>
207 210
             </div>
208
-          </div>
211
+          </div> -->
209 212
           <!-- 3  -->
210
-          <div class="equipmentdata_equipment">
213
+          <!-- <div class="equipmentdata_equipment">
211 214
             <div class="equipmentdata_div">
212 215
               <div class="equipment_title">A相无功功率</div>
213 216
               <div>{{ pcslist.aphaseReactivePower ?? "-" }} kW</div>
@@ -224,9 +227,9 @@
224 227
               <div class="equipment_title">A相视在功率</div>
225 228
               <div>{{ pcslist.aphaseApparentPower ?? "-" }} kVA</div>
226 229
             </div>
227
-          </div>
230
+          </div> -->
228 231
           <!-- 4  -->
229
-          <div class="equipmentdata_equipment">
232
+          <!-- <div class="equipmentdata_equipment">
230 233
             <div class="equipmentdata_div">
231 234
               <div class="equipment_title">B相视在功率</div>
232 235
               <div>{{ pcslist.bphaseApparentPower ?? "-" }} kVA</div>
@@ -238,16 +241,14 @@
238 241
             <div class="equipmentdata_div">
239 242
               <div class="equipment_title">AB电压</div>
240 243
               <div>{{ (pcslist.acAbVolt * 1).toFixed(2) ?? "-" }} V</div>
241
-              <!-- <div class="equipment_title">AB离网电压</div> -->
242
-              <!-- <div>{{ (pcslist.abOffGridVolt * 1).toFixed(2) ?? "-" }} V</div> -->
243 244
             </div>
244 245
             <div class="equipmentdata_div">
245 246
               <div class="equipment_title">BC电压</div>
246 247
               <div>{{ (pcslist.acBcVolt * 1).toFixed(2) ?? "-" }} V</div>
247 248
             </div>
248
-          </div>
249
+          </div> -->
249 250
           <!-- 5  -->
250
-          <div class="equipmentdata_equipment">
251
+          <!-- <div class="equipmentdata_equipment">
251 252
             <div class="equipmentdata_div">
252 253
               <div class="equipment_title">CA电压</div>
253 254
               <div>{{ (pcslist.acCaVolt * 1).toFixed(2) ?? "-" }} V</div>
@@ -264,10 +265,16 @@
264 265
               <div class="equipment_title">CA电流</div>
265 266
               <div>{{ (pcslist.acCaCurrent * 1).toFixed(2) ?? "-" }} A</div>
266 267
             </div>
267
-          </div>
268
+          </div> -->
268 269
           <!-- 6 -->
269 270
           <div class="equipmentdata_equipment">
270 271
             <div class="equipmentdata_div">
272
+              <!-- <div class="equipment_title">总交流功率因数</div> -->
273
+              <div class="equipment_title">交流电流</div>
274
+              <!-- <div>{{ pcslist.aphaseActivePower ?? "-" }}A</div> -->
275
+              <div>{{ (pcslist.acAbCurrent * 1).toFixed(2) ?? "-" }}A</div>
276
+            </div>
277
+            <div class="equipmentdata_div">
271 278
               <div class="equipment_title">A相电压</div>
272 279
               <div>{{ (pcslist.acAphaseVolt * 1).toFixed(2) ?? "-" }} V</div>
273 280
             </div>
@@ -279,14 +286,13 @@
279 286
               <div class="equipment_title">C相电压</div>
280 287
               <div>{{ (pcslist.acCphaseVolt * 1).toFixed(2) ?? "-" }} V</div>
281 288
             </div>
282
-            <div class="equipmentdata_div">
289
+            <!-- <div class="equipmentdata_div">
283 290
               <div class="equipment_title">A相电流</div>
284 291
               <div>{{ (pcslist.acAphaseCurrent * 1).toFixed(2) ?? "-" }} A</div>
285
-              <!-- <div>{{ (pcslist.acAbCurrent * 1).toFixed(2) ?? "-" }} A</div> -->
286
-            </div>
292
+            </div> -->
287 293
           </div>
288 294
           <!-- 7 -->
289
-          <div class="equipmentdata_equipment">
295
+          <!-- <div class="equipmentdata_equipment">
290 296
             <div class="equipmentdata_div">
291 297
               <div class="equipment_title">B相电流</div>
292 298
               <div>{{ (pcslist.acBphaseCurrent * 1).toFixed(2) ?? "-" }} A</div>
@@ -303,9 +309,9 @@
303 309
               <div class="equipment_title">PCS环境温度</div>
304 310
               <div>{{ pcslist.envTempr ?? "-" }} ℃</div>
305 311
             </div>
306
-          </div>
312
+          </div> -->
307 313
           <!-- 8 -->
308
-          <div class="equipmentdata_equipment">
314
+          <!-- <div class="equipmentdata_equipment">
309 315
             <div class="equipmentdata_div">
310 316
               <div class="equipment_title">PCS散热器温度</div>
311 317
               <div>{{ pcslist.radiatorTemp ?? "-" }} ℃</div>
@@ -322,9 +328,9 @@
322 328
               <div class="equipment_title">C1模块温度</div>
323 329
               <div>{{ pcslist.cphaseIgbtMaxTempr ?? "-" }} ℃</div>
324 330
             </div>
325
-          </div>
331
+          </div> -->
326 332
           <!-- 9 -->
327
-          <div class="equipmentdata_equipment">
333
+          <!-- <div class="equipmentdata_equipment">
328 334
             <div class="equipmentdata_div">
329 335
               <div class="equipment_title">A2模块温度</div>
330 336
               <div>{{ pcslist.aphaseIgbtMinTempr ?? "-" }} ℃</div>
@@ -341,15 +347,15 @@
341 347
               <div class="equipment_title">进风口温度</div>
342 348
               <div>{{ pcslist.airInletTemp ?? "-" }} ℃</div>
343 349
             </div>
344
-          </div>
350
+          </div> -->
345 351
           <!-- 10 -->
346
-          <div class="equipmentdata_equipment">
352
+          <!-- <div class="equipmentdata_equipment">
347 353
             <div class="equipmentdata_div">
348 354
               <div class="equipment_title">出风口温度</div>
349 355
               <div>{{ pcslist.airOutletTemp ?? "-" }} ℃</div>
350 356
             </div>
351 357
             <div class="equipmentdata_div1"></div>
352
-          </div>
358
+          </div> -->
353 359
           <div class="equipmentdata">设备故障字</div>
354 360
           <!-- faultStatusWordList -->
355 361
           <div class="equipmentdata_data">
@@ -460,17 +466,18 @@
460 466
               <div class="equipment_title">C相有功功率</div>
461 467
               <div>{{ datalist.cphaseActivePower ?? "-" }} kW</div>
462 468
             </div>
463
-            <div class="equipmentdata_div4">
469
+            <div class="equipmentdata_divobx"></div>
470
+            <!-- <div class="equipmentdata_div4">
464 471
               <div class="equipment_title">电流互感器变比</div>
465 472
               <div>-</div>
466
-            </div>
473
+            </div> -->
467 474
           </div>
468
-          <div class="equipmentdata_equipment">
475
+          <!-- <div class="equipmentdata_equipment">
469 476
             <div class="equipmentdata_div">
470 477
               <div class="equipment_title">电压互感器变比</div>
471 478
               <div>-</div>
472 479
             </div>
473
-          </div>
480
+          </div> -->
474 481
           <div class="equipmentdata">电量数据</div>
475 482
           <div class="eltable">
476 483
             <el-table :data="Electricitymeterlist" style="width: 100%" border>
@@ -590,17 +597,7 @@
590 597
               <div class="equipment_title">放电限制功率</div>
591 598
               <div>{{ BMSlist.dischargeablePower ?? "-" }} kW</div>
592 599
             </div>
593
-            <div class="equipmentdata_div">
594
-              <div class="equipment_title">可充电量</div>
595
-              <div>{{ BMSlist.rechargeableKwh ?? "-" }} kWh</div>
596
-            </div>
597
-            <div class="equipmentdata_div4">
598
-              <div class="equipment_title">可放电量</div>
599
-              <div>{{ BMSlist.dischargeableKwh ?? "-" }} kWh</div>
600
-            </div>
601
-          </div>
602
-          <!-- 3 -->
603
-          <div class="equipmentdata_equipment">
600
+
604 601
             <div class="equipmentdata_div">
605 602
               <div class="equipment_title">平均单体温度</div>
606 603
               <div>{{ BMSlist.avgCellTempr ?? "-" }} ℃</div>
@@ -609,6 +606,9 @@
609 606
               <div class="equipment_title">平均单体电压</div>
610 607
               <div>{{ BMSlist.avgCellVoltage ?? "-" }} V</div>
611 608
             </div>
609
+          </div>
610
+          <!-- 3 -->
611
+          <!-- <div class="equipmentdata_equipment">
612 612
             <div class="equipmentdata_div">
613 613
               <div class="equipment_title">绝缘值</div>
614 614
               <div>{{ BMSlist.insulationResistance ?? "-" }} kΩ</div>
@@ -617,13 +617,21 @@
617 617
               <div class="equipment_title">正极绝缘值</div>
618 618
               <div>{{ BMSlist.posInsulationResistance ?? "-" }} kΩ</div>
619 619
             </div>
620
-          </div>
620
+          </div> -->
621 621
           <!-- 4 -->
622 622
           <div class="equipmentdata_equipment">
623
-            <div class="equipmentdata_div">
623
+            <!-- <div class="equipmentdata_div">
624
+              <div class="equipment_title">可充电量</div>
625
+              <div>{{ BMSlist.rechargeableKwh ?? "-" }} kWh</div>
626
+            </div>
627
+            <div class="equipmentdata_div4">
628
+              <div class="equipment_title">可放电量</div>
629
+              <div>{{ BMSlist.dischargeableKwh ?? "-" }} kWh</div>
630
+            </div> -->
631
+            <!-- <div class="equipmentdata_div">
624 632
               <div class="equipment_title">负极绝缘值</div>
625 633
               <div>{{ BMSlist.negInsulationResistance ?? "-" }} kΩ</div>
626
-            </div>
634
+            </div> -->
627 635
             <div class="equipmentdata_div">
628 636
               <div class="equipment_title">最高单体温度</div>
629 637
               <div>{{ BMSlist.maxCellTempr ?? "-" }} ℃</div>
@@ -636,15 +644,14 @@
636 644
               <div class="equipment_title">最高单体电压</div>
637 645
               <div>{{ BMSlist.maxCellVoltage ?? "-" }} V</div>
638 646
             </div>
639
-          </div>
640
-          <!-- 4 -->
641
-          <div class="equipmentdata_equipment">
642 647
             <div class="equipmentdata_div">
643 648
               <div class="equipment_title">最低单体电压</div>
644 649
               <div>{{ BMSlist.minCellVoltage ?? "-" }} V</div>
645 650
             </div>
646 651
           </div>
647 652
           <!--  -->
653
+          <div class="equipmentdata_equipment"></div>
654
+          <!--  -->
648 655
         </div>
649 656
         <div class="equipmentdiv" v-if="deviceType == 4">
650 657
           <div class="equipmenttime">末次数据时间:{{ Conditionerdata.ts }}</div>
@@ -785,7 +792,7 @@
785 792
 
786 793
           <div class="equipmentdata">设备数据</div>
787 794
           <!-- class="" -->
788
-          <div class="equipmentdata_equipment">
795
+          <!-- <div class="equipmentdata_equipment">
789 796
             <div class="equipmentdata_div">
790 797
               <div class="equipment_title">电流</div>
791 798
               <div>{{ Conditionerdata.acVolt ?? "-" }} A</div>
@@ -802,9 +809,9 @@
802 809
               <div class="equipment_title">盘管温度</div>
803 810
               <div>{{ Conditionerdata.coilTempr ?? "-" }} ℃</div>
804 811
             </div>
805
-          </div>
812
+          </div> -->
806 813
           <!-- 2 -->
807
-          <div class="equipmentdata_equipment">
814
+          <!-- <div class="equipmentdata_equipment">
808 815
             <div class="equipmentdata_div">
809 816
               <div class="equipment_title">柜外温度</div>
810 817
               <div>{{ Conditionerdata.outdoorTempr ?? "-" }} ℃</div>
@@ -821,28 +828,28 @@
821 828
               <div class="equipment_title">融霜温度</div>
822 829
               <div>{{ Conditionerdata.defrostTempr ?? "-" }} ℃</div>
823 830
             </div>
824
-          </div>
825
-          <!-- 3 -->
831
+          </div> -->
832
+          <!--  -->
826 833
           <div class="equipmentdata_equipment">
827 834
             <div class="equipmentdata_div">
828
-              <div class="equipment_title">排气温度</div>
829
-              <div>{{ Conditionerdata.exhaustTempr ?? "-" }} ℃</div>
835
+              <div class="equipment_title">出水温度</div>
836
+              <div>{{ Conditionerdata.condensingTempr ?? "-" }} ℃</div>
830 837
             </div>
831 838
             <div class="equipmentdata_div">
832
-              <div class="equipment_title">出风温度</div>
833
-              <div>{{ Conditionerdata.airOutTempr ?? "-" }} ℃</div>
839
+              <div class="equipment_title">回水温度</div>
840
+              <div>{{ Conditionerdata.defrostTempr ?? "-" }} ℃</div>
834 841
             </div>
835 842
             <div class="equipmentdata_div">
836
-              <div class="equipment_title">回风温度</div>
837
-              <div>{{ Conditionerdata.airInTempr ?? "-" }} ℃</div>
843
+              <div class="equipment_title">出水压力</div>
844
+              <div>{{ Conditionerdata.outdoorTempr ?? "-" }} Bar</div>
838 845
             </div>
839 846
             <div class="equipmentdata_div4">
840
-              <div class="equipment_title">柜内湿度</div>
841
-              <div>{{ Conditionerdata.humidity ?? "-" }} %</div>
847
+              <div class="equipment_title">回水压力</div>
848
+              <div>{{ Conditionerdata.cabinetTempr ?? "-" }} Bar</div>
842 849
             </div>
843 850
           </div>
844
-          <!-- 4 -->
845
-          <div class="equipmentdata_equipment">
851
+          <!--  -->
852
+          <!-- <div class="equipmentdata_equipment">
846 853
             <div class="equipmentdata_div">
847 854
               <div class="equipment_title">制热开启温度</div>
848 855
               <div>{{ Conditionerdata.heatingStartTempr ?? "-" }} ℃</div>
@@ -859,9 +866,9 @@
859 866
               <div class="equipment_title">制冷关闭温度</div>
860 867
               <div>{{ Conditionerdata.refrigerationStopTempr ?? "-" }} ℃</div>
861 868
             </div>
862
-          </div>
869
+          </div> -->
863 870
           <!-- 5-->
864
-          <div class="equipmentdata_equipment">
871
+          <!-- <div class="equipmentdata_equipment">
865 872
             <div class="equipmentdata_div">
866 873
               <div class="equipment_title">高温告警温度</div>
867 874
               <div>{{ Conditionerdata.highTemprThreshold ?? "-" }} ℃</div>
@@ -878,9 +885,9 @@
878 885
               <div class="equipment_title">除湿开启温度</div>
879 886
               <div>{{ Conditionerdata.dehumStartTemp ?? "-" }} ℃</div>
880 887
             </div>
881
-          </div>
888
+          </div> -->
882 889
           <!-- 6 -->
883
-          <div class="equipmentdata_equipment">
890
+          <!-- <div class="equipmentdata_equipment">
884 891
             <div class="equipmentdata_div">
885 892
               <div class="equipment_title">除湿关闭温度</div>
886 893
               <div>{{ Conditionerdata.dehumStartHum ?? "-" }} ℃</div>
@@ -897,20 +904,21 @@
897 904
               <div class="equipment_title">内风机转速</div>
898 905
               <div>{{ Conditionerdata.innerFanSpeed ?? "-" }} rpm</div>
899 906
             </div>
900
-          </div>
901
-          <!-- 4 -->
902
-          <div class="equipmentdata_equipment">
907
+          </div> -->
908
+          <!-- 7 -->
909
+          <!-- <div class="equipmentdata_equipment">
903 910
             <div class="equipmentdata_div">
904 911
               <div class="equipment_title">外风机转速</div>
905 912
               <div>{{ Conditionerdata.exhaustTempr ?? "-" }} rpm</div>
906 913
             </div>
907
-          </div>
908
-          <!--  -->
914
+          </div> -->
915
+          <!-- 8 -->
909 916
         </div>
910 917
       </el-card>
911 918
     </div>
912 919
   </div>
913 920
 </template>
921
+<!--    -->
914 922
 <script setup lang="ts">
915 923
 import { onMounted, onUnmounted, Ref, ref } from "vue";
916 924
 import {
@@ -932,7 +940,12 @@ const emsDeviceId = ref("");
932 940
 const intervalID = ref();
933 941
 const poststationstationName = async () => {
934 942
   const { data } = await stationstationName({});
935
-  Singlevalue.value = data[0].id;
943
+  if (data.length == 0) {
944
+    Singlevalue.value = "";
945
+    return;
946
+  } else {
947
+    Singlevalue.value = data[0].id;
948
+  }
936 949
   cities.value = data;
937 950
   postemsDevice(Singlevalue.value);
938 951
 };
@@ -947,11 +960,6 @@ const postemsDevice = async (value: any) => {
947 960
   } else {
948 961
     emsDeviceId.value = data[0].id;
949 962
   }
950
-  for (let index = 0; index < data.length; index++) {
951
-    if (data[index].emsDeviceId.length > 20) {
952
-      data[index].emsDeviceId = data[index].emsDeviceId.substring(7);
953
-    }
954
-  }
955 963
 
956 964
   emsDevice.value = data;
957 965
   getstationrealtime();
@@ -962,6 +970,7 @@ const deviceType = ref(1);
962 970
 const getstationrealtime = async () => {
963 971
   const { data } = await poststationdeviceList({ emsId: emsDeviceId.value }, Singlevalue.value);
964 972
   if (data.length == 0) return;
973
+
965 974
   deviceList.value = data;
966 975
   deviceType.value = data[0].deviceType;
967 976
   handleClick();
@@ -995,7 +1004,7 @@ const handleClick = async () => {
995 1004
     getgetairConditionerInfo();
996 1005
   }
997 1006
 };
998
-//
1007
+
999 1008
 const devicesClickindex = ref(0);
1000 1009
 const devicesClickid = ref("1");
1001 1010
 const devicesClick = async (val: number, id: string) => {
@@ -1013,7 +1022,8 @@ const getpcsdata = async () => {
1013 1022
   const { data } = await postpcsInfo({ emsId: emsDeviceId.value }, Singlevalue.value, emsDeviceId.value);
1014 1023
   pcslist.value = data;
1015 1024
 };
1016
-// 电表
1025
+
1026
+//
1017 1027
 const Electricitymeterlist = ref();
1018 1028
 const datalist = ref();
1019 1029
 const Electricitymeter = async () => {
@@ -1092,4 +1102,4 @@ onMounted(() => {
1092 1102
 <style scoped lang="scss">
1093 1103
 @import "./index.scss";
1094 1104
 </style>
1095
-<!-- -->
1105
+<!---->

+ 44
- 0
src/views/monitor/job.scss 파일 보기

@@ -0,0 +1,44 @@
1
+.screen {
2
+  display: flex;
3
+  width: 100%;
4
+  margin-bottom: 20px;
5
+}
6
+.screen1 {
7
+  display: flex;
8
+  justify-content: space-between;
9
+  width: 100%;
10
+}
11
+.screen_view {
12
+  display: flex;
13
+  align-items: center;
14
+  width: 100%;
15
+}
16
+.screen_view1 {
17
+  display: flex;
18
+  align-items: center;
19
+  width: 30%;
20
+}
21
+.cardbottom {
22
+  margin-top: 20px;
23
+}
24
+.title {
25
+  display: flex;
26
+  align-items: center;
27
+  margin-bottom: 20px;
28
+  font-size: 18px;
29
+  .title_time {
30
+    margin-left: 10px;
31
+    font-size: 16px;
32
+  }
33
+}
34
+.pagination {
35
+  display: flex;
36
+  justify-content: space-between;
37
+  margin-top: 20px;
38
+}
39
+.btn-group {
40
+  display: flex;
41
+  gap: 10px; /* 按钮之间的间隔 */
42
+  align-items: center; /* 垂直居中按钮 */
43
+  justify-content: center; /* 水平居中按钮 */
44
+}

+ 201
- 0
src/views/monitor/job.vue 파일 보기

@@ -0,0 +1,201 @@
1
+<template>
2
+  <div>
3
+    <!-- <div class="card content-box">
4
+    </div> -->
5
+    <div class="title">
6
+      用户管理
7
+      <div class="title_time">{{ currentDate }}</div>
8
+    </div>
9
+    <div class="card">
10
+      <div class="screen">
11
+        <div class="screen_view">
12
+          任务名称&ensp;<el-input v-model="jobName" style="width: 300px" size="large" placeholder="输入任务名称" />
13
+        </div>
14
+        <div class="screen_view">
15
+          任务分组&ensp;<el-select v-model="grouping" placeholder="请选择任务分组" size="large" style="width: 300px">
16
+            <el-option v-for="item in groupingdata" :key="item.value" :label="item.label" :value="item.value" />
17
+          </el-select>
18
+        </div>
19
+        <div class="screen_view">
20
+          任务状态&ensp;<el-select v-model="status" placeholder="请选择任务状态" size="large" style="width: 300px">
21
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
22
+          </el-select>
23
+        </div>
24
+        <div class="screen1">
25
+          <div>
26
+            <el-button type="primary" size="large" color="#0052d9" @click="query(0)">查询</el-button>
27
+            <el-button size="large" @click="query(1)">重置</el-button>&ensp;&ensp;
28
+          </div>
29
+        </div>
30
+      </div>
31
+    </div>
32
+    <div class="card cardbottom">
33
+      <!-- <el-button v-if="BUTTONS.useradd" type="primary" size="large" color="#0052d9" @click="newaddition">新增</el-button> -->
34
+      <el-button v-if="BUTTONS.jobadd" type="primary" size="large" color="#0052d9" @click="newaddition">新增</el-button>
35
+
36
+      <div>&ensp;</div>
37
+      <el-table :data="tableData.rows" style="width: 100%" border>
38
+        <el-table-column prop="misfirePolicy" label="任务编码" show-overflow-tooltip />
39
+        <el-table-column prop="jobName" label="任务名称" />
40
+        <el-table-column prop="jobGroup" label="任务分组" />
41
+        <el-table-column prop="invokeTarget" label="调用目标字符串" />
42
+        <el-table-column prop="cronExpression" label="执行表达式" />
43
+        <el-table-column prop="status" label="任务状态" align="center" width="140">
44
+          <template #default="scope">
45
+            <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="onswitch(scope.row)" />
46
+          </template>
47
+        </el-table-column>
48
+        <el-table-column prop="createTime" label="创建时间" />
49
+        <el-table-column label="操作" align="center" width="260">
50
+          <template #default="scope">
51
+            <el-button v-if="BUTTONS.jobedit" color="#0052d9" type="primary" @click="newition(scope.row)">编辑</el-button>
52
+            <!-- <el-button @click="Newpassword(scope.row)">重置密码</el-button> -->
53
+            <el-button v-if="BUTTONS.jobdelete" @click="onremove(scope.row)">删除</el-button>
54
+          </template>
55
+        </el-table-column>
56
+      </el-table>
57
+      <!-- 分页组件 -->
58
+      <div class="pagination">
59
+        <div></div>
60
+        <slot name="pagination">
61
+          <Pagination :pageable="pageable" :handle-size-change="handleSizeChange" :handle-current-change="handleCurrentChange" />
62
+        </slot>
63
+      </div>
64
+    </div>
65
+  </div>
66
+</template>
67
+<!--    -->
68
+<script setup lang="ts">
69
+import { useHandleData } from "@/hooks/useHandleData.js";
70
+import { ref, onMounted } from "vue";
71
+import { useRouter } from "vue-router";
72
+import { joblistURL, jobremove, jobchangeStatus } from "../../api/home/Multisite.js";
73
+import Pagination from "@/components/ProTable/components/Pagination.vue";
74
+import { useAuthButtons } from "@/hooks/useAuthButtons";
75
+const { BUTTONS } = useAuthButtons();
76
+
77
+const router = useRouter();
78
+
79
+const groupingdata = ref([
80
+  {
81
+    value: "",
82
+    label: "全部"
83
+  },
84
+  {
85
+    value: "DEFAULT",
86
+    label: "默认"
87
+  },
88
+  {
89
+    value: "SYSTEM",
90
+    label: "系统"
91
+  }
92
+]);
93
+const options = ref([
94
+  {
95
+    value: "",
96
+    label: "全部"
97
+  },
98
+  {
99
+    value: "0",
100
+    label: "正常"
101
+  },
102
+  {
103
+    value: "1",
104
+    label: "暂停"
105
+  }
106
+]);
107
+const query = (val: any) => {
108
+  if (val == 0) {
109
+  } else {
110
+    (createTime.value = []), (status.value = ""), (phonenumber.value = "");
111
+    getplatformuserlist();
112
+  }
113
+};
114
+const newaddition = () => {
115
+  router.push({
116
+    path: "/monitor/add",
117
+    query: {
118
+      type: "任务新增", // 传递的参数
119
+      id: ""
120
+    }
121
+  });
122
+};
123
+const newition = (row: any) => {
124
+  router.push({
125
+    path: "/monitor/add",
126
+    query: {
127
+      type: "任务编辑", // 传递的参数
128
+      id: row.id
129
+    }
130
+  });
131
+};
132
+// 查询
133
+
134
+const tableData = ref();
135
+const jobName = ref("");
136
+const grouping = ref("");
137
+const status = ref("");
138
+const phonenumber = ref();
139
+const createTime = ref();
140
+createTime.value = [];
141
+
142
+const pageable = ref({
143
+  pn: 1,
144
+  ps: 10,
145
+  total: 0
146
+});
147
+const getplatformuserlist = async () => {
148
+  let obj = {
149
+    jobName: jobName.value,
150
+    jobGroup: grouping.value,
151
+    status: status.value,
152
+    orderByColumn: "createTime",
153
+    isAsc: "desc",
154
+    pageNum: pageable.value.pn,
155
+    pageSize: pageable.value.ps
156
+  };
157
+  const data = await joblistURL(obj);
158
+  console.log(data);
159
+  tableData.value = data;
160
+  pageable.value.total = data.total;
161
+};
162
+// 表格操作 Hooks
163
+const handleSizeChange = async (e: any) => {
164
+  pageable.value.ps = e;
165
+  getplatformuserlist();
166
+};
167
+const handleCurrentChange = async (e: any) => {
168
+  pageable.value.pn = e;
169
+
170
+  getplatformuserlist();
171
+};
172
+
173
+// 删除
174
+const onremove = async (row: any) => {
175
+  await useHandleData(jobremove, { ids: row.id }, "删除");
176
+  await getplatformuserlist();
177
+};
178
+
179
+const currentDate = ref();
180
+// 按钮
181
+const onswitch = async (row: any) => {
182
+  let obj = {
183
+    id: row.id,
184
+    jobGroup: row.jobGroup,
185
+    status: row.status
186
+  };
187
+  await jobchangeStatus(obj);
188
+  await getplatformuserlist();
189
+};
190
+onMounted(() => {
191
+  const current = localStorage.getItem("currentDate");
192
+  if (current) {
193
+    currentDate.value = current;
194
+  }
195
+  getplatformuserlist();
196
+});
197
+</script>
198
+<style scoped lang="scss">
199
+@import "./job.scss";
200
+</style>
201
+<!--  -->

+ 7
- 0
src/views/overview/index.scss 파일 보기

@@ -2,6 +2,13 @@
2 2
 .title {
3 3
   margin-bottom: 20px;
4 4
   :deep(.el-select__wrapper) {
5
+    .el-select__prefix {
6
+      color: #000000 !important;
7
+    }
8
+    .el-select__selected-item {
9
+      font-size: 22px;
10
+    }
11
+
5 12
     background-color: rgb(0 0 0 / 0%);
6 13
     box-shadow: 0 0 0 0 !important;
7 14
 

+ 147
- 151
src/views/overview/index.vue 파일 보기

@@ -7,13 +7,19 @@
7 7
         placeholder="选择电站"
8 8
         popper-class="custom-header"
9 9
         :max-collapse-tags="1"
10
-        style="width: 300px"
10
+        class="Space_content"
11 11
         size="large"
12 12
       >
13
-        <!-- <template #header>
14
-          <el-checkbox> All </el-checkbox>
15
-        </template> -->
16
-        <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" @click="onselect(item)" />
13
+        <el-option
14
+          v-for="(item, index) in cities"
15
+          :key="index"
16
+          :label="item.stationName"
17
+          :value="item.id"
18
+          @click="onselect(item)"
19
+        />
20
+        <template #prefix>
21
+          {{ (cities.find(s => s.id === Singlevalue) || {}).stationName }}
22
+        </template>
17 23
       </el-select>
18 24
     </div>
19 25
     <el-row :gutter="20">
@@ -24,15 +30,24 @@
24 30
               <div class="overview_title_name">今日充电量</div>
25 31
             </div>
26 32
             <div class="overview_title">
27
-              <div class="overview_titlename">{{ multiStation.dayImportKwh }} <span class="overview_unit"> MWh</span></div>
33
+              <div class="overview_titlename">
34
+                {{ formatAmountkwh(multiStation.dayImportKwh) }}
35
+                <span class="overview_unit"> {{ formatCompany(multiStation.dayImportKwh) }}</span>
36
+              </div>
28 37
               <div class="overview_img1">
29 38
                 <img src="../../assets/images/charging.png" alt="站点" />
30 39
               </div>
31 40
             </div>
32
-            <div class="overview_line">较昨日下降: {{ multiStation.importKwhDiffYDay }} MWh</div>
41
+            <div class="overview_line">
42
+              较昨日下降: {{ formatAmountkwh_(multiStation.importKwhDiffYDay) }}
43
+              {{ formatCompany_(multiStation.importKwhDiffYDay) }}
44
+            </div>
33 45
             <el-divider />
34 46
             <div class="overview_line">
35
-              月充电:{{ multiStation.monthImportKwh }} MWh | 累计充电:{{ multiStation.accumulativeImportKwh }} MWh
47
+              本月充电: {{ formatAmountkwh(multiStation.monthImportKwh) }} {{ formatCompany(multiStation.monthImportKwh) }} |
48
+              累计充电:
49
+              {{ formatAmountkwh(multiStation.accumulativeImportKwh) }}
50
+              {{ formatCompany(multiStation.accumulativeImportKwh) }}
36 51
             </div>
37 52
           </div>
38 53
         </el-card>
@@ -44,15 +59,24 @@
44 59
               <div class="overview_title_name">今日放电量</div>
45 60
             </div>
46 61
             <div class="overview_title">
47
-              <div class="overview_titlename">{{ multiStation.dayExportKwh }}<span class="overview_unit"> MWh</span></div>
62
+              <div class="overview_titlename">
63
+                {{ formatAmountkwh(multiStation.dayExportKwh) }}
64
+                <span class="overview_unit"> {{ formatCompany(multiStation.dayExportKwh) }}</span>
65
+              </div>
48 66
               <div class="overview_img2">
49 67
                 <img src="../../assets/images/discharge.png" alt="站点" />
50 68
               </div>
51 69
             </div>
52
-            <div class="overview_line">较昨日下降: {{ multiStation.exportKwhDiffYDay }} MWh</div>
70
+            <div class="overview_line">
71
+              较昨日下降: {{ formatAmountkwh_(multiStation.exportKwhDiffYDay) }}
72
+              {{ formatCompany_(multiStation.exportKwhDiffYDay) }}
73
+            </div>
53 74
             <el-divider />
54 75
             <div class="overview_line">
55
-              月充电:{{ multiStation.monthExportKwh }} MWh | 累计充电:{{ multiStation.accumulativeExportKwh }} MWh
76
+              本月充电: {{ formatAmountkwh(multiStation.monthExportKwh) }} {{ formatCompany(multiStation.monthExportKwh) }} |
77
+              累计充电:
78
+              {{ formatAmountkwh(multiStation.accumulativeExportKwh) }}
79
+              {{ formatCompany(multiStation.accumulativeExportKwh) }}
56 80
             </div>
57 81
           </div>
58 82
         </el-card>
@@ -64,15 +88,23 @@
64 88
               <div class="overview_title_name">今日收益</div>
65 89
             </div>
66 90
             <div class="overview_title">
67
-              <div class="overview_titlename">{{ multiStation.todayProfit }} <span class="overview_unit">元</span></div>
91
+              <div class="overview_titlename">
92
+                {{ formatAmount(multiStation.todayProfit) }}
93
+                <span class="overview_unit">{{ formatAmounts(multiStation.todayProfit) }}</span>
94
+              </div>
68 95
               <div class="overview_img3">
69 96
                 <img src="../../assets/images/qian.png" alt="站点" />
70 97
               </div>
71 98
             </div>
72
-            <div class="overview_line">较昨日下降: {{ multiStation.profitDiffYDay }} 万元</div>
99
+            <div class="overview_line">
100
+              较昨日下降: {{ formatAmount1(multiStation.profitDiffYDay) }}
101
+              {{ formatAmounts2(multiStation.profitDiffYDay) }}
102
+            </div>
73 103
             <el-divider />
74 104
             <div class="overview_line">
75
-              本月收益:{{ multiStation.monthProfit }}万元 | 总收益:{{ multiStation.totalProfit }}万元
105
+              本月收益: {{ formatAmount(multiStation.monthProfit) }} {{ formatAmounts(multiStation.monthProfit) }} | 总收益:
106
+              {{ formatAmount(multiStation.totalProfit) }}
107
+              {{ formatAmounts(multiStation.totalProfit) }}
76 108
             </div>
77 109
           </div>
78 110
         </el-card>
@@ -81,20 +113,23 @@
81 113
         <el-card>
82 114
           <div class="grid-content ep-bg-purple">
83 115
             <div class="overview_title1">
84
-              <div class="overview_title_name">站点总数</div>
116
+              <div class="overview_title_name">设备总数</div>
85 117
             </div>
86 118
             <div class="overview_title">
87
-              <div class="overview_titlename">{{ multiStation.stationTotalCount }}<span class="overview_unit">个</span></div>
119
+              <div class="overview_titlename">{{ multiStation.stationTotalCount }} <span class="overview_unit">个</span></div>
88 120
               <div class="overview_img">
89 121
                 <img src="../../assets/images/gu1.png" alt="站点" />
90 122
               </div>
91 123
             </div>
92 124
             <div class="overview_line">
93
-              在线{{ multiStation.stationTotalCount }}个 \ 离线{{ multiStation.stationOfflineCount }}
125
+              在线 {{ multiStation.stationOnlineCount }} 个 \ 离线 {{ multiStation.stationOfflineCount }} 
94 126
             </div>
95 127
             <el-divider />
96 128
             <div class="overview_line">
97
-              装机功率:{{ multiStation.installedPower }} MWh | 装机容量:{{ multiStation.installedPower }} MWh
129
+              装机功率: {{ formatAmountkwh(multiStation.installedPower) }} {{ formatCompany(multiStation.installedPower) }} |
130
+              装机容量:
131
+              {{ formatAmountkwh(multiStation.installedCap) }}
132
+              {{ formatCompany(multiStation.installedCap) }}
98 133
             </div>
99 134
           </div>
100 135
         </el-card>
@@ -122,6 +157,7 @@
122 157
                 end-placeholder="结束时间"
123 158
                 :default-value="value2"
124 159
                 :disabled-date="pickerOptions"
160
+                value-format="YYYY-MM-DD hh:mm:ss"
125 161
                 @change="onhandleClick"
126 162
               />
127 163
             </div>
@@ -141,7 +177,7 @@
141 177
 
142 178
             <div class="gridpiechartdiv">
143 179
               <div class="gridpiechartnameright">装机总容量</div>
144
-              <div class="gridpiechartnameleft">{{ stationinfodata.installedCap }} MWh</div>
180
+              <div class="gridpiechartnameleft">{{ stationinfodata.installedCap }} kWh</div>
145 181
             </div>
146 182
 
147 183
             <div class="gridpiechartdiv">
@@ -163,7 +199,7 @@
163 199
       </el-col>
164 200
     </el-row>
165 201
     <div class="middle">
166
-      <el-card style="width: 49%">
202
+      <el-card style="width: 100%">
167 203
         <div class="middleleft">
168 204
           <div class="middlelefttop">
169 205
             <div>综合功率</div>
@@ -179,6 +215,7 @@
179 215
                 end-placeholder="结束时间"
180 216
                 :default-value="timedayslist"
181 217
                 :disabled-date="pickerOptions"
218
+                value-format="YYYY-MM-DD hh:mm:ss"
182 219
                 @change="onpowerblur"
183 220
               />
184 221
             </div>
@@ -186,36 +223,11 @@
186 223
           <div class="middleleftchart" ref="comprehensive"></div>
187 224
         </div>
188 225
       </el-card>
189
-      <el-card style="width: 49%">
190
-        <div class="middleright" ref="achievement">
191
-          <div class="middlelefttop">
192
-            <div>放电达成率</div>
193
-
194
-            <div class="middle_divright">
195
-              <div :class="dischargedays == 7 ? 'middle_divright_1' : 'middle_divright_2'" @click="ondischarge(7)">近7日</div>
196
-              <div :class="dischargedays == 31 ? 'middle_divright_1' : 'middle_divright_2'" @click="ondischarge(31)">近31日</div>
197
-              <div :class="dischargedays == 360 ? 'middle_divright_1' : 'middle_divright_2'" @click="ondischarge(360)">
198
-                近12月
199
-              </div>
200
-              <el-date-picker
201
-                v-model="dischargetimedayslist"
202
-                type="daterange"
203
-                start-placeholder="开始时间"
204
-                end-placeholder="结束时间"
205
-                :default-value="dischargetimedayslist"
206
-                :disabled-date="pickerOptions"
207
-                @change="onblur"
208
-              />
209
-            </div>
210
-          </div>
211
-          <div class="middleleftchart" ref="discharge"></div>
212
-        </div>
213
-      </el-card>
214 226
     </div>
215 227
     <el-card>
216 228
       <template #header>
217 229
         <div class="card-header">
218
-          <span>系统列表</span>
230
+          <span>设备列表</span>
219 231
         </div>
220 232
       </template>
221 233
       <div class="cardtable">
@@ -225,15 +237,15 @@
225 237
           <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
226 238
         </el-select>
227 239
         &emsp;
228
-        <el-input v-model="modelinput" style="width: 240px" placeholder="请输入内容" size="large" />
240
+        <el-input v-model="modelinput" style="width: 240px" placeholder="设备编号" size="large" />
229 241
         &emsp;
230 242
         <el-button type="primary" size="large" color="#0052d9" @click="query(0)">查询</el-button>
231 243
         <el-button size="large" @click="query(1)">重置</el-button>
232 244
       </div>
233 245
       <el-table :data="tableData.records" style="width: 100%" border :scrollbar-always-on="true">
234 246
         <el-table-column type="index" label="序号" width="60" />
235
-        <el-table-column prop="emsDeviceId" label="系统编号" width="160" />
236
-        <el-table-column prop="name" label="系统名称" width="160" />
247
+        <el-table-column prop="emsDeviceId" label="设备编号" width="160" />
248
+        <el-table-column prop="name" label="设备名称" width="160" />
237 249
         <el-table-column prop="onlineStatus" label="在线状态" width="160">
238 250
           <template #default="scope">
239 251
             {{ scope.row.onlineStatus == 0 ? "离线" : "在线" }}
@@ -279,7 +291,7 @@
279 291
         </div>
280 292
         <div class="dialog_title">
281 293
           <div class="more_name">装机容量:</div>
282
-          <div class="more_theme">{{ stationinfodata.installedCap }}MWh</div>
294
+          <div class="more_theme">{{ stationinfodata.installedCap }}kWh</div>
283 295
         </div>
284 296
         <div class="dialog_title">
285 297
           <div class="more_name">电站地址:</div>
@@ -334,14 +346,13 @@ import * as echarts from "echarts";
334 346
 import Pagination from "@/components/ProTable/components/Pagination.vue";
335 347
 
336 348
 import {
337
-  gethomesite,
349
+  getmuitiStation,
338 350
   emsSystempage,
339 351
   stationstationName,
340 352
   postsexportKwh,
341 353
   singlestationday,
342 354
   singlestationyearMonth,
343 355
   singlestationchargingMonth,
344
-  postexportKwh,
345 356
   overallEfficiencyday,
346 357
   overallEfficiencyyearMonth,
347 358
   Stationinfo
@@ -368,7 +379,7 @@ const onselect = (val: any) => {
368 379
   gatsinglestationday();
369 380
   postmultiStationpagebaseInfo();
370 381
   oncomprehen(7);
371
-  ondischarge(7);
382
+  getsite();
372 383
 };
373 384
 const cities: Ref<Station.todo[]> = ref([]);
374 385
 
@@ -394,15 +405,16 @@ const poststationstationName = async () => {
394 405
   const { data } = await stationstationName({});
395 406
   Singlevalue.value = data[0].id;
396 407
   cities.value = data;
408
+  getsite();
397 409
   getStationinfo();
398 410
   gatsinglestationday();
399 411
   postmultiStationpagebaseInfo();
400 412
   oncomprehen(7);
401
-  ondischarge(7);
402 413
 };
403 414
 // 选择站点
404 415
 const getsite = async () => {
405
-  const { data } = await gethomesite();
416
+  console.log(Singlevalue.value);
417
+  const { data } = await getmuitiStation(Singlevalue.value);
406 418
   multiStation.value = data;
407 419
 };
408 420
 // 站点信息 查看详细
@@ -528,7 +540,7 @@ const getsinglestationchargingMonth = async () => {
528 540
 
529 541
   baroptionchart(dates, profits);
530 542
 };
531
-// 收益统计237 255 230
543
+// 收益统计
532 544
 const baroptionchart = (dates: string[][], profits: { type: string }[]) => {
533 545
   const baroptionvalue = echarts.init(baroption.value);
534 546
   window.addEventListener(
@@ -553,9 +565,7 @@ const baroptionchart = (dates: string[][], profits: { type: string }[]) => {
553 565
     },
554 566
     xAxis: {
555 567
       type: "category",
556
-      axisLabel: {
557
-        interval: 0 // 显示所有刻度
558
-      }
568
+      axisLabel: {}
559 569
     },
560 570
     yAxis: {
561 571
       type: "value"
@@ -624,11 +634,10 @@ const handleClose = () => {
624 634
 const comprehensive = ref();
625 635
 const timedays = ref(7);
626 636
 const timedayslist = ref();
627
-const onpowerblur = (val: any) => {
628
-  if (!val) {
629
-    getcomprehensiveefficiency();
630
-  }
637
+const onpowerblur = () => {
638
+  getcomprehensiveefficiency();
631 639
 };
640
+
632 641
 const oncomprehen = (val: number) => {
633 642
   // 获取当前日期
634 643
   timedays.value = val;
@@ -666,6 +675,7 @@ const getcomprehensiveefficiency = async () => {
666 675
     Singlevalue.value
667 676
   );
668 677
   const dates = [["profit", "综合效率"]];
678
+
669 679
   for (let index = 0; index < data.list.length; index++) {
670 680
     dates.push([data.list[index].ymd, data.list[index].overallEfficiency.toString()]);
671 681
   }
@@ -727,100 +737,88 @@ const getiveefficiency = (num: any, dates: string[][], profits: { type: string }
727 737
   comprehensivevalue.setOption(option, true);
728 738
 };
729 739
 // 综合效率---------------------------------------------------------------
730
-// 放电达成率---------------------------------------------------------------
731
-const discharge = ref();
732
-const dischargedays = ref(7);
733
-const dischargetimedayslist = ref();
734
-// 选择时间
735
-const onblur = async (val: any) => {
736
-  if (!val) {
737
-    gethttpdischarge();
740
+
741
+// 充电量进位
742
+const formatAmountkwh = (amount: number) => {
743
+  if (amount == undefined) {
744
+    return "1000";
745
+  }
746
+  if (amount < 1000) {
747
+    return amount.toFixed(2);
748
+  } else {
749
+    return (amount / 1000).toFixed(2);
738 750
   }
739 751
 };
740
-const ondischarge = (val: number) => {
741
-  // 获取当前日期
742
-  dischargedays.value = val;
743
-
744
-  const today = new Date();
745
-  const currentDate = today.toLocaleDateString();
746
-
747
-  // 获取过去 7 天的日期
748
-  const sevenDaysAgoDate = new Date(today);
749
-  sevenDaysAgoDate.setDate(today.getDate() - 7);
750
-  const sevenDaysAgo = sevenDaysAgoDate.toLocaleDateString();
751
-
752
-  // 获取过去 31 天的日期
753
-  const thirtyOneDaysAgoDate = new Date(today);
754
-  thirtyOneDaysAgoDate.setDate(today.getDate() - 31);
755
-  const thirtyOneDaysAgo = thirtyOneDaysAgoDate.toLocaleDateString();
756
-
757
-  // 获取去年同月的日期
758
-  const lastYearSameMonthDate = new Date(today.getFullYear() - 1, today.getMonth(), today.getDate());
759
-  const lastYearSameMonth = lastYearSameMonthDate.toLocaleDateString();
760
-  if (val == 7) {
761
-    dischargetimedayslist.value = [sevenDaysAgo, currentDate];
762
-  } else if (val == 31) {
763
-    dischargetimedayslist.value = [thirtyOneDaysAgo, currentDate];
752
+const formatCompany = (amount: number) => {
753
+  if (amount == undefined) {
754
+    return "kWh";
755
+  }
756
+  if (amount < 1000) {
757
+    return "kWh";
764 758
   } else {
765
-    dischargetimedayslist.value = [lastYearSameMonth, currentDate];
759
+    return "MWh";
766 760
   }
767
-  gethttpdischarge();
768 761
 };
769
-const gethttpdischarge = async () => {
770
-  const { data } = await postexportKwh(
771
-    {
772
-      startDate: dischargetimedayslist.value[0],
773
-      endDate: dischargetimedayslist.value[1]
774
-    },
775
-    Singlevalue.value
776
-  );
777
-  const dates = [["profit", "放电达成率"]];
778
-  for (let index = 0; index < data.list.length; index++) {
779
-    dates.push([data.list[index].ymd, data.list[index].dischargeCompletionRate.toString()]);
762
+const formatAmountkwh_ = (amount: number) => {
763
+  if (amount == undefined) {
764
+    return "1000";
765
+  }
766
+  if (amount > -1000) {
767
+    return amount.toFixed(2);
768
+  } else {
769
+    return (amount / 1000).toFixed(2);
780 770
   }
781
-  const profits = [{ type: "line" }];
782
-  // console.log(dates, profits);
783
-
784
-  gethttpchart(data.avgDischargeCompleteRate, dates, profits);
785 771
 };
786
-const gethttpchart = (num: any, dates: string[][], profits: { type: string }[]) => {
787
-  const dischargevalue = echarts.init(discharge.value);
788
-  window.addEventListener(
789
-    "resize",
790
-    () => {
791
-      dischargevalue.resize();
792
-    },
793
-    false
794
-  );
795
-  let option = {
796
-    title: {
797
-      text: `放电达成率${num.toFixed(2)}%`,
798
-      subtext: "效率/%"
799
-    },
800
-    legend: {
801
-      right: 30
802
-    },
803
-    grid: {
804
-      left: "2%",
805
-      right: "4%",
806
-      bottom: "6%",
807
-      containLabel: true
808
-    },
809
-    xAxis: {
810
-      type: "category"
811
-    },
812
-    yAxis: {
813
-      type: "value"
814
-    },
815
-    dataset: {
816
-      source: dates
817
-    },
818
-    series: profits
819
-  };
820
-
821
-  dischargevalue.setOption(option, true);
772
+const formatCompany_ = (amount: number) => {
773
+  if (amount == undefined) {
774
+    return "kWh";
775
+  }
776
+  if (amount > -1000) {
777
+    return "kWh";
778
+  } else {
779
+    return "MWh";
780
+  }
781
+};
782
+const formatAmount = (amount: number) => {
783
+  if (amount == undefined) {
784
+    return "1000";
785
+  }
786
+  if (amount < 10000) {
787
+    return amount.toFixed(2);
788
+  } else {
789
+    return (amount / 10000).toFixed(2);
790
+  }
791
+};
792
+const formatAmounts = (amount: number) => {
793
+  if (amount == undefined) {
794
+    return "元";
795
+  }
796
+  if (amount < 10000) {
797
+    return "元";
798
+  } else {
799
+    return "万元";
800
+  }
801
+};
802
+const formatAmount1 = (amount: number) => {
803
+  if (amount == undefined) {
804
+    return "1000";
805
+  }
806
+  if (amount > -10000) {
807
+    return amount.toFixed(2);
808
+  } else {
809
+    return (amount / 10000).toFixed(2);
810
+  }
811
+};
812
+const formatAmounts2 = (amount: number) => {
813
+  if (amount == undefined) {
814
+    return "元";
815
+  }
816
+  if (amount > -10000) {
817
+    return "元";
818
+  } else {
819
+    return "万元";
820
+  }
822 821
 };
823
-// 放电达成率---------------------------------------------------------------
824 822
 onMounted(() => {
825 823
   const current = localStorage.getItem("currentDate");
826 824
   if (current) {
@@ -834,8 +832,6 @@ onMounted(() => {
834 832
   value2.value = [sevenDaysAgo, currentDate.value];
835 833
   timedayslist.value = [sevenDaysAgo, currentDate.value];
836 834
 
837
-  getsite();
838
-
839 835
   poststationstationName();
840 836
 });
841 837
 </script>

+ 2
- 2
src/views/post/index.vue 파일 보기

@@ -7,7 +7,7 @@
7 7
     <div class="card">
8 8
       <div class="screen">
9 9
         <div>
10
-          岗位编码&ensp;&ensp;<el-input v-model="postCode" style="width: 300px" size="large" placeholder="输入角色名称" />
10
+          岗位编码&ensp;&ensp;<el-input v-model="postCode" style="width: 300px" size="large" placeholder="输入岗位编码" />
11 11
         </div>
12 12
         <div>
13 13
           &ensp;&ensp;&ensp;&ensp;岗位名称&ensp;&ensp;<el-input
@@ -55,7 +55,7 @@
55 55
         <el-table-column label="操作" align="center">
56 56
           <template #default="scope">
57 57
             <el-button color="#0052d9" v-if="BUTTONS.postedit" type="primary" @click="newition(scope.row)">编辑</el-button>
58
-            <el-button v-if="BUTTONS.postedit" @click="onremove(scope.row)">删除</el-button>
58
+            <el-button v-if="BUTTONS.postdelete" @click="onremove(scope.row)">删除</el-button>
59 59
           </template>
60 60
         </el-table-column>
61 61
       </el-table>

+ 79
- 38
src/views/powerStation/addition.vue 파일 보기

@@ -7,16 +7,19 @@
7 7
         <div class="user_left">
8 8
           <el-form ref="formRef" :model="numberValidateForm" label-width="auto" class="demo-ruleForm">
9 9
             <div class="elform">
10
-              <el-form-item label="电站名称" prop="powerName" :rules="[{ required: true, message: '请输入电站名称' }]">
11
-                <el-input
12
-                  v-model.number="numberValidateForm.powerName"
13
-                  style="width: 300px"
14
-                  size="large"
15
-                  type="text"
16
-                  placeholder="请输入电站名称"
17
-                  autocomplete="off"
18
-                />
19
-              </el-form-item>
10
+              <div style="display: flex; align-items: center">
11
+                <el-form-item label="电站名称" prop="powerName" :rules="[{ required: true, message: '请输入电站名称' }]">
12
+                  <el-input
13
+                    v-model="numberValidateForm.powerName"
14
+                    style="width: 300px"
15
+                    size="large"
16
+                    type="text"
17
+                    placeholder="请输入电站名称"
18
+                    autocomplete="off"
19
+                  />
20
+                </el-form-item>
21
+              </div>
22
+
20 23
               <el-form-item label="绑定设备" prop="emsId" :rules="[{ required: true, message: '请选择绑定设备' }]">
21 24
                 <el-select
22 25
                   multiple
@@ -149,35 +152,32 @@
149 152
                 </el-form-item>
150 153
               </div> -->
151 154
 
152
-              <!-- <div class="elform1">
155
+              <div class="elform1">
153 156
                 <el-form-item label="电站图片">
154
-                  <UploadImgs v-model="numberValidateForm.absoluteStationPicUr1" width="300px">
157
+                  <UploadImgs v-model:file-list="absoluteStationPicUr1" width="300px" :limit="9">
155 158
                     <template #empty>
156 159
                       <el-icon><Picture /></el-icon>
157 160
                       <span>请上传电站图片</span>
158 161
                     </template>
159
-                    <template #tip>图片类型 __ jpg丶jpeg丶png丶gif</template>
162
+                    <template #tip>图片类型 __ jpg jpeg png</template>
160 163
                   </UploadImgs>
161 164
                 </el-form-item>
162
-              </div> -->
165
+              </div>
163 166
             </div>
164
-            <!-- <div class="elform">
167
+            <div class="elform">
165 168
               <div class="elform1">
166
-                <el-form-item
167
-                  label="电站图片"
168
-                  prop="absoluteStationPicUr1"
169
-                  :rules="[{ required: true, message: '请选择电站图片' }]"
170
-                >
171
-                  <UploadImgs v-model="numberValidateForm.absoluteStationPicUr1" width="300px">
169
+                <el-form-item label="电站布局图">
170
+                  <UploadImgs v-model:file-list="layoutPicUr1" width="300px" :limit="9">
172 171
                     <template #empty>
173 172
                       <el-icon><Picture /></el-icon>
174 173
                       <span>请上传电站图片</span>
175 174
                     </template>
176
-                    <template #tip>图片类型 __ jpg丶jpeg丶png丶gif</template>
175
+                    <template #tip>图片类型 __ jpg jpeg png</template>
177 176
                   </UploadImgs>
178 177
                 </el-form-item>
179 178
               </div>
180
-            </div> -->
179
+            </div>
180
+
181 181
             <el-divider />
182 182
             <el-form-item class="bottom">
183 183
               <el-button type="primary" @click="submitForm(formRef)">保存</el-button>
@@ -192,8 +192,8 @@
192 192
 <!--    -->
193 193
 <script setup lang="ts">
194 194
 import {
195
-  platformpostedit,
196
-  platformshupostedit,
195
+  updatesingleeditURL,
196
+  editpowerURL,
197 197
   selectemssytemALLURL,
198 198
   insertpowerURL,
199 199
   getlistcountry,
@@ -204,18 +204,20 @@ import {
204 204
 import { CascaderOption, CascaderProps, FormInstance } from "element-plus";
205 205
 import { onMounted, reactive, ref } from "vue";
206 206
 import { useRouter, useRoute } from "vue-router";
207
-// import UploadImgs from "@/components/Upload/Imgs.vue";
207
+import UploadImgs from "@/components/Upload/Imgs.vue";
208 208
 const router = useRouter();
209 209
 const route = useRoute();
210 210
 
211 211
 const formRef = ref<FormInstance>();
212 212
 const supertype = ref(route.query.type);
213 213
 const selectedValue = ref([44]);
214
-
214
+const absoluteStationPicUr1 = ref();
215
+const layoutPicUr1 = ref();
215 216
 const numberValidateForm = reactive({
216
-  id: route.query.id,
217
+  id: "",
217 218
   powerName: "", // 电站名称
218
-  absoluteStationPicUr1: "", // 图片
219
+  url: [], // 图片
220
+  arrangementplan: [],
219 221
   // stationtelephone: "", // 电话
220 222
   emsId: "", //设备id
221 223
   address: "", // 地址
@@ -245,10 +247,15 @@ const submitForm = (formEl: FormInstance | undefined) => {
245 247
     if (valid) {
246 248
       if (route.query.type == "电站新增") {
247 249
         // numberValidateForm.emsId;
250
+
251
+        numberValidateForm.url = absoluteStationPicUr1.value.map((item: { url: any }) => item.url).join(", ");
252
+        numberValidateForm.arrangementplan = layoutPicUr1.value.map((item: { url: any }) => item.url).join(", ");
248 253
         const { data } = await insertpowerURL(numberValidateForm);
249 254
         console.log(data);
250 255
       } else {
251
-        const { data } = await platformpostedit(numberValidateForm);
256
+        numberValidateForm.url = absoluteStationPicUr1.value.map((item: { url: any }) => item.url).join(", ");
257
+        numberValidateForm.arrangementplan = layoutPicUr1.value.map((item: { url: any }) => item.url).join(", ");
258
+        const { data } = await updatesingleeditURL(numberValidateForm);
252 259
         console.log(data);
253 260
       }
254 261
       router.back();
@@ -258,7 +265,7 @@ const submitForm = (formEl: FormInstance | undefined) => {
258 265
     }
259 266
   });
260 267
 };
261
-const selectemsId = ref([]);
268
+const selectemsId = ref();
262 269
 const onselect = () => {
263 270
   numberValidateForm.emsId = selectemsId.value.join();
264 271
 };
@@ -269,16 +276,50 @@ const resetForm = (formEl: FormInstance | undefined) => {
269 276
 };
270 277
 const yonghueditdata = ref();
271 278
 const getghuedit = async () => {
272
-  const { data } = await platformshupostedit(route.query.id);
279
+  const { data } = await editpowerURL(route.query.id, {});
273 280
   yonghueditdata.value = data;
274
-  console.log(yonghueditdata.value);
281
+
282
+  numberValidateForm.id = yonghueditdata.value[0].powerId;
283
+  numberValidateForm.powerName = yonghueditdata.value[0].stationName;
284
+  numberValidateForm.installerName = yonghueditdata.value[0].installerName;
285
+  numberValidateForm.url = yonghueditdata.value[0].url;
286
+  numberValidateForm.arrangementplan = yonghueditdata.value[0].arrangementurl;
287
+  selectemsId.value = [];
288
+  for (let index = 0; index < yonghueditdata.value[0].emsid.length; index++) {
289
+    let a = yonghueditdata.value[0].emsid[index].eid;
290
+    selectemsId.value.push(a);
291
+  }
292
+  numberValidateForm.emsId = yonghueditdata.value[0].emsid;
293
+  // numberValidateForm.address = yonghueditdata.value[0].address;
294
+  numberValidateForm.contactPhone = yonghueditdata.value[0].contactPhone;
295
+  numberValidateForm.installedPower = yonghueditdata.value[0].installedPower;
296
+  numberValidateForm.installedCap = yonghueditdata.value[0].installedCap;
297
+  numberValidateForm.operationDate = yonghueditdata.value[0].operationDate;
298
+  absoluteStationPicUr1.value = [];
299
+  for (let index = 0; index < yonghueditdata.value[0].url.length; index++) {
300
+    absoluteStationPicUr1.value.push({
301
+      url: yonghueditdata.value[0].url[index]
302
+    });
303
+  }
304
+  layoutPicUr1.value = [];
305
+  for (let index = 0; index < yonghueditdata.value[0].arrangementurl.length; index++) {
306
+    layoutPicUr1.value.push({
307
+      url: yonghueditdata.value[0].arrangementurl[index]
308
+    });
309
+  }
310
+  grtselectemssytem();
275 311
 };
276 312
 // 选择设备编码
277 313
 const equipmentdata = ref();
278 314
 const grtselectemssytem = async () => {
279 315
   const { data } = await selectemssytemALLURL({});
280
-  equipmentdata.value = data;
281
-  console.log(data);
316
+  let arr = data;
317
+  console.log(arr);
318
+  const emsidArray = yonghueditdata.value[0].emsid as any[];
319
+  const arrArray = arr as any[];
320
+
321
+  equipmentdata.value = [...emsidArray, ...arrArray];
322
+  console.log(equipmentdata.value);
282 323
 };
283 324
 // 地区
284 325
 const countrydata = ref();
@@ -393,11 +434,11 @@ const oncascader = async (selectedValues: any) => {
393 434
   selectedValue.value = selectedValues;
394 435
 };
395 436
 onMounted(() => {
396
-  if (route.query.type == "岗位编辑") {
397
-    return;
437
+  if (route.query.type == "电站编辑") {
398 438
     getghuedit();
439
+  } else {
440
+    grtselectemssytem();
399 441
   }
400
-  grtselectemssytem();
401 442
 });
402 443
 </script>
403 444
 <!-- 电站 -->

+ 5
- 0
src/views/powerStation/index.scss 파일 보기

@@ -94,3 +94,8 @@
94 94
 .dialog_name {
95 95
   border-right: 1px solid rgb(0 0 0 / 5%);
96 96
 }
97
+.elimageurl {
98
+  display: flex;
99
+  overflow: hidden;
100
+  overflow: auto auto;
101
+}

+ 91
- 22
src/views/powerStation/index.vue 파일 보기

@@ -12,7 +12,7 @@
12 12
         </el-button>
13 13
         <div class="selectsite_right">
14 14
           <div class="tabpane_1">电站状态:</div>
15
-          <el-select v-model="Singlevalue" placeholder="Select" size="large" style="width: 240px" @change="postemsDevice">
15
+          <el-select v-model="Singlevalue" placeholder="电站状态" size="large" style="width: 240px" @change="postemsDevice">
16 16
             <el-option v-for="item in cities" :key="item.id" :label="item.name" :value="item.id" />
17 17
           </el-select>
18 18
           &ensp;&ensp;&ensp;
@@ -25,23 +25,63 @@
25 25
       </div>
26 26
       <el-table :data="tableData.records" style="width: 100%" border>
27 27
         <el-table-column type="index" prop="date" label="序号" width="60" />
28
-        <el-table-column prop="stationName" label="电站名称" width="180" />
29
-        <el-table-column prop="installerName" label="安装人" />
28
+        <el-table-column prop="powerName" label="电站名称" width="180" />
29
+        <el-table-column prop="stationName" label="安装人" />
30 30
         <el-table-column prop="contactPhone" label="安装人电话">
31 31
           <!-- <template #default="scope">
32 32
             {{ scope.row.pcsStatus == "" ? "-" : scope.row.pcsStatus }}
33 33
           </template> -->
34 34
         </el-table-column>
35 35
         <el-table-column prop="installedPower" label="装机功率(MW)" />
36
-        <el-table-column prop="installedCap" label="装机容量(MWh)" />
36
+        <el-table-column prop="installedCap" label="装机容量(kWh)" />
37 37
         <el-table-column prop="country" label="电站地址">
38 38
           <template #default="scope"> {{ scope.row.country }} {{ scope.row.province }} {{ scope.row.city }} </template>
39 39
         </el-table-column>
40 40
         <el-table-column prop="operationDate" label="投运时间" />
41
-        <el-table-column label="操作">
41
+        <el-table-column prop="url" label="电站图片" width="200">
42
+          <template #default="scope">
43
+            <div class="elimageurl">
44
+              <div v-for="(item, index) in scope.row.url" :key="index">
45
+                <el-image
46
+                  style="width: 60px; height: 60px; margin-right: 10px"
47
+                  :src="item"
48
+                  :zoom-rate="1.2"
49
+                  :max-scale="7"
50
+                  :min-scale="0.2"
51
+                  :preview-teleported="true"
52
+                  :preview-src-list="scope.row.url"
53
+                  :initial-index="index"
54
+                  fit="cover"
55
+                />
56
+              </div>
57
+            </div>
58
+          </template>
59
+        </el-table-column>
60
+        <el-table-column prop="arrangementurl" label="设备布局图" width="200">
61
+          <template #default="scope">
62
+            <div class="elimageurl">
63
+              <div v-for="(item, index) in scope.row.arrangementurl" :key="index">
64
+                <el-image
65
+                  style="width: 60px; height: 60px; margin-right: 10px"
66
+                  :src="item"
67
+                  :zoom-rate="1.2"
68
+                  :max-scale="7"
69
+                  :min-scale="0.2"
70
+                  :preview-teleported="true"
71
+                  :preview-src-list="scope.row.url"
72
+                  :initial-index="index"
73
+                  fit="cover"
74
+                />
75
+              </div>
76
+            </div>
77
+          </template>
78
+        </el-table-column>
79
+        <el-table-column label="操作" align="center" width="180">
42 80
           <template #default="scope">
43 81
             <el-button @click="details(scope.row)">查看</el-button>
44
-            <!-- <el-button type="primary" color="#0052d9" @click="newition(scope.row)">编辑</el-button> -->
82
+            <el-button v-if="BUTTONS.powerStationedit" type="primary" color="#0052d9" @click="newition(scope.row)">
83
+              编辑
84
+            </el-button>
45 85
           </template>
46 86
         </el-table-column>
47 87
       </el-table>
@@ -62,11 +102,27 @@
62 102
       <div v-if="informationtype == 1">
63 103
         <div class="more_img">
64 104
           <div class="more_name">电站图片:</div>
65
-          <img class="dialogimg" :src="carditem.absoluteStationPicUrl" alt="" />
105
+          <!-- <img class="dialogimg" :src="carditem.absoluteStationPicUrl" alt="" /> -->
106
+          <div class="elimageurl">
107
+            <div v-for="(item, index) in carditem.url" :key="index">
108
+              <el-image
109
+                style="width: 120px; height: 120px; margin-right: 10px"
110
+                :src="item"
111
+                :zoom-rate="1.2"
112
+                :max-scale="7"
113
+                :min-scale="0.2"
114
+                :preview-teleported="true"
115
+                :preview-src-list="carditem.url"
116
+                :initial-index="index"
117
+                fit="cover"
118
+              />
119
+            </div>
120
+          </div>
66 121
         </div>
122
+
67 123
         <div class="dialog_title">
68 124
           <div class="more_name">电站名称:</div>
69
-          <div class="more_theme">{{ carditem.stationName }}</div>
125
+          <div class="more_theme">{{ carditem.powerName }}</div>
70 126
         </div>
71 127
         <div class="dialog_title">
72 128
           <div class="more_name">装机功率:</div>
@@ -74,7 +130,7 @@
74 130
         </div>
75 131
         <div class="dialog_title">
76 132
           <div class="more_name">装机容量:</div>
77
-          <div class="more_theme">{{ carditem.installedCap }}MWh</div>
133
+          <div class="more_theme">{{ carditem.installedCap }}kWh</div>
78 134
         </div>
79 135
         <div class="dialog_title">
80 136
           <div class="more_name">电站地址:</div>
@@ -91,8 +147,22 @@
91 147
       </div>
92 148
       <div v-if="informationtype == 2">
93 149
         <div class="dialog_title">
94
-          <div class="more_name">安装图片:</div>
95
-          <div class="more_theme">-</div>
150
+          <div class="more_name">安装布局图片:</div>
151
+          <div class="elimageurl">
152
+            <div v-for="(item, index) in carditem.arrangementurl" :key="index">
153
+              <el-image
154
+                style="width: 120px; height: 120px; margin-right: 10px"
155
+                :src="item"
156
+                :zoom-rate="1.2"
157
+                :max-scale="7"
158
+                :min-scale="0.2"
159
+                :preview-teleported="true"
160
+                :preview-src-list="carditem.arrangementurl"
161
+                :initial-index="index"
162
+                fit="cover"
163
+              />
164
+            </div>
165
+          </div>
96 166
         </div>
97 167
         <div class="dialog_title">
98 168
           <div class="more_name">并网点信息:</div>
@@ -128,7 +198,6 @@ import Pagination from "@/components/ProTable/components/Pagination.vue";
128 198
 import { useRouter } from "vue-router";
129 199
 import { useAuthButtons } from "@/hooks/useAuthButtons";
130 200
 const { BUTTONS } = useAuthButtons();
131
-console.log(BUTTONS);
132 201
 
133 202
 const router = useRouter();
134 203
 
@@ -215,20 +284,20 @@ const newaddition = () => {
215 284
     path: "/powerStation/addition",
216 285
     query: {
217 286
       type: "电站新增", // 传递的参数
218
-      id: ""
287
+      id: null
219 288
     }
220 289
   });
221 290
 };
222 291
 // 编辑
223
-// const newition = (row: any) => {
224
-//   router.push({
225
-//     path: "/powerStation/addition",
226
-//     query: {
227
-//       type: "电站编辑", // 传递的参数
228
-//       id: row.id
229
-//     }
230
-//   });
231
-// };
292
+const newition = (row: any) => {
293
+  router.push({
294
+    path: "/powerStation/addition",
295
+    query: {
296
+      type: "电站编辑", // 传递的参数
297
+      id: row.powerId
298
+    }
299
+  });
300
+};
232 301
 onMounted(() => {
233 302
   const current = localStorage.getItem("currentDate");
234 303
   if (current) {

+ 15
- 0
src/views/reportforms/index.scss 파일 보기

@@ -20,6 +20,11 @@
20 20
   align-items: center;
21 21
   width: 100%;
22 22
 }
23
+.tabpanesite {
24
+  display: flex;
25
+  align-items: center;
26
+  justify-content: space-between;
27
+}
23 28
 .tabpane {
24 29
   display: flex;
25 30
   align-items: center;
@@ -159,3 +164,13 @@
159 164
   width: 100%;
160 165
   min-height: 550px;
161 166
 }
167
+.exportright {
168
+  margin-top: 40px;
169
+}
170
+.dropdown {
171
+  display: flex;
172
+  align-items: center;
173
+  justify-content: center;
174
+  width: 100%;
175
+  margin: 20px 0;
176
+}

+ 504
- 83
src/views/reportforms/index.vue 파일 보기

@@ -14,50 +14,81 @@
14 14
       <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
15 15
         <el-tab-pane label="站点汇总" name="站点汇总">
16 16
           <div class="tabdiv">
17
-            <div class="tabpane">
18
-              <div>时间范围:</div>
19
-              <div class="tabpane1">
20
-                <!-- year -->
21
-                <el-date-picker
22
-                  v-if="timetype != 'year'"
23
-                  v-model="timepicker"
24
-                  :type="timetype"
25
-                  start-placeholder="开始时间"
26
-                  end-placeholder="结束时间"
27
-                  :disabled-date="pickerOptions"
28
-                  @change="datepicker"
29
-                  size="large"
30
-                />
31
-                <YearPicker
32
-                  v-if="timetype == 'year'"
33
-                  style="width: 300px"
34
-                  ref="statisticPicker"
35
-                  :label-width="50"
36
-                  :init-year="dateValue"
37
-                  :start-year1="timepicker[0]"
38
-                  :end-year2="timepicker[1]"
39
-                  @update-time-range="updateStatisticYear"
40
-                />
41
-                <el-select
42
-                  v-model="daymonthyearvalue"
43
-                  placeholder="选择日期"
44
-                  size="large"
45
-                  style="width: 80px"
46
-                  @change="getdaymonthyear"
47
-                >
48
-                  <el-option v-for="item in daymonthyear" :key="item.value" :label="item.label" :value="item.value" />
49
-                </el-select>
17
+            <div class="tabpanesite">
18
+              <div class="tabpane">
19
+                <div>时间范围:</div>
20
+                <div class="tabpane1">
21
+                  <!-- year -->
22
+                  <el-date-picker
23
+                    v-if="timetype != 'year'"
24
+                    v-model="timepicker"
25
+                    :type="timetype"
26
+                    start-placeholder="开始时间"
27
+                    end-placeholder="结束时间"
28
+                    :disabled-date="pickerOptions"
29
+                    @change="datepicker"
30
+                    size="large"
31
+                  />
32
+                  <YearPicker
33
+                    v-if="timetype == 'year'"
34
+                    style="width: 300px"
35
+                    ref="statisticPicker"
36
+                    :label-width="50"
37
+                    :init-year="dateValue"
38
+                    :start-year1="timepicker[0]"
39
+                    :end-year2="timepicker[1]"
40
+                    @update-time-range="updateStatisticYear"
41
+                  />
42
+                  <el-select
43
+                    v-model="daymonthyearvalue"
44
+                    placeholder="选择日期"
45
+                    size="large"
46
+                    style="width: 80px"
47
+                    @change="getdaymonthyear"
48
+                  >
49
+                    <el-option v-for="item in daymonthyear" :key="item.value" :label="item.label" :value="item.value" />
50
+                  </el-select>
51
+                </div>
52
+                &ensp;&ensp;
53
+                <el-button type="primary" size="large" color="#0052d9" @click="gatSummary">查询</el-button>
54
+                <el-button size="large" @click="onreset">重置</el-button>
55
+              </div>
56
+
57
+              <div class="exportright" v-if="BUTTONS.export">
58
+                <el-dropdown trigger="click" :hide-on-click="false" @visible-change="onclose">
59
+                  <el-button size="large" type="primary" plain>导出</el-button>
60
+                  <template #dropdown>
61
+                    <el-dropdown-menu v-for="(item, index) in columnList" :key="index">
62
+                      <el-dropdown-item>
63
+                        <el-checkbox @change="oncheck" v-model="item.ifcolumn" :label="item.label" size="large" />
64
+                        <template v-if="item.children">
65
+                          <template v-for="(items, i) in item.children" :key="i">
66
+                            <el-checkbox @change="onchildren" v-model="items.ifcolumn" :label="items.label" size="large" />
67
+                          </template>
68
+                        </template>
69
+                      </el-dropdown-item>
70
+                    </el-dropdown-menu>
71
+                    <div class="dropdown">
72
+                      <el-button @click="onexport" type="primary" plain>确定导出</el-button>
73
+                    </div>
74
+                  </template>
75
+                </el-dropdown>
50 76
               </div>
51
-              &ensp;&ensp;
52
-              <el-button type="primary" size="large" color="#0052d9" @click="gatSummary">查询</el-button>
53
-              <el-button size="large" @click="onreset">重置</el-button>
54
-              <el-button v-if="BUTTONS.export" size="large" @click="onexport" type="primary" plain>导出</el-button>
55 77
             </div>
56 78
             &ensp;&ensp;
57
-
58 79
             <el-table :data="tableData.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
59
-              <el-table-column prop="stationName" label="站点名称" width="150" align="center" />
60
-
80
+              <!-- <el-table-column type="selection" width="55" /> -->
81
+              <template v-for="(item, index) in columnList" :key="index">
82
+                <el-table-column v-if="item.ifcolumn" :label="item.label" :prop="item.prop" align="center">
83
+                  <template v-if="item.children">
84
+                    <template v-for="(items, i) in item.children" :key="i">
85
+                      <el-table-column v-if="items.ifcolumn" :label="items.label" :prop="items.prop" align="center">
86
+                      </el-table-column>
87
+                    </template>
88
+                  </template>
89
+                </el-table-column>
90
+              </template>
91
+              <!-- <el-table-column prop="stationName" label="站点名称" width="150" align="center" />
61 92
               <el-table-column label="充电量(kWh)" align="center">
62 93
                 <el-table-column prop="chargeSharp" label="尖" align="center" />
63 94
                 <el-table-column prop="chargePeak" label="峰" align="center" />
@@ -72,7 +103,7 @@
72 103
                 <el-table-column prop="dischargeValley" label="谷" align="center" />
73 104
                 <el-table-column prop="dischargeTotal" label="总" align="center" />
74 105
               </el-table-column>
75
-              <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" />
106
+              <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" /> -->
76 107
             </el-table>
77 108
           </div>
78 109
         </el-tab-pane>
@@ -84,41 +115,65 @@
84 115
             <div :class="reportformsindex == 3 ? 'tabpane_2' : 'tabpane_1'" @click="onreportforms(3)">月报表</div>
85 116
             <div :class="reportformsindex == 4 ? 'tabpane_2' : 'tabpane_1'" @click="onreportforms(4)">年报表</div>
86 117
           </div>
87
-          <div class="selectsite">
88
-            <div class="tabpane_1">选择站点:</div>
89
-            <el-select v-model="Singlevalue" placeholder="Select" size="large" style="width: 240px" @change="postemsDevice">
90
-              <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
91
-            </el-select>
92
-            &ensp;&ensp;&ensp;&ensp; &ensp;&ensp;
93
-            <div class="tabpane_1">选择日期:</div>
94
-            <div>
95
-              <el-date-picker
96
-                v-if="pickertype != 'year'"
97
-                v-model="starttime"
98
-                :type="pickertype"
99
-                placeholder="选择时间"
100
-                size="large"
101
-                clearable
102
-                :disabled-date="pickerOptions"
103
-                @change="yearstarttime"
104
-              />
105
-              <YearPicker
106
-                v-if="pickertype == 'year'"
107
-                style="width: 300px"
108
-                ref="statisticPicker"
109
-                :label-width="50"
110
-                :init-year="dateValue"
111
-                :start-year1="starttime[0]"
112
-                :end-year2="starttime[1]"
113
-                @update-time-range="updateStatisticYear1"
114
-              />
118
+          <div class="tabpanesite">
119
+            <div class="selectsite">
120
+              <div class="tabpane_1">选择站点:</div>
121
+              <el-select v-model="Singlevalue" placeholder="选择站点" size="large" style="width: 240px" @change="postemsDevice">
122
+                <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
123
+              </el-select>
124
+              &ensp;&ensp;&ensp;&ensp; &ensp;&ensp;
125
+              <div class="tabpane_1">选择日期:</div>
126
+              <div>
127
+                <el-date-picker
128
+                  v-if="pickertype != 'year'"
129
+                  v-model="starttime"
130
+                  :type="pickertype"
131
+                  placeholder="选择时间"
132
+                  size="large"
133
+                  clearable
134
+                  :disabled-date="pickerOptions"
135
+                  @change="yearstarttime"
136
+                />
137
+                <YearPicker
138
+                  v-if="pickertype == 'year'"
139
+                  style="width: 300px"
140
+                  ref="statisticPicker"
141
+                  :label-width="50"
142
+                  :init-year="dateValue"
143
+                  :start-year1="starttime[0]"
144
+                  :end-year2="starttime[1]"
145
+                  @update-time-range="updateStatisticYear1"
146
+                />
147
+              </div>
148
+              &ensp;&ensp;
149
+
150
+              <el-button type="primary" size="large" color="#0052d9" @click="onselectsite">查询</el-button>
151
+              <el-button size="large" @click="onselectreset">重置</el-button>
152
+              &ensp;&ensp;
115 153
             </div>
116
-            &ensp;&ensp;
117 154
 
118
-            <el-button type="primary" size="large" color="#0052d9" @click="onselectsite">查询</el-button>
119
-            <el-button size="large" @click="onselectreset">重置</el-button>
120
-            <div style="margin-left: 14px" v-if="BUTTONS.export">
155
+            <!-- <div style="margin-left: 14px" v-if="BUTTONS.export">
121 156
               <el-button size="large" @click="singleexport" type="primary" plain v-if="reportformsindex != 1">导出</el-button>
157
+            </div> -->
158
+            <div class="exportright" v-if="BUTTONS.export && reportformsindex != 1">
159
+              <el-dropdown trigger="click" :hide-on-click="false" @visible-change="onsingleclose">
160
+                <el-button size="large" type="primary" plain>导出</el-button>
161
+                <template #dropdown>
162
+                  <el-dropdown-menu v-for="(item, index) in singlecolumnList" :key="index">
163
+                    <el-dropdown-item>
164
+                      <el-checkbox @change="onsingle" v-model="item.ifcolumn" :label="item.label" size="large" />
165
+                      <template v-if="item.children">
166
+                        <template v-for="(items, i) in item.children" :key="i">
167
+                          <el-checkbox @change="onsinglechildren" v-model="items.ifcolumn" :label="items.label" size="large" />
168
+                        </template>
169
+                      </template>
170
+                    </el-dropdown-item>
171
+                  </el-dropdown-menu>
172
+                  <div class="dropdown">
173
+                    <el-button @click="singleexport" type="primary" plain>确定导出</el-button>
174
+                  </div>
175
+                </template>
176
+              </el-dropdown>
122 177
             </div>
123 178
           </div>
124 179
           <div v-if="reportformsindex == 1">
@@ -164,7 +219,7 @@
164 219
               <div class="trendchartchart" ref="columnchart"></div>
165 220
             </div>
166 221
             <div class="Line_chart" v-if="chartindex == 3">
167
-              <div class="columntable">
222
+              <div class="columntable" v-if="tablelist.list">
168 223
                 <el-table :data="tablelist.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
169 224
                   <el-table-column prop="ymdHour" label="时间" width="150" align="center">
170 225
                     <template #default="scope">
@@ -210,8 +265,18 @@
210 265
           </div>
211 266
           <div class="dailyreport" v-else>
212 267
             <el-table :data="betweenyear.list" style="width: 100%" align="center" :show-overflow-tooltip="true">
213
-              <!-- <el-table-column prop="year" label="日期" width="150" align="center" /> -->
214
-              <el-table-column label="日期" width="150" align="center">
268
+              <template v-for="(item, index) in singlecolumnList" :key="index">
269
+                <el-table-column v-if="item.ifcolumn" :label="item.label" :prop="item.prop" align="center">
270
+                  <template v-if="item.children">
271
+                    <template v-for="(items, i) in item.children" :key="i">
272
+                      <el-table-column v-if="items.ifcolumn" :label="items.label" :prop="items.prop" align="center">
273
+                      </el-table-column>
274
+                    </template>
275
+                  </template>
276
+                </el-table-column>
277
+              </template>
278
+
279
+              <!-- <el-table-column label="日期" width="150" align="center">
215 280
                 <template #default="scope">
216 281
                   <div v-if="scope.row.ymd">{{ scope.row.ymd }}</div>
217 282
                   <div v-if="scope.row.ym">{{ scope.row.ym }}</div>
@@ -232,7 +297,7 @@
232 297
                 <el-table-column prop="dischargeValley" label="谷" align="center" />
233 298
                 <el-table-column prop="dischargeTotal" label="总" align="center" />
234 299
               </el-table-column>
235
-              <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" />
300
+              <el-table-column prop="overallEfficiency" label="综合效率(%)" width="150" align="center" /> -->
236 301
             </el-table>
237 302
           </div>
238 303
         </el-tab-pane>
@@ -240,6 +305,7 @@
240 305
     </el-card>
241 306
   </div>
242 307
 </template>
308
+<!--    -->
243 309
 <script setup lang="ts">
244 310
 import { onMounted, Ref, ref } from "vue";
245 311
 import {
@@ -263,10 +329,167 @@ import {
263 329
 } from "@/api/home/Multisite";
264 330
 import { useAuthButtons } from "@/hooks/useAuthButtons";
265 331
 const { BUTTONS } = useAuthButtons();
266
-
267 332
 import YearPicker from "@/components/year/index.vue";
268 333
 import * as echarts from "echarts";
269 334
 import { other, Station } from "@/api/interface";
335
+// 汇总表头
336
+const columnList = ref([
337
+  {
338
+    prop: "stationName",
339
+    label: "日期",
340
+    ifcolumn: true,
341
+    children: null
342
+  },
343
+  {
344
+    prop: "",
345
+    label: "充电量(kWh)",
346
+    ifcolumn: true,
347
+    children: [
348
+      {
349
+        prop: "chargeSharp",
350
+        label: "尖",
351
+        ifcolumn: true
352
+      },
353
+      {
354
+        prop: "chargePeak",
355
+        label: "峰",
356
+        ifcolumn: true
357
+      },
358
+      {
359
+        prop: "chargeShoulder",
360
+        label: "平",
361
+        ifcolumn: true
362
+      },
363
+      {
364
+        prop: "chargeValley",
365
+        label: "谷",
366
+        ifcolumn: true
367
+      },
368
+      {
369
+        prop: "chargeTotal",
370
+        label: "总",
371
+        ifcolumn: true
372
+      }
373
+    ]
374
+  },
375
+  {
376
+    prop: "",
377
+    label: "放电量(kWh)",
378
+    ifcolumn: true,
379
+    children: [
380
+      {
381
+        prop: "dischargeSharp",
382
+        label: "尖",
383
+        ifcolumn: true
384
+      },
385
+      {
386
+        prop: "dischargePeak",
387
+        label: "峰",
388
+        ifcolumn: true
389
+      },
390
+      {
391
+        prop: "dischargeShoulder",
392
+        label: "平",
393
+        ifcolumn: true
394
+      },
395
+      {
396
+        prop: "dischargeValley",
397
+        label: "谷",
398
+        ifcolumn: true
399
+      },
400
+      {
401
+        prop: "dischargeTotal",
402
+        label: "总",
403
+        ifcolumn: true
404
+      }
405
+    ]
406
+  },
407
+  {
408
+    prop: "overallEfficiency",
409
+    label: "综合效率(%)",
410
+    ifcolumn: true,
411
+    children: null
412
+  }
413
+]);
414
+// 单站报表表头
415
+const singlecolumnList = ref([
416
+  {
417
+    prop: "andTime",
418
+    label: "日期",
419
+    ifcolumn: true,
420
+    children: null
421
+  },
422
+  {
423
+    prop: "",
424
+    label: "充电量(kWh)",
425
+    ifcolumn: true,
426
+    children: [
427
+      {
428
+        prop: "chargeSharp",
429
+        label: "尖",
430
+        ifcolumn: true
431
+      },
432
+      {
433
+        prop: "chargePeak",
434
+        label: "峰",
435
+        ifcolumn: true
436
+      },
437
+      {
438
+        prop: "chargeShoulder",
439
+        label: "平",
440
+        ifcolumn: true
441
+      },
442
+      {
443
+        prop: "chargeValley",
444
+        label: "谷",
445
+        ifcolumn: true
446
+      },
447
+      {
448
+        prop: "chargeTotal",
449
+        label: "总",
450
+        ifcolumn: true
451
+      }
452
+    ]
453
+  },
454
+  {
455
+    prop: "",
456
+    label: "放电量(kWh)",
457
+    ifcolumn: true,
458
+    children: [
459
+      {
460
+        prop: "dischargeSharp",
461
+        label: "尖",
462
+        ifcolumn: true
463
+      },
464
+      {
465
+        prop: "dischargePeak",
466
+        label: "峰",
467
+        ifcolumn: true
468
+      },
469
+      {
470
+        prop: "dischargeShoulder",
471
+        label: "平",
472
+        ifcolumn: true
473
+      },
474
+      {
475
+        prop: "dischargeValley",
476
+        label: "谷",
477
+        ifcolumn: true
478
+      },
479
+      {
480
+        prop: "dischargeTotal",
481
+        label: "总",
482
+        ifcolumn: true
483
+      }
484
+    ]
485
+  },
486
+  {
487
+    prop: "overallEfficiency",
488
+    label: "综合效率(%)",
489
+    ifcolumn: true,
490
+    children: null
491
+  }
492
+]);
270 493
 const currentDate = ref();
271 494
 const activeName = ref("站点汇总");
272 495
 const timepicker: Ref<any> = ref([]);
@@ -279,6 +502,7 @@ const handleClick = (val: any) => {
279 502
     timepicker.value = [currentDate, currentDate];
280 503
     getreportpowerday();
281 504
   } else {
505
+    chartindex.value = 1;
282 506
     poststationstationName();
283 507
   }
284 508
 };
@@ -358,10 +582,151 @@ const gatSummary = () => {
358 582
 const onreset = () => {
359 583
   getdaymonthyear(1);
360 584
 };
585
+const onclose = (val: boolean) => {
586
+  console.log(val);
587
+  setTimeout(() => {
588
+    if (!val) {
589
+      for (const column of columnList.value) {
590
+        column.ifcolumn = true;
591
+
592
+        if (column.children) {
593
+          for (const child of column.children) {
594
+            child.ifcolumn = true;
595
+          }
596
+        }
597
+      }
598
+    }
599
+  }, 500); // 延迟 0.5毫秒
600
+};
601
+const onsingleclose = (val: boolean) => {
602
+  console.log(val);
603
+  setTimeout(() => {
604
+    if (!val) {
605
+      for (const column of singlecolumnList.value) {
606
+        column.ifcolumn = true;
607
+
608
+        if (column.children) {
609
+          for (const child of column.children) {
610
+            child.ifcolumn = true;
611
+          }
612
+        }
613
+      }
614
+    }
615
+  }, 500); // 延迟 0.5毫秒
616
+};
617
+// 点击汇总父元素多选
618
+const oncheck = () => {
619
+  if (columnList.value) {
620
+    for (let index = 0; index < columnList.value.length; index++) {
621
+      const column = columnList.value[index];
622
+      if (column && !column.ifcolumn) {
623
+        if (column.children && column.prop == "") {
624
+          for (let i = 0; i < column.children.length; i++) {
625
+            const child = column.children[i];
626
+            child.ifcolumn = false;
627
+          }
628
+        }
629
+      } else {
630
+        if (column.children && column.prop == "") {
631
+          for (let i = 0; i < column.children.length; i++) {
632
+            const child = column.children[i];
633
+            child.ifcolumn = true;
634
+          }
635
+        }
636
+      }
637
+    }
638
+  }
639
+};
640
+// 点击汇总子元素
641
+const onchildren = () => {
642
+  if (columnList.value) {
643
+    for (let index = 0; index < columnList.value.length; index++) {
644
+      const column = columnList.value[index];
645
+      if (column.children && column.prop == "") {
646
+        for (let i = 0; i < column.children.length; i++) {
647
+          const child = column.children[i];
648
+          console.log(child);
649
+
650
+          if (child && !child.ifcolumn) {
651
+            column.ifcolumn = false;
652
+          } else {
653
+            column.ifcolumn = true;
654
+            return;
655
+          }
656
+        }
657
+      }
658
+    }
659
+  }
660
+};
661
+// 点击单站父元素多选
662
+const onsingle = () => {
663
+  if (singlecolumnList.value) {
664
+    for (let index = 0; index < singlecolumnList.value.length; index++) {
665
+      const column = singlecolumnList.value[index];
666
+      if (column && !column.ifcolumn) {
667
+        if (column.children && column.prop == "") {
668
+          for (let i = 0; i < column.children.length; i++) {
669
+            const child = column.children[i];
670
+            child.ifcolumn = false;
671
+          }
672
+        }
673
+      } else {
674
+        if (column.children && column.prop == "") {
675
+          for (let i = 0; i < column.children.length; i++) {
676
+            const child = column.children[i];
677
+            child.ifcolumn = true;
678
+          }
679
+        }
680
+      }
681
+    }
682
+  }
683
+};
684
+// 点击单站子元素
685
+const onsinglechildren = () => {
686
+  if (singlecolumnList.value) {
687
+    for (let index = 0; index < singlecolumnList.value.length; index++) {
688
+      const column = singlecolumnList.value[index];
689
+      if (column.children && column.prop == "") {
690
+        for (let i = 0; i < column.children.length; i++) {
691
+          const child = column.children[i];
692
+          console.log(child);
693
+
694
+          if (child && !child.ifcolumn) {
695
+            column.ifcolumn = false;
696
+          } else {
697
+            column.ifcolumn = true;
698
+            return;
699
+          }
700
+        }
701
+      }
702
+    }
703
+  }
704
+};
361 705
 // 导出
362 706
 const onexport = async () => {
707
+  let obj: string[] = []; // 假设 prop 是 string 类型,如果不是,请根据实际类型修改
708
+
709
+  if (columnList.value) {
710
+    for (const column of columnList.value) {
711
+      if (column?.ifcolumn) {
712
+        if (column.prop) {
713
+          obj.push(column.prop);
714
+        }
715
+        if (column.children) {
716
+          for (const child of column.children) {
717
+            if (child?.ifcolumn && child.prop) {
718
+              obj.push(child.prop);
719
+            }
720
+          }
721
+        }
722
+      }
723
+    }
724
+  }
725
+  const jsonString = obj.join(",");
726
+
363 727
   if (daymonthyearvalue.value == 1) {
364 728
     let obj = {
729
+      excel: jsonString,
365 730
       startDate: timepicker.value[0],
366 731
       endDate: timepicker.value[1]
367 732
     };
@@ -369,6 +734,8 @@ const onexport = async () => {
369 734
     downloadxlsx(timepicker.value[0], data);
370 735
   } else if (daymonthyearvalue.value == 2) {
371 736
     let obj = {
737
+      excel: jsonString,
738
+
372 739
       startYearMonth: timepicker.value[0],
373 740
       endYearMonth: timepicker.value[1]
374 741
     };
@@ -376,6 +743,7 @@ const onexport = async () => {
376 743
     downloadxlsx(timepicker.value[0], data);
377 744
   } else if (daymonthyearvalue.value == 3) {
378 745
     let obj = {
746
+      excel: jsonString,
379 747
       startYear: timepicker.value[0],
380 748
       endYear: timepicker.value[1]
381 749
     };
@@ -563,10 +931,31 @@ const onselectsite = async () => {
563 931
 const onselectreset = async () => {
564 932
   onreportforms(1);
565 933
 };
566
-// 导出
934
+
567 935
 const singleexport = async () => {
936
+  let obj: string[] = []; // 假设 prop 是 string 类型,如果不是,请根据实际类型修改
937
+
938
+  if (singlecolumnList.value) {
939
+    for (const column of singlecolumnList.value) {
940
+      if (column?.ifcolumn) {
941
+        if (column.prop) {
942
+          obj.push(column.prop);
943
+        }
944
+        if (column.children) {
945
+          for (const child of column.children) {
946
+            if (child?.ifcolumn && child.prop) {
947
+              obj.push(child.prop);
948
+            }
949
+          }
950
+        }
951
+      }
952
+    }
953
+  }
954
+  const jsonString = obj.join(",");
568 955
   if (reportformsindex.value == 2) {
569 956
     let obj = {
957
+      excel: jsonString,
958
+
570 959
       startTime: starttime.value[0],
571 960
       endTime: starttime.value[1]
572 961
     };
@@ -574,6 +963,8 @@ const singleexport = async () => {
574 963
     downloadxlsx(starttime.value[0], data);
575 964
   } else if (reportformsindex.value == 3) {
576 965
     let obj = {
966
+      excel: jsonString,
967
+
577 968
       startYearMonth: starttime.value[0],
578 969
       endYearMonth: starttime.value[1]
579 970
     };
@@ -581,6 +972,7 @@ const singleexport = async () => {
581 972
     downloadxlsx(starttime.value[0], data);
582 973
   } else if (reportformsindex.value == 4) {
583 974
     let obj = {
975
+      excel: jsonString,
584 976
       startYear: starttime.value[0],
585 977
       endYear: starttime.value[1]
586 978
     };
@@ -718,9 +1110,14 @@ const getemsSystemsingleStation = async () => {
718 1110
 };
719 1111
 const getreportsingleStationoriginal = async () => {
720 1112
   const { data } = await reportsingleStationoriginal({ dateType: rawdataid.value }, Singlevalue.value, singleid.value);
721
-  ondatachart(data);
1113
+  if (data) {
1114
+    ondatachart(data);
1115
+  }
722 1116
 };
723 1117
 const ondatachart = (data: any) => {
1118
+  if (data.length == 0) {
1119
+    return;
1120
+  }
724 1121
   const valueList = data.map(function (item: any) {
725 1122
     return item.accumulativeExportKwh;
726 1123
   }); // 充电
@@ -929,9 +1326,12 @@ const getsingleStationtable = async () => {
929 1326
     date: starttime.value
930 1327
   };
931 1328
   const { data } = await singleStationtable(obj, Singlevalue.value);
932
-  data.total.ymdHour = "合计";
933
-  data.list.push(data.total);
934
-  tablelist.value = data;
1329
+  if (data.list.length > 0) {
1330
+    data.total.ymdHour = "合计";
1331
+    data.list.push(data.total);
1332
+    tablelist.value = data;
1333
+  }
1334
+
935 1335
   // tablelist.value = data;
936 1336
 };
937 1337
 // 电量报表-单站_日月年报表
@@ -946,6 +1346,13 @@ const getsingleStationyear = async () => {
946 1346
   betweenyear.value = data;
947 1347
   data.total.ymd = "合计";
948 1348
   betweenyear.value.list.push(data.total);
1349
+  betweenyear.value.list = betweenyear.value.list.map((item: { ymd: any }) => {
1350
+    return {
1351
+      ...item,
1352
+      andTime: item.ymd,
1353
+      ymd: undefined // 如果需要完全删除 ymd 键,可以设置为 undefined
1354
+    };
1355
+  });
949 1356
 };
950 1357
 const getelectricitylevelyearMonth = async () => {
951 1358
   let obj = {
@@ -957,6 +1364,13 @@ const getelectricitylevelyearMonth = async () => {
957 1364
   betweenyear.value = data;
958 1365
   data.total.ym = "合计";
959 1366
   betweenyear.value.list.push(data.total);
1367
+  betweenyear.value.list = betweenyear.value.list.map((item: { ym: any }) => {
1368
+    return {
1369
+      ...item,
1370
+      andTime: item.ym,
1371
+      ym: undefined // 如果需要完全删除 ymd 键,可以设置为 undefined
1372
+    };
1373
+  });
960 1374
 };
961 1375
 const getelectricitylevelyear = async () => {
962 1376
   let obj = {
@@ -968,6 +1382,13 @@ const getelectricitylevelyear = async () => {
968 1382
   betweenyear.value = data;
969 1383
   data.total.year = "合计";
970 1384
   betweenyear.value.list.push(data.total);
1385
+  betweenyear.value.list = betweenyear.value.list.map((item: { year: any }) => {
1386
+    return {
1387
+      ...item,
1388
+      andTime: item.year,
1389
+      year: undefined // 如果需要完全删除 ymd 键,可以设置为 undefined
1390
+    };
1391
+  });
971 1392
 };
972 1393
 onMounted(() => {
973 1394
   const current = localStorage.getItem("currentDate");

+ 2
- 0
src/views/role/index.vue 파일 보기

@@ -62,6 +62,8 @@
62 62
           </template>
63 63
         </el-table-column>
64 64
         <el-table-column prop="createTime" label="创建时间" />
65
+        <el-table-column prop="remark" label="备注" />
66
+
65 67
         <el-table-column label="操作" align="center">
66 68
           <template #default="scope">
67 69
             <el-button v-if="BUTTONS.roleedit" color="#0052d9" type="primary" @click="newition(scope.row)">编辑</el-button>

+ 7
- 3
src/views/station/index.vue 파일 보기

@@ -89,9 +89,13 @@
89 89
               <el-card>
90 90
                 <div class="el_card">
91 91
                   <div>
92
-                    <div class="el_cardname">{{ item.installedCap }} <span class="el_cardunit">MWh</span></div>
92
+                    <div class="el_cardname">{{ item.installedCap }} <span class="el_cardunit">kWh</span></div>
93 93
                     <div class="topcard_title">装机容量</div>
94 94
                   </div>
95
+                  <!-- <div>
96
+                    <div class="el_cardname">{{ item.installedCap }} <span class="el_cardunit">台/套</span></div>
97
+                    <div class="topcard_title">装机设备</div>
98
+                  </div> -->
95 99
                   <div>
96 100
                     <div class="el_cardname">{{ item.installedPower }} <span class="el_cardunit">MW</span></div>
97 101
                     <div class="topcard_title">装机功率</div>
@@ -144,7 +148,7 @@
144 148
           </div>
145 149
           <div class="dialog_title">
146 150
             <div class="more_name">装机容量:</div>
147
-            <div class="more_theme">{{ carditem.installedCap }}MWh</div>
151
+            <div class="more_theme">{{ carditem.installedCap }}kWh</div>
148 152
           </div>
149 153
           <div class="dialog_title">
150 154
             <div class="more_name">电站地址:</div>
@@ -465,5 +469,5 @@ onMounted(() => {
465 469
 @import "./index.scss";
466 470
 </style>
467 471
 <!--
468
- 
472
+
469 473
 -->

+ 10
- 0
src/views/system/index.scss 파일 보기

@@ -2,6 +2,13 @@
2 2
 .title {
3 3
   display: flex;
4 4
   :deep(.el-select__wrapper) {
5
+    .el-select__prefix {
6
+      color: #000000 !important;
7
+    }
8
+    .el-select__selected-item {
9
+      font-size: 22px;
10
+    }
11
+
5 12
     background-color: rgb(0 0 0 / 0%);
6 13
     box-shadow: 0 0 0 0 !important;
7 14
 
@@ -186,6 +193,7 @@
186 193
 .Boxdiv {
187 194
   width: 100%;
188 195
   height: 674px;
196
+  overflow: auto;
189 197
   border: 1px solid #e7e7e7;
190 198
 }
191 199
 .Boxdiv_ {
@@ -335,6 +343,7 @@
335 343
   border: 1px solid #e7e7e7;
336 344
 }
337 345
 .income_title {
346
+  box-sizing: border-box;
338 347
   display: flex;
339 348
 }
340 349
 .income_title1 {
@@ -412,6 +421,7 @@
412 421
   justify-content: center;
413 422
   width: 120px;
414 423
   height: 48px;
424
+  border-right: 1px solid #e7e7e7;
415 425
   border-bottom: 1px solid #e7e7e7;
416 426
 }
417 427
 .income_ul_right {

+ 24
- 12
src/views/system/index.vue 파일 보기

@@ -7,23 +7,29 @@
7 7
         placeholder="选择电站"
8 8
         popper-class="custom-header"
9 9
         :max-collapse-tags="1"
10
-        style="width: 300px"
10
+        class="Space_content"
11 11
         size="large"
12 12
         @change="postemsDevice"
13 13
       >
14
-        <el-option v-for="item in cities" :key="item.id" :label="item.stationName" :value="item.id" />
14
+        <el-option v-for="(item, index) in cities" :key="index" :label="item.stationName" :value="item.id" />
15
+        <template #prefix>
16
+          {{ (cities.find(s => s.id === Singlevalue) || {}).stationName }}
17
+        </template>
15 18
       </el-select>
16 19
       <div class="title_"></div>
17 20
       <el-select
18 21
         v-model="emsDeviceId"
19 22
         collapse-tags
20
-        placeholder="选择设备编号"
23
+        placeholder="选择编号"
21 24
         popper-class="custom-header"
22 25
         :max-collapse-tags="1"
23
-        style="width: 240px"
26
+        class="Space_content"
24 27
         size="large"
25 28
         @change="getstationrealtime"
26 29
       >
30
+        <template #prefix>
31
+          {{ (emsDevice.find(s => s.id === emsDeviceId) || {}).id }}
32
+        </template>
27 33
         <el-option v-for="item in emsDevice" :key="item.id" :label="item.emsDeviceId" :value="item.id" />
28 34
       </el-select>
29 35
     </div>
@@ -40,25 +46,25 @@
40 46
               <div class="real_timediv">
41 47
                 <el-card>
42 48
                   <div class="real_timename">今日充电量</div>
43
-                  <div class="real_timeunit">{{ realtime.dayImportKwh }}<span class="real_timeunitcss">kwh</span></div>
49
+                  <div class="real_timeunit">{{ realtime.dayImportKwh }}<span class="real_timeunitcss">kWh</span></div>
44 50
                 </el-card>
45 51
               </div>
46 52
               <div class="real_timediv">
47 53
                 <el-card>
48 54
                   <div class="real_timename">今日放电量</div>
49
-                  <div class="real_timeunit">{{ realtime.dayExportKwh }} <span class="real_timeunitcss">kwh</span></div>
55
+                  <div class="real_timeunit">{{ realtime.dayExportKwh }} <span class="real_timeunitcss">kWh</span></div>
50 56
                 </el-card>
51 57
               </div>
52 58
               <div class="real_timediv">
53 59
                 <el-card>
54 60
                   <div class="real_timename">累计充电量</div>
55
-                  <div class="real_timeunit">{{ realtime.accumulativeImportKwh }} <span class="real_timeunitcss">MWh</span></div>
61
+                  <div class="real_timeunit">{{ realtime.accumulativeImportKwh }} <span class="real_timeunitcss">kWh</span></div>
56 62
                 </el-card>
57 63
               </div>
58 64
               <div class="real_timediv">
59 65
                 <el-card>
60 66
                   <div class="real_timename">累计放电量</div>
61
-                  <div class="real_timeunit">{{ realtime.accumulativeExportKwh }} <span class="real_timeunitcss">MWh</span></div>
67
+                  <div class="real_timeunit">{{ realtime.accumulativeExportKwh }} <span class="real_timeunitcss">kWh</span></div>
62 68
                 </el-card>
63 69
               </div>
64 70
               <div class="real_timediv">
@@ -350,8 +356,13 @@ const poststationstationName = async () => {
350 356
 const postemsDevice = async () => {
351 357
   emsDevice.value = [];
352 358
   const { data } = await postemsSystemsingleStation({}, Singlevalue.value);
359
+  if (data.length == 0) {
360
+    emsDeviceId.value = "";
361
+    return;
362
+  } else {
363
+    emsDeviceId.value = data[0].id;
364
+  }
353 365
 
354
-  emsDeviceId.value = data[0].id ?? "";
355 366
   emsDevice.value = data;
356 367
   getstationrealtime();
357 368
 };
@@ -367,6 +378,8 @@ const realtime: Ref<Station.realtimeinfo> = ref({
367 378
 const getstationrealtime = async () => {
368 379
   const { data } = await poststationrealtime({}, Singlevalue.value, emsDeviceId.value);
369 380
   realtime.value = data;
381
+  console.log(data);
382
+
370 383
   await getpoststationdevice();
371 384
   await getstationsystem();
372 385
   await getstationdevice();
@@ -788,11 +801,10 @@ const gatrevenue = async () => {
788 801
   };
789 802
   const { data } = await postelectricityrevenue(obj, Singlevalue.value, emsDeviceId.value);
790 803
   console.log(data);
791
-  data.list.forEach(item => {
792
-    item["ymdHour"] = item["ymdHour"].substring(11, item["ymdHour"].length);
793
-  });
804
+
794 805
   incomedata.value = data;
795 806
 };
807
+
796 808
 onMounted(() => {
797 809
   const current = localStorage.getItem("currentDate");
798 810
   if (current) {

+ 1
- 1
src/views/user/index.vue 파일 보기

@@ -9,7 +9,7 @@
9 9
     <div class="card">
10 10
       <div class="screen">
11 11
         <div class="screen_view">
12
-          账号&ensp;&ensp;<el-input v-model="loginName" style="width: 70%" size="large" placeholder="输入登录名称" />
12
+          登录账号&ensp;&ensp;<el-input v-model="loginName" style="width: 70%" size="large" placeholder="输入登录账号" />
13 13
         </div>
14 14
         <div class="screen_view">
15 15
           用户状态&ensp;&ensp;<el-select v-model="status" placeholder="请选择用户状态" size="large" style="width: 70%">

+ 46
- 0
src/views/userinformation/index.scss 파일 보기

@@ -0,0 +1,46 @@
1
+.screen {
2
+  display: flex;
3
+  width: 100%;
4
+  margin-bottom: 20px;
5
+}
6
+.screen1 {
7
+  display: flex;
8
+  justify-content: space-between;
9
+  width: 100%;
10
+}
11
+.cardbottom {
12
+  margin-top: 20px;
13
+}
14
+.title {
15
+  display: flex;
16
+  align-items: center;
17
+  margin-bottom: 20px;
18
+  font-size: 18px;
19
+  .title_time {
20
+    margin-left: 10px;
21
+    font-size: 16px;
22
+  }
23
+}
24
+.user {
25
+  display: flex;
26
+  align-items: center;
27
+  margin-top: 40px;
28
+}
29
+.user_to {
30
+  width: 60px;
31
+  height: 60px;
32
+  margin-left: 20px;
33
+  border-radius: 100%;
34
+}
35
+.user_div {
36
+  margin-left: 20px;
37
+}
38
+.bottom {
39
+  position: fixed;
40
+  bottom: 80px;
41
+  left: 80px;
42
+  display: flex;
43
+  justify-content: center;
44
+  width: 100%;
45
+  margin-top: 40px;
46
+}

+ 95
- 0
src/views/userinformation/index.vue 파일 보기

@@ -0,0 +1,95 @@
1
+<template>
2
+  <div>
3
+    <div class="title">
4
+      角色管理
5
+      <div class="title_time">{{ currentDate }}</div>
6
+    </div>
7
+    <div class="card">
8
+      <div class="user">
9
+        头像:
10
+        <div class="user_div">
11
+          <UploadImg v-model:image-url="absoluteStationPicUr1" :drag="false" border-radius="50%"> </UploadImg>
12
+        </div>
13
+      </div>
14
+      <div class="user">
15
+        昵称:<span class="user_div">{{ userdata.user.userName }}</span>
16
+      </div>
17
+      <div class="user">
18
+        部门:<span class="user_div">{{ userdata.user.dept.deptName }}</span>
19
+      </div>
20
+      <div class="user">
21
+        角色:<span class="user_div">{{ userdata.user.roles[0].roleName }}</span>
22
+      </div>
23
+      <div class="user">
24
+        账号:<span class="user_div">{{ userdata.user.loginName }}</span>
25
+      </div>
26
+      <div class="user">
27
+        性别:<span class="user_div">{{ userdata.user.userName == 0 ? "男" : "女" }}</span>
28
+      </div>
29
+      <div class="user">
30
+        电话:<span class="user_div">{{ userdata.user.phonenumber }}</span>
31
+      </div>
32
+      <div class="user">
33
+        邮箱:<span class="user_div">{{ userdata.user.email }}</span>
34
+      </div>
35
+      <div class="user">
36
+        创建时间:<span class="user_div">{{ userdata.user.createTime }}</span>
37
+      </div>
38
+      <div class="user">
39
+        备注:<span class="user_div">{{ userdata.user.remark }}</span>
40
+      </div>
41
+    </div>
42
+    <div class="bottom">
43
+      <el-button @click="resetForm()" type="primary" size="large">返回</el-button>
44
+    </div>
45
+  </div>
46
+</template>
47
+<!--    -->
48
+<script setup lang="ts">
49
+import { selectaccountNumber, updateURL } from "@/api/home/Multisite";
50
+import { onMounted, ref, watch } from "vue";
51
+import UploadImg from "@/components/Upload/Img.vue";
52
+
53
+import { useRouter } from "vue-router";
54
+const router = useRouter();
55
+const userdata = ref();
56
+
57
+const absoluteStationPicUr1 = ref("");
58
+watch(absoluteStationPicUr1, (newVal, oldVal) => {
59
+  console.log("absoluteStationPicUr1 has changed:", newVal);
60
+  console.log(oldVal);
61
+
62
+  // 你可以在这里处理变化后的逻辑
63
+  getupdate();
64
+});
65
+// 修改个人信息
66
+const getupdate = async () => {
67
+  console.log(absoluteStationPicUr1.value);
68
+  let obj = {
69
+    avatar: absoluteStationPicUr1.value
70
+  };
71
+  const { data } = await updateURL(obj);
72
+  console.log(data);
73
+  getplatformuserlist();
74
+};
75
+const getplatformuserlist = async () => {
76
+  const { data } = await selectaccountNumber({});
77
+  userdata.value = data;
78
+  absoluteStationPicUr1.value = userdata.value.user.avatar;
79
+};
80
+const currentDate = ref();
81
+const resetForm = async () => {
82
+  router.back();
83
+};
84
+onMounted(() => {
85
+  const current = localStorage.getItem("currentDate");
86
+  if (current) {
87
+    currentDate.value = current;
88
+  }
89
+  getplatformuserlist();
90
+});
91
+</script>
92
+<style scoped lang="scss">
93
+@import "./index.scss";
94
+</style>
95
+<!-- -->

Loading…
취소
저장