Compare commits
587 Commits
3b69a152bd
...
temp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36575339c5 | ||
|
|
4145353928 | ||
|
|
3d08f22562 | ||
|
|
c2ff0238d9 | ||
|
|
8ec8bcd494 | ||
|
|
308fa1e14f | ||
|
|
75dbd0641e | ||
|
|
190ec589ce | ||
|
|
360ec9e6e8 | ||
|
|
91b0ca9fb8 | ||
|
|
87243b212d | ||
|
|
bbb77faa8a | ||
|
|
2a8eeb657c | ||
|
|
3fa3655200 | ||
|
|
7a7e2bb968 | ||
|
|
117db1c400 | ||
|
|
0c822e6d29 | ||
|
|
0b9ae9dcd3 | ||
|
|
e4d54f411a | ||
|
|
3a4f4505dc | ||
|
|
6b03be0119 | ||
|
|
0698847543 | ||
|
|
7c09cbc83b | ||
|
|
a648d043ee | ||
|
|
7eae05f6fb | ||
|
|
d94a29e9de | ||
|
|
378baaefe2 | ||
|
|
758a5718de | ||
|
|
1d7eee538f | ||
|
|
cc80c3155a | ||
|
|
7096e692ee | ||
|
|
f4d7076a08 | ||
|
|
a28c331c10 | ||
|
|
c4548fc81d | ||
|
|
a0809e12f0 | ||
|
|
ba778bc0cf | ||
|
|
c9b67317a3 | ||
|
|
b41ac8dcbe | ||
|
|
0627ba2cb2 | ||
|
|
88a8837876 | ||
|
|
3aca13f9bb | ||
|
|
52fa3ff491 | ||
|
|
5ddc013f38 | ||
|
|
9124c37650 | ||
|
|
0e632c962a | ||
|
|
b54a785891 | ||
|
|
228f13d037 | ||
|
|
cd112d5981 | ||
|
|
63a5c3ff0e | ||
|
|
01745cea42 | ||
|
|
572cdc60b3 | ||
|
|
ed7194e253 | ||
|
|
6851afdee6 | ||
|
|
e8253be8ca | ||
|
|
0cb7edaa7e | ||
|
|
c6b4895b67 | ||
|
|
84ed95512f | ||
|
|
b36081126f | ||
|
|
93f2869a5b | ||
|
|
f8eda43169 | ||
|
|
1102e8ac3a | ||
|
|
dc3d0a59ba | ||
|
|
915358dbec | ||
|
|
a7400bae18 | ||
|
|
0db717594d | ||
|
|
cfba387285 | ||
|
|
15e6e51f1b | ||
|
|
0c146d17ca | ||
|
|
e1ea9e56cd | ||
|
|
12a9040ee5 | ||
|
|
d1189bcae9 | ||
|
|
699754c902 | ||
|
|
6ba03df551 | ||
|
|
474d0cd916 | ||
|
|
695ec5f4a0 | ||
|
|
3cf535351e | ||
|
|
ffd7be94f6 | ||
|
|
5803e3cdd9 | ||
|
|
1051e09a7c | ||
|
|
583347ba70 | ||
|
|
c76dcaa7c5 | ||
|
|
ce97741978 | ||
|
|
06e0ec7425 | ||
|
|
c21a79da87 | ||
|
|
d31cc213cb | ||
|
|
ef6f59a1c6 | ||
|
|
cac9355b04 | ||
|
|
fad5398292 | ||
|
|
06706da713 | ||
|
|
029d665c0f | ||
|
|
e07cfd4664 | ||
|
|
440b43ba42 | ||
|
|
30a76a5cc3 | ||
|
|
15811933c3 | ||
|
|
6695790805 | ||
|
|
81fc1ed71a | ||
|
|
2524367eb5 | ||
|
|
968bade95e | ||
|
|
169ee2f432 | ||
|
|
32706e348e | ||
|
|
8bb0e07a3b | ||
|
|
d4b0e13fa1 | ||
|
|
4836efd896 | ||
|
|
c27b19bf1e | ||
|
|
0ef0bb57f3 | ||
|
|
d3eef2678e | ||
|
|
3316fa6d3e | ||
|
|
68015eb31e | ||
|
|
6362c00860 | ||
|
|
9ff820af25 | ||
|
|
9f910958e7 | ||
|
|
49a5168454 | ||
|
|
8ef988b7b2 | ||
|
|
d7ea375fb0 | ||
|
|
f21e8d48a6 | ||
|
|
1ceddd5df9 | ||
|
|
9f9982b04a | ||
|
|
75a582cdce | ||
|
|
723ade2531 | ||
|
|
6c3dd401ad | ||
|
|
129ef8845a | ||
|
|
49df50b260 | ||
|
|
6ef4c99920 | ||
|
|
8a949074aa | ||
|
|
eed65ab04d | ||
|
|
8b746a307d | ||
|
|
49010d1437 | ||
|
|
7b4f22222d | ||
|
|
ca74de5b37 | ||
|
|
3195a1547b | ||
|
|
7b1f25689e | ||
|
|
0009360d9f | ||
|
|
a57c3d5b6c | ||
|
|
069698930e | ||
|
|
12990f86d2 | ||
|
|
05bb62752b | ||
|
|
c09ca418b3 | ||
|
|
13bda76928 | ||
|
|
933e4b26a8 | ||
|
|
7153a81c63 | ||
|
|
6cb09f631b | ||
|
|
ece2712b09 | ||
|
|
878d02680d | ||
|
|
def744926f | ||
|
|
e292a4178b | ||
|
|
173ad8bdb4 | ||
|
|
47e6750b24 | ||
|
|
d212ab2f02 | ||
|
|
257716253c | ||
|
|
cb4fb86cf4 | ||
|
|
e99f441461 | ||
|
|
43fcd2b161 | ||
|
|
4a1f9259d7 | ||
|
|
e9b8581aab | ||
|
|
2d40e8d26d | ||
|
|
400839e865 | ||
|
|
cf9854e005 | ||
|
|
7d049151b6 | ||
|
|
196f7de9b4 | ||
|
|
d8e8dc651c | ||
|
|
42049e14bd | ||
|
|
bb792158d8 | ||
|
|
580d82639d | ||
|
|
fbe0796d7d | ||
|
|
45d914b16e | ||
|
|
2c396d2d8d | ||
|
|
591220343a | ||
|
|
6a349afcf2 | ||
|
|
fd2ee73d4a | ||
|
|
b36db572f7 | ||
|
|
08acefd9f5 | ||
|
|
73b6246203 | ||
|
|
93363c7550 | ||
|
|
10d354c4f6 | ||
|
|
d15f8e8ed5 | ||
|
|
fddba152fc | ||
|
|
2635851a44 | ||
|
|
0f81a21cb5 | ||
|
|
df589c5a8e | ||
|
|
a47f8ae50f | ||
|
|
7e97118634 | ||
|
|
897db024e0 | ||
|
|
07f1903c98 | ||
|
|
2d4e1dc5a1 | ||
|
|
f3542dffee | ||
|
|
60cd53992d | ||
|
|
3e390a8ce1 | ||
|
|
ee565449ab | ||
|
|
0b37b30c40 | ||
|
|
eae4dd3e71 | ||
|
|
94e5079222 | ||
|
|
404e3f23b9 | ||
|
|
13f29d862b | ||
|
|
59c3004067 | ||
|
|
5c2f77dc9d | ||
|
|
fbc6619126 | ||
|
|
aef40e64de | ||
|
|
2fde44ed23 | ||
|
|
1aa6ebdd45 | ||
|
|
83119f53e9 | ||
|
|
4205413418 | ||
|
|
2e1b1b8249 | ||
|
|
1f0eca56ae | ||
|
|
f18dad74e7 | ||
|
|
b89794d8be | ||
|
|
7799bac74a | ||
|
|
3d9cf0d94c | ||
|
|
3b0c02666e | ||
|
|
c2fc3c4098 | ||
|
|
7bd8721e32 | ||
|
|
56c903ca86 | ||
|
|
1a77df6442 | ||
|
|
0ee511e23a | ||
|
|
790c8a3962 | ||
|
|
fb38527edf | ||
|
|
f1952d7621 | ||
|
|
ed8d86ab8b | ||
|
|
ca7b5bbede | ||
|
|
0e452ddef2 | ||
|
|
e7642fe14c | ||
|
|
55ec21d41c | ||
|
|
dbdf3da68a | ||
|
|
e4c46d9da3 | ||
|
|
2eeab1c5a9 | ||
|
|
27732376b0 | ||
|
|
93cf7ab9fa | ||
|
|
cce83ee700 | ||
|
|
4395408f68 | ||
|
|
7758049b28 | ||
|
|
5e5bb2f239 | ||
|
|
3672d6feb3 | ||
|
|
7e50064857 | ||
|
|
d583acfb2d | ||
|
|
b079a2b464 | ||
|
|
5d7bd5bb19 | ||
|
|
f11a374baa | ||
|
|
16f3865dbd | ||
|
|
8b448e9061 | ||
|
|
5fb7235510 | ||
|
|
243aea92bb | ||
|
|
5d3eafa417 | ||
|
|
c6961fdfa8 | ||
|
|
1990fd11e6 | ||
|
|
bb9be7b4e0 | ||
|
|
ea25c22383 | ||
|
|
bab2e8def5 | ||
|
|
c0fa5ad9be | ||
|
|
bb3c4f1961 | ||
|
|
e64a3123a2 | ||
|
|
deba7bddd8 | ||
|
|
01fd569185 | ||
|
|
8a81c3e784 | ||
|
|
55051da8a5 | ||
|
|
75df2dfb11 | ||
|
|
67a76481cc | ||
|
|
3daeea7d3d | ||
|
|
d881ac0180 | ||
|
|
9a1298987f | ||
|
|
99e2e803ef | ||
|
|
180ad4a005 | ||
|
|
05409722ae | ||
|
|
1cf99afbc3 | ||
|
|
b55304ef7f | ||
|
|
16d7f81f0e | ||
|
|
3841e2afdd | ||
|
|
27de4ad24e | ||
|
|
3783e9d0d3 | ||
|
|
7c1f120182 | ||
|
|
e14bd35fac | ||
|
|
744aae1bba | ||
|
|
e05a813a1e | ||
|
|
008f73c706 | ||
|
|
06ee0ec6a4 | ||
|
|
979c15eda3 | ||
|
|
82b0f4cf96 | ||
|
|
bbed0e3ff3 | ||
|
|
1790db4595 | ||
|
|
8b40268bd1 | ||
|
|
7aa949bdcf | ||
|
|
61dcbfeacd | ||
|
|
6478070bd8 | ||
|
|
a1b3ee2c8c | ||
|
|
dd7c417f81 | ||
|
|
a9e6998430 | ||
|
|
261ad9017d | ||
|
|
b8b6a46e7e | ||
|
|
ab29f9152d | ||
|
|
2d96bbda3b | ||
|
|
7869b083c3 | ||
|
|
9637a6f13b | ||
|
|
ecf6cd38dd | ||
|
|
84191fe301 | ||
|
|
7dadb22181 | ||
|
|
b396c37426 | ||
|
|
ee99ba7340 | ||
|
|
c628c10f25 | ||
|
|
79c56bb979 | ||
|
|
9ca6cb83f0 | ||
|
|
a2bfe148d3 | ||
|
|
9134cf4ac3 | ||
|
|
7b77c3cc88 | ||
|
|
5e2f9cc966 | ||
|
|
4dcb8f74ca | ||
|
|
223ceed5eb | ||
|
|
5c5acf6942 | ||
|
|
975d5fe4f0 | ||
|
|
159698ffbe | ||
|
|
1b0118bb82 | ||
|
|
7c679f7fa5 | ||
|
|
ccec1ee763 | ||
|
|
c390535202 | ||
|
|
f4d01d65d0 | ||
|
|
16e3213f21 | ||
|
|
842c1e94e0 | ||
|
|
55f98f9e56 | ||
|
|
fc4b038e2e | ||
|
|
5993621c21 | ||
|
|
714e640c2e | ||
|
|
96b91ad6de | ||
|
|
b82b97ebb1 | ||
|
|
69727fa613 | ||
|
|
0fba8917f2 | ||
|
|
088590beea | ||
|
|
4c2989239d | ||
|
|
1c8419569e | ||
|
|
822519dbb6 | ||
|
|
2d1d3a41a8 | ||
|
|
2bc56cc1d4 | ||
|
|
f82ffa185d | ||
|
|
57d97eb3e2 | ||
|
|
c9e283c3c8 | ||
|
|
ec94e2b5b4 | ||
|
|
c085f51cd1 | ||
|
|
1e4a3d61da | ||
|
|
9bd82ebbee | ||
|
|
ecdcd900d3 | ||
|
|
2f1a54a114 | ||
|
|
f636f426b0 | ||
|
|
1c709d3ccf | ||
|
|
df0f1f62ad | ||
|
|
6be90a8d0c | ||
|
|
75a9b87513 | ||
|
|
0fa9abf014 | ||
|
|
2576503808 | ||
|
|
7274efd5c2 | ||
|
|
429909a712 | ||
|
|
a6f77afe70 | ||
|
|
4955c235cc | ||
|
|
86db377d29 | ||
|
|
db70343b18 | ||
|
|
7f839b7a31 | ||
|
|
13d6db895f | ||
|
|
4e17163c67 | ||
|
|
c1aa2483ed | ||
|
|
652a94a466 | ||
|
|
97667fc496 | ||
|
|
7745f55803 | ||
|
|
f915dab012 | ||
|
|
9031837695 | ||
|
|
bd4fec4c7e | ||
|
|
f10045b64d | ||
|
|
85cd183493 | ||
|
|
a83f8d868a | ||
|
|
bf4a3fd581 | ||
|
|
2a6de583e1 | ||
|
|
ddf0514182 | ||
|
|
1be888feba | ||
|
|
5c902d174d | ||
|
|
c2e69b4d36 | ||
|
|
62f357c5d5 | ||
|
|
b06c9ddc84 | ||
|
|
40021ba5d0 | ||
|
|
1401d3611f | ||
|
|
d29c724920 | ||
|
|
5eba9a35a0 | ||
|
|
6278e3ff17 | ||
|
|
0b619fe937 | ||
|
|
48569345aa | ||
|
|
dc0f2a164b | ||
|
|
1aa294b998 | ||
|
|
ef20fa58de | ||
|
|
dac2e095e1 | ||
|
|
c68dc4deb7 | ||
|
|
0e9743f598 | ||
|
|
2fe6bb6d81 | ||
|
|
58300c60e2 | ||
|
|
3bf19ba70d | ||
|
|
de0ce4ec2d | ||
|
|
8091bc10cc | ||
|
|
e90efdb08d | ||
|
|
86e0b30e81 | ||
|
|
0214356cbb | ||
|
|
098b4f29fd | ||
|
|
3598e3d887 | ||
|
|
4869fd4d16 | ||
|
|
b41caf9320 | ||
|
|
8603732377 | ||
|
|
32d1a633b1 | ||
|
|
5deff41679 | ||
|
|
0681836c02 | ||
|
|
4526da936e | ||
|
|
c31b5468c7 | ||
|
|
e0206a228b | ||
|
|
47614e12ed | ||
|
|
d8cc8293bc | ||
|
|
141f2a3e6f | ||
|
|
4fcdae08de | ||
|
|
93d5959334 | ||
|
|
042fc8f16f | ||
|
|
0282d2d1aa | ||
|
|
97c3945848 | ||
|
|
37b877b220 | ||
|
|
4dea1ff14d | ||
|
|
de7a0ab88a | ||
|
|
533f0cc633 | ||
|
|
0cac402bd1 | ||
|
|
6137aaa4b6 | ||
|
|
4d49ef4e42 | ||
|
|
131913e52d | ||
|
|
5ed7449392 | ||
|
|
a698c69b7c | ||
|
|
5fde3175f1 | ||
|
|
149f44a8dd | ||
|
|
060ac6d486 | ||
|
|
7b624f6549 | ||
|
|
717b2aad72 | ||
|
|
f98a8be0b9 | ||
|
|
de2202e360 | ||
|
|
6b93422b08 | ||
|
|
30286253e7 | ||
|
|
a0d928feaa | ||
|
|
50ca1daca4 | ||
|
|
fb1980d73a | ||
|
|
ab17c4a1f9 | ||
|
|
aab4c9a600 | ||
|
|
0855659d74 | ||
|
|
3abdde797b | ||
|
|
d004a06ec1 | ||
|
|
76248c0f70 | ||
|
|
6e294e13eb | ||
|
|
7a9bea2f8e | ||
|
|
77052ae284 | ||
|
|
33eb153885 | ||
|
|
a3a5b63ea5 | ||
|
|
7a20eb8603 | ||
|
|
dc29be2718 | ||
|
|
f28b224c91 | ||
|
|
bfd6282a99 | ||
|
|
64cfd47d50 | ||
|
|
796d2fcf63 | ||
|
|
287dc9262b | ||
|
|
f39fb299c4 | ||
|
|
9ad9446cae | ||
|
|
1d4b76492d | ||
|
|
a16b26370f | ||
|
|
9316629faa | ||
|
|
c7bbc1f003 | ||
|
|
da80693704 | ||
|
|
40d93e74aa | ||
|
|
b2a200486f | ||
|
|
228f420bd4 | ||
|
|
78d49ff16e | ||
|
|
4bbb5c5133 | ||
|
|
d294c3f07a | ||
|
|
fba16c75b9 | ||
|
|
e5cd75c845 | ||
|
|
be09e531b9 | ||
|
|
45908dd5c1 | ||
|
|
7fd1733872 | ||
|
|
2d9fc62d86 | ||
|
|
7eb8ba79f8 | ||
|
|
ef782e90b6 | ||
|
|
46398fda22 | ||
|
|
edfc11825d | ||
|
|
9f1620c9f8 | ||
|
|
9ddeaa59eb | ||
|
|
8f25d2293c | ||
|
|
7c64a6b231 | ||
|
|
d6865544d8 | ||
|
|
3d2d777644 | ||
|
|
613e7feaf4 | ||
|
|
b55ab2353e | ||
|
|
d654588e65 | ||
|
|
15fce86265 | ||
|
|
cecd3a0325 | ||
|
|
0c291263cd | ||
|
|
d4f17c4c02 | ||
|
|
e16ad610e7 | ||
|
|
fea7abd476 | ||
|
|
2ebe536243 | ||
|
|
ab3960fff8 | ||
|
|
77a9fe882d | ||
|
|
8a554f5871 | ||
|
|
5d7d8cc4de | ||
|
|
69776112f9 | ||
|
|
f744ad286e | ||
|
|
75a67c3039 | ||
|
|
ec1ae071f8 | ||
|
|
d527a1467f | ||
|
|
012c049ab0 | ||
|
|
e0fe92a8f8 | ||
|
|
e9ca9cfab9 | ||
|
|
217496d5b6 | ||
|
|
efced81544 | ||
|
|
1f62153ad4 | ||
|
|
09fa01122c | ||
|
|
cd1690fb28 | ||
|
|
559db71640 | ||
|
|
91dd7a7d0c | ||
|
|
bc80a22180 | ||
|
|
da3d5840df | ||
|
|
08972bfbfb | ||
|
|
819a00f733 | ||
|
|
680855f310 | ||
|
|
8e6abb5c57 | ||
|
|
689a349d96 | ||
|
|
dd82f15e7f | ||
|
|
fbf460a620 | ||
|
|
c4132d41cd | ||
|
|
c4652e2571 | ||
|
|
d58f066b39 | ||
|
|
e6ed0f0e09 | ||
|
|
3b6d11122e | ||
|
|
30743f1474 | ||
|
|
ec6faa9494 | ||
|
|
cbfa942ff6 | ||
|
|
fc940e7241 | ||
|
|
a0f5c4de08 | ||
|
|
112c701799 | ||
|
|
6a31e3199b | ||
|
|
2141efd7a7 | ||
|
|
946384b9ed | ||
|
|
0bfbf391e2 | ||
|
|
e7e2d52dff | ||
|
|
14a7c158bc | ||
|
|
9c3508fbc8 | ||
|
|
61218104d3 | ||
|
|
bd89f7973d | ||
|
|
e1b0d817fe | ||
|
|
31479608c0 | ||
|
|
65230bf066 | ||
|
|
9319c09fb7 | ||
|
|
620fbd509a | ||
|
|
4614c8699f | ||
|
|
f7ebb4bd60 | ||
|
|
c9f8148dc3 | ||
|
|
c4d7573cbb | ||
|
|
778ada00fc | ||
|
|
e28ca898ee | ||
|
|
a67f48c770 | ||
|
|
0db3da2362 | ||
|
|
de08945d49 | ||
|
|
ddb046d2d3 | ||
|
|
d2b0a2ca06 | ||
|
|
c7f104091f | ||
|
|
2c6dc56e0b | ||
|
|
1e72487b35 | ||
|
|
8b2dc8a230 | ||
|
|
ab7217f0f0 | ||
|
|
11a7c77f69 | ||
|
|
576f313b2f | ||
|
|
1a7a01894d | ||
|
|
79743608b8 | ||
|
|
2dac756371 | ||
|
|
97ebd09edd | ||
|
|
c8718677f4 | ||
|
|
060365e0fe | ||
|
|
cf301fb1f1 | ||
|
|
d8bc019f03 | ||
|
|
51d9fb84e5 | ||
|
|
0df4d84cb6 | ||
|
|
3e9897b798 | ||
|
|
aee1cfdc40 | ||
|
|
443058d61f | ||
|
|
3f236bb1b1 | ||
|
|
60ae99d410 | ||
|
|
54b7ffb119 | ||
|
|
78207546c7 | ||
|
|
5318f0f46c | ||
|
|
de932dfe22 | ||
|
|
3958d730f0 | ||
|
|
91d6051664 | ||
|
|
043e73267f | ||
|
|
69a68c615e | ||
|
|
1d25ea126c | ||
|
|
4a9b924df6 | ||
|
|
84ef5b6032 |
65
README.md
@@ -26,3 +26,68 @@ Run `Volar: Switch TS Plugin on/off` from VSCode command palette.
|
|||||||
4. Open the VSCode command palette
|
4. Open the VSCode command palette
|
||||||
5. Search and run "Select TypeScript version" -> "Use workspace version"
|
5. Search and run "Select TypeScript version" -> "Use workspace version"
|
||||||
test
|
test
|
||||||
|
#### 目录结构
|
||||||
|
|-- build 构建相关
|
||||||
|
|-- hx-ai-intelligent AI智能BSA系统
|
||||||
|
|-- mock 定义模拟数据(登录/登出/获取用户信息等)
|
||||||
|
|-- public 静态资源
|
||||||
|
|-- resources 资源文件
|
||||||
|
|-- src
|
||||||
|
|-- api 定义接口请求地址
|
||||||
|
|-- components 当前项目的公共组件
|
||||||
|
|-- ns-modal-form.vue 经过二次封装后的“弹窗”通用组件
|
||||||
|
|-- ns-steps.vue 经过二次封装后的“步骤条”通用组件
|
||||||
|
|-- config 配置文件
|
||||||
|
|-- app.config.ts(包含应用程序配置的对象,包含api路径/组件配置等)
|
||||||
|
|-- directives 自定义指令(在vue应用程序中设置全局指令)
|
||||||
|
|-- enum 枚举(用于http请求配置和错误代码的处理)
|
||||||
|
|-- icon 图标(svg图标文件)
|
||||||
|
|-- router 路由
|
||||||
|
|-- store 状态管理
|
||||||
|
|-- theme 主题样式(less/scss)文件
|
||||||
|
|-- util 工具类
|
||||||
|
|-- debounce.ts 防抖函数(用于优化频繁出发的事件处理函数,例如窗口大小改变/滚动事件等)
|
||||||
|
|-- view 页面
|
||||||
|
|-- App.vue 根组件
|
||||||
|
|-- .env.development 当前项目开发环境配置
|
||||||
|
|-- .env.production 当前项目生产环境配置
|
||||||
|
|-- index.html 当前项目入口页
|
||||||
|
|-- tsconfig.json typescript配置
|
||||||
|
|-- vite.config.ts vite配置(包含当前项目请求接口地址)
|
||||||
|
|-- lib
|
||||||
|
|-- component 公共组件(color/drawer/echarts/flowChart/form/modal/table/tree等组件的二次封装或将组件注册为插件形式使用)
|
||||||
|
|-- paas 私有组件
|
||||||
|
|-- saas 私有组件
|
||||||
|
|-- type 类型定义
|
||||||
|
|-- use 自定义hook文件
|
||||||
|
|-- util (http/axios等工具类)
|
||||||
|
|-- node_modules 依赖包
|
||||||
|
|-- public 静态资源(不会被编译)
|
||||||
|
|-- src
|
||||||
|
|-- main.ts 入口文件(初始化saasInit函数的相关配置或服务的入口点。)
|
||||||
|
|-- type 声明定义应用程序的全局类型
|
||||||
|
|-- .env.development 开发环境配置
|
||||||
|
|-- .env.production 生产环境配置
|
||||||
|
|-- index.html 项目入口文件
|
||||||
|
|-- package.json 项目依赖包管理
|
||||||
|
|-- tsconfig.json typescript配置
|
||||||
|
|-- vite.config.ts vite配置
|
||||||
|
|-- README.md 项目说明
|
||||||
|
|
||||||
|
#### 开发前的相关配置或调试时需要本地启动项目
|
||||||
|
1、node官网下载并安装node环境,node版本18.12以上稳定版。官网地址:https://nodejs.cn/download/
|
||||||
|
node版本安装18.12以上版本,npm版本安装9.6.0以上版即可
|
||||||
|
查看版本:node -v npm -v
|
||||||
|
2、更换npm源为淘宝镜像
|
||||||
|
命令:npm config set registry https://registry.npmmirror.com/
|
||||||
|
输入此命令查看是否完成修改:npm config get registry
|
||||||
|
3、安装pnpm包管理器,由于有时npm启动项目会因为存在重复配置及文件而报错,使用pnpm可以避开这些问题,将资源整合,性能提高的同时也扩展了场景。
|
||||||
|
命令:npm install -g pnpm
|
||||||
|
输入此命令查看是否完成安装:pnpm -v
|
||||||
|
4、安装依赖包
|
||||||
|
命令:pnpm install
|
||||||
|
5、启动hx-ai-intelligent 项目命令:pnpm run ai 打包到线上命令:pnpm run ai-build
|
||||||
|
6、启动hx-op项目 项目命令:pnpm run ai-op 打包到线上命令:pnpm run ai-op-build
|
||||||
|
7、如使用vscode编辑器,可以在终端使用cmd终端启动项目,powershell终端会报错
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
hx-ai-intelligent/.env
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# port
|
||||||
|
VITE_PORT = 3301
|
||||||
|
#mode
|
||||||
|
VITE_GLOB_APP_RUN_TYPE = saas
|
||||||
|
|
||||||
|
# spa-title
|
||||||
|
VITE_GLOB_APP_TITLE = hx-ai-intelligent Depositor
|
||||||
|
|
||||||
|
# spa shortname
|
||||||
|
VITE_GLOB_APP_SHORT_NAME = hx-ai-intelligent-depositor
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = true
|
||||||
|
|
||||||
# public path
|
# public path
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /hx-ai-intelligent/
|
||||||
|
|
||||||
# Cross-domain proxy, you can configure multiple
|
# Cross-domain proxy, you can configure multiple
|
||||||
# Please note that no line breaks http://100.73.70.51
|
# Please note that no line breaks http://100.73.70.51
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = true
|
||||||
|
|
||||||
# public path
|
# public path
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /hx-ai-intelligent/
|
||||||
|
|
||||||
# Delete console
|
# Delete console
|
||||||
VITE_DROP_CONSOLE = true
|
VITE_DROP_CONSOLE = true
|
||||||
1
hx-ai-intelligent/.version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0.0.1
|
||||||
0
nervui-smart-parking/build.sh → hx-ai-intelligent/build.sh
Executable file → Normal file
19
hx-ai-intelligent/index.html
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" href="/projectIcon.svg" />
|
||||||
|
<meta name="referrer" content="never" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<!-- <script type="text/javascript">
|
||||||
|
window._AMapSecurityConfig = {
|
||||||
|
securityJsCode: '09e43004c09d39c0e61f8fd65d5e6a5a',
|
||||||
|
};
|
||||||
|
</script> -->
|
||||||
|
<title>AI智能BAS系统</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="./src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
hx-ai-intelligent/public/asset/file/carbonAssets.xlsx
Normal file
BIN
hx-ai-intelligent/public/asset/file/emissionSource.xlsx
Normal file
BIN
hx-ai-intelligent/public/asset/file/energyConsumption.xlsx
Normal file
BIN
hx-ai-intelligent/public/asset/file/groupList.xlsx
Normal file
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/21961.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/21962.png
Normal file
|
After Width: | Height: | Size: 810 B |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22394.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22396.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22396@2x.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22400.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22400@2x.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22406.png
Normal file
|
After Width: | Height: | Size: 237 B |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22419.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22419@2x.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22496.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22546.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22549.png
Normal file
|
After Width: | Height: | Size: 795 B |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22553.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/22554.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/alarm.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/alarm1.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/bgsquare.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/device2.png
Normal file
|
After Width: | Height: | Size: 802 B |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/fault1.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/off.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/off1.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/on.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/on1.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/repair.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
hx-ai-intelligent/public/asset/image/bulbLogo/repair1.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
BIN
hx-ai-intelligent/public/asset/image/headerIcon.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
hx-ai-intelligent/public/asset/image/login/background.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
hx-ai-intelligent/public/asset/image/login/lg-card-bg.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
10
hx-ai-intelligent/public/projectIcon.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36">
|
||||||
|
<g id="组_23402" data-name="组 23402" transform="translate(-959.12 -738.12)">
|
||||||
|
<rect id="矩形_16530" data-name="矩形 16530" width="36" height="36" transform="translate(959.12 738.12)" fill="none"/>
|
||||||
|
<g id="组_23400" data-name="组 23400" transform="translate(960.956 739.956)">
|
||||||
|
<path id="路径_30576" data-name="路径 30576" d="M207.674,163.872v-9.284a2.553,2.553,0,0,0-1.179-2.063l-8.056-4.634a2.417,2.417,0,0,0-2.358,0l-8.023,4.65a2.38,2.38,0,0,0-1.179,2.063v9.333A2.553,2.553,0,0,0,188.059,166l8.056,4.585a2.417,2.417,0,0,0,2.358,0l8.056-4.634A2.331,2.331,0,0,0,207.674,163.872Z" transform="translate(-181.117 -142.881)" fill="#4388fb" opacity="0.2"/>
|
||||||
|
<path id="路径_30577" data-name="路径 30577" d="M265.893,314.283h-2.718l-.884-2.653h-4.224l-.884,2.653h-2.718l4.224-11.625h2.9Zm-4.093-4.617-1.326-4.044a9.365,9.365,0,0,1-.2-1.015h-.065a5.831,5.831,0,0,1-.2,1.015l-1.326,4.044Zm8.072-7.073v11.625h-2.456V302.592Z" transform="translate(-246.539 -292.932)" fill="#4388fb"/>
|
||||||
|
<path id="路径_30578" data-name="路径 30578" d="M36.685,20.095a.9.9,0,0,0-.884.884v2.472a1.535,1.535,0,0,1-.77,1.294L23.7,31.262a1.422,1.422,0,0,1-1.523,0l-11.33-6.517a1.456,1.456,0,0,1-.77-1.294V20.177a2.409,2.409,0,0,0-1-4.6,2.425,2.425,0,0,0-2.423,2.407,2.391,2.391,0,0,0,1.637,2.276v3.176a3.268,3.268,0,0,0,1.637,2.816l11.33,6.582a3.244,3.244,0,0,0,1.637.409,3.471,3.471,0,0,0,1.637-.475l11.281-6.517a3.268,3.268,0,0,0,1.637-2.816V20.963A.76.76,0,0,0,36.685,20.095Zm.884-6.942V10.287a3.268,3.268,0,0,0-1.637-2.816L24.585.954a3.284,3.284,0,0,0-3.291,0L9.947,7.471A3.268,3.268,0,0,0,8.31,10.287v2.227a.884.884,0,1,0,1.768,0V10.287a1.535,1.535,0,0,1,.77-1.294l11.33-6.517a1.422,1.422,0,0,1,1.523,0L34.982,9.059a1.456,1.456,0,0,1,.77,1.294v2.734a2.4,2.4,0,1,0,1.817.065Z" transform="translate(-6.656 -0.512)" fill="#4388fb"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
207
hx-ai-intelligent/src/App.vue
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
<template>
|
||||||
|
<a-config-provider :locale="locale">
|
||||||
|
<div style="width: 100%; height: 100%">
|
||||||
|
<a-spin :spinning="state.isLoading" size="large">
|
||||||
|
<router-view />
|
||||||
|
</a-spin>
|
||||||
|
</div>
|
||||||
|
</a-config-provider>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, watch, ref } from 'vue';
|
||||||
|
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import Cookies from 'js-cookie';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import { items } from '/@/store/item';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'App',
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const cachedViews = ['Status'];
|
||||||
|
window.localStorage.setItem('mapKey', JSON.stringify({ type: 'tmap', url: '' }));
|
||||||
|
// watch(
|
||||||
|
// () => router.currentRoute.value,
|
||||||
|
// (e) => {
|
||||||
|
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) === undefined && e.fullPath !== '/login') {
|
||||||
|
// // message.warn('登陆信息已过期,请重新登录!', 1);
|
||||||
|
// // router.push('/login');
|
||||||
|
// // }
|
||||||
|
// // } else {
|
||||||
|
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) !== undefined && e === '/login') {
|
||||||
|
// // let url = window.sessionStorage.getItem('url');
|
||||||
|
// // url === null ? window.sessionStorage.setItem('url', '/doorway/visitor/audit') : '';
|
||||||
|
// // router.push(url === null ? '/doorway' : url);
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
return {
|
||||||
|
cachedViews,
|
||||||
|
locale: zhCN,
|
||||||
|
// 获得全局变量
|
||||||
|
state: items(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ns-content-main) {
|
||||||
|
.ant-tabs-content {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 树组件
|
||||||
|
:deep(.ant-tree-node-content-wrapper) {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
text-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-tree-node-selected) {
|
||||||
|
color: @primary-color !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ns-view-list-table 搜索区域
|
||||||
|
:deep(.ns-table-search) {
|
||||||
|
.ns-flexv2-form {
|
||||||
|
.ns-operate {
|
||||||
|
text-align: left;
|
||||||
|
margin-left: 0;
|
||||||
|
.ant-btn {
|
||||||
|
margin: 0;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ns-form-body {
|
||||||
|
max-width: 1650px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 区域阴影
|
||||||
|
// .ns-list-table {
|
||||||
|
|
||||||
|
:deep(.ant-tabs) {
|
||||||
|
// // overflow: visible;
|
||||||
|
// box-shadow: @ns-content-box-shadow;
|
||||||
|
// border-radius: @ns-border-radius;
|
||||||
|
.ns-table-search {
|
||||||
|
border-top-left-radius: 0px !important;
|
||||||
|
border-top-right-radius: 0px !important;
|
||||||
|
}
|
||||||
|
.ns-table-main {
|
||||||
|
border-bottom-left-radius: 0px !important;
|
||||||
|
border-bottom-right-radius: 0px !important;
|
||||||
|
}
|
||||||
|
// .ant-tabs-tabpane-active > div {
|
||||||
|
// height: 100%;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
// .ant-tabs .ns-table-main {
|
||||||
|
// border-bottom-left-radius: 0px !important;
|
||||||
|
// border-bottom-right-radius: 0px !important;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 菜单icon(仅仅处理特殊需求:未选中时icon与文字不同色)
|
||||||
|
:deep(.anticon) {
|
||||||
|
color: #8d96a3 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-menu-item-selected .ant-menu-item-only-child),
|
||||||
|
:deep(.ant-menu-submenu-selected .ant-menu-item-only-child),
|
||||||
|
:deep(.firstMenuItem-selected) {
|
||||||
|
.router-link-active > .anticon {
|
||||||
|
color: @white !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-menu-item-active) {
|
||||||
|
.anticon {
|
||||||
|
color: @primary-color !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.ant-menu-submenu-active),
|
||||||
|
:deep(.ant-menu-submenu-open),
|
||||||
|
:deep(.ant-menu-item-selected) {
|
||||||
|
.ant-menu-submenu-title {
|
||||||
|
.anticon {
|
||||||
|
color: @primary-color !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@min-padding: 5px;
|
||||||
|
:deep(.ns-left-menu-space):not(.ns-left-menu-space-collapsed) {
|
||||||
|
.firstMenuItem-selected {
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
|
||||||
|
background-color: transparent;
|
||||||
|
&::before {
|
||||||
|
background-color: @primary-color;
|
||||||
|
opacity: 1;
|
||||||
|
height: calc(100% - @min-padding*2);
|
||||||
|
top: @min-padding;
|
||||||
|
border-radius: @ns-border-radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-menu-item-active:not(.ant-menu-item-selected) {
|
||||||
|
background-color: transparent !important;
|
||||||
|
position: relative;
|
||||||
|
&::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
background-color: rgb(@primary-color, 0.1);
|
||||||
|
height: calc(100% - @min-padding*2);
|
||||||
|
top: @min-padding;
|
||||||
|
left: 0;
|
||||||
|
border-radius: @ns-border-radius;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// .ant-menu-inline .ant-menu-item-selected::after {
|
||||||
|
// content: '';
|
||||||
|
// position: absolute;
|
||||||
|
// top: 50%;
|
||||||
|
// right: -20px;
|
||||||
|
// transform: translateY(-50%);
|
||||||
|
// width: 3px !important;
|
||||||
|
// border-radius: 2px;
|
||||||
|
// background-color: red;
|
||||||
|
// height: 30px;
|
||||||
|
// z-index: 2;
|
||||||
|
// border: none;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.ant-menu-title-content {
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.nsHeader_action) {
|
||||||
|
.action {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
letter-spacing: 0px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: rgba(51, 51, 51, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
:deep(.ant-spin-nested-loading) {
|
||||||
|
min-height: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-spin-container) {
|
||||||
|
min-height: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
31
hx-ai-intelligent/src/api/IlluminationInfo.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
const prefix = '/carbon-smart/api';
|
||||||
|
// 照明系统及相关接口
|
||||||
|
export enum lightingManage {
|
||||||
|
// 主页 ========================================================
|
||||||
|
|
||||||
|
// 获得分区与线路
|
||||||
|
getTree = prefix + '/illuminationCtrl/getCtrlPanelTree',
|
||||||
|
// 修改线路的可用/禁用状态
|
||||||
|
setDisable = '/carbon-smart/api/illuminationCtrl/changePanelStatus',
|
||||||
|
// 获得设备 - 小灯泡
|
||||||
|
getBulbs = prefix + '/illuminationCtrl/getDeviceState',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 控制面板 =======================================
|
||||||
|
|
||||||
|
// 获取当前修改的内容对比数据
|
||||||
|
getChangeList = prefix + '/illuminationCtrl/getSceneChangeInfo',
|
||||||
|
// 提交当前修改
|
||||||
|
submitChangeList = prefix + '/illuminationCtrl/changeToSceneMode',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 计划列表 =======================================
|
||||||
|
|
||||||
|
// 右侧表格修改数据提交
|
||||||
|
submitTableData = prefix + '/illuminationCtrl/refreshPlanStatus',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 日志 ===========================================
|
||||||
|
|
||||||
|
// 获取日志
|
||||||
|
getLog = prefix + '/illuminationInfo/pageAbleLog',
|
||||||
|
// 获取日志详情
|
||||||
|
getLogDetail = prefix + '/illuminationInfo/fullLog',
|
||||||
|
}
|
||||||
29
hx-ai-intelligent/src/api/airConditionControlSystem.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
const prefix = '/carbon-smart/api';
|
||||||
|
// 空调系统及相关接口
|
||||||
|
export enum airConditionControl {
|
||||||
|
// 主页 ======================================================
|
||||||
|
|
||||||
|
// 主页分区结构
|
||||||
|
getTree = prefix + '/airConditioningCtrl/getCtrlPanelTree',
|
||||||
|
// 主页小灯泡
|
||||||
|
getDeviceList = prefix + '/airConditioningCtrl/getDeviceState',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 控制面板 =======================================
|
||||||
|
|
||||||
|
// 获得修改的比对列表
|
||||||
|
getChangeList = prefix + '/airConditioningCtrl/getSceneChangeInfo',
|
||||||
|
// 提交修改结果
|
||||||
|
submitChangeList = prefix + '/airConditioningCtrl/changeToSceneMode',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 计划列表 =======================================
|
||||||
|
|
||||||
|
// 右侧表格修改数据提交
|
||||||
|
submitTableData = prefix + '/airConditioningCtrl/refreshPlanStatus',
|
||||||
|
|
||||||
|
// 主页 > 抽屉 > 日志 ===========================================
|
||||||
|
|
||||||
|
// 获取日志
|
||||||
|
getLog = prefix + '/airConditioningInfo/pageAbleLog',
|
||||||
|
// 获取日志详情
|
||||||
|
getLogDetail = prefix + '/airConditioningInfo/fullLog',
|
||||||
|
}
|
||||||
7
hx-ai-intelligent/src/api/airConditioningSystem.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum airConditioningSystemApi {
|
||||||
|
getVentHostCtrlList = `${BASE_URL}/api/ventHostCtrl/getDeviceState`, // 查询新风主机最新状态
|
||||||
|
getAcBoxCtrlList = `${BASE_URL}/api/acBoxCtrl/getDeviceState`, // 查询空调箱最新状态
|
||||||
|
getTempSysCtrlList = `${BASE_URL}/api/tempSysCtrl/getFloorHeatingState`, // 查询地暖最新状态
|
||||||
|
}
|
||||||
10
hx-ai-intelligent/src/api/alarmManagement/alarmOverview.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { BASE_URL } from '../index';
|
||||||
|
|
||||||
|
export enum alarmOverviewApi {
|
||||||
|
getAlarmEquipment = `${BASE_URL}/api/AlarmOverview/alarmEquipment`, //设备告警 数量
|
||||||
|
getAlarmEnergyConsumption = `${BASE_URL}/api/AlarmOverview/alarmEnergyConsumption`, //能碳告警 数量
|
||||||
|
getAlarmGateway = `${BASE_URL}/api/AlarmOverview/alarmGateway`, //网关告警 数量
|
||||||
|
getPriority = `${BASE_URL}/api/AlarmOverview/priority`, //优先级 数量
|
||||||
|
getProcessProgress = `${BASE_URL}/api/AlarmOverview/processProgress`, //进度 数量
|
||||||
|
getAlarmTrend = `${BASE_URL}/api/AlarmOverview/alarmTrend`, //30天告警 数量
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { BASE_URL } from '../../index';
|
||||||
|
|
||||||
|
export enum deviceAlarms {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmEquipment/selectAlarmEquipment`, //设备告警分页
|
||||||
|
addOrUpNewData = `${BASE_URL}/api/AlarmEquipment/creatOrUpdate`, //设备告警添加 修改
|
||||||
|
del = `${BASE_URL}/api/AlarmEquipment/delete`, //设备告警删除
|
||||||
|
configGetTableList = `${BASE_URL}/api/AlarmEquipmentRule/selectAlarmEquipmentRule`, //配置设备告警分页
|
||||||
|
configAddOrUpNewData = `${BASE_URL}/api/AlarmEquipmentRule/creatOrUpdate`, //配置设备告警添加 修改
|
||||||
|
configFindById = `${BASE_URL}/api/AlarmEquipmentRule/findById`, //配置设备告警 查询详情
|
||||||
|
configDel = `${BASE_URL}/api/AlarmEquipmentRule/delete`, //配置设备告警删除
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { BASE_URL } from '../../index';
|
||||||
|
|
||||||
|
export enum energyAlarms {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption`, //能耗告警分页
|
||||||
|
addOrUpNewData = `${BASE_URL}/api/AlarmEnergyConsumption/creatOrUpdate`, //能耗告警添加 修改
|
||||||
|
del = `${BASE_URL}/api/AlarmEnergyConsumption/delete`, //能耗删除
|
||||||
|
configGetTableList = `${BASE_URL}/api/AlarmEnergyConsumptionRule/selectAlarmEnergyConsumptionRule`, //配置设备告警分页
|
||||||
|
configAddOrUpNewData = `${BASE_URL}/api/AlarmEnergyConsumptionRule/creatOrUpdate`, //配置设备告警添加 修改
|
||||||
|
configFindById = `${BASE_URL}/api/AlarmEnergyConsumptionRule/findById`, //配置设备告警 查询详情
|
||||||
|
configDel = `${BASE_URL}/api/AlarmEnergyConsumptionRule/delete`, //配置设备告警删除
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { BASE_URL } from '../../index';
|
||||||
|
|
||||||
|
export enum notificationManagementApi {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmContactInformation/selectAlarmContactInformation`, //通知管理分页
|
||||||
|
upData = `${BASE_URL}/api/AlarmContactInformation/update`, //通知管理 修改
|
||||||
|
findById = `${BASE_URL}/api/AlarmContactInformation/findById`, //通知管理 查询详情
|
||||||
|
}
|
||||||
9
hx-ai-intelligent/src/api/alarmManagement/energyAlarm.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { BASE_URL } from '../index';
|
||||||
|
|
||||||
|
export enum energyAlarmApi {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmEnergyConsumptionLog/selectAlarmEnergyConsumptionLog`, //能碳告警 列表
|
||||||
|
getCodeList = `${BASE_URL}/api/AlarmEnergyConsumptionLog/selectErrorCodeList `, //能碳告警 列表
|
||||||
|
getSelectAlarmEnergyConsumptionLogStatusProcess = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/selectAlarmEnergyConsumptionLogStatusProcess`, //能碳告警 状态 没有创建工单log接口
|
||||||
|
noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEnergyConsumptionLogStatusProcess/creatOrUpdate`, //能碳告警 状态 没有创建工单 添加 修改状态log
|
||||||
|
getEnergyGraph = `${BASE_URL}/energy/trigger/getEnergyGraph`, //能碳告警 状态 echarts图
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { BASE_URL } from '../index';
|
||||||
|
|
||||||
|
export enum equipmentAlarmApi {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmEquipmentLog/selectAlarmEquipmentLog`, //设备告警 列表
|
||||||
|
getCodeList = `${BASE_URL}/api/AlarmEquipmentLog/selectErrorCodeList`, //设备告警 列表
|
||||||
|
getSelectAlarmEquipmentLogStatusProcess = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess`, //设备告警 状态 没有创建工单log接口
|
||||||
|
noCreatOrUpdateLog = `${BASE_URL}/api/AlarmEquipmentLogStatusProcess/creatOrUpdate`, //设备告警 状态 没有创建工单 添加 修改状态log
|
||||||
|
getDeviceGraph = `${BASE_URL}/equipment/trigger/getDeviceGraph`, //设备告警 echats图
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { BASE_URL } from '../index';
|
||||||
|
export enum gatewayAlarmApi {
|
||||||
|
getTableList = `${BASE_URL}/api/AlarmGatewayLog/selectAlarmGatewayLog`, //网关告警 列表
|
||||||
|
}
|
||||||
113
hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
// 碳排因子库接口
|
||||||
|
export enum carbonEmissionFactorLibrary {
|
||||||
|
getTableList = '/carbon-smart/api/carbon/emission/factor/queryCarbonFactorPage',
|
||||||
|
creatOrUpdate = '/carbon-smart/api/carbon/emission/factor/creatOrUpdate',
|
||||||
|
del = '/carbon-smart/api/carbon/emission/factor/del',
|
||||||
|
getEmissionProcess = '/carbon-smart/api/carbon/emission/factor/getEmissionProcess',
|
||||||
|
findById = '/carbon-smart/api/carbon/emission/factor/findById',
|
||||||
|
getCarbonFactorTree = '/carbon-smart/api/carbon/emission/type/getCarbonFactorTree',
|
||||||
|
creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate',
|
||||||
|
delTreeNode = '/carbon-smart/api/carbon/emission/type/del',
|
||||||
|
move = '/carbon-smart/api/carbon/emission/type/move',
|
||||||
|
import = '/carbon-smart/api/carbon/emission/factor/import',
|
||||||
|
export = '/carbon-smart/api/carbon/emission/factor/export',
|
||||||
|
gasAndDatabase = '/carbon-smart/api/carbon/emission/factor/gasAndDatabase',
|
||||||
|
checkDel = '/carbon-smart/api/carbon/emission/factor/checkDel',
|
||||||
|
// 单位管理
|
||||||
|
dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement',
|
||||||
|
findOutermost = '/carbon-smart/client/dict/findOutermost',
|
||||||
|
createDictionary = '/carbon-smart/client/dict/createDictionary',
|
||||||
|
updateDictionary = '/carbon-smart/client/dict/updateDictionary',
|
||||||
|
delDictionary = '/carbon-smart/client/dict/delDictionary',
|
||||||
|
}
|
||||||
|
// 碳排管理-能耗统计接口
|
||||||
|
export enum energyConsumption {
|
||||||
|
getDicList = '/carbon-smart/client/dict/list',
|
||||||
|
pageList = '/carbon-smart/api/carbon/stats/pageList',
|
||||||
|
findById = '/carbon-smart/api/carbon/stats/findById',
|
||||||
|
creat = '/carbon-smart/api/carbon/stats/creat',
|
||||||
|
update = '/carbon-smart/api/carbon/stats/update',
|
||||||
|
del = '/carbon-smart/api/carbon/stats/del',
|
||||||
|
voucherDownloadList = '/carbon-smart/api/carbon/stats/voucherDownloadList',
|
||||||
|
energyAcquisition = '/carbon-smart/api/carbon/stats/energyAcquisition',
|
||||||
|
import = '/carbon-smart/api/carbon/stats/import',
|
||||||
|
export = '/carbon-smart/api/carbon/stats/export',
|
||||||
|
}
|
||||||
|
// 碳排管理-碳排速算接口
|
||||||
|
export enum quickCalculation {
|
||||||
|
carbonQuickTree = '/carbon-smart/api/carbon/energy/correlation/carbonQuickTree',
|
||||||
|
queryCarbonEmissionPage = '/carbon-smart/api/carbon/energy/correlation/queryCarbonEmissionPage',
|
||||||
|
creat = '/carbon-smart/api/carbon/energy/correlation/creat',
|
||||||
|
update = '/carbon-smart/api/carbon/energy/correlation/update',
|
||||||
|
del = '/carbon-smart/api/carbon/energy/correlation/del',
|
||||||
|
}
|
||||||
|
// 碳排管理-碳排统计接口
|
||||||
|
export enum carbonEmission {
|
||||||
|
carbonEmissionStatistics = '/carbon-smart/api/carbon/energy/correlation/carbonEmissionStatistics',
|
||||||
|
}
|
||||||
|
// 碳盘查接口
|
||||||
|
export enum carbonInventoryCheck {
|
||||||
|
carbonInventoryList = '/carbon-smart/api/carbon/report/carbonInventoryList',
|
||||||
|
createOrUpdate = '/carbon-smart/api/carbon/report/createOrUpdate',
|
||||||
|
findById = '/carbon-smart/api/carbon/report/findById',
|
||||||
|
delete = '/carbon-smart/api/carbon/report/delete',
|
||||||
|
downloadZip = '/carbon-smart/api/carbon/report/downloadZip',
|
||||||
|
// 填报页面接口
|
||||||
|
// 最左侧碳盘查报告树
|
||||||
|
getCategoryTree = '/carbon-smart/api/carbon/inventory/contact/getCategoryTree',
|
||||||
|
updateCategoryTree = '/carbon-smart/api/carbon/inventory/contact/update',
|
||||||
|
// 排放源中左侧树
|
||||||
|
getInventoryTree = '/carbon-smart/api/carbon/inventory/getInventoryTree',
|
||||||
|
create = '/carbon-smart/api/carbon/inventory/create',
|
||||||
|
update = '/carbon-smart/api/carbon/inventory/update',
|
||||||
|
del = '/carbon-smart/api/carbon/inventory/del',
|
||||||
|
// 获取排放源表格数据
|
||||||
|
findUnitById = '/carbon-smart/api/carbon/inventory/findById',
|
||||||
|
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
|
||||||
|
updateTable = '/carbon-smart/api/carbon/inventory/details/update',
|
||||||
|
voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList',
|
||||||
|
nodeCancellationConsumption = '/carbon-smart/api/carbon/inventory/details/nodeCancellationConsumption',
|
||||||
|
// 排放统计接口
|
||||||
|
emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic',
|
||||||
|
// 碳排流向
|
||||||
|
carbonFlowDirection = '/carbon-smart/api/carbon/inventory/carbonFlowDirection',
|
||||||
|
}
|
||||||
|
// 碳资产
|
||||||
|
export enum carbonAssets {
|
||||||
|
// 全部
|
||||||
|
carbonAssets = '/carbon-smart/api/carbon/trade/details/carbonAssets',
|
||||||
|
// 详情
|
||||||
|
carbonDetailsList = '/carbon-smart/api/carbon/trade/details/carbonDetailsList',
|
||||||
|
createOrUpdate = '/carbon-smart/api/carbon/trade/details/createOrUpdate',
|
||||||
|
delete = '/carbon-smart/api/carbon/trade/details/delete',
|
||||||
|
quotaStatistics = '/carbon-smart/api/carbon/trade/details/quotaStatistics',
|
||||||
|
import = '/carbon-smart/api/carbon/trade/details/import',
|
||||||
|
export = '/carbon-smart/api/carbon/trade/details/export',
|
||||||
|
}
|
||||||
|
// 上传图片接口
|
||||||
|
export enum uploadPic {
|
||||||
|
uploadfiles = '/carbon-smart/api/common/file/uploadfiles',
|
||||||
|
select = '/carbon-smart/api/common/file/select',
|
||||||
|
uploadfile = '/carbon-smart/api/common/file/uploadfile',
|
||||||
|
download = '/carbon-smart/api/common/file/download',
|
||||||
|
downloadZip = '/carbon-smart/api/common/file/downloadZip',
|
||||||
|
}
|
||||||
|
// 碳规划
|
||||||
|
export enum carbonPlanning {
|
||||||
|
// 全部
|
||||||
|
whole = '/carbon-smart/api/carbon/planning/whole',
|
||||||
|
// 详情
|
||||||
|
searchListByYear = '/carbon-smart/api/carbon/planning/searchListByYear',
|
||||||
|
searchListByMonth = '/carbon-smart/api/carbon/planning/searchListByMonth',
|
||||||
|
yearAndMonthAchievement = '/carbon-smart/api/carbon/planning/yearAndMonthAchievement',
|
||||||
|
annualElectricityConsumption = '/carbon-smart/api/carbon/planning/annualElectricityConsumption',
|
||||||
|
electricityUsageBackThen = '/carbon-smart/api/carbon/planning/electricityUsageBackThen',
|
||||||
|
detailedStatisticalDataTable = '/carbon-smart/api/carbon/planning/detailedStatisticalDataTable',
|
||||||
|
detailedStatisticalDataChart = '/carbon-smart/api/carbon/planning/detailedStatisticalDataChart',
|
||||||
|
batchOrUpdate = '/carbon-smart/api/carbon/planning/batchOrUpdate',
|
||||||
|
addNodes = '/carbon-smart/api/carbon/planning/addNodes',
|
||||||
|
benchmarkSetting = '/carbon-smart/api/carbon/planning/benchmarkSetting',
|
||||||
|
monthBenchmarkSetting = '/carbon-smart/api/carbon/planning/monthBenchmarkSetting',
|
||||||
|
benchmarkSubmit = '/carbon-smart/api/carbon/planning/benchmarkSubmit',
|
||||||
|
autoObtained = '/carbon-smart/api/carbon/planning/autoObtained',
|
||||||
|
}
|
||||||
10
hx-ai-intelligent/src/api/coldAndHeatSources.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum coldAndHeatSourcesApi {
|
||||||
|
getUserWaterPumpState = `${BASE_URL}/api/tempSysCtrl/getUserWaterPumpState`, // 用户水泵查询最新状态
|
||||||
|
getLandWaterPumpState = `${BASE_URL}/api/tempSysCtrl/getLandWaterPumpState`, // 地源水泵查询最新状态
|
||||||
|
getLandHeatPumpState = `${BASE_URL}/api/tempSysCtrl/getLandHeatPumpState`, //螺旋式地源热泵 - 查询最新状态
|
||||||
|
getEnergyTankState = `${BASE_URL}/api/tempSysCtrl/getEnergyTankState`, //冷热水双蓄储能罐 - 查询最新状态
|
||||||
|
getCoolPumpState = `${BASE_URL}/api/tempSysCtrl/getCoolPumpState`, //释冷泵 - 查询最新状态
|
||||||
|
getAirHeatPumpState = `${BASE_URL}/api/tempSysCtrl/getAirHeatPumpState`, //空气源热泵 - 查询最新状态
|
||||||
|
}
|
||||||
39
hx-ai-intelligent/src/api/deviceManage.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
export enum device {
|
||||||
|
queryDeviceTree = `${BASE_URL}/deviceInfo/queryDeviceTree`, // 左侧树
|
||||||
|
queryDevicePage = `${BASE_URL}/deviceInfo/queryDevicePage`, // 列表
|
||||||
|
dropArea = `${BASE_URL}/deviceInfo/dropArea`, // 查询下拉区域
|
||||||
|
queryDevicePoint = `${BASE_URL}/deviceInfo/queryDevicePoint`, // 获取设备点位
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum group {
|
||||||
|
queryDeviceGroupTree = `${BASE_URL}/deviceGroup/queryDeviceGroupTree`, // 左侧树
|
||||||
|
creatOrUpdate = `${BASE_URL}/deviceGroup/creatOrUpdate`, // 左侧树节点新增编辑
|
||||||
|
del = `${BASE_URL}/deviceGroup/del`,
|
||||||
|
move = `${BASE_URL}/deviceGroup/move`,
|
||||||
|
queryEditGroup = `${BASE_URL}/deviceGroup/queryEditGroup`, // 分组树
|
||||||
|
queryGroupPage = `${BASE_URL}/deviceGroup/queryGroupPage`, // 分组列表
|
||||||
|
saveGroupList = `${BASE_URL}/deviceGroup/saveGroupList`, // 分组保存
|
||||||
|
delGroupList = `${BASE_URL}/deviceGroup/delGroupList`, // 分组删除
|
||||||
|
queryGroupInfoPage = `${BASE_URL}/deviceGroup/queryGroupInfoPage`, // 计算列表
|
||||||
|
queryEditCompute = `${BASE_URL}/deviceGroup/queryEditCompute`, // 计算树
|
||||||
|
saveComputeList = `${BASE_URL}/deviceGroup/saveComputeList`, // 计算保存
|
||||||
|
delComputeList = `${BASE_URL}/deviceGroup/delComputeList`, // 计算删除
|
||||||
|
queryComputeGroup = `${BASE_URL}/deviceGroup/queryComputeGroup`, // 计算分组列表
|
||||||
|
saveComputeGroup = `${BASE_URL}/deviceGroup/saveComputeGroup`, // 计算分组新增
|
||||||
|
saveComputeGroupInfo = `${BASE_URL}/deviceGroup/saveComputeGroupInfo`, // 批量分组
|
||||||
|
delComputeGroup = `${BASE_URL}/deviceGroup/delComputeGroup`, // 分组删除
|
||||||
|
computeGroupNum = `${BASE_URL}/deviceGroup/computeGroupNum`, // 分组删除
|
||||||
|
formula = `${BASE_URL}/deviceGroup/formula`, // 编辑公式
|
||||||
|
queryFormula = `${BASE_URL}/deviceGroup/queryFormula`, // 公式查询
|
||||||
|
dropGroupFilter = `${BASE_URL}/deviceGroup/dropGroupFilter`, // 分组列表查询
|
||||||
|
dropGroupInfoFilter = `${BASE_URL}/deviceGroup/dropGroupInfoFilter`, // 计算列表查询
|
||||||
|
queryDeviceToEnergy = `${BASE_URL}/deviceGroup/queryDeviceToEnergy`, // 能耗监测用查询设备(能耗监测设备树)
|
||||||
|
|
||||||
|
importGroup = `${BASE_URL}/deviceGroup/importGroup`, // 批量导入计算节点
|
||||||
|
|
||||||
|
getCarbonGroupList = `${BASE_URL}/deviceGroup/carbonEmissions/getGroupList`, // 分组管理-碳排放-分组查询设备
|
||||||
|
deleteCarbonDevice = `${BASE_URL}/deviceGroup/carbonEmissions/deleteDevice`, // 分组管理-碳排放-删除设备
|
||||||
|
addCarbonDevice = `${BASE_URL}/deviceGroup/carbonEmissions/addDevice`, // 分组管理-碳排放-添加设备
|
||||||
|
updateCarbonFactor = `${BASE_URL}/deviceGroup/carbonEmissions/updateFactor`, // 分组管理-碳排放-设置因子
|
||||||
|
}
|
||||||
6
hx-ai-intelligent/src/api/dict.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export enum dict {
|
||||||
|
dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement',
|
||||||
|
updateDictionary = '/carbon-smart/client/dict/updateDictionary',
|
||||||
|
createDictionary = '/carbon-smart/client/dict/createDictionary',
|
||||||
|
delDictionary = '/carbon-smart/client/dict/delDictionary',
|
||||||
|
}
|
||||||
6
hx-ai-intelligent/src/api/electricDoor.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum electricDoorApi {
|
||||||
|
getDeviceState = `${BASE_URL}/api/eleDoorCtrl/getDeviceState`, // 查询设备最新状态
|
||||||
|
getDeviceRecordList = `${BASE_URL}/api/eleDoorCtrl/getDeviceRecordList`, // 查询设备日志列表
|
||||||
|
}
|
||||||
72
hx-ai-intelligent/src/api/index.ts
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import { get } from 'lodash-es';
|
||||||
|
import { http } from '/nerv-lib/util/http';
|
||||||
|
|
||||||
|
/***
|
||||||
|
*配置接口 格式 module:Array<resource>
|
||||||
|
*/
|
||||||
|
export const apiModule = {
|
||||||
|
parking: ['User', 'CurrentUser', 'Organizational'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BASE_URL = '/carbon-smart';
|
||||||
|
|
||||||
|
interface dictHttpConfig {
|
||||||
|
api?: string;
|
||||||
|
keyField?: string;
|
||||||
|
params: object;
|
||||||
|
transform?: Function;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取字典数据(首次获取,后续读缓存)
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const dict = async ({
|
||||||
|
api = `${BASE_URL}/client/dict/listByKey`,
|
||||||
|
params = {},
|
||||||
|
keyField = 'dicKey',
|
||||||
|
transform = (res: any) => res,
|
||||||
|
}: dictHttpConfig) => {
|
||||||
|
const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object;
|
||||||
|
const key = get(params, keyField) as keyof typeof dictMap;
|
||||||
|
|
||||||
|
if (!dictMap.hasOwnProperty(key)) {
|
||||||
|
const res = await http.post(api, params);
|
||||||
|
const options = get(transform(res), `data.${key}`);
|
||||||
|
dictMap[key] = options;
|
||||||
|
sessionStorage.setItem('dictMap', JSON.stringify(dictMap));
|
||||||
|
}
|
||||||
|
return Promise.resolve({ data: { data: get(dictMap, key) } });
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有枚举(参数为数组,可以不传参)
|
||||||
|
*/
|
||||||
|
export const getAllEnum = async ({
|
||||||
|
api = `${BASE_URL}/operation/enum/getAllEnum`,
|
||||||
|
params = {},
|
||||||
|
}: dictHttpConfig) => {
|
||||||
|
const res = await http.post(api, params);
|
||||||
|
return Promise.resolve(res);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单个枚举(需传参,参数 enumType)
|
||||||
|
*/
|
||||||
|
export const getEnum = async ({
|
||||||
|
api = `${BASE_URL}/operation/enum/getEnum`,
|
||||||
|
params = {},
|
||||||
|
}: dictHttpConfig) => {
|
||||||
|
const res = await http.get(api, params);
|
||||||
|
return Promise.resolve(res);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* 获取谈规划单位(需传参,参数 enumType)
|
||||||
|
*/
|
||||||
|
export const getEnumEnergy = async ({
|
||||||
|
api = `${BASE_URL}/operation/enum/getEnumEnergy`,
|
||||||
|
params = {},
|
||||||
|
}: dictHttpConfig) => {
|
||||||
|
const res = await http.get(api, params);
|
||||||
|
return Promise.resolve(res);
|
||||||
|
};
|
||||||
6
hx-ai-intelligent/src/api/liftSystem.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum liftSystemApi {
|
||||||
|
getDeviceState = `${BASE_URL}/api/elevatorCtrl/getDeviceState`, // 查询设备最新状态
|
||||||
|
getDeviceRecordList = `${BASE_URL}/api/elevatorCtrl/getDeviceRecordList`, // 查询设备日志列表
|
||||||
|
}
|
||||||
4
hx-ai-intelligent/src/api/menuSystem.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
export enum menuS {
|
||||||
|
queryMenuPage = `${BASE_URL}/deviceInfo/queryDevicePage`, // 菜单列表
|
||||||
|
}
|
||||||
28
hx-ai-intelligent/src/api/monitor.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
// 设备监测
|
||||||
|
export enum deviceMonitor {
|
||||||
|
getDeviceGraph = '/carbon-smart/api/monitor/getDeviceGraph',
|
||||||
|
getDevicePointToMonitor = '/carbon-smart/api/monitor/getDevicePointToMonitor',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能耗监测
|
||||||
|
export enum energyMonitor {
|
||||||
|
getDeviceOrNodeEnergyGraph = '/carbon-smart/api/monitor/getDeviceOrNodeEnergyGraph',
|
||||||
|
getDeviceOrNodeEnergyAnalyse = '/carbon-smart/api/monitor/getDeviceOrNodeEnergyAnalyse',
|
||||||
|
}
|
||||||
|
|
||||||
|
// 环境监测
|
||||||
|
export enum environmentMonitor {
|
||||||
|
getDeviceStatus = '/carbon-smart/api/monitor/getDeviceStatus', //环境监测-获取设备状态
|
||||||
|
getDeviceAverages = '/carbon-smart/api/monitor/getDeviceAverages', //环境监测-获取设备平均值
|
||||||
|
queryDeviceArea = '/carbon-smart/deviceInfo/queryDeviceArea', //查询区域位置组成树结构
|
||||||
|
getDeviceHotMap = '/carbon-smart/api/monitor/getDeviceHotMap', //环境监测-获取环境热力图
|
||||||
|
|
||||||
|
getDeviceHistory = '/carbon-smart/api/monitor/getDeviceHistory', //环境监测-历史数据-获取环境设备历史数据
|
||||||
|
|
||||||
|
getDeviceAveragesByRate = '/carbon-smart/api/monitor/getDeviceAveragesByRate', //环境监测-平均数据-获取环境设备平均数据
|
||||||
|
|
||||||
|
queryDeviceInfoListPage = '/carbon-smart/api/monitor/queryDeviceInfoListPage', //环境监测-根据条件查询设备数据(分页) 配置监测点位
|
||||||
|
|
||||||
|
startUpDevice = '/carbon-smart/api/monitor/startUpDevice', // 环境监测-配置启动设备
|
||||||
|
stopDevice = '/carbon-smart/api/monitor/stopDevice', // 环境监测-停用设备
|
||||||
|
}
|
||||||
37
hx-ai-intelligent/src/api/origanizemanage.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum permission {
|
||||||
|
add = `${BASE_URL}/admin/permission/save`,
|
||||||
|
queryOrgPermission = `${BASE_URL}/api/dept/queryOrgPermission`,
|
||||||
|
queryRolePermission = `${BASE_URL}/api/dept/queryRolePermission`,
|
||||||
|
queryFilterDeptPermission = `${BASE_URL}/api/dept/queryFilterDeptPermission`,
|
||||||
|
queryDeptPermission = `${BASE_URL}/api/dept/queryDeptPermission`,
|
||||||
|
queryDeptPermissionFilter = `${BASE_URL}/api/dept/queryDeptPermissionFilter`,
|
||||||
|
queryRolePermissionFilter = `${BASE_URL}/api/dept/queryRolePermissionFilter`,
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum origanizemanage {
|
||||||
|
userList = '/carbon-smart/api/user/queryUserByPage',
|
||||||
|
addUser = '/carbon-smart/api/user/save',
|
||||||
|
editUser = '/carbon-smart/api/user/edit',
|
||||||
|
frozen = '/carbon-smart/api/user/frozen',
|
||||||
|
resetPwd = '/carbon-smart/api/user/resetPwd',
|
||||||
|
del = '/carbon-smart/api/user/del',
|
||||||
|
batchDel = '/carbon-smart/api/user/batchDel',
|
||||||
|
queryOrgTree = '/carbon-smart/api/user/queryOrgTree',
|
||||||
|
queryDeptTree = '/carbon-smart/api/user/queryDeptTree',
|
||||||
|
queryUserPerList = '/carbon-smart/api/user/queryUserPerList',
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum department {
|
||||||
|
queryDeptTree = `${BASE_URL}/api/dept/queryDeptTree`,
|
||||||
|
deptSave = `${BASE_URL}/api/dept/save`,
|
||||||
|
deptEdit = `${BASE_URL}/api/dept/edit`,
|
||||||
|
deptDel = `${BASE_URL}/api/dept/del`,
|
||||||
|
addPermission = `${BASE_URL}/api/dept/addPermission`,
|
||||||
|
addRolePermission = `${BASE_URL}/api/dept/addRolePermission`,
|
||||||
|
delRole = `${BASE_URL}/api/dept/delRole`,
|
||||||
|
addRole = `${BASE_URL}/api/dept/addRole`,
|
||||||
|
editRole = `${BASE_URL}/api/dept/editRole`,
|
||||||
|
queryRoleTree = `${BASE_URL}/api/dept/queryRoleTree`,
|
||||||
|
}
|
||||||
15
hx-ai-intelligent/src/api/planManage.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
const prefix = '/carbon-smart/api';
|
||||||
|
// 照明系统及相关接口
|
||||||
|
export enum planManage {
|
||||||
|
/**
|
||||||
|
* @param deviceType 设备类型(1照明,2空调,3排风扇,4风幕机,5电动窗,6给排水)
|
||||||
|
*/
|
||||||
|
// 获得未激活的计划
|
||||||
|
getTransData = prefix + '/deviceCtrlPlan/getDeActivatedPlanList',
|
||||||
|
// 获得激活的计划
|
||||||
|
getTableData = prefix + '/deviceCtrlPlan/getActivatedPlanList',
|
||||||
|
// 提交计划状态修改
|
||||||
|
submitTransData = prefix + '/deviceCtrlPlan/activePlanByIdList',
|
||||||
|
// 用于确认当前是否有计划正在运行
|
||||||
|
getRunningPlan = prefix + '/deviceCtrlPlan/getRunningPlan',
|
||||||
|
}
|
||||||
9
hx-ai-intelligent/src/api/planToAdd.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { BASE_URL } from './index';
|
||||||
|
|
||||||
|
export enum planToAddApi {
|
||||||
|
getActivatedPlanTree = `${BASE_URL}/api/deviceCtrlPlan/getPlanLibTree`, //计划树
|
||||||
|
getActivatedPlanListByTree = `${BASE_URL}/api/deviceCtrlPlan/getPageAblePlanListByTree`, //计划列表
|
||||||
|
updPlan = `${BASE_URL}/api/deviceCtrlPlan/updateCtrlPlan`, //修改计划
|
||||||
|
delPlan = `${BASE_URL}/api/deviceCtrlPlan/deleteCtrlPlanByIdList`, //修改计划
|
||||||
|
addPlan = `${BASE_URL}/api/deviceCtrlPlan/addCtrlPlan`, //添加计划
|
||||||
|
}
|
||||||
@@ -8,13 +8,10 @@ enum Api {
|
|||||||
USER_INFO = 'api/web/objs/CurrentUser', //获取用户信息
|
USER_INFO = 'api/web/objs/CurrentUser', //获取用户信息
|
||||||
USER_RESOURCE = '/api/community/objs/User/Resource', //获取用户资源
|
USER_RESOURCE = '/api/community/objs/User/Resource', //获取用户资源
|
||||||
}
|
}
|
||||||
export const userLogin = (data: RoomListModel) => http.post(Api.USER_LOGIN, data);
|
export const userLogin = (data) => http.post(Api.USER_LOGIN, data);
|
||||||
export const userInfo = () => http.get(Api.USER_INFO);
|
export const userInfo = () => http.get(Api.USER_INFO);
|
||||||
export const userResource = () => http.get(Api.USER_RESOURCE);
|
export const userResource = () => http.get(Api.USER_RESOURCE);
|
||||||
/**
|
/**
|
||||||
* @description 用户登录
|
* @description 用户登录
|
||||||
* @property `[fatherRegionUuid]` 父级区域唯一标识
|
* @property `[fatherRegionUuid]` 父级区域唯一标识
|
||||||
*/
|
*/
|
||||||
interface RoomListModel {
|
|
||||||
data: string;
|
|
||||||
}
|
|
||||||
54
hx-ai-intelligent/src/api/ventilatingSystem.ts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
// 前缀
|
||||||
|
const prefix = '/carbon-smart/api';
|
||||||
|
// 通风系统相关接口
|
||||||
|
export enum ventilating {
|
||||||
|
//传感器获取数据
|
||||||
|
getSensorData = prefix + '/sensorCtrl/getMultiFuncSensorState',
|
||||||
|
// 排风扇相关 =============================================
|
||||||
|
// 获得排风扇系统的树形结构
|
||||||
|
getTree1 = prefix + '/ventilatingFanCtrl/getCtrlPanelTree',
|
||||||
|
// 获得排风扇的 场景/禁用 修改数据
|
||||||
|
getChangeList1 = prefix + '/ventilatingFanCtrl/getSceneChangeInfo',
|
||||||
|
// 提交排风扇的修改内容
|
||||||
|
sendChangeList1 = prefix + '/ventilatingFanCtrl/changeToSceneMode',
|
||||||
|
// 获得排风扇的设备状态
|
||||||
|
getDevice1 = prefix + '/ventilatingFanCtrl/getDeviceState',
|
||||||
|
// 提交排风扇的修改内容
|
||||||
|
submitTableData1 = prefix + '/ventilatingFanCtrl/refreshPlanStatus',
|
||||||
|
// 排风扇日志
|
||||||
|
getLog1 = prefix + '/ventilatingFanInfo/pageAbleLog',
|
||||||
|
// 排风扇日志详情
|
||||||
|
getLogDetail1 = prefix + '/ventilatingFanInfo/fullLog',
|
||||||
|
|
||||||
|
// 风幕机相关 =============================================
|
||||||
|
// 获得风幕机的树形结构
|
||||||
|
getTree2 = prefix + '/airCurtainMachineCtrl/getCtrlPanelTree',
|
||||||
|
// 获得风幕机的 场景/禁用 修改数据
|
||||||
|
getChangeList2 = prefix + '/airCurtainMachineCtrl/getSceneChangeInfo',
|
||||||
|
// 提交风幕机的修改内容
|
||||||
|
sendChangeList2 = prefix + '/airCurtainMachineCtrl/changeToSceneMode',
|
||||||
|
// 获得风幕机的设备状态
|
||||||
|
getDevice2 = prefix + '/airCurtainMachineCtrl/getDeviceState',
|
||||||
|
// 提交风幕机的修改内容
|
||||||
|
submitTableData2 = prefix + '/airCurtainMachineCtrl/refreshPlanStatus',
|
||||||
|
// 风幕机日志
|
||||||
|
getLog2 = prefix + '/airCurtainMachineInfo/pageAbleLog',
|
||||||
|
// 风幕机日志详情
|
||||||
|
getLogDetail2 = prefix + '/airCurtainMachineInfo/fullLog',
|
||||||
|
|
||||||
|
// 电动窗相关 =============================================
|
||||||
|
// 获得电动窗的树形结构
|
||||||
|
getTree3 = prefix + '/eleOperatedWindowCtrl/getCtrlPanelTree',
|
||||||
|
// 获得电动窗的 场景/禁用 修改数据
|
||||||
|
getChangeList3 = prefix + '/eleOperatedWindowCtrl/getSceneChangeInfo',
|
||||||
|
// 提交电动窗的修改内容
|
||||||
|
sendChangeList3 = prefix + '/eleOperatedWindowCtrl/changeToSceneMode',
|
||||||
|
// 获得电动窗的设备状态
|
||||||
|
getDevice3 = prefix + '/eleOperatedWindowCtrl/getDeviceState',
|
||||||
|
// 提交电动窗的修改内容
|
||||||
|
submitTableData3 = prefix + '/eleOperatedWindowCtrl/refreshPlanStatus',
|
||||||
|
// 电动窗日志
|
||||||
|
getLog3 = prefix + '/eleOperatedWindowInfo/pageAbleLog',
|
||||||
|
// 电动窗日志详情
|
||||||
|
getLogDetail3 = prefix + '/eleOperatedWindowInfo/fullLog',
|
||||||
|
}
|
||||||
26
hx-ai-intelligent/src/api/waterSystem.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// 前缀
|
||||||
|
const prefix = '/carbon-smart/api';
|
||||||
|
// 通风系统相关接口
|
||||||
|
export enum waterSys {
|
||||||
|
// 首页 ====================================================
|
||||||
|
|
||||||
|
// 获得污水池状态
|
||||||
|
getPool1 = prefix + '/waterSysCtrl/getSewagePoolState',
|
||||||
|
// 获得阀门状态
|
||||||
|
getValve = prefix + '/waterSysCtrl/getValveState',
|
||||||
|
// 获得集水池状态
|
||||||
|
getPool2 = prefix + '/waterSysCtrl/getCollectPoolState',
|
||||||
|
// 获得水泵状态
|
||||||
|
getPump = prefix + '/waterSysCtrl/getPumpState',
|
||||||
|
// 提交场景模式修改
|
||||||
|
submitList = prefix + '/waterSysCtrl/changeToSceneMode',
|
||||||
|
|
||||||
|
// 计划 tab1 ===============================================
|
||||||
|
submitTableData = prefix + '/waterSysCtrl/refreshPlanStatus',
|
||||||
|
|
||||||
|
// 日志 tab2 ===============================================
|
||||||
|
// 获得设备日志
|
||||||
|
getLog = prefix + '/waterSysInfo/pageAbleLog',
|
||||||
|
// 获得日志详情
|
||||||
|
getLogDetail = prefix + '/waterSysInfo/fullLog',
|
||||||
|
}
|
||||||
6
hx-ai-intelligent/src/components/Drawer/index.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { withInstall } from '/@/utils';
|
||||||
|
import basicDrawer from './src/BasicDrawer.vue';
|
||||||
|
|
||||||
|
export const BasicDrawer = withInstall(basicDrawer);
|
||||||
|
export * from './src/typing';
|
||||||
|
export { useDrawer, useDrawerInner } from './src/useDrawer';
|
||||||
255
hx-ai-intelligent/src/components/Drawer/src/BasicDrawer.vue
Normal file
@@ -0,0 +1,255 @@
|
|||||||
|
<template>
|
||||||
|
<Drawer :class="prefixCls" @close="onClose" v-bind="getBindValues">
|
||||||
|
<template #title v-if="!$slots.title">
|
||||||
|
<DrawerHeader :title="getMergeProps.title" :isDetail="isDetail" :showDetailBack="showDetailBack" @close="onClose">
|
||||||
|
<template #titleToolbar>
|
||||||
|
<slot name="titleToolbar"></slot>
|
||||||
|
</template>
|
||||||
|
</DrawerHeader>
|
||||||
|
</template>
|
||||||
|
<template v-else #title>
|
||||||
|
<slot name="title"></slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<ScrollContainer :style="getScrollContentStyle" v-loading="getLoading" :loading-tip="loadingText || t('common.loadingText')">
|
||||||
|
<slot></slot>
|
||||||
|
</ScrollContainer>
|
||||||
|
<DrawerFooter v-bind="getProps" @close="onClose" @ok="handleOk" :height="getFooterHeight">
|
||||||
|
<template #[item]="data" v-for="item in Object.keys($slots)">
|
||||||
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
|
</template>
|
||||||
|
</DrawerFooter>
|
||||||
|
</Drawer>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import type { DrawerInstance, DrawerProps } from './typing';
|
||||||
|
import type { CSSProperties } from 'vue';
|
||||||
|
import { defineComponent, ref, computed, watch, unref, nextTick, toRaw, getCurrentInstance } from 'vue';
|
||||||
|
import { Drawer } from 'ant-design-vue';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { isFunction, isNumber } from '/@/utils/is';
|
||||||
|
import { deepMerge } from '/@/utils';
|
||||||
|
import DrawerFooter from './components/DrawerFooter.vue';
|
||||||
|
import DrawerHeader from './components/DrawerHeader.vue';
|
||||||
|
import { ScrollContainer } from '/@/components/Container';
|
||||||
|
import { basicProps } from './props';
|
||||||
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: { Drawer, ScrollContainer, DrawerFooter, DrawerHeader },
|
||||||
|
inheritAttrs: false,
|
||||||
|
props: basicProps,
|
||||||
|
emits: ['visible-change', 'open-change', 'ok', 'close', 'register'],
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const visibleRef = ref(false);
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const propsRef = ref<Partial<Nullable<DrawerProps>>>(null);
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const { prefixVar, prefixCls } = useDesign('basic-drawer');
|
||||||
|
|
||||||
|
const drawerInstance: DrawerInstance = {
|
||||||
|
setDrawerProps: setDrawerProps,
|
||||||
|
emitVisible: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
const instance = getCurrentInstance();
|
||||||
|
|
||||||
|
instance && emit('register', drawerInstance, instance.uid);
|
||||||
|
|
||||||
|
const getMergeProps = computed((): DrawerProps => {
|
||||||
|
// update-begin--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(toRaw改成cloneDeep,否则props的变化不会触发computed)
|
||||||
|
return { ...deepMerge(cloneDeep(props), unref(propsRef)) };
|
||||||
|
// update-end--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(toRaw改成cloneDeep,否则props的变化不会触发computed)
|
||||||
|
});
|
||||||
|
|
||||||
|
const getProps = computed((): DrawerProps => {
|
||||||
|
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
const opt = {
|
||||||
|
placement: 'right',
|
||||||
|
...unref(attrs),
|
||||||
|
...unref(getMergeProps),
|
||||||
|
open: unref(visibleRef),
|
||||||
|
};
|
||||||
|
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
opt.title = undefined;
|
||||||
|
let { isDetail, width, wrapClassName, getContainer } = opt;
|
||||||
|
if (isDetail) {
|
||||||
|
if (!width) {
|
||||||
|
opt.width = '100%';
|
||||||
|
}
|
||||||
|
const detailCls = `${prefixCls}__detail`;
|
||||||
|
wrapClassName = opt['class'] ? opt['class'] : wrapClassName;
|
||||||
|
opt.class = wrapClassName ? `${wrapClassName} ${detailCls}` : detailCls;
|
||||||
|
|
||||||
|
if (!getContainer) {
|
||||||
|
// TODO type error?
|
||||||
|
opt.getContainer = `.${prefixVar}-layout-content` as any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('getProps:opt',opt);
|
||||||
|
return opt as DrawerProps;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getBindValues = computed((): DrawerProps => {
|
||||||
|
return {
|
||||||
|
...attrs,
|
||||||
|
...unref(getProps),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// Custom implementation of the bottom button,
|
||||||
|
const getFooterHeight = computed(() => {
|
||||||
|
const { footerHeight, showFooter } = unref(getProps);
|
||||||
|
if (showFooter && footerHeight) {
|
||||||
|
return isNumber(footerHeight) ? `${footerHeight}px` : `${footerHeight.replace('px', '')}px`;
|
||||||
|
}
|
||||||
|
return `0px`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getScrollContentStyle = computed((): CSSProperties => {
|
||||||
|
const footerHeight = unref(getFooterHeight);
|
||||||
|
return {
|
||||||
|
position: 'relative',
|
||||||
|
height: `calc(100% - ${footerHeight})`,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const getLoading = computed(() => {
|
||||||
|
return !!unref(getProps)?.loading;
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
if (newVal !== oldVal) visibleRef.value = newVal;
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.open,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
if (newVal !== oldVal) visibleRef.value = newVal;
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => visibleRef.value,
|
||||||
|
(visible) => {
|
||||||
|
nextTick(() => {
|
||||||
|
emit('visible-change', visible);
|
||||||
|
emit('open-change', visible);
|
||||||
|
instance && drawerInstance.emitVisible?.(visible, instance.uid);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Cancel event
|
||||||
|
async function onClose(e: Recordable) {
|
||||||
|
const { closeFunc } = unref(getProps);
|
||||||
|
emit('close', e);
|
||||||
|
if (closeFunc && isFunction(closeFunc)) {
|
||||||
|
const res = await closeFunc();
|
||||||
|
visibleRef.value = !res;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
visibleRef.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDrawerProps(props: Partial<DrawerProps>): void {
|
||||||
|
// Keep the last setDrawerProps
|
||||||
|
propsRef.value = deepMerge(unref(propsRef) || ({} as any), props);
|
||||||
|
|
||||||
|
if (Reflect.has(props, 'visible')) {
|
||||||
|
visibleRef.value = !!props.visible;
|
||||||
|
}
|
||||||
|
if (Reflect.has(props, 'open')) {
|
||||||
|
visibleRef.value = !!props.open;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleOk() {
|
||||||
|
emit('ok');
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
onClose,
|
||||||
|
t,
|
||||||
|
prefixCls,
|
||||||
|
getMergeProps: getMergeProps as any,
|
||||||
|
getScrollContentStyle,
|
||||||
|
getProps: getProps as any,
|
||||||
|
getLoading,
|
||||||
|
getBindValues,
|
||||||
|
getFooterHeight,
|
||||||
|
handleOk,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
@header-height: 60px;
|
||||||
|
@detail-header-height: 40px;
|
||||||
|
@prefix-cls: ~'@{namespace}-basic-drawer';
|
||||||
|
@prefix-cls-detail: ~'@{namespace}-basic-drawer__detail';
|
||||||
|
|
||||||
|
.@{prefix-cls} {
|
||||||
|
.ant-drawer-wrapper-body {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-close {
|
||||||
|
&:hover {
|
||||||
|
color: @error-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-body {
|
||||||
|
height: calc(100% - @header-height);
|
||||||
|
padding: 0;
|
||||||
|
background-color: @component-background;
|
||||||
|
|
||||||
|
.scrollbar__wrap {
|
||||||
|
padding: 16px !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .scrollbar > .scrollbar__bar.is-horizontal {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{prefix-cls-detail} {
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
.ant-drawer-header {
|
||||||
|
width: 100%;
|
||||||
|
height: @detail-header-height;
|
||||||
|
padding: 0;
|
||||||
|
border-top: 1px solid @border-color-base;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-title {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-close {
|
||||||
|
height: @detail-header-height;
|
||||||
|
line-height: @detail-header-height;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar__wrap {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-drawer-body {
|
||||||
|
height: calc(100% - @detail-header-height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div :class="prefixCls" :style="getStyle" v-if="showFooter || $slots.footer">
|
||||||
|
<template v-if="!$slots.footer">
|
||||||
|
<slot name="insertFooter"></slot>
|
||||||
|
<a-button v-bind="cancelButtonProps" @click="handleClose" class="mr-2" v-if="showCancelBtn">
|
||||||
|
{{ cancelText }}
|
||||||
|
</a-button>
|
||||||
|
<slot name="centerFooter"></slot>
|
||||||
|
<a-button :type="okType" @click="handleOk" v-bind="okButtonProps" class="mr-2" :loading="confirmLoading" v-if="showOkBtn">
|
||||||
|
{{ okText }}
|
||||||
|
</a-button>
|
||||||
|
<slot name="appendFooter"></slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<slot name="footer"></slot>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import type { CSSProperties } from 'vue';
|
||||||
|
import { defineComponent, computed } from 'vue';
|
||||||
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
|
||||||
|
import { footerProps } from '../props';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'BasicDrawerFooter',
|
||||||
|
props: {
|
||||||
|
...footerProps,
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
default: '60px',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ['ok', 'close'],
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const { prefixCls } = useDesign('basic-drawer-footer');
|
||||||
|
|
||||||
|
const getStyle = computed((): CSSProperties => {
|
||||||
|
const heightStr = `${props.height}`;
|
||||||
|
return {
|
||||||
|
height: heightStr,
|
||||||
|
lineHeight: heightStr,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleOk() {
|
||||||
|
emit('ok');
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClose() {
|
||||||
|
emit('close');
|
||||||
|
}
|
||||||
|
return { handleOk, prefixCls, handleClose, getStyle };
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
@prefix-cls: ~'@{namespace}-basic-drawer-footer';
|
||||||
|
@footer-height: 60px;
|
||||||
|
.@{prefix-cls} {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 12px 0 20px;
|
||||||
|
text-align: right;
|
||||||
|
background-color: @component-background;
|
||||||
|
border-top: 1px solid @border-color-base;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<template>
|
||||||
|
<BasicTitle v-if="!isDetail" :class="[prefixCls, 'is-drawer']">
|
||||||
|
<slot name="title"></slot>
|
||||||
|
{{ !$slots.title ? title : '' }}
|
||||||
|
</BasicTitle>
|
||||||
|
|
||||||
|
<div :class="[prefixCls, `${prefixCls}--detail`]" v-else>
|
||||||
|
<span :class="`${prefixCls}__twrap`">
|
||||||
|
<span @click="handleClose" v-if="showDetailBack">
|
||||||
|
<ArrowLeftOutlined :class="`${prefixCls}__back`" />
|
||||||
|
</span>
|
||||||
|
<span v-if="title">{{ title }}</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span :class="`${prefixCls}__toolbar`">
|
||||||
|
<slot name="titleToolbar"></slot>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import { BasicTitle } from '/@/components/Basic';
|
||||||
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
|
||||||
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'BasicDrawerHeader',
|
||||||
|
components: { BasicTitle, ArrowLeftOutlined },
|
||||||
|
props: {
|
||||||
|
isDetail: propTypes.bool,
|
||||||
|
showDetailBack: propTypes.bool,
|
||||||
|
title: propTypes.string,
|
||||||
|
},
|
||||||
|
emits: ['close'],
|
||||||
|
setup(_, { emit }) {
|
||||||
|
const { prefixCls } = useDesign('basic-drawer-header');
|
||||||
|
|
||||||
|
function handleClose() {
|
||||||
|
emit('close');
|
||||||
|
}
|
||||||
|
|
||||||
|
return { prefixCls, handleClose };
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
@prefix-cls: ~'@{namespace}-basic-drawer-header';
|
||||||
|
@footer-height: 60px;
|
||||||
|
.@{prefix-cls} {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
&__back {
|
||||||
|
padding: 0 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__twrap {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__toolbar {
|
||||||
|
padding-right: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
46
hx-ai-intelligent/src/components/Drawer/src/props.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import type { PropType } from 'vue';
|
||||||
|
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
export const footerProps = {
|
||||||
|
confirmLoading: { type: Boolean },
|
||||||
|
/**
|
||||||
|
* @description: Show close button
|
||||||
|
*/
|
||||||
|
showCancelBtn: { type: Boolean, default: true },
|
||||||
|
cancelButtonProps: Object as PropType<Recordable>,
|
||||||
|
cancelText: { type: String, default: t('common.cancelText') },
|
||||||
|
/**
|
||||||
|
* @description: Show confirmation button
|
||||||
|
*/
|
||||||
|
showOkBtn: { type: Boolean, default: true },
|
||||||
|
okButtonProps: Object as PropType<Recordable>,
|
||||||
|
okText: { type: String, default: t('common.okText') },
|
||||||
|
okType: { type: String, default: 'primary' },
|
||||||
|
showFooter: { type: Boolean },
|
||||||
|
footerHeight: {
|
||||||
|
type: [String, Number] as PropType<string | number>,
|
||||||
|
default: 60,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
export const basicProps = {
|
||||||
|
class: {type: [String, Object, Array]},
|
||||||
|
isDetail: { type: Boolean },
|
||||||
|
title: { type: String, default: '' },
|
||||||
|
loadingText: { type: String },
|
||||||
|
showDetailBack: { type: Boolean, default: true },
|
||||||
|
visible: { type: Boolean },
|
||||||
|
open: { type: Boolean },
|
||||||
|
loading: { type: Boolean },
|
||||||
|
maskClosable: { type: Boolean, default: true },
|
||||||
|
getContainer: {
|
||||||
|
type: [Object, String] as PropType<any>,
|
||||||
|
},
|
||||||
|
closeFunc: {
|
||||||
|
type: [Function, Object] as PropType<any>,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
destroyOnClose: { type: Boolean },
|
||||||
|
...footerProps,
|
||||||
|
};
|
||||||
199
hx-ai-intelligent/src/components/Drawer/src/typing.ts
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes';
|
||||||
|
import type { CSSProperties, VNodeChild, ComputedRef } from 'vue';
|
||||||
|
import type { ScrollContainerOptions } from '/@/components/Container/index';
|
||||||
|
|
||||||
|
export interface DrawerInstance {
|
||||||
|
setDrawerProps: (props: Partial<DrawerProps> | boolean) => void;
|
||||||
|
emitVisible?: (visible: boolean, uid: number) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ReturnMethods extends DrawerInstance {
|
||||||
|
openDrawer: <T = any>(visible?: boolean, data?: T, openOnSet?: boolean) => void;
|
||||||
|
closeDrawer: () => void;
|
||||||
|
getVisible?: ComputedRef<boolean>;
|
||||||
|
getOpen?: ComputedRef<boolean>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RegisterFn = (drawerInstance: DrawerInstance, uuid?: string) => void;
|
||||||
|
|
||||||
|
export interface ReturnInnerMethods extends DrawerInstance {
|
||||||
|
closeDrawer: () => void;
|
||||||
|
changeLoading: (loading: boolean) => void;
|
||||||
|
changeOkLoading: (loading: boolean) => void;
|
||||||
|
getVisible?: ComputedRef<boolean>;
|
||||||
|
getOpen?: ComputedRef<boolean>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UseDrawerReturnType = [RegisterFn, ReturnMethods];
|
||||||
|
|
||||||
|
export type UseDrawerInnerReturnType = [RegisterFn, ReturnInnerMethods];
|
||||||
|
|
||||||
|
export interface DrawerFooterProps {
|
||||||
|
showOkBtn: boolean;
|
||||||
|
showCancelBtn: boolean;
|
||||||
|
/**
|
||||||
|
* Text of the Cancel button
|
||||||
|
* @default 'cancel'
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
cancelText: string;
|
||||||
|
/**
|
||||||
|
* Text of the OK button
|
||||||
|
* @default 'OK'
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
okText: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Button type of the OK button
|
||||||
|
* @default 'primary'
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
okType: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
|
||||||
|
/**
|
||||||
|
* The ok button props, follow jsx rules
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
okButtonProps: { props: ButtonProps; on: {} };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The cancel button props, follow jsx rules
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
cancelButtonProps: { props: ButtonProps; on: {} };
|
||||||
|
/**
|
||||||
|
* Whether to apply loading visual effect for OK button or not
|
||||||
|
* @default false
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
confirmLoading: boolean;
|
||||||
|
|
||||||
|
showFooter: boolean;
|
||||||
|
footerHeight: string | number;
|
||||||
|
}
|
||||||
|
export interface DrawerProps extends DrawerFooterProps {
|
||||||
|
isDetail?: boolean;
|
||||||
|
loading?: boolean;
|
||||||
|
showDetailBack?: boolean;
|
||||||
|
visible?: boolean;
|
||||||
|
open?: boolean;
|
||||||
|
/**
|
||||||
|
* Built-in ScrollContainer component configuration
|
||||||
|
* @type ScrollContainerOptions
|
||||||
|
*/
|
||||||
|
scrollOptions?: ScrollContainerOptions;
|
||||||
|
closeFunc?: () => Promise<any>;
|
||||||
|
triggerWindowResize?: boolean;
|
||||||
|
/**
|
||||||
|
* Whether a close (x) button is visible on top right of the Drawer dialog or not.
|
||||||
|
* @default true
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
closable?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to unmount child components on closing drawer or not.
|
||||||
|
* @default false
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
destroyOnClose?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the mounted node for Drawer.
|
||||||
|
* @default 'body'
|
||||||
|
* @type any ( HTMLElement| () => HTMLElement | string)
|
||||||
|
*/
|
||||||
|
getContainer?: () => HTMLElement | string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show mask or not.
|
||||||
|
* @default true
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
mask?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clicking on the mask (area outside the Drawer) to close the Drawer or not.
|
||||||
|
* @default true
|
||||||
|
* @type boolean
|
||||||
|
*/
|
||||||
|
maskClosable?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Style for Drawer's mask element.
|
||||||
|
* @default {}
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
maskStyle?: CSSProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The title for Drawer.
|
||||||
|
* @type any (string | slot)
|
||||||
|
*/
|
||||||
|
title?: VNodeChild | JSX.Element;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The class name of the container of the Drawer dialog.
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
class?: string;
|
||||||
|
// 兼容老版本的写法(后续可能会删除,优先写class)
|
||||||
|
wrapClassName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Style of wrapper element which **contains mask** compare to `drawerStyle`
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
wrapStyle?: CSSProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Style of the popup layer element
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
drawerStyle?: CSSProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Style of floating layer, typically used for adjusting its position.
|
||||||
|
* @type object
|
||||||
|
*/
|
||||||
|
bodyStyle?: CSSProperties;
|
||||||
|
headerStyle?: CSSProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Width of the Drawer dialog.
|
||||||
|
* @default 256
|
||||||
|
* @type string | number
|
||||||
|
*/
|
||||||
|
width?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* placement is top or bottom, height of the Drawer dialog.
|
||||||
|
* @type string | number
|
||||||
|
*/
|
||||||
|
height?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The z-index of the Drawer.
|
||||||
|
* @default 1000
|
||||||
|
* @type number
|
||||||
|
*/
|
||||||
|
zIndex?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The placement of the Drawer.
|
||||||
|
* @default 'right'
|
||||||
|
* @type string
|
||||||
|
*/
|
||||||
|
placement?: 'top' | 'right' | 'bottom' | 'left';
|
||||||
|
afterVisibleChange?: (visible?: boolean) => void;
|
||||||
|
keyboard?: boolean;
|
||||||
|
/**
|
||||||
|
* Specify a callback that will be called when a user clicks mask, close button or Cancel button.
|
||||||
|
*/
|
||||||
|
onClose?: (e?: Event) => void;
|
||||||
|
}
|
||||||
|
export interface DrawerActionType {
|
||||||
|
scrollBottom: () => void;
|
||||||
|
scrollTo: (to: number) => void;
|
||||||
|
getScrollWrap: () => Element | null;
|
||||||
|
}
|
||||||
156
hx-ai-intelligent/src/components/Drawer/src/useDrawer.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import type { UseDrawerReturnType, DrawerInstance, ReturnMethods, DrawerProps, UseDrawerInnerReturnType } from './typing';
|
||||||
|
import { ref, getCurrentInstance, unref, reactive, watchEffect, nextTick, toRaw, computed } from 'vue';
|
||||||
|
import { isProdMode } from '/@/utils/env';
|
||||||
|
import { isFunction } from '/@/utils/is';
|
||||||
|
import { tryOnUnmounted } from '@vueuse/core';
|
||||||
|
import { isEqual } from 'lodash-es';
|
||||||
|
import { error } from '/@/utils/log';
|
||||||
|
|
||||||
|
const dataTransferRef = reactive<any>({});
|
||||||
|
|
||||||
|
const visibleData = reactive<{ [key: number]: boolean }>({});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: Applicable to separate drawer and call outside
|
||||||
|
*/
|
||||||
|
export function useDrawer(): UseDrawerReturnType {
|
||||||
|
if (!getCurrentInstance()) {
|
||||||
|
throw new Error('useDrawer() can only be used inside setup() or functional components!');
|
||||||
|
}
|
||||||
|
const drawer = ref<DrawerInstance | null>(null);
|
||||||
|
const loaded = ref<Nullable<boolean>>(false);
|
||||||
|
const uid = ref<string>('');
|
||||||
|
|
||||||
|
function register(drawerInstance: DrawerInstance, uuid: string) {
|
||||||
|
isProdMode() &&
|
||||||
|
tryOnUnmounted(() => {
|
||||||
|
drawer.value = null;
|
||||||
|
loaded.value = null;
|
||||||
|
dataTransferRef[unref(uid)] = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (unref(loaded) && isProdMode() && drawerInstance === unref(drawer)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uid.value = uuid;
|
||||||
|
drawer.value = drawerInstance;
|
||||||
|
loaded.value = true;
|
||||||
|
|
||||||
|
drawerInstance.emitVisible = (visible: boolean, uid: number) => {
|
||||||
|
visibleData[uid] = visible;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const getInstance = () => {
|
||||||
|
const instance = unref(drawer);
|
||||||
|
if (!instance) {
|
||||||
|
error('useDrawer instance is undefined!');
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
const methods: ReturnMethods = {
|
||||||
|
setDrawerProps: (props: Partial<DrawerProps>): void => {
|
||||||
|
getInstance()?.setDrawerProps(props);
|
||||||
|
},
|
||||||
|
|
||||||
|
getVisible: computed((): boolean => {
|
||||||
|
return visibleData[~~unref(uid)];
|
||||||
|
}),
|
||||||
|
|
||||||
|
getOpen: computed((): boolean => {
|
||||||
|
return visibleData[~~unref(uid)];
|
||||||
|
}),
|
||||||
|
|
||||||
|
openDrawer: <T = any>(visible = true, data?: T, openOnSet = true): void => {
|
||||||
|
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
getInstance()?.setDrawerProps({
|
||||||
|
open: visible,
|
||||||
|
});
|
||||||
|
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
if (!data) return;
|
||||||
|
|
||||||
|
if (openOnSet) {
|
||||||
|
dataTransferRef[unref(uid)] = null;
|
||||||
|
dataTransferRef[unref(uid)] = toRaw(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const equal = isEqual(toRaw(dataTransferRef[unref(uid)]), toRaw(data));
|
||||||
|
if (!equal) {
|
||||||
|
dataTransferRef[unref(uid)] = toRaw(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeDrawer: () => {
|
||||||
|
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
getInstance()?.setDrawerProps({ open: false });
|
||||||
|
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
return [register, methods];
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => {
|
||||||
|
const drawerInstanceRef = ref<Nullable<DrawerInstance>>(null);
|
||||||
|
const currentInstance = getCurrentInstance();
|
||||||
|
const uidRef = ref<string>('');
|
||||||
|
|
||||||
|
if (!getCurrentInstance()) {
|
||||||
|
throw new Error('useDrawerInner() can only be used inside setup() or functional components!');
|
||||||
|
}
|
||||||
|
|
||||||
|
const getInstance = () => {
|
||||||
|
const instance = unref(drawerInstanceRef);
|
||||||
|
if (!instance) {
|
||||||
|
error('useDrawerInner instance is undefined!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
const register = (modalInstance: DrawerInstance, uuid: string) => {
|
||||||
|
isProdMode() &&
|
||||||
|
tryOnUnmounted(() => {
|
||||||
|
drawerInstanceRef.value = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
uidRef.value = uuid;
|
||||||
|
drawerInstanceRef.value = modalInstance;
|
||||||
|
currentInstance?.emit('register', modalInstance, uuid);
|
||||||
|
};
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
const data = dataTransferRef[unref(uidRef)];
|
||||||
|
if (!data) return;
|
||||||
|
if (!callbackFn || !isFunction(callbackFn)) return;
|
||||||
|
nextTick(() => {
|
||||||
|
callbackFn(data);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return [
|
||||||
|
register,
|
||||||
|
{
|
||||||
|
changeLoading: (loading = true) => {
|
||||||
|
getInstance()?.setDrawerProps({ loading });
|
||||||
|
},
|
||||||
|
|
||||||
|
changeOkLoading: (loading = true) => {
|
||||||
|
getInstance()?.setDrawerProps({ confirmLoading: loading });
|
||||||
|
},
|
||||||
|
getVisible: computed((): boolean => {
|
||||||
|
return visibleData[~~unref(uidRef)];
|
||||||
|
}),
|
||||||
|
getOpen: computed((): boolean => {
|
||||||
|
return visibleData[~~unref(uidRef)];
|
||||||
|
}),
|
||||||
|
closeDrawer: () => {
|
||||||
|
getInstance()?.setDrawerProps({ open: false });
|
||||||
|
},
|
||||||
|
|
||||||
|
setDrawerProps: (props: Partial<DrawerProps>) => {
|
||||||
|
getInstance()?.setDrawerProps(props);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
};
|
||||||
10
hx-ai-intelligent/src/components/Table/index.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export { default as BasicTable } from './src/BasicTable.vue';
|
||||||
|
export { default as TableAction } from './src/components/TableAction.vue';
|
||||||
|
export { default as EditTableHeaderIcon } from './src/components/EditTableHeaderIcon.vue';
|
||||||
|
// export { default as TableImg } from './src/components/TableImg.vue';
|
||||||
|
export * from './src/types/table';
|
||||||
|
// export * from './src/types/pagination';
|
||||||
|
// export * from './src/types/tableAction';
|
||||||
|
// export { useTable } from './src/hooks/useTable';
|
||||||
|
// export type { FormSchema, FormProps } from '/@/components/Form/src/types/form';
|
||||||
|
// export type { EditRecordRow } from './src/components/editable';
|
||||||
605
hx-ai-intelligent/src/components/Table/src/BasicTable.vue
Normal file
@@ -0,0 +1,605 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="wrapRef" :class="getWrapperClass">
|
||||||
|
<!-- <BasicForm
|
||||||
|
:class="{ 'table-search-area-hidden': !getBindValues.formConfig?.schemas?.length }"
|
||||||
|
submitOnReset
|
||||||
|
v-bind="getFormProps"
|
||||||
|
v-if="getBindValues.useSearchForm"
|
||||||
|
:tableAction="tableAction"
|
||||||
|
@register="registerForm"
|
||||||
|
@submit="handleSearchInfoChange"
|
||||||
|
@advanced-change="redoHeight"
|
||||||
|
>
|
||||||
|
<template #[replaceFormSlotKey(item)]="data" v-for="item in getFormSlotKeys">
|
||||||
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
|
</template>
|
||||||
|
</BasicForm> -->
|
||||||
|
|
||||||
|
<!-- antd v3 升级兼容,阻止数据的收集,防止控制台报错 -->
|
||||||
|
<!-- https://antdv.com/docs/vue/migration-v3-cn -->
|
||||||
|
<a-form-item-rest>
|
||||||
|
<!-- 【TV360X-377】关联记录必填影响到了table的输入框和页码样式 -->
|
||||||
|
<a-form-item>
|
||||||
|
<Table ref="tableElRef" v-bind="getBindValues" :rowClassName="getRowClassName" v-show="getEmptyDataIsShowTable" @resizeColumn="handleResizeColumn" @change="handleTableChange">
|
||||||
|
<!-- antd的原生插槽直接传递 -->
|
||||||
|
<template #[item]="data" v-for="item in slotNamesGroup.native" :key="item">
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:20240424---for:【issues/1146】BasicTable使用headerCell全选框出不来 -->
|
||||||
|
<template v-if="item === 'headerCell'">
|
||||||
|
<CustomSelectHeader v-if="isCustomSelection(data.column)" v-bind="selectHeaderProps" />
|
||||||
|
<slot v-else :name="item" v-bind="data || {}"></slot>
|
||||||
|
</template>
|
||||||
|
<slot v-else :name="item" v-bind="data || {}"></slot>
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:20240424---for:【issues/1146】BasicTable使用headerCell全选框出不来 -->
|
||||||
|
</template>
|
||||||
|
<template #headerCell="{ column }">
|
||||||
|
<!-- update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题 -->
|
||||||
|
<CustomSelectHeader v-if="isCustomSelection(column)" v-bind="selectHeaderProps"/>
|
||||||
|
<HeaderCell v-else :column="column" />
|
||||||
|
<!-- update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题 -->
|
||||||
|
</template>
|
||||||
|
<!-- 增加对antdv3.x兼容 -->
|
||||||
|
<template #bodyCell="data">
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:220230717---for:【issues-179】antd3 一些警告以及报错(针对表格) -->
|
||||||
|
<!-- update-begin--author:liusq---date:20230921---for:【issues/770】slotsBak异常报错的问题,增加判断column是否存在 -->
|
||||||
|
<template v-if="data.column?.slotsBak?.customRender">
|
||||||
|
<!-- update-end--author:liusq---date:20230921---for:【issues/770】slotsBak异常报错的问题,增加判断column是否存在 -->
|
||||||
|
<slot :name="data.column.slotsBak.customRender" v-bind="data || {}"></slot>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<slot name="bodyCell" v-bind="data || {}"></slot>
|
||||||
|
</template>
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:22030717---for:【issues-179】antd3 一些警告以及报错(针对表格) -->
|
||||||
|
</template>
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计) -->
|
||||||
|
<template v-if="showSummaryRef && !getBindValues.showSummary" #summary="data">
|
||||||
|
<slot name="summary" v-bind="data || {}">
|
||||||
|
<TableSummary :data="data || {}" v-bind="getSummaryProps" />
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
<!-- update-end--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计) -->
|
||||||
|
</Table>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form-item-rest>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam, BasicColumn } from './types/table';
|
||||||
|
|
||||||
|
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUnmounted, onMounted, nextTick } from 'vue';
|
||||||
|
import { Table } from 'ant-design-vue';
|
||||||
|
// import { BasicForm, useForm } from '/@/components/Form/index';
|
||||||
|
// import { PageWrapperFixedHeightKey } from '/@/components/Page/injectionKey';
|
||||||
|
import CustomSelectHeader from './components/CustomSelectHeader.vue'
|
||||||
|
import expandIcon from './components/ExpandIcon';
|
||||||
|
// import HeaderCell from './components/HeaderCell.vue';
|
||||||
|
import TableSummary from './components/TableSummary';
|
||||||
|
import { InnerHandlers } from './types/table';
|
||||||
|
import { usePagination } from './hooks/usePagination';
|
||||||
|
import { useColumns } from './hooks/useColumns';
|
||||||
|
import { useDataSource } from './hooks/useDataSource';
|
||||||
|
import { useLoading } from './hooks/useLoading';
|
||||||
|
import { useRowSelection } from './hooks/useRowSelection';
|
||||||
|
import { useTableScroll } from './hooks/useTableScroll';
|
||||||
|
import { useCustomRow } from './hooks/useCustomRow';
|
||||||
|
import { useTableStyle } from './hooks/useTableStyle';
|
||||||
|
import { useTableHeader } from './hooks/useTableHeader';
|
||||||
|
import { useTableExpand } from './hooks/useTableExpand';
|
||||||
|
import { createTableContext } from './hooks/useTableContext';
|
||||||
|
import { useTableFooter } from './hooks/useTableFooter';
|
||||||
|
import { useTableForm } from './hooks/useTableForm';
|
||||||
|
// import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
|
import { useCustomSelection } from "./hooks/useCustomSelection";
|
||||||
|
|
||||||
|
import { omit, pick } from 'lodash-es';
|
||||||
|
import { basicProps } from './props';
|
||||||
|
// import { isFunction } from '/@/utils/is';
|
||||||
|
// import { warn } from '/@/utils/log';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
Table,
|
||||||
|
// BasicForm,
|
||||||
|
HeaderCell,
|
||||||
|
TableSummary,
|
||||||
|
CustomSelectHeader,
|
||||||
|
},
|
||||||
|
props: basicProps,
|
||||||
|
emits: [
|
||||||
|
'fetch-success',
|
||||||
|
'fetch-error',
|
||||||
|
'selection-change',
|
||||||
|
'register',
|
||||||
|
'row-click',
|
||||||
|
'row-dbClick',
|
||||||
|
'row-contextmenu',
|
||||||
|
'row-mouseenter',
|
||||||
|
'row-mouseleave',
|
||||||
|
'edit-end',
|
||||||
|
'edit-cancel',
|
||||||
|
'edit-row-end',
|
||||||
|
'edit-change',
|
||||||
|
'expanded-rows-change',
|
||||||
|
'change',
|
||||||
|
'columns-change',
|
||||||
|
'table-redo',
|
||||||
|
],
|
||||||
|
setup(props, { attrs, emit, slots, expose }) {
|
||||||
|
const tableElRef = ref(null);
|
||||||
|
const tableData = ref<Recordable[]>([]);
|
||||||
|
|
||||||
|
const wrapRef = ref(null);
|
||||||
|
const innerPropsRef = ref<Partial<BasicTableProps>>();
|
||||||
|
|
||||||
|
const { prefixCls } = useDesign('basic-table');
|
||||||
|
const [registerForm, formActions] = useForm();
|
||||||
|
|
||||||
|
const getProps = computed(() => {
|
||||||
|
return { ...props, ...unref(innerPropsRef) } as BasicTableProps;
|
||||||
|
});
|
||||||
|
|
||||||
|
const isFixedHeightPage = inject(PageWrapperFixedHeightKey, false);
|
||||||
|
watchEffect(() => {
|
||||||
|
unref(isFixedHeightPage) &&
|
||||||
|
props.canResize &&
|
||||||
|
warn("'canResize' of BasicTable may not work in PageWrapper with 'fixedHeight' (especially in hot updates)");
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getLoading, setLoading } = useLoading(getProps);
|
||||||
|
const { getPaginationInfo, getPagination, setPagination, setShowPagination, getShowPagination } = usePagination(getProps);
|
||||||
|
|
||||||
|
// update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
|
||||||
|
// const { getRowSelection, getRowSelectionRef, getSelectRows, clearSelectedRowKeys, getSelectRowKeys, deleteSelectRowByKey, setSelectedRowKeys } =
|
||||||
|
// useRowSelection(getProps, tableData, emit);
|
||||||
|
|
||||||
|
// 子级列名
|
||||||
|
const childrenColumnName = computed(() => getProps.value.childrenColumnName || 'children');
|
||||||
|
|
||||||
|
// 自定义选择列
|
||||||
|
const {
|
||||||
|
getRowSelection,
|
||||||
|
getSelectRows,
|
||||||
|
getSelectRowKeys,
|
||||||
|
setSelectedRowKeys,
|
||||||
|
getRowSelectionRef,
|
||||||
|
selectHeaderProps,
|
||||||
|
isCustomSelection,
|
||||||
|
handleCustomSelectColumn,
|
||||||
|
clearSelectedRowKeys,
|
||||||
|
deleteSelectRowByKey,
|
||||||
|
getExpandIconColumnIndex,
|
||||||
|
} = useCustomSelection(
|
||||||
|
getProps,
|
||||||
|
emit,
|
||||||
|
wrapRef,
|
||||||
|
getPaginationInfo,
|
||||||
|
tableData,
|
||||||
|
childrenColumnName
|
||||||
|
)
|
||||||
|
// update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
|
||||||
|
const {
|
||||||
|
handleTableChange: onTableChange,
|
||||||
|
getDataSourceRef,
|
||||||
|
getDataSource,
|
||||||
|
getRawDataSource,
|
||||||
|
setTableData,
|
||||||
|
updateTableDataRecord,
|
||||||
|
deleteTableDataRecord,
|
||||||
|
insertTableDataRecord,
|
||||||
|
findTableDataRecord,
|
||||||
|
fetch,
|
||||||
|
getRowKey,
|
||||||
|
reload,
|
||||||
|
getAutoCreateKey,
|
||||||
|
updateTableData,
|
||||||
|
} = useDataSource(
|
||||||
|
getProps,
|
||||||
|
{
|
||||||
|
tableData,
|
||||||
|
getPaginationInfo,
|
||||||
|
setLoading,
|
||||||
|
setPagination,
|
||||||
|
validate: formActions.validate,
|
||||||
|
clearSelectedRowKeys,
|
||||||
|
},
|
||||||
|
emit
|
||||||
|
);
|
||||||
|
|
||||||
|
function handleTableChange(...args) {
|
||||||
|
onTableChange.call(undefined, ...args);
|
||||||
|
emit('change', ...args);
|
||||||
|
// 解决通过useTable注册onChange时不起作用的问题
|
||||||
|
const { onChange } = unref(getProps);
|
||||||
|
onChange && isFunction(onChange) && onChange.call(undefined, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
const { getViewColumns, getColumns, setCacheColumnsByField, setColumns, getColumnsRef, getCacheColumns } = useColumns(
|
||||||
|
getProps,
|
||||||
|
getPaginationInfo,
|
||||||
|
// update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
handleCustomSelectColumn,
|
||||||
|
// update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
);
|
||||||
|
|
||||||
|
const { getScrollRef, redoHeight } = useTableScroll(getProps, tableElRef, getColumnsRef, getRowSelectionRef, getDataSourceRef);
|
||||||
|
|
||||||
|
const { customRow } = useCustomRow(getProps, {
|
||||||
|
setSelectedRowKeys,
|
||||||
|
getSelectRowKeys,
|
||||||
|
clearSelectedRowKeys,
|
||||||
|
getAutoCreateKey,
|
||||||
|
emit,
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getRowClassName } = useTableStyle(getProps, prefixCls);
|
||||||
|
|
||||||
|
const { getExpandOption, expandAll, collapseAll } = useTableExpand(getProps, tableData, emit);
|
||||||
|
|
||||||
|
const handlers: InnerHandlers = {
|
||||||
|
onColumnsChange: (data: ColumnChangeParam[]) => {
|
||||||
|
emit('columns-change', data);
|
||||||
|
// support useTable
|
||||||
|
unref(getProps).onColumnsChange?.(data);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const { getHeaderProps } = useTableHeader(getProps, slots, handlers);
|
||||||
|
// update-begin--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计)
|
||||||
|
const getSummaryProps = computed(() => {
|
||||||
|
return pick(unref(getProps), ['summaryFunc', 'summaryData', 'hasExpandedRow', 'rowKey']);
|
||||||
|
});
|
||||||
|
const getIsEmptyData = computed(() => {
|
||||||
|
return (unref(getDataSourceRef) || []).length === 0;
|
||||||
|
});
|
||||||
|
const showSummaryRef = computed(() => {
|
||||||
|
const summaryProps = unref(getSummaryProps);
|
||||||
|
return (summaryProps.summaryFunc || summaryProps.summaryData) && !unref(getIsEmptyData);
|
||||||
|
});
|
||||||
|
// update-end--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计)
|
||||||
|
|
||||||
|
const { getFooterProps } = useTableFooter(getProps, slots, getScrollRef, tableElRef, getDataSourceRef);
|
||||||
|
|
||||||
|
const { getFormProps, replaceFormSlotKey, getFormSlotKeys, handleSearchInfoChange } = useTableForm(getProps, slots, fetch, getLoading);
|
||||||
|
|
||||||
|
const getBindValues = computed(() => {
|
||||||
|
const dataSource = unref(getDataSourceRef);
|
||||||
|
let propsData: Recordable = {
|
||||||
|
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
|
||||||
|
...attrs,
|
||||||
|
customRow,
|
||||||
|
//树列表展开使用AntDesignVue默认的加减图标 author:scott date:20210914
|
||||||
|
//expandIcon: slots.expandIcon ? null : expandIcon(),
|
||||||
|
...unref(getProps),
|
||||||
|
...unref(getHeaderProps),
|
||||||
|
scroll: unref(getScrollRef),
|
||||||
|
loading: unref(getLoading),
|
||||||
|
tableLayout: 'fixed',
|
||||||
|
rowSelection: unref(getRowSelectionRef),
|
||||||
|
rowKey: unref(getRowKey),
|
||||||
|
columns: toRaw(unref(getViewColumns)),
|
||||||
|
pagination: toRaw(unref(getPaginationInfo)),
|
||||||
|
dataSource,
|
||||||
|
footer: unref(getFooterProps),
|
||||||
|
...unref(getExpandOption),
|
||||||
|
// 【QQYUN-5837】动态计算 expandIconColumnIndex
|
||||||
|
expandIconColumnIndex: getExpandIconColumnIndex.value,
|
||||||
|
};
|
||||||
|
|
||||||
|
//update-begin---author:wangshuai ---date:20230214 for:[QQYUN-4237]代码生成 内嵌子表模式 没有滚动条------------
|
||||||
|
//额外的展开行存在插槽时会将滚动移除掉,注释掉
|
||||||
|
/*if (slots.expandedRowRender) {
|
||||||
|
propsData = omit(propsData, 'scroll');
|
||||||
|
}*/
|
||||||
|
//update-end---author:wangshuai ---date:20230214 for:[QQYUN-4237]代码生成 内嵌子表模式 没有滚动条------------
|
||||||
|
|
||||||
|
// update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
// 自定义选择列,需要去掉原生的
|
||||||
|
delete propsData.rowSelection
|
||||||
|
// update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
|
||||||
|
// update-begin--author:liaozhiyang---date:20230919---for:【QQYUN-6387】展开写法(去掉报错)
|
||||||
|
!propsData.isTreeTable && delete propsData.expandIconColumnIndex;
|
||||||
|
propsData.expandedRowKeys === null && delete propsData.expandedRowKeys;
|
||||||
|
// update-end--author:liaozhiyang---date:20230919---for:【QQYUN-6387】展开写法(去掉报错)
|
||||||
|
propsData = omit(propsData, ['class', 'onChange']);
|
||||||
|
return propsData;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 统一设置表格列宽度
|
||||||
|
const getMaxColumnWidth = computed(() => {
|
||||||
|
const values = unref(getBindValues);
|
||||||
|
return values.maxColumnWidth > 0 ? values.maxColumnWidth + 'px' : null;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getWrapperClass = computed(() => {
|
||||||
|
const values = unref(getBindValues);
|
||||||
|
return [
|
||||||
|
prefixCls,
|
||||||
|
attrs.class,
|
||||||
|
{
|
||||||
|
[`${prefixCls}-form-container`]: values.useSearchForm,
|
||||||
|
[`${prefixCls}--inset`]: values.inset,
|
||||||
|
[`${prefixCls}-col-max-width`]: getMaxColumnWidth.value != null,
|
||||||
|
// 是否显示表尾合计
|
||||||
|
[`${prefixCls}--show-summary`]: values.showSummary,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
const getEmptyDataIsShowTable = computed(() => {
|
||||||
|
const { emptyDataIsShowTable, useSearchForm } = unref(getProps);
|
||||||
|
if (emptyDataIsShowTable || !useSearchForm) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return !!unref(getDataSourceRef).length;
|
||||||
|
});
|
||||||
|
|
||||||
|
function setProps(props: Partial<BasicTableProps>) {
|
||||||
|
innerPropsRef.value = { ...unref(innerPropsRef), ...props };
|
||||||
|
}
|
||||||
|
|
||||||
|
const tableAction: TableActionType = {
|
||||||
|
reload,
|
||||||
|
getSelectRows,
|
||||||
|
clearSelectedRowKeys,
|
||||||
|
getSelectRowKeys,
|
||||||
|
deleteSelectRowByKey,
|
||||||
|
setPagination,
|
||||||
|
setTableData,
|
||||||
|
updateTableDataRecord,
|
||||||
|
deleteTableDataRecord,
|
||||||
|
insertTableDataRecord,
|
||||||
|
findTableDataRecord,
|
||||||
|
redoHeight,
|
||||||
|
setSelectedRowKeys,
|
||||||
|
setColumns,
|
||||||
|
setLoading,
|
||||||
|
getDataSource,
|
||||||
|
getRawDataSource,
|
||||||
|
setProps,
|
||||||
|
getRowSelection,
|
||||||
|
getPaginationRef: getPagination,
|
||||||
|
getColumns,
|
||||||
|
getCacheColumns,
|
||||||
|
emit,
|
||||||
|
updateTableData,
|
||||||
|
setShowPagination,
|
||||||
|
getShowPagination,
|
||||||
|
setCacheColumnsByField,
|
||||||
|
expandAll,
|
||||||
|
collapseAll,
|
||||||
|
getSize: () => {
|
||||||
|
return unref(getBindValues).size as SizeType;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
createTableContext({ ...tableAction, wrapRef, getBindValues });
|
||||||
|
|
||||||
|
// update-begin--author:sunjianlei---date:220230718---for:【issues/179】兼容新老slots写法,移除控制台警告
|
||||||
|
// 获取分组之后的slot名称
|
||||||
|
const slotNamesGroup = computed<{
|
||||||
|
// AntTable原生插槽
|
||||||
|
native: string[];
|
||||||
|
// 列自定义插槽
|
||||||
|
custom: string[];
|
||||||
|
}>(() => {
|
||||||
|
const native: string[] = [];
|
||||||
|
const custom: string[] = [];
|
||||||
|
const columns = unref<Recordable[]>(getViewColumns) as BasicColumn[];
|
||||||
|
const allCustomRender = columns.map<string>((column) => column.slotsBak?.customRender);
|
||||||
|
for (const name of Object.keys(slots)) {
|
||||||
|
// 过滤特殊的插槽
|
||||||
|
if (['bodyCell'].includes(name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (allCustomRender.includes(name)) {
|
||||||
|
custom.push(name);
|
||||||
|
} else {
|
||||||
|
native.push(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { native, custom };
|
||||||
|
});
|
||||||
|
// update-end--author:sunjianlei---date:220230718---for:【issues/179】兼容新老slots写法,移除控制台警告
|
||||||
|
// update-begin--author:liaozhiyang---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
|
||||||
|
nextTick(() => {
|
||||||
|
getProps.value.defaultExpandAllRows && expandAll();
|
||||||
|
})
|
||||||
|
// update-end--author:sunjianlei---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
|
||||||
|
expose(tableAction);
|
||||||
|
|
||||||
|
emit('register', tableAction, formActions);
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
tableElRef,
|
||||||
|
getBindValues,
|
||||||
|
getLoading,
|
||||||
|
registerForm,
|
||||||
|
handleSearchInfoChange,
|
||||||
|
getEmptyDataIsShowTable,
|
||||||
|
handleTableChange,
|
||||||
|
getRowClassName,
|
||||||
|
wrapRef,
|
||||||
|
tableAction,
|
||||||
|
redoHeight,
|
||||||
|
handleResizeColumn: (w, col) => {
|
||||||
|
console.log('col',col);
|
||||||
|
col.width = w;
|
||||||
|
},
|
||||||
|
getFormProps: getFormProps as any,
|
||||||
|
replaceFormSlotKey,
|
||||||
|
getFormSlotKeys,
|
||||||
|
getWrapperClass,
|
||||||
|
getMaxColumnWidth,
|
||||||
|
columns: getViewColumns,
|
||||||
|
|
||||||
|
// update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
selectHeaderProps,
|
||||||
|
isCustomSelection,
|
||||||
|
// update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
|
||||||
|
slotNamesGroup,
|
||||||
|
// update-begin--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计)
|
||||||
|
getSummaryProps,
|
||||||
|
showSummaryRef,
|
||||||
|
// update-end--author:liaozhiyang---date:20240425---for:【pull/1201】添加antd的TableSummary功能兼容老的summary(表尾合计)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
@border-color: #cecece4d;
|
||||||
|
|
||||||
|
@prefix-cls: ~'@{namespace}-basic-table';
|
||||||
|
|
||||||
|
[data-theme='dark'] {
|
||||||
|
.ant-table-tbody > tr:hover.ant-table-row-selected > td,
|
||||||
|
.ant-table-tbody > tr.ant-table-row-selected td {
|
||||||
|
background-color: #262626;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{prefix-cls} {
|
||||||
|
//表格选择工具栏样式
|
||||||
|
.alert {
|
||||||
|
// background-color: #323232;
|
||||||
|
// border-color: #424242;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{prefix-cls} {
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
|
&-row__striped {
|
||||||
|
td {
|
||||||
|
background-color: @app-content-background;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// update-begin--author:liaozhiyang---date:20240613---for:【TV360X-1232】查询区域隐藏后点击刷新不走请求了(采用css隐藏)
|
||||||
|
> .table-search-area-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240613---for:【TV360X-1232】查询区域隐藏后点击刷新不走请求了(采用css隐藏)
|
||||||
|
&-form-container {
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
.ant-form {
|
||||||
|
padding: 12px 10px 6px 10px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background-color: @component-background;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-tag {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//update-begin-author:liusq---date:20230517--for: [issues/526]RangePicker 设置预设范围按钮样式问题---
|
||||||
|
.ant-picker-preset {
|
||||||
|
.ant-tag {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//update-end-author:liusq---date:20230517--for: [issues/526]RangePicker 设置预设范围按钮样式问题---
|
||||||
|
|
||||||
|
.ant-table-wrapper {
|
||||||
|
padding: 6px;
|
||||||
|
background-color: @component-background;
|
||||||
|
border-radius: 2px;
|
||||||
|
|
||||||
|
.ant-table-title {
|
||||||
|
min-height: 40px;
|
||||||
|
padding: 0 0 8px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table.ant-table-bordered .ant-table-title {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table {
|
||||||
|
width: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
display: flex;
|
||||||
|
padding: 8px 6px;
|
||||||
|
border-bottom: none;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
//定义行颜色
|
||||||
|
.trcolor {
|
||||||
|
background-color: rgba(255, 192, 203, 0.31);
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
//.ant-table-tbody > tr.ant-table-row-selected td {
|
||||||
|
//background-color: fade(@primary-color, 8%) !important;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-pagination {
|
||||||
|
margin: 10px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table-footer {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.ant-table-wrapper {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table-content {
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
// overflow-y: scroll !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding: 12px 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//表格选择工具栏样式
|
||||||
|
.alert {
|
||||||
|
height: 38px;
|
||||||
|
// background-color: #e6f7ff;
|
||||||
|
// border-color: #91d5ff;
|
||||||
|
}
|
||||||
|
&--inset {
|
||||||
|
.ant-table-wrapper {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ 统一设置表格列最大宽度 ------
|
||||||
|
&-col-max-width {
|
||||||
|
.ant-table-thead tr th,
|
||||||
|
.ant-table-tbody tr td {
|
||||||
|
max-width: v-bind(getMaxColumnWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ------ 统一设置表格列最大宽度 ------
|
||||||
|
|
||||||
|
// update-begin--author:sunjianlei---date:220230718---for:【issues/622】修复表尾合计错位的问题
|
||||||
|
&--show-summary {
|
||||||
|
.ant-table > .ant-table-footer {
|
||||||
|
padding: 12px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-table.ant-table-bordered > .ant-table-footer {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// update-end--author:sunjianlei---date:220230718---for:【issues/622】修复表尾合计错位的问题
|
||||||
|
// update-begin--author:liaozhiyang---date:20240604---for:【TV360X-377】关联记录必填影响到了table的输入框和页码样式
|
||||||
|
> .ant-form-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240604---for:【TV360X-377】关联记录必填影响到了table的输入框和页码样式
|
||||||
|
}
|
||||||
|
</style>
|
||||||
26
hx-ai-intelligent/src/components/Table/src/componentMap.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import type { Component } from 'vue';
|
||||||
|
import { Input, Select, Checkbox, InputNumber, Switch, DatePicker, TimePicker } from 'ant-design-vue';
|
||||||
|
import type { ComponentType } from './types/componentType';
|
||||||
|
import { ApiSelect, ApiTreeSelect } from '/@/components/Form';
|
||||||
|
|
||||||
|
const componentMap = new Map<ComponentType, Component>();
|
||||||
|
|
||||||
|
componentMap.set('Input', Input);
|
||||||
|
componentMap.set('InputNumber', InputNumber);
|
||||||
|
componentMap.set('Select', Select);
|
||||||
|
componentMap.set('ApiSelect', ApiSelect);
|
||||||
|
componentMap.set('ApiTreeSelect', ApiTreeSelect);
|
||||||
|
componentMap.set('Switch', Switch);
|
||||||
|
componentMap.set('Checkbox', Checkbox);
|
||||||
|
componentMap.set('DatePicker', DatePicker);
|
||||||
|
componentMap.set('TimePicker', TimePicker);
|
||||||
|
|
||||||
|
export function add(compName: ComponentType, component: Component) {
|
||||||
|
componentMap.set(compName, component);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(compName: ComponentType) {
|
||||||
|
componentMap.delete(compName);
|
||||||
|
}
|
||||||
|
|
||||||
|
export { componentMap };
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<!-- 自定义选择列,表头实现部分 -->
|
||||||
|
<template>
|
||||||
|
<!-- update-begin--author:liaozhiyang---date:20231130---for:【issues/5595】BasicTable组件hideSelectAll: true无法隐藏全选框 -->
|
||||||
|
<template v-if="isRadio">
|
||||||
|
<!-- radio不存在全选,所以放个空标签 -->
|
||||||
|
<span></span>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<template v-if="hideSelectAll">
|
||||||
|
<span></span>
|
||||||
|
</template>
|
||||||
|
<a-checkbox :disabled="disabled" v-else :checked="checked" :indeterminate="isHalf" @update:checked="onChange" />
|
||||||
|
</template>
|
||||||
|
<!-- update-end--author:liaozhiyang---date:20231130---for:【issues/5595】BasicTable组件hideSelectAll: true无法隐藏全选框 -->
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
isRadio: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
selectedLength: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
// 当前页条目数
|
||||||
|
pageSize: {
|
||||||
|
type: Number,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
hideSelectAll: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
// update-begin--author:liaozhiyang---date:20231016---for:【QQYUN-6774】解决checkbox禁用后全选仍能勾选问题
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
// update-end--author:liaozhiyang---date:20231016---for:【QQYUN-6774】解决checkbox禁用后全选仍能勾选问题
|
||||||
|
});
|
||||||
|
const emit = defineEmits(['select-all']);
|
||||||
|
|
||||||
|
// 是否全选
|
||||||
|
const checked = computed(() => {
|
||||||
|
if (props.isRadio) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return props.selectedLength > 0 && props.selectedLength >= props.pageSize;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 是否半选
|
||||||
|
const isHalf = computed(() => {
|
||||||
|
if (props.isRadio) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return props.selectedLength > 0 && props.selectedLength < props.pageSize;
|
||||||
|
});
|
||||||
|
|
||||||
|
function onChange(checked: boolean) {
|
||||||
|
emit('select-all', checked);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||