Compare commits
738 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97d1f08bbe | ||
|
|
7d0053eb71 | ||
|
|
666fb22c49 | ||
|
|
b319a89501 | ||
|
|
8e0b3be438 | ||
|
|
b0d92de738 | ||
|
|
92b3e25989 | ||
|
|
43c75c96a7 | ||
|
|
da0aa0cd0f | ||
|
|
b0c88b9df2 | ||
|
|
7c0ec5844a | ||
|
|
a4a64ef0f9 | ||
|
|
58bb25500e | ||
|
|
3d73c34343 | ||
|
|
f74fedc213 | ||
|
|
8ea49f9609 | ||
|
|
9ee71d29d4 | ||
|
|
039a67c35a | ||
|
|
e17749d47e | ||
|
|
21c859c8f1 | ||
|
|
4fe239c86f | ||
| ab62e56bbb | |||
| 5730b9c5cf | |||
|
|
d4992db198 | ||
|
|
5ccd1709a5 | ||
|
|
b48c1e0d78 | ||
|
|
fcdbbce7a9 | ||
|
|
d08194bfd8 | ||
|
|
55f579ef64 | ||
|
|
783e1c080b | ||
|
|
44cdb3273c | ||
|
|
dbc21cdbfa | ||
|
|
24d83cfd39 | ||
|
|
b213b721bb | ||
|
|
4ae42408c3 | ||
|
|
a9156f0954 | ||
|
|
3e7509cd44 | ||
|
|
24becb82e1 | ||
|
|
6608587edd | ||
|
|
5ad8cdecba | ||
|
|
6b4cca1ef7 | ||
|
|
dea0844829 | ||
|
|
bbd438d23f | ||
|
|
c88128b63b | ||
|
|
95c68942ed | ||
|
|
5db685baca | ||
|
|
fa710efea4 | ||
|
|
d0c3e1d9bd | ||
|
|
589ddd38f3 | ||
|
|
47d1500296 | ||
|
|
4a8f8bff6a | ||
|
|
2b9b87a3db | ||
|
|
b241128105 | ||
|
|
226e3271ee | ||
|
|
1c253fd713 | ||
|
|
ed81d3d398 | ||
|
|
09b54a29ab | ||
|
|
b27615baaf | ||
|
|
c735e7a5bb | ||
|
|
c78f591baf | ||
|
|
cfd8b072dd | ||
|
|
d18e34d2c9 | ||
|
|
53813795db | ||
|
|
8c3098e19a | ||
|
|
780a446aed | ||
|
|
375f01a6ab | ||
|
|
48aab7c1e9 | ||
|
|
d7cfe665e2 | ||
|
|
237c23bb70 | ||
|
|
4cd6302ee0 | ||
|
|
6a75709774 | ||
|
|
629dff1256 | ||
|
|
6d6d03c03c | ||
|
|
6122f53c8e | ||
|
|
5a7eea1052 | ||
|
|
25f3570c18 | ||
|
|
74e015bd12 | ||
|
|
da6a72807b | ||
|
|
bb7ebaea45 | ||
|
|
ae51b590af | ||
|
|
2ec3102eff | ||
|
|
f5f7d259a9 | ||
|
|
4364f88526 | ||
|
|
0f5e21a06c | ||
|
|
ddbaf5651a | ||
|
|
a847419ab5 | ||
|
|
d5fb41cbab | ||
|
|
25e7b754b7 | ||
|
|
a32ca3c849 | ||
|
|
6e979c5dcb | ||
|
|
8b578d4d8b | ||
|
|
52fcdbfe1e | ||
|
|
4559a7b5e2 | ||
|
|
567201563d | ||
|
|
772707ac42 | ||
|
|
4a6db824ba | ||
|
|
8b4c22e959 | ||
|
|
d7f1224df4 | ||
|
|
ac4e0e2077 | ||
|
|
56a6f199c0 | ||
|
|
0abb765b32 | ||
|
|
4f8fdb83d1 | ||
|
|
300b220de2 | ||
|
|
825d2cc46a | ||
|
|
95b602e6d4 | ||
|
|
a7b5bbf0bf | ||
|
|
dfbba11aae | ||
|
|
5cf39e8aa8 | ||
|
|
a19a20ddd8 | ||
|
|
0985cc5d7c | ||
|
|
2be0be681e | ||
|
|
dd9ca8f956 | ||
|
|
5cd60d9a32 | ||
|
|
959ae1dee9 | ||
|
|
d2d1490e9b | ||
|
|
7bcd88c3a7 | ||
|
|
8e3368bd29 | ||
|
|
bc03ba88f0 | ||
|
|
2aee4b281d | ||
|
|
26647222e2 | ||
|
|
a2db45cace | ||
|
|
d761c0449b | ||
|
|
dc6a346fd4 | ||
|
|
e938c6b3d9 | ||
|
|
c9fef2a9d7 | ||
|
|
9319dd06c5 | ||
|
|
7b96ce84fc | ||
|
|
b105ff890c | ||
|
|
61b87304e6 | ||
|
|
83c8dc5f19 | ||
|
|
b1ddf540ca | ||
|
|
0025895696 | ||
|
|
1ec8cce63e | ||
|
|
865d52c135 | ||
|
|
ce8607af36 | ||
|
|
4e8a6300dd | ||
| 919e81da8b | |||
|
|
18cb6dbde8 | ||
| 6d405d16ed | |||
|
|
77d2176812 | ||
| c85eac3888 | |||
|
|
27d2d82fcd | ||
|
|
ecbc3c30c8 | ||
|
|
0a65efd235 | ||
|
|
5cd8fea60c | ||
|
|
3d1b4eb7c6 | ||
| ec1330bdb8 | |||
|
|
e66bcdb293 | ||
|
|
88f1876ef0 | ||
|
|
fdc1fd6fbd | ||
|
|
022d80f30e | ||
| f59f287b63 | |||
| 6e573cc597 | |||
| d2f92ecde4 | |||
|
|
b2a6a1de4e | ||
|
|
f374df79a6 | ||
|
|
154eb9f79c | ||
|
|
d0724cb7f6 | ||
| d6d63523a3 | |||
|
|
83998f88ac | ||
|
|
9c5e54507b | ||
|
|
15689b5284 | ||
|
|
00893d2d1f | ||
|
|
0079f7415e | ||
| 327801d040 | |||
|
|
6e22c01dd8 | ||
|
|
bccb4b1f17 | ||
|
|
1f37cc567c | ||
|
|
f81503091d | ||
|
|
e29f25653e | ||
|
|
9e8e44b886 | ||
|
|
6e10b0c645 | ||
|
|
c8f3b4eddc | ||
|
|
cc848b1ffb | ||
|
|
d2f0382bd9 | ||
|
|
9fecf0ce3f | ||
|
|
290586d0ff | ||
|
|
ddc45af223 | ||
|
|
0e6f123306 | ||
|
|
7b93363b23 | ||
|
|
2fd0dcb8a3 | ||
|
|
86ee05f8af | ||
|
|
38814b9f44 | ||
|
|
fb5d13671d | ||
|
|
310a769092 | ||
|
|
8c63edabdc | ||
|
|
5363625a2f | ||
| efcd6e1cfe | |||
| acc4d0ca67 | |||
| 772f38feca | |||
|
|
1eb141e559 | ||
|
|
16b446bf20 | ||
|
|
bc0de34c15 | ||
|
|
15f2c1ee41 | ||
|
|
81a944062a | ||
|
|
3c19b05f4b | ||
|
|
c1f53cdc69 | ||
|
|
6ef2a6049b | ||
|
|
9989cc98cb | ||
|
|
e192158deb | ||
|
|
2e5d551e5d | ||
|
|
4622eb36d9 | ||
|
|
9c53b7c18e | ||
|
|
7b3805060f | ||
|
|
629600bc00 | ||
|
|
8b144b63fc | ||
|
|
098ab3a41d | ||
|
|
2a53f577aa | ||
|
|
f8b7c224b7 | ||
|
|
f0b3bdd37c | ||
|
|
bb35eb749b | ||
|
|
b3750d6a7f | ||
|
|
33ebb91ab6 | ||
|
|
3e00f2fee7 | ||
|
|
68e9856641 | ||
|
|
51b2e80493 | ||
|
|
cf77572f41 | ||
| fe6524404c | |||
|
|
ccda7218f4 | ||
|
|
ddd0e6a22b | ||
|
|
ed85453de1 | ||
|
|
04939606fc | ||
|
|
2df455b667 | ||
|
|
8fb214d7a7 | ||
|
|
4f2c8a8016 | ||
|
|
c2974dbe0d | ||
|
|
3891e5459a | ||
|
|
9ed47ac5bc | ||
|
|
114fcd140d | ||
|
|
19a30894f8 | ||
|
|
2134fea518 | ||
|
|
82f495ce3b | ||
|
|
f2ecff54a3 | ||
|
|
f56004ac15 | ||
|
|
5303c47248 | ||
| 37731592f7 | |||
|
|
c9e41e0c82 | ||
|
|
4a80a88e6e | ||
|
|
30b219e14d | ||
|
|
ecec9adeea | ||
|
|
1853152138 | ||
| 5619413f37 | |||
|
|
5b736bc475 | ||
|
|
2aa37c3fe3 | ||
|
|
4e0cb72f32 | ||
|
|
ce74ec4db7 | ||
|
|
9938306884 | ||
|
|
ef63fcf807 | ||
|
|
08cffa4256 | ||
|
|
e1a740f8bf | ||
|
|
56d035253b | ||
|
|
e7348107d0 | ||
|
|
ea38b4eb21 | ||
| 67ef976739 | |||
| 60145ec4f7 | |||
|
|
81600ddc69 | ||
|
|
e0941d628b | ||
|
|
760dcbf723 | ||
|
|
b75ecb8c66 | ||
|
|
39f4cfa670 | ||
|
|
862251b83c | ||
|
|
312490ce59 | ||
|
|
d7df999cf2 | ||
|
|
e0b1b5907b | ||
|
|
f06ca03881 | ||
|
|
a9b80ed33c | ||
|
|
834230b26a | ||
|
|
403ddbfb6e | ||
|
|
ffb44ea909 | ||
|
|
b729e4efa1 | ||
|
|
962c286fd5 | ||
|
|
c215f51554 | ||
| 859c85b427 | |||
|
|
5fe637e84f | ||
|
|
5f68071c77 | ||
|
|
1675a5af31 | ||
|
|
ec1d09dbd0 | ||
|
|
eda7b516f6 | ||
|
|
630eb48d28 | ||
|
|
0d2f8a7788 | ||
| 230c68f454 | |||
| 68934060e6 | |||
| 846e7514b7 | |||
| 410cfb0f7a | |||
|
|
c892410b07 | ||
|
|
7caa4a5303 | ||
|
|
c17efbf9f6 | ||
| c46abeecf5 | |||
|
|
0947097932 | ||
|
|
50fc02d4eb | ||
|
|
a122e9e1b3 | ||
|
|
d7cfcc7855 | ||
|
|
05948aebf5 | ||
|
|
cca214aaf7 | ||
|
|
0111954c5e | ||
|
|
ce31499964 | ||
|
|
059864d193 | ||
|
|
6d2fb4dde8 | ||
|
|
49059d9c59 | ||
|
|
d2f7041988 | ||
|
|
f94372d20b | ||
|
|
9af98b034f | ||
|
|
341b8df5a9 | ||
|
|
7470f697bd | ||
|
|
c058b99a0d | ||
|
|
d5eed13f38 | ||
|
|
c27ee88182 | ||
|
|
e2559ffa65 | ||
|
|
a0bd32453c | ||
|
|
54e7a91841 | ||
|
|
042f6eef51 | ||
| c9857326c6 | |||
| 9c4e0094f9 | |||
| 781b27af51 | |||
|
|
37e257afc8 | ||
| 4d4fdd6190 | |||
|
|
0fd2d8252d | ||
|
|
3cf5019880 | ||
|
|
258d3d692f | ||
|
|
667ed3bcc0 | ||
|
|
a882189022 | ||
|
|
686e009243 | ||
|
|
30d5f3390c | ||
|
|
3398b414ca | ||
|
|
b6a2c42feb | ||
|
|
cb5a9050f2 | ||
|
|
661b27abd0 | ||
|
|
59a24c9ea2 | ||
|
|
6cf5da5d48 | ||
|
|
537f5e2f4c | ||
|
|
70531a0729 | ||
|
|
ded15e5c8b | ||
|
|
3021f7e4d3 | ||
|
|
876d9cfa00 | ||
|
|
8f28825162 | ||
|
|
0e6612f6bd | ||
|
|
39183fde5d | ||
|
|
b967419cb1 | ||
|
|
0712698638 | ||
|
|
d3a74e830f | ||
|
|
f68da773ab | ||
|
|
8db814dba4 | ||
|
|
7dcff99de5 | ||
|
|
97100dfa63 | ||
|
|
d41707fcf9 | ||
|
|
2377916f29 | ||
|
|
be2f40715a | ||
|
|
489c0882ac | ||
|
|
492db88b45 | ||
|
|
3b198eb4ed | ||
|
|
5efc27d4b6 | ||
|
|
ec9f270d04 | ||
|
|
afd2d467f3 | ||
|
|
ff0798450d | ||
|
|
fbefc70368 | ||
|
|
faa0bc54a6 | ||
|
|
bf5f4eab77 | ||
| 188456c970 | |||
|
|
c06334e96f | ||
| 82e8bf2e0b | |||
| 30382fb34d | |||
| c7e5ee0862 | |||
|
|
d6ac63586b | ||
|
|
e0fd42199f | ||
|
|
d9e3168484 | ||
|
|
dc7e91ca66 | ||
|
|
692358d278 | ||
| 3750031d6b | |||
| 0bae200241 | |||
|
|
61bd1a0d6a | ||
|
|
37cf3dfdd7 | ||
|
|
8be96ca64e | ||
|
|
d225391248 | ||
|
|
f2fd0b078e | ||
|
|
f71963ea3b | ||
|
|
6a635246bb | ||
|
|
d338ca6b25 | ||
|
|
193c3b963c | ||
|
|
cad4965b1b | ||
|
|
79306d846f | ||
|
|
f4ea510c5d | ||
|
|
07cc26fa8d | ||
|
|
f87e268242 | ||
|
|
1aeceffe0b | ||
|
|
fc97087767 | ||
|
|
61be97b04b | ||
|
|
934162875c | ||
|
|
4b3991099a | ||
|
|
b14a961c1a | ||
|
|
cbe41d80ce | ||
|
|
28203f2621 | ||
|
|
b8492dfbe6 | ||
|
|
15faac8079 | ||
|
|
ad850ca4ee | ||
|
|
6c05c6e06e | ||
|
|
8b2cda80b1 | ||
|
|
3f7756b417 | ||
|
|
5004e319b6 | ||
|
|
19035f2dc9 | ||
|
|
9d8a5c76b2 | ||
|
|
6300eb2f43 | ||
|
|
da58ffb621 | ||
|
|
1500fafb92 | ||
|
|
df53eea432 | ||
|
|
cc1771c208 | ||
|
|
5e881c0804 | ||
|
|
5666e01ae0 | ||
|
|
4acec8a2d6 | ||
|
|
426a511099 | ||
|
|
89303b44ae | ||
|
|
ffb82066bb | ||
|
|
f46b8c0a56 | ||
|
|
280289af37 | ||
| a0c7f79302 | |||
| bd1eecc106 | |||
|
|
1a23bcb510 | ||
|
|
942c28d3bd | ||
| 034b31ba47 | |||
|
|
7a76c2da8a | ||
|
|
1a9d8e8606 | ||
| 14583d919d | |||
|
|
629fd174e4 | ||
|
|
9080fe06a4 | ||
|
|
0e183bb5c1 | ||
| 8caf856d2d | |||
|
|
d28669e6b0 | ||
| 700884d01a | |||
| c06bd9fa24 | |||
| ce92a1d645 | |||
|
|
4f622da52c | ||
| 7d3e86a5fc | |||
|
|
c66d181b98 | ||
| f860630bfb | |||
|
|
6db4d79839 | ||
| e2924d5e57 | |||
| 92b9a82f21 | |||
|
|
c3f89ca1f8 | ||
|
|
8c435c91dd | ||
|
|
6e6cfa5be0 | ||
|
|
ea203d0ccc | ||
|
|
370cd52774 | ||
|
|
942bae3045 | ||
|
|
356548c8fb | ||
| 5c012c2bc9 | |||
| 9c9b8015a0 | |||
| bba0ced7f9 | |||
|
|
e8de7b56d9 | ||
|
|
95022f62a8 | ||
|
|
1d918f3335 | ||
|
|
f992637ad2 | ||
|
|
40f18bbdf8 | ||
|
|
3bb9cec08a | ||
|
|
6842260f59 | ||
|
|
305c30d725 | ||
|
|
e799dd2f08 | ||
| 1e83172e9a | |||
|
|
475d236b7e | ||
|
|
ddeb84fcfe | ||
|
|
b3aeebb7c7 | ||
|
|
b11f4839f4 | ||
|
|
4adc28a055 | ||
|
|
e46e9e1d3a | ||
|
|
4fcb26bbde | ||
|
|
6bd0e891fa | ||
|
|
15f1308557 | ||
|
|
9689197db9 | ||
|
|
4ad490657f | ||
|
|
9f8f8244e3 | ||
|
|
9206be2562 | ||
|
|
6065fd1f67 | ||
|
|
c16560a0ca | ||
|
|
440cfe1ac5 | ||
|
|
1ad1a0198e | ||
|
|
b603ac9bdb | ||
|
|
68aa4c409b | ||
|
|
f22b4e7fb8 | ||
|
|
400328d5fa | ||
|
|
cce3e6861a | ||
|
|
55368ce9b8 | ||
|
|
c6ef54f7d3 | ||
| 6f97c48226 | |||
| 5f45bc98fb | |||
|
|
5738594be2 | ||
|
|
ce47831992 | ||
| 634c2d84fc | |||
| 70855c5a21 | |||
|
|
b1e5e70411 | ||
|
|
bf2e3219fc | ||
|
|
2f5aeb9ffc | ||
| 9e8ed310fc | |||
| 07a5e32579 | |||
|
|
fe1bb04922 | ||
| a75e964adc | |||
|
|
87d22032e6 | ||
|
|
55ae64b3e1 | ||
|
|
891c6d8e93 | ||
|
|
ba7747dfe9 | ||
| b148c04059 | |||
|
|
4e179d61b5 | ||
|
|
b23ee84543 | ||
|
|
d02f85cea5 | ||
| ab02f8f1b3 | |||
| 8fc1d1ffc9 | |||
|
|
44b1da94c1 | ||
|
|
c2b63a7a3f | ||
|
|
56619c9140 | ||
|
|
99bbb5434d | ||
| 40c9c5fdad | |||
|
|
3ea2c93e43 | ||
|
|
6369c8ee63 | ||
|
|
da4bbf1e2c | ||
|
|
14e5535fd8 | ||
|
|
4e53bb3b27 | ||
| e793fdbe42 | |||
| 0e41a5b9f1 | |||
|
|
ac9dfd1669 | ||
|
|
72eb3e189b | ||
| 0cace11975 | |||
| b8e502b168 | |||
|
|
15502d0107 | ||
| cb4e4646bd | |||
| 93ce1b4994 | |||
|
|
1c452b5574 | ||
|
|
876c06ef54 | ||
|
|
37d65a944d | ||
|
|
7bc9321c86 | ||
|
|
ee564dccb6 | ||
| cdbb386c7c | |||
| 325ade7cdc | |||
|
|
fcd8c1a0dd | ||
|
|
fa1cb02a51 | ||
|
|
40fe12cd96 | ||
|
|
d83c04dc8b | ||
|
|
23b2974597 | ||
|
|
f5e78316ef | ||
|
|
cc2020f3d6 | ||
|
|
26cda335c5 | ||
|
|
171533cef0 | ||
|
|
69de6dd7a3 | ||
|
|
9039ed4bdc | ||
|
|
131d3b7018 | ||
|
|
454aabdc97 | ||
|
|
089c97d859 | ||
|
|
9ff5423368 | ||
|
|
f29d6e8d88 | ||
|
|
5199ee2db0 | ||
|
|
6de9e22b4c | ||
|
|
52968d9aaa | ||
|
|
b584142f5e | ||
|
|
edea30a406 | ||
|
|
1f3024eb91 | ||
| 8b9abba74b | |||
|
|
4dec1392f7 | ||
|
|
e54cbfbc0a | ||
|
|
505cd93446 | ||
|
|
f3ee11ebab | ||
|
|
45295ef898 | ||
|
|
0635dda6a0 | ||
|
|
f58f7b97e5 | ||
|
|
7556f0e5bc | ||
|
|
17fe29cb1b | ||
|
|
4bb4eb80d9 | ||
| ae1507e775 | |||
|
|
85d8a57bf7 | ||
|
|
42cf23a516 | ||
|
|
858cf75b46 | ||
|
|
de8a392d2c | ||
|
|
b614767b2d | ||
|
|
5ebb8549bf | ||
|
|
ead1feb379 | ||
|
|
1474c15bd9 | ||
|
|
f24f87dcc8 | ||
|
|
d416f46b3a | ||
| 352df35205 | |||
|
|
e5f201515e | ||
|
|
40520a7d30 | ||
|
|
cffbfe1380 | ||
|
|
839777ea4d | ||
|
|
5be1d22115 | ||
|
|
80d1912fd5 | ||
|
|
b94e0323d9 | ||
|
|
90f4e53e9f | ||
|
|
7ebad7d6b9 | ||
|
|
34534a1dbf | ||
| 645fac0681 | |||
| 0a23700403 | |||
|
|
c00f8843c0 | ||
|
|
8869974471 | ||
|
|
8125d60105 | ||
|
|
5a32d5b7a8 | ||
|
|
a1d113562b | ||
|
|
4a7535e4f5 | ||
|
|
de5548bbbd | ||
|
|
87c46e8477 | ||
|
|
edda224847 | ||
|
|
5ac6bbf04b | ||
|
|
b0a5329937 | ||
|
|
7a0626413d | ||
| fe04ad1573 | |||
|
|
689cc39bbc | ||
|
|
ba0c577514 | ||
|
|
a629907196 | ||
|
|
bf60bcfe12 | ||
|
|
27eb9a7d93 | ||
|
|
336ee843cc | ||
|
|
9eac101794 | ||
|
|
085fcc62aa | ||
|
|
99e6abbcfd | ||
| a4b96066e0 | |||
|
|
c4e2da8d67 | ||
|
|
1be15ee849 | ||
|
|
99bc54349b | ||
|
|
bf823ddff0 | ||
|
|
23e72f38a6 | ||
|
|
2d993b2f73 | ||
| 9703d35a3a | |||
|
|
d10a7a4884 | ||
|
|
938b9054d3 | ||
|
|
8a5bcca901 | ||
|
|
410cd53e51 | ||
|
|
4031724fa9 | ||
|
|
e95552e6b9 | ||
|
|
012f7e3346 | ||
|
|
cbe6c4a98d | ||
|
|
aa52778e99 | ||
|
|
5e8dda0b75 | ||
|
|
081aeacff7 | ||
|
|
65e54ee2b5 | ||
|
|
0fd6ebf810 | ||
|
|
fa4b5d26e5 | ||
|
|
23f45b38cb | ||
|
|
d76b055730 | ||
|
|
c334c07b39 | ||
|
|
45a5dcb068 | ||
|
|
3d9ba8b1cb | ||
|
|
c6836cad06 | ||
|
|
e70d1cb3f2 | ||
|
|
af454e1a56 | ||
|
|
6ce58e86ad | ||
| 2e17531c52 | |||
|
|
6b76d89507 | ||
|
|
e4025e39cb | ||
|
|
af12dc8d0a | ||
|
|
f0edeaee85 | ||
|
|
5cbdadecc4 | ||
|
|
30c1f90513 | ||
| c241d8b819 | |||
| 24f12a3590 | |||
|
|
f17f5c9925 | ||
|
|
99877b1c98 | ||
|
|
fdf91965d9 | ||
|
|
fd21d32f4a | ||
|
|
0a4385f29b | ||
|
|
63c6693d04 | ||
|
|
ff7084a332 | ||
|
|
b63e8897f5 | ||
|
|
dc3976f525 | ||
|
|
9b8765f001 | ||
| bbe23e1b14 | |||
|
|
5f0b36b3bb | ||
|
|
f0b75eae2f | ||
|
|
45e62b2750 | ||
|
|
d11e4822ed | ||
|
|
93b67fe845 | ||
|
|
ebc2ac1a41 | ||
|
|
4fd2f10ec6 | ||
|
|
2715871017 | ||
|
|
4cfca89895 | ||
| 53ead0e62f | |||
|
|
b00967159a | ||
|
|
1b37684e3c | ||
|
|
48f393be25 | ||
|
|
645fb83bce | ||
|
|
fe8bc407d3 | ||
|
|
d20cab57be | ||
|
|
68df3d5e23 | ||
|
|
8984bc577e | ||
|
|
07d02307e2 | ||
|
|
a027dc75c3 | ||
|
|
5da07d8631 | ||
|
|
d061fc9b32 | ||
|
|
ae47d429ba | ||
|
|
396d6a7336 | ||
|
|
fdf826d5f8 | ||
|
|
0db5fa650f | ||
|
|
53b4616a87 | ||
|
|
b923b7c35d | ||
|
|
8bd5351d29 | ||
|
|
726f7841e8 | ||
|
|
47883ce426 | ||
|
|
2459fc1848 | ||
|
|
cbc11f636a | ||
|
|
5dbd6eb8be | ||
|
|
167716e61b | ||
|
|
6d7f045bce | ||
|
|
a73417ea02 | ||
|
|
9c3850db98 | ||
| 393ad5fa0b | |||
|
|
9e8fe2c91f | ||
|
|
b57a7edf28 | ||
|
|
85cc5ebb27 | ||
| 0cd32fbb5f | |||
|
|
2833e65f57 | ||
|
|
5a29403636 | ||
|
|
9c0b9a7c93 | ||
|
|
69a4cbbbc2 | ||
|
|
e2b2382cc4 | ||
|
|
f8a4d05f57 | ||
|
|
d996c43f9f | ||
|
|
c195a58eb4 | ||
| b1c9375873 | |||
|
|
6010cbf20a | ||
|
|
11c32ed360 | ||
|
|
0494822ff4 | ||
|
|
2611f43d1f | ||
| ea4edfadd0 | |||
|
|
8e2a22cf61 | ||
|
|
3a1cfe0f31 | ||
|
|
5bdc44b301 | ||
|
|
92a1736667 | ||
|
|
57f9238033 | ||
|
|
1b171d4b8d | ||
|
|
c5acb84d97 | ||
|
|
63a1e9ec56 | ||
|
|
f06a8d6b15 | ||
| 92df927453 | |||
|
|
2878dce69d | ||
|
|
7d5d128b54 | ||
|
|
6e9e3db358 | ||
|
|
a415ffa12a | ||
|
|
9e8cdaead6 | ||
|
|
e5d4aae846 | ||
|
|
d6af35828d | ||
|
|
aa86c5e662 | ||
|
|
f99aa94b8f | ||
|
|
f5c226ba28 | ||
|
|
741020fe79 | ||
|
|
33004e081d |
@@ -1,112 +0,0 @@
|
|||||||
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from "axios";
|
|
||||||
import { showFullScreenLoading, tryHideFullScreenLoading } from "@/components/Loading/fullScreen";
|
|
||||||
import { LOGIN_URL } from "@/config";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import { ResultData } from "@/api/interface";
|
|
||||||
import { ResultEnum } from "@/enums/httpEnum";
|
|
||||||
import { checkStatus } from "./helper/checkStatus";
|
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
|
||||||
import router from "@/routers";
|
|
||||||
|
|
||||||
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
|
||||||
loading?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = {
|
|
||||||
// 默认地址请求地址,可在 .env.** 文件中修改
|
|
||||||
baseURL: import.meta.env.VITE_API_URL as string,
|
|
||||||
// 设置超时时间
|
|
||||||
timeout: ResultEnum.TIMEOUT as number,
|
|
||||||
// 跨域时候允许携带凭证
|
|
||||||
withCredentials: true,
|
|
||||||
// post请求指定数据类型以及编码
|
|
||||||
headers: { 'Content-Type': 'application/json;charset=utf-8' }
|
|
||||||
};
|
|
||||||
|
|
||||||
class RequestHttp {
|
|
||||||
service: AxiosInstance;
|
|
||||||
public constructor(config: AxiosRequestConfig) {
|
|
||||||
// 创建实例
|
|
||||||
this.service = axios.create(config);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description 请求拦截器
|
|
||||||
* 客户端发送请求 -> [请求拦截器] -> 服务器
|
|
||||||
* token校验(JWT) : 接受服务器返回的 token,存储到 vuex/pinia/本地储存当中
|
|
||||||
*/
|
|
||||||
this.service.interceptors.request.use(
|
|
||||||
(config: CustomAxiosRequestConfig) => {
|
|
||||||
const userStore = useUserStore();
|
|
||||||
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { loading: false } 来控制
|
|
||||||
config.loading ?? (config.loading = true);
|
|
||||||
config.loading && showFullScreenLoading();
|
|
||||||
if (config.headers && typeof config.headers.set === "function") {
|
|
||||||
config.headers.set("x-access-token", userStore.token);
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
(error: AxiosError) => {
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description 响应拦截器
|
|
||||||
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
|
|
||||||
*/
|
|
||||||
this.service.interceptors.response.use(
|
|
||||||
(response: AxiosResponse) => {
|
|
||||||
const { data } = response;
|
|
||||||
const userStore = useUserStore();
|
|
||||||
tryHideFullScreenLoading();
|
|
||||||
// 登陆失效
|
|
||||||
if (data.code == ResultEnum.OVERDUE) {
|
|
||||||
userStore.setToken("");
|
|
||||||
router.replace(LOGIN_URL);
|
|
||||||
ElMessage.error(data.message);
|
|
||||||
return Promise.reject(data);
|
|
||||||
}
|
|
||||||
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
|
|
||||||
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
|
||||||
ElMessage.error(data.message);
|
|
||||||
return Promise.reject(data);
|
|
||||||
}
|
|
||||||
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
|
|
||||||
return data;
|
|
||||||
},
|
|
||||||
async (error: AxiosError) => {
|
|
||||||
const { response } = error;
|
|
||||||
tryHideFullScreenLoading();
|
|
||||||
// 请求超时 && 网络错误单独判断,没有 response
|
|
||||||
if (error.message.indexOf("timeout") !== -1) ElMessage.error("请求超时!请您稍后重试");
|
|
||||||
if (error.message.indexOf("Network Error") !== -1) ElMessage.error("网络错误!请您稍后重试");
|
|
||||||
// 根据服务器响应的错误状态码,做不同的处理
|
|
||||||
if (response) checkStatus(response.status);
|
|
||||||
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
|
|
||||||
if (!window.navigator.onLine) router.replace("/500");
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @description 常用请求方法封装
|
|
||||||
*/
|
|
||||||
get<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
|
|
||||||
return this.service.get(url, { params, ..._object });
|
|
||||||
}
|
|
||||||
post<T>(url: string, params?: object | string, _object = {}): Promise<ResultData<T>> {
|
|
||||||
return this.service.post(url, params, _object);
|
|
||||||
}
|
|
||||||
put<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
|
|
||||||
return this.service.put(url, params, _object);
|
|
||||||
}
|
|
||||||
delete<T>(url: string, params?: any, _object = {}): Promise<ResultData<T>> {
|
|
||||||
return this.service.delete(url, { params, ..._object });
|
|
||||||
}
|
|
||||||
download(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
|
||||||
return this.service.post(url, params, { ..._object, responseType: "blob" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default new RequestHttp(config);
|
|
||||||
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@@ -1,18 +1,28 @@
|
|||||||
{
|
{
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
|
"Analyse",
|
||||||
|
"CHNFACTOR",
|
||||||
|
"CHNPACTOR",
|
||||||
"Chns",
|
"Chns",
|
||||||
"Combox",
|
"Combox",
|
||||||
|
"Datasource",
|
||||||
"daterange",
|
"daterange",
|
||||||
"devicedata",
|
"devicedata",
|
||||||
"errordata",
|
"errordata",
|
||||||
"errordetail",
|
"errordetail",
|
||||||
|
"Interharmonic",
|
||||||
|
"IRMS",
|
||||||
"logdata",
|
"logdata",
|
||||||
|
"MSQI",
|
||||||
"Pids",
|
"Pids",
|
||||||
"plandata",
|
"plandata",
|
||||||
"PQDIF",
|
"PQDIF",
|
||||||
|
"Preinvestment",
|
||||||
"resourcedata",
|
"resourcedata",
|
||||||
"resourcename",
|
"resourcename",
|
||||||
"rmark",
|
"rmark",
|
||||||
"showtest"
|
"showtest",
|
||||||
|
"UNBAN",
|
||||||
|
"VRMS"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -25,10 +25,10 @@ module.exports = (appInfo) => {
|
|||||||
*/
|
*/
|
||||||
config.windowsOption = {
|
config.windowsOption = {
|
||||||
title: '自动检测平台',
|
title: '自动检测平台',
|
||||||
width: 1280,
|
width: 1920 /1.5,
|
||||||
height: 850,
|
height: 1080 /1.2,
|
||||||
minWidth: 1280,
|
minWidth: 1920 /1.5,
|
||||||
minHeight: 850,
|
minHeight: 1080 /1.2,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
//webSecurity: false,
|
//webSecurity: false,
|
||||||
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
|
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ module.exports = (appInfo) => {
|
|||||||
/**
|
/**
|
||||||
* 开发者工具
|
* 开发者工具
|
||||||
*/
|
*/
|
||||||
config.openDevTools = true;
|
config.openDevTools = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用程序顶部菜单
|
* 应用程序顶部菜单
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ VITE_API_URL=/api
|
|||||||
|
|
||||||
# 开发环境跨域代理,支持配置多个
|
# 开发环境跨域代理,支持配置多个
|
||||||
|
|
||||||
|
#VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
|
||||||
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||||
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
||||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_PWA=true
|
VITE_PWA=true
|
||||||
|
|
||||||
# 线上环境接口地址
|
# 线上环境接口地址
|
||||||
|
#VITE_API_URL="/api" # 打包时用
|
||||||
VITE_API_URL="http://192.168.1.125:18092/"
|
VITE_API_URL="http://192.168.1.125:18092/"
|
||||||
|
|||||||
11
frontend/.prettierrc
Normal file
11
frontend/.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"tabWidth": 4,
|
||||||
|
"printWidth": 120,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": false,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"htmlWhitespaceSensitivity": "ignore"
|
||||||
|
}
|
||||||
@@ -14,7 +14,10 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
|
"@types/event-source-polyfill": "^1.0.5",
|
||||||
|
"@vue-flow/core": "^1.45.0",
|
||||||
"@vueuse/core": "^10.4.1",
|
"@vueuse/core": "^10.4.1",
|
||||||
|
"autofit.js": "^3.2.8",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.9",
|
"dayjs": "^1.11.9",
|
||||||
@@ -22,9 +25,12 @@
|
|||||||
"echarts": "^5.4.3",
|
"echarts": "^5.4.3",
|
||||||
"echarts-liquidfill": "^3.1.0",
|
"echarts-liquidfill": "^3.1.0",
|
||||||
"element-plus": "^2.7.8",
|
"element-plus": "^2.7.8",
|
||||||
|
"event-source-polyfill": "^1.0.31",
|
||||||
|
"html2canvas": "^1.4.1",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"mkdirp": "^3.0.1",
|
"mkdirp": "^3.0.1",
|
||||||
|
"node-forge": "^1.3.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"pinia": "^2.2.1",
|
"pinia": "^2.2.1",
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
@@ -41,11 +47,14 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "^1.8.0",
|
"@rushstack/eslint-patch": "^1.8.0",
|
||||||
"@tsconfig/node20": "^20.1.4",
|
"@tsconfig/node20": "^20.1.4",
|
||||||
|
"@types/html2canvas": "^1.0.0",
|
||||||
"@types/md5": "^2.3.2",
|
"@types/md5": "^2.3.2",
|
||||||
"@types/node": "^20.14.14",
|
"@types/node": "^20.14.14",
|
||||||
|
"@types/node-forge": "^1.3.11",
|
||||||
"@types/nprogress": "^0.2.0",
|
"@types/nprogress": "^0.2.0",
|
||||||
"@types/qs": "^6.9.8",
|
"@types/qs": "^6.9.8",
|
||||||
"@types/sortablejs": "^1.15.2",
|
"@types/sortablejs": "^1.15.2",
|
||||||
|
"@types/xlsx": "^0.0.36",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||||
"@typescript-eslint/parser": "^6.7.0",
|
"@typescript-eslint/parser": "^6.7.0",
|
||||||
"@vitejs/plugin-vue": "^5.0.5",
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
@@ -67,11 +76,11 @@
|
|||||||
"unplugin-auto-import": "^0.18.3",
|
"unplugin-auto-import": "^0.18.3",
|
||||||
"unplugin-vue-components": "^0.27.4",
|
"unplugin-vue-components": "^0.27.4",
|
||||||
"unplugin-vue-setup-extend-plus": "^1.0.0",
|
"unplugin-vue-setup-extend-plus": "^1.0.0",
|
||||||
"vite": "^5.3.1",
|
"vite": "^5.4.19",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-eslint": "^1.8.1",
|
"vite-plugin-eslint": "^1.8.1",
|
||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-node-polyfills": "^0.22.0",
|
"vite-plugin-node-polyfills": "^0.24.0",
|
||||||
"vite-plugin-pwa": "^0.16.5",
|
"vite-plugin-pwa": "^0.16.5",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vue-tsc": "^2.0.21"
|
"vue-tsc": "^2.0.21"
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--element-plus语言国际化,全局修改为中文-->
|
<!--element-plus语言国际化,全局修改为中文-->
|
||||||
<el-config-provider
|
<el-config-provider :locale="locale" :size="assemblySize" :button="buttonConfig">
|
||||||
:locale='locale'
|
<router-view />
|
||||||
:size='assemblySize'
|
|
||||||
:button='buttonConfig'
|
|
||||||
>
|
|
||||||
<router-view :key='$route.fullPath' />
|
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup>
|
<script lang="ts" setup>
|
||||||
defineOptions({
|
import autofit from 'autofit.js'
|
||||||
name: 'App',
|
|
||||||
})
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { getBrowserLang } from '@/utils'
|
import { getBrowserLang } from '@/utils'
|
||||||
import { useTheme } from '@/hooks/useTheme'
|
import { useTheme } from '@/hooks/useTheme'
|
||||||
import { ElConfigProvider } from 'element-plus'
|
import { ElConfigProvider } from 'element-plus'
|
||||||
import { LanguageType } from './stores/interface'
|
import { type LanguageType } from './stores/interface'
|
||||||
import { useGlobalStore } from '@/stores/modules/global'
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import en from 'element-plus/es/locale/lang/en'
|
import en from 'element-plus/es/locale/lang/en'
|
||||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'App'
|
||||||
|
})
|
||||||
|
|
||||||
const globalStore = useGlobalStore()
|
const globalStore = useGlobalStore()
|
||||||
|
|
||||||
// init theme
|
// init theme
|
||||||
@@ -34,6 +32,16 @@ onMounted(() => {
|
|||||||
const language = globalStore.language ?? getBrowserLang()
|
const language = globalStore.language ?? getBrowserLang()
|
||||||
i18n.locale.value = language
|
i18n.locale.value = language
|
||||||
globalStore.setGlobalState('language', language as LanguageType)
|
globalStore.setGlobalState('language', language as LanguageType)
|
||||||
|
// 自动适配
|
||||||
|
autofit.init({
|
||||||
|
el: '#app',
|
||||||
|
//dh: 720 * 1,
|
||||||
|
//dw: 1280 * 1.2,
|
||||||
|
dw: 1920 / 1.5,
|
||||||
|
dh: 1080 / 1.2,
|
||||||
|
resize: true,
|
||||||
|
limit: 0.1
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// element language
|
// element language
|
||||||
|
|||||||
240
frontend/src/api/check/interface/index.ts
Normal file
240
frontend/src/api/check/interface/index.ts
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
export namespace CheckData {
|
||||||
|
export interface DataCheck {
|
||||||
|
scriptName: string
|
||||||
|
errorSysId: string
|
||||||
|
dataRule: string
|
||||||
|
deviceName: string
|
||||||
|
chnNum: string
|
||||||
|
deviceId: string
|
||||||
|
num?: string | number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PhaseCheckResult {
|
||||||
|
// 检测源定值-标准值
|
||||||
|
resultData: number
|
||||||
|
// 装置原始数据-被检值
|
||||||
|
data: number
|
||||||
|
|
||||||
|
// 误差值
|
||||||
|
errorData: number
|
||||||
|
// 第几次谐波
|
||||||
|
num?: number
|
||||||
|
//符合、不符合
|
||||||
|
isData?: number
|
||||||
|
//最大误差值
|
||||||
|
radius?: string
|
||||||
|
unit?: string
|
||||||
|
}
|
||||||
|
export interface DataItem {
|
||||||
|
num: number
|
||||||
|
isData: number
|
||||||
|
data: number
|
||||||
|
resultData: number
|
||||||
|
radius: string
|
||||||
|
errorData: number
|
||||||
|
unit: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TableRow {
|
||||||
|
isData: number
|
||||||
|
harmNum: number
|
||||||
|
radius: string
|
||||||
|
dataA: DataItem
|
||||||
|
dataB: DataItem
|
||||||
|
dataC: DataItem
|
||||||
|
dataT: DataItem | null
|
||||||
|
unit: string
|
||||||
|
timeDev?: string
|
||||||
|
uaDev?: string | number
|
||||||
|
ubDev?: string | number
|
||||||
|
ucDev?: string | number
|
||||||
|
utDev?: string | number
|
||||||
|
uaStdDev?: string | number
|
||||||
|
ubStdDev?: string | number
|
||||||
|
ucStdDev?: string | number
|
||||||
|
utStdDev?: string | number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于定义 查看(设备)通道检测结果响应数据 类型
|
||||||
|
*/
|
||||||
|
export interface ResCheckResult {
|
||||||
|
dataA?: PhaseCheckResult | null
|
||||||
|
dataB?: PhaseCheckResult | null
|
||||||
|
dataC?: PhaseCheckResult | null
|
||||||
|
dataT?: PhaseCheckResult | null
|
||||||
|
|
||||||
|
// 第几次谐波
|
||||||
|
//num: number | null,
|
||||||
|
//符合、不符合
|
||||||
|
isData?: number
|
||||||
|
//最大误差值
|
||||||
|
radius?: string
|
||||||
|
//单位
|
||||||
|
unit?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
|
||||||
|
*/
|
||||||
|
export interface CheckResult {
|
||||||
|
stdA?: string
|
||||||
|
dataA?: string
|
||||||
|
errorA?: string
|
||||||
|
maxErrorA?: string
|
||||||
|
isDataA?: number
|
||||||
|
unitA?: string
|
||||||
|
stdB?: string
|
||||||
|
dataB?: string
|
||||||
|
errorB?: string
|
||||||
|
maxErrorB?: string
|
||||||
|
isDataB?: number
|
||||||
|
unitB?: string
|
||||||
|
stdC?: string
|
||||||
|
dataC?: string
|
||||||
|
errorC?: string
|
||||||
|
maxErrorC?: string
|
||||||
|
isDataC?: number
|
||||||
|
unitC?: string
|
||||||
|
stdT?: string
|
||||||
|
dataT?: string
|
||||||
|
errorT?: string
|
||||||
|
maxErrorT?: string
|
||||||
|
isDataT?: number
|
||||||
|
unitT?: string
|
||||||
|
|
||||||
|
//最大误差值
|
||||||
|
maxError?: string
|
||||||
|
unit?: string
|
||||||
|
//符合、不符合
|
||||||
|
result?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于定义 具体通道的原始数据类型
|
||||||
|
*/
|
||||||
|
export interface RawDataItem {
|
||||||
|
time?: string
|
||||||
|
harmNum?: number | null
|
||||||
|
dataA?: string
|
||||||
|
dataB?: string
|
||||||
|
dataC?: string
|
||||||
|
dataT?: string
|
||||||
|
unit?: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Device {
|
||||||
|
deviceId: string //装置序号Id
|
||||||
|
deviceName: string //设备名称
|
||||||
|
chnNum: number //设备通道数
|
||||||
|
|
||||||
|
planId: string //计划Id
|
||||||
|
devType: string //设备类型
|
||||||
|
devVolt: number //设备电压
|
||||||
|
devCurr: number //设备电流
|
||||||
|
factorFlag: number //是否支持系数校准
|
||||||
|
checkResult: number //检测结果
|
||||||
|
chnNumList: string[] //连线存储数据
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用来描述检测脚本类型
|
||||||
|
export interface ScriptItem {
|
||||||
|
id: string
|
||||||
|
code: string
|
||||||
|
scriptName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用来描述 检测数据-左侧树结构
|
||||||
|
export interface TreeItem {
|
||||||
|
id: string | null
|
||||||
|
scriptTypeName: string | null
|
||||||
|
sourceDesc: string | null
|
||||||
|
harmNum: number | null
|
||||||
|
index: number | null
|
||||||
|
fly: number | null
|
||||||
|
children: TreeItem[] | null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用来描述 通道检测结果
|
||||||
|
export enum ChnCheckResultEnum {
|
||||||
|
UNKNOWN = -1,
|
||||||
|
LOADING = 0,
|
||||||
|
SUCCESS = 1,
|
||||||
|
FAIL = 2,
|
||||||
|
TIMEOUT = 3,
|
||||||
|
ERRORDATA = 4,
|
||||||
|
NOT_PART_IN_ERROR = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeviceCheckResult {
|
||||||
|
deviceId: string
|
||||||
|
deviceName: string
|
||||||
|
code?: string
|
||||||
|
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||||
|
}
|
||||||
|
|
||||||
|
//用来描述 某个脚本测试项对所有通道的检测结果
|
||||||
|
export interface ScriptChnItem {
|
||||||
|
scriptType: string
|
||||||
|
scriptName?: string //可以不要该属性,有点多余
|
||||||
|
code?: string
|
||||||
|
// 设备
|
||||||
|
devices: Array<DeviceCheckResult>
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum ButtonColorEnum {
|
||||||
|
INFO = '#909399',
|
||||||
|
LOADING = 'var(--el-color-primary)',
|
||||||
|
SUCCESS = '#91cc75',
|
||||||
|
WARNING = '#e6a23c',
|
||||||
|
DANGER = '#f56c6c'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于描述 (设备)通道检测结果展示的按钮类型
|
||||||
|
*/
|
||||||
|
export interface ButtonResult {
|
||||||
|
color: ButtonColorEnum
|
||||||
|
icon: 'More' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled' | 'Minus'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于描述 脚本检测结果展示的按钮类型
|
||||||
|
*/
|
||||||
|
export interface ScriptChnViewItem {
|
||||||
|
scriptType: string
|
||||||
|
scriptName?: string //脚本项名称,可以不要该属性,有点多余
|
||||||
|
|
||||||
|
// 设备
|
||||||
|
devices: Array<{
|
||||||
|
deviceId: string
|
||||||
|
deviceName: string
|
||||||
|
chnResult: ButtonResult[]
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义检测日志类型
|
||||||
|
*/
|
||||||
|
export interface LogItem {
|
||||||
|
type: 'info' | 'warning' | 'error'
|
||||||
|
log: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义手动检测时,勾选的测试项
|
||||||
|
*/
|
||||||
|
export interface SelectTestItem {
|
||||||
|
preTest: boolean
|
||||||
|
timeTest: boolean
|
||||||
|
channelsTest: boolean
|
||||||
|
test: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
//描述比对式检测项描述
|
||||||
|
export interface CompareTestItem {
|
||||||
|
id: string
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
}
|
||||||
143
frontend/src/api/check/test/index.ts
Normal file
143
frontend/src/api/check/test/index.ts
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
import { pa } from 'element-plus/es/locale/index.mjs';
|
||||||
|
import http from '@/api'
|
||||||
|
import {CheckData} from '@/api/check/interface'
|
||||||
|
|
||||||
|
export const getBigTestItem = (params: {
|
||||||
|
reCheckType: number
|
||||||
|
planId: string
|
||||||
|
devIds: string[]
|
||||||
|
patternId: string
|
||||||
|
}) => {
|
||||||
|
return http.post(`/adPlan/getBigTestItem`, params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getScriptList = (params: {
|
||||||
|
devId:string,
|
||||||
|
chnNum:number,
|
||||||
|
num:number
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/getCheckItem', params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取弹出框表单数据
|
||||||
|
* @param params 当为scriptType为null时,表示查询所有脚本类型,否则只查询指定脚本类型。当为chnNum为-1时,表示查询所有通道,否则只查询指定通道。
|
||||||
|
*/
|
||||||
|
export const getFormData = (params: {
|
||||||
|
planId: string
|
||||||
|
deviceId: string
|
||||||
|
chnNum: string
|
||||||
|
scriptType: string | null
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/formContent/', params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取树形结构数据
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getTreeData = (params: {
|
||||||
|
scriptId?: string
|
||||||
|
devId?: string
|
||||||
|
devNum?: string
|
||||||
|
scriptType?: string | null
|
||||||
|
code?: string
|
||||||
|
}) => {
|
||||||
|
return http.post<CheckData.TreeItem[]>('/result/treeData/', params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取检查数据
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getTableData = (params: {
|
||||||
|
scriptType: string | null
|
||||||
|
scriptId: string
|
||||||
|
devId: string
|
||||||
|
devNum: string
|
||||||
|
code: string
|
||||||
|
index: number
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/resultData/', params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const exportRawData = (params: {
|
||||||
|
scriptType: string | null
|
||||||
|
scriptId: string
|
||||||
|
devId: string
|
||||||
|
devNum: string
|
||||||
|
code: string
|
||||||
|
index: number
|
||||||
|
}) => {
|
||||||
|
return http.download('/result/exportRawData', params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新计算
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const reCalculate = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptId: string
|
||||||
|
errorSysId: string
|
||||||
|
deviceId: string
|
||||||
|
code: string
|
||||||
|
patternId: string
|
||||||
|
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/reCalculate', params, {loading: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据获取基本信息
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getContrastFormContent = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptType: string
|
||||||
|
deviceId: string
|
||||||
|
chnNum: string
|
||||||
|
num: number | null
|
||||||
|
patternId: string
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/getContrastFormContent', params, {loading: false})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取检测结果
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getContrastResult = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptType: string
|
||||||
|
deviceId: string
|
||||||
|
chnNum: string | number
|
||||||
|
num: number | string | null
|
||||||
|
waveNum: number | null
|
||||||
|
isWave: boolean
|
||||||
|
patternId: string
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/getContrastResult', params, {loading: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更换误差体系
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const changeErrorSystem = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptId: string
|
||||||
|
errorSysId: string
|
||||||
|
deviceId: string
|
||||||
|
code: string
|
||||||
|
patternId: string
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/changeErrorSystem', params, {loading: true})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除(误差体系切换时产生的)临时表
|
||||||
|
* @param code
|
||||||
|
*/
|
||||||
|
export const deleteTempTable = (code: string) => {
|
||||||
|
return http.get(`/result/deleteTempTable?code=${code}`, null, {loading: false})
|
||||||
|
}
|
||||||
24
frontend/src/api/device/controlSource/index.ts
Normal file
24
frontend/src/api/device/controlSource/index.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
import type { controlSource } from '@/api/device/interface/controlSource'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name 程控源管理模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
//通讯校验
|
||||||
|
export const checkSimulate = (params: controlSource.ResControl) => {
|
||||||
|
return http.post(`/prepare/ytxCheckSimulate`,params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//启动
|
||||||
|
export const startSimulateTest = (params: controlSource.ResControl) => {
|
||||||
|
return http.post(`prepare/startSimulateTest`,params,{loading:false})
|
||||||
|
}
|
||||||
|
|
||||||
|
//停止
|
||||||
|
export const closeSimulateTest = (params: controlSource.ResControl) => {
|
||||||
|
return http.post(`/prepare/closeSimulateTest`,params,{loading:false})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
29
frontend/src/api/device/devType/index.ts
Normal file
29
frontend/src/api/device/devType/index.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import type { DevType } from '@/api/device/interface/devType'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name 设备类型管理模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
//获取设备类型
|
||||||
|
export const getDevTypeList = (params: DevType.ReqPqDevTypeParams) => {
|
||||||
|
return http.post(`/devType/list`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加设备类型
|
||||||
|
export const addDevType = (params: DevType.ResPqDevType) => {
|
||||||
|
return http.post(`/devType/add`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑设备类型
|
||||||
|
export const updateDevType = (params: DevType.ResPqDevType) => {
|
||||||
|
return http.post(`/devType/update`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除设备类型
|
||||||
|
export const deleteDevType = (params: string[]) => {
|
||||||
|
return http.post(`/devType/delete`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -48,64 +48,64 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '1', //装置序号ID
|
id: '1', //装置序号ID
|
||||||
name: '240001', //设备名称
|
name: '240001', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '2', //装置序号ID
|
id: '2', //装置序号ID
|
||||||
name: '240002', //设备名称
|
name: '240002', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '3', //装置序号ID
|
id: '3', //装置序号ID
|
||||||
name: '240003', //设备名称
|
name: '240003', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '4', //装置序号ID
|
id: '4', //装置序号ID
|
||||||
name: '240004', //设备名称
|
name: '240004', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '5', //装置序号ID
|
id: '5', //装置序号ID
|
||||||
name: '240005', //设备名称
|
name: '240005', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '有不合格项', //检测结果
|
check_Result: '不符合', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 1, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '6', //装置序号ID
|
id: '6', //装置序号ID
|
||||||
name: '240006', //设备名称
|
name: '240006', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '有不合格项', //检测结果
|
check_Result: '不符合', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -114,9 +114,9 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '7', //装置序号ID
|
id: '7', //装置序号ID
|
||||||
name: '240007', //设备名称
|
name: '240007', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '全部合格', //检测结果
|
check_Result: '符合', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -125,20 +125,20 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '8', //装置序号ID
|
id: '8', //装置序号ID
|
||||||
name: '240008', //设备名称
|
name: '240008', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '全部合格', //检测结果
|
check_Result: '符合', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 1, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '9', //装置序号ID
|
id: '9', //装置序号ID
|
||||||
name: '240009', //设备名称
|
name: '240009', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '有不合格项', //检测结果
|
check_Result: '不符合', //检测结果
|
||||||
report_State: '已生成', //报告状态
|
report_State: '已生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -147,9 +147,9 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '10', //装置序号ID
|
id: '10', //装置序号ID
|
||||||
name: '240010', //设备名称
|
name: '240010', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '全部合格', //检测结果
|
check_Result: '符合', //检测结果
|
||||||
report_State: '已生成', //报告状态
|
report_State: '已生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -158,9 +158,9 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '11', //装置序号ID
|
id: '11', //装置序号ID
|
||||||
name: '240011', //设备名称
|
name: '240011', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '全部合格', //检测结果
|
check_Result: '符合', //检测结果
|
||||||
report_State: '已生成', //报告状态
|
report_State: '已生成', //报告状态
|
||||||
document_State: '已归档', //归档状态
|
document_State: '已归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -169,9 +169,9 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '12', //装置序号ID
|
id: '12', //装置序号ID
|
||||||
name: '240012', //设备名称
|
name: '240012', //设备名称
|
||||||
dev_Type: 'PQS882B4',//设备类型
|
dev_Type: 'PQS-882B4',//设备类型
|
||||||
dev_Chns: 4, //设备通道数
|
dev_Chns: 4, //设备通道数
|
||||||
check_Result: '全部合格', //检测结果
|
check_Result: '符合', //检测结果
|
||||||
report_State: '已生成', //报告状态
|
report_State: '已生成', //报告状态
|
||||||
document_State: '已归档', //归档状态
|
document_State: '已归档', //归档状态
|
||||||
check_State:'检测完成',//检测状态
|
check_State:'检测完成',//检测状态
|
||||||
@@ -180,258 +180,90 @@ const data = [
|
|||||||
{
|
{
|
||||||
id: '13', //装置序号ID
|
id: '13', //装置序号ID
|
||||||
name: '240013', //设备名称
|
name: '240013', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '14', //装置序号ID
|
id: '14', //装置序号ID
|
||||||
name: '240014', //设备名称
|
name: '240014', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '15', //装置序号ID
|
id: '15', //装置序号ID
|
||||||
name: '240013', //设备名称
|
name: '240015', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '16', //装置序号ID
|
id: '16', //装置序号ID
|
||||||
name: '240014', //设备名称
|
name: '240016', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '17', //装置序号ID
|
id: '17', //装置序号ID
|
||||||
name: '240017', //设备名称
|
name: '240017', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '18', //装置序号ID
|
id: '18', //装置序号ID
|
||||||
name: '240018', //设备名称
|
name: '240018', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '19', //装置序号ID
|
id: '19', //装置序号ID
|
||||||
name: '240019', //设备名称
|
name: '240019', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '20', //装置序号ID
|
id: '20', //装置序号ID
|
||||||
name: '240020', //设备名称
|
name: '240020', //设备名称
|
||||||
dev_Type: 'PQS882A',//设备类型
|
dev_Type: 'PQS-882A',//设备类型
|
||||||
dev_Chns: 1, //设备通道数
|
dev_Chns: 1, //设备通道数
|
||||||
check_Result: '未检测', //检测结果
|
check_Result: '未检', //检测结果
|
||||||
report_State: '未生成', //报告状态
|
report_State: '未生成', //报告状态
|
||||||
document_State: '未归档', //归档状态
|
document_State: '未归档', //归档状态
|
||||||
check_State:'未检测',//检测状态
|
check_State:'未检',//检测状态
|
||||||
reCheck_Num: 0, //复检次数
|
reCheck_Num: 0, //复检次数
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
// const plan_devicedata = [
|
|
||||||
// {
|
|
||||||
// id: '1', //装置序号ID
|
|
||||||
// name: '模拟装置1', //设备名称
|
|
||||||
// dev_Type: 'PQS882A',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 0, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '2', //装置序号ID
|
|
||||||
// name: '模拟装置2', //设备名称
|
|
||||||
// dev_Type: 'PQS882B4',//设备类型
|
|
||||||
// dev_Chns: 4, //设备通道数
|
|
||||||
// check_Result: '/', //检测结果
|
|
||||||
// report_State: '未生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'未检',//检测状态
|
|
||||||
// reCheck_Num: 0, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '3', //装置序号ID
|
|
||||||
// name: '模拟装置3', //设备名称
|
|
||||||
// dev_Type: 'PQS882B4',//设备类型
|
|
||||||
// dev_Chns: 4, //设备通道数
|
|
||||||
// check_Result: '/', //检测结果
|
|
||||||
// report_State: '未生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测中',//检测状态
|
|
||||||
// reCheck_Num: 0, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '4', //装置序号ID
|
|
||||||
// name: '模拟装置4', //设备名称
|
|
||||||
// dev_Type: 'PQS882B4',//设备类型
|
|
||||||
// dev_Chns: 4, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '未生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 1, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '5', //装置序号ID
|
|
||||||
// name: '中电测试装置', //设备名称
|
|
||||||
// dev_Type: 'PMC-680M-22-22-00-115ANBC',//设备类型
|
|
||||||
// dev_Chns: 4, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '未生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 1, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '6', //装置序号ID
|
|
||||||
// name: '易司拓测试装置1', //设备名称
|
|
||||||
// dev_Type: 'E703A',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 1, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '7', //装置序号ID
|
|
||||||
// name: '易司拓测试装置2', //设备名称
|
|
||||||
// dev_Type: 'E703A',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 1, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '8', //装置序号ID
|
|
||||||
// name: '山大电力测试装置1', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 1, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '9', //装置序号ID
|
|
||||||
// name: '山大电力测试装置2', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '10', //装置序号ID
|
|
||||||
// name: '山大电力测试装置2', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '11', //装置序号ID
|
|
||||||
// name: '山大电力测试装置2', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '12', //装置序号ID
|
|
||||||
// name: '山大电力测试装置2', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '13', //装置序号ID
|
|
||||||
// name: '山大电力测试装置2', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '14', //装置序号ID
|
|
||||||
// name: '山大电力测试装置3', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: '15', //装置序号ID
|
|
||||||
// name: '山大电力测试装置4', //设备名称
|
|
||||||
// dev_Type: 'SDL-3002C',//设备类型
|
|
||||||
// dev_Chns: 1, //设备通道数
|
|
||||||
// check_Result: '不合格', //检测结果
|
|
||||||
// report_State: '已生成', //报告状态
|
|
||||||
// document_State: '未归档', //归档状态
|
|
||||||
// check_State:'检测完成',//检测状态
|
|
||||||
// reCheck_Num: 2, //复检次数
|
|
||||||
// },
|
|
||||||
// ]
|
|
||||||
|
|
||||||
export default {data,plan_devicedata}
|
export default {data,plan_devicedata}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { pa } from 'element-plus/es/locale/index.mjs';
|
||||||
import type {Device} from '@/api/device/interface/device'
|
import type {Device} from '@/api/device/interface/device'
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
|
|
||||||
@@ -29,11 +30,45 @@ export const deletePqDev = (params: string[]) => {
|
|||||||
export const exportPqDev = (params: Device.ReqPqDevParams) => {
|
export const exportPqDev = (params: Device.ReqPqDevParams) => {
|
||||||
return http.download(`/pqDev/export`, params)
|
return http.download(`/pqDev/export`, params)
|
||||||
}
|
}
|
||||||
export const downloadTemplate = () => {
|
// 下载导入文件模板
|
||||||
return http.download(`/pqDev/downloadTemplate`)
|
export const downloadTemplate = (params: { pattern: string }) => {
|
||||||
}
|
return http.download(`/pqDev/downloadTemplate`,params)
|
||||||
//导入被检设备
|
|
||||||
export const importPqDev=(params: Device.ReqPqDevParams)=>{
|
|
||||||
return http.upload(`/pqDev/import`, params)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//导入被检设备
|
||||||
|
export const importPqDev = (params: Device.ReqPqDevParams) => {
|
||||||
|
return http.uploadExcel(`/pqDev/import`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//导入比对式被检设备
|
||||||
|
export const importContrastPqDev = (params: Device.ReqPqDevParams) => {
|
||||||
|
return http.upload(`/pqDev/importContrast`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// //导出灿能二楼设备
|
||||||
|
// export const exportCNDev = (params: Device.ReqPqDevParams) => {
|
||||||
|
// return http.download(`/pqDev/exportCNDev`, params)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 下载灿能二楼设备导入文件模板
|
||||||
|
// export const downloadCNDevTemplate = () => {
|
||||||
|
// return http.download(`/pqDev/downloadCNDevTemplate`)
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //导入灿能二楼设备
|
||||||
|
// export const importCNDev = (params: Device.ReqPqDevParams) => {
|
||||||
|
// return http.uploadExcel(`/pqDev/importCNDev`, params)
|
||||||
|
// }
|
||||||
|
|
||||||
|
export const getPqDevById = (params: Device.ReqPqDevParams) => {
|
||||||
|
return http.get(`/pqDev/getById?id=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
||||||
|
export const getPqDev = () => {
|
||||||
|
return http.get(`/devType/listAll`)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getSelectOptions = (params:{ pattern: string }) => {
|
||||||
|
return http.get(`/pqDev/getSelectOptions`, params)
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,177 +30,202 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
const errordetail = ref<ErrorSystem.Error_detail[]>([
|
const errorADetail = ref<ErrorSystem.Error_detail[]>([
|
||||||
{
|
{
|
||||||
measured: '电压偏差',
|
col1: '电压偏差',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '10%~150%标称电压',
|
condition: '10%~150%标称电压',
|
||||||
maxErrorValue: '±0.1%Un'
|
maxErrorValue: '±0.1%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '频率偏差',
|
col1:'频率偏差',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'频率',
|
measurementType:'频率',
|
||||||
condition: '42.5~57.5 Hz',
|
condition: '42.5~57.5 Hz',
|
||||||
maxErrorValue: '±0.01Hz'
|
maxErrorValue: '±0.01Hz'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '0.5%~5%',
|
condition: '0.5%~5%',
|
||||||
maxErrorValue: '±0.15%'
|
maxErrorValue: '±0.15%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '5%(不包含)~ 40%',
|
condition: '5%(不包含)~ 40%',
|
||||||
maxErrorValue: '±0.3%'
|
maxErrorValue: '±0.3%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±1%'
|
maxErrorValue: '±1%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压波动幅值',
|
col1:'电压波动',
|
||||||
|
col2: '电压幅值',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.2%Un'
|
maxErrorValue: '±0.2%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压波动持续时间',
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'时间',
|
measurementType:'时间',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±1周波'
|
maxErrorValue: '±1周波'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '闪变',
|
col1:'闪变',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'短时间闪变',
|
measurementType:'短时间闪变',
|
||||||
condition: 'Pst:0.2~10',
|
condition: 'Pst:0.2~10',
|
||||||
maxErrorValue: '±5%'
|
maxErrorValue: '±5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh≥1%Un',
|
condition: 'Uh≥1%Un',
|
||||||
maxErrorValue: '±5%Uh'
|
maxErrorValue: '±5%Uh'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh<1%Un',
|
condition: 'Uh<1%Un',
|
||||||
maxErrorValue: '±0.05%Un'
|
maxErrorValue: '±0.05%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In≥3%In',
|
condition: 'In≥3%In',
|
||||||
maxErrorValue: '±5%Ih'
|
maxErrorValue: '±5%Ih'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In<3%In',
|
condition: 'In<3%In',
|
||||||
maxErrorValue: '±0.15%In'
|
maxErrorValue: '±0.15%In'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'相角',
|
measurementType:'相角',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: 'h≤5,±1°*h'
|
maxErrorValue: 'h≤5,±1°*h'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'相角',
|
measurementType:'相角',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: 'h>5,±5°'
|
maxErrorValue: 'h>5,±5°'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: 'Ph≥150W',
|
condition: 'Ph≥150W',
|
||||||
maxErrorValue: '±1%Ph'
|
maxErrorValue: '±1%Ph'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: 'Ph<150W',
|
condition: 'Ph<150W',
|
||||||
maxErrorValue: '±1.5W'
|
maxErrorValue: '±1.5W'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh≥1%Un',
|
condition: 'Uh≥1%Un',
|
||||||
maxErrorValue: '±5%Uh'
|
maxErrorValue: '±5%Uh'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh<1%Un',
|
condition: 'Uh<1%Un',
|
||||||
maxErrorValue: '±0.05%Un'
|
maxErrorValue: '±0.05%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In≥3%In',
|
condition: 'In≥3%In',
|
||||||
maxErrorValue: '±5%Ih'
|
maxErrorValue: '±5%Ih'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In<3%In',
|
condition: 'In<3%In',
|
||||||
maxErrorValue: '±0.15%In'
|
maxErrorValue: '±0.15%In'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '功率',
|
col1:'功率',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.5%'
|
maxErrorValue: '±0.5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电流',
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'I≥0.05In',
|
condition: 'I≥0.05In',
|
||||||
maxErrorValue: '±0.5%'
|
maxErrorValue: '±0.5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电流',
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: '0.01In≤I<0.05In',
|
condition: '0.01In≤I<0.05In',
|
||||||
maxErrorValue: '±1%'
|
maxErrorValue: '±1%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '暂态电压幅值',
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '电压幅值',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.2%Un'
|
maxErrorValue: '±0.2%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '暂态持续时间',
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'时间',
|
measurementType:'时间',
|
||||||
condition: '',
|
condition: '',
|
||||||
@@ -208,5 +233,191 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const errorSDetail = ref<ErrorSystem.Error_detail[]>([
|
||||||
|
{
|
||||||
|
col1: '电压偏差',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '20%~120%标称电压',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'频率偏差',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'频率',
|
||||||
|
condition: '42.5~57.5 Hz',
|
||||||
|
maxErrorValue: '±0.05Hz'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '1%~5%',
|
||||||
|
maxErrorValue: '±0.2%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '5%(不包含)~ 40%',
|
||||||
|
maxErrorValue: '±0.6%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'三相不平衡度',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '电压幅值',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1.0%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用半波刷新方均根值',
|
||||||
|
maxErrorValue: '±1周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用全波刷新方均根值',
|
||||||
|
maxErrorValue: '±2周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'闪变',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'短时间闪变',
|
||||||
|
condition: 'Pst:0.4~4',
|
||||||
|
maxErrorValue: '±10%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh≥3%Un',
|
||||||
|
maxErrorValue: '±5%Uh'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh<3%Un',
|
||||||
|
maxErrorValue: '±0.15%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In≥10%In',
|
||||||
|
maxErrorValue: '±5%Ih'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'谐波和间谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In<10%In',
|
||||||
|
maxErrorValue: '±0.5%In'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh≥3%Un',
|
||||||
|
maxErrorValue: '±5%Uh'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: 'Uh<3%Un',
|
||||||
|
maxErrorValue: '±0.15%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In≥10%In',
|
||||||
|
maxErrorValue: '±5%Ih'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'高频次谐波',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'In<10%In',
|
||||||
|
maxErrorValue: '±0.5%In'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'功率',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'功率',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: 'I≥0.05In',
|
||||||
|
maxErrorValue: '±0.5%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1:'电流',
|
||||||
|
col2: '',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电流',
|
||||||
|
condition: '0.01In≤I<0.05In',
|
||||||
|
maxErrorValue: '±1%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '电压幅值',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'电压',
|
||||||
|
condition: '',
|
||||||
|
maxErrorValue: '±1.0%Un'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用半波刷新方均根值',
|
||||||
|
maxErrorValue: '±1周波'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
|
deviceLevel: 'S',
|
||||||
|
measurementType:'时间',
|
||||||
|
condition: '使用全波刷新方均根值',
|
||||||
|
maxErrorValue: '±2周波'
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
export default {errordata,errordetail}
|
export default {errordata,errorADetail,errorSDetail}
|
||||||
@@ -30,5 +30,7 @@ export const deletePqErrSys = (params: string[]) => {
|
|||||||
return http.post(`/pqErrSys/delete`, params)
|
return http.post(`/pqErrSys/delete`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//复制误差体系
|
||||||
|
export const copyPqErrSys = (params: ErrorSystem.ErrorSystemList) => {
|
||||||
|
return http.get(`/pqErrSys/copy?id=${params.id}`)
|
||||||
|
}
|
||||||
38
frontend/src/api/device/icd/index.ts
Normal file
38
frontend/src/api/device/icd/index.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import type { ICD } from '@/api/device/interface/icd'
|
||||||
|
import http from '@/api'
|
||||||
|
import { pa } from 'element-plus/es/locale/index.mjs'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name ICD管理模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//获取ICD分页
|
||||||
|
export const getICDList = (params: ICD.ReqICDParams) => {
|
||||||
|
return http.post(`/icd/list`,params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取ICD
|
||||||
|
export const getICDAllList = (params: ICD.ResICD) => {
|
||||||
|
return http.get(`/icd/listAll`,params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加ICD
|
||||||
|
export const addICD = (params: ICD.ResICD) => {
|
||||||
|
return http.post(`/icd/add`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑ICD
|
||||||
|
export const updateICD = (params: ICD.ResICD) => {
|
||||||
|
return http.post(`/icd/update`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除ICD
|
||||||
|
export const deleteICD = (params: string[]) => {
|
||||||
|
return http.post(`/icd/delete`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
15
frontend/src/api/device/interface/controlSource.ts
Normal file
15
frontend/src/api/device/interface/controlSource.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import type { ReqPage,ResPage } from '@/api/interface'
|
||||||
|
|
||||||
|
// 被检设备模块
|
||||||
|
export namespace controlSource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被检设备新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResControl {
|
||||||
|
userPageId: string;
|
||||||
|
scriptId: string;
|
||||||
|
scriptIndex: number;
|
||||||
|
sourceId: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
41
frontend/src/api/device/interface/devType.ts
Normal file
41
frontend/src/api/device/interface/devType.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
|
// 设备类型模块
|
||||||
|
export namespace DevType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型数据表格分页查询参数
|
||||||
|
*/
|
||||||
|
export interface ReqPqDevTypeParams extends ReqPage {
|
||||||
|
id: string; // 装置序号id 必填
|
||||||
|
devType?: string; // 设备名称
|
||||||
|
createTime?: string; //创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResPqDevType {
|
||||||
|
id: string; //设备类型ID
|
||||||
|
name: string;//设备类型名称
|
||||||
|
icd: string| null;//设备关联的ICD
|
||||||
|
power: string| null;//工作电源
|
||||||
|
devVolt: number; //额定电压(V)
|
||||||
|
devCurr: number; //额定电流(A)
|
||||||
|
devChns: number; //设备通道数
|
||||||
|
reportName: string| null;//报告模版名称
|
||||||
|
state: number;
|
||||||
|
waveCmd:string| null;//录波指令
|
||||||
|
createBy?: string| null; //创建用户
|
||||||
|
createTime?: string| null; //创建时间
|
||||||
|
updateBy?: string| null; //更新用户
|
||||||
|
updateTime?: string| null; //更新时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型表格查询分页返回的对象;
|
||||||
|
*/
|
||||||
|
export interface ResPqDevTypePage extends ResPage<ResPqDevType> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,63 +1,119 @@
|
|||||||
import type { ReqPage, ResPage } from '@/api/interface'
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
import type { Monitor } from './monitor'
|
||||||
|
|
||||||
// 被检设备模块
|
// 被检设备模块
|
||||||
export namespace Device {
|
export namespace Device {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电能质量指标字典数据表格分页查询参数
|
* 被检设备表格分页查询参数
|
||||||
*/
|
*/
|
||||||
export interface ReqPqDevParams extends ReqPage {
|
export interface ReqPqDevParams extends ReqPage {
|
||||||
id: string; // 装置序号id 必填
|
id: string // 装置序号id 必填
|
||||||
devType?: string; // 设备名称
|
name: string //设备名称
|
||||||
createTime?:string; //创建时间
|
devType?: string // 设备名称
|
||||||
|
createTime?: string //创建时间
|
||||||
|
pattern: string
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被检设备表格分页查询参数
|
||||||
|
*/
|
||||||
|
export interface ReqDevReportParams extends ReqPage {
|
||||||
|
planId?: string // 计划id
|
||||||
|
devId?: string // 装置id
|
||||||
|
scriptId?: string // 脚本id
|
||||||
|
planCode?: string
|
||||||
|
devIdList?: string[] // 装置id列表
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 被检设备新增、修改、根据id查询返回的对象
|
* 被检设备新增、修改、根据id查询返回的对象
|
||||||
*/
|
*/
|
||||||
export interface ResPqDev {
|
export interface ResPqDev {
|
||||||
id: string; //装置序号ID
|
id: string //装置序号ID
|
||||||
name: string; //设备名称
|
name: string //设备名称
|
||||||
pattern: string; //设备模式 模拟 数字 比对
|
pattern: string //设备模式 模拟 数字 比对
|
||||||
devType: string;//设备类型
|
devType: string //设备类型
|
||||||
devChns: number; //设备通道数
|
manufacturer?: string | null //生产厂家
|
||||||
devVolt: number; //额定电压(V)
|
createDate: string //生产日期
|
||||||
devCurr: number; //额定电流(A)
|
createId: string //出厂编号
|
||||||
manufacturer: string;//生产厂家
|
hardwareVersion: string //固件版本
|
||||||
createDate: string; //生产日期
|
softwareVersion: string //软件版本
|
||||||
createId: string; //出厂编号
|
protocol: string //通讯协议
|
||||||
hardwareVersion: string; //固件版本
|
ip: string //IP地址
|
||||||
softwareVersion: string; //软件版本
|
port: number //端口号
|
||||||
protocol:string; //通讯协议
|
encryptionFlag: number //装置是否为加密版本
|
||||||
ip: string; //IP地址
|
series?: string | null //装置识别码(3ds加密)
|
||||||
port: number; //端口号
|
devKey?: string | null //装置秘钥(3ds加密)
|
||||||
encryptionFlag: number; //装置是否为加密版本
|
sampleId?: string | null //样品编号
|
||||||
series?: string| null; //装置识别码(3ds加密)
|
arrivedDate?: string //送样日期
|
||||||
devKey?: string| null; //装置秘钥(3ds加密)
|
cityName?: string | null //所属地市名称
|
||||||
sampleID?: string| null; //样品编号
|
gdName?: string | null //所属供电公司名称
|
||||||
arrivedDate?: string; //送样日期
|
subName?: string | null //所属电站名称
|
||||||
cityName?: string| null; //所属地市名称
|
reportPath?: string | null //报告路径
|
||||||
gDName?: string| null; //所属供电公司名称
|
planId?: string //检测计划Id
|
||||||
subName?: string| null; //所属电站名称
|
factorFlag?: number //是否支持系数校准(0:不支持,1:支持)
|
||||||
checkState?: number| null; //检测状态
|
preinvestmentPlan: string | null //预投计划
|
||||||
checkResult?: number| null; //检测结果
|
delegate: string | null //委托方
|
||||||
reportState?: number| null; //报告状态
|
inspectChannel?: string[] | string //被检通道
|
||||||
documentState?: number| null; //归档状态
|
inspectDate?: string | null //定检日期
|
||||||
reportPath?: string| null; //报告路径
|
harmSysId?: string | null //谐波系统设备id
|
||||||
qRCode?: string| null; //设备关键信息二维码
|
importFlag?: number //是否为导入设备 0否 1是
|
||||||
reCheckNum: number; //复检次数
|
state: number //状态
|
||||||
state: number; //状态
|
createBy?: string | null //创建用户
|
||||||
createBy?: string| null; //创建用户
|
createTime?: string | null //创建时间
|
||||||
createTime?: string| null; //创建时间
|
updateBy?: string | null //更新用户
|
||||||
updateBy?: string| null; //更新用户
|
updateTime?: string | null //更新时间
|
||||||
updateTime?: string| null; //更新时间
|
|
||||||
|
|
||||||
|
devChns: number //设备通道数
|
||||||
|
devVolt: number //额定电压(V)
|
||||||
|
devCurr: number //额定电流(A)
|
||||||
|
icdId: string | null
|
||||||
|
power: string | null //工作电源
|
||||||
|
|
||||||
|
devId?: number
|
||||||
|
checkState?: number | null //检测状态(0:未检,1:检测中,2:检测完成 3:归档)
|
||||||
|
checkResult?: number | null //检测结果(0:不符合,1:符合,2:未检)
|
||||||
|
reportState?: number | null //报告状态(0:未生成,1:已生成,2:未检)
|
||||||
|
recheckNum: number //复检次数
|
||||||
|
timeCheckResult?: number //守时检测结果(0:不符合1:符合)
|
||||||
|
factorCheckResult?: number //系数校准结果(0:不合格,1:合格,2:未检)
|
||||||
|
realtimeResult?: number //实时数据结论(0:不符合,1:符合,2:未检)
|
||||||
|
statisticsResult?: number //统计数据结论(0:不符合,1:符合,2:未检)
|
||||||
|
recordedResult?: number //录波数据结论(0:不符合,1:符合,2:未检)
|
||||||
|
checkBy?: string | null //检测人
|
||||||
|
checkTime?: string | null //检测时间
|
||||||
|
preDetectTime?: number //预检测耗时
|
||||||
|
coefficientTime?: number //系数校准耗时
|
||||||
|
formalCheckTime?: number //正式检测耗时
|
||||||
|
|
||||||
|
boundPlanName?: string | null
|
||||||
|
assign?: number ////是否分配给检测人员 0否 1是
|
||||||
|
monitorList: Monitor.ResPqMon[]
|
||||||
|
checked: boolean // 是否已选择
|
||||||
|
disabled: boolean // 是否禁用
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SelectOption {
|
||||||
|
label: string
|
||||||
|
value: string | number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResDev {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
icd: string
|
||||||
|
power: string
|
||||||
|
devVolt: number
|
||||||
|
devCurr: number
|
||||||
|
devChns: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResTH {
|
||||||
|
temperature: number | null //温度
|
||||||
|
humidity: number | null //湿度
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 被检设备表格查询分页返回的对象;
|
* 被检设备表格查询分页返回的对象;
|
||||||
*/
|
*/
|
||||||
export interface ResPqDevPage extends ResPage<ResPqDev> {
|
export interface ResPqDevPage extends ResPage<ResPqDev> {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -22,25 +22,29 @@ export namespace ErrorSystem {
|
|||||||
|
|
||||||
// 查看详细误差体系
|
// 查看详细误差体系
|
||||||
export interface ErrorSystemDetail {
|
export interface ErrorSystemDetail {
|
||||||
nextId: number;
|
sort: number;
|
||||||
id:string;//误差体系子表ID
|
id:string;//误差体系子表ID
|
||||||
errorSysId:string;//所属误差体系ID
|
errorSysId:string;//所属误差体系ID
|
||||||
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段)
|
errorType: string;//误差类型,树形字典表(没有树形表则需要拆分字段)
|
||||||
startValue?:number;//误差判断起始值(误差范围)
|
scriptType: string;//脚本类型
|
||||||
|
startValue?:number | null;//误差判断起始值(误差范围)
|
||||||
startFlag?:number;//是否包含起始值
|
startFlag?:number;//是否包含起始值
|
||||||
endValue?:number;//;误差判断结束值(误差范围)
|
endValue?:number | null;//;误差判断结束值(误差范围)
|
||||||
endFlag?:number;//是否包含结束值
|
endFlag?:number;//是否包含结束值
|
||||||
conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
|
conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
|
||||||
maxErrorValue:number;//误差最大值
|
maxErrorValue:number;//误差最大值
|
||||||
errorValueType:string;//误差值类型(包括值类型,绝对值、相对值1、相对值2)
|
errorValueType:any;//误差值类型(0标称值、1标准值、2值类型)
|
||||||
|
valueType:number;//值类型(1绝对值、2相对值)
|
||||||
|
errorUnit:string;//误差单位
|
||||||
}
|
}
|
||||||
|
|
||||||
//查看详细误差体系
|
//查看详细误差体系
|
||||||
// export interface Error_detail {
|
export interface Error_detail {
|
||||||
// measured: string;
|
col1: string;
|
||||||
// deviceLevel: string;
|
col2: string;
|
||||||
// measurementType:string;
|
deviceLevel: string;
|
||||||
// condition: string;
|
measurementType:string;
|
||||||
// maxErrorValue: string;
|
condition: string;
|
||||||
// }
|
maxErrorValue: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
37
frontend/src/api/device/interface/icd.ts
Normal file
37
frontend/src/api/device/interface/icd.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
|
// ICD模块
|
||||||
|
export namespace ICD {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ICD表格分页查询参数
|
||||||
|
*/
|
||||||
|
export interface ReqICDParams extends ReqPage {
|
||||||
|
id: string; // 装置序号id 必填
|
||||||
|
devType?: string; // 设备名称
|
||||||
|
createTime?: string; //创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ICD新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResICD {
|
||||||
|
id: string; //icdID
|
||||||
|
name: string;//icd名称
|
||||||
|
path: string;//icd存储地址
|
||||||
|
state: number;
|
||||||
|
createBy?: string| null; //创建用户
|
||||||
|
createTime?: string| null; //创建时间
|
||||||
|
updateBy?: string| null; //更新用户
|
||||||
|
updateTime?: string| null; //更新时间
|
||||||
|
angle: number; // 是否支持电压相角、电流相角指标
|
||||||
|
usePhaseIndex: number; // 角型接线时是否使用相别的指标来进行检测
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ICD表格查询分页返回的对象;
|
||||||
|
*/
|
||||||
|
export interface ResICDPage extends ResPage<ResICD> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,33 +1,36 @@
|
|||||||
import type { ReqPage, ResPage } from '@/api/interface'
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
// 被检设备模块
|
// 监测点模块
|
||||||
export namespace Monitor {
|
export namespace Monitor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电能质量指标字典数据表格分页查询参数
|
* 监测点表格分页查询参数
|
||||||
*/
|
*/
|
||||||
export interface ReqPqMonParams extends ReqPage {
|
export interface ReqPqMonParams extends ReqPage {
|
||||||
id: string; // 装置序号id 必填
|
id: string; // 装置序号id 必填
|
||||||
devType?: string; // 设备名称
|
name?: string; // 设备名称
|
||||||
createTime?:string; //创建时间
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 被检设备新增、修改、根据id查询返回的对象
|
* 监测点新增、修改、根据id查询返回的对象
|
||||||
*/
|
*/
|
||||||
export interface ResPqMon {
|
export interface ResPqMon {
|
||||||
id: string; //监测点ID
|
id: string; //监测点ID
|
||||||
code: string; //默认与谐波系统监测点ID相同
|
|
||||||
devId: string; //所属设备ID
|
devId: string; //所属设备ID
|
||||||
name: string; //所属母线
|
busbar: string;//所属母线
|
||||||
num: number; //监测点序号
|
name: string; //监测点名称
|
||||||
pt: number; //PT变比
|
num: number; //线路号,监测点序号
|
||||||
ct: number; //CT变比
|
pt: string; //PT变比
|
||||||
ptType:string; //接线方式,字典表
|
ct: string; //CT变比
|
||||||
|
connection: string; //接线方式,字典表
|
||||||
|
statInterval: number; //统计间隔
|
||||||
|
harmSysId: string; //默认与谐波系统监测点ID相同
|
||||||
|
checkFlag: number;//是否参与检测0否1是
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 被检设备表格查询分页返回的对象;
|
* 监测点表格查询分页返回的对象;
|
||||||
*/
|
*/
|
||||||
export interface ResPqMonPage extends ResPage<ResPqMon> {
|
export interface ResPqMonPage extends ResPage<ResPqMon> {
|
||||||
|
|
||||||
|
|||||||
39
frontend/src/api/device/interface/report.ts
Normal file
39
frontend/src/api/device/interface/report.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
import type { UploadFile } from 'element-plus';
|
||||||
|
|
||||||
|
// 报告模版接口
|
||||||
|
export namespace PqReport {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告模版表格分页查询参数
|
||||||
|
*/
|
||||||
|
export interface ReqReportParams extends ReqPage {
|
||||||
|
id: string; // 装置序号id 必填
|
||||||
|
name?: string; // 设备名称
|
||||||
|
createTime?: string; //创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告模版新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResReport {
|
||||||
|
id: string; //报告模板id
|
||||||
|
name: string;//报告模板名称
|
||||||
|
version:string;//版本号
|
||||||
|
baseFile?:string;//基础模板文件路径
|
||||||
|
detailFile?:string;//检测项模版文件路径
|
||||||
|
description:string;//描述信息
|
||||||
|
state:number;//状态:8-删除 1-正常
|
||||||
|
createBy?: string| null; //创建用户
|
||||||
|
createTime?: string| null; //创建时间
|
||||||
|
updateBy?: string| null; //更新用户
|
||||||
|
updateTime?: string| null; //更新时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报告模版表格查询分页返回的对象;
|
||||||
|
*/
|
||||||
|
export interface ResReportPage extends ResPage<ResReport> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
47
frontend/src/api/device/interface/standardDevice.ts
Normal file
47
frontend/src/api/device/interface/standardDevice.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
|
// 标准设备模块
|
||||||
|
export namespace StandardDevice {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准设备表格分页查询参数
|
||||||
|
*/
|
||||||
|
export interface ReqPqStandardDeviceParams extends ReqPage {
|
||||||
|
id: string; // 装置序号id 必填
|
||||||
|
name: string; //设备名称
|
||||||
|
devType?: string; // 设备名称
|
||||||
|
createTime?: string; //创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准设备新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResPqStandardDevice {
|
||||||
|
id: string; //装置序号ID
|
||||||
|
name: string; //设备名称
|
||||||
|
devType: string;//设备类型
|
||||||
|
manufacturer?: string | null;//生产厂家
|
||||||
|
protocol: string;//通讯协议
|
||||||
|
ip: string; //IP地址
|
||||||
|
port: number; //端口号
|
||||||
|
inspectChannel:string[] |string;//可检通道数
|
||||||
|
encryptionFlag: number; //装置是否为加密版本
|
||||||
|
series?: string | null; //装置识别码(3ds加密)
|
||||||
|
devKey?: string | null; //装置秘钥(3ds加密)
|
||||||
|
state: number; //状态
|
||||||
|
createBy?: string | null; //创建用户
|
||||||
|
createTime?: string | null; //创建时间
|
||||||
|
updateBy?: string | null; //更新用户
|
||||||
|
updateTime?: string | null; //更新时间
|
||||||
|
disabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准设备表格查询分页返回的对象;
|
||||||
|
*/
|
||||||
|
export interface ResPqStandardDevicePage extends ResPage<ResPqStandardDevice> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,37 +2,37 @@ import type { ReqPage, ResPage } from '@/api/interface'
|
|||||||
|
|
||||||
// 检测脚本模块
|
// 检测脚本模块
|
||||||
export namespace TestScript {
|
export namespace TestScript {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测脚本表格分页查询参数
|
* 检测脚本表格分页查询参数
|
||||||
*/
|
*/
|
||||||
export interface ReqTestScriptParams extends ReqPage {
|
export interface ReqTestScriptParams extends ReqPage {
|
||||||
id: string; // 装置序号id 必填
|
id: string // 装置序号id 必填
|
||||||
name: string;
|
name: string
|
||||||
type: string;
|
type: string
|
||||||
|
pattern: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测脚本接口
|
// 检测脚本接口
|
||||||
export interface ResTestScript {
|
export interface ResTestScript {
|
||||||
id?: string; //检测脚本ID
|
id?: string //检测脚本ID
|
||||||
name: string; //检测脚本名称
|
name: string //检测脚本名称
|
||||||
type: string; //检测脚本类型(字典表Code字段,脚本还是模板)
|
type: string //设定0为脚本,1为模板
|
||||||
pattern: string;//检测脚本模式(字典表Code字段,数字、模拟、比对)
|
pattern: string //检测脚本模式(字典表Code字段,数字、模拟、比对)
|
||||||
valueType?: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无)
|
valueType?: string //脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无)
|
||||||
standardName: string;//参照标准名称
|
standardName: string //参照标准名称
|
||||||
standardTime: string;//标准推行时间
|
standardTime: string //标准推行时间
|
||||||
state:number;//
|
state?: number //
|
||||||
createBy?: string;
|
createBy?: string
|
||||||
createTime?: string;
|
createTime?: string
|
||||||
updateBy?: string;
|
updateBy?: string
|
||||||
updateTime?: string;
|
updateTime?: string
|
||||||
|
selectedValue?: string
|
||||||
|
ratedCurr?: number
|
||||||
|
ratedVolt?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测脚本查询分页返回的对象;
|
* 检测脚本查询分页返回的对象;
|
||||||
*/
|
*/
|
||||||
export interface ResTestScriptPage extends ResPage<ResTestScript> {
|
export interface ResTestScriptPage extends ResPage<ResTestScript> {}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ export namespace TestSource {
|
|||||||
// 检测源接口
|
// 检测源接口
|
||||||
export interface ResTestSource {
|
export interface ResTestSource {
|
||||||
id: string; //检测源ID
|
id: string; //检测源ID
|
||||||
name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
name?: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
||||||
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
||||||
type: string; //检测源类型(字典表Code字段,标准源、高精度设备)
|
type: string; //检测源类型(字典表Code字段,标准源、高精度设备)
|
||||||
devType: string;//检测源设备类型(字典表Code字段)
|
devType: string;//检测源设备类型(字典表Code字段)
|
||||||
@@ -34,9 +34,9 @@ export namespace TestSource {
|
|||||||
}
|
}
|
||||||
export interface ParameterType{
|
export interface ParameterType{
|
||||||
id:string;
|
id:string;
|
||||||
sourceParamType:string;
|
type:string;
|
||||||
sourceParamDesc:string;
|
desc:string;
|
||||||
sourceParamValue:string;
|
value:string|null;
|
||||||
sort:number;
|
sort:number;
|
||||||
pId:string;
|
pId:string;
|
||||||
children?:ParameterType[];
|
children?:ParameterType[];
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import type { Monitor } from '@/api/device/interface/monitor'
|
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6,23 +5,9 @@ import http from '@/api'
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//获取监测点
|
//获取监测点
|
||||||
export const getPqMonList = (params: Monitor.ReqPqMonParams) => {
|
export const getPqMonList = (param:any) => {
|
||||||
//return http.post(`/pqMon/list`, params)
|
return http.post(`/pqMonitor/list`, param)
|
||||||
}
|
|
||||||
|
|
||||||
//添加监测点
|
|
||||||
export const addPqMon = (params: Monitor.ResPqMon) => {
|
|
||||||
//return http.post(`/pqMon/add`, params)
|
|
||||||
}
|
|
||||||
|
|
||||||
//编辑监测点
|
|
||||||
export const updatePqMon = (params: Monitor.ResPqMon) => {
|
|
||||||
//return http.post(`/pqMon/update`, params)
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除监测点
|
|
||||||
export const deletePqMon = (params: string[]) => {
|
|
||||||
//return http.post(`/pqMon/delete`, params)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
51
frontend/src/api/device/report/index.ts
Normal file
51
frontend/src/api/device/report/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type {PqReport} from '@/api/device/interface/report'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name 报告模版模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
//获取报告模版
|
||||||
|
export const getPqReportList = (params: PqReport.ReqReportParams) => {
|
||||||
|
return http.post(`/report/list`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增报告模版
|
||||||
|
export const addPqReport = (params: PqReport.ResReport) => {
|
||||||
|
return http.upload(`/report/add`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除报告模版
|
||||||
|
export const deletePqReport = (params: string[]) => {
|
||||||
|
return http.post(`/report/delete`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询报告模板详情
|
||||||
|
export const getPqReportById = (params: PqReport.ResReport) => {
|
||||||
|
return http.get(`/report/getById?id=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改报告模板
|
||||||
|
export const updatePqReport = (params: PqReport.ResReport) => {
|
||||||
|
return http.upload(`/report/update`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询所有报告模板名称
|
||||||
|
export const getPqReportAllName = () => {
|
||||||
|
return http.get(`/report/listAllName`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据名称查询指定报告模板的所有版本
|
||||||
|
export const getPqReportAllVersion = (params:any) => {
|
||||||
|
return http.get(`/report/listAllVersion?name=${params.name}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//被检设备归档
|
||||||
|
export const documentedPqDev = (ids: string[]) => {
|
||||||
|
return http.post(`/report/documented`, ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传报告到云端
|
||||||
|
export const uploadReportToCloud = (deviceIds: string[]) => {
|
||||||
|
return http.post(`/report/uploadReportToCloud`, deviceIds)
|
||||||
|
}
|
||||||
55
frontend/src/api/device/standardDevice/index.ts
Normal file
55
frontend/src/api/device/standardDevice/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { StandardDevice } from '@/api/device/interface/standardDevice'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name 标准设备管理模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
//获取标准设备
|
||||||
|
export const getPqStandardDevList = (params: StandardDevice.ReqPqStandardDeviceParams) => {
|
||||||
|
return http.post(`/pqStandardDev/list`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据id查询标准设备
|
||||||
|
export const getPqStandardDevById = (params: StandardDevice.ReqPqStandardDeviceParams) => {
|
||||||
|
return http.get(`/pqStandardDev/getById?id=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加标准设备
|
||||||
|
export const addPqStandardDev = (params: StandardDevice.ResPqStandardDevice) => {
|
||||||
|
return http.post(`/pqStandardDev/add`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//编辑标准设备
|
||||||
|
export const updatePqStandardDev = (params: StandardDevice.ResPqStandardDevice) => {
|
||||||
|
return http.post(`/pqStandardDev/update`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除标准设备
|
||||||
|
export const deletePqStandardDev = (params: string[]) => {
|
||||||
|
return http.post(`/pqStandardDev/delete`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//导出标准设备
|
||||||
|
export const exportPqStandardDev = (params: StandardDevice.ReqPqStandardDeviceParams) => {
|
||||||
|
return http.download(`/pqStandardDev/export`, params)
|
||||||
|
}
|
||||||
|
// 下载导入文件模板
|
||||||
|
export const downloadTemplate = () => {
|
||||||
|
return http.download(`/pqStandardDev/downloadTemplate`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//导入标准设备
|
||||||
|
export const importPqStandardDev = (params: StandardDevice.ReqPqStandardDeviceParams) => {
|
||||||
|
return http.uploadExcel(`/pqStandardDev/import`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取所有标准设备
|
||||||
|
export const getAllPqStandardDev = () => {
|
||||||
|
return http.get(`/pqStandardDev/getAll`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取可以绑定的标准设备
|
||||||
|
export const canBindingList = () => {
|
||||||
|
return http.get(`/pqStandardDev/canBindingList`)
|
||||||
|
}
|
||||||
@@ -1,15 +1,23 @@
|
|||||||
import type { TestScript } from '@/api/device/interface/testScript'
|
import type { TestScript } from '@/api/device/interface/testScript'
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
|
import { Loading } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name 检测脚本管理模块
|
* @name 检测脚本管理模块
|
||||||
*/
|
*/
|
||||||
|
// 新增脚本
|
||||||
|
export const pqScriptAdd = (params: TestScript.ResTestScript) => {
|
||||||
|
return http.post(`/pqScript/add`, params)
|
||||||
|
}
|
||||||
|
// 修改脚本
|
||||||
|
export const pqScriptUpdate = (params: TestScript.ResTestScript) => {
|
||||||
|
return http.post(`/pqScript/update`, params)
|
||||||
|
}
|
||||||
// 获取检测脚本列表
|
// 获取检测脚本列表
|
||||||
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
|
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
|
||||||
return http.post(`/pqScript/list`, params)
|
return http.post(`/pqScript/list`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//升级为模版
|
//升级为模版
|
||||||
export const updatePqScript = (params: TestScript.ResTestScript) => {
|
export const updatePqScript = (params: TestScript.ResTestScript) => {
|
||||||
return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
|
return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
|
||||||
@@ -19,3 +27,27 @@ export const updatePqScript = (params: TestScript.ResTestScript) => {
|
|||||||
export const deletePqScript = (params: string[]) => {
|
export const deletePqScript = (params: string[]) => {
|
||||||
return http.post(`/pqScript/delete`, params)
|
return http.post(`/pqScript/delete`, params)
|
||||||
}
|
}
|
||||||
|
//添加检测脚本
|
||||||
|
export const addScriptDtls = (params: any) => {
|
||||||
|
return http.post(`/pqScript/addScriptDtls`, params)
|
||||||
|
}
|
||||||
|
//根据脚本id查询检测脚本详情
|
||||||
|
export const dlsDetails = (params: any) => {
|
||||||
|
return http.post(`/pqScript/dlsDetails`, params)
|
||||||
|
}
|
||||||
|
// 删除脚本
|
||||||
|
export const deleteDtls = (params: any) => {
|
||||||
|
return http.post(`/pqScript/deleteDtls`, params)
|
||||||
|
}
|
||||||
|
// 启用关闭脚本
|
||||||
|
export const updateDtls = (params: any) => {
|
||||||
|
return http.post(`/pqScript/updateDtls`, params)
|
||||||
|
}
|
||||||
|
// 根据通讯参数生成装置下发原始数据公式
|
||||||
|
export const scriptDtlsCheckDataList = (params: any) => {
|
||||||
|
return http.post(`/pqScript/scriptDtlsCheckDataList`, params,{loading: false})
|
||||||
|
}
|
||||||
|
// 通讯脚本回显
|
||||||
|
export const checkDataList = (params: any) => {
|
||||||
|
return http.post(`/pqScript/checkDataList`, params, { loading: true })
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export const checkStatus = (status: number) => {
|
|||||||
case 400:
|
case 400:
|
||||||
ElMessage.error("请求失败!请您稍后重试");
|
ElMessage.error("请求失败!请您稍后重试");
|
||||||
break;
|
break;
|
||||||
case 401:
|
// case 401:
|
||||||
ElMessage.error("登录失效!请您重新登录");
|
// ElMessage.error("登录失效!请您重新登录");
|
||||||
break;
|
// break;
|
||||||
case 403:
|
case 403:
|
||||||
ElMessage.error("当前账号无权限访问!");
|
ElMessage.error("当前账号无权限访问!");
|
||||||
break;
|
break;
|
||||||
|
|||||||
6
frontend/src/api/home/channelsTest/index.ts
Normal file
6
frontend/src/api/home/channelsTest/index.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import http from "@/api";
|
||||||
|
|
||||||
|
//系数校准发送基本信息
|
||||||
|
export const getCoefficientCheck = (params: any) => {
|
||||||
|
return http.post(`/prepare/coefficientCheck`, params,{loading: false})
|
||||||
|
}
|
||||||
31
frontend/src/api/home/interface/channelsTest.ts
Normal file
31
frontend/src/api/home/interface/channelsTest.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// 系数校准模块
|
||||||
|
export namespace ChannelsTest {
|
||||||
|
|
||||||
|
// 系数校准列表
|
||||||
|
export interface CoefficientVO {
|
||||||
|
devName?: string;//设备名称
|
||||||
|
type?:string;//区分大小电压
|
||||||
|
monitorNum: string;//监测点序号
|
||||||
|
desc: string;//描述
|
||||||
|
aVuData:string;//电压通道A数据
|
||||||
|
aVuXi:string;//电压通道A系数
|
||||||
|
bVuData:string;//电压通道B数据
|
||||||
|
bVuXi:string;//电压通道B系数
|
||||||
|
cVuData:string;//电压通道C数据
|
||||||
|
cVuXi:string;//电压通道C系数
|
||||||
|
aIeData:string;//电流通道A数据
|
||||||
|
aIeXi:string;//电流通道A系数
|
||||||
|
bIeData:string;//电流通道B数据
|
||||||
|
bIeXi:string;//电流通道B系数
|
||||||
|
cIeData:string;//电流通道C数据
|
||||||
|
cIeXi:string;//电流通道C系数
|
||||||
|
loading: boolean;
|
||||||
|
aV:string;
|
||||||
|
bV:string;
|
||||||
|
cV:string;
|
||||||
|
aI:string;
|
||||||
|
bI:string;
|
||||||
|
cI:string;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,15 +1,23 @@
|
|||||||
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import axios, {
|
||||||
|
AxiosError,
|
||||||
|
type AxiosInstance,
|
||||||
|
type AxiosRequestConfig,
|
||||||
|
type AxiosResponse,
|
||||||
|
type InternalAxiosRequestConfig
|
||||||
|
} from 'axios'
|
||||||
import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen'
|
import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen'
|
||||||
import { LOGIN_URL } from '@/config'
|
import { LOGIN_URL } from '@/config'
|
||||||
import { ElMessage } from 'element-plus'
|
import { type ResultData } from '@/api/interface'
|
||||||
import { ResultData } from '@/api/interface'
|
|
||||||
import { ResultEnum } from '@/enums/httpEnum'
|
import { ResultEnum } from '@/enums/httpEnum'
|
||||||
import { checkStatus } from './helper/checkStatus'
|
import { checkStatus } from './helper/checkStatus'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
import router from '@/routers'
|
import router from '@/routers'
|
||||||
|
import { refreshToken } from '@/api/user/login'
|
||||||
|
import { EventSourcePolyfill } from 'event-source-polyfill'
|
||||||
|
|
||||||
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
||||||
loading?: boolean;
|
loading?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
@@ -20,7 +28,7 @@ const config = {
|
|||||||
// 跨域时候允许携带凭证
|
// 跨域时候允许携带凭证
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
// post请求指定数据类型以及编码
|
// post请求指定数据类型以及编码
|
||||||
headers: { 'Content-Type': 'application/json;charset=utf-8' },
|
headers: { 'Content-Type': 'application/json;charset=utf-8' }
|
||||||
}
|
}
|
||||||
|
|
||||||
class RequestHttp {
|
class RequestHttp {
|
||||||
@@ -37,48 +45,104 @@ class RequestHttp {
|
|||||||
*/
|
*/
|
||||||
this.service.interceptors.request.use(
|
this.service.interceptors.request.use(
|
||||||
(config: CustomAxiosRequestConfig) => {
|
(config: CustomAxiosRequestConfig) => {
|
||||||
|
isFirst = true
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { loading: false } 来控制
|
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { loading: false } 来控制
|
||||||
config.loading ?? (config.loading = true)
|
config.loading ?? (config.loading = true)
|
||||||
config.loading && showFullScreenLoading()
|
config.loading && showFullScreenLoading()
|
||||||
if (config.headers && typeof config.headers.set === 'function') {
|
if (config.headers && typeof config.headers.set === 'function') {
|
||||||
config.headers.set('Authorization', 'Bearer '+userStore.token)
|
config.headers.set('Authorization', 'Bearer ' + userStore.accessToken)
|
||||||
|
config.headers.set('Is-Refresh-Token', userStore.isRefreshToken + '')
|
||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
(error: AxiosError) => {
|
(error: AxiosError) => {
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
let isFirst = true
|
||||||
/**
|
/**
|
||||||
* @description 响应拦截器
|
* @description 响应拦截器
|
||||||
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
|
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
|
||||||
*/
|
*/
|
||||||
this.service.interceptors.response.use(
|
this.service.interceptors.response.use(
|
||||||
(response: AxiosResponse) => {
|
async (response: AxiosResponse) => {
|
||||||
const { data } = response
|
const { data } = response
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
tryHideFullScreenLoading()
|
tryHideFullScreenLoading()
|
||||||
|
|
||||||
|
if (data.code === ResultEnum.ACCESSTOKEN_EXPIRED) {
|
||||||
|
// 用长token去换短token
|
||||||
|
userStore.setAccessToken(userStore.refreshToken)
|
||||||
|
userStore.setIsRefreshToken(true)
|
||||||
|
const result = await refreshToken()
|
||||||
|
if (result) {
|
||||||
|
//获取新token成功的话
|
||||||
|
// 有新的token后,重新请求
|
||||||
|
userStore.setAccessToken(result.data.accessToken)
|
||||||
|
userStore.setRefreshToken(result.data.refreshToken)
|
||||||
|
userStore.setIsRefreshToken(false)
|
||||||
|
userStore.setExp(1000 * 60 * 60 * 24 * 30)
|
||||||
|
response.config.headers.Authorization = `Bearer ${result.data.accessToken}` //重新请求前需要将更新后的新token更换掉之前无效的token,不然会死循环
|
||||||
|
const resp = await this.service.request(response.config)
|
||||||
|
return resp
|
||||||
|
} else {
|
||||||
|
// 刷新失效,跳转登录页
|
||||||
|
}
|
||||||
|
}
|
||||||
// 登陆失效
|
// 登陆失效
|
||||||
if (data.code == ResultEnum.OVERDUE) {
|
if (data.code === ResultEnum.OVERDUE) {
|
||||||
userStore.setToken('')
|
console.log('登陆失效')
|
||||||
userStore.setUserInfo({name: ''})
|
userStore.setAccessToken('')
|
||||||
router.replace(LOGIN_URL)
|
userStore.setRefreshToken('')
|
||||||
|
userStore.setIsRefreshToken(false)
|
||||||
|
userStore.setUserInfo({ id: '', name: '' })
|
||||||
|
userStore.setExp(0)
|
||||||
|
await router.replace(LOGIN_URL)
|
||||||
|
if (isFirst) {
|
||||||
|
//临时处理token失效弹窗多次
|
||||||
ElMessage.error(data.message)
|
ElMessage.error(data.message)
|
||||||
|
isFirst = false
|
||||||
|
}
|
||||||
return Promise.reject(data)
|
return Promise.reject(data)
|
||||||
}
|
}
|
||||||
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
|
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
|
||||||
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
||||||
|
if (data.message.includes('&')) {
|
||||||
|
let formattedMessage = data.message.split('&').join('<br>')
|
||||||
|
if (data.message.includes(':')) {
|
||||||
|
formattedMessage = formattedMessage.replace(':', '')
|
||||||
|
}
|
||||||
|
ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true })
|
||||||
|
return Promise.reject(data)
|
||||||
|
}
|
||||||
|
|
||||||
ElMessage.error(data.message)
|
ElMessage.error(data.message)
|
||||||
return Promise.reject(data)
|
return Promise.reject(data)
|
||||||
}
|
}
|
||||||
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
|
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
|
||||||
|
|
||||||
|
if (userStore.exp <= Date.now() && userStore.exp !== 0) {
|
||||||
|
userStore.setAccessToken('')
|
||||||
|
userStore.setRefreshToken('')
|
||||||
|
userStore.setIsRefreshToken(false)
|
||||||
|
userStore.setUserInfo({ id: '', name: '' })
|
||||||
|
userStore.setExp(0)
|
||||||
|
ElMessage.error('登录已过期,请重新登录!')
|
||||||
|
await router.replace(LOGIN_URL)
|
||||||
|
return Promise.reject(data)
|
||||||
|
}
|
||||||
|
// 对于blob类型的响应,返回完整的response对象以保留响应头
|
||||||
|
if (response.config.responseType === 'blob') {
|
||||||
|
return response
|
||||||
|
}
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
async (error: AxiosError) => {
|
async (error: AxiosError) => {
|
||||||
const { response } = error
|
const { response } = error
|
||||||
tryHideFullScreenLoading()
|
tryHideFullScreenLoading()
|
||||||
|
console.log('error', error.message)
|
||||||
// 请求超时 && 网络错误单独判断,没有 response
|
// 请求超时 && 网络错误单独判断,没有 response
|
||||||
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试')
|
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试')
|
||||||
if (error.message.indexOf('Network Error') !== -1) ElMessage.error('网络错误!请您稍后重试')
|
if (error.message.indexOf('Network Error') !== -1) ElMessage.error('网络错误!请您稍后重试')
|
||||||
@@ -87,7 +151,7 @@ class RequestHttp {
|
|||||||
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
|
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
|
||||||
if (!window.navigator.onLine) router.replace('/500')
|
if (!window.navigator.onLine) router.replace('/500')
|
||||||
return Promise.reject(error)
|
return Promise.reject(error)
|
||||||
},
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,13 +175,68 @@ class RequestHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
download(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
download(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||||
|
return this.service.post(url, params, { ..._object, responseType: 'blob' }).then(res => res.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadWithHeaders(url: string, params?: object, _object = {}): Promise<AxiosResponse<Blob>> {
|
||||||
return this.service.post(url, params, { ..._object, responseType: 'blob' })
|
return this.service.post(url, params, { ..._object, responseType: 'blob' })
|
||||||
}
|
}
|
||||||
|
|
||||||
upload(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
upload(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||||
return this.service.post(url, params, { ..._object, headers: { 'Content-Type': 'multipart/form-data' } })
|
return this.service.post(url, params, {
|
||||||
|
..._object,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对excel的上传,默认返回的是blob类型,Excel没问题时返回json特殊处理
|
||||||
|
*/
|
||||||
|
uploadExcel(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||||
|
return this.service
|
||||||
|
.post(url, params, {
|
||||||
|
..._object,
|
||||||
|
headers: { 'Content-Type': 'multipart/form-data' },
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
.then(res => res.data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加SSE连接方法
|
||||||
|
sse(url: string, params?: any): EventSource {
|
||||||
|
const userStore = useUserStore()
|
||||||
|
// 构造带参数的URL
|
||||||
|
let requestUrl = config.baseURL + url
|
||||||
|
if (params) {
|
||||||
|
const searchParams = new URLSearchParams()
|
||||||
|
for (const key in params) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
||||||
|
searchParams.append(key, String(params[key]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
requestUrl += '?' + searchParams.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建EventSource连接
|
||||||
|
const eventSource = new EventSourcePolyfill(requestUrl, {
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Bearer ' + userStore.accessToken
|
||||||
|
},
|
||||||
|
// 增加超时时间到1200秒
|
||||||
|
heartbeatTimeout: 1200000
|
||||||
|
})
|
||||||
|
|
||||||
|
// 设置默认的Authorization头部
|
||||||
|
eventSource.addEventListener('open', function () {
|
||||||
|
console.log('SSE连接已建立')
|
||||||
|
})
|
||||||
|
// 添加错误处理
|
||||||
|
eventSource.addEventListener('error', function (err) {
|
||||||
|
console.error('SSE连接错误:', err)
|
||||||
|
})
|
||||||
|
|
||||||
|
return eventSource
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new RequestHttp(config)
|
export default new RequestHttp(config)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export interface Result {
|
|||||||
* 请求响应参数(包含data)
|
* 请求响应参数(包含data)
|
||||||
*/
|
*/
|
||||||
export interface ResultData<T = any> extends Result {
|
export interface ResultData<T = any> extends Result {
|
||||||
|
map(arg0: (item: any) => { label: any; value: any; }): { label: string; value: string; }[] | { label: string; value: string; }[];
|
||||||
data: T;
|
data: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,75 +2,62 @@
|
|||||||
"code": "A0000",
|
"code": "A0000",
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
"id": "0",
|
"id": "1",
|
||||||
|
"pid": "0",
|
||||||
"name": "频率准确度检测",
|
"name": "频率准确度检测",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"pid": 0,
|
"id": "1-1",
|
||||||
"id": "0-1",
|
"pid": "1",
|
||||||
"name": "额定工作条件下的检测",
|
"name": "额定工作条件下的检测",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":1,
|
"id": "1-1-1",
|
||||||
"isChildNode":true,
|
"pid": "1-1",
|
||||||
"pid": "0-1",
|
|
||||||
"id": "0-1-1",
|
|
||||||
"name": "输入:频率 42.5Hz..."
|
"name": "输入:频率 42.5Hz..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":2,
|
"id": "1-1-2",
|
||||||
"isChildNode":true,
|
"pid": "1-1",
|
||||||
"pid": "0-1",
|
|
||||||
"id": "0-1-2",
|
|
||||||
"name": "输入:频率 50.0Hz..."
|
"name": "输入:频率 50.0Hz..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":3,
|
"id": "1-1-3",
|
||||||
"isChildNode":true,
|
"pid": "1-1",
|
||||||
"pid": "0-1",
|
"name": "输入:频率 50.05Hz...."
|
||||||
"id": "0-1-3",
|
|
||||||
"name": "输入:频率 50.05Hz..."
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": 0,
|
"id": "1-2",
|
||||||
"id": "0-2",
|
"pid": "1",
|
||||||
"name": "电压对频率测量的影响",
|
"name": "电压对频率测量的影响",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":4,
|
"id": "1-2-1",
|
||||||
"isChildNode":true,
|
"pid": "1-2",
|
||||||
"pid": "0-2",
|
|
||||||
"id": "0-2-1",
|
|
||||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":5,
|
"id": "1-2-1",
|
||||||
"isChildNode":true,
|
"pid": "1-2",
|
||||||
"pid": "0-2",
|
|
||||||
"id": "0-2-1",
|
|
||||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":6,
|
"id": "1-2-2",
|
||||||
"isChildNode":true,
|
"pid": "1-2",
|
||||||
"pid": "0-2",
|
|
||||||
"id": "0-2-2",
|
|
||||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": 0,
|
"id": "1-3",
|
||||||
"id": "0-3",
|
"pid": "1",
|
||||||
"name": "谐波对频率测量的影响",
|
"name": "谐波对频率测量的影响",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":7,
|
"id": "1-3-1",
|
||||||
"isChildNode":true,
|
"pid": "1-3",
|
||||||
"pid": "0-3",
|
|
||||||
"id": "0-3-1",
|
|
||||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -78,145 +65,125 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "1",
|
"id": "2",
|
||||||
|
"pid": "0",
|
||||||
"name": "电压准确度检测",
|
"name": "电压准确度检测",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"pid": 1,
|
"pid": "2",
|
||||||
"id": "1-1",
|
|
||||||
"name": "额定工作条件下的检测",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"scriptIdx":8,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-1",
|
|
||||||
"id": "1-1-1",
|
|
||||||
"name": "输入:频率 42.5Hz..."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"scriptIdx":9,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-1",
|
|
||||||
"id": "1-1-2",
|
|
||||||
"name": "输入:频率 50.0Hz..."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"scriptIdx":10,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-1",
|
|
||||||
"id": "1-1-3",
|
|
||||||
"name": "输入:频率 50.05Hz..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pid": 0,
|
|
||||||
"id": "1-2",
|
|
||||||
"name": "电压对频率测量的影响",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"scriptIdx":11,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-2",
|
|
||||||
"id": "1-2-1",
|
|
||||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"scriptIdx":12,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-2",
|
|
||||||
"id": "1-2-1",
|
|
||||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"scriptIdx":13,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "1-2",
|
|
||||||
"id": "1-2-2",
|
|
||||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"pid": 0,
|
|
||||||
"id": "0-3",
|
|
||||||
"name": "谐波对频率测量的影响",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"scriptIdx":14,
|
|
||||||
"isChildNode":true,
|
|
||||||
"pid": "0-3",
|
|
||||||
"id": "0-3-1",
|
|
||||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "2",
|
|
||||||
"name": "谐波准确度检测",
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"pid": 2,
|
|
||||||
"id": "2-1",
|
"id": "2-1",
|
||||||
"name": "额定工作条件下的检测",
|
"name": "额定工作条件下的检测",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":15,
|
|
||||||
"pid": "2-1",
|
|
||||||
"id": "2-1-1",
|
"id": "2-1-1",
|
||||||
|
"pid": "2-1",
|
||||||
"name": "输入:频率 42.5Hz..."
|
"name": "输入:频率 42.5Hz..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":16,
|
|
||||||
"pid": "2-1",
|
|
||||||
"id": "2-1-2",
|
"id": "2-1-2",
|
||||||
|
"pid": "2-1",
|
||||||
"name": "输入:频率 50.0Hz..."
|
"name": "输入:频率 50.0Hz..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":17,
|
|
||||||
"pid": "2-1",
|
|
||||||
"id": "2-1-3",
|
"id": "2-1-3",
|
||||||
|
"pid": "2-1",
|
||||||
"name": "输入:频率 50.05Hz..."
|
"name": "输入:频率 50.05Hz..."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": 2,
|
"pid": "2",
|
||||||
"id": "2-2",
|
"id": "2-2",
|
||||||
"name": "电压对频率测量的影响",
|
"name": "电压对频率测量的影响",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":18,
|
|
||||||
"pid": "2-2",
|
|
||||||
"id": "2-2-1",
|
"id": "2-2-1",
|
||||||
|
"pid": "2-2",
|
||||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":19,
|
|
||||||
"pid": "2-2",
|
|
||||||
"id": "2-2-1",
|
"id": "2-2-1",
|
||||||
|
"pid": "2-2",
|
||||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"scriptIdx":20,
|
|
||||||
"pid": "2-2",
|
|
||||||
"id": "2-2-2",
|
"id": "2-2-2",
|
||||||
|
"pid": "2-2",
|
||||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pid": 2,
|
"pid": "2",
|
||||||
"id": "2-3",
|
"id": "2-3",
|
||||||
"name": "谐波对频率测量的影响",
|
"name": "谐波对频率测量的影响",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"scriptIdx":21,
|
|
||||||
"pid": "2-3",
|
|
||||||
"id": "2-3-1",
|
"id": "2-3-1",
|
||||||
|
"pid": "2-3",
|
||||||
|
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3",
|
||||||
|
"pid": "0",
|
||||||
|
"name": "谐波准确度检测",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "3-1",
|
||||||
|
"pid": "3",
|
||||||
|
"name": "额定工作条件下的检测",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "3-1-1",
|
||||||
|
"pid": "3-1",
|
||||||
|
"name": "输入:频率 42.5Hz..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-1-2",
|
||||||
|
"pid": "3-1",
|
||||||
|
"name": "输入:频率 50.0Hz..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-1-3",
|
||||||
|
"pid": "3-1",
|
||||||
|
"name": "输入:频率 50.05Hz..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-2",
|
||||||
|
"pid": "3",
|
||||||
|
"name": "电压对频率测量的影响",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "3-2-1",
|
||||||
|
"pid": "3-2",
|
||||||
|
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-2-1",
|
||||||
|
"pid": "3-2",
|
||||||
|
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-2-2",
|
||||||
|
"pid": "3-2",
|
||||||
|
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3-3",
|
||||||
|
"pid": "3",
|
||||||
|
"name": "谐波对频率测量的影响",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "3-3-1",
|
||||||
|
"pid": "3-3",
|
||||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,72 +1,73 @@
|
|||||||
import type { ReqPage } from '@/api/interface'
|
import type { ReqPage } from '@/api/interface'
|
||||||
import type { DatetimeFormatProps } from 'vue-i18n';
|
|
||||||
|
|
||||||
// 检测计划模块
|
// 检测计划模块
|
||||||
export namespace Plan {
|
export namespace Plan {
|
||||||
|
|
||||||
// 检测计划接口
|
// 检测计划接口
|
||||||
export interface PlanBO {
|
export interface ResPlan {
|
||||||
id?: string; //检测计划ID
|
id: string; //检测计划ID
|
||||||
name: string; //检测计划名称
|
name: string; //检测计划名称
|
||||||
pattern: string; //模式,字典表(数字、模拟、比对)
|
pattern?: string; //模式,字典表(数字、模拟、比对)
|
||||||
father_Plan_Id?: string; //父计划ID
|
fatherPlanId?: string; //父计划ID
|
||||||
dataSource_Id: string[]; //数据源ID
|
dataSourceId: string; //数据源ID
|
||||||
script_Id: string; //检测脚本ID
|
scriptId: string; //检测脚本ID
|
||||||
error_Sys_Id: string;//误差体系ID
|
errorSysId: string;//误差体系ID
|
||||||
test_State: string; //检测状态
|
timeCheck:number;//守时检测:0否,1。是
|
||||||
report_State: string; //报告生成状态
|
testState: number; //检测状态:0:未检、1:检测中、2:检测完成,默认为 0
|
||||||
result: string;//检测结果
|
reportState: number; //报告生成状态:0:未生成、1:部分生成、2:全部生成,默认为 0
|
||||||
create_Time?: string;//创建时间
|
result: number;//检测结果:0:不符合、1:符合、2:/,默认为 2
|
||||||
|
code:number; //自动生成,用于生成数据表后缀
|
||||||
|
state: number;//;状态:0-删除 1-正常
|
||||||
|
createBy?:string; //创建用户
|
||||||
|
createTime?:string; //创建时间
|
||||||
|
updateBy?:string; //更新用户
|
||||||
|
updateTime?:string; //更新时间
|
||||||
|
|
||||||
|
associateReport:number;//是否关联报告模板 0否 1是
|
||||||
|
reportTemplateName:string;
|
||||||
|
reportTemplateVersion:string;
|
||||||
|
dataRule:string;//数据处理原则
|
||||||
|
|
||||||
|
standardDevIds:string[];
|
||||||
|
standardDevMap:Map<string,number>;//标准设备
|
||||||
|
testItems:string[];//测试项
|
||||||
|
Check_By?:string;//计划检测人
|
||||||
|
progress?: number; // 进度百分比,例如 75
|
||||||
|
children?: ResPlan[];
|
||||||
|
testConfig?: PlanTestConfig;
|
||||||
|
importFlag?: number; // 导入标识,0-否,1-是
|
||||||
|
leader?: string; // 负责人
|
||||||
|
memberIds?: string | string[]; //成员
|
||||||
|
members?: string; //成员字符串
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测计划 + 分页
|
// 检测计划 + 分页
|
||||||
export interface ReqPlanParams extends ReqPage,PlanBO {
|
export interface ReqPlanParams extends ReqPage,ResPlan {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检测计划 + 检测源
|
|
||||||
export interface PlanAndSourceBO extends PlanBO {
|
|
||||||
testSourceName: string;//计划所属检测源
|
|
||||||
source_Id: string[];
|
|
||||||
device_Id?: string[];
|
|
||||||
testSourceList?: string[];//临时测试
|
|
||||||
dataSource_Ids:string;
|
|
||||||
}
|
|
||||||
// // 检测计划列表
|
|
||||||
// export interface PlanList {
|
|
||||||
// id: string; //检测计划ID
|
|
||||||
// name: string; //检测计划名称
|
|
||||||
// pattern: string; //模式,字典表(数字、模拟、比对)
|
|
||||||
// father_Plan_Id: string; //父计划ID
|
|
||||||
// dataSource_Id: string; //数据源ID
|
|
||||||
// script_Id: string; //检测脚本ID
|
|
||||||
// error_Sys_Id: string;//误差体系ID
|
|
||||||
// test_State: string; //检测状态
|
|
||||||
// report_State: string; //报告生成状态
|
|
||||||
// result: string;//检测结果
|
|
||||||
// state: number; //状态
|
|
||||||
// create_By?: string; //创建用户
|
|
||||||
// create_Time?: string;//创建时间
|
|
||||||
// update_By?: string; //更新用户
|
|
||||||
// update_Time?: string; //更新时间
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // 被检设备参数
|
|
||||||
// export interface ReqPlanParams extends ReqPage {
|
export interface ReqPlan extends ResPlan {
|
||||||
// id: string; //检测计划ID
|
datasourceIds:string | string[];
|
||||||
// name: string; //检测计划名称
|
sourceIds: string | null;
|
||||||
// pattern: string; //模式,字典表(数字、模拟、比对)
|
planId:string;
|
||||||
// father_Plan_Id: string; //父计划ID
|
scriptName: string ;
|
||||||
// dataSource_Id: string; //数据源ID
|
errorSysName: string;
|
||||||
// script_Id: string; //检测脚本ID
|
sourceName: string ;
|
||||||
// error_Sys_Id: string;//误差体系ID
|
standardDevNameStr: string;
|
||||||
// test_State: string; //检测状态
|
testItemNameStr:string;
|
||||||
// report_State: string; //报告生成状态
|
devIds: string[];
|
||||||
// result: string;//检测结果
|
}
|
||||||
// state: number; //状态
|
|
||||||
// create_By?: string; //创建用户
|
export interface PlanTestConfig {
|
||||||
// create_Time?: string;//创建时间
|
planId: string;
|
||||||
// update_By?: string; //更新用户
|
waveRecord: number;
|
||||||
// update_Time?: string; //更新时间
|
realTime: number;
|
||||||
// }
|
statistics: number;
|
||||||
|
flicker: number;
|
||||||
|
maxTime: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,162 @@
|
|||||||
import { ResPage } from '@/api/interface'
|
import type { Plan } from './interface'
|
||||||
import { Plan } from './interface'
|
|
||||||
import { ADMIN as rePrefix } from '@/api/config/serviceName'
|
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
|
import type { ErrorSystem } from '../device/interface/error'
|
||||||
|
import type { Device } from '../device/interface/device'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name 检测计划管理模块
|
* @name 检测计划管理模块
|
||||||
*/
|
*/
|
||||||
// 获取检测计划列表
|
// 获取检测计划列表
|
||||||
export const getPlanList = (params: Plan.ReqPlanParams) => {
|
export const getPlanList = (params: Plan.ReqPlanParams) => {
|
||||||
return http.post<ResPage<Plan.PlanBO>>(`/plan/list`, params)
|
return http.post(`/adPlan/list`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增检测计划
|
// 新增检测计划
|
||||||
export const addPlan = (params: Plan.PlanBO) => {
|
export const addPlan = (params: any) => {
|
||||||
return http.post(`/role/add`, params)
|
return http.post(`/adPlan/add`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑检测计划
|
// 编辑检测计划
|
||||||
export const editPlan = (params: Plan.PlanBO) => {
|
export const updatePlan = (params: any) => {
|
||||||
return http.post(`/role/edit`, params)
|
return http.post(`/adPlan/update`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除检测计划
|
// 删除检测计划
|
||||||
export const deletePlan = (params: { id: string[] }) => {
|
export const deletePlan = (params: { id: string[]; pattern: string }) => {
|
||||||
return http.post(`/role/del`, params)
|
return http.post(`/adPlan/delete?pattern=${params.pattern}`, params.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取指定模式下所有检测源
|
||||||
|
export const getTestSourceList = (params: Plan.ReqPlan) => {
|
||||||
|
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取指定模式下所有检测脚本
|
||||||
|
export const getPqScriptList = (params: Plan.ReqPlan) => {
|
||||||
|
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取所有误差体系
|
||||||
|
export const getPqErrSysList = () => {
|
||||||
|
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取指定模式下所有未绑定的设备
|
||||||
|
export const getUnboundPqDevList = (params: { pattern: string}) => {
|
||||||
|
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据检测计划id查询出所有已绑定的设备
|
||||||
|
export const getBoundPqDevList = (params: any) => {
|
||||||
|
return http.post(`/adPlan/listByPlanId`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//检测计划绑定设备
|
||||||
|
// export const BindPqDevList = (params: any) => {
|
||||||
|
// return http.post(`/pqDev/bindDev`,params)
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 按照模式查询检测计划(用于首页展示)
|
||||||
|
export const getPlanListByPattern = (params: Plan.ReqPlan) => {
|
||||||
|
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出检测计划
|
||||||
|
export const exportPlan = (params: Device.ReqPqDevParams) => {
|
||||||
|
return http.download(`/adPlan/export`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载模板
|
||||||
|
export const downloadTemplate = (params: { patternId: string }) => {
|
||||||
|
return http.download(`/adPlan/downloadTemplate`, params)
|
||||||
|
}
|
||||||
|
// 导入检测计划
|
||||||
|
export const importPlan = (params: Device.ReqPqDevParams) => {
|
||||||
|
return http.uploadExcel(`/adPlan/import`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 装置检测报告生成
|
||||||
|
export const generateDevReport = (params: Device.ReqDevReportParams) => {
|
||||||
|
return http.post(`/report/generateReport`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 装置检测报告下载
|
||||||
|
export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
||||||
|
return http.download(`/report/downloadReport`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 装置检测报告下载(带响应头)
|
||||||
|
export const downloadDevDataWithHeaders = (params: Device.ReqDevReportParams) => {
|
||||||
|
return http.downloadWithHeaders(`/report/downloadReport`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const staticsAnalyse = (params: { id: string[] }) => {
|
||||||
|
return http.download('/adPlan/analyse', params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据计划id分页查询被检设
|
||||||
|
export const getDevListByPlanId = (params: any) => {
|
||||||
|
return http.post(`/adPlan/listDevByPlanId`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改子计划名称
|
||||||
|
export const updateSubPlanName = (params: Plan.ReqPlan) => {
|
||||||
|
return http.get(`/adPlan/updateSubPlanName?planId=${params.id}&name=${params.name}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//子计划绑定/解绑标准设备
|
||||||
|
export const subPlanBindStandardDevList = (params: Plan.ReqPlan) => {
|
||||||
|
return http.post(`/adPlan/updateBindStandardDev`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//子计划绑定/解绑被检设备
|
||||||
|
export const subPlanBindDev = (params: Plan.ReqPlan) => {
|
||||||
|
return http.post(`/adPlan/updateBindDev`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据父计划ID获取未被子计划绑定的标准设备
|
||||||
|
export const getUnboundStandardDevList = (params: Plan.ResPlan) => {
|
||||||
|
return http.get(`/adPlan/getUnBoundStandardDev?fatherPlanId=${params.fatherPlanId}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据计划ID获取已绑定的标准设备
|
||||||
|
export const getBoundStandardDevList = (params: Plan.ResPlan) => {
|
||||||
|
return http.get(`/adPlan/getBoundStandardDev?planId=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据计划ID获取已绑定的所有标准设备
|
||||||
|
export const getBoundStandardDevAllList = (params: { id: string }) => {
|
||||||
|
return http.get(`/adPlan/getBoundStandardDev?planId=${params.id}&all=1`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出子计划
|
||||||
|
export const exportSubPlan = (params: Plan.ResPlan) => {
|
||||||
|
return http.download(`/adPlan/exportSubPlan?planId=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入子检测计划
|
||||||
|
export const importSubPlan = (params: Plan.ResPlan) => {
|
||||||
|
return http.upload(`/adPlan/importSubPlan`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出计划检测结果数据
|
||||||
|
export const exportPlanCheckData = (params: any) => {
|
||||||
|
return http.post(
|
||||||
|
`/adPlan/exportPlanCheckData?planId=${params.id}&devIds=${params.devIds}&report=${params.report}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据误差体系id获取测试项
|
||||||
|
export const getPqErrSysTestItemList = (params: {errorSysId : string}) => {
|
||||||
|
return http.get(`/pqErrSys/getTestItems?id=${params.errorSysId}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取计划项目成员
|
||||||
|
export const getMemberList = (params: {id : string}) => {
|
||||||
|
return http.get(`/adPlan/getMemberList?planId=${params.id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入并合并子检测计划检测结果数据
|
||||||
|
export const importAndMergePlanCheckData = (params: Plan.ResPlan) => {
|
||||||
|
return http.upload(`/adPlan/importAndMergePlanCheckData`, params)
|
||||||
}
|
}
|
||||||
@@ -58,11 +58,15 @@ const dictReportState: Dict[] = [
|
|||||||
const dictResult: Dict[] = [
|
const dictResult: Dict[] = [
|
||||||
{
|
{
|
||||||
id: "0",
|
id: "0",
|
||||||
label: '符合',
|
label: '不符合',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
label: '不符合',
|
label: '符合',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
label: '/',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -170,35 +174,35 @@ const testFatherPlanList: Dict[] = [
|
|||||||
const sourceDataList: Dict[] = [
|
const sourceDataList: Dict[] = [
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
label: '标准源-福禄克-6100A',
|
label: '标准源-FLUKE.6100A电能功率标准源-1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2",
|
id: "2",
|
||||||
label: '标准源-昂立-PF2',
|
label: '标准源-ANGLI-FP2高性能数字信号源-1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3",
|
id: "3",
|
||||||
label: '标准源-丹迪克-DKLN1',
|
label: '标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4",
|
id: "4",
|
||||||
label: '标准源-博电源-PQC600A',
|
label: '标准源-PQC600A高精度电能功率标准源-1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "5",
|
id: "5",
|
||||||
label: '高精度设备-PQV520-1',
|
label: '高精度设备-PQV-520便携式电能质量监测装置-1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "6",
|
id: "6",
|
||||||
label: '高精度设备-PQV520-2',
|
label: '高精度设备-PQV-520便携式电能质量监测装置-2',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "7",
|
id: "7",
|
||||||
label: '高精度设备-PQV520-3',
|
label: '高精度设备-PQV-520便携式电能质量监测装置-3',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "8",
|
id: "8",
|
||||||
label: '高精度设备-PQV520-4',
|
label: '高精度设备-PQV-520便携式电能质量监测装置-4',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -206,46 +210,80 @@ const sourceDataList: Dict[] = [
|
|||||||
const deviceDataList: Dict[] = [
|
const deviceDataList: Dict[] = [
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
label: '模拟装置1',
|
label: '240001',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "2",
|
id: "2",
|
||||||
label: '模拟装置2',
|
label: '240002',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "3",
|
id: "3",
|
||||||
label: '模拟装置3',
|
label: '240003',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4",
|
id: "4",
|
||||||
label: '模拟装置4',
|
label: '240004',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "5",
|
id: "5",
|
||||||
label: '中电送检装置',
|
label: '240005',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "6",
|
id: "6",
|
||||||
label: '易司拓测试装置',
|
label: '240006',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "7",
|
id: "7",
|
||||||
label: '山大电力测试装置1',
|
label: '240007',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "8",
|
id: "8",
|
||||||
label: '山大电力测试装置2',
|
label: '240008',
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
// const deviceDataList: Dict[] = [
|
||||||
|
// {
|
||||||
|
// id: "1",
|
||||||
|
// label: '模拟装置1',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "2",
|
||||||
|
// label: '模拟装置2',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "3",
|
||||||
|
// label: '模拟装置3',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "4",
|
||||||
|
// label: '模拟装置4',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "5",
|
||||||
|
// label: '中电送检装置',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "6",
|
||||||
|
// label: '易司拓测试装置',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "7",
|
||||||
|
// label: '山大电力测试装置1',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "8",
|
||||||
|
// label: '山大电力测试装置2',
|
||||||
|
// },
|
||||||
|
|
||||||
|
// ]
|
||||||
|
|
||||||
const planData = ref<Plan.PlanAndSourceBO[]>([
|
const planData = ref<Plan.PlanAndSourceBO[]>([
|
||||||
{
|
{
|
||||||
'id': '1',
|
'id': '1',
|
||||||
'name': '检测计划1',
|
'name': '沧州110kV东光站装置送检',
|
||||||
'pattern':'1',
|
'pattern':'1',
|
||||||
"source_Id" : ['1'],
|
"source_Id" : ['1'],
|
||||||
"testSourceName":'标准源-福禄克-6100A',
|
"testSourceName":'标准源-FLUKE.6100A电能功率标准源-1',
|
||||||
'dataSource_Id':['1'],
|
'dataSource_Id':['1'],
|
||||||
'dataSource_Ids':'实时数据',
|
'dataSource_Ids':'实时数据',
|
||||||
'script_Id':'1',
|
'script_Id':'1',
|
||||||
@@ -256,32 +294,32 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'id': '2',
|
'id': '2',
|
||||||
'name': '检测计划2',
|
'name': '邯郸2台安徽振兴终端送检',
|
||||||
'pattern':'1',
|
'pattern':'1',
|
||||||
"source_Id" : ['5','6','7','8'],
|
"source_Id" : ['5','6','7','8'],
|
||||||
"testSourceName":'高精度设备-PQV520-1',
|
"testSourceName":'高精度设备-PQV-520便携式电能质量监测装置-1',
|
||||||
'father_Plan_Id':'1',
|
'father_Plan_Id':'1',
|
||||||
'dataSource_Id':['5'],
|
'dataSource_Id':['1'],
|
||||||
'dataSource_Ids':'分钟统计数据CP95值',
|
'dataSource_Ids':'实时数据',
|
||||||
'script_Id':'2',
|
'script_Id':'2',
|
||||||
'error_Sys_Id':'2',
|
'error_Sys_Id':'2',
|
||||||
'test_State':'2',
|
'test_State':'2',
|
||||||
'report_State':'2',
|
'report_State':'2',
|
||||||
'result':'0',
|
'result':'0',
|
||||||
"testSourceList":[
|
"testSourceList":[
|
||||||
'高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-4'
|
'高精度设备-PQV-520便携式电能质量监测装置-2','高精度设备-PQV-520便携式电能质量监测装置-3','高精度设备-PQV-520便携式电能质量监测装置-4'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'id': '3',
|
'id': '3',
|
||||||
'name': '检测子计划3',
|
'name': '浙江分布式光伏电能质量试点',
|
||||||
'pattern':'1',
|
'pattern':'1',
|
||||||
"source_Id" : ['3'],
|
"source_Id" : ['3'],
|
||||||
"testSourceName":'标准源-丹迪克-DKLN1',
|
"testSourceName":'标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
|
||||||
'father_Plan_Id':'1',
|
'father_Plan_Id':'1',
|
||||||
'dataSource_Id':['1'],
|
'dataSource_Id':['1'],
|
||||||
'dataSource_Ids':'实时数据',
|
'dataSource_Ids':'实时数据',
|
||||||
'script_Id':'3',
|
'script_Id':'4',
|
||||||
'error_Sys_Id':'3',
|
'error_Sys_Id':'3',
|
||||||
'test_State':'1',
|
'test_State':'1',
|
||||||
'report_State':'1',
|
'report_State':'1',
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
"code": "200",
|
"code": "200",
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
"name": "未检测",
|
"name": "未检",
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"pid": 1,
|
"pid": 1,
|
||||||
"name": "邯郸220kV团城站等4座站电能质量检测"
|
"name": "邯郸220kV团城站电能质量检测"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"pid": 1,
|
"pid": 1,
|
||||||
"name": "深圳市中电软件有限公司委托送检"
|
"name": "深圳市中电公司委托送检"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": 1
|
"id": 1
|
||||||
@@ -28,17 +28,17 @@
|
|||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"pid": 2,
|
"pid": 2,
|
||||||
"name": "沧州220kV留古等4座变电站电能质量检测"
|
"name": "沧州220kV留古站电能质量检测"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"pid": 2,
|
"pid": 2,
|
||||||
"name": "沧州供电公司110kV东光站等10台装置送检"
|
"name": "沧州110kV东光站装置送检"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
"pid": 2,
|
"pid": 2,
|
||||||
"name": "保定分布式光伏电能质量监测试点"
|
"name": "浙江分布式光伏电能质量试点"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": 2
|
"id": 2
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
{
|
{
|
||||||
"id": 11,
|
"id": 11,
|
||||||
"pid": 3,
|
"pid": 3,
|
||||||
"name": "北京2024现场检测"
|
"name": "深圳2台中电终端委托送检"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": 3
|
"id": 3
|
||||||
|
|||||||
51
frontend/src/api/result/interface/index.ts
Normal file
51
frontend/src/api/result/interface/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
export interface MonitorResult {
|
||||||
|
/**
|
||||||
|
* 监测点id
|
||||||
|
*/
|
||||||
|
monitorId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点序号
|
||||||
|
*/
|
||||||
|
monitorNum: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总检测次数
|
||||||
|
*/
|
||||||
|
totalNum: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合格检测次数
|
||||||
|
*/
|
||||||
|
qualifiedNum: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不合格检测次数
|
||||||
|
*/
|
||||||
|
unQualifiedNum: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 误差体系名称
|
||||||
|
*/
|
||||||
|
errorSysName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测结果
|
||||||
|
*/
|
||||||
|
checkResult: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 哪次
|
||||||
|
*/
|
||||||
|
whichTime: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结论来源
|
||||||
|
*/
|
||||||
|
resultOrigin: string;
|
||||||
|
/**
|
||||||
|
* 来源类型
|
||||||
|
*/
|
||||||
|
resultType: string;
|
||||||
|
}
|
||||||
7
frontend/src/api/result/result.ts
Normal file
7
frontend/src/api/result/result.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
export const getMonitorResult = (devId: string) => http.post(`/result/getMonitorResult?devId=${devId}`)
|
||||||
|
export const getMonitorDataSourceResult = (monitorId: string) =>
|
||||||
|
http.get(`/result/getMonitorDataSourceResult?monitorId=${monitorId}`)
|
||||||
|
|
||||||
|
export const updateMonitorResult = (data: any) => http.post('/result/updateMonitorResult', data)
|
||||||
46
frontend/src/api/socket/socket.ts
Normal file
46
frontend/src/api/socket/socket.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
|
||||||
|
export const startPreTest = (params) => {
|
||||||
|
return http.post(`/prepare/startPreTest`, params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const closePreTest = (params) => {
|
||||||
|
return http.post(`/prepare/closePreTest`, params,{ loading: false })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始正式检测
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
// export const startTest = (params) => {
|
||||||
|
// return http.post(`/prepare/startTest`, params, {loading: false})
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 暂停正式检测
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const pauseTest = () => {
|
||||||
|
return http.get(`/prepare/closePreTest`, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继续正式检测
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const resumeTest = (params) => {
|
||||||
|
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比对式通道配对
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const contrastTest = (params: any) => {
|
||||||
|
return http.post(`/prepare/startContrastTest`,params)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const exportAlignData= () => {
|
||||||
|
return http.download(`/prepare/exportAlignData`)
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import {type Base} from '@/api/system/base/interface'
|
import {type Base} from '@/api/system/base/interface'
|
||||||
|
|
||||||
@@ -12,6 +13,10 @@ export const updateTestConfig = (params: Base.ResTestConfig) => {
|
|||||||
return http.post(`/sysTestConfig/update`, params)
|
return http.post(`/sysTestConfig/update`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//场景切换
|
||||||
|
export const updateScene = (params: any) => {
|
||||||
|
return http.post(`/sysTestConfig/update`,params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ export namespace Base {
|
|||||||
id: string; //系统配置表Id
|
id: string; //系统配置表Id
|
||||||
autoGenerate:number;//检测报告是否自动生成0 否;1是
|
autoGenerate:number;//检测报告是否自动生成0 否;1是
|
||||||
maxTime:number;//最大复检次数,默认3次
|
maxTime:number;//最大复检次数,默认3次
|
||||||
dataRule:string;//数据处理原则,关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值
|
|
||||||
state: number; //状态
|
state: number; //状态
|
||||||
|
scale:number;//小数位
|
||||||
createBy?: string| null; //创建用户
|
createBy?: string| null; //创建用户
|
||||||
createTime?: string| null; //创建时间
|
createTime?: string| null; //创建时间
|
||||||
updateBy?: string| null; //更新用户
|
updateBy?: string| null; //更新用户
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ const dictData: Dict[] = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
id: "0",
|
id: "0",
|
||||||
label: 'FLUKE6100A电能功率标准源',
|
label: 'FLUKE.6100A电能功率标准源',
|
||||||
code: 0,
|
code: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -236,7 +236,7 @@ const dictData: Dict[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "4",
|
id: "4",
|
||||||
label: 'PQV-520电能质量检测装置',
|
label: 'PQV-520便携式电能质量监测装置',
|
||||||
code: 4,
|
code: 4,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import { type Dict } from '@/api/system/dictionary/interface'
|
import { type Dict } from '@/api/system/dictionary/interface'
|
||||||
|
import { c } from 'vite/dist/node/types.d-aGj9QkWt'
|
||||||
|
|
||||||
//获取字典类型
|
//获取字典类型
|
||||||
export const getDictTreeList = (params: Dict.ResDictTree) => {
|
export const getDictTreeByCode = (params: Dict.ResDictTree) => {
|
||||||
const name = params.name || '';
|
const code = params.code || ''
|
||||||
return http.get(`/dictTree/getTree?keyword=${name}`, params)
|
return http.get(`/dictTree/getTreeByCode?code=${code}`, { loading: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getDictTreeByName = (params: Dict.ResDictTree) => {
|
||||||
|
const name = params.name || ''
|
||||||
|
return http.get(`/dictTree/getTreeByName?name=${name}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加字典类型
|
//添加字典类型
|
||||||
@@ -21,4 +27,3 @@ export const updateDictTree = (params: Dict.ResDictTree) => {
|
|||||||
export const deleteDictTree = (params: Dict.ResDictTree) => {
|
export const deleteDictTree = (params: Dict.ResDictTree) => {
|
||||||
return http.post(`/dictTree/delete?id=${params.id}`)
|
return http.post(`/dictTree/delete?id=${params.id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export namespace Dict {
|
|||||||
name: string; // 名称
|
name: string; // 名称
|
||||||
code: string; // 编码
|
code: string; // 编码
|
||||||
sort: number; // 排序
|
sort: number; // 排序
|
||||||
|
openValue?: number | null;
|
||||||
level?: number | null; // 事件等级:0-普通;1-中等;2-严重 (默认为0)
|
level?: number | null; // 事件等级:0-普通;1-中等;2-严重 (默认为0)
|
||||||
algoDescribe?: number | null; // 与高级算法内部Id描述对应
|
algoDescribe?: number | null; // 与高级算法内部Id描述对应
|
||||||
value?: string | null; // 字典针对电压等级
|
value?: string | null; // 字典针对电压等级
|
||||||
@@ -116,10 +117,10 @@ export namespace Dict {
|
|||||||
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
||||||
curSts?:number | null;//sts、do的当前值;
|
curSts?:number | null;//sts、do的当前值;
|
||||||
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
||||||
maxNum?:number ;//设置最大值
|
maxNum?:number | null;//设置最大值
|
||||||
minNum?: number;//设置最小值
|
minNum?: number| null;//设置最小值
|
||||||
setValue?:string | null;//参数为enum可设置的所有值序列
|
setValue?:string | null;//参数为enum可设置的所有值序列
|
||||||
strlen?:number ;//参数string可设置字符串的长度上 限
|
strlen?:number | null;//参数string可设置字符串的长度上 限
|
||||||
defaultValue?:string | null; //参数缺省值、告警code值
|
defaultValue?:string | null; //参数缺省值、告警code值
|
||||||
resourcesId?:string ; //报表数据来源(统计表表名)
|
resourcesId?:string ; //报表数据来源(统计表表名)
|
||||||
limitName?:string | null; //限值字段名称
|
limitName?:string | null; //限值字段名称
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import type {AuditLog } from '@/api/system/log/interface/log.ts'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name 审计日志管理模块
|
||||||
|
*/
|
||||||
|
|
||||||
|
//获取审计日志
|
||||||
|
export const getAuditLog = (params: AuditLog.ReqAuditLogParams) => {
|
||||||
|
return http.post(`/sysLog/list`, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const exportCsv = (params: AuditLog.ReqAuditLogParams) => {
|
||||||
|
return http.download(`/sysLog/exportCSV`, params)
|
||||||
|
}
|
||||||
@@ -1,15 +1,36 @@
|
|||||||
|
import type { ReqPage, ResPage } from '@/api/interface'
|
||||||
|
|
||||||
// 审计日志管理模块
|
// 审计日志管理模块
|
||||||
export namespace Sys_Log_Audit {
|
export namespace AuditLog {
|
||||||
// 日志列表
|
|
||||||
export interface Audit_LogList {
|
/**
|
||||||
id: string;//日志表Id
|
* 设备类型数据表格分页查询参数
|
||||||
operate_Type:string;//日志类型
|
*/
|
||||||
|
export interface ReqAuditLogParams extends ReqPage {
|
||||||
|
id: string; //审计日志Id 必填
|
||||||
|
createTime?: string; //创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型新增、修改、根据id查询返回的对象
|
||||||
|
*/
|
||||||
|
export interface ResAuditLog {
|
||||||
|
id: string;//审计日志Id
|
||||||
|
operate_Type:string;//操作类型
|
||||||
ip:string;//操作IP
|
ip:string;//操作IP
|
||||||
result: string;//事件结果
|
result: string;//事件结果
|
||||||
remark: string;//事件描述
|
remark: string;//事件描述
|
||||||
|
level:number;//告警等级
|
||||||
warn:number;//告警标志
|
warn:number;//告警标志
|
||||||
create_By:string;//创建用户
|
create_By:string;//创建用户
|
||||||
create_Time:string;//创建时间
|
create_Time:string;//创建时间
|
||||||
|
sort:number;//排序
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备类型表格查询分页返回的对象;
|
||||||
|
*/
|
||||||
|
export interface ResAuditLogPage extends ResPage<ResAuditLog> {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,11 +2,10 @@ import http from '@/api'
|
|||||||
import { type VersionRegister } from '@/api/system/versionRegister/interface'
|
import { type VersionRegister } from '@/api/system/versionRegister/interface'
|
||||||
|
|
||||||
//获取有效数据配置
|
//获取有效数据配置
|
||||||
export const getRegRes = (params: VersionRegister.ResSys_Reg_Res) => {
|
export const getRegRes = (params: { type: string }) => {
|
||||||
return http.get(`/sysRegRes/getRegResByType?id=${params.type}`)
|
return http.get(`/sysRegRes/getRegResByType?id=${params.type}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//编辑有效数据配置
|
//编辑有效数据配置
|
||||||
export const updateRegRes = (params: VersionRegister.Sys_Reg_Res) => {
|
export const updateRegRes = (params: VersionRegister.Sys_Reg_Res) => {
|
||||||
return http.post(`/sysRegRes/update`, params)
|
return http.post(`/sysRegRes/update`, params)
|
||||||
|
|||||||
@@ -3,17 +3,20 @@ import type { ReqPage,ResPage } from '@/api/interface'
|
|||||||
|
|
||||||
export namespace Login {
|
export namespace Login {
|
||||||
export interface ReqLoginForm {
|
export interface ReqLoginForm {
|
||||||
username: string;
|
username: string
|
||||||
password: string;
|
password: string
|
||||||
|
checked: boolean
|
||||||
}
|
}
|
||||||
export interface ResLogin {
|
export interface ResLogin {
|
||||||
accessToken: string;
|
accessToken: string
|
||||||
|
refreshToken: string
|
||||||
userInfo: {
|
userInfo: {
|
||||||
name: string;
|
id: string
|
||||||
|
name: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export interface ResAuthButtons {
|
export interface ResAuthButtons {
|
||||||
[key: string]: string[];
|
[key: string]: string[]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,6 +52,8 @@ export namespace User {
|
|||||||
updateTime?: string;//更新时间
|
updateTime?: string;//更新时间
|
||||||
roleIds?: string[]; //
|
roleIds?: string[]; //
|
||||||
roleNames?:string[]; //
|
roleNames?:string[]; //
|
||||||
|
roleCodes?:string[]; //
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户接口
|
// 用户接口
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
|
import { pa } from 'element-plus/es/locale/index.mjs';
|
||||||
import type {Login} from '@/api/user/interface/user'
|
import type {Login} from '@/api/user/interface/user'
|
||||||
import {ADMIN as rePrefix} from '@/api/system/config/serviceName'
|
import {ADMIN as rePrefix} from '@/api/system/config/serviceName'
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import type {Dict} from '@/api/interface'
|
import type {Dict} from '@/api/interface'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name 登录模块
|
* @name 登录模块
|
||||||
*/
|
*/
|
||||||
// 用户登录
|
// 用户登录
|
||||||
export const loginApi = (params: Login.ReqLoginForm) => {
|
export const loginApi = (params: { username: string; password: string}) => {
|
||||||
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, {loading: false})
|
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, {loading: false})
|
||||||
// return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
|
// return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
|
||||||
}
|
}
|
||||||
@@ -30,3 +32,29 @@ export const getDictList = () =>{
|
|||||||
return http.get<Dict>('/dictData/dictDataCache')
|
return http.get<Dict>('/dictData/dictDataCache')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//token刷新
|
||||||
|
export const refreshToken = () => {
|
||||||
|
return http.get<Login.ResLogin>(`${rePrefix}/refreshToken`,
|
||||||
|
{},
|
||||||
|
{loading: false}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取场景
|
||||||
|
export const getCurrentScene = () => {
|
||||||
|
return http.get('/sysTestConfig/getCurrentScene', {}, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取RSA公钥
|
||||||
|
*/
|
||||||
|
export const getPublicKey = (username: string) => {
|
||||||
|
return http.get(`/admin/getPublicKey?username=${username}`, {}, {loading: false})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取是否在检测中自动生成报告
|
||||||
|
*/
|
||||||
|
export const getAutoGenerate = () => {
|
||||||
|
return http.get('/sysTestConfig/getAutoGenerate', {}, {loading: false})
|
||||||
|
}
|
||||||
|
|||||||
@@ -37,3 +37,7 @@ export const updatePassWord = (params: User.ResPassWordUser) => {
|
|||||||
return http.post(`/sysUser/updatePassword`,params)
|
return http.post(`/sysUser/updatePassword`,params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取所有用户
|
||||||
|
export const getAllUser= () => {
|
||||||
|
return http.get(`/sysUser/getAll`)
|
||||||
|
}
|
||||||
|
|||||||
BIN
frontend/src/assets/images/inspected1.jpg
Normal file
BIN
frontend/src/assets/images/inspected1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 MiB |
BIN
frontend/src/assets/images/inspected2.png
Normal file
BIN
frontend/src/assets/images/inspected2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
BIN
frontend/src/assets/images/transient.png
Normal file
BIN
frontend/src/assets/images/transient.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -10,10 +10,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="403">
|
<script setup lang="ts" name="403">
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter();
|
|
||||||
|
const router = useRouter()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,10 +10,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="404">
|
<script setup lang="ts" name="404">
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter();
|
|
||||||
|
const router = useRouter()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,10 +10,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="500">
|
<script setup lang="ts" name="500">
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from 'vue-router'
|
||||||
const router = useRouter();
|
|
||||||
|
const router = useRouter()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" :title="`批量添加${parameter.title}`" :destroy-on-close="true" width="580px" draggable>
|
<el-dialog
|
||||||
|
v-model="dialogVisible"
|
||||||
|
:title="`批量添加${parameter.title}`"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
width="580px"
|
||||||
|
draggable
|
||||||
|
>
|
||||||
<el-form class="drawer-multiColumn-form" label-width="100px">
|
<el-form class="drawer-multiColumn-form" label-width="100px">
|
||||||
<el-form-item label="模板下载 :">
|
<el-form-item label="模板下载 :">
|
||||||
<el-button type="primary" :icon="Download" @click="downloadTemp">点击下载</el-button>
|
<el-button type="primary" :icon="Download" @click="downloadTemp">点击下载</el-button>
|
||||||
@@ -15,19 +21,22 @@
|
|||||||
:http-request="uploadExcel"
|
:http-request="uploadExcel"
|
||||||
:before-upload="beforeExcelUpload"
|
:before-upload="beforeExcelUpload"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:on-success="excelUploadSuccess"
|
|
||||||
:on-error="excelUploadError"
|
|
||||||
:accept="parameter.fileType!.join(',')"
|
:accept="parameter.fileType!.join(',')"
|
||||||
>
|
>
|
||||||
<slot name="empty">
|
<slot name="empty">
|
||||||
<el-icon class="el-icon--upload">
|
<el-icon class="el-icon--upload">
|
||||||
<upload-filled />
|
<upload-filled />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或
|
||||||
|
<em>点击上传</em>
|
||||||
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<slot name="tip">
|
<slot name="tip">
|
||||||
<div class="el-upload__tip">请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M</div>
|
<div class="el-upload__tip">
|
||||||
|
请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M
|
||||||
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -40,112 +49,159 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="ImportExcel">
|
<script setup lang="ts" name="ImportExcel">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue'
|
||||||
import { useDownload } from "@/hooks/useDownload";
|
import { useDownload } from '@/hooks/useDownload'
|
||||||
import { Download } from "@element-plus/icons-vue";
|
import { Download } from '@element-plus/icons-vue'
|
||||||
import { ElNotification, UploadRequestOptions, UploadRawFile } from "element-plus";
|
import { ElMessage, ElNotification, UploadRawFile, UploadRequestOptions } from 'element-plus'
|
||||||
|
|
||||||
export interface ExcelParameterProps {
|
export interface ExcelParameterProps {
|
||||||
title: string; // 标题
|
title: string // 标题
|
||||||
showCover?: boolean; // 是否显示”数据覆盖“选项
|
showCover?: boolean // 是否显示”数据覆盖“选项
|
||||||
fileSize?: number; // 上传文件的大小
|
patternId?: string // 模式ID
|
||||||
fileType?: File.ExcelMimeType[]; // 上传文件的类型
|
planId?: string | null //计划ID
|
||||||
tempApi?: (params: any) => Promise<any>; // 下载模板的Api
|
fileSize?: number // 上传文件的大小
|
||||||
importApi?: (params: any) => Promise<any>; // 批量导入的Api
|
fileType?: File.ExcelMimeType[] // 上传文件的类型
|
||||||
getTableList?: () => void; // 获取表格数据的Api
|
tempApi?: (params: any) => Promise<any> // 下载模板的Api
|
||||||
|
importApi?: (params: any) => Promise<any> // 批量导入的Api
|
||||||
|
getTableList?: () => void // 获取表格数据的Api
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否覆盖数据
|
// 是否覆盖数据
|
||||||
const isCover = ref(false);
|
const isCover = ref(false)
|
||||||
// 最大文件上传数
|
// 最大文件上传数
|
||||||
const excelLimit = ref(1);
|
const excelLimit = ref(1)
|
||||||
// dialog状态
|
// dialog状态
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false)
|
||||||
// 父组件传过来的参数
|
// 父组件传过来的参数
|
||||||
const parameter = ref<ExcelParameterProps>({
|
const parameter = ref<ExcelParameterProps>({
|
||||||
title: "",
|
title: '',
|
||||||
fileSize: 5,
|
fileSize: 5,
|
||||||
fileType: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]
|
fileType: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']
|
||||||
});
|
})
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'result', data: boolean): void
|
||||||
|
}>()
|
||||||
// 接收父组件参数
|
// 接收父组件参数
|
||||||
const acceptParams = (params: ExcelParameterProps) => {
|
const acceptParams = (params: ExcelParameterProps) => {
|
||||||
parameter.value = { ...parameter.value, ...params };
|
parameter.value = { ...parameter.value, ...params }
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
// Excel 导入模板下载
|
// Excel 导入模板下载
|
||||||
const downloadTemp = () => {
|
const downloadTemp = () => {
|
||||||
if (!parameter.value.tempApi) return;
|
if (!parameter.value.tempApi) return
|
||||||
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`,{},true);
|
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, { pattern: parameter.value.patternId }, false)
|
||||||
};
|
}
|
||||||
|
|
||||||
// 文件上传
|
// 文件上传
|
||||||
const uploadExcel = async (param: UploadRequestOptions) => {
|
const uploadExcel = async (param: UploadRequestOptions) => {
|
||||||
debugger
|
let excelFormData = new FormData()
|
||||||
let excelFormData = new FormData();
|
excelFormData.append('file', param.file)
|
||||||
excelFormData.append("file", param.file);
|
if (parameter.value.patternId) {
|
||||||
isCover.value && excelFormData.append("isCover", isCover.value as unknown as Blob);
|
excelFormData.append('patternId', parameter.value.patternId)
|
||||||
await parameter.value.importApi!(excelFormData);
|
}
|
||||||
parameter.value.getTableList && parameter.value.getTableList();
|
|
||||||
dialogVisible.value = false;
|
excelFormData.append('planId', parameter.value.planId)
|
||||||
};
|
|
||||||
|
isCover.value && excelFormData.append('isCover', isCover.value as unknown as Blob)
|
||||||
|
//await parameter.value.importApi!(excelFormData);
|
||||||
|
await parameter.value.importApi!(excelFormData).then(res => handleImportResponse(res))
|
||||||
|
|
||||||
|
parameter.value.getTableList && parameter.value.getTableList()
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleImportResponse(res: any) {
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
if (res.type === 'application/json') {
|
||||||
|
const fileReader = new FileReader()
|
||||||
|
fileReader.onloadend = () => {
|
||||||
|
try {
|
||||||
|
const jsonData = JSON.parse(fileReader.result)
|
||||||
|
if (jsonData.code === 'A0000') {
|
||||||
|
ElMessage.success('导入成功')
|
||||||
|
} else {
|
||||||
|
ElMessageBox.alert(jsonData.message, {
|
||||||
|
title: '导入结果',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
emit('result', jsonData.data)
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fileReader.readAsText(res)
|
||||||
|
} else {
|
||||||
|
emit('result', false)
|
||||||
|
ElMessage.error('导入失败,请查看下载附件!')
|
||||||
|
let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||||
|
const url = window.URL.createObjectURL(blob)
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = url
|
||||||
|
link.download = '导入失败数据'
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
link.remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 文件上传之前判断
|
* @description 文件上传之前判断
|
||||||
* @param file 上传的文件
|
* @param file 上传的文件
|
||||||
* */
|
* */
|
||||||
const beforeExcelUpload = (file: UploadRawFile) => {
|
const beforeExcelUpload = (file: UploadRawFile) => {
|
||||||
const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType);
|
const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType)
|
||||||
const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!;
|
const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!
|
||||||
if (!isExcel)
|
if (!isExcel)
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: "温馨提示",
|
title: '温馨提示',
|
||||||
message: "上传文件只能是 xls / xlsx 格式!",
|
message: '上传文件只能是 xls / xlsx 格式!',
|
||||||
type: "warning"
|
type: 'warning'
|
||||||
});
|
})
|
||||||
if (!fileSize)
|
if (!fileSize)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: "温馨提示",
|
title: '温馨提示',
|
||||||
message: `上传文件大小不能超过 ${parameter.value.fileSize}MB!`,
|
message: `上传文件大小不能超过 ${parameter.value.fileSize}MB!`,
|
||||||
type: "warning"
|
type: 'warning'
|
||||||
});
|
})
|
||||||
}, 0);
|
}, 0)
|
||||||
return isExcel && fileSize;
|
return isExcel && fileSize
|
||||||
};
|
}
|
||||||
|
|
||||||
// 文件数超出提示
|
// 文件数超出提示
|
||||||
const handleExceed = () => {
|
const handleExceed = () => {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: "温馨提示",
|
title: '温馨提示',
|
||||||
message: "最多只能上传一个文件!",
|
message: '最多只能上传一个文件!',
|
||||||
type: "warning"
|
type: 'warning'
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
// 上传错误提示
|
// 上传错误提示
|
||||||
const excelUploadError = () => {
|
// const excelUploadError = () => {
|
||||||
ElNotification({
|
// ElNotification({
|
||||||
title: "温馨提示",
|
// title: '温馨提示',
|
||||||
message: `批量添加${parameter.value.title}失败,请您重新上传!`,
|
// message: `批量添加${parameter.value.title}失败,请您重新上传!`,
|
||||||
type: "error"
|
// type: 'error',
|
||||||
});
|
// })
|
||||||
};
|
// }
|
||||||
|
|
||||||
// 上传成功提示
|
// 上传成功提示
|
||||||
const excelUploadSuccess = () => {
|
// const excelUploadSuccess = () => {
|
||||||
ElNotification({
|
// ElNotification({
|
||||||
title: "温馨提示",
|
// title: '温馨提示',
|
||||||
message: `批量添加${parameter.value.title}成功!`,
|
// message: `批量添加${parameter.value.title}成功!`,
|
||||||
type: "success"
|
// type: 'success',
|
||||||
});
|
// })
|
||||||
};
|
// }
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
acceptParams
|
acceptParams
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
3
frontend/src/components/ImportZip/index.scss
Normal file
3
frontend/src/components/ImportZip/index.scss
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.upload {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
241
frontend/src/components/ImportZip/index.vue
Normal file
241
frontend/src/components/ImportZip/index.vue
Normal file
@@ -0,0 +1,241 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-model="dialogVisible"
|
||||||
|
:title="parameter.title"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
width="450px"
|
||||||
|
:close-on-click-modal="!parameter.progressBar"
|
||||||
|
:show-close="!disable"
|
||||||
|
draggable
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
ref="uploadRef"
|
||||||
|
action="#"
|
||||||
|
class="upload"
|
||||||
|
:limit="1"
|
||||||
|
:http-request="uploadZip"
|
||||||
|
accept=".zip"
|
||||||
|
:auto-upload="!parameter.confirmMessage"
|
||||||
|
:on-change="handleChange"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:disabled="fileDisabled"
|
||||||
|
>
|
||||||
|
<slot name="empty">
|
||||||
|
<el-button type="primary" :disabled="fileDisabled" icon="Upload">点击上传</el-button>
|
||||||
|
</slot>
|
||||||
|
<template #tip>
|
||||||
|
<slot name="tip">
|
||||||
|
<div class="el-upload__tip">请上传 .zip 标准格式文件</div>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
</el-upload>
|
||||||
|
|
||||||
|
<el-text v-if="parameter.progressBar && progressData.status === 'exception'" size="small" type="danger">
|
||||||
|
{{ progressData.message }}
|
||||||
|
</el-text>
|
||||||
|
<el-text v-if="parameter.progressBar && progressData.status === 'success'" size="small" type="success">
|
||||||
|
{{ progressData.message }}
|
||||||
|
</el-text>
|
||||||
|
<el-text v-if="parameter.progressBar && progressData.status === ''" size="small" type="info">
|
||||||
|
{{ progressData.message }}
|
||||||
|
</el-text>
|
||||||
|
<el-progress
|
||||||
|
style="margin-top: 10px; margin-bottom: 10px"
|
||||||
|
v-if="parameter.progressBar"
|
||||||
|
:status="progressData.status"
|
||||||
|
:percentage="progressData.percentage"
|
||||||
|
:stroke-width="10"
|
||||||
|
striped
|
||||||
|
striped-flow
|
||||||
|
></el-progress>
|
||||||
|
|
||||||
|
<template #footer v-if="parameter.confirmMessage">
|
||||||
|
<el-button :disabled="disable" type="primary" @click="uploadSubmit">开始导入</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="ImportZip">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import type { UploadInstance, UploadProps, UploadRequestOptions } from 'element-plus'
|
||||||
|
import http from '@/api'
|
||||||
|
|
||||||
|
export interface ZipParameterProps {
|
||||||
|
title: string // 标题
|
||||||
|
patternId?: string // 模式ID
|
||||||
|
planId?: string // 计划ID
|
||||||
|
importApi?: (params: any) => Promise<any> // 批量导入的Api
|
||||||
|
confirmMessage?: string // 提示信息
|
||||||
|
progressBar?: boolean // 进度条
|
||||||
|
}
|
||||||
|
// dialog状态
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const disable = ref(true)
|
||||||
|
const fileDisabled = ref(false)
|
||||||
|
const uploadRef = ref<UploadInstance>()
|
||||||
|
|
||||||
|
// 父组件传过来的参数
|
||||||
|
const parameter = ref<ZipParameterProps>({
|
||||||
|
title: ''
|
||||||
|
})
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'result', data: boolean): void
|
||||||
|
}>()
|
||||||
|
// 接收父组件参数
|
||||||
|
const acceptParams = (params: ZipParameterProps) => {
|
||||||
|
parameter.value = { ...parameter.value, ...params }
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 文件上传
|
||||||
|
const uploadZip = (param: UploadRequestOptions) => {
|
||||||
|
let zipFormData = new FormData()
|
||||||
|
zipFormData.append('file', param.file)
|
||||||
|
if (parameter.value.patternId) {
|
||||||
|
zipFormData.append('patternId', parameter.value.patternId)
|
||||||
|
}
|
||||||
|
if (parameter.value.planId) {
|
||||||
|
zipFormData.append('planId', parameter.value.planId)
|
||||||
|
}
|
||||||
|
if (parameter.value.progressBar) {
|
||||||
|
initSSE()
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
parameter.value.importApi!(zipFormData)
|
||||||
|
.then(res => handleImportResponse(res))
|
||||||
|
.catch(err => {
|
||||||
|
fileDisabled.value = false
|
||||||
|
disable.value = false
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleImportResponse = (res: any) => {
|
||||||
|
if (!parameter.value.progressBar) {
|
||||||
|
if (res.code === 'A0000') {
|
||||||
|
ElMessage.success('导入成功')
|
||||||
|
emit('result', true)
|
||||||
|
dialogVisible.value = false
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.message)
|
||||||
|
fileDisabled.value = false
|
||||||
|
disable.value = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (res.code !== 'A0000') {
|
||||||
|
ElMessage.error(res.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploadSubmit = () => {
|
||||||
|
if (!uploadRef.value) {
|
||||||
|
return ElMessage.warning('请选择文件!')
|
||||||
|
}
|
||||||
|
progressData.value = {
|
||||||
|
percentage: 0,
|
||||||
|
status: '',
|
||||||
|
message: ''
|
||||||
|
}
|
||||||
|
ElMessageBox.confirm(parameter.value.confirmMessage, '温馨提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
disable.value = true
|
||||||
|
fileDisabled.value = true
|
||||||
|
uploadRef.value?.submit()
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
disable.value = false
|
||||||
|
fileDisabled.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
|
||||||
|
disable.value = uploadFiles.length === 0
|
||||||
|
progressData.value = {
|
||||||
|
percentage: 0,
|
||||||
|
status: '',
|
||||||
|
message: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||||
|
disable.value = uploadFiles.length === 0
|
||||||
|
progressData.value = {
|
||||||
|
percentage: 0,
|
||||||
|
status: '',
|
||||||
|
message: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const progressData = ref({
|
||||||
|
percentage: 0,
|
||||||
|
status: '',
|
||||||
|
message: ''
|
||||||
|
})
|
||||||
|
const eventSource = ref<EventSource | null>(null)
|
||||||
|
|
||||||
|
const initSSE = () => {
|
||||||
|
eventSource.value = http.sse('/sse/createSse')
|
||||||
|
|
||||||
|
eventSource.value.onmessage = event => {
|
||||||
|
console.log('收到消息内容是:', event.data)
|
||||||
|
const res = JSON.parse(event.data)
|
||||||
|
progressData.value.percentage = res.data
|
||||||
|
progressData.value.message = res.message
|
||||||
|
if (res.code === 'A0002') {
|
||||||
|
fileDisabled.value = false
|
||||||
|
disable.value = false
|
||||||
|
progressData.value.status = 'exception'
|
||||||
|
ElMessage.error(res.message)
|
||||||
|
}
|
||||||
|
if (progressData.value.percentage === 100) {
|
||||||
|
progressData.value.status = 'success'
|
||||||
|
eventSource.value!.close()
|
||||||
|
ElMessage.success('导入成功')
|
||||||
|
emit('result', true)
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eventSource.value.onerror = error => {
|
||||||
|
console.warn('SSE 连接出错:', error)
|
||||||
|
eventSource.value!.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 添加一个手动关闭EventSource的函数
|
||||||
|
const closeEventSource = () => {
|
||||||
|
if (eventSource.value) {
|
||||||
|
eventSource.value.close()
|
||||||
|
eventSource.value = null
|
||||||
|
console.log('SSE连接已关闭')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 监听 dialogVisible 的变化,确保在对话框关闭时清理资源
|
||||||
|
watch(dialogVisible, newVal => {
|
||||||
|
if (!newVal) {
|
||||||
|
// 延迟执行,确保在组件完全关闭后清理
|
||||||
|
setTimeout(() => {
|
||||||
|
closeEventSource()
|
||||||
|
fileDisabled.value = false
|
||||||
|
disable.value = false
|
||||||
|
progressData.value = {
|
||||||
|
percentage: 0,
|
||||||
|
status: '',
|
||||||
|
message: ''
|
||||||
|
}
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onUnmounted(() => {
|
||||||
|
closeEventSource()
|
||||||
|
})
|
||||||
|
defineExpose({
|
||||||
|
acceptParams
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@use './index.scss';
|
||||||
|
</style>
|
||||||
@@ -9,5 +9,5 @@
|
|||||||
<script setup lang="ts" name="Loading"></script>
|
<script setup lang="ts" name="Loading"></script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use "./index.scss";;
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@
|
|||||||
:search-param='searchParam'
|
:search-param='searchParam'
|
||||||
:search-col='searchCol'
|
:search-col='searchCol'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 表格主体 -->
|
<!-- 表格主体 -->
|
||||||
<div class='card table-main'>
|
<div class='table-main' :class='{ card: showCard }' >
|
||||||
<!-- 表格头部 操作按钮 -->
|
<!-- 表格头部 操作按钮 -->
|
||||||
<div class='table-header'>
|
<div class='table-header'>
|
||||||
<div class='header-button-lf'>
|
<div class='header-button-lf'>
|
||||||
@@ -43,10 +42,11 @@
|
|||||||
>
|
>
|
||||||
<!-- 默认插槽 -->
|
<!-- 默认插槽 -->
|
||||||
<slot />
|
<slot />
|
||||||
|
|
||||||
<template v-for='item in tableColumns' :key='item'>
|
<template v-for='item in tableColumns' :key='item'>
|
||||||
<!-- selection || radio || index || expand || sort -->
|
<!-- selection || radio || index || expand || sort -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-if='item.type && columnTypes.includes(item.type)'
|
v-if='item.type && columnTypes.includes(item.type) && item.isShow'
|
||||||
v-bind='item'
|
v-bind='item'
|
||||||
:align="item.align ?? 'center'"
|
:align="item.align ?? 'center'"
|
||||||
:reserve-selection="item.type == 'selection'"
|
:reserve-selection="item.type == 'selection'"
|
||||||
@@ -119,6 +119,7 @@ import TableColumn from './components/TableColumn.vue'
|
|||||||
import Sortable from 'sortablejs'
|
import Sortable from 'sortablejs'
|
||||||
|
|
||||||
export interface ProTableProps {
|
export interface ProTableProps {
|
||||||
|
|
||||||
columns: ColumnProps[]; // 列配置项 ==> 必传
|
columns: ColumnProps[]; // 列配置项 ==> 必传
|
||||||
data?: any[]; // 静态 table data 数据,若存在则不会使用 requestApi 返回的 data ==> 非必传
|
data?: any[]; // 静态 table data 数据,若存在则不会使用 requestApi 返回的 data ==> 非必传
|
||||||
requestApi?: (params: any) => Promise<any>; // 请求表格数据的 api ==> 非必传
|
requestApi?: (params: any) => Promise<any>; // 请求表格数据的 api ==> 非必传
|
||||||
@@ -126,6 +127,7 @@ export interface ProTableProps {
|
|||||||
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
|
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
|
||||||
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
|
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
|
||||||
title?: string; // 表格标题 ==> 非必传
|
title?: string; // 表格标题 ==> 非必传
|
||||||
|
showCard?: boolean; // 下个是否需要卡片
|
||||||
pagination?: boolean; // 是否需要分页组件 ==> 非必传(默认为true)
|
pagination?: boolean; // 是否需要分页组件 ==> 非必传(默认为true)
|
||||||
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{})
|
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{})
|
||||||
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为true)
|
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为true)
|
||||||
@@ -141,6 +143,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
|||||||
pagination: true,
|
pagination: true,
|
||||||
initParam: {},
|
initParam: {},
|
||||||
border: true,
|
border: true,
|
||||||
|
showCard: true,
|
||||||
toolButton: true,
|
toolButton: true,
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||||
|
|||||||
@@ -1,49 +1,49 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='icon-box'>
|
<div class="icon-box">
|
||||||
<el-input
|
<el-input
|
||||||
ref='inputRef'
|
ref="inputRef"
|
||||||
v-model='valueIcon'
|
v-model="valueIcon"
|
||||||
v-bind='$attrs'
|
v-bind="$attrs"
|
||||||
:placeholder='placeholder'
|
:placeholder="placeholder"
|
||||||
:clearable='clearable'
|
:clearable="clearable"
|
||||||
@clear='clearIcon'
|
@clear="clearIcon"
|
||||||
@click='openDialog'
|
@click="openDialog"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-button :icon='customIcons[iconValue]' />
|
<el-button :icon="customIcons[iconValue]" />
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-dialog v-model='dialogVisible' :title='placeholder' top='50px' width='66%'>
|
<el-dialog v-model="dialogVisible" :title="placeholder" top="5%" width="30%">
|
||||||
<el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' />
|
<el-input v-model="inputValue" placeholder="搜索图标" size="large" :prefix-icon="Icons.Search" />
|
||||||
<el-scrollbar v-if='Object.keys(iconsList).length'>
|
<el-scrollbar v-if="Object.keys(iconsList).length">
|
||||||
<div class='icon-list'>
|
<div class="icon-list">
|
||||||
<div v-for='item in iconsList' :key='item' class='icon-item' @click='selectIcon(item)'>
|
<div v-for="item in iconsList" :key="item" class="icon-item" @click="selectIcon(item)">
|
||||||
<component :is='item'></component>
|
<component :is="item"></component>
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<el-empty v-else description='未搜索到您要找的图标~' />
|
<el-empty v-else description="未搜索到您要找的图标~" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang='ts' setup name='SelectIcon'>
|
<script lang="ts" setup name="SelectIcon">
|
||||||
import * as Icons from '@element-plus/icons-vue'
|
import * as Icons from '@element-plus/icons-vue'
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue'
|
||||||
|
|
||||||
interface SelectIconProps {
|
interface SelectIconProps {
|
||||||
iconValue: string| undefined;
|
iconValue: string | undefined
|
||||||
title?: string;
|
title?: string
|
||||||
clearable?: boolean;
|
clearable?: boolean
|
||||||
placeholder?: string;
|
placeholder?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<SelectIconProps>(), {
|
const props = withDefaults(defineProps<SelectIconProps>(), {
|
||||||
iconValue: '',
|
iconValue: '',
|
||||||
title: '请选择图标',
|
title: '请选择图标',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
placeholder: '请选择图标',
|
placeholder: '请选择图标'
|
||||||
})
|
})
|
||||||
|
|
||||||
// 重新接收一下,防止打包后 clearable 报错
|
// 重新接收一下,防止打包后 clearable 报错
|
||||||
@@ -55,7 +55,7 @@ const openDialog = () => (dialogVisible.value = true)
|
|||||||
|
|
||||||
// 选择图标(触发更新父组件数据)
|
// 选择图标(触发更新父组件数据)
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
'update:iconValue': [value: string];
|
'update:iconValue': [value: string]
|
||||||
}>()
|
}>()
|
||||||
const selectIcon = (item: any) => {
|
const selectIcon = (item: any) => {
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
@@ -83,9 +83,8 @@ const iconsList = computed((): { [key: string]: any } => {
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,97 +1,84 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='time-control'>
|
<div class="time-control">
|
||||||
<el-select
|
<el-select class="select" v-model="timeUnit" placeholder="选择时间单位" @change="handleChange">
|
||||||
class='select'
|
|
||||||
v-model='timeUnit'
|
|
||||||
placeholder='选择时间单位'
|
|
||||||
@change='handleChange'
|
|
||||||
>
|
|
||||||
<!-- 采用 v-for 动态渲染 -->
|
<!-- 采用 v-for 动态渲染 -->
|
||||||
<el-option
|
<el-option v-for="unit in timeUnits" :key="unit.value" :label="unit.label" :value="unit.value"></el-option>
|
||||||
v-for='unit in timeUnits'
|
|
||||||
:key='unit.value'
|
|
||||||
:label='unit.label'
|
|
||||||
:value='unit.value'
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<!-- 禁用时间选择器 -->
|
<!-- 禁用时间选择器 -->
|
||||||
<div class='date-display'>
|
<div class="date-display">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
class='date-picker'
|
class="date-picker"
|
||||||
v-model='startDate'
|
v-model="startDate"
|
||||||
type='date'
|
type="date"
|
||||||
placeholder='起始时间'
|
placeholder="起始时间"
|
||||||
@change='emitDateChange'
|
@change="emitDateChange"
|
||||||
:disabled-date='disableStartDate'
|
:disabled-date="disableStartDate"
|
||||||
:readonly="timeUnit != '自定义'"
|
:readonly="timeUnit != '自定义'"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
<el-text>~</el-text>
|
<el-text>~</el-text>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
class='date-picker'
|
class="date-picker"
|
||||||
v-model='endDate'
|
v-model="endDate"
|
||||||
type='date'
|
type="date"
|
||||||
placeholder='结束时间'
|
placeholder="结束时间"
|
||||||
@change='emitDateChange'
|
@change="emitDateChange"
|
||||||
:disabled-date='disableEndDate'
|
:disabled-date="disableEndDate"
|
||||||
:readonly="timeUnit !== '自定义'"
|
:readonly="timeUnit !== '自定义'"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
<div class='date-display' v-if="timeUnit !== '自定义'">
|
<div class="date-display" v-if="timeUnit !== '自定义'">
|
||||||
<el-button
|
<el-button
|
||||||
style='width: 10px;'
|
style="width: 10px"
|
||||||
class='triangle-button'
|
class="triangle-button"
|
||||||
type='primary'
|
type="primary"
|
||||||
@click='prevPeriod'
|
@click="prevPeriod"
|
||||||
@change='emitDateChange'
|
@change="emitDateChange"
|
||||||
>
|
>
|
||||||
<div class='left_triangle'></div>
|
<div class="left_triangle"></div>
|
||||||
</el-button>
|
|
||||||
<el-button class='triangle-button' type='primary' @click='goToCurrent'>
|
|
||||||
当前
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button class="triangle-button" type="primary" @click="goToCurrent">当前</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
style='width: 10px;'
|
style="width: 10px"
|
||||||
class='triangle-button'
|
class="triangle-button"
|
||||||
type='primary'
|
type="primary"
|
||||||
@click='nextPeriod'
|
@click="nextPeriod"
|
||||||
:disabled='isNextDisabled'
|
:disabled="isNextDisabled"
|
||||||
>
|
>
|
||||||
<div class='right_triangle'></div>
|
<div class="right_triangle"></div>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
<script setup lang='ts'>
|
import { onMounted, ref } from 'vue'
|
||||||
import { ref, onMounted, defineProps, defineEmits } from 'vue'
|
|
||||||
|
|
||||||
// 定义时间单位的类型
|
// 定义时间单位的类型
|
||||||
interface TimeUnit {
|
interface TimeUnit {
|
||||||
label: string;
|
label: string
|
||||||
value: string;
|
value: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 定义组件的props,包含包括和排除的时间单位
|
// 定义组件的props,包含包括和排除的时间单位
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
include: {
|
include: {
|
||||||
type: Array as () => string[],
|
type: Array as () => string[],
|
||||||
default: () => ['日', '周', '月', '季度', '年', '自定义'],
|
default: () => ['日', '周', '月', '季度', '年', '自定义']
|
||||||
},
|
},
|
||||||
exclude: {
|
exclude: {
|
||||||
type: Array as () => string[],
|
type: Array as () => string[],
|
||||||
default: () => [],
|
default: () => []
|
||||||
},
|
},
|
||||||
default: {
|
default: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '月',
|
default: '月'
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update-dates', startDate: string, endDate: string): void;
|
(e: 'update-dates', startDate: string, endDate: string): void
|
||||||
}>()
|
}>()
|
||||||
const timeUnit = ref<string>(props.default) // 默认选择
|
const timeUnit = ref<string>(props.default) // 默认选择
|
||||||
const startDate = ref<Date>(new Date()) // 起始日期
|
const startDate = ref<Date>(new Date()) // 起始日期
|
||||||
@@ -100,16 +87,17 @@ const isNextDisabled = ref<boolean>(false) // 控制下一周期按钮的禁用
|
|||||||
const today = ref<Date>(new Date()) // 当前日期
|
const today = ref<Date>(new Date()) // 当前日期
|
||||||
// 过滤出可用的时间单位
|
// 过滤出可用的时间单位
|
||||||
const timeUnits = ref<TimeUnit[]>(
|
const timeUnits = ref<TimeUnit[]>(
|
||||||
props.include.filter(unit => !props.exclude.includes(unit)).map(unit => ({
|
props.include
|
||||||
|
.filter(unit => !props.exclude.includes(unit))
|
||||||
|
.map(unit => ({
|
||||||
label: unit,
|
label: unit,
|
||||||
value: unit,
|
value: unit
|
||||||
})),
|
}))
|
||||||
)
|
)
|
||||||
|
|
||||||
// 发出日期变化事件
|
// 发出日期变化事件
|
||||||
const emitDateChange = () => {
|
const emitDateChange = () => {
|
||||||
emit('update-dates', formatDate(startDate.value), formatDate(endDate.value))
|
emit('update-dates', formatDate(startDate.value), formatDate(endDate.value))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 在组件挂载时更新日期范围
|
// 在组件挂载时更新日期范围
|
||||||
@@ -126,11 +114,19 @@ const handleChange = (unit: string) => {
|
|||||||
endDate.value = new Date()
|
endDate.value = new Date()
|
||||||
}
|
}
|
||||||
timeUnit.value = unit
|
timeUnit.value = unit
|
||||||
|
|
||||||
|
// 确保开始时间和结束时间不为空
|
||||||
|
if (!startDate.value) {
|
||||||
|
startDate.value = new Date()
|
||||||
|
}
|
||||||
|
if (!endDate.value) {
|
||||||
|
endDate.value = new Date()
|
||||||
|
}
|
||||||
|
|
||||||
emitDateChange() // 变化时也发出更新事件
|
emitDateChange() // 变化时也发出更新事件
|
||||||
updateNextButtonStatus()
|
updateNextButtonStatus()
|
||||||
}
|
}
|
||||||
const updateDateRange = () => {
|
const updateDateRange = () => {
|
||||||
|
|
||||||
// 根据选择的时间单位计算起始和结束日期
|
// 根据选择的时间单位计算起始和结束日期
|
||||||
if (timeUnit.value === '日') {
|
if (timeUnit.value === '日') {
|
||||||
startDate.value = today.value
|
startDate.value = today.value
|
||||||
@@ -138,32 +134,29 @@ const updateDateRange = () => {
|
|||||||
} else if (timeUnit.value === '周') {
|
} else if (timeUnit.value === '周') {
|
||||||
startDate.value = getStartOfWeek(today.value)
|
startDate.value = getStartOfWeek(today.value)
|
||||||
endDate.value = getEndOfWeek(today.value)
|
endDate.value = getEndOfWeek(today.value)
|
||||||
|
|
||||||
} else if (timeUnit.value === '月') {
|
} else if (timeUnit.value === '月') {
|
||||||
// 获取本月的开始和结束日期
|
// 获取本月的开始和结束日期
|
||||||
startDate.value = new Date(today.value.getFullYear(), today.value.getMonth(), 1);
|
startDate.value = new Date(today.value.getFullYear(), today.value.getMonth(), 1)
|
||||||
endDate.value = new Date(today.value.getFullYear(), today.value.getMonth() + 1, 0);
|
endDate.value = new Date(today.value.getFullYear(), today.value.getMonth() + 1, 0)
|
||||||
|
|
||||||
// // 确保结束日期不超过今天
|
// // 确保结束日期不超过今天
|
||||||
// if (endDate.value > today.value) {
|
// if (endDate.value > today.value) {
|
||||||
// endDate.value = new Date(today.value);
|
// endDate.value = new Date(today.value);
|
||||||
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} else if (timeUnit.value === '季度') {
|
} else if (timeUnit.value === '季度') {
|
||||||
const quarter = Math.floor(today.value.getMonth() / 3);
|
const quarter = Math.floor(today.value.getMonth() / 3)
|
||||||
startDate.value = new Date(today.value.getFullYear(), quarter * 3, 1);
|
startDate.value = new Date(today.value.getFullYear(), quarter * 3, 1)
|
||||||
endDate.value = new Date(today.value.getFullYear(), quarter * 3 + 3, 0);
|
endDate.value = new Date(today.value.getFullYear(), quarter * 3 + 3, 0)
|
||||||
|
|
||||||
// // 确保结束日期不超过今天
|
// // 确保结束日期不超过今天
|
||||||
// if (endDate.value > today.value) {
|
// if (endDate.value > today.value) {
|
||||||
// endDate.value = new Date(today.value);
|
// endDate.value = new Date(today.value);
|
||||||
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} else if (timeUnit.value === '年') {
|
} else if (timeUnit.value === '年') {
|
||||||
startDate.value = new Date(today.value.getFullYear(), 0, 1);
|
startDate.value = new Date(today.value.getFullYear(), 0, 1)
|
||||||
endDate.value = new Date(today.value.getFullYear(), 11, 31);
|
endDate.value = new Date(today.value.getFullYear(), 11, 31)
|
||||||
|
|
||||||
// // 确保结束日期不超过今天
|
// // 确保结束日期不超过今天
|
||||||
// if (endDate.value > today.value) {
|
// if (endDate.value > today.value) {
|
||||||
@@ -172,7 +165,13 @@ const updateDateRange = () => {
|
|||||||
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
// 确保开始时间和结束时间不为空
|
||||||
|
if (!startDate.value) {
|
||||||
|
startDate.value = new Date()
|
||||||
|
}
|
||||||
|
if (!endDate.value) {
|
||||||
|
endDate.value = new Date()
|
||||||
|
}
|
||||||
|
|
||||||
updateNextButtonStatus()
|
updateNextButtonStatus()
|
||||||
}
|
}
|
||||||
@@ -190,8 +189,8 @@ const getEndOfWeek = (date: Date) => {
|
|||||||
endOfWeek.setDate(endOfWeek.getDate() + diff)
|
endOfWeek.setDate(endOfWeek.getDate() + diff)
|
||||||
|
|
||||||
// 获取今天的日期
|
// 获取今天的日期
|
||||||
const today = new Date();
|
const today = new Date()
|
||||||
today.setHours(23, 59, 59, 999); // 设置今天的结束时间(23:59:59.999)
|
today.setHours(23, 59, 59, 999) // 设置今天的结束时间(23:59:59.999)
|
||||||
|
|
||||||
// 返回不超过今天的结束时间
|
// 返回不超过今天的结束时间
|
||||||
//return endOfWeek > today ? today : endOfWeek;
|
//return endOfWeek > today ? today : endOfWeek;
|
||||||
@@ -208,13 +207,8 @@ const prevPeriod = () => {
|
|||||||
prevStartDate.setDate(prevStartDate.getDate() - 7)
|
prevStartDate.setDate(prevStartDate.getDate() - 7)
|
||||||
prevEndDate.setDate(prevEndDate.getDate() - 7)
|
prevEndDate.setDate(prevEndDate.getDate() - 7)
|
||||||
} else if (timeUnit.value === '月') {
|
} else if (timeUnit.value === '月') {
|
||||||
|
|
||||||
|
|
||||||
prevStartDate.setMonth(prevStartDate.getMonth() - 1)
|
prevStartDate.setMonth(prevStartDate.getMonth() - 1)
|
||||||
prevEndDate.setMonth(prevEndDate.getMonth() - 1)
|
prevEndDate.setMonth(prevEndDate.getMonth() - 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if (timeUnit.value === '季度') {
|
} else if (timeUnit.value === '季度') {
|
||||||
prevStartDate.setMonth(prevStartDate.getMonth() - 3)
|
prevStartDate.setMonth(prevStartDate.getMonth() - 3)
|
||||||
prevEndDate.setMonth(prevEndDate.getMonth() - 3)
|
prevEndDate.setMonth(prevEndDate.getMonth() - 3)
|
||||||
@@ -258,7 +252,6 @@ const nextPeriod = () => {
|
|||||||
updateNextButtonStatus()
|
updateNextButtonStatus()
|
||||||
}
|
}
|
||||||
const updateNextButtonStatus = () => {
|
const updateNextButtonStatus = () => {
|
||||||
|
|
||||||
// 更新下一个按钮的禁用状态
|
// 更新下一个按钮的禁用状态
|
||||||
const maxDate = new Date() // 假设最新日期为今天
|
const maxDate = new Date() // 假设最新日期为今天
|
||||||
// 将 maxDate 设置为当天的开始时间
|
// 将 maxDate 设置为当天的开始时间
|
||||||
@@ -271,7 +264,6 @@ const updateNextButtonStatus = () => {
|
|||||||
emitDateChange() // 变化时也发出更新事件
|
emitDateChange() // 变化时也发出更新事件
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 限制开始日期不能选择超过当前日期
|
// 限制开始日期不能选择超过当前日期
|
||||||
const disableStartDate = (date: Date) => {
|
const disableStartDate = (date: Date) => {
|
||||||
return date > today.value
|
return date > today.value
|
||||||
@@ -283,18 +275,18 @@ const disableEndDate = (date: Date) => {
|
|||||||
return date > today.value || (start && date <= start)
|
return date > today.value || (start && date <= start)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 格式化日期yyyy-mm-dd
|
// 格式化日期yyyy-mm-dd
|
||||||
function formatDate(date:Date) {
|
function formatDate(date: Date | null): string {
|
||||||
const year = date.getFullYear();
|
if (!date) {
|
||||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
return ''
|
||||||
const day = String(date.getDate()).padStart(2, '0');
|
}
|
||||||
return `${year}-${month}-${day}`;
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
282
frontend/src/components/echarts/line/index.vue
Normal file
282
frontend/src/components/echarts/line/index.vue
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
<template>
|
||||||
|
<div class="chart">
|
||||||
|
<div ref="chartRef" class="my-chart" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||||
|
// import echarts from './echarts'
|
||||||
|
import * as echarts from 'echarts' // 全引入
|
||||||
|
// import 'echarts/lib/component/dataZoom'
|
||||||
|
|
||||||
|
const color = [
|
||||||
|
'var(--el-color-primary)',
|
||||||
|
'#07CCCA',
|
||||||
|
'#00BFF5',
|
||||||
|
'#FFBF00',
|
||||||
|
'#77DA63',
|
||||||
|
'#D5FF6B',
|
||||||
|
'#Ff6600',
|
||||||
|
'#FF9100',
|
||||||
|
'#5B6E96',
|
||||||
|
'#66FFCC',
|
||||||
|
'#B3B3B3'
|
||||||
|
]
|
||||||
|
|
||||||
|
const chartRef = ref<HTMLDivElement>()
|
||||||
|
|
||||||
|
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
||||||
|
let chart: echarts.ECharts | any = null
|
||||||
|
const resizeHandler = () => {
|
||||||
|
// 不在视野中的时候不进行resize
|
||||||
|
if (!chartRef.value) return
|
||||||
|
if (chartRef.value.offsetHeight == 0) return
|
||||||
|
chart.getZr().painter.getViewportRoot().style.display = 'none'
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
chart.resize()
|
||||||
|
chart.getZr().painter.getViewportRoot().style.display = ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const initChart = () => {
|
||||||
|
if (!props.isInterVal && !props.pieInterVal) {
|
||||||
|
chart?.dispose()
|
||||||
|
}
|
||||||
|
// chart?.dispose()
|
||||||
|
chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||||
|
const options = {
|
||||||
|
title: {
|
||||||
|
left: 'center',
|
||||||
|
// textStyle: {
|
||||||
|
color: '#000',
|
||||||
|
fontSize: 18,
|
||||||
|
// },
|
||||||
|
...(props.options?.title || null)
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis',
|
||||||
|
axisPointer: {
|
||||||
|
type: 'shadow',
|
||||||
|
label: {
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 16
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textStyle: {
|
||||||
|
color: '#fff',
|
||||||
|
fontStyle: 'normal',
|
||||||
|
opacity: 0.35,
|
||||||
|
fontSize: 14
|
||||||
|
},
|
||||||
|
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||||
|
borderWidth: 0,
|
||||||
|
confine: true,
|
||||||
|
...(props.options?.tooltip || null)
|
||||||
|
},
|
||||||
|
|
||||||
|
legend: {
|
||||||
|
right: 20,
|
||||||
|
top: 0,
|
||||||
|
itemGap: 10,
|
||||||
|
itemStyle: {},
|
||||||
|
// textStyle: {
|
||||||
|
fontSize: 12,
|
||||||
|
padding: [2, 0, 0, 0], //[上、右、下、左]
|
||||||
|
// },
|
||||||
|
itemWidth: 15,
|
||||||
|
itemHeight: 10,
|
||||||
|
...(props.options?.legend || null)
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
top: '60px',
|
||||||
|
left: '30px',
|
||||||
|
right: '70px',
|
||||||
|
bottom: props.options?.options?.dataZoom === null ? '10px' : '40px',
|
||||||
|
containLabel: true,
|
||||||
|
...(props.options?.grid || null)
|
||||||
|
},
|
||||||
|
xAxis: props.options?.xAxis ? handlerXAxis() : null,
|
||||||
|
yAxis: props.options?.yAxis ? handlerYAxis() : null,
|
||||||
|
dataZoom: props.options?.dataZoom || [
|
||||||
|
{
|
||||||
|
type: 'inside',
|
||||||
|
height: 13,
|
||||||
|
start: 0,
|
||||||
|
bottom: '20px',
|
||||||
|
end: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
start: 0,
|
||||||
|
height: 13,
|
||||||
|
bottom: '20px',
|
||||||
|
end: 100
|
||||||
|
}
|
||||||
|
],
|
||||||
|
color: props.options?.color || color,
|
||||||
|
series: props.options?.series,
|
||||||
|
...props.options?.options
|
||||||
|
}
|
||||||
|
// console.log(options.series,"获取x轴");
|
||||||
|
handlerBar(options)
|
||||||
|
|
||||||
|
// 处理柱状图
|
||||||
|
chart.setOption(options, true)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
chart.resize()
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
const handlerBar = (options: any) => {
|
||||||
|
if (Array.isArray(options.series)) {
|
||||||
|
options.series.forEach((item: any) => {
|
||||||
|
if (item.type === 'bar') {
|
||||||
|
item.barMinHeight = 10
|
||||||
|
item.barMaxWidth = 20
|
||||||
|
item.itemStyle = Object.assign(
|
||||||
|
{
|
||||||
|
color: (params: any) => {
|
||||||
|
if (params.value == 0 || params.value == 3.14159) {
|
||||||
|
return '#ccc'
|
||||||
|
} else {
|
||||||
|
return props.options?.color
|
||||||
|
? props.options?.color[params.seriesIndex]
|
||||||
|
: color[params.seriesIndex]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item.itemStyle
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handlerYAxis = () => {
|
||||||
|
let temp = {
|
||||||
|
type: 'value',
|
||||||
|
nameGap: 15,
|
||||||
|
nameTextStyle: {
|
||||||
|
color: '#000'
|
||||||
|
},
|
||||||
|
splitNumber: 5,
|
||||||
|
minInterval: 1,
|
||||||
|
axisLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: '#000'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: '#000',
|
||||||
|
fontSize: 14,
|
||||||
|
formatter: function (value) {
|
||||||
|
return value.toFixed(0) // 格式化显示为一位小数
|
||||||
|
}
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
// 使用深浅的间隔色
|
||||||
|
color: ['#ccc'],
|
||||||
|
type: 'dashed',
|
||||||
|
opacity: 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// props.options?.xAxis 是数组还是对象
|
||||||
|
if (Array.isArray(props.options?.yAxis)) {
|
||||||
|
return props.options?.yAxis.map((item: any) => {
|
||||||
|
return {
|
||||||
|
...temp,
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
...temp,
|
||||||
|
...props.options?.yAxis
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const handlerXAxis = () => {
|
||||||
|
let temp = {
|
||||||
|
type: 'category',
|
||||||
|
axisTick: { show: false },
|
||||||
|
nameTextStyle: {
|
||||||
|
color: '#000'
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
// lineStyle: {
|
||||||
|
color: '#000'
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
// textStyle: {
|
||||||
|
fontFamily: 'dinproRegular',
|
||||||
|
color: '#000',
|
||||||
|
fontSize: '12'
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
// boundaryGap: false,
|
||||||
|
}
|
||||||
|
// props.options?.xAxis 是数组还是对象
|
||||||
|
if (Array.isArray(props.options?.xAxis)) {
|
||||||
|
return props.options?.xAxis.map((item: any) => {
|
||||||
|
return {
|
||||||
|
...temp,
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
...temp,
|
||||||
|
...props.options?.xAxis
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let throttle: ReturnType<typeof setTimeout>
|
||||||
|
// 动态计算table高度
|
||||||
|
const resizeObserver = new ResizeObserver(entries => {
|
||||||
|
for (const entry of entries) {
|
||||||
|
if (throttle) {
|
||||||
|
clearTimeout(throttle)
|
||||||
|
}
|
||||||
|
throttle = setTimeout(() => {
|
||||||
|
resizeHandler()
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
onMounted(() => {
|
||||||
|
initChart()
|
||||||
|
resizeObserver.observe(chartRef.value!)
|
||||||
|
})
|
||||||
|
defineExpose({ initChart })
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
resizeObserver.unobserve(chartRef.value!)
|
||||||
|
chart?.dispose()
|
||||||
|
})
|
||||||
|
watch(
|
||||||
|
() => props.options,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
initChart()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.chart {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
position: absolute;
|
||||||
|
right: 0px;
|
||||||
|
top: -60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-chart {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
|
import { ref } from "vue";
|
||||||
const chartsRef = ref();
|
const chartsRef = ref();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
//饼图数据
|
//饼图数据
|
||||||
@@ -21,11 +22,16 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
const customData: any = ref({}),
|
const customData: any = ref({}),
|
||||||
legendData: any = ref({}),
|
legendData: any = ref({}),
|
||||||
chart: any = ref();
|
chart: any = ref();
|
||||||
|
|
||||||
|
const labelIsShow = ref(true)//引导线台数和鼠标点击饼图是否弹出提示显示
|
||||||
const init = () => {
|
const init = () => {
|
||||||
|
|
||||||
|
|
||||||
customData.value = {
|
customData.value = {
|
||||||
title: "", //标题
|
title: "", //标题
|
||||||
textAlign: "left", //标题位置可选属性left 可选属性值 left,right,center
|
textAlign: "left", //标题位置可选属性left 可选属性值 left,right,center
|
||||||
@@ -34,13 +40,16 @@ const init = () => {
|
|||||||
isRadius: false, //是否圆角
|
isRadius: false, //是否圆角
|
||||||
isSpace: false, //是否显示间隔
|
isSpace: false, //是否显示间隔
|
||||||
isLabelLine: true, //是否显示引导线
|
isLabelLine: true, //是否显示引导线
|
||||||
|
titleFontSize: '14px', //标题字体大小
|
||||||
|
|
||||||
...props.customData,
|
...props.customData,
|
||||||
|
|
||||||
};
|
};
|
||||||
legendData.value = {
|
legendData.value = {
|
||||||
icon: "roundRect", // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
|
icon: "roundRect", // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
|
||||||
orient: "vertical", //图例排列方向
|
orient: "vertical", //图例排列方向
|
||||||
left: "right", //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
|
left: "right", //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
|
||||||
itemGap: 1, // 设置图例项之间的间隔为20
|
itemGap: 10, // 设置图例项之间的间隔为20
|
||||||
...props.legendData,
|
...props.legendData,
|
||||||
};
|
};
|
||||||
chart.value = chartsRef.value && echarts.init(chartsRef.value);
|
chart.value = chartsRef.value && echarts.init(chartsRef.value);
|
||||||
@@ -48,10 +57,27 @@ const init = () => {
|
|||||||
title: {
|
title: {
|
||||||
text: customData.value.title,
|
text: customData.value.title,
|
||||||
left: customData.value.textAlign,
|
left: customData.value.textAlign,
|
||||||
|
textStyle: {
|
||||||
|
fontSize: customData.value.titleFontSize, // 使用 titleFontSize 属性
|
||||||
|
},
|
||||||
},
|
},
|
||||||
legend:legendData.value,
|
legend:legendData.value,
|
||||||
|
// legend: {
|
||||||
|
// icon: legendData.value.icon, // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
|
||||||
|
// orient: "vertical", //图例排列方向
|
||||||
|
// left: legendData.value.left, //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
|
||||||
|
// itemGap: 1, // 设置图例项之间的间隔为20
|
||||||
|
// formatter: function (name) {
|
||||||
|
|
||||||
|
// const item = props.chartsData.filter(item=>item.name==name)
|
||||||
|
// console.log(item)
|
||||||
|
// if(item)
|
||||||
|
// return item[0].value;
|
||||||
|
|
||||||
|
// },
|
||||||
|
// },
|
||||||
tooltip: {
|
tooltip: {
|
||||||
show: true,
|
show: labelIsShow.value,
|
||||||
trigger: "item",
|
trigger: "item",
|
||||||
formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ",
|
formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ",
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -61,7 +87,13 @@ const init = () => {
|
|||||||
type: "pie",
|
type: "pie",
|
||||||
radius: customData.value.isRing ? ["55", "75"] : "80%",
|
radius: customData.value.isRing ? ["55", "75"] : "80%",
|
||||||
data: props.chartsData,
|
data: props.chartsData,
|
||||||
center: ["55%", "50%"], // 设置饼图的中心位置
|
formatter: function (name: any) {
|
||||||
|
const item = props.chartsData.filter(item=>item.name==name)
|
||||||
|
//console.log(item)
|
||||||
|
if(item)
|
||||||
|
return item[0].value;
|
||||||
|
},
|
||||||
|
center: ["55%", "55%"], // 设置饼图的中心位置
|
||||||
// padAngle: 2,
|
// padAngle: 2,
|
||||||
minAngle: 15, //最小角度
|
minAngle: 15, //最小角度
|
||||||
startAngle: 270, //起始角度
|
startAngle: 270, //起始角度
|
||||||
@@ -74,12 +106,15 @@ const init = () => {
|
|||||||
},
|
},
|
||||||
label: {
|
label: {
|
||||||
normal: {
|
normal: {
|
||||||
show: true,
|
show: labelIsShow.value,
|
||||||
position: "inside",
|
position: "outside",
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: "#fff",
|
//color: "#fff",
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
},
|
},
|
||||||
|
formatter: function (data) {
|
||||||
|
return labelIsShow.value ? data.value + '台' : '';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
@@ -93,6 +128,7 @@ const init = () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
option && chart.value && chart.value.setOption(option);
|
option && chart.value && chart.value.setOption(option);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
chart.value.resize();
|
chart.value.resize();
|
||||||
@@ -108,7 +144,7 @@ const reSize = (widthValue: number,heightValue: number,silentValue: boolean) =>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const resizeCharts = () => {
|
const resizeCharts = () => {
|
||||||
console.log(chart.value,111111);
|
//console.log(chart.value,111111);
|
||||||
|
|
||||||
if (chart.value) {
|
if (chart.value) {
|
||||||
chart.value.resize();
|
chart.value.resize();
|
||||||
@@ -128,6 +164,12 @@ watch(
|
|||||||
() => props.chartsData,
|
() => props.chartsData,
|
||||||
(val, oldVal) => {
|
(val, oldVal) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
const item = props.chartsData.find(item => item.value === 0);
|
||||||
|
if(item != undefined){
|
||||||
|
labelIsShow.value = false;
|
||||||
|
}else{
|
||||||
|
labelIsShow.value = true;
|
||||||
|
}
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
// 首页地址(默认)
|
// 首页地址(默认)
|
||||||
export const HOME_URL: string = "/home/index";
|
export const HOME_URL: string = "/home/index";
|
||||||
|
|
||||||
|
// export const HOME_URL: string = "/machine/controlSource";
|
||||||
|
|
||||||
// 登录页地址(默认)
|
// 登录页地址(默认)
|
||||||
export const LOGIN_URL: string = "/login";
|
export const LOGIN_URL: string = "/login";
|
||||||
|
|
||||||
// 默认主题颜色
|
// 默认主题颜色
|
||||||
export const DEFAULT_PRIMARY: string = "#003078";
|
export const DEFAULT_PRIMARY: string = "#526ADE";
|
||||||
|
|
||||||
// 路由白名单地址(本地存在的路由 staticRouter.ts 中)
|
// 路由白名单地址(本地存在的路由 staticRouter.ts 中)
|
||||||
export const ROUTER_WHITE_LIST: string[] = ["/500"];
|
export const ROUTER_WHITE_LIST: string[] = ["/500"];
|
||||||
@@ -17,3 +19,5 @@ export const AMAP_MAP_KEY: string = "";
|
|||||||
|
|
||||||
// 百度地图 key
|
// 百度地图 key
|
||||||
export const BAIDU_MAP_KEY: string = "";
|
export const BAIDU_MAP_KEY: string = "";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,23 @@ import type { Directive, DirectiveBinding } from 'vue'
|
|||||||
|
|
||||||
const auth: Directive = {
|
const auth: Directive = {
|
||||||
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
||||||
const { value } = binding
|
//console.log('binding',binding)
|
||||||
|
const { value, modifiers } = binding
|
||||||
|
let currentPageRoles = []
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
|
if (modifiers && Object.keys(modifiers).length) {
|
||||||
// console.log('1234',authStore.routeName)
|
currentPageRoles = authStore.authButtonListGet[Object.keys(modifiers)[0]] ?? []
|
||||||
// console.log('123',currentPageRoles)
|
} else {
|
||||||
|
currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? []
|
||||||
|
}
|
||||||
|
console.log('currentPageRoles', currentPageRoles)
|
||||||
if (value instanceof Array && value.length) {
|
if (value instanceof Array && value.length) {
|
||||||
const hasPermission = value.every(item => currentPageRoles.includes(item))
|
const hasPermission = value.every(item => currentPageRoles.includes(item))
|
||||||
if (!hasPermission) el.remove()
|
if (!hasPermission) el.remove()
|
||||||
} else {
|
} else {
|
||||||
if (!currentPageRoles.includes(value)) el.remove()
|
if (!currentPageRoles.includes(value)) el.remove()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default auth
|
export default auth
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
export enum ResultEnum {
|
export enum ResultEnum {
|
||||||
SUCCESS = "A0000",
|
SUCCESS = "A0000",
|
||||||
ERROR = 500,
|
ERROR = 500,
|
||||||
OVERDUE = "401",
|
ACCESSTOKEN_EXPIRED = "A0024",
|
||||||
|
OVERDUE = "A0025",
|
||||||
TIMEOUT = 30000,
|
TIMEOUT = 30000,
|
||||||
TYPE = "success"
|
TYPE = "success"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { ElNotification } from "element-plus";
|
import { ElNotification } from "element-plus";
|
||||||
|
import type { AxiosResponse } from "axios";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 接收数据流生成 blob,创建链接,下载文件
|
* @description 接收数据流生成 blob,创建链接,下载文件
|
||||||
@@ -8,6 +9,55 @@ import { ElNotification } from "element-plus";
|
|||||||
* @param {Boolean} isNotify 是否有导出消息提示 (默认为 true)
|
* @param {Boolean} isNotify 是否有导出消息提示 (默认为 true)
|
||||||
* @param {String} fileType 导出的文件格式 (默认为.xlsx)
|
* @param {String} fileType 导出的文件格式 (默认为.xlsx)
|
||||||
* */
|
* */
|
||||||
|
/**
|
||||||
|
* 从 Content-Disposition 头解析文件名
|
||||||
|
*/
|
||||||
|
const getFileNameFromContentDisposition = (contentDisposition: string | undefined | null): string | null => {
|
||||||
|
if (!contentDisposition) return null;
|
||||||
|
|
||||||
|
// 优先匹配 filename*=UTF-8'' 格式(RFC 5987)
|
||||||
|
const filenameStarRegex = /filename\*\s*=\s*UTF-8''([^;]+)/i;
|
||||||
|
const starMatches = filenameStarRegex.exec(contentDisposition);
|
||||||
|
|
||||||
|
if (starMatches && starMatches[1]) {
|
||||||
|
try {
|
||||||
|
return decodeURIComponent(starMatches[1]);
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('解码 filename* 失败:', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其次匹配 filename="文件名" 或 filename=文件名 格式
|
||||||
|
const filenameRegex = /filename\s*=\s*([^;]+)/i;
|
||||||
|
const matches = filenameRegex.exec(contentDisposition);
|
||||||
|
|
||||||
|
if (matches && matches[1]) {
|
||||||
|
let filename = matches[1].trim();
|
||||||
|
|
||||||
|
// 去除引号
|
||||||
|
filename = filename.replace(/^["']|["']$/g, "");
|
||||||
|
|
||||||
|
// 尝试解码 URL 编码的文件名
|
||||||
|
try {
|
||||||
|
// 检查是否包含 URL 编码字符
|
||||||
|
if (filename.includes('%') || filename.includes('UTF-8')) {
|
||||||
|
// 处理可能的 UTF-8 前缀
|
||||||
|
if (filename.startsWith("UTF-8''") || filename.startsWith("utf-8''")) {
|
||||||
|
filename = filename.substring(7);
|
||||||
|
}
|
||||||
|
filename = decodeURIComponent(filename);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 如果解码失败,返回原始文件名
|
||||||
|
console.warn('解码文件名失败,使用原始值:', e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
export const useDownload = async (
|
export const useDownload = async (
|
||||||
api: (param: any) => Promise<any>,
|
api: (param: any) => Promise<any>,
|
||||||
tempName: string,
|
tempName: string,
|
||||||
@@ -42,3 +92,70 @@ export const useDownload = async (
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 支持服务器文件名的下载方法,会从 Content-Disposition 头获取文件名
|
||||||
|
* @param {Function} api 导出表格的api方法 (必传)
|
||||||
|
* @param {String} fallbackName 备用文件名,当服务器未提供时使用 (可选)
|
||||||
|
* @param {Object} params 导出的参数 (默认{})
|
||||||
|
* @param {Boolean} isNotify 是否有导出消息提示 (默认为 true)
|
||||||
|
* @param {String} fallbackFileType 备用文件格式,当服务器未提供时使用 (默认为.xlsx)
|
||||||
|
*/
|
||||||
|
export const useDownloadWithServerFileName = async (
|
||||||
|
api: (param: any) => Promise<AxiosResponse<Blob> | any>,
|
||||||
|
fallbackName: string = "",
|
||||||
|
params: any = {},
|
||||||
|
isNotify: boolean = true,
|
||||||
|
fallbackFileType: string = ".xlsx"
|
||||||
|
) => {
|
||||||
|
if (isNotify) {
|
||||||
|
ElNotification({
|
||||||
|
title: "温馨提示",
|
||||||
|
message: "如果数据庞大会导致下载缓慢哦,请您耐心等待!",
|
||||||
|
type: "info",
|
||||||
|
duration: 3000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await api(params);
|
||||||
|
|
||||||
|
// 检查响应是否包含 data 属性(AxiosResponse)还是直接是 Blob
|
||||||
|
const blob = res.data ? new Blob([res.data]) : new Blob([res]);
|
||||||
|
|
||||||
|
// 尝试从响应头获取文件名(如果存在)
|
||||||
|
let serverFileName: string | null = null;
|
||||||
|
if (res.headers) {
|
||||||
|
const headers = res.headers || {};
|
||||||
|
const contentDisposition = headers['content-disposition'] || headers['Content-Disposition'];
|
||||||
|
serverFileName = getFileNameFromContentDisposition(contentDisposition);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确定最终使用的文件名
|
||||||
|
let finalFileName: string;
|
||||||
|
if (serverFileName) {
|
||||||
|
finalFileName = serverFileName;
|
||||||
|
} else if (fallbackName) {
|
||||||
|
finalFileName = `${fallbackName}${fallbackFileType}`;
|
||||||
|
} else {
|
||||||
|
finalFileName = `download${fallbackFileType}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 兼容 edge 不支持 createObjectURL 方法
|
||||||
|
if ("msSaveOrOpenBlob" in navigator) {
|
||||||
|
return window.navigator.msSaveOrOpenBlob(blob, finalFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
const blobUrl = window.URL.createObjectURL(blob);
|
||||||
|
const exportFile = document.createElement("a");
|
||||||
|
exportFile.style.display = "none";
|
||||||
|
exportFile.download = finalFileName;
|
||||||
|
exportFile.href = blobUrl;
|
||||||
|
document.body.appendChild(exportFile);
|
||||||
|
exportFile.click();
|
||||||
|
// 去除下载对 url 的影响
|
||||||
|
document.body.removeChild(exportFile);
|
||||||
|
window.URL.revokeObjectURL(blobUrl);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('文件下载失败:', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export const useTable = (
|
|||||||
});
|
});
|
||||||
dataCallBack && (data = dataCallBack(data));
|
dataCallBack && (data = dataCallBack(data));
|
||||||
state.tableData = isPageable ? data.records : data;
|
state.tableData = isPageable ? data.records : data;
|
||||||
|
//console.log(data);
|
||||||
// 解构后台返回的分页数据 (如果有分页更新分页信息)
|
// 解构后台返回的分页数据 (如果有分页更新分页信息)
|
||||||
if (isPageable) {
|
if (isPageable) {
|
||||||
state.resPageable.total = data.total;
|
state.resPageable.total = data.total;
|
||||||
@@ -85,6 +86,7 @@ export const useTable = (
|
|||||||
state.resPageable.size = data.size;
|
state.resPageable.size = data.size;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
//console.log('123');
|
||||||
requestError && requestError(error);
|
requestError && requestError(error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export const useTheme = () => {
|
|||||||
|
|
||||||
// 修改主题颜色
|
// 修改主题颜色
|
||||||
const changePrimary = (val: string | null) => {
|
const changePrimary = (val: string | null) => {
|
||||||
|
|
||||||
if (!val) {
|
if (!val) {
|
||||||
val = DEFAULT_PRIMARY;
|
val = DEFAULT_PRIMARY;
|
||||||
ElMessage({ type: "success", message: `主题颜色已重置为 ${DEFAULT_PRIMARY}` });
|
ElMessage({ type: "success", message: `主题颜色已重置为 ${DEFAULT_PRIMARY}` });
|
||||||
@@ -40,10 +41,13 @@ export const useTheme = () => {
|
|||||||
for (let i = 1; i <= 9; i++) {
|
for (let i = 1; i <= 9; i++) {
|
||||||
const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`;
|
const primaryColor = isDark.value ? `${getDarkColor(val, i / 10)}` : `${getLightColor(val, i / 10)}`;
|
||||||
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor);
|
document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, primaryColor);
|
||||||
|
|
||||||
|
// const colorValue = document.documentElement.style.getPropertyValue(`--el-color-primary-light-${i}`).trim();
|
||||||
|
// console.log(`--el-color-primary-light-${i}: ${colorValue}`);
|
||||||
}
|
}
|
||||||
globalStore.setGlobalState("primary", val);
|
globalStore.setGlobalState("primary", val);
|
||||||
};
|
|
||||||
|
|
||||||
|
}
|
||||||
// 灰色和弱色切换
|
// 灰色和弱色切换
|
||||||
const changeGreyOrWeak = (type: Theme.GreyOrWeakType, value: boolean) => {
|
const changeGreyOrWeak = (type: Theme.GreyOrWeakType, value: boolean) => {
|
||||||
const body = document.body as HTMLElement;
|
const body = document.body as HTMLElement;
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default {
|
|||||||
changePassword: "Change Password",
|
changePassword: "Change Password",
|
||||||
changeMode:"Change Mode",
|
changeMode:"Change Mode",
|
||||||
versionRegister:"Version Register",
|
versionRegister:"Version Register",
|
||||||
|
changeTheme: "Change Theme",
|
||||||
|
changeScene: "Change Scene",
|
||||||
logout: "Logout"
|
logout: "Logout"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default {
|
|||||||
changePassword: "修改密码",
|
changePassword: "修改密码",
|
||||||
changeMode:"模式切换",
|
changeMode:"模式切换",
|
||||||
versionRegister:"版本注册",
|
versionRegister:"版本注册",
|
||||||
|
changeTheme:"主题切换",
|
||||||
|
changeScene: "场景切换",
|
||||||
logout: "退出登录"
|
logout: "退出登录"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<!-- 经典布局 -->
|
<!-- 经典布局 -->
|
||||||
<template>
|
<template>
|
||||||
<el-container class="layout">
|
<el-container class="layout">
|
||||||
|
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="header-lf mask-image">
|
<div class="header-lf mask-image">
|
||||||
<div class="logo flx-center">
|
<div class="logo flx-center">
|
||||||
@@ -38,26 +37,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="layoutClassic">
|
<script setup lang="ts" name="layoutClassic">
|
||||||
import { computed } from "vue";
|
import { computed } from 'vue'
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from 'vue-router'
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import Main from "@/layouts/components/Main/index.vue";
|
import Main from '@/layouts/components/Main/index.vue'
|
||||||
import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
|
import SubMenu from '@/layouts/components/Menu/SubMenu.vue'
|
||||||
import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft.vue";
|
import ToolBarLeft from '@/layouts/components/Header/ToolBarLeft.vue'
|
||||||
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
|
import ToolBarRight from '@/layouts/components/Header/ToolBarRight.vue'
|
||||||
|
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore()
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore()
|
||||||
const accordion = computed(() => globalStore.accordion);
|
const accordion = computed(() => globalStore.accordion)
|
||||||
const isCollapse = computed(() => globalStore.isCollapse);
|
const isCollapse = computed(() => globalStore.isCollapse)
|
||||||
const menuList = computed(() => authStore.showMenuListGet);
|
const menuList = computed(() => authStore.showMenuListGet)
|
||||||
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string);
|
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,7 +11,9 @@
|
|||||||
v-for="item in menuList"
|
v-for="item in menuList"
|
||||||
:key="item.path"
|
:key="item.path"
|
||||||
class="split-item"
|
class="split-item"
|
||||||
:class="{ 'split-active': splitActive === item.path || `/${splitActive.split('/')[1]}` === item.path }"
|
:class="{
|
||||||
|
'split-active': splitActive === item.path || `/${splitActive.split('/')[1]}` === item.path
|
||||||
|
}"
|
||||||
@click="changeSubMenu(item)"
|
@click="changeSubMenu(item)"
|
||||||
>
|
>
|
||||||
<el-icon>
|
<el-icon>
|
||||||
@@ -24,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-aside :class="{ 'not-aside': !subMenuList.length }" :style="{ width: isCollapse ? '65px' : '210px' }">
|
<el-aside :class="{ 'not-aside': !subMenuList.length }" :style="{ width: isCollapse ? '65px' : '210px' }">
|
||||||
<div class="logo flx-center">
|
<div class="logo flx-center">
|
||||||
<span v-show="subMenuList.length" class="logo-text">{{ isCollapse ? "G" : title }}</span>
|
<span v-show="subMenuList.length" class="logo-text">{{ isCollapse ? 'G' : title }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-menu
|
<el-menu
|
||||||
@@ -49,55 +51,55 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="layoutColumns">
|
<script setup lang="ts" name="layoutColumns">
|
||||||
import { ref, computed, watch } from "vue";
|
import { computed, ref, watch } from 'vue'
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import Main from "@/layouts/components/Main/index.vue";
|
import Main from '@/layouts/components/Main/index.vue'
|
||||||
import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft.vue";
|
import ToolBarLeft from '@/layouts/components/Header/ToolBarLeft.vue'
|
||||||
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
|
import ToolBarRight from '@/layouts/components/Header/ToolBarRight.vue'
|
||||||
import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
|
import SubMenu from '@/layouts/components/Menu/SubMenu.vue'
|
||||||
|
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore()
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore()
|
||||||
const accordion = computed(() => globalStore.accordion);
|
const accordion = computed(() => globalStore.accordion)
|
||||||
const isCollapse = computed(() => globalStore.isCollapse);
|
const isCollapse = computed(() => globalStore.isCollapse)
|
||||||
const menuList = computed(() => authStore.showMenuListGet);
|
const menuList = computed(() => authStore.showMenuListGet)
|
||||||
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string);
|
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string)
|
||||||
|
|
||||||
const subMenuList = ref<Menu.MenuOptions[]>([]);
|
const subMenuList = ref<Menu.MenuOptions[]>([])
|
||||||
const splitActive = ref("");
|
const splitActive = ref('')
|
||||||
watch(
|
watch(
|
||||||
() => [menuList, route],
|
() => [menuList, route],
|
||||||
() => {
|
() => {
|
||||||
// 当前菜单没有数据直接 return
|
// 当前菜单没有数据直接 return
|
||||||
if (!menuList.value.length) return;
|
if (!menuList.value.length) return
|
||||||
splitActive.value = route.path;
|
splitActive.value = route.path
|
||||||
const menuItem = menuList.value.filter((item: Menu.MenuOptions) => {
|
const menuItem = menuList.value.filter((item: Menu.MenuOptions) => {
|
||||||
return route.path === item.path || `/${route.path.split("/")[1]}` === item.path;
|
return route.path === item.path || `/${route.path.split('/')[1]}` === item.path
|
||||||
});
|
})
|
||||||
if (menuItem[0].children?.length) return (subMenuList.value = menuItem[0].children);
|
if (menuItem[0].children?.length) return (subMenuList.value = menuItem[0].children)
|
||||||
subMenuList.value = [];
|
subMenuList.value = []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
|
||||||
// change SubMenu
|
// change SubMenu
|
||||||
const changeSubMenu = (item: Menu.MenuOptions) => {
|
const changeSubMenu = (item: Menu.MenuOptions) => {
|
||||||
splitActive.value = item.path;
|
splitActive.value = item.path
|
||||||
if (item.children?.length) return (subMenuList.value = item.children);
|
if (item.children?.length) return (subMenuList.value = item.children)
|
||||||
subMenuList.value = [];
|
subMenuList.value = []
|
||||||
router.push(item.path);
|
router.push(item.path)
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -39,7 +39,9 @@
|
|||||||
}
|
}
|
||||||
.el-menu-item:hover {
|
.el-menu-item:hover {
|
||||||
color: #fff; //一级导航划过颜色
|
color: #fff; //一级导航划过颜色
|
||||||
background-color: #5274a5 !important; //一级导航划过背景色
|
//background-color: #5274a5 !important; //一级导航划过背景色
|
||||||
|
background-color:var(--el-color-primary-light-3) !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
.el-sub-menu__hide-arrow {
|
.el-sub-menu__hide-arrow {
|
||||||
width: 65px;
|
width: 65px;
|
||||||
@@ -47,7 +49,9 @@
|
|||||||
}
|
}
|
||||||
.el-menu-item.is-active {
|
.el-menu-item.is-active {
|
||||||
color: #fff !important; //一级导航文字选中颜色
|
color: #fff !important; //一级导航文字选中颜色
|
||||||
background-color: #5274a5 !important; //一级导航选中背景色
|
//background-color: #5274a5 !important; //一级导航选中背景色
|
||||||
|
background-color: var(--el-color-primary-light-3) !important;
|
||||||
|
|
||||||
border-bottom: 0 !important;
|
border-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
.el-sub-menu__title {
|
.el-sub-menu__title {
|
||||||
@@ -67,7 +71,9 @@
|
|||||||
color: #fff !important; //二级导航文字选中颜色
|
color: #fff !important; //二级导航文字选中颜色
|
||||||
// background-color: var(--el-color-primary) !important;
|
// background-color: var(--el-color-primary) !important;
|
||||||
// background-color: #5274a5 !important;//二级导航选中背景色
|
// background-color: #5274a5 !important;//二级导航选中背景色
|
||||||
background-color: #5274a5 !important;
|
|
||||||
|
//background-color: #7588e5 !important;
|
||||||
|
background-color: var(--el-color-primary-light-3) !important;
|
||||||
border-bottom-color: var(--el-color-primary) !important;
|
border-bottom-color: var(--el-color-primary) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,7 @@
|
|||||||
<el-header>
|
<el-header>
|
||||||
<div class="logo flx-center">
|
<div class="logo flx-center">
|
||||||
<!-- <img class="logo-img" src="@/assets/images/logo.svg" alt="logo" /> -->
|
<!-- <img class="logo-img" src="@/assets/images/logo.svg" alt="logo" /> -->
|
||||||
<img
|
<img class="logo-img" src="@/assets/images/cn_pms9100_logo.png" alt="logo" />
|
||||||
class="logo-img"
|
|
||||||
src="@/assets/images/cn_pms9100_logo.png"
|
|
||||||
alt="logo"
|
|
||||||
/>
|
|
||||||
<span class="logo-text">{{ title }}</span>
|
<span class="logo-text">{{ title }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-menu v-if="showMenuFlag" trigger="click" mode="horizontal" :router="false" :default-active="activeMenu">
|
<el-menu v-if="showMenuFlag" trigger="click" mode="horizontal" :router="false" :default-active="activeMenu">
|
||||||
@@ -45,37 +41,34 @@
|
|||||||
<ToolBarRight />
|
<ToolBarRight />
|
||||||
</el-header>
|
</el-header>
|
||||||
<Main />
|
<Main />
|
||||||
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="layoutTransverse">
|
<script setup lang="ts" name="layoutTransverse">
|
||||||
import { computed } from "vue";
|
import { computed } from 'vue'
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import Main from "@/layouts/components/Main/index.vue";
|
import Main from '@/layouts/components/Main/index.vue'
|
||||||
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
|
import ToolBarRight from '@/layouts/components/Header/ToolBarRight.vue'
|
||||||
import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
|
import SubMenu from '@/layouts/components/Menu/SubMenu.vue'
|
||||||
|
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore()
|
||||||
const menuList = computed(() => authStore.showMenuListGet);
|
const menuList = computed(() => authStore.showMenuListGet)
|
||||||
const showMenuFlag = computed(() => authStore.showMenuFlagGet)
|
const showMenuFlag = computed(() => authStore.showMenuFlagGet)
|
||||||
const activeMenu = computed(
|
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string)
|
||||||
() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
||||||
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, "_blank");
|
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, '_blank')
|
||||||
router.push(subItem.path);
|
router.push(subItem.path)
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
.logo {
|
.logo {
|
||||||
margin-right: 0 !important;
|
margin-right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,26 +31,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="layoutVertical">
|
<script setup lang="ts" name="layoutVertical">
|
||||||
import { computed } from "vue";
|
import { computed } from 'vue'
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from 'vue-router'
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import Main from "@/layouts/components/Main/index.vue";
|
import Main from '@/layouts/components/Main/index.vue'
|
||||||
import ToolBarLeft from "@/layouts/components/Header/ToolBarLeft.vue";
|
import ToolBarLeft from '@/layouts/components/Header/ToolBarLeft.vue'
|
||||||
import ToolBarRight from "@/layouts/components/Header/ToolBarRight.vue";
|
import ToolBarRight from '@/layouts/components/Header/ToolBarRight.vue'
|
||||||
import SubMenu from "@/layouts/components/Menu/SubMenu.vue";
|
import SubMenu from '@/layouts/components/Menu/SubMenu.vue'
|
||||||
|
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE;
|
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore()
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore()
|
||||||
const accordion = computed(() => globalStore.accordion);
|
const accordion = computed(() => globalStore.accordion)
|
||||||
const isCollapse = computed(() => globalStore.isCollapse);
|
const isCollapse = computed(() => globalStore.isCollapse)
|
||||||
const menuList = computed(() => authStore.showMenuListGet);
|
const menuList = computed(() => authStore.showMenuListGet)
|
||||||
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string);
|
const activeMenu = computed(() => (route.meta.activeMenu ? route.meta.activeMenu : route.path) as string)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,58 +10,51 @@
|
|||||||
<!-- <el-button dictType="primary"> -->
|
<!-- <el-button dictType="primary"> -->
|
||||||
<div class="change_mode">
|
<div class="change_mode">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
<el-icon class="el-icon--right change_mode_down"
|
<el-icon class="el-icon--right change_mode_down"><arrow-down /></el-icon>
|
||||||
><arrow-down
|
|
||||||
/></el-icon>
|
|
||||||
<el-icon class="el-icon--right change_mode_up"><arrow-up /></el-icon>
|
<el-icon class="el-icon--right change_mode_up"><arrow-up /></el-icon>
|
||||||
</div>
|
</div>
|
||||||
<!-- </el-button> -->
|
<!-- </el-button> -->
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="title = '模拟式模块'"
|
<el-dropdown-item @click="handelOpen('模拟式')">模拟式模块</el-dropdown-item>
|
||||||
>模拟式模块</el-dropdown-item
|
<el-dropdown-item @click="handelOpen('数字式')">数字式模块</el-dropdown-item>
|
||||||
>
|
<el-dropdown-item @click="handelOpen('比对式')">比对式模块</el-dropdown-item>
|
||||||
<el-dropdown-item @click="title = '数字式模块'"
|
|
||||||
>数字式模块</el-dropdown-item
|
|
||||||
>
|
|
||||||
<el-dropdown-item @click="title = '比对式模块'"
|
|
||||||
>比对式模块</el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<p style="margin: 0;">
|
<p style="margin: 0">
|
||||||
<a href="http://www.shining-electric.com/" target="_blank">
|
<a href="http://www.shining-electric.com/" target="_blank">2024 © 南京灿能电力自动化股份有限公司</a>
|
||||||
2024 © 南京灿能电力自动化股份有限公司
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
import { computed } from 'vue'
|
||||||
const title = ref("模拟式模块");
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const modeStore = useModeStore();
|
const router = useRouter()
|
||||||
watch(() => modeStore.currentMode, (newVal) => {
|
const authStore = useAuthStore()
|
||||||
//console.log('当前模式:', newVal);
|
const modeStore = useModeStore()
|
||||||
switch (newVal) {
|
|
||||||
case '模拟式':
|
const title = computed(() => {
|
||||||
title.value = '模拟式模块';
|
return modeStore.currentMode === '' ? '模拟式模块' : modeStore.currentMode + '模块'
|
||||||
break;
|
})
|
||||||
case '数字式':
|
|
||||||
title.value = '数字式模块';
|
const handelOpen = async (item: string) => {
|
||||||
break;
|
await authStore.setShowMenu()
|
||||||
case '比对式':
|
modeStore.setCurrentMode(item) // 将模式code存入 store
|
||||||
title.value = '比对式模块';
|
|
||||||
break;
|
//if (router.currentRoute.value.path === '/home/index') {
|
||||||
default:
|
// 强制刷新页面
|
||||||
title.value = '模拟式模块';
|
window.location.reload()
|
||||||
|
//} else {
|
||||||
|
// router.push({ path: '/home/index' });
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
.footer {
|
.footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: var(--el-color-primary);
|
background-color: var(--el-color-primary);
|
||||||
@@ -100,10 +93,11 @@ watch(() => modeStore.currentMode, (newVal) => {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
text-align: center;
|
text-align: right;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
a {
|
a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
margin-right: 25px; // 增加右边距
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- <div class="userInfo">-->
|
||||||
|
<!-- <div class="icon">-->
|
||||||
|
<!-- <Avatar/>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div class="username">-->
|
||||||
|
<!-- {{ username }}-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<el-dropdown trigger="click">
|
<el-dropdown trigger="click">
|
||||||
<div class="userInfo">
|
<div class="userInfo">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
@@ -10,18 +18,43 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="openDialog('themeRef')">
|
||||||
|
<el-icon><Sunny /></el-icon>{{ t("header.changeTheme") }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="openDialog('infoRef')">
|
<el-dropdown-item @click="openDialog('infoRef')">
|
||||||
<el-icon><User /></el-icon>{{ $t("header.personalData") }}
|
<el-icon><User /></el-icon>{{ t("header.personalData") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="openDialog('passwordRef')">
|
<el-dropdown-item @click="openDialog('passwordRef')">
|
||||||
<el-icon><Edit /></el-icon>{{ $t("header.changePassword") }}
|
<el-icon><Edit /></el-icon>{{ t("header.changePassword") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="changeMode">
|
<el-dropdown-item @click="changeMode">
|
||||||
<el-icon><Edit /></el-icon>{{ $t("header.changeMode") }}
|
<el-icon><Switch /></el-icon>{{ t("header.changeMode") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="openDialog('versionRegisterRef')">
|
<el-dropdown-item @click="openDialog('versionRegisterRef')">
|
||||||
<el-icon><SetUp /></el-icon>{{ $t("header.versionRegister") }}
|
<el-icon><SetUp /></el-icon>{{ t("header.versionRegister") }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown trigger="hover" placement="left-start" v-if="userStore.userInfo.loginName == 'root'">
|
||||||
|
<div class="custom-dropdown-trigger">
|
||||||
|
<el-icon><Tools /></el-icon>
|
||||||
|
<span>{{ t("header.changeScene") }}</span>
|
||||||
|
</div>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item
|
||||||
|
v-for="item in dictStore.getDictData('app_scene')"
|
||||||
|
:key="item.value"
|
||||||
|
:class="{
|
||||||
|
'custom-dropdown-item': true,
|
||||||
|
active: item.value === appSceneStore.currentScene
|
||||||
|
}"
|
||||||
|
@click="changeScene(item.value?? '')"
|
||||||
|
:disabled = "item.value === appSceneStore.currentScene"
|
||||||
|
>
|
||||||
|
{{ item.name }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -34,6 +67,9 @@
|
|||||||
<PasswordDialog ref="passwordRef"></PasswordDialog>
|
<PasswordDialog ref="passwordRef"></PasswordDialog>
|
||||||
<!-- versionRegisterDialog -->
|
<!-- versionRegisterDialog -->
|
||||||
<VersionDialog ref="versionRegisterRef"></VersionDialog>
|
<VersionDialog ref="versionRegisterRef"></VersionDialog>
|
||||||
|
<!-- ThemeDialog -->
|
||||||
|
<ThemeDialog ref="themeRef"></ThemeDialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -42,12 +78,13 @@ import { LOGIN_URL } from "@/config";
|
|||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { logoutApi } from "@/api/user/login";
|
import { logoutApi } from "@/api/user/login";
|
||||||
import { useUserStore } from "@/stores/modules/user";
|
import { useUserStore } from "@/stores/modules/user";
|
||||||
import { ElMessageBox, ElMessage } from "element-plus";
|
import { ElMessageBox, ElMessage, CHANGE_EVENT } from "element-plus";
|
||||||
import InfoDialog from "./InfoDialog.vue";
|
import InfoDialog from "./InfoDialog.vue";
|
||||||
import PasswordDialog from "./PasswordDialog.vue";
|
import PasswordDialog from "./PasswordDialog.vue";
|
||||||
|
import ThemeDialog from "./ThemeDialog.vue";
|
||||||
import VersionDialog from "@/views/system/versionRegister/index.vue";
|
import VersionDialog from "@/views/system/versionRegister/index.vue";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import { Avatar } from "@element-plus/icons-vue";
|
import { ArrowLeft, Avatar, Delete, Document, Sunny, Switch ,Tools} from "@element-plus/icons-vue";
|
||||||
import AssemblySize from "./components/AssemblySize.vue";
|
import AssemblySize from "./components/AssemblySize.vue";
|
||||||
import Language from "./components/Language.vue";
|
import Language from "./components/Language.vue";
|
||||||
import SearchMenu from "./components/SearchMenu.vue";
|
import SearchMenu from "./components/SearchMenu.vue";
|
||||||
@@ -56,13 +93,24 @@ import Message from "./components/Message.vue";
|
|||||||
import Fullscreen from "./components/Fullscreen.vue";
|
import Fullscreen from "./components/Fullscreen.vue";
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from "@/stores/modules/auth";
|
||||||
import {useDictStore} from "@/stores/modules/dict";
|
import {useDictStore} from "@/stores/modules/dict";
|
||||||
import { useModeStore } from "@/stores/modules/mode";
|
import { useModeStore,useAppSceneStore } from "@/stores/modules/mode";
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const dictStore = useDictStore();
|
const dictStore = useDictStore();
|
||||||
const username = computed(() => userStore.userInfo.name);
|
const username = computed(() => userStore.userInfo.name);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const modeStore = useModeStore();
|
const modeStore = useModeStore();
|
||||||
|
const AppSceneStore = useAppSceneStore();
|
||||||
|
import { useTheme } from "@/hooks/useTheme";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
import {updateScene} from '@/api/system/base/index'
|
||||||
|
|
||||||
|
|
||||||
|
const { changePrimary} = useTheme();
|
||||||
|
|
||||||
|
// 初始化 i18n
|
||||||
|
const { t } = useI18n(); // 使用 t 方法替代 $t
|
||||||
|
|
||||||
// 退出登录
|
// 退出登录
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
@@ -74,10 +122,14 @@ const logout = () => {
|
|||||||
// 1.执行退出登录接口
|
// 1.执行退出登录接口
|
||||||
await logoutApi();
|
await logoutApi();
|
||||||
// 2.清除 Token
|
// 2.清除 Token
|
||||||
userStore.setToken("");
|
userStore.setAccessToken("");
|
||||||
userStore.setUserInfo({name: ""});
|
userStore.setRefreshToken("");
|
||||||
|
userStore.setExp(0)
|
||||||
|
userStore.setUserInfo({id: "", name: ""});
|
||||||
|
userStore.setIsRefreshToken(false)
|
||||||
dictStore.setDictData([]);
|
dictStore.setDictData([]);
|
||||||
modeStore.setCurrentMode('');
|
modeStore.setCurrentMode('');
|
||||||
|
AppSceneStore.setCurrentMode('');
|
||||||
// 3.重定向到登陆页
|
// 3.重定向到登陆页
|
||||||
router.replace(LOGIN_URL);
|
router.replace(LOGIN_URL);
|
||||||
ElMessage.success("退出登录成功!");
|
ElMessage.success("退出登录成功!");
|
||||||
@@ -90,12 +142,26 @@ const logout = () => {
|
|||||||
const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
|
const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
|
||||||
const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null);
|
const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null);
|
||||||
const versionRegisterRef = ref<InstanceType<typeof VersionDialog> | null>(null);
|
const versionRegisterRef = ref<InstanceType<typeof VersionDialog> | null>(null);
|
||||||
|
const themeRef = ref<InstanceType<typeof ThemeDialog> | null>(null);
|
||||||
const openDialog = (ref: string) => {
|
const openDialog = (ref: string) => {
|
||||||
if (ref == "infoRef") infoRef.value?.openDialog();
|
if (ref == "infoRef") infoRef.value?.openDialog();
|
||||||
if (ref == "passwordRef") passwordRef.value?.openDialog();
|
if (ref == "passwordRef") passwordRef.value?.openDialog();
|
||||||
if (ref == "versionRegisterRef") versionRegisterRef.value?.openDialog();
|
if (ref == "versionRegisterRef") versionRegisterRef.value?.openDialog();
|
||||||
|
if (ref == "themeRef") themeRef.value?.openDialog();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const appSceneStore = useAppSceneStore();
|
||||||
|
|
||||||
|
const changeScene = async (value: string) => {
|
||||||
|
appSceneStore.setCurrentMode(value);
|
||||||
|
await updateScene({scene :dictStore.getDictData('app_scene').find(item => item.value == value)?.id});
|
||||||
|
// 强制刷新页面
|
||||||
|
window.location.reload();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//模式切换
|
//模式切换
|
||||||
const changeMode = () => {
|
const changeMode = () => {
|
||||||
authStore.changeModel();
|
authStore.changeModel();
|
||||||
@@ -135,4 +201,18 @@ const changeMode = () => {
|
|||||||
// height: 100%;
|
// height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-trigger {
|
||||||
|
padding: 8px 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-dropdown-menu__item.custom-dropdown-item.active),
|
||||||
|
:deep(.el-dropdown-menu__item.custom-dropdown-item.active:hover) {
|
||||||
|
background-color: var(--el-color-primary-light-9) !important;
|
||||||
|
color: var(--el-color-primary)
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="dialogVisible" title="主题切换" width="500px" draggable>
|
||||||
|
<el-divider content-position="center">主题颜色</el-divider>
|
||||||
|
<div style="display: flex; justify-content: center;">
|
||||||
|
<el-color-picker v-model="color" />
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="sure">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { onMounted, ref } from "vue";
|
||||||
|
import { useTheme } from "@/hooks/useTheme";
|
||||||
|
import { on } from "events";
|
||||||
|
const color = ref('')
|
||||||
|
const { changePrimary} = useTheme();
|
||||||
|
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const openDialog = () => {
|
||||||
|
// 修复:使用可选链和空值合并运算符确保不会出现 null 或 undefined
|
||||||
|
const storedColor = JSON.parse(localStorage.getItem('cn-global') ?? '{}').primary;
|
||||||
|
color.value = storedColor ?? '#526ADE'; // 默认值为 '#526ADE'
|
||||||
|
dialogVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const sure = () => {
|
||||||
|
changePrimary(color.value); // 切换主题
|
||||||
|
dialogVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// onMounted(() => {
|
||||||
|
// // 修复:使用可选链和空值合并运算符确保不会出现 null 或 undefined
|
||||||
|
// const storedColor = JSON.parse(localStorage.getItem('cn-global') ?? '{}').primary;
|
||||||
|
// console.log('123',storedColor)
|
||||||
|
// color.value = storedColor ?? '#526ADE'; // 默认值为 '#526ADE'
|
||||||
|
// })
|
||||||
|
|
||||||
|
defineExpose({ openDialog });
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
.el-main {
|
.el-main {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 20px;//主体padding
|
padding: 15px;//主体padding
|
||||||
overflow-x: hidden;
|
overflow: hidden;
|
||||||
background-color: var(--el-bg-color-page);
|
background-color: var(--el-bg-color-page);
|
||||||
}
|
}
|
||||||
.el-footer {
|
.el-footer {
|
||||||
|
|||||||
@@ -2,84 +2,80 @@
|
|||||||
<Maximize v-show="maximize" />
|
<Maximize v-show="maximize" />
|
||||||
<Tabs v-if="tabs && showMenuFlag" />
|
<Tabs v-if="tabs && showMenuFlag" />
|
||||||
<el-main>
|
<el-main>
|
||||||
<!-- style="height: calc(100vh - 157px);overflow-y:auto; overflow-x:hidden;" :style='{height:showMenuFlag?"calc(100vh - 157px)":" calc(100vh - 120px)"}' -->
|
<router-view v-slot="{ Component, route }" style="height: 100%">
|
||||||
<router-view v-slot="{ Component, route }" style="height:100%;">
|
<!-- {{ keepAliveName}} -->
|
||||||
<transition appear name="fade-transform" mode="out-in">
|
<!-- <transition name="slide-right" mode="out-in"> -->
|
||||||
<keep-alive :include="keepAliveName">
|
<keep-alive :include="tabsMenuList">
|
||||||
<component
|
<component :is="Component" :key="route.fullPath" />
|
||||||
:is="Component"
|
|
||||||
v-if="isRouterShow"
|
|
||||||
:key="route.fullPath"
|
|
||||||
/>
|
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
<!-- </transition> -->
|
||||||
</router-view>
|
</router-view>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-footer>
|
<el-footer>
|
||||||
<!-- v-show="footer" -->
|
|
||||||
<Footer />
|
<Footer />
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onBeforeUnmount, provide, watch, computed } from "vue";
|
import { computed, onBeforeUnmount, provide, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from 'pinia'
|
||||||
import { useDebounceFn } from "@vueuse/core";
|
import { useDebounceFn } from '@vueuse/core'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import { useKeepAliveStore } from "@/stores/modules/keepAlive";
|
import { useKeepAliveStore } from '@/stores/modules/keepAlive'
|
||||||
import Maximize from "./components/Maximize.vue";
|
import Maximize from './components/Maximize.vue'
|
||||||
import Tabs from "@/layouts/components/Tabs/index.vue";
|
import Tabs from '@/layouts/components/Tabs/index.vue'
|
||||||
import Footer from "@/layouts/components/Footer/index.vue";
|
import Footer from '@/layouts/components/Footer/index.vue'
|
||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
const globalStore = useGlobalStore();
|
import { useTabsStore } from '@/stores/modules/tabs'
|
||||||
const authStore = useAuthStore();
|
|
||||||
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
|
|
||||||
|
|
||||||
const keepAliveStore = useKeepAliveStore();
|
const tabStore = useTabsStore()
|
||||||
const { keepAliveName } = storeToRefs(keepAliveStore);
|
const globalStore = useGlobalStore()
|
||||||
|
const tabsMenuList = computed(() => tabStore.tabsMenuList.map(item => item.name))
|
||||||
|
const authStore = useAuthStore()
|
||||||
|
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore)
|
||||||
|
const keepAliveStore = useKeepAliveStore()
|
||||||
|
const { keepAliveName } = storeToRefs(keepAliveStore)
|
||||||
//是否显示导航栏
|
//是否显示导航栏
|
||||||
const showMenuFlag = computed(() => authStore.showMenuFlagGet);
|
const showMenuFlag = computed(() => authStore.showMenuFlagGet)
|
||||||
// 注入刷新页面方法
|
// 注入刷新页面方法
|
||||||
const isRouterShow = ref(true);
|
const isRouterShow = ref(true)
|
||||||
const refreshCurrentPage = (val: boolean) => (isRouterShow.value = val);
|
const refreshCurrentPage = (val: boolean) => (isRouterShow.value = val)
|
||||||
provide("refresh", refreshCurrentPage);
|
provide('refresh', refreshCurrentPage)
|
||||||
|
|
||||||
// 监听当前页面是否最大化,动态添加 class
|
// 监听当前页面是否最大化,动态添加 class
|
||||||
watch(
|
watch(
|
||||||
() => maximize.value,
|
() => maximize.value,
|
||||||
() => {
|
() => {
|
||||||
const app = document.getElementById("app") as HTMLElement;
|
const app = document.getElementById('app') as HTMLElement
|
||||||
if (maximize.value) app.classList.add("main-maximize");
|
if (maximize.value) app.classList.add('main-maximize')
|
||||||
else app.classList.remove("main-maximize");
|
else app.classList.remove('main-maximize')
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
)
|
||||||
|
|
||||||
// 监听布局变化,在 body 上添加相对应的 layout class
|
// 监听布局变化,在 body 上添加相对应的 layout class
|
||||||
watch(
|
watch(
|
||||||
() => layout.value,
|
() => layout.value,
|
||||||
() => {
|
() => {
|
||||||
const body = document.body as HTMLElement;
|
const body = document.body as HTMLElement
|
||||||
body.setAttribute("class", layout.value);
|
body.setAttribute('class', layout.value)
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
)
|
||||||
|
|
||||||
// 监听窗口大小变化,折叠侧边栏
|
// 监听窗口大小变化,折叠侧边栏
|
||||||
const screenWidth = ref(0);
|
const screenWidth = ref(0)
|
||||||
const listeningWindow = useDebounceFn(() => {
|
const listeningWindow = useDebounceFn(() => {
|
||||||
screenWidth.value = document.body.clientWidth;
|
screenWidth.value = document.body.clientWidth
|
||||||
if (!isCollapse.value && screenWidth.value < 1200)
|
if (!isCollapse.value && screenWidth.value < 1200) globalStore.setGlobalState('isCollapse', true)
|
||||||
globalStore.setGlobalState("isCollapse", true);
|
if (isCollapse.value && screenWidth.value > 1200) globalStore.setGlobalState('isCollapse', false)
|
||||||
if (isCollapse.value && screenWidth.value > 1200)
|
}, 100)
|
||||||
globalStore.setGlobalState("isCollapse", false);
|
window.addEventListener('resize', listeningWindow, false)
|
||||||
}, 100);
|
|
||||||
window.addEventListener("resize", listeningWindow, false);
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
window.removeEventListener("resize", listeningWindow);
|
window.removeEventListener('resize', listeningWindow)
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,27 +20,36 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { onBeforeMount } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
defineProps<{ menuList: Menu.MenuOptions[] }>();
|
defineProps<{ menuList: Menu.MenuOptions[] }>();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
||||||
|
//console.log('1456----------------',subItem);
|
||||||
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, "_blank");
|
if (subItem.meta.isLink) return window.open(subItem.meta.isLink, "_blank");
|
||||||
router.push(subItem.path);
|
router.push(subItem.path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.el-sub-menu .el-sub-menu__title:hover {
|
.el-sub-menu .el-sub-menu__title:hover {
|
||||||
// color: var(--el-menu-hover-text-color) !important;
|
// color: var(--el-menu-hover-text-color) !important;
|
||||||
// background-color: transparent !important;
|
// background-color: transparent !important;
|
||||||
color: #fff !important;//一级导航文字选中颜色
|
color: #fff !important;//一级导航文字选中颜色
|
||||||
background-color: #5274a5 !important; //一级导航选中背景色
|
//background-color: #5274a5 !important; //一级导航选中背景色
|
||||||
|
|
||||||
|
background-color: var(--el-color-primary-light-3) !important;
|
||||||
|
|
||||||
}
|
}
|
||||||
.el-menu--collapse {
|
.el-menu--collapse {
|
||||||
.is-active {
|
.is-active {
|
||||||
.el-sub-menu__title {
|
.el-sub-menu__title {
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
// background-color: var(--el-color-primary) !important;
|
// background-color: var(--el-color-primary) !important;
|
||||||
background-color: #5274a5 !important;
|
//background-color: #5274a5 !important;
|
||||||
|
background-color: var(--el-color-primary-light-3) !important;
|
||||||
|
|
||||||
border-bottom: 0 !important;
|
border-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +62,9 @@ const handleClickMenu = (subItem: Menu.MenuOptions) => {
|
|||||||
// color: var(--el-menu-active-color) !important;
|
// color: var(--el-menu-active-color) !important;
|
||||||
// background-color: var(--el-menu-active-bg-color) !important;
|
// background-color: var(--el-menu-active-bg-color) !important;
|
||||||
color: #fff !important;//一级导航文字选中颜色
|
color: #fff !important;//一级导航文字选中颜色
|
||||||
background-color: #5274a5 !important; //一级导航选中背景色
|
//background-color: #5274a5 !important; //一级导航选中背景色
|
||||||
|
background-color: var(--el-color-primary-light-3) !important;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
@@ -6,25 +6,32 @@
|
|||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="refresh">
|
<el-dropdown-item @click="refresh">
|
||||||
<el-icon><Refresh /></el-icon>{{ $t("tabs.refresh") }}
|
<el-icon><Refresh /></el-icon>
|
||||||
|
{{ $t('tabs.refresh') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="maximize">
|
<el-dropdown-item @click="maximize">
|
||||||
<el-icon><FullScreen /></el-icon>{{ $t("tabs.maximize") }}
|
<el-icon><FullScreen /></el-icon>
|
||||||
|
{{ $t('tabs.maximize') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item divided @click="closeCurrentTab">
|
<el-dropdown-item divided @click="closeCurrentTab">
|
||||||
<el-icon><Remove /></el-icon>{{ $t("tabs.closeCurrent") }}
|
<el-icon><Remove /></el-icon>
|
||||||
|
{{ $t('tabs.closeCurrent') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'left')">
|
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'left')">
|
||||||
<el-icon><DArrowLeft /></el-icon>{{ $t("tabs.closeLeft") }}
|
<el-icon><DArrowLeft /></el-icon>
|
||||||
|
{{ $t('tabs.closeLeft') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'right')">
|
<el-dropdown-item @click="tabStore.closeTabsOnSide(route.fullPath, 'right')">
|
||||||
<el-icon><DArrowRight /></el-icon>{{ $t("tabs.closeRight") }}
|
<el-icon><DArrowRight /></el-icon>
|
||||||
|
{{ $t('tabs.closeRight') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item divided @click="tabStore.closeMultipleTab(route.fullPath)">
|
<el-dropdown-item divided @click="tabStore.closeMultipleTab(route.fullPath)">
|
||||||
<el-icon><CircleClose /></el-icon>{{ $t("tabs.closeOther") }}
|
<el-icon><CircleClose /></el-icon>
|
||||||
|
{{ $t('tabs.closeOther') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="closeAllTab">
|
<el-dropdown-item @click="closeAllTab">
|
||||||
<el-icon><FolderDelete /></el-icon>{{ $t("tabs.closeAll") }}
|
<el-icon><FolderDelete /></el-icon>
|
||||||
|
{{ $t('tabs.closeAll') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
@@ -32,50 +39,50 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { inject, nextTick } from "vue";
|
import { inject, nextTick } from 'vue'
|
||||||
import { HOME_URL } from "@/config";
|
import { HOME_URL } from '@/config'
|
||||||
import { useTabsStore } from "@/stores/modules/tabs";
|
import { useTabsStore } from '@/stores/modules/tabs'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import { useKeepAliveStore } from "@/stores/modules/keepAlive";
|
import { useKeepAliveStore } from '@/stores/modules/keepAlive'
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute()
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const tabStore = useTabsStore();
|
const tabStore = useTabsStore()
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore()
|
||||||
const keepAliveStore = useKeepAliveStore();
|
const keepAliveStore = useKeepAliveStore()
|
||||||
|
|
||||||
// refresh current page
|
// refresh current page
|
||||||
const refreshCurrentPage: Function = inject("refresh") as Function;
|
const refreshCurrentPage: Function = inject('refresh') as Function
|
||||||
const refresh = () => {
|
const refresh = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
keepAliveStore.removeKeepAliveName(route.name as string);
|
keepAliveStore.removeKeepAliveName(route.name as string)
|
||||||
refreshCurrentPage(false);
|
refreshCurrentPage(false)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
keepAliveStore.addKeepAliveName(route.name as string);
|
keepAliveStore.addKeepAliveName(route.name as string)
|
||||||
refreshCurrentPage(true);
|
refreshCurrentPage(true)
|
||||||
});
|
})
|
||||||
}, 0);
|
}, 0)
|
||||||
};
|
}
|
||||||
|
|
||||||
// maximize current page
|
// maximize current page
|
||||||
const maximize = () => {
|
const maximize = () => {
|
||||||
globalStore.setGlobalState("maximize", true);
|
globalStore.setGlobalState('maximize', true)
|
||||||
};
|
}
|
||||||
|
|
||||||
// Close Current
|
// Close Current
|
||||||
const closeCurrentTab = () => {
|
const closeCurrentTab = () => {
|
||||||
if (route.meta.isAffix) return;
|
if (route.meta.isAffix) return
|
||||||
tabStore.removeTabs(route.fullPath);
|
tabStore.removeTabs(route.fullPath)
|
||||||
};
|
}
|
||||||
|
|
||||||
// Close All
|
// Close All
|
||||||
const closeAllTab = () => {
|
const closeAllTab = () => {
|
||||||
tabStore.closeMultipleTab();
|
tabStore.closeMultipleTab()
|
||||||
router.push(HOME_URL);
|
router.push(HOME_URL)
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "../index.scss";
|
@use '../index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='tabs-box'>
|
<div class="tabs-box">
|
||||||
<div class='tabs-menu'>
|
<div class="tabs-menu">
|
||||||
<el-tabs v-model='tabsMenuValue' type='card' @tab-click='tabClick' @tab-remove='tabRemove'>
|
<el-tabs v-model="tabsMenuValue" type="card" @tab-click="tabClick" @tab-remove="tabRemove">
|
||||||
<el-tab-pane v-for='item in tabsMenuList' :key='item.path' :label='item.title' :name='item.path'
|
<el-tab-pane
|
||||||
:closable='item.close'>
|
v-for="item in tabsMenuList"
|
||||||
|
:key="item.path"
|
||||||
|
:label="item.title"
|
||||||
|
:name="item.path"
|
||||||
|
:closable="item.close"
|
||||||
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<el-icon v-show='item.icon && tabsIcon' class='tabs-icon'>
|
<el-icon v-show="item.icon && tabsIcon" class="tabs-icon">
|
||||||
<component :is='item.icon'></component>
|
<component :is="item.icon"></component>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</template>
|
</template>
|
||||||
@@ -17,14 +22,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import Sortable from 'sortablejs'
|
import Sortable from 'sortablejs'
|
||||||
import { ref, computed, watch, onMounted } from 'vue'
|
import { computed, onMounted, ref, watch } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { useGlobalStore } from '@/stores/modules/global'
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import { useTabsStore } from '@/stores/modules/tabs'
|
import { useTabsStore } from '@/stores/modules/tabs'
|
||||||
import { useAuthStore } from '@/stores/modules/auth'
|
import { useAuthStore } from '@/stores/modules/auth'
|
||||||
import { TabsPaneContext, TabPaneName } from 'element-plus'
|
import { TabPaneName, TabsPaneContext } from 'element-plus'
|
||||||
import MoreButton from './components/MoreButton.vue'
|
import MoreButton from './components/MoreButton.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -42,7 +47,6 @@ onMounted(() => {
|
|||||||
initTabs()
|
initTabs()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 监听路由的变化(防止浏览器后退/前进不变化 tabsMenuValue)
|
// 监听路由的变化(防止浏览器后退/前进不变化 tabsMenuValue)
|
||||||
watch(
|
watch(
|
||||||
() => route.fullPath,
|
() => route.fullPath,
|
||||||
@@ -58,12 +62,12 @@ watch(
|
|||||||
path: route.fullPath,
|
path: route.fullPath,
|
||||||
name: route.name as string,
|
name: route.name as string,
|
||||||
close: !route.meta.isAffix,
|
close: !route.meta.isAffix,
|
||||||
isKeepAlive: route.meta.isKeepAlive as boolean,
|
isKeepAlive: route.meta.isKeepAlive as boolean
|
||||||
}
|
}
|
||||||
tabStore.addTabs(tabsParams)
|
tabStore.addTabs(tabsParams)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
// 初始化需要固定的 tabs
|
// 初始化需要固定的 tabs
|
||||||
@@ -77,6 +81,7 @@ const initTabs = () => {
|
|||||||
name: item.name,
|
name: item.name,
|
||||||
close: !item.meta.isAffix,
|
close: !item.meta.isAffix,
|
||||||
isKeepAlive: item.meta.isKeepAlive,
|
isKeepAlive: item.meta.isKeepAlive,
|
||||||
|
unshift: true
|
||||||
}
|
}
|
||||||
tabStore.addTabs(tabsParams)
|
tabStore.addTabs(tabsParams)
|
||||||
}
|
}
|
||||||
@@ -93,7 +98,7 @@ const tabsDrop = () => {
|
|||||||
const currRow = tabsList.splice(oldIndex as number, 1)[0]
|
const currRow = tabsList.splice(oldIndex as number, 1)[0]
|
||||||
tabsList.splice(newIndex as number, 0, currRow)
|
tabsList.splice(newIndex as number, 0, currRow)
|
||||||
tabStore.setTabs(tabsList)
|
tabStore.setTabs(tabsList)
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,10 +110,10 @@ const tabClick = (tabItem: TabsPaneContext) => {
|
|||||||
|
|
||||||
// Remove Tab
|
// Remove Tab
|
||||||
const tabRemove = (fullPath: TabPaneName) => {
|
const tabRemove = (fullPath: TabPaneName) => {
|
||||||
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath)
|
tabStore.removeTabs(fullPath as string, fullPath == route.fullPath || '/machine/testScriptAdd' == route.fullPath)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang='scss'>
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
.layout-light {
|
.layout-light {
|
||||||
background-color: var(--el-color-primary-light-5);
|
background-color: var(--el-color-primary-light-3);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
.layout-content {
|
.layout-content {
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
</el-divider>
|
</el-divider>
|
||||||
<div class="layout-box">
|
<div class="layout-box">
|
||||||
<el-tooltip effect="dark" content="纵向" placement="top" :show-after="200">
|
<el-tooltip effect="dark" content="纵向" placement="top" :show-after="200">
|
||||||
<div :class="['layout-item layout-vertical', { 'is-active': layout == 'vertical' }]" @click="setLayout('vertical')">
|
<div
|
||||||
|
:class="['layout-item layout-vertical', { 'is-active': layout == 'vertical' }]"
|
||||||
|
@click="setLayout('vertical')"
|
||||||
|
>
|
||||||
<div class="layout-dark"></div>
|
<div class="layout-dark"></div>
|
||||||
<div class="layout-container">
|
<div class="layout-container">
|
||||||
<div class="layout-light"></div>
|
<div class="layout-light"></div>
|
||||||
@@ -19,7 +22,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" content="经典" placement="top" :show-after="200">
|
<el-tooltip effect="dark" content="经典" placement="top" :show-after="200">
|
||||||
<div :class="['layout-item layout-classic', { 'is-active': layout == 'classic' }]" @click="setLayout('classic')">
|
<div
|
||||||
|
:class="['layout-item layout-classic', { 'is-active': layout == 'classic' }]"
|
||||||
|
@click="setLayout('classic')"
|
||||||
|
>
|
||||||
<div class="layout-dark"></div>
|
<div class="layout-dark"></div>
|
||||||
<div class="layout-container">
|
<div class="layout-container">
|
||||||
<div class="layout-light"></div>
|
<div class="layout-light"></div>
|
||||||
@@ -31,7 +37,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" content="横向" placement="top" :show-after="200">
|
<el-tooltip effect="dark" content="横向" placement="top" :show-after="200">
|
||||||
<div :class="['layout-item layout-transverse', { 'is-active': layout == 'transverse' }]" @click="setLayout('transverse')">
|
<div
|
||||||
|
:class="['layout-item layout-transverse', { 'is-active': layout == 'transverse' }]"
|
||||||
|
@click="setLayout('transverse')"
|
||||||
|
>
|
||||||
<div class="layout-dark"></div>
|
<div class="layout-dark"></div>
|
||||||
<div class="layout-content"></div>
|
<div class="layout-content"></div>
|
||||||
<el-icon v-if="layout == 'transverse'">
|
<el-icon v-if="layout == 'transverse'">
|
||||||
@@ -40,7 +49,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" content="分栏" placement="top" :show-after="200">
|
<el-tooltip effect="dark" content="分栏" placement="top" :show-after="200">
|
||||||
<div :class="['layout-item layout-columns', { 'is-active': layout == 'columns' }]" @click="setLayout('columns')">
|
<div
|
||||||
|
:class="['layout-item layout-columns', { 'is-active': layout == 'columns' }]"
|
||||||
|
@click="setLayout('columns')"
|
||||||
|
>
|
||||||
<div class="layout-dark"></div>
|
<div class="layout-dark"></div>
|
||||||
<div class="layout-light"></div>
|
<div class="layout-light"></div>
|
||||||
<div class="layout-content"></div>
|
<div class="layout-content"></div>
|
||||||
@@ -128,18 +140,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue'
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from 'pinia'
|
||||||
import { useTheme } from "@/hooks/useTheme";
|
import { useTheme } from '@/hooks/useTheme'
|
||||||
import { useGlobalStore } from "@/stores/modules/global";
|
import { useGlobalStore } from '@/stores/modules/global'
|
||||||
import { LayoutType } from "@/stores/interface";
|
import { LayoutType } from '@/stores/interface'
|
||||||
import { DEFAULT_PRIMARY } from "@/config";
|
import { DEFAULT_PRIMARY } from '@/config'
|
||||||
import mittBus from "@/utils/mittBus";
|
import mittBus from '@/utils/mittBus'
|
||||||
import SwitchDark from "@/components/SwitchDark/index.vue";
|
import SwitchDark from '@/components/SwitchDark/index.vue'
|
||||||
|
|
||||||
const { changePrimary, changeGreyOrWeak, setAsideTheme, setHeaderTheme } = useTheme();
|
const { changePrimary, changeGreyOrWeak, setAsideTheme, setHeaderTheme } = useTheme()
|
||||||
|
|
||||||
const globalStore = useGlobalStore();
|
const globalStore = useGlobalStore()
|
||||||
const {
|
const {
|
||||||
layout,
|
layout,
|
||||||
primary,
|
primary,
|
||||||
@@ -154,33 +166,33 @@ const {
|
|||||||
tabs,
|
tabs,
|
||||||
tabsIcon,
|
tabsIcon,
|
||||||
footer
|
footer
|
||||||
} = storeToRefs(globalStore);
|
} = storeToRefs(globalStore)
|
||||||
|
|
||||||
// 预定义主题颜色
|
// 预定义主题颜色
|
||||||
const colorList = [
|
const colorList = [
|
||||||
DEFAULT_PRIMARY,
|
DEFAULT_PRIMARY,
|
||||||
"#daa96e",
|
'#daa96e',
|
||||||
"#0c819f",
|
'#0c819f',
|
||||||
"#409eff",
|
'#409eff',
|
||||||
"#27ae60",
|
'#27ae60',
|
||||||
"#ff5c93",
|
'#ff5c93',
|
||||||
"#e74c3c",
|
'#e74c3c',
|
||||||
"#fd726d",
|
'#fd726d',
|
||||||
"#f39c12",
|
'#f39c12',
|
||||||
"#9b59b6"
|
'#9b59b6'
|
||||||
];
|
]
|
||||||
|
|
||||||
// 设置布局方式
|
// 设置布局方式
|
||||||
const setLayout = (val: LayoutType) => {
|
const setLayout = (val: LayoutType) => {
|
||||||
globalStore.setGlobalState("layout", val);
|
globalStore.setGlobalState('layout', val)
|
||||||
setAsideTheme();
|
setAsideTheme()
|
||||||
};
|
}
|
||||||
|
|
||||||
// 打开主题设置
|
// 打开主题设置
|
||||||
const drawerVisible = ref(false);
|
const drawerVisible = ref(false)
|
||||||
mittBus.on("openThemeDrawer", () => (drawerVisible.value = true));
|
mittBus.on('openThemeDrawer', () => (drawerVisible.value = true))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@use './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -65,5 +65,6 @@ const setupAll = async () => {
|
|||||||
|
|
||||||
//挂载app
|
//挂载app
|
||||||
setupAll().then(() => {
|
setupAll().then(() => {
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ const routerMode = {
|
|||||||
* @param meta.isKeepAlive ==> 当前路由是否缓存
|
* @param meta.isKeepAlive ==> 当前路由是否缓存
|
||||||
* */
|
* */
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
|
|
||||||
history: routerMode[mode](),
|
history: routerMode[mode](),
|
||||||
routes: [...staticRouter],
|
routes: [...staticRouter],
|
||||||
// 不区分路由大小写,非严格模式下提供了更宽松的路径匹配
|
// 不区分路由大小写,非严格模式下提供了更宽松的路径匹配
|
||||||
@@ -46,14 +47,13 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
// 1.NProgress 开始
|
// 1.NProgress 开始
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
|
|
||||||
// 2.动态设置标题
|
// 2.动态设置标题
|
||||||
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||||
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title
|
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title
|
||||||
|
|
||||||
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
|
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
|
||||||
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
||||||
if (userStore.token) return next(from.fullPath)
|
if (userStore.accessToken) return next(from.fullPath)
|
||||||
resetRouter()
|
resetRouter()
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
@@ -62,17 +62,16 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
if (ROUTER_WHITE_LIST.includes(to.path)) return next()
|
if (ROUTER_WHITE_LIST.includes(to.path)) return next()
|
||||||
|
|
||||||
// 5.判断是否有 Token,没有重定向到 login 页面
|
// 5.判断是否有 Token,没有重定向到 login 页面
|
||||||
if (!userStore.token) return next({ path: LOGIN_URL, replace: true })
|
if (!userStore.accessToken) return next({ path: LOGIN_URL, replace: true })
|
||||||
|
|
||||||
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
|
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
|
||||||
if (!authStore.authMenuListGet.length) {
|
if (!authStore.authMenuListGet.length) {
|
||||||
await initDynamicRouter()
|
await initDynamicRouter()
|
||||||
return next({ ...to, replace: true })
|
return next({ ...to, replace: true })
|
||||||
}
|
}
|
||||||
//console.log(to)
|
|
||||||
// 7.存储 routerName 做按钮权限筛选
|
// 7.存储 routerName 做按钮权限筛选
|
||||||
authStore.setRouteName(to.name as string)
|
authStore.setRouteName(to.name as string)
|
||||||
|
|
||||||
// 8.正常访问页面
|
// 8.正常访问页面
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ export const initDynamicRouter = async () => {
|
|||||||
type: "warning",
|
type: "warning",
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
userStore.setToken("");
|
userStore.setAccessToken("");
|
||||||
|
userStore.setRefreshToken("");
|
||||||
|
userStore.setExp(0)
|
||||||
router.replace(LOGIN_URL);
|
router.replace(LOGIN_URL);
|
||||||
return Promise.reject("No permission");
|
return Promise.reject("No permission");
|
||||||
}
|
}
|
||||||
@@ -36,9 +38,11 @@ export const initDynamicRouter = async () => {
|
|||||||
// 3.添加动态路由
|
// 3.添加动态路由
|
||||||
authStore.flatMenuListGet.forEach(item => {
|
authStore.flatMenuListGet.forEach(item => {
|
||||||
item.children && delete item.children;
|
item.children && delete item.children;
|
||||||
|
|
||||||
if (item.component && typeof item.component == "string") {
|
if (item.component && typeof item.component == "string") {
|
||||||
item.component = modules["/src/views" + item.component + ".vue"];
|
item.component = modules["/src/views" + item.component + ".vue"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.meta.isFull) {
|
if (item.meta.isFull) {
|
||||||
router.addRoute(item as unknown as RouteRecordRaw);
|
router.addRoute(item as unknown as RouteRecordRaw);
|
||||||
} else {
|
} else {
|
||||||
@@ -47,7 +51,9 @@ export const initDynamicRouter = async () => {
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 当按钮 || 菜单请求出错时,重定向到登陆页
|
// 当按钮 || 菜单请求出错时,重定向到登陆页
|
||||||
userStore.setToken("");
|
userStore.setAccessToken("");
|
||||||
|
userStore.setRefreshToken("");
|
||||||
|
userStore.setExp(0)
|
||||||
router.replace(LOGIN_URL);
|
router.replace(LOGIN_URL);
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,122 +1,139 @@
|
|||||||
import { RouteRecordRaw } from "vue-router";
|
import { RouteRecordRaw } from 'vue-router'
|
||||||
import { HOME_URL, LOGIN_URL } from "@/config";
|
import { HOME_URL, LOGIN_URL } from '@/config'
|
||||||
export const Layout = () => import('@/layouts/index.vue');
|
export const Layout = () => import('@/layouts/index.vue')
|
||||||
/**
|
/**
|
||||||
* staticRouter (静态路由)
|
* staticRouter (静态路由)
|
||||||
*/
|
*/
|
||||||
export const staticRouter: RouteRecordRaw[] = [
|
export const staticRouter: RouteRecordRaw[] = [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: '/',
|
||||||
redirect: HOME_URL,
|
redirect: HOME_URL
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: LOGIN_URL,
|
path: LOGIN_URL,
|
||||||
name: "login",
|
name: 'login',
|
||||||
component: () => import("@/views/login/index.vue"),
|
component: () => import('@/views/login/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: "登录",
|
title: '登录'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/layout",
|
path: '/layout',
|
||||||
name: "layout",
|
name: 'layout',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "/plan",
|
path: '/plan',
|
||||||
name: "plan",
|
name: 'plan',
|
||||||
redirect: "/plan/planList",
|
redirect: '/plan/planList',
|
||||||
children: [
|
children: [
|
||||||
{
|
// {
|
||||||
path: "/plan/planList",
|
// path: "/plan/planList",
|
||||||
name: "planList",
|
// name: "planList",
|
||||||
component: () => import("@/views/plan/planList/index.vue"),
|
// component: () => import("@/views/plan/planList/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "检测计划列表",
|
// title: "检测计划列表",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: false,
|
// isKeepAlive: true,//缓存改成true
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/singlePlanList",
|
// path: "/plan/singlePlanList",
|
||||||
name: "singlePlanList",
|
// name: "singlePlanList",
|
||||||
component: () => import("@/views/plan/singlePlanList/index.vue"),
|
// component: () => import("@/views/plan/singlePlanList/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "单个计划列表",
|
// title: "单个计划列表",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: false,
|
// isKeepAlive: true,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/preTest",
|
// path: "/plan/preTest",
|
||||||
name: "preTest",
|
// name: "preTest",
|
||||||
component: () => import("@/views/plan/preTest/index.vue"),
|
// component: () => import("@/views/plan/preTest/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "预检测",
|
// title: "预检测",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: false,
|
// isKeepAlive: false,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: "/plan/autoTest",
|
// path: "/plan/autoTest",
|
||||||
name: "autoTest",
|
// name: "autoTest",
|
||||||
component: () => import("@/views/plan/autoTest/index.vue"),
|
// component: () => import("@/views/plan/autoTest/index.vue"),
|
||||||
meta: {
|
// meta: {
|
||||||
title: "自动检测",
|
// title: "自动检测",
|
||||||
icon: "List",
|
// icon: "List",
|
||||||
isLink: "",
|
// isLink: "",
|
||||||
hideTab:true,
|
// hideTab:true,
|
||||||
parentPath:'/system/proTable',
|
// parentPath:'/system/proTable',
|
||||||
isHide: false,
|
// isHide: false,
|
||||||
isFull: false,
|
// isFull: false,
|
||||||
isAffix: false,
|
// isAffix: false,
|
||||||
isKeepAlive: false,
|
// isKeepAlive: true,
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
|
|
||||||
// 错误页面路由
|
// 错误页面路由
|
||||||
{
|
{
|
||||||
path: "/403",
|
path: '/403',
|
||||||
name: "403",
|
name: '403',
|
||||||
component: () => import("@/components/ErrorMessage/403.vue"),
|
component: () => import('@/components/ErrorMessage/403.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: "403页面",
|
title: '403页面'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/404",
|
path: '/404',
|
||||||
name: "404",
|
name: '404',
|
||||||
component: () => import("@/components/ErrorMessage/404.vue"),
|
component: () => import('@/components/ErrorMessage/404.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: "404页面",
|
title: '404页面'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/500",
|
path: '/500',
|
||||||
name: "500",
|
name: '500',
|
||||||
component: () => import("@/components/ErrorMessage/500.vue"),
|
component: () => import('@/components/ErrorMessage/500.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: "500页面",
|
title: '500页面'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
// Resolve refresh page, route warnings
|
// Resolve refresh page, route warnings
|
||||||
{
|
{
|
||||||
path: "/:pathMatch(.*)*",
|
path: '/:pathMatch(.*)*',
|
||||||
component: () => import("@/components/ErrorMessage/404.vue"),
|
component: () => import('@/components/ErrorMessage/404.vue')
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
];
|
{
|
||||||
|
path: '/machine/testScriptAdd',
|
||||||
|
name: 'testScriptAdd',
|
||||||
|
component: () => import('@/views/machine/testScript/components/testScriptPopup.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '检测脚本配置',
|
||||||
|
icon: 'List',
|
||||||
|
isLink: '',
|
||||||
|
hideTab: true,
|
||||||
|
parentPath: '/machine/testScript',
|
||||||
|
isHide: false,
|
||||||
|
isFull: false,
|
||||||
|
isAffix: false,
|
||||||
|
isKeepAlive: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|||||||
@@ -17,3 +17,5 @@ export const USER_STORE_KEY = "cn-user";
|
|||||||
// pinia中dict store的key
|
// pinia中dict store的key
|
||||||
export const DICT_STORE_KEY = "cn-dictData";
|
export const DICT_STORE_KEY = "cn-dictData";
|
||||||
|
|
||||||
|
export const CHECK_STORE_KEY = "cn-check";
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,10 @@ export interface GlobalState {
|
|||||||
|
|
||||||
/* UserState */
|
/* UserState */
|
||||||
export interface UserState {
|
export interface UserState {
|
||||||
token: string;
|
accessToken: string;
|
||||||
userInfo: { name: string };
|
refreshToken: string;
|
||||||
|
isRefreshToken: boolean;
|
||||||
|
userInfo: { id: string, name: string,loginName:string };
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tabsMenuProps */
|
/* tabsMenuProps */
|
||||||
@@ -39,6 +41,7 @@ export interface TabsMenuProps {
|
|||||||
name: string;
|
name: string;
|
||||||
close: boolean;
|
close: boolean;
|
||||||
isKeepAlive: boolean;
|
isKeepAlive: boolean;
|
||||||
|
unshift?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TabsState */
|
/* TabsState */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user