Compare commits
1021 Commits
v2.2.2
...
feat-unify
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa84ee778c | ||
|
|
0eb75fbba4 | ||
|
|
6858f5bd39 | ||
|
|
b9f6ed95ab | ||
|
|
8039213380 | ||
|
|
c5a704767d | ||
|
|
20be7f2e45 | ||
|
|
fa476b6186 | ||
|
|
9c9bc98216 | ||
|
|
362456bdea | ||
|
|
ffceed63ca | ||
|
|
3cb4dbb12b | ||
|
|
5a981109de | ||
|
|
e6b7a868a2 | ||
|
|
0aa3f68f6d | ||
|
|
796bfd2c98 | ||
|
|
df0728ea12 | ||
|
|
7c745c5613 | ||
|
|
73090a6f1e | ||
|
|
e46ee17914 | ||
|
|
93e5b38491 | ||
|
|
37593bc257 | ||
|
|
b2eb54ca4b | ||
|
|
bfbc7edd31 | ||
|
|
a43b9fbdec | ||
|
|
5c4df5c824 | ||
|
|
5cc10c4198 | ||
|
|
b6d366e86d | ||
|
|
6e1740d2e2 | ||
|
|
2c6493105a | ||
|
|
c290d407a3 | ||
|
|
43713ba7dc | ||
|
|
5e28c513a4 | ||
|
|
d43823794d | ||
|
|
318a90f709 | ||
|
|
5326405a38 | ||
|
|
f8ec88ea64 | ||
|
|
0d5e6d6e53 | ||
|
|
c24e77d3af | ||
|
|
02e4ebf884 | ||
|
|
03b22f4af1 | ||
|
|
324edc27e1 | ||
|
|
cf63d5d086 | ||
|
|
5e09105a70 | ||
|
|
f5c3f51db2 | ||
|
|
7d2a98ab85 | ||
|
|
2d302bb468 | ||
|
|
789328b02e | ||
|
|
db9dca09e8 | ||
|
|
b93a2a516a | ||
|
|
3e10592a74 | ||
|
|
3e5e1a9b41 | ||
|
|
9ee62dffca | ||
|
|
778be20ddc | ||
|
|
23e76a93f4 | ||
|
|
29eee8fa48 | ||
|
|
8bf3c3bb75 | ||
|
|
4c2ca2b635 | ||
|
|
a20f540027 | ||
|
|
bd7d3fe23e | ||
|
|
f0f8c86b0d | ||
|
|
0138db1b4f | ||
|
|
a7d433b62d | ||
|
|
6f93b1f599 | ||
|
|
2a9983047a | ||
|
|
e81d7e8b20 | ||
|
|
2c0658ce50 | ||
|
|
f97112f117 | ||
|
|
7cf39a0e58 | ||
|
|
4c290d64ba | ||
|
|
9707e4af0f | ||
|
|
9161374320 | ||
|
|
8d81ed3870 | ||
|
|
ef7dbba3ce | ||
|
|
e9e5b798e7 | ||
|
|
d0f3490bd5 | ||
|
|
2036a509f0 | ||
|
|
3c802d44f4 | ||
|
|
96def0107d | ||
|
|
f96a9c9d6f | ||
|
|
5220cae94a | ||
|
|
4048d4a418 | ||
|
|
872382b4a3 | ||
|
|
77a763db75 | ||
|
|
73ce3a8551 | ||
|
|
a56ddc9415 | ||
|
|
122635248e | ||
|
|
01bf37ce38 | ||
|
|
4a75cc4d11 | ||
|
|
d0260041ce | ||
|
|
e3d5860a41 | ||
|
|
650ee93368 | ||
|
|
ac85b72be8 | ||
|
|
fd8aeba700 | ||
|
|
dad4d41894 | ||
|
|
144ef06cd1 | ||
|
|
885387cb5a | ||
|
|
dd13a0844b | ||
|
|
b66205eda9 | ||
|
|
6ea3f0701e | ||
|
|
1aade9c4b8 | ||
|
|
6f5d1d9459 | ||
|
|
a8211c6a41 | ||
|
|
752cb744c0 | ||
|
|
c22d559195 | ||
|
|
2c834c1d62 | ||
|
|
cc97672fcc | ||
|
|
e49cf3dea2 | ||
|
|
abbf678e89 | ||
|
|
634b5c2bea | ||
|
|
e559ca928a | ||
|
|
c8662537ca | ||
|
|
04539d605d | ||
|
|
ddf067560a | ||
|
|
7e036261e8 | ||
|
|
b083bd9724 | ||
|
|
0481d42f36 | ||
|
|
6bac8e10ba | ||
|
|
5fd6870cfe | ||
|
|
ce9d59896c | ||
|
|
e6da8d8b9f | ||
|
|
d8fcf4e7d3 | ||
|
|
56c3b9f935 | ||
|
|
7c871c775c | ||
|
|
c0e38e64db | ||
|
|
26eb3aef27 | ||
|
|
5d8d2cde3f | ||
|
|
369614af1e | ||
|
|
55d5f160a5 | ||
|
|
f25217c394 | ||
|
|
d7bc1b6d5c | ||
|
|
f101b476fb | ||
|
|
44a5e2dc4b | ||
|
|
1ece3072a0 | ||
|
|
8e1b56d74c | ||
|
|
ba0cc9cd82 | ||
|
|
1b5d0ee955 | ||
|
|
ae42dec906 | ||
|
|
31be6737f2 | ||
|
|
5987e83a12 | ||
|
|
73955aef09 | ||
|
|
0ddbdfce57 | ||
|
|
3af6bf3a4f | ||
|
|
3b8280ed3a | ||
|
|
644d761cba | ||
|
|
4d68a81ab4 | ||
|
|
b9e3053fe3 | ||
|
|
a48bdd08ff | ||
|
|
ad29bf5f26 | ||
|
|
e0bc13cccb | ||
|
|
aabc907864 | ||
|
|
df75da275b | ||
|
|
9004a55b8c | ||
|
|
3087606a5d | ||
|
|
c653006045 | ||
|
|
a6e7158800 | ||
|
|
97e81d8d99 | ||
|
|
99cad606e7 | ||
|
|
c4a7c673f8 | ||
|
|
c349e6384e | ||
|
|
b23d8504d2 | ||
|
|
662c2fd4dd | ||
|
|
ae77a32c87 | ||
|
|
d1b9c1764d | ||
|
|
4e298efaa0 | ||
|
|
deca505b9c | ||
|
|
185936467d | ||
|
|
c7cbb9b72a | ||
|
|
c3d1c4312c | ||
|
|
55119bee93 | ||
|
|
bd5e06350d | ||
|
|
be992ab9b1 | ||
|
|
352a97d5c1 | ||
|
|
491246205e | ||
|
|
f2087205c1 | ||
|
|
4f55b881db | ||
|
|
c311dd08e3 | ||
|
|
504a1f4703 | ||
|
|
2f24548cb1 | ||
|
|
a67cc9f876 | ||
|
|
92c7e1fce5 | ||
|
|
a2e2373dfd | ||
|
|
e0d2e8031d | ||
|
|
ef4beff52a | ||
|
|
7121a6b2f8 | ||
|
|
489560e670 | ||
|
|
bad3e31b0a | ||
|
|
854f7f15a4 | ||
|
|
d3d3cb440e | ||
|
|
c04f53a9c4 | ||
|
|
cfc2055af8 | ||
|
|
94ae80419d | ||
|
|
988153aaad | ||
|
|
77076136a6 | ||
|
|
628d66e80e | ||
|
|
d4ba828d08 | ||
|
|
05849a3d92 | ||
|
|
e7c227f4ae | ||
|
|
04cf44a528 | ||
|
|
c1d9702c58 | ||
|
|
884a70168d | ||
|
|
e24a029a78 | ||
|
|
c7d6403a09 | ||
|
|
6804a52e76 | ||
|
|
82a55b75b8 | ||
|
|
47aba057fd | ||
|
|
e6211cd523 | ||
|
|
9c9ab6c734 | ||
|
|
abfcbe27de | ||
|
|
bcec26374f | ||
|
|
a2bd41cd57 | ||
|
|
cab509b9a3 | ||
|
|
a5981a4387 | ||
|
|
0d26dce512 | ||
|
|
ee1b55cad9 | ||
|
|
27020b2920 | ||
|
|
99aea4b9d3 | ||
|
|
e1521a31ac | ||
|
|
97df12ee5f | ||
|
|
b9783b168f | ||
|
|
7b3012d8da | ||
|
|
455a9735e7 | ||
|
|
b277bd63c6 | ||
|
|
1c170bbb8a | ||
|
|
2234861cff | ||
|
|
0f30ac9694 | ||
|
|
b618ecfef2 | ||
|
|
56b96bfe44 | ||
|
|
c0bc170422 | ||
|
|
0f24b44269 | ||
|
|
0064a39403 | ||
|
|
4004b2e45e | ||
|
|
932aa038bb | ||
|
|
73488e9704 | ||
|
|
88764d77a8 | ||
|
|
94295a35bc | ||
|
|
530bb98782 | ||
|
|
47adc1378f | ||
|
|
a2389a5d99 | ||
|
|
b618f17978 | ||
|
|
563680f066 | ||
|
|
b462bd6f25 | ||
|
|
7cac99dd80 | ||
|
|
87d5c9ffb7 | ||
|
|
7fa4319bd1 | ||
|
|
05a048e5a8 | ||
|
|
a5dcc3d360 | ||
|
|
0193431c6d | ||
|
|
6c8d12f4e1 | ||
|
|
ceffd2ef0c | ||
|
|
1aa56d844a | ||
|
|
101a4ea27c | ||
|
|
8b1c775178 | ||
|
|
b3c1d83aed | ||
|
|
3adda1e3a4 | ||
|
|
610a8170ef | ||
|
|
9e21a1d036 | ||
|
|
305be7a187 | ||
|
|
1652bfedae | ||
|
|
6ebdceeafb | ||
|
|
5815ea9a0a | ||
|
|
c1bd7168e2 | ||
|
|
a10e9db14f | ||
|
|
50e789ee11 | ||
|
|
c48b7ddc10 | ||
|
|
6359ec15b3 | ||
|
|
b818df2ba0 | ||
|
|
7f49e83557 | ||
|
|
6d38d61816 | ||
|
|
f0e860f306 | ||
|
|
31f67232ae | ||
|
|
7fdc53e921 | ||
|
|
0624c60010 | ||
|
|
32ca138e6a | ||
|
|
171e0aa408 | ||
|
|
b1062d4673 | ||
|
|
f691bb8437 | ||
|
|
52009a415b | ||
|
|
80fc026483 | ||
|
|
b512328a70 | ||
|
|
709d8196fc | ||
|
|
5e2621ca7c | ||
|
|
f6086f40e0 | ||
|
|
520f46adc3 | ||
|
|
da809f13b3 | ||
|
|
be3e7b58b3 | ||
|
|
801aa1f82f | ||
|
|
f23433091a | ||
|
|
8fdb068023 | ||
|
|
0db49d055f | ||
|
|
72c26b71f3 | ||
|
|
3b8181ae10 | ||
|
|
a7edef16f4 | ||
|
|
c2a9642393 | ||
|
|
1b01fd81a8 | ||
|
|
3c04f81147 | ||
|
|
ec28ccf09c | ||
|
|
fa34300401 | ||
|
|
32743391f8 | ||
|
|
6aa439c991 | ||
|
|
33ed0fa468 | ||
|
|
c1b1436473 | ||
|
|
006b28ba38 | ||
|
|
c987dd8816 | ||
|
|
23bbac7318 | ||
|
|
4b21e598db | ||
|
|
26e77dd46c | ||
|
|
88728357d8 | ||
|
|
580f5b1a3f | ||
|
|
2236100e3d | ||
|
|
5dd6f88a42 | ||
|
|
57be88e8aa | ||
|
|
26d249f942 | ||
|
|
0d3585503b | ||
|
|
f70576bbdc | ||
|
|
dcb7806847 | ||
|
|
8832da10c9 | ||
|
|
46f93ffb86 | ||
|
|
96e427ee08 | ||
|
|
dd824a8ca6 | ||
|
|
ca2d70df6e | ||
|
|
7eba381512 | ||
|
|
498743e965 | ||
|
|
4460a3269b | ||
|
|
d2d35e717d | ||
|
|
774c005306 | ||
|
|
e51a635445 | ||
|
|
643eed4858 | ||
|
|
ceac00f3eb | ||
|
|
12e85b61d2 | ||
|
|
f539b09361 | ||
|
|
0aac4efa1b | ||
|
|
1fac9e5254 | ||
|
|
41454cda38 | ||
|
|
31a84e4d87 | ||
|
|
42659a7360 | ||
|
|
83f73aab8d | ||
|
|
2030fcc711 | ||
|
|
32488a03cd | ||
|
|
6d4cfe29ba | ||
|
|
451913f087 | ||
|
|
7d3267959f | ||
|
|
e6209cc008 | ||
|
|
f506ccd2e4 | ||
|
|
3eb3527226 | ||
|
|
f379f7652c | ||
|
|
2de57e93f5 | ||
|
|
0067d4fd5a | ||
|
|
e8760c81ac | ||
|
|
f47c890d2f | ||
|
|
a9bb294f60 | ||
|
|
2096665118 | ||
|
|
102e50be8f | ||
|
|
7ed8fbfcbf | ||
|
|
93b85f09d8 | ||
|
|
c05f851e02 | ||
|
|
072918fc6f | ||
|
|
7218fe57fc | ||
|
|
942ff14d82 | ||
|
|
dc5186fb69 | ||
|
|
857879d700 | ||
|
|
144b2aa81c | ||
|
|
3bfdfea016 | ||
|
|
e3984e672d | ||
|
|
6875bcdbb8 | ||
|
|
ca587c9ee3 | ||
|
|
2abbac8b52 | ||
|
|
0415a68352 | ||
|
|
5a259269ce | ||
|
|
ace8c1c411 | ||
|
|
b196b5aee2 | ||
|
|
3db217e687 | ||
|
|
4107477b9b | ||
|
|
ce0c439f06 | ||
|
|
5d9b3d5a9b | ||
|
|
20b196a12a | ||
|
|
54555ece08 | ||
|
|
4c38abd198 | ||
|
|
5e502eed6d | ||
|
|
1c54bd836a | ||
|
|
46f80ea907 | ||
|
|
0b5f35752b | ||
|
|
1688c6bf38 | ||
|
|
56a98c4d11 | ||
|
|
88bb915161 | ||
|
|
594c8f215f | ||
|
|
15166b6490 | ||
|
|
0bd22db048 | ||
|
|
7322817cb5 | ||
|
|
ec572f8f04 | ||
|
|
8654a45e9b | ||
|
|
10c4729383 | ||
|
|
437ad1bd9f | ||
|
|
74a03b905c | ||
|
|
a295cb44f0 | ||
|
|
cd20e68480 | ||
|
|
35968475b9 | ||
|
|
84c9e73e7b | ||
|
|
6ba668c5f8 | ||
|
|
55dcb43329 | ||
|
|
5ed7374592 | ||
|
|
578c177141 | ||
|
|
bd63169cbb | ||
|
|
831ae3a3db | ||
|
|
5cbd15992a | ||
|
|
d00ba1fdaa | ||
|
|
6a5fe679be | ||
|
|
6da5c613de | ||
|
|
8d0615bc95 | ||
|
|
503c9d6fca | ||
|
|
8a10a9cf82 | ||
|
|
78eb3ccc3f | ||
|
|
30b43cdb82 | ||
|
|
1d1dd07c2f | ||
|
|
7cccbabca4 | ||
|
|
c2aeb420b2 | ||
|
|
b10bc2edc4 | ||
|
|
cdccfa3e12 | ||
|
|
e8c5455748 | ||
|
|
2561c18dec | ||
|
|
ce6f618ba8 | ||
|
|
2d05e8054c | ||
|
|
3ad3d8d9a0 | ||
|
|
0e83597ddc | ||
|
|
8f4ae6f3ba | ||
|
|
3c65fa806e | ||
|
|
48a6b14537 | ||
|
|
de0404705b | ||
|
|
f13b3ca630 | ||
|
|
84361cb5f5 | ||
|
|
34e0b6e610 | ||
|
|
6c941ffed5 | ||
|
|
012eed6f67 | ||
|
|
3eac0d1592 | ||
|
|
ea8a2b59d9 | ||
|
|
8e40416e72 | ||
|
|
d058361e01 | ||
|
|
2491f7ff57 | ||
|
|
f84c72dc71 | ||
|
|
d735bc93ce | ||
|
|
4355c766fd | ||
|
|
2b47817d26 | ||
|
|
5f5b7bf2e3 | ||
|
|
c5908f6d92 | ||
|
|
7e64d30258 | ||
|
|
64d9fbb989 | ||
|
|
437818abce | ||
|
|
ffe7911d4b | ||
|
|
aad72ec5b6 | ||
|
|
d0436ec478 | ||
|
|
5568c3cd2d | ||
|
|
5197eb9292 | ||
|
|
a84f8f4411 | ||
|
|
3cf01f0c51 | ||
|
|
db815661e8 | ||
|
|
fcdc26e9eb | ||
|
|
fa061c42ad | ||
|
|
6edbb7c8a7 | ||
|
|
799c445c4b | ||
|
|
70fbf5de3e | ||
|
|
db3c38a333 | ||
|
|
73c7697443 | ||
|
|
919117c408 | ||
|
|
8092edab81 | ||
|
|
ef4f45ddb0 | ||
|
|
2ff867ba5f | ||
|
|
4f26fc2763 | ||
|
|
0c5b5f96f1 | ||
|
|
3f5f827550 | ||
|
|
3e969e4ae5 | ||
|
|
bcd1dfd7bd | ||
|
|
c1dfd78d18 | ||
|
|
39aa1645c9 | ||
|
|
797a3e3f5b | ||
|
|
53e740bb1d | ||
|
|
11d09c4d63 | ||
|
|
76bb4c4038 | ||
|
|
ccac647ecc | ||
|
|
39692e3b8b | ||
|
|
7aeebff5df | ||
|
|
62dc625363 | ||
|
|
1784e79c83 | ||
|
|
a5374ee746 | ||
|
|
a71bd16103 | ||
|
|
d3afea8c5e | ||
|
|
bfa16ec438 | ||
|
|
2499cbdd44 | ||
|
|
3cc3714e94 | ||
|
|
5abfcfdd1b | ||
|
|
ca8cac3f1a | ||
|
|
3dc745d4ad | ||
|
|
6c871b071f | ||
|
|
87bc0aaced | ||
|
|
3584c1c95c | ||
|
|
be0aa6d099 | ||
|
|
34d27c1004 | ||
|
|
6ee2bdcddb | ||
|
|
2a9d8e0845 | ||
|
|
47296f2607 | ||
|
|
6b913545db | ||
|
|
3836808d97 | ||
|
|
85f3b4e9e3 | ||
|
|
85beabe7c8 | ||
|
|
0109bcbfb9 | ||
|
|
0fb9a79df9 | ||
|
|
b39bcd864c | ||
|
|
6b805fbdfb | ||
|
|
abe76aeb59 | ||
|
|
5f49bc1aa8 | ||
|
|
54d2125067 | ||
|
|
7c86560f68 | ||
|
|
c7f5508e07 | ||
|
|
b7618693b4 | ||
|
|
b1870296c0 | ||
|
|
d3e1cd2fdb | ||
|
|
79a35423c7 | ||
|
|
71807be01d | ||
|
|
e74f796203 | ||
|
|
041d7da9d8 | ||
|
|
a99d949b29 | ||
|
|
c2a9e2a469 | ||
|
|
2e6c1f2431 | ||
|
|
80b05db764 | ||
|
|
ce28a96504 | ||
|
|
340cab11b7 | ||
|
|
712233c215 | ||
|
|
a84e922bc6 | ||
|
|
947ffb45d7 | ||
|
|
5dd14761b7 | ||
|
|
b9b915e913 | ||
|
|
044143571f | ||
|
|
06fe805736 | ||
|
|
c149ea9449 | ||
|
|
c003ce76ad | ||
|
|
077881e499 | ||
|
|
f655a57e61 | ||
|
|
0b04bf4929 | ||
|
|
2fcd3b1132 | ||
|
|
a8c2a989cb | ||
|
|
f287cf68ab | ||
|
|
190d2c60a8 | ||
|
|
b981640eae | ||
|
|
568fd6c105 | ||
|
|
221351ec11 | ||
|
|
6ab34a0996 | ||
|
|
6b551ae68b | ||
|
|
2917cde2e5 | ||
|
|
294a4a6cdf | ||
|
|
6ecd12ed07 | ||
|
|
8ec1626c1e | ||
|
|
23381fea37 | ||
|
|
1e678b7492 | ||
|
|
2ceca7287f | ||
|
|
7f4dd5295b | ||
|
|
cf1e4a0f8a | ||
|
|
ffd628fa82 | ||
|
|
d639e445eb | ||
|
|
b263681dda | ||
|
|
e16413b570 | ||
|
|
63b5186c3e | ||
|
|
3c6f6e70ef | ||
|
|
ba20316761 | ||
|
|
437dd1c411 | ||
|
|
674f748d20 | ||
|
|
d0d5f5b77d | ||
|
|
c095e15d6c | ||
|
|
efd9228cc9 | ||
|
|
ebd6132385 | ||
|
|
9098443c83 | ||
|
|
423890a4df | ||
|
|
15fc418fc4 | ||
|
|
fb2edeb7d2 | ||
|
|
b861587f01 | ||
|
|
c3738fab45 | ||
|
|
24fba75f28 | ||
|
|
00b6b63e1e | ||
|
|
5dab8fa7d9 | ||
|
|
2460fe4e86 | ||
|
|
9a5d71fb5c | ||
|
|
c930efba0c | ||
|
|
908f33c849 | ||
|
|
ff7c820b1f | ||
|
|
11b5eee86a | ||
|
|
4252725d9d | ||
|
|
deeb3a472c | ||
|
|
763173de44 | ||
|
|
f46e6ad8c8 | ||
|
|
09b31547e1 | ||
|
|
dee2ff8dee | ||
|
|
fc26544a85 | ||
|
|
0c4974ca1d | ||
|
|
7f315b95ce | ||
|
|
093e7d1edb | ||
|
|
00ee150c5d | ||
|
|
a4e18f8893 | ||
|
|
c754a36ee5 | ||
|
|
a07d4daed5 | ||
|
|
39023832e3 | ||
|
|
5b8dda60bd | ||
|
|
f7ade54e93 | ||
|
|
ea40cce9a4 | ||
|
|
2524b0ad2d | ||
|
|
4ae7e9dd2e | ||
|
|
8220f4b366 | ||
|
|
7e237b508a | ||
|
|
28bb82e579 | ||
|
|
bcabcb0831 | ||
|
|
c24b03f3da | ||
|
|
63dd03e755 | ||
|
|
f3f1f57b01 | ||
|
|
8da1a074a2 | ||
|
|
8fd7561971 | ||
|
|
c69f9b09ec | ||
|
|
875c267181 | ||
|
|
acd705da88 | ||
|
|
6ade215ea5 | ||
|
|
cabd46268e | ||
|
|
93540d4234 | ||
|
|
7564f816fc | ||
|
|
278782b0f8 | ||
|
|
d604f97b4c | ||
|
|
18a1304e5c | ||
|
|
ce308cf772 | ||
|
|
cb3b7e424e | ||
|
|
18f799cfd6 | ||
|
|
1c6c32f5f7 | ||
|
|
5983fa4de0 | ||
|
|
74c6443a86 | ||
|
|
4bb3739588 | ||
|
|
7f5153f5fa | ||
|
|
2c0b1955af | ||
|
|
290150fc5e | ||
|
|
6e1921d9eb | ||
|
|
d75697af0c | ||
|
|
01bb9a8939 | ||
|
|
df7e07c3e8 | ||
|
|
50907035b8 | ||
|
|
b4da5a925d | ||
|
|
00f392eae0 | ||
|
|
eb14531567 | ||
|
|
18b6acaed1 | ||
|
|
b2437e56ca | ||
|
|
348de945e3 | ||
|
|
3ec36194c7 | ||
|
|
f0f414400f | ||
|
|
79a438bc96 | ||
|
|
caf8586c7e | ||
|
|
c168eaa58e | ||
|
|
0ef0b65b02 | ||
|
|
d3caa77ba3 | ||
|
|
84864b759c | ||
|
|
6169d841ee | ||
|
|
e9363df523 | ||
|
|
99517313f7 | ||
|
|
219f57f037 | ||
|
|
d183d1120e | ||
|
|
1cafb9e84b | ||
|
|
e4776a1522 | ||
|
|
56e82d96c6 | ||
|
|
57dba3f9a2 | ||
|
|
3836131a27 | ||
|
|
dd8ad88f96 | ||
|
|
7b262d8b5b | ||
|
|
a151d12a99 | ||
|
|
a913fd9b2f | ||
|
|
c67df66098 | ||
|
|
5badafce62 | ||
|
|
5d48eea29b | ||
|
|
b6893d1208 | ||
|
|
b402969a44 | ||
|
|
3d1ed95bed | ||
|
|
4b2370f229 | ||
|
|
ab93fa0adf | ||
|
|
b608897742 | ||
|
|
0681e9217d | ||
|
|
6ed7c130cb | ||
|
|
7b8d996ef6 | ||
|
|
0423d66596 | ||
|
|
829a98e4e1 | ||
|
|
4e7e1e62b6 | ||
|
|
b678e389df | ||
|
|
5b88c7dae5 | ||
|
|
ca7bd08b57 | ||
|
|
afaccad16c | ||
|
|
98ce49ee03 | ||
|
|
66b4c457bf | ||
|
|
f0751499b3 | ||
|
|
a43d5778cb | ||
|
|
9d3f53c315 | ||
|
|
e02dad5e2c | ||
|
|
b4972eed39 | ||
|
|
f641889edd | ||
|
|
a0d0a5e214 | ||
|
|
2222af12c3 | ||
|
|
9ba6d71780 | ||
|
|
8c297737c0 | ||
|
|
8e815e90ab | ||
|
|
03628fd46b | ||
|
|
d067560776 | ||
|
|
b4aa89e810 | ||
|
|
0f0c631f2a | ||
|
|
28c4a133a6 | ||
|
|
5abdddc2e6 | ||
|
|
defb71569d | ||
|
|
efba045ad0 | ||
|
|
77a6b50307 | ||
|
|
dc7e3f5a06 | ||
|
|
3c6c059e2a | ||
|
|
00ba6554b1 | ||
|
|
dc347aeb0f | ||
|
|
15564813bc | ||
|
|
7ebe986b17 | ||
|
|
9f0ee71310 | ||
|
|
6f22bc6127 | ||
|
|
e9c263728b | ||
|
|
100ec84d57 | ||
|
|
8a30a763f0 | ||
|
|
295115b6be | ||
|
|
383b7c3cd5 | ||
|
|
895d1c8ac8 | ||
|
|
0b2a7920ae | ||
|
|
3a698e96be | ||
|
|
a5f54fd31f | ||
|
|
123b5a6073 | ||
|
|
d1bb15b883 | ||
|
|
c7a9c24871 | ||
|
|
0d5a592e1d | ||
|
|
68a37cc95d | ||
|
|
6706710d3c | ||
|
|
8be1eff5b4 | ||
|
|
69fca60836 | ||
|
|
5904d04e2e | ||
|
|
5e6ecfc3e5 | ||
|
|
879c1f3332 | ||
|
|
b36cf2bc7e | ||
|
|
70e606c071 | ||
|
|
77aae79bac | ||
|
|
2fafb3d7de | ||
|
|
38a49d68e5 | ||
|
|
525941512e | ||
|
|
079fc2bdb9 | ||
|
|
34177e00af | ||
|
|
bb2b11edf2 | ||
|
|
a41104118e | ||
|
|
f2d32d8256 | ||
|
|
5d585994ca | ||
|
|
536faa2778 | ||
|
|
793f4098b7 | ||
|
|
0d482ad9c4 | ||
|
|
eee2611c4e | ||
|
|
9d04515977 | ||
|
|
19c62d7b78 | ||
|
|
5861e38056 | ||
|
|
6cd2a06974 | ||
|
|
f0b21b3bf9 | ||
|
|
7654d29d10 | ||
|
|
c03b4c0263 | ||
|
|
daf5537aea | ||
|
|
b2ed8a57a7 | ||
|
|
7a1d64c7e2 | ||
|
|
504c461c57 | ||
|
|
2725f136fe | ||
|
|
00af3f90d8 | ||
|
|
a4c1b08ca1 | ||
|
|
8f419cbbbb | ||
|
|
8110173d8a | ||
|
|
70b4af4a65 | ||
|
|
851a4d58ec | ||
|
|
cd360a1833 | ||
|
|
96ea54a413 | ||
|
|
0d873e4ffa | ||
|
|
4b21f3a753 | ||
|
|
7d5f607b92 | ||
|
|
d7185522c0 | ||
|
|
f5ca879bff | ||
|
|
ddb541ade9 | ||
|
|
4cb9597ad9 | ||
|
|
1ae22cafa3 | ||
|
|
06f80a4645 | ||
|
|
7d744bb621 | ||
|
|
bb8f7c5ed4 | ||
|
|
aec646b5b0 | ||
|
|
91e041ba97 | ||
|
|
ab487d2a1d | ||
|
|
0faf7e24af | ||
|
|
ef74947572 | ||
|
|
b5e862e740 | ||
|
|
0053daed2f | ||
|
|
43b9b72369 | ||
|
|
55c500f34b | ||
|
|
10c6176a16 | ||
|
|
b98aeb1976 | ||
|
|
6b8b1e43ae | ||
|
|
2d7db3f0f6 | ||
|
|
c42e9ad0fb | ||
|
|
559bf2fe57 | ||
|
|
75291a9feb | ||
|
|
9ca618c3c5 | ||
|
|
bf020e3d3e | ||
|
|
d9ee41c892 | ||
|
|
0cb3cb3eae | ||
|
|
3d72d58e87 | ||
|
|
bdf7527824 | ||
|
|
2651b21b45 | ||
|
|
285fff6add | ||
|
|
80c5856732 | ||
|
|
15b908773d | ||
|
|
1b133890b0 | ||
|
|
b8db165f6e | ||
|
|
a45036c935 | ||
|
|
fe4184c6c4 | ||
|
|
5f7ebcf233 | ||
|
|
94672221e5 | ||
|
|
09e3140c0d | ||
|
|
c4971a9954 | ||
|
|
b5d54ed173 | ||
|
|
f4df648e5a | ||
|
|
b60843d3ed | ||
|
|
db0641c937 | ||
|
|
109a1a8d7a | ||
|
|
8cb8e6407a | ||
|
|
859024056a | ||
|
|
58688e6e93 | ||
|
|
e2e72ff9fd | ||
|
|
c3e5117b31 | ||
|
|
d37f316a86 | ||
|
|
41e7dc7ab1 | ||
|
|
524bea8744 | ||
|
|
ea75f161a7 | ||
|
|
e6a7ad9776 | ||
|
|
da38db1f4e | ||
|
|
adff55f89a | ||
|
|
55c8314613 | ||
|
|
a96df3cc13 | ||
|
|
4c6ed77806 | ||
|
|
5b5f59da91 | ||
|
|
5694f61e4d | ||
|
|
87b033c633 | ||
|
|
06caa046fa | ||
|
|
98100be99d | ||
|
|
f25ec3d6a7 | ||
|
|
a33e2f29e3 | ||
|
|
9bd14ebc0c | ||
|
|
5c595fdedf | ||
|
|
b9b7c75627 | ||
|
|
c2e01b3907 | ||
|
|
9295b93116 | ||
|
|
b0f5fd826c | ||
|
|
fb89f9b85b | ||
|
|
5c797b738e | ||
|
|
b817ee7f80 | ||
|
|
33174f8208 | ||
|
|
41798a2ec6 | ||
|
|
bea36accff | ||
|
|
6f74838e1e | ||
|
|
b2e255bb42 | ||
|
|
1028ea0302 | ||
|
|
f767e9aaba | ||
|
|
620c83b1e0 | ||
|
|
19b7853057 | ||
|
|
d1db7ad494 | ||
|
|
5298b8267f | ||
|
|
7f729d141f | ||
|
|
1f405b5055 | ||
|
|
516723e252 | ||
|
|
6e0ab15e47 | ||
|
|
977f1cade0 | ||
|
|
4075064384 | ||
|
|
26315f3424 | ||
|
|
f2af017925 | ||
|
|
e3575d0f43 | ||
|
|
cee302f208 | ||
|
|
922afd8310 | ||
|
|
cab18e29f5 | ||
|
|
6dbe603fcd | ||
|
|
9ed848e21f | ||
|
|
4e9e492c29 | ||
|
|
f8095ca52a | ||
|
|
211e7b08c4 | ||
|
|
6678b2858d | ||
|
|
8e9905816e | ||
|
|
edfdcee3a4 | ||
|
|
8fce610ec7 | ||
|
|
3923b49c9e | ||
|
|
1b7ee5cb2e | ||
|
|
166b2bb98f | ||
|
|
2690b06eff | ||
|
|
14010cce8f | ||
|
|
2bdc489827 | ||
|
|
b8639ceb7e | ||
|
|
eb685d3af4 | ||
|
|
6f68cc58d3 | ||
|
|
b550c3e541 | ||
|
|
40a129aafd | ||
|
|
c071cb5a49 | ||
|
|
adb5f353bf | ||
|
|
52418d7f70 | ||
|
|
3745e2afcd | ||
|
|
aa71bb545e | ||
|
|
d74fb21c9e | ||
|
|
b980c79ab4 | ||
|
|
f91b1d7f8a | ||
|
|
0b58dd4d17 | ||
|
|
c968853092 | ||
|
|
b32e06e03b | ||
|
|
69faf8db75 | ||
|
|
d689698ddd | ||
|
|
7e4eb8eed2 | ||
|
|
7d01528703 | ||
|
|
88f9f9efe1 | ||
|
|
23f09d33a2 | ||
|
|
de1652973c | ||
|
|
830d475215 | ||
|
|
c8437fd3ea | ||
|
|
df2c9eea98 | ||
|
|
09e253e833 | ||
|
|
9d541d5ac3 | ||
|
|
6d04bb8eea | ||
|
|
ec5e74019b | ||
|
|
8f15b0a32f | ||
|
|
0ce954588e | ||
|
|
0a7d817e60 | ||
|
|
483d1eb5e8 | ||
|
|
27f416a46e | ||
|
|
5e2f0ab6df | ||
|
|
c3096ed486 | ||
|
|
abaf8f07ad | ||
|
|
47a7ce9d6e | ||
|
|
41711b174f | ||
|
|
9876c7a802 | ||
|
|
cd91047b6e | ||
|
|
c5b1380299 | ||
|
|
7ec0af42b8 | ||
|
|
b9501cee37 | ||
|
|
c92510863f | ||
|
|
47456fb801 | ||
|
|
c6a7be352b | ||
|
|
0a223afab2 | ||
|
|
9f4e893290 | ||
|
|
ce6843f6a2 | ||
|
|
ae78ced3dd | ||
|
|
1749680268 | ||
|
|
379a6d259f | ||
|
|
ab8c84e1b9 | ||
|
|
b3d723d323 | ||
|
|
9659027502 | ||
|
|
9a1e23c661 | ||
|
|
66bcf066e0 | ||
|
|
5e07c2ca6d | ||
|
|
f57fa702d9 | ||
|
|
f44d119f16 | ||
|
|
be28b2990f | ||
|
|
a71180b71b | ||
|
|
1e915bc873 | ||
|
|
8faa6d516c | ||
|
|
43e557253f | ||
|
|
7a3af81d7a | ||
|
|
bbeba4a8d8 | ||
|
|
953b8c3486 | ||
|
|
0fc4d44ba2 | ||
|
|
e1a41a2853 | ||
|
|
3e4b3001ef | ||
|
|
5db0119bb6 | ||
|
|
4fc4cbf593 | ||
|
|
a8338ec49e | ||
|
|
20a1866923 | ||
|
|
cb14424110 | ||
|
|
56d00831d3 | ||
|
|
ec5fccb945 | ||
|
|
7262c4af22 | ||
|
|
d54c9d2388 | ||
|
|
5550e75893 | ||
|
|
6af050efb2 | ||
|
|
fec6c6f23e | ||
|
|
5843388d0b | ||
|
|
81881a8ed4 | ||
|
|
4bf319dcb4 | ||
|
|
d2fabeae5f | ||
|
|
b7a372e50f | ||
|
|
6850dd467d | ||
|
|
c4953e7afd | ||
|
|
0f7fbfcce8 | ||
|
|
8bdacd82c7 | ||
|
|
b03a495712 | ||
|
|
95e2cdc689 | ||
|
|
ea32cb1810 | ||
|
|
3a87f0dd30 | ||
|
|
5030cfe099 | ||
|
|
67b613dabf | ||
|
|
e8057361d6 | ||
|
|
7200242386 | ||
|
|
d5d5a72126 | ||
|
|
c582f72ea7 | ||
|
|
f665b75fc4 | ||
|
|
a0fdd752d4 | ||
|
|
072b8668fd | ||
|
|
9c74c26219 | ||
|
|
8c64abbe51 | ||
|
|
3d9cd8013d | ||
|
|
dcb2214c04 | ||
|
|
b349f3440b | ||
|
|
c8098f429d | ||
|
|
7c1bba409a | ||
|
|
fcc6b20fb6 | ||
|
|
698b5264ba | ||
|
|
a1d743aa74 | ||
|
|
1a659d4a60 | ||
|
|
2194ca5cd6 | ||
|
|
d9641d6690 | ||
|
|
291290d7f1 | ||
|
|
5cbdbf137d | ||
|
|
5cfdcc68b7 | ||
|
|
8951dcb60d | ||
|
|
4647caf383 | ||
|
|
1ae9197d89 | ||
|
|
0881225fda | ||
|
|
3ee85b7c7b | ||
|
|
11763d14c7 | ||
|
|
cf4e15c31e | ||
|
|
035dac762c | ||
|
|
a8de985e88 |
4
.env
@@ -2,7 +2,7 @@
|
||||
VITE_DEV_PORT = '8080'
|
||||
|
||||
# development path
|
||||
VITE_DEV_PATH = 'https://demo.mtruning.club'
|
||||
VITE_DEV_PATH = 'http://1.117.240.165:8080'
|
||||
|
||||
# production path
|
||||
VITE_PRO_PATH = 'https://demo.mtruning.club'
|
||||
VITE_PRO_PATH = 'http://1.117.240.165:8080'
|
||||
@@ -1,51 +0,0 @@
|
||||
version: '1.0'
|
||||
name: branch-pipeline
|
||||
displayName: BranchPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
|
||||
nodeVersion: 14.16.0
|
||||
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
|
||||
commands:
|
||||
- npm install && rm -rf ./dist && npm run build
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
|
||||
path:
|
||||
- ./dist
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_nodejs
|
||||
- stage:
|
||||
name: release
|
||||
displayName: 发布
|
||||
steps:
|
||||
- step: publish@release_artifacts
|
||||
name: publish_release_artifacts
|
||||
displayName: '发布'
|
||||
# 上游上传制品任务的产出
|
||||
dependArtifact: output
|
||||
# 发布制品版本号
|
||||
version: '1.0.0.0'
|
||||
# 是否开启版本号自增,默认开启
|
||||
autoIncrement: true
|
||||
triggers:
|
||||
push:
|
||||
branches:
|
||||
exclude:
|
||||
- master
|
||||
include:
|
||||
- .*
|
||||
@@ -1,49 +0,0 @@
|
||||
version: '1.0'
|
||||
name: master-pipeline
|
||||
displayName: MasterPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
|
||||
nodeVersion: 14.16.0
|
||||
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
|
||||
commands:
|
||||
- npm install && rm -rf ./dist && npm run build
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
|
||||
path:
|
||||
- ./dist
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_nodejs
|
||||
- stage:
|
||||
name: release
|
||||
displayName: 发布
|
||||
steps:
|
||||
- step: publish@release_artifacts
|
||||
name: publish_release_artifacts
|
||||
displayName: '发布'
|
||||
# 上游上传制品任务的产出
|
||||
dependArtifact: output
|
||||
# 发布制品版本号
|
||||
version: '1.0.0.0'
|
||||
# 是否开启版本号自增,默认开启
|
||||
autoIncrement: true
|
||||
triggers:
|
||||
push:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
@@ -1,36 +0,0 @@
|
||||
version: '1.0'
|
||||
name: pr-pipeline
|
||||
displayName: PRPipeline
|
||||
stages:
|
||||
- stage:
|
||||
name: compile
|
||||
displayName: 编译
|
||||
steps:
|
||||
- step: build@nodejs
|
||||
name: build_nodejs
|
||||
displayName: Nodejs 构建
|
||||
# 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本
|
||||
nodeVersion: 14.16.0
|
||||
# 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】
|
||||
commands:
|
||||
- npm install && rm -rf ./dist && npm run build
|
||||
# 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除
|
||||
artifacts:
|
||||
# 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址
|
||||
- name: BUILD_ARTIFACT
|
||||
# 构建产物获取路径,是指代码编译完毕之后构建物的所在路径
|
||||
path:
|
||||
- ./dist
|
||||
- step: publish@general_artifacts
|
||||
name: publish_general_artifacts
|
||||
displayName: 上传制品
|
||||
# 上游构建任务定义的产物名,默认BUILD_ARTIFACT
|
||||
dependArtifact: BUILD_ARTIFACT
|
||||
# 上传到制品库时的制品命名,默认output
|
||||
artifactName: output
|
||||
dependsOn: build_nodejs
|
||||
triggers:
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
171
README.md
@@ -1,119 +1,74 @@
|
||||
## 总览
|
||||
|
||||

|
||||
|
||||
**`master-fetch` 分支是带有后端接口请求的分支**
|
||||
|
||||
**后端项目地址:[https://gitee.com/MTrun/go-view-serve](https://gitee.com/MTrun/go-view-serve)**
|
||||
|
||||
**接口说明地址:[https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb](https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb)**
|
||||
### feat-unify-test 分支目标
|
||||
+ 实现 backend 后端工厂
|
||||
将后端业务逻辑集中到 backend 了,控制 BackEndFactory 就可以适配不同的后端。
|
||||
伪代码如下:
|
||||
export const BackEndFactory = ():IBackend=>{
|
||||
switch(项目后端配置){
|
||||
case "无数据库":
|
||||
return new MockBackend() // 等同: -master ,没有存储
|
||||
case "indexdb":
|
||||
return new IndexDbBackend() // 这次开发的,用 indexdb 做测试
|
||||
case "java":
|
||||
return new JavaBackend() // 等同: -fetch, 没 java 环境,还没做
|
||||
case "python":
|
||||
return new PythonBackend() // 自定义开发的后端
|
||||
。。。 其他 oss 、云平台的后端 。。。
|
||||
}}
|
||||
意义:
|
||||
1 unify 统一 -fetch 和 master 分支,消除分支之间的差异。
|
||||
2 方便接入不同的自定义后端平台。
|
||||
3 前端存储功能让测试工作更加方便
|
||||
|
||||
## 使用
|
||||
+ 完善事件处理机制
|
||||
在事件中修改图表配置
|
||||
在事件中修改图表数据
|
||||
在事件中调用图表 exposed 函数
|
||||
数据驱动界面
|
||||
|
||||
所有的接口地址位置:`src\api\path\*`
|
||||
### 试验功能1:Backend 后端工厂
|
||||
+ 对比 -fetch 分支,梳理后端逻辑到 backend 目录的 ibackend 接口
|
||||
+ 登录 - login
|
||||
+ 登出 - logout
|
||||
+ 预览,token 注入或单点登陆 - checkToken
|
||||
+ 显示项目列表和分页 - projectList
|
||||
+ 保存、发布、修改名称 - updateProject
|
||||
+ 复制项目 - copyProject
|
||||
+ 图表内的图片上传 - uploadFile
|
||||
+ 上传图片显示处理 - getFileUrl
|
||||
+ IndexDbBackend 用indexdb浏览器数据库实现了 project 相关所有功能。
|
||||
+ Todo: 统一后端错误处理
|
||||
+ Todo:开发 javabackend,适配现有的后端
|
||||
|
||||
接口地址修改:`.env`
|
||||
### 试验功能2:事件处理机制
|
||||
+ 实现最常用的互动:找到图表元素、显示或隐藏、修改数据
|
||||
+ 核心代码:useLifeHandler.hook.ts
|
||||
+ 在事件代码中通过 runtime 实现运行时刻的图表管理,提供基础函数:
|
||||
+ selectComponents 选择多个图表
|
||||
+ selectOneComponent 选择一个图表
|
||||
+ getChartConfig 读取图表
|
||||
+ setChartConfig 设置图表
|
||||
+ callExposed 调用图表 exposed 的函数
|
||||
+ 以下例子可以在点击事件中加入代码并预览,测试效果。
|
||||
|
||||
```shell
|
||||
# port
|
||||
VITE_DEV_PORT = '8080'
|
||||
+ 例子1 切换显示名称为 饼图 和 柱状图 的图表:
|
||||
const range = runtime.fn.selectComponents("饼图 柱状图")
|
||||
const h = runtime.fn.getChartConfig(range, "hide")
|
||||
runtime.fn.setChartConfig(range, "hide", !h)
|
||||
|
||||
# development path
|
||||
VITE_DEV_PATH = 'http://127.0.0.1:8080'
|
||||
+ 例子2 修改一个名称 柱状图001 组件id 2wolqibrx3c000 的图表数据,以下两句等效
|
||||
runtime.fn.setChartConfig("柱状图001", "dataset", {"dimensions":["product","data1","data2"],"source":[{"product":"Mon","data1":120,"data2":130}]})
|
||||
runtime.fn.setChartConfig("#2wolqibrx3c000", "dataset", {"dimensions":["product","data1","data2"],"source":[{"product":"Mon","data1":120,"data2":230}]})
|
||||
|
||||
# production path
|
||||
VITE_PRO_PATH = 'http://127.0.0.1:8080'
|
||||
```
|
||||
|
||||
公共前缀修改:`src\settings\httpSetting.ts`
|
||||
|
||||
```shell
|
||||
// 请求前缀
|
||||
export const axiosPre = '/api/goview'
|
||||
```
|
||||
|
||||
接口封装:`src\api\http.ts`
|
||||
|
||||
```ts
|
||||
import axiosInstance from './axios'
|
||||
import { RequestHttpEnum, ContentTypeEnum } from '@/enums/httpEnum'
|
||||
|
||||
export const get = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.GET,
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
export const post = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.POST,
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const put = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.PUT,
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const del = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.DELETE,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取请求函数,默认get
|
||||
export const http = (type?: RequestHttpEnum) => {
|
||||
switch (type) {
|
||||
case RequestHttpEnum.GET:
|
||||
return get
|
||||
|
||||
case RequestHttpEnum.POST:
|
||||
return post
|
||||
|
||||
case RequestHttpEnum.PUT:
|
||||
return put
|
||||
|
||||
case RequestHttpEnum.DELETE:
|
||||
return del
|
||||
|
||||
default:
|
||||
return get
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## 代码提交
|
||||
|
||||
* feat: 新功能
|
||||
* fix: 修复 Bug
|
||||
* docs: 文档修改
|
||||
* perf: 性能优化
|
||||
* revert: 版本回退
|
||||
* ci: CICD集成相关
|
||||
* test: 添加测试代码
|
||||
* refactor: 代码重构
|
||||
* build: 影响项目构建或依赖修改
|
||||
* style: 不影响程序逻辑的代码修改
|
||||
* chore: 不属于以上类型的其他类型(日常事务)
|
||||
|
||||
## 交流
|
||||
|
||||
QQ 群:1030129384
|
||||
|
||||

|
||||
|
||||

|
||||
+ 例子3 找到一个组并隐藏
|
||||
const c = runtime.fn.selectOneComponent("分组")
|
||||
if(c){
|
||||
console.log(runtime.fn.getChartConfig(c, "isGroup" ))
|
||||
runtime.fn.setChartConfig(c, "hide", true)
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import path from 'path'
|
||||
export const OUTPUT_DIR = 'dist'
|
||||
|
||||
// monaco-editor 路径
|
||||
@@ -7,7 +6,7 @@ export const prefix = `monaco-editor/esm/vs`
|
||||
// chunk 警告大小
|
||||
export const chunkSizeWarningLimit = 2000
|
||||
|
||||
// 禁用 brotliSize 压缩大小报告
|
||||
// 禁用 brotli 压缩大小报告
|
||||
export const brotliSize = false
|
||||
|
||||
// 分包
|
||||
@@ -15,12 +14,7 @@ export const rollupOptions = {
|
||||
output: {
|
||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/js/[name]-[hash].js',
|
||||
assetFileNames: (chunkInfo) => {
|
||||
if(['.png', '.jpg', '.jpeg'].includes(path.extname(chunkInfo.name))) {
|
||||
return `static/[ext]/[name].[ext]`
|
||||
}
|
||||
return `static/[ext]/[name]-[hash].[ext]`
|
||||
},
|
||||
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
|
||||
manualChunks: {
|
||||
jsonWorker: [`${prefix}/language/json/json.worker`],
|
||||
cssWorker: [`${prefix}/language/css/css.worker`],
|
||||
|
||||
17
package.json
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"name": "go-view",
|
||||
"version": "2.2.2",
|
||||
"engines": {
|
||||
"node": ">=12.0"
|
||||
},
|
||||
"version": "2.1.0",
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
@@ -14,8 +11,6 @@
|
||||
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx,.vue src --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "^1.0.1",
|
||||
"@amap/amap-jsapi-types": "^0.0.8",
|
||||
"@types/color": "^3.0.3",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/keymaster": "^1.6.30",
|
||||
@@ -24,8 +19,6 @@
|
||||
"axios": "^0.27.2",
|
||||
"color": "^4.2.3",
|
||||
"crypto-js": "^4.1.1",
|
||||
"dayjs": "^1.11.7",
|
||||
"dom-helpers": "^5.2.1",
|
||||
"echarts-liquidfill": "^3.1.0",
|
||||
"echarts-stat": "^1.2.0",
|
||||
"echarts-wordcloud": "^2.0.0",
|
||||
@@ -34,13 +27,13 @@
|
||||
"html2canvas": "^1.4.1",
|
||||
"keymaster": "^1.6.2",
|
||||
"monaco-editor": "^0.33.0",
|
||||
"naive-ui": "2.34.3",
|
||||
"naive-ui": "2.33.4",
|
||||
"pinia": "^2.0.13",
|
||||
"screenfull": "^6.0.1",
|
||||
"three": "^0.145.0",
|
||||
"vue": "^3.2.31",
|
||||
"vue-demi": "^0.13.1",
|
||||
"vue-i18n": "^9.2.2",
|
||||
"vue-i18n": "9.1.10",
|
||||
"vue-router": "4.0.12",
|
||||
"vue3-lazyload": "^0.2.5-beta",
|
||||
"vue3-sketch-ruler": "^1.3.3",
|
||||
@@ -75,7 +68,7 @@
|
||||
"sass": "^1.49.11",
|
||||
"sass-loader": "^12.6.0",
|
||||
"typescript": "4.6.3",
|
||||
"vite": "4.2.1",
|
||||
"vite": "2.9.9",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-importer": "^0.2.5",
|
||||
"vite-plugin-mock": "^2.9.6",
|
||||
@@ -83,4 +76,4 @@
|
||||
"vue-echarts": "^6.0.2",
|
||||
"vue-tsc": "^0.28.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
2920
pnpm-lock.yaml
generated
13
src/App.vue
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<n-config-provider
|
||||
:locale="zhCN"
|
||||
:theme="darkTheme"
|
||||
:hljs="hljsTheme"
|
||||
:locale="locale"
|
||||
:date-locale="dateLocale"
|
||||
:date-locale="dateZhCN"
|
||||
:theme-overrides="overridesTheme"
|
||||
>
|
||||
<go-app-provider>
|
||||
@@ -14,10 +14,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { NConfigProvider } from 'naive-ui'
|
||||
import { zhCN, dateZhCN, NConfigProvider } from 'naive-ui'
|
||||
import { GoAppProvider } from '@/components/GoAppProvider'
|
||||
import { I18n } from '@/components/I18n'
|
||||
import { useSystemInit, useDarkThemeHook, useThemeOverridesHook, useCode, useLang } from '@/hooks'
|
||||
|
||||
import { useSystemInit, useDarkThemeHook, useThemeOverridesHook, useCode } from '@/hooks'
|
||||
|
||||
// 暗黑主题
|
||||
const darkTheme = useDarkThemeHook()
|
||||
@@ -30,8 +31,4 @@ const hljsTheme = useCode()
|
||||
|
||||
// 系统全局数据初始化
|
||||
useSystemInit()
|
||||
|
||||
// 全局语言
|
||||
const { locale, dateLocale } = useLang()
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,82 +1,29 @@
|
||||
import axios, { AxiosResponse, AxiosRequestConfig, Axios } from 'axios'
|
||||
import { ResultEnum, ModuleTypeEnum } from "@/enums/httpEnum"
|
||||
import { PageEnum, ErrorPageNameMap } from "@/enums/pageEnum"
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
import { axiosPre } from '@/settings/httpSetting'
|
||||
import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
|
||||
import { redirectErrorPage, getLocalStorage, routerTurnByName, isPreview } from '@/utils'
|
||||
import { fetchAllowList } from './axios.config'
|
||||
import includes from 'lodash/includes'
|
||||
|
||||
export interface MyResponseType<T> {
|
||||
code: ResultEnum
|
||||
data: T
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface MyRequestInstance extends Axios {
|
||||
<T = any>(config: AxiosRequestConfig): Promise<MyResponseType<T>>
|
||||
}
|
||||
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios'
|
||||
import { ResultEnum } from "@/enums/httpEnum"
|
||||
import { ErrorPageNameMap } from "@/enums/pageEnum"
|
||||
import { redirectErrorPage } from '@/utils'
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : ''}${axiosPre}`,
|
||||
baseURL: import.meta.env.DEV ? import.meta.env.VITE_DEV_PATH : import.meta.env.VITE_PRO_PATH,
|
||||
timeout: ResultEnum.TIMEOUT,
|
||||
}) as unknown as MyRequestInstance
|
||||
})
|
||||
|
||||
axiosInstance.interceptors.request.use(
|
||||
(config: AxiosRequestConfig) => {
|
||||
// 白名单校验
|
||||
if (includes(fetchAllowList, config.url)) return config
|
||||
// 获取 token
|
||||
const info = getLocalStorage(StorageEnum.GO_SYSTEM_STORE)
|
||||
// 重新登录
|
||||
if (!info) {
|
||||
routerTurnByName(PageEnum.BASE_LOGIN_NAME)
|
||||
return config
|
||||
}
|
||||
const userInfo = info[SystemStoreEnum.USER_INFO]
|
||||
config.headers = {
|
||||
...config.headers,
|
||||
[userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || ''
|
||||
}
|
||||
return config
|
||||
},
|
||||
(err: AxiosRequestConfig) => {
|
||||
Promise.reject(err)
|
||||
(error: AxiosRequestConfig) => {
|
||||
Promise.reject(error)
|
||||
}
|
||||
)
|
||||
|
||||
// 响应拦截器
|
||||
axiosInstance.interceptors.response.use(
|
||||
(res: AxiosResponse) => {
|
||||
// 预览页面错误不进行处理
|
||||
if (isPreview()) {
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
const { code } = res.data as { code: number }
|
||||
|
||||
if (code === undefined || code === null) return Promise.resolve(res.data)
|
||||
|
||||
// 成功
|
||||
if (code === ResultEnum.SUCCESS) {
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 登录过期
|
||||
if (code === ResultEnum.TOKEN_OVERDUE) {
|
||||
window['$message'].error(window['$t']('http.token_overdue_message'))
|
||||
routerTurnByName(PageEnum.BASE_LOGIN_NAME)
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 固定错误码重定向
|
||||
if (ErrorPageNameMap.get(code)) {
|
||||
redirectErrorPage(code)
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 提示错误
|
||||
window['$message'].error(window['$t']((res.data as any).msg))
|
||||
if (code === ResultEnum.SUCCESS) return Promise.resolve(res.data)
|
||||
// 重定向
|
||||
if (ErrorPageNameMap.get(code)) redirectErrorPage(code)
|
||||
return Promise.resolve(res.data)
|
||||
},
|
||||
(err: AxiosResponse) => {
|
||||
|
||||
@@ -9,16 +9,16 @@ import {
|
||||
} from '@/enums/httpEnum'
|
||||
import type { RequestGlobalConfigType, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
|
||||
export const get = <T = any>(url: string, params?: object) => {
|
||||
return axiosInstance<T>({
|
||||
export const get = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.GET,
|
||||
params: params,
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const post = <T = any>(url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance<T>({
|
||||
export const post = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.POST,
|
||||
data: data,
|
||||
@@ -28,8 +28,8 @@ export const post = <T = any>(url: string, data?: object, headersType?: string)
|
||||
})
|
||||
}
|
||||
|
||||
export const patch = <T = any>(url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance<T>({
|
||||
export const patch = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.PATCH,
|
||||
data: data,
|
||||
@@ -39,8 +39,8 @@ export const patch = <T = any>(url: string, data?: object, headersType?: string)
|
||||
})
|
||||
}
|
||||
|
||||
export const put = <T = any>(url: string, data?: object, headersType?: ContentTypeEnum) => {
|
||||
return axiosInstance<T>({
|
||||
export const put = (url: string, data?: object, headersType?: ContentTypeEnum) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.PUT,
|
||||
data: data,
|
||||
@@ -50,8 +50,8 @@ export const put = <T = any>(url: string, data?: object, headersType?: ContentTy
|
||||
})
|
||||
}
|
||||
|
||||
export const del = <T = any>(url: string, params?: object) => {
|
||||
return axiosInstance<T>({
|
||||
export const del = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.DELETE,
|
||||
params
|
||||
@@ -82,11 +82,11 @@ export const http = (type?: RequestHttpEnum) => {
|
||||
}
|
||||
const prefix = 'javascript:'
|
||||
// 对输入字符进行转义处理
|
||||
export const translateStr = (target: string | Record<any, any>) => {
|
||||
export const translateStr = (target: string | object) => {
|
||||
if (typeof target === 'string') {
|
||||
if (target.startsWith(prefix)) {
|
||||
const funcStr = target.split(prefix)[1]
|
||||
let result
|
||||
let result;
|
||||
try {
|
||||
result = new Function(`${funcStr}`)()
|
||||
} catch (error) {
|
||||
@@ -100,8 +100,8 @@ export const translateStr = (target: string | Record<any, any>) => {
|
||||
}
|
||||
for (const key in target) {
|
||||
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
||||
const subTarget = target[key]
|
||||
target[key] = translateStr(subTarget)
|
||||
const subTarget = (target as any)[key];
|
||||
(target as any)[key] = translateStr(subTarget)
|
||||
}
|
||||
}
|
||||
return target
|
||||
@@ -116,6 +116,7 @@ export const customizeHttp = (targetParams: RequestConfigType, globalParams: Req
|
||||
if (!targetParams || !globalParams) {
|
||||
return
|
||||
}
|
||||
|
||||
// 全局
|
||||
const {
|
||||
// 全局请求源地址
|
||||
@@ -172,9 +173,7 @@ export const customizeHttp = (targetParams: RequestConfigType, globalParams: Req
|
||||
|
||||
case RequestBodyEnum.JSON:
|
||||
headers['Content-Type'] = ContentTypeEnum.JSON
|
||||
//json对象也能使用'javasctipt:'来动态拼接参数
|
||||
data = translateStr(targetRequestParams.Body['json'])
|
||||
if(typeof data === 'string') data = JSON.parse(data)
|
||||
data = translateStr(JSON.parse(targetRequestParams.Body['json']))
|
||||
// json 赋值给 data
|
||||
break
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
{
|
||||
"nodes": [
|
||||
{
|
||||
"id": "0",
|
||||
"name": "Myriel",
|
||||
"symbolSize": "@integer(0, 50)",
|
||||
"x": -266.82776,
|
||||
"y": 299.6904,
|
||||
"value": "@integer(0, 50)",
|
||||
"category": 3
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"name": "Napoleon",
|
||||
"symbolSize": "@integer(0, 50)",
|
||||
"x": -418.08344,
|
||||
"y": 446.8853,
|
||||
"value": "@integer(0, 50)",
|
||||
"category": 5
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"name": "MlleBaptistine",
|
||||
"symbolSize": "@integer(0, 50)",
|
||||
"x": -212.76357,
|
||||
"y": 245.29176,
|
||||
"value": "@integer(0, 50)",
|
||||
"category": 1
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"name": "MmeMagloire",
|
||||
"symbolSize": "@integer(0, 50)",
|
||||
"x": -242.82404,
|
||||
"y": 235.26283,
|
||||
"value": "@integer(0, 50)",
|
||||
"category": 1
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"name": "CountessDeLo",
|
||||
"symbolSize": "@integer(0, 50)",
|
||||
"x": -379.30386,
|
||||
"y": 429.06424,
|
||||
"value": "@integer(0, 50)",
|
||||
"category": 0
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"source": "1",
|
||||
"target": "@integer(2, 4)"
|
||||
},
|
||||
{
|
||||
"source": "2",
|
||||
"target": "@integer(3, 4)"
|
||||
},
|
||||
{
|
||||
"source": "3",
|
||||
"target": "@integer(0, 2)"
|
||||
},
|
||||
{
|
||||
"source": "3",
|
||||
"target": "@integer(0, 1)"
|
||||
},
|
||||
{
|
||||
"source": "4",
|
||||
"target": "@integer(0, 3)"
|
||||
}
|
||||
],
|
||||
"categories": [
|
||||
{
|
||||
"name": "A"
|
||||
},
|
||||
{
|
||||
"name": "B"
|
||||
},
|
||||
{
|
||||
"name": "C"
|
||||
},
|
||||
{
|
||||
"name": "D"
|
||||
},
|
||||
{
|
||||
"name": "E"
|
||||
},
|
||||
{
|
||||
"name": "F"
|
||||
},
|
||||
{
|
||||
"name": "G"
|
||||
},
|
||||
{
|
||||
"name": "H"
|
||||
},
|
||||
{
|
||||
"name": "I"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -15,12 +15,9 @@ export const radarUrl = '/mock/radarData'
|
||||
export const heatMapUrl = '/mock/heatMapData'
|
||||
export const scatterBasicUrl = '/mock/scatterBasic'
|
||||
export const mapUrl = '/mock/map'
|
||||
export const capsuleUrl = '/mock/capsule'
|
||||
export const wordCloudUrl = '/mock/wordCloud'
|
||||
export const treemapUrl = '/mock/treemap'
|
||||
export const threeEarth01Url = '/mock/threeEarth01Data'
|
||||
export const sankeyUrl = '/mock/sankey'
|
||||
export const graphUrl = '/mock/graphData'
|
||||
|
||||
const mockObject: MockMethod[] = [
|
||||
{
|
||||
@@ -85,11 +82,6 @@ const mockObject: MockMethod[] = [
|
||||
method: RequestHttpEnum.GET,
|
||||
response: () => test.fetchMap
|
||||
},
|
||||
{
|
||||
url: capsuleUrl,
|
||||
method: RequestHttpEnum.GET,
|
||||
response: () => test.fetchCapsule
|
||||
},
|
||||
{
|
||||
url: wordCloudUrl,
|
||||
method: RequestHttpEnum.GET,
|
||||
@@ -105,16 +97,6 @@ const mockObject: MockMethod[] = [
|
||||
method: RequestHttpEnum.GET,
|
||||
response: () => test.threeEarth01Data
|
||||
},
|
||||
{
|
||||
url: sankeyUrl,
|
||||
method: RequestHttpEnum.GET,
|
||||
response: () => test.fetchSankey
|
||||
},
|
||||
{
|
||||
url: graphUrl,
|
||||
method: RequestHttpEnum.GET,
|
||||
response: () => test.graphData
|
||||
},
|
||||
]
|
||||
|
||||
export default mockObject
|
||||
|
||||
@@ -1,9 +1,79 @@
|
||||
{
|
||||
"markers|50": [
|
||||
"point": [
|
||||
{
|
||||
"name": "某某地市",
|
||||
"value": "@integer(2, 20)",
|
||||
"position": ["@float(115, 117, 1, 6)", "@float(38, 40, 1, 6)"]
|
||||
"name": "北京",
|
||||
"value": [116.405285, 39.904989, 200]
|
||||
},
|
||||
{
|
||||
"name": "郑州",
|
||||
"value": [113.665412, 34.757975, 888]
|
||||
},
|
||||
{
|
||||
"name": "青海",
|
||||
"value": [101.778916, 36.623178, 666]
|
||||
},
|
||||
{
|
||||
"name": "宁夏回族自治区",
|
||||
"value": [106.278179, 38.46637, 66]
|
||||
},
|
||||
{
|
||||
"name": "哈尔滨市",
|
||||
"value": [126.642464, 45.756967, 101]
|
||||
}
|
||||
],
|
||||
"map": [
|
||||
{
|
||||
"name": "北京市",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "河北省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
|
||||
{
|
||||
"name": "江苏省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "福建省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "山东省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "河南省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "湖北省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "广西壮族自治区",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "海南省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "青海省",
|
||||
"value": "@integer(0, 1000)"
|
||||
},
|
||||
{
|
||||
"name": "新疆维吾尔自治区",
|
||||
"value": "@integer(0, 1000)"
|
||||
}
|
||||
],
|
||||
"pieces": [
|
||||
{ "gte": 1000, "label": ">1000" },
|
||||
{ "gte": 600, "lte": 999, "label": "600-999" },
|
||||
{ "gte": 200, "lte": 599, "label": "200-599" },
|
||||
{ "gte": 50, "lte": 199, "label": "49-199" },
|
||||
{ "gte": 10, "lte": 49, "label": "10-49" },
|
||||
{ "lte": 9, "label": "<9" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
{
|
||||
"label": [
|
||||
{
|
||||
"name": "a"
|
||||
},
|
||||
{
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"name": "a1"
|
||||
},
|
||||
{
|
||||
"name": "a2"
|
||||
},
|
||||
{
|
||||
"name": "b1"
|
||||
},
|
||||
{
|
||||
"name": "b2"
|
||||
}
|
||||
],
|
||||
"links": [
|
||||
{
|
||||
"source": "a",
|
||||
"target": "a1",
|
||||
"value": "@integer(0, 10)"
|
||||
},
|
||||
{
|
||||
"source": "a",
|
||||
"target": "a2",
|
||||
"value": "@integer(0, 10)"
|
||||
},
|
||||
{
|
||||
"source": "b",
|
||||
"target": "b1",
|
||||
"value": "@integer(0, 10)"
|
||||
},
|
||||
{
|
||||
"source": "a",
|
||||
"target": "b1",
|
||||
"value": "@integer(0, 10)"
|
||||
},
|
||||
{
|
||||
"source": "b1",
|
||||
"target": "a1",
|
||||
"value": "@integer(0, 10)"
|
||||
},
|
||||
{
|
||||
"source": "b1",
|
||||
"target": "b2",
|
||||
"value": "@integer(0, 10)"
|
||||
}
|
||||
],
|
||||
"levels": [
|
||||
{
|
||||
"depth": 0,
|
||||
"itemStyle": {
|
||||
"color": "#decbe4"
|
||||
},
|
||||
"lineStyle": {
|
||||
"color": "source",
|
||||
"opacity": 0.9
|
||||
}
|
||||
},
|
||||
{
|
||||
"depth": 1,
|
||||
"itemStyle": {
|
||||
"color": "#b3cde3"
|
||||
},
|
||||
"lineStyle": {
|
||||
"color": "source",
|
||||
"opacity": 0.6
|
||||
}
|
||||
},
|
||||
{
|
||||
"depth": 2,
|
||||
"itemStyle": {
|
||||
"color": "#ccebc5"
|
||||
},
|
||||
"lineStyle": {
|
||||
"color": "source",
|
||||
"opacity": 0.6
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,8 +2,6 @@ import heatmapJson from './heatMapData.json'
|
||||
import scatterJson from './scatter.json'
|
||||
import mapJson from './map.json'
|
||||
import tTreemapJson from './treemap.json'
|
||||
import sankeyJson from './sankey.json'
|
||||
import graphDataJson from './graph.json'
|
||||
|
||||
export default {
|
||||
// 单图表
|
||||
@@ -12,8 +10,28 @@ export default {
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
data: {
|
||||
dimensions: ['product', 'dataOne'],
|
||||
'source|20': [
|
||||
dimensions: ['product', 'dataOne'],
|
||||
source: [
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|0-900': 3
|
||||
@@ -21,31 +39,43 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
// 胶囊图
|
||||
fetchCapsule: {
|
||||
code: 0,
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
data: {
|
||||
dimensions: ['name', 'value'],
|
||||
"source|2-5": [
|
||||
{ 'name|+1': ["厦门","福州","北京","上海","新疆","郑州","湖南","内蒙古"], 'value|0-40': 20 },
|
||||
]
|
||||
}
|
||||
},
|
||||
// 图表
|
||||
fetchMockData: {
|
||||
code: 0,
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
data: {
|
||||
dimensions: ['product', 'dataOne', 'dataTwo', 'dataThree'],
|
||||
'source|20': [
|
||||
dimensions: ['product', 'dataOne', 'dataTwo'],
|
||||
source: [
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3,
|
||||
'dataThree|100-900': 3
|
||||
'dataTwo|100-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3
|
||||
},
|
||||
{
|
||||
product: '@name',
|
||||
'dataOne|100-900': 3,
|
||||
'dataTwo|100-900': 3
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -55,7 +85,21 @@ export default {
|
||||
code: 0,
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
'data|50': [{ name: '@name', 'value|100-900': 5 }]
|
||||
data: [
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 },
|
||||
{ name: '@name', 'value|100-900': 5 }
|
||||
]
|
||||
},
|
||||
// 轮播表格
|
||||
fetchScrollBoard: {
|
||||
@@ -218,22 +262,13 @@ export default {
|
||||
data: [
|
||||
{
|
||||
startArray: { name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' },
|
||||
'endArray|10': [{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }]
|
||||
endArray: [
|
||||
{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' },
|
||||
{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' },
|
||||
{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' },
|
||||
{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
// 桑基图
|
||||
fetchSankey: {
|
||||
code: 0,
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
data: sankeyJson
|
||||
},
|
||||
// 关系图
|
||||
graphData: {
|
||||
code: 0,
|
||||
status: 200,
|
||||
msg: '请求成功',
|
||||
data: graphDataJson
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,99 +1,84 @@
|
||||
import { http } from '@/api/http'
|
||||
import { httpErrorHandle } from '@/utils'
|
||||
import { ContentTypeEnum, RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum'
|
||||
import { ProjectItem, ProjectDetail } from './project'
|
||||
|
||||
// * 项目列表
|
||||
export const projectListApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)<ProjectItem[]>(`${ModuleTypeEnum.PROJECT}/list`, data)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/list`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 新增项目
|
||||
export const createProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)<{
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
id: number
|
||||
}>(`${ModuleTypeEnum.PROJECT}/create`, data)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/create`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 获取项目
|
||||
export const fetchProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)<ProjectDetail>(`${ModuleTypeEnum.PROJECT}/getData`, data)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.PROJECT}/getData`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 保存项目
|
||||
export const saveProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(
|
||||
`${ModuleTypeEnum.PROJECT}/save/data`,
|
||||
data,
|
||||
ContentTypeEnum.FORM_URLENCODED
|
||||
)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/save/data`, data, ContentTypeEnum.FORM_URLENCODED);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 修改项目基础信息
|
||||
export const updateProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/edit`, data)
|
||||
return res
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.PROJECT}/edit`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * 删除项目
|
||||
export const deleteProjectApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.DELETE)(`${ModuleTypeEnum.PROJECT}/delete`, data)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.DELETE)(`${ModuleTypeEnum.PROJECT}/delete`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 修改发布状态 [-1未发布,1发布]
|
||||
export const changeProjectReleaseApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/publish`, data)
|
||||
return res
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.PUT)(`${ModuleTypeEnum.PROJECT}/publish`, data);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 上传文件
|
||||
export const uploadFile = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)<{
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
fileName: string,
|
||||
fileurl: string,
|
||||
}>(`${ModuleTypeEnum.PROJECT}/upload`, data, ContentTypeEnum.FORM_DATA)
|
||||
return res
|
||||
export const uploadFile = async (url:string, data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)(url, data, ContentTypeEnum.FORM_DATA);
|
||||
return res;
|
||||
} catch {
|
||||
httpErrorHandle()
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
39
src/api/path/project.d.ts
vendored
@@ -1,39 +0,0 @@
|
||||
export type ProjectItem = {
|
||||
/**
|
||||
* 项目 id
|
||||
*/
|
||||
id: string
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
projectName: string
|
||||
/**
|
||||
* 项目状态:\
|
||||
* -1: 未发布\
|
||||
* 1: 已发布
|
||||
*/
|
||||
state: number
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime: string
|
||||
/**
|
||||
* 预览图片url
|
||||
*/
|
||||
indexImage: string
|
||||
/**
|
||||
* 创建者 id
|
||||
*/
|
||||
createUserId: string
|
||||
/**
|
||||
* 项目备注
|
||||
*/
|
||||
remarks: string
|
||||
}
|
||||
|
||||
export interface ProjectDetail extends ProjectItem {
|
||||
/**
|
||||
* 项目参数
|
||||
*/
|
||||
content: string
|
||||
}
|
||||
@@ -1,39 +1,33 @@
|
||||
import { http } from '@/api/http'
|
||||
import { httpErrorHandle } from '@/utils'
|
||||
import { RequestHttpEnum, ModuleTypeEnum } from '@/enums/httpEnum'
|
||||
import { LoginResult } from './system'
|
||||
|
||||
// * 登录
|
||||
export const loginApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.POST)<LoginResult>(`${ModuleTypeEnum.SYSTEM}/login`, data)
|
||||
return res
|
||||
} catch (err) {
|
||||
httpErrorHandle()
|
||||
const res = await http(RequestHttpEnum.POST)(`${ModuleTypeEnum.SYSTEM}/login`, data);
|
||||
return res;
|
||||
} catch(err) {
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 登出
|
||||
export const logoutApi = async () => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/logout`)
|
||||
return res
|
||||
} catch (err) {
|
||||
httpErrorHandle()
|
||||
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/logout`);
|
||||
return res;
|
||||
} catch(err) {
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
|
||||
// * 获取 oss 上传接口
|
||||
export const ossUrlApi = async (data: object) => {
|
||||
try {
|
||||
const res = await http(RequestHttpEnum.GET)<{
|
||||
/**
|
||||
* bucket 地址
|
||||
*/
|
||||
bucketURL?: string
|
||||
}>(`${ModuleTypeEnum.SYSTEM}/getOssInfo`, data)
|
||||
return res
|
||||
} catch (err) {
|
||||
httpErrorHandle()
|
||||
const res = await http(RequestHttpEnum.GET)(`${ModuleTypeEnum.SYSTEM}/getOssInfo`, data);
|
||||
return res;
|
||||
} catch(err) {
|
||||
httpErrorHandle();
|
||||
}
|
||||
}
|
||||
}
|
||||
26
src/api/path/system.d.ts
vendored
@@ -1,26 +0,0 @@
|
||||
export interface LoginResult {
|
||||
token: {
|
||||
/**
|
||||
* token 值
|
||||
*/
|
||||
tokenValue: string
|
||||
/**
|
||||
* token key
|
||||
*/
|
||||
tokenName: string
|
||||
}
|
||||
userinfo: {
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
nickname: string
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
username: string
|
||||
/**
|
||||
* 用户 id
|
||||
*/
|
||||
id: string
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 15 KiB |
BIN
src/assets/images/project/moke-20211219181327.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
src/assets/videos/earth.mp4
Normal file
146
src/backend/ibackend.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
|
||||
/**
|
||||
* 后端接口,相关功能对应表:
|
||||
* 登录 - login
|
||||
* 登出 - logout
|
||||
* 预览,token 注入或单点登陆 - checkToken
|
||||
* 显示项目列表和分页 - projectList
|
||||
* 保存、发布、修改名称 - updateProject
|
||||
* 复制项目 - copyProject
|
||||
* 图表内的图片上传 - uploadFile
|
||||
* 上传图片显示处理 - getFileUrl
|
||||
* 所有接口返回格式:MyResponseType
|
||||
*/
|
||||
import { IndexDbBackend } from "./indexdb/indexdbbackend";
|
||||
// import { PythonBackend } from "./python/pythonbackend";
|
||||
|
||||
export interface MyResponseType {
|
||||
code: number; // 状态:200 表示接口调用成功,参考:HttpEnum
|
||||
msg: string; // 提示信息,配合 data 和 code
|
||||
data: any; // data = null 表示接口结果错误,错误原因放在 msg
|
||||
}
|
||||
|
||||
export class MyResponse implements MyResponseType {
|
||||
code: number = 200;
|
||||
msg: string = "";
|
||||
data: any = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现 IBackend 后端接口
|
||||
* 错误处理:
|
||||
*/
|
||||
export interface IBackend {
|
||||
/**
|
||||
* 初始化后端系统,测试后端连接,oss地址等
|
||||
* @param data 可选,备用
|
||||
*/
|
||||
init(data:any):any
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
* @param data {} .username .password
|
||||
* @return MyResponseType
|
||||
* .data 须包含:
|
||||
* token:{tokenValue:"", tokenName:""},
|
||||
* userinfo:{nickname:"", username: "", id: 用户ID}
|
||||
* 错误处理:
|
||||
* 1 接口错误 .code 不为 200 .msg 可选,后端反馈错误信息
|
||||
* 2 登陆错误 .code=200 .data = null, msg 可选,反馈不能登陆的原因
|
||||
* 登陆信息.data 记录:
|
||||
* setLocalStorage(GO_LOGIN_INFO_STORE, res.data)
|
||||
*/
|
||||
login(data:any):any
|
||||
|
||||
/**
|
||||
* 通知后端登出
|
||||
*/
|
||||
logout():any
|
||||
|
||||
/**
|
||||
* 检查Token是否有效,配合预览页面和单点登陆,备用
|
||||
* @param data {tokenValue, tokenName}
|
||||
* @return 同 login()
|
||||
*/
|
||||
checkToken(data:any):any
|
||||
|
||||
/**
|
||||
* 项目列表
|
||||
* @param data {} .page, .limit
|
||||
* @return [项目],字段名称需要进行 map
|
||||
* id: projectId
|
||||
* title:projectName
|
||||
* release,
|
||||
* label:remarks
|
||||
* image:indexImage 如果需要挂刷新,在这里处理。如果需要拼接 url(getFileUrl),也在这里处理好。
|
||||
*/
|
||||
projectList(data:any):any
|
||||
|
||||
/**
|
||||
* 新增项目
|
||||
* @param data
|
||||
* .projectName
|
||||
* @return id 新项目 ID
|
||||
*/
|
||||
createProject(data: any):any
|
||||
|
||||
/**
|
||||
* 获取项目
|
||||
* @param data .projectId
|
||||
* @return
|
||||
id:projectId
|
||||
projectName,
|
||||
state: release,
|
||||
remarks,
|
||||
content
|
||||
*/
|
||||
fetchProject(data: any):any
|
||||
|
||||
/**
|
||||
* 修改项目
|
||||
* @param data
|
||||
* .projectId 必须
|
||||
* .projectName 可选
|
||||
* .release 可选
|
||||
* .content 可选
|
||||
* .object File 可选 对象
|
||||
* .remarks 可选
|
||||
* @return
|
||||
*/
|
||||
updateProject(data: any):any
|
||||
|
||||
/**
|
||||
* 复制项目
|
||||
* @param data
|
||||
* .copyId 需要复制的项目ID
|
||||
* .projectName
|
||||
* @return id 新项目ID
|
||||
*/
|
||||
copyProject(data: any):any
|
||||
|
||||
/**
|
||||
* 删除项目
|
||||
* @param data
|
||||
* .projectId
|
||||
* @return
|
||||
*/
|
||||
deleteProject(data: any):any
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* @param file File 图片对象
|
||||
* @param params 备用 Todo: 上传文件可带上项目ID和其他附加信息,以便后端文件管理
|
||||
* @return .uri 文件对象 uri。建议在图表中保存相对地址,通过 getFileUrl 得到完整地址
|
||||
*/
|
||||
uploadFile(file: File, params: any):any
|
||||
/**
|
||||
* 文件地址转换,处理 uploadFile 的返回地址。如果是绝对地址,可以不处理
|
||||
* @param uploadUri 上传返回的 uri
|
||||
* @return 供 image.src 使用的地址信息
|
||||
*/
|
||||
getFileUrl(uploadUri:string):string
|
||||
}
|
||||
|
||||
export const BackEndFactory = new IndexDbBackend();
|
||||
// export const BackEndFactory = new MockBackend();
|
||||
// export const BackEndFactory = new PythonBackend();
|
||||
147
src/backend/indexdb/indexdb.ts
Normal file
@@ -0,0 +1,147 @@
|
||||
/**
|
||||
* IndexDb 帮助类
|
||||
*/
|
||||
|
||||
const win: { [k: string]: any } = window || globalThis;
|
||||
const indexedDB =
|
||||
win.indexedDB || win.mozIndexedDB || win.webkitIndexedDB || win.msIndexedDB;
|
||||
const dbs: { [k: string]: IDBDatabase } = {};
|
||||
let databaseName: string;
|
||||
let request: IDBOpenDBRequest;
|
||||
interface AnyEvent {
|
||||
[k: string]: any;
|
||||
}
|
||||
|
||||
export interface TableOption {
|
||||
storeName: string;
|
||||
option: { [K: string]: any };
|
||||
index: { [K: string]: any }[];
|
||||
}
|
||||
|
||||
export const createDB = (
|
||||
name: string,
|
||||
version?: string,
|
||||
options?: TableOption[],
|
||||
) =>
|
||||
new Promise<IDBDatabase>((resolve, reject) => {
|
||||
if (!indexedDB) reject('浏览器不支持indexedDB');
|
||||
databaseName = name;
|
||||
if (dbs?.[name]) {
|
||||
resolve(dbs[name]);
|
||||
return;
|
||||
}
|
||||
request = indexedDB.open(name, version);
|
||||
createTable(options)?.then((db: IDBDatabase) => resolve(db));
|
||||
request.onsuccess = (event: AnyEvent) => {
|
||||
// IDBDatabase
|
||||
const db = event.target.result;
|
||||
// 缓存起来
|
||||
dbs[name] = db;
|
||||
resolve(db);
|
||||
};
|
||||
request.onerror = (event: AnyEvent) => reject(event);
|
||||
});
|
||||
|
||||
export const createTable = (options?: TableOption[]) => {
|
||||
if (!options) return;
|
||||
return new Promise<IDBDatabase>((resolve) => {
|
||||
request.onupgradeneeded = (event: AnyEvent) => {
|
||||
const db = event.target.result;
|
||||
dbs[databaseName] = db;
|
||||
for (const i in options) {
|
||||
// 判断是否存在表
|
||||
if (!db.objectStoreNames.contains(options[i].storeName)) {
|
||||
const objectStore = db.createObjectStore(
|
||||
options[i].storeName,
|
||||
options[i].option,
|
||||
);
|
||||
for (const j of options[i].index) {
|
||||
objectStore.createIndex(j.name, j.keyPath, {
|
||||
unique: j.unique,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
resolve(db);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const getTransaction = async (name: string, version?: string) => {
|
||||
let db: IDBDatabase;
|
||||
// 先从缓存获取
|
||||
if (dbs[databaseName]) {
|
||||
db = dbs[databaseName];
|
||||
} else {
|
||||
db = await createDB(databaseName, version);
|
||||
}
|
||||
return db.transaction(name, 'readwrite');
|
||||
};
|
||||
|
||||
const getObjectStore = async (
|
||||
name: string,
|
||||
version?: string,
|
||||
): Promise<IDBObjectStore> => {
|
||||
const transaction = await getTransaction(name, version);
|
||||
return transaction.objectStore(name);
|
||||
};
|
||||
|
||||
const getStore = (name: string, type: string, data: any) =>
|
||||
new Promise<IDBDatabase>((resolve) => {
|
||||
getObjectStore(name).then((objectStore: IDBObjectStore | any) => {
|
||||
const request = objectStore[type](data);
|
||||
request.onsuccess = (event: AnyEvent) =>
|
||||
resolve(event.target.result);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
const findStore = (
|
||||
name: string,
|
||||
start: any,
|
||||
end: any,
|
||||
startInclude: any,
|
||||
endInclude: any,
|
||||
) =>
|
||||
new Promise<IDBDatabase>((resolve, reject) => {
|
||||
getObjectStore(name).then((objectStore: IDBObjectStore) => {
|
||||
const request = objectStore.openCursor(
|
||||
IDBKeyRange.bound(start, end, startInclude, endInclude),
|
||||
);
|
||||
request.onsuccess = (event: AnyEvent) =>
|
||||
resolve(event.target.result);
|
||||
request.onerror = (event: AnyEvent) => reject(event);
|
||||
});
|
||||
});
|
||||
|
||||
export interface DBSelect {
|
||||
add: (data: any) => Promise<IDBDatabase>;
|
||||
get: (data: any) => Promise<IDBDatabase>;
|
||||
getAll: () => Promise<IDBDatabase>;
|
||||
del: (data: any) => Promise<IDBDatabase>;
|
||||
clear: (data: any) => Promise<IDBDatabase>;
|
||||
put: (data: any) => Promise<IDBDatabase>;
|
||||
find: (
|
||||
start: any,
|
||||
end: any,
|
||||
startInclude: any,
|
||||
endInclude: any,
|
||||
) => Promise<IDBDatabase>;
|
||||
}
|
||||
// 获取一个store
|
||||
export const onDBSelect = async (
|
||||
name: string,
|
||||
version: string
|
||||
): Promise<DBSelect> => {
|
||||
const add = (data: any) => getStore(name, 'add', data);
|
||||
const get = (data: any) => getStore(name, 'get', data);
|
||||
const getAll = () => getStore(name, 'getAll', null);
|
||||
const del = (data: any) => getStore(name, 'delete', data);
|
||||
const clear = (data: any) => getStore(name, 'clear', data);
|
||||
const put = (data: any) => getStore(name, 'put', data);
|
||||
const find = (start: any, end: any, startInclude: any, endInclude: any) =>
|
||||
findStore(name, start, end, startInclude, endInclude);
|
||||
const options: DBSelect = { add, get, getAll, clear, del, put, find };
|
||||
getObjectStore(name, version);
|
||||
return options;
|
||||
};
|
||||
155
src/backend/indexdb/indexdbbackend.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
import { MyResponse, IBackend } from '../ibackend'
|
||||
import { createDB, DBSelect, onDBSelect } from '../indexdb/indexdb'
|
||||
import { fileToUrl, fileToBlob } from "@/utils"
|
||||
|
||||
const PROJECT_TABLE = "project"
|
||||
const IMAGE_TABLE = "image" // 保存图片,未实现,Todo
|
||||
const DB_NAME = "goview"
|
||||
const DB_VER = "1"
|
||||
|
||||
export class IndexDbBackend implements IBackend {
|
||||
public async init(data: any) {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:IDBDatabase = await createDB(DB_NAME, DB_VER, [
|
||||
{
|
||||
storeName: PROJECT_TABLE,
|
||||
option: {
|
||||
keyPath: "projectId", autoIncrement:true
|
||||
},
|
||||
index: [
|
||||
{name: 'projectId', keyPath: "projectId", unique: true},
|
||||
{name: 'projectName', keyPath: "projectName", unique: false},
|
||||
{name: 'release', keyPath: "release", unique: false},
|
||||
{name: 'remarks', keyPath: "remarks", unique: false},
|
||||
{name: 'content', keyPath: "content", unique: false},
|
||||
{name: 'indexImage', keyPath: "indexImage", unique: false}
|
||||
]
|
||||
}
|
||||
])
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async login(data:any) {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
if(data.password == "123456" && data.username == "admin"){
|
||||
rtn.data = {
|
||||
token:{tokenValue:"mockToken", tokenName:"name"},
|
||||
userinfo:{nickname:"nickname", username:data.username, id:1}
|
||||
}
|
||||
}else{
|
||||
rtn.data = null
|
||||
rtn.msg = "admin 和 123456"
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async logout() {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async checkToken(data: any) {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
console.log("CheckToken: " + data.token)
|
||||
rtn.data = {
|
||||
token:{tokenValue:"mockToken", tokenName:"name"},
|
||||
userinfo:{nickname:"nickname", username:data.username, id:1}
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async projectList(data:any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
const r:any = await db.getAll()
|
||||
rtn.data = []
|
||||
r.map(function (item: any) {
|
||||
let url = ""
|
||||
if(item.indexImage){
|
||||
const Url = URL || window.URL || window.webkitURL
|
||||
url = Url.createObjectURL(item.indexImage)
|
||||
}
|
||||
rtn.data.push({
|
||||
id: item.projectId,
|
||||
title: item.projectName,
|
||||
release: item.release == 1,
|
||||
label:item.remarks,
|
||||
image:url
|
||||
})
|
||||
})
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async createProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
rtn.data.id = await db.add({ projectName:data.projectName })
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async fetchProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
const r:any = await db.get(parseInt(data.projectId))
|
||||
rtn.data = {
|
||||
id:r.projectId,
|
||||
projectName: r.projectName,
|
||||
state: r.release,
|
||||
remarks: r.remarks,
|
||||
content: r.content
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async updateProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
const row:any = await db.get(parseInt(data.projectId))
|
||||
if("content" in data) row.content = data.content
|
||||
if("projectName" in data) row.projectName = data.projectName
|
||||
if("release" in data) row.release = data.release
|
||||
if("remarks" in data) row.remarks = data.remarks
|
||||
if("object" in data) {
|
||||
row.indexImage = await fileToBlob(data.object)
|
||||
}
|
||||
await db.put(row)
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async copyProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
const row:any = await db.get(parseInt(data.copyId))
|
||||
rtn.data.id =await db.add({
|
||||
projectName:data.projectName,
|
||||
content:row.content,
|
||||
indexImage:row.indexImage,
|
||||
remarks:row.remarks
|
||||
})
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async deleteProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
const db:DBSelect = await onDBSelect(PROJECT_TABLE, DB_VER)
|
||||
await db.del(parseInt(data.projectId))
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async changeProjectRelease(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async uploadFile(data: File, params:any){
|
||||
// Todo: 图片可以保存在表中
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
rtn.data.uri = fileToUrl(data)
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public getFileUrl(uploadUri:string){
|
||||
return uploadUri;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ModuleTypeEnum } from '@/enums/httpEnum'
|
||||
export enum ModuleTypeEnum {
|
||||
SYSTEM = 'sys',
|
||||
PROJECT = 'project',
|
||||
}
|
||||
|
||||
// 接口白名单(免登录)
|
||||
export const fetchAllowList = [
|
||||
71
src/backend/java/axios.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import axios, { AxiosResponse, AxiosRequestConfig } from 'axios'
|
||||
import { ResultEnum } from "@/enums/httpEnum"
|
||||
import { PageEnum, ErrorPageNameMap } from "@/enums/pageEnum"
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
import { axiosPre } from '@/settings/httpSetting'
|
||||
import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
|
||||
import { redirectErrorPage, getLocalStorage, routerTurnByName, httpErrorHandle } from '@/utils'
|
||||
import { fetchAllowList } from './axios.config'
|
||||
import includes from 'lodash/includes'
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: `${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : ''}${axiosPre}`,
|
||||
timeout: ResultEnum.TIMEOUT,
|
||||
})
|
||||
|
||||
axiosInstance.interceptors.request.use(
|
||||
(config: AxiosRequestConfig) => {
|
||||
// 白名单校验
|
||||
if (includes(fetchAllowList, config.url)) return config
|
||||
// 获取 token
|
||||
const info = getLocalStorage(StorageEnum.GO_SYSTEM_STORE)
|
||||
// 重新登录
|
||||
if (!info) {
|
||||
routerTurnByName(PageEnum.BASE_LOGIN_NAME)
|
||||
return config
|
||||
}
|
||||
const userInfo = info[SystemStoreEnum.USER_INFO]
|
||||
config.headers = {
|
||||
...config.headers,
|
||||
[userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || ''
|
||||
}
|
||||
return config
|
||||
},
|
||||
(err: AxiosRequestConfig) => {
|
||||
Promise.reject(err)
|
||||
}
|
||||
)
|
||||
|
||||
// 响应拦截器
|
||||
axiosInstance.interceptors.response.use(
|
||||
(res: AxiosResponse) => {
|
||||
const { code } = res.data as { code: number }
|
||||
|
||||
// 成功
|
||||
if (code === ResultEnum.SUCCESS) {
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 登录过期
|
||||
if (code === ResultEnum.TOKEN_OVERDUE) {
|
||||
window['$message'].error(window['$t']('http.token_overdue_message'))
|
||||
routerTurnByName(PageEnum.BASE_LOGIN_NAME)
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 固定错误码重定向
|
||||
if (ErrorPageNameMap.get(code)) {
|
||||
redirectErrorPage(code)
|
||||
return Promise.resolve(res.data)
|
||||
}
|
||||
|
||||
// 提示错误
|
||||
window['$message'].error(window['$t']((res.data as any).msg))
|
||||
return Promise.resolve(res.data)
|
||||
},
|
||||
(err: AxiosResponse) => {
|
||||
Promise.reject(err)
|
||||
}
|
||||
)
|
||||
|
||||
export default axiosInstance
|
||||
226
src/backend/java/http.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
import axiosInstance from './axios'
|
||||
import {
|
||||
RequestHttpEnum,
|
||||
ContentTypeEnum,
|
||||
RequestBodyEnum,
|
||||
RequestDataTypeEnum,
|
||||
RequestContentTypeEnum,
|
||||
RequestParamsObjType
|
||||
} from '@/enums/httpEnum'
|
||||
import type { RequestGlobalConfigType, RequestConfigType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
|
||||
export const get = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.GET,
|
||||
params: params,
|
||||
})
|
||||
}
|
||||
|
||||
export const post = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.POST,
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const patch = (url: string, data?: object, headersType?: string) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.PATCH,
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const put = (url: string, data?: object, headersType?: ContentTypeEnum) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.PUT,
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': headersType || ContentTypeEnum.JSON
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const del = (url: string, params?: object) => {
|
||||
return axiosInstance({
|
||||
url: url,
|
||||
method: RequestHttpEnum.DELETE,
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 获取请求函数,默认get
|
||||
export const http = (type?: RequestHttpEnum) => {
|
||||
switch (type) {
|
||||
case RequestHttpEnum.GET:
|
||||
return get
|
||||
|
||||
case RequestHttpEnum.POST:
|
||||
return post
|
||||
|
||||
case RequestHttpEnum.PATCH:
|
||||
return patch
|
||||
|
||||
case RequestHttpEnum.PUT:
|
||||
return put
|
||||
|
||||
case RequestHttpEnum.DELETE:
|
||||
return del
|
||||
|
||||
default:
|
||||
return get
|
||||
}
|
||||
}
|
||||
const prefix = 'javascript:'
|
||||
// 对输入字符进行转义处理
|
||||
export const translateStr = (target: string | object) => {
|
||||
if (typeof target === 'string') {
|
||||
if (target.startsWith(prefix)) {
|
||||
const funcStr = target.split(prefix)[1]
|
||||
let result;
|
||||
try {
|
||||
result = new Function(`${funcStr}`)()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
window['$message'].error('js内容解析有误!')
|
||||
}
|
||||
return result
|
||||
} else {
|
||||
return target
|
||||
}
|
||||
}
|
||||
for (const key in target) {
|
||||
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
||||
const subTarget = (target as any)[key];
|
||||
(target as any)[key] = translateStr(subTarget)
|
||||
}
|
||||
}
|
||||
return target
|
||||
}
|
||||
|
||||
/**
|
||||
* * 自定义请求
|
||||
* @param targetParams 当前组件参数
|
||||
* @param globalParams 全局参数
|
||||
*/
|
||||
export const customizeHttp = (targetParams: RequestConfigType, globalParams: RequestGlobalConfigType) => {
|
||||
if (!targetParams || !globalParams) {
|
||||
return
|
||||
}
|
||||
|
||||
// 全局
|
||||
const {
|
||||
// 全局请求源地址
|
||||
requestOriginUrl,
|
||||
// 全局请求内容
|
||||
requestParams: globalRequestParams
|
||||
} = globalParams
|
||||
|
||||
// 目标组件(优先级 > 全局组件)
|
||||
const {
|
||||
// 请求地址
|
||||
requestUrl,
|
||||
// 普通 / sql
|
||||
requestContentType,
|
||||
// 获取数据的方式
|
||||
requestDataType,
|
||||
// 请求方式 get/post/del/put/patch
|
||||
requestHttpType,
|
||||
// 请求体类型 none / form-data / x-www-form-urlencoded / json /xml
|
||||
requestParamsBodyType,
|
||||
// SQL 请求对象
|
||||
requestSQLContent,
|
||||
// 请求内容 params / cookie / header / body: 同 requestParamsBodyType
|
||||
requestParams: targetRequestParams
|
||||
} = targetParams
|
||||
|
||||
// 静态排除
|
||||
if (requestDataType === RequestDataTypeEnum.STATIC) return
|
||||
|
||||
if (!requestUrl) {
|
||||
return
|
||||
}
|
||||
|
||||
// 处理头部
|
||||
let headers: RequestParamsObjType = {
|
||||
...globalRequestParams.Header,
|
||||
...targetRequestParams.Header
|
||||
}
|
||||
headers = translateStr(headers)
|
||||
|
||||
// data 参数
|
||||
let data: RequestParamsObjType | FormData | string = {}
|
||||
// params 参数
|
||||
let params: RequestParamsObjType = { ...targetRequestParams.Params }
|
||||
params = translateStr(params)
|
||||
// form 类型处理
|
||||
let formData: FormData = new FormData()
|
||||
formData.set('default', 'defaultData')
|
||||
// 类型处理
|
||||
|
||||
switch (requestParamsBodyType) {
|
||||
case RequestBodyEnum.NONE:
|
||||
break
|
||||
|
||||
case RequestBodyEnum.JSON:
|
||||
headers['Content-Type'] = ContentTypeEnum.JSON
|
||||
data = translateStr(JSON.parse(targetRequestParams.Body['json']))
|
||||
// json 赋值给 data
|
||||
break
|
||||
|
||||
case RequestBodyEnum.XML:
|
||||
headers['Content-Type'] = ContentTypeEnum.XML
|
||||
// xml 字符串赋值给 data
|
||||
data = translateStr(targetRequestParams.Body['xml'])
|
||||
break
|
||||
|
||||
case RequestBodyEnum.X_WWW_FORM_URLENCODED: {
|
||||
headers['Content-Type'] = ContentTypeEnum.FORM_URLENCODED
|
||||
const bodyFormData = targetRequestParams.Body['x-www-form-urlencoded']
|
||||
for (const i in bodyFormData) formData.set(i, translateStr(bodyFormData[i]))
|
||||
// FormData 赋值给 data
|
||||
data = formData
|
||||
break
|
||||
}
|
||||
|
||||
case RequestBodyEnum.FORM_DATA: {
|
||||
headers['Content-Type'] = ContentTypeEnum.FORM_DATA
|
||||
const bodyFormUrlencoded = targetRequestParams.Body['form-data']
|
||||
for (const i in bodyFormUrlencoded) {
|
||||
formData.set(i, translateStr(bodyFormUrlencoded[i]))
|
||||
}
|
||||
// FormData 赋值给 data
|
||||
data = formData
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// sql 处理
|
||||
if (requestContentType === RequestContentTypeEnum.SQL) {
|
||||
headers['Content-Type'] = ContentTypeEnum.JSON
|
||||
data = requestSQLContent
|
||||
}
|
||||
|
||||
try {
|
||||
const url = (new Function("return `" + `${requestOriginUrl}${requestUrl}`.trim() + "`"))();
|
||||
return axiosInstance({
|
||||
url,
|
||||
method: requestHttpType,
|
||||
data,
|
||||
params,
|
||||
headers
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
window['$message'].error('URL地址格式有误!')
|
||||
}
|
||||
}
|
||||
130
src/backend/mock/mockbackend.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
import { MyResponse, IBackend } from './ibackend'
|
||||
import { fileToUrl } from '@/utils'
|
||||
|
||||
|
||||
/**
|
||||
* MockBackend
|
||||
* 模拟纯前端,不会保存,也不报错。
|
||||
*/
|
||||
|
||||
export class MockBackend implements IBackend {
|
||||
public async init(data: any) {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async login(data:any) {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
if(data.password == "123456" && data.username == "admin"){
|
||||
rtn.data = {
|
||||
token:{tokenValue:"mockToken", tokenName:"name"},
|
||||
userinfo:{nickname:"nickname", username:data.username, id:1}
|
||||
}
|
||||
}else{
|
||||
rtn.data = null
|
||||
rtn.msg = "用户名或密码错误!"
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async logout() {
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async checkToken(data:any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async projectList(data:any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
rtn.data =[
|
||||
{
|
||||
id: 1,
|
||||
title: '假数据不可用',
|
||||
release: true,
|
||||
label: '官方案例'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '物料2-假数据不可用',
|
||||
release: false,
|
||||
label: '官方案例'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '物料3-假数据不可用',
|
||||
release: false,
|
||||
label: '官方案例'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '物料4-假数据不可用',
|
||||
release: false,
|
||||
label: '官方案例'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '物料5-假数据不可用',
|
||||
release: false,
|
||||
label: '官方案例'
|
||||
}
|
||||
];
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async createProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
rtn.data.id = "newId"
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async fetchProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
rtn.data = {
|
||||
id:data.projectId,
|
||||
projectName: '假数据不可用',
|
||||
indexImage:'',
|
||||
state: 0,
|
||||
remarks: '官方案例',
|
||||
content: null
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async saveProject(data: object){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async updateProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async copyProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async deleteProject(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async changeProjectRelease(data: any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public async uploadFile(data: File, params:any){
|
||||
let rtn:MyResponse = new MyResponse;
|
||||
rtn.data.uri = fileToUrl(data)
|
||||
return rtn;
|
||||
}
|
||||
|
||||
public getFileUrl(uploadUri:string){
|
||||
return uploadUri;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import Flipper from './index.vue'
|
||||
|
||||
type FlipType = 'up' | 'down'
|
||||
|
||||
export { Flipper, FlipType }
|
||||
@@ -1,13 +1,19 @@
|
||||
<template>
|
||||
<div class="go-Flipper" :class="[flipType, { go: isFlipping }]">
|
||||
<div class="M-Flipper" :class="[flipType, { go: isFlipping }]">
|
||||
<div class="digital front" :data-front="frontTextFromData"></div>
|
||||
<div class="digital back" :data-back="backTextFromData"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Flipper'
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, PropType, watch } from 'vue'
|
||||
import { FlipType } from './index'
|
||||
import { FlipType } from '.'
|
||||
|
||||
const props = defineProps({
|
||||
flipType: {
|
||||
@@ -125,7 +131,7 @@ $lineColor: #4a9ef8;
|
||||
}
|
||||
// #endregion
|
||||
|
||||
.go-Flipper {
|
||||
.M-Flipper {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: $width;
|
||||
@@ -14,19 +14,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { langList } from '@/i18n/index'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const { LanguageIcon } = icon.ionicons5
|
||||
const { locale } = useI18n();
|
||||
const langStore = useLangStore()
|
||||
const options = langList
|
||||
|
||||
const handleSelect = (key: LangEnum) => {
|
||||
locale.value = key;
|
||||
langStore.changeLang(key)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<n-modal v-model:show="modelShowRef" @afterLeave="closeHandle">
|
||||
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
|
||||
<n-list bordered class="go-system-info">
|
||||
<template #header>
|
||||
<n-space justify="space-between">
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
|
||||
<n-list-item>
|
||||
<n-space class="go-my-2" :size="20">
|
||||
<n-space :size="20">
|
||||
<n-text class="item-left">版权声明:</n-text>
|
||||
<n-text>
|
||||
GoView 版权属于
|
||||
@@ -21,7 +21,8 @@
|
||||
</n-list-item>
|
||||
|
||||
<n-list-item>
|
||||
<n-space class="go-my-2" :size="20">
|
||||
<n-divider style="margin-top: 0" />
|
||||
<n-space :size="20">
|
||||
<n-text class="item-left">协议备注:</n-text>
|
||||
<n-text>
|
||||
请遵守开源 MIT 协议,以上声明 <n-text type="error">不可删除</n-text>,否则视作侵权行为,后果自负!
|
||||
@@ -30,7 +31,8 @@
|
||||
</n-list-item>
|
||||
|
||||
<n-list-item>
|
||||
<n-space class="go-mt-2" :size="20">
|
||||
<n-divider style="margin-top: 0" />
|
||||
<n-space :size="20">
|
||||
<n-text class="item-left">商业授权:</n-text>
|
||||
<n-text>
|
||||
若不想保留版权声明,请通过仓库/交流群 联系项目作者,进行授权
|
||||
@@ -42,19 +44,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const props = defineProps({
|
||||
modelShow: Boolean
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
|
||||
const modelShowRef = ref(false)
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
defineProps({
|
||||
modelShow: Boolean
|
||||
})
|
||||
|
||||
const closeHandle = () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<n-modal v-model:show="modelShowRef" @afterLeave="closeHandle">
|
||||
<n-modal v-model:show="modelShow" @afterLeave="closeHandle">
|
||||
<n-list bordered class="go-system-setting">
|
||||
<template #header>
|
||||
<n-space justify="space-between">
|
||||
@@ -69,20 +69,21 @@
|
||||
</template>
|
||||
|
||||
<script script lang="ts" setup>
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { ListType } from './index.d'
|
||||
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
|
||||
import { SettingStoreEnums, ToolsStatusEnum } from '@/store/modules/settingStore/settingStore.d'
|
||||
import { icon } from '@/plugins'
|
||||
|
||||
const props = defineProps({
|
||||
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
|
||||
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
|
||||
defineProps({
|
||||
modelShow: Boolean
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelShow'])
|
||||
const { HelpOutlineIcon, CloseIcon } = icon.ionicons5
|
||||
const settingStore = useSettingStore()
|
||||
const modelShowRef = ref(false)
|
||||
|
||||
const list = reactive<ListType[]>([
|
||||
{
|
||||
@@ -167,10 +168,6 @@ const list = reactive<ListType[]>([
|
||||
}
|
||||
])
|
||||
|
||||
watch(() => props.modelShow, (newValue) => {
|
||||
modelShowRef.value = newValue
|
||||
})
|
||||
|
||||
const closeHandle = () => {
|
||||
emit('update:modelShow', false)
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { h, ref } from 'vue'
|
||||
import { NAvatar, NText } from 'naive-ui'
|
||||
import { renderIcon, getLocalStorage } from '@/utils'
|
||||
import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d'
|
||||
import { StorageEnum } from '@/enums/storageEnum'
|
||||
import { renderIcon } from '@/utils'
|
||||
import { logout, renderLang } from '@/utils'
|
||||
import { GoSystemSet } from '@/components/GoSystemSet/index'
|
||||
import { GoSystemInfo } from '@/components/GoSystemInfo/index'
|
||||
@@ -66,17 +64,7 @@ const renderUserInfo = () => {
|
||||
}),
|
||||
h('div', null, [
|
||||
h('div', null, [
|
||||
h(NText, { depth: 2 }, {
|
||||
default: () => {
|
||||
const info = getLocalStorage(StorageEnum.GO_SYSTEM_STORE)
|
||||
if (info) {
|
||||
return info[SystemStoreEnum.USER_INFO][SystemStoreUserInfoEnum.USER_NAME];
|
||||
}
|
||||
else {
|
||||
return 'admin';
|
||||
}
|
||||
}
|
||||
})
|
||||
h(NText, { depth: 2 }, { default: () => '奔跑的面条' })
|
||||
])
|
||||
])
|
||||
]
|
||||
@@ -149,4 +137,4 @@ const handleSelect = (key: string) => {
|
||||
cursor: pointer;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import ChartGlobImage from './index.vue'
|
||||
|
||||
export { ChartGlobImage }
|
||||
@@ -1,31 +0,0 @@
|
||||
<template>
|
||||
<img class="list-img" v-lazy="imageInfo" alt="图表图片" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, PropType, watch } from 'vue'
|
||||
import { fetchImages } from '@/packages'
|
||||
import { ConfigType } from '@/packages/index.d'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<ConfigType>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const imageInfo = ref('')
|
||||
|
||||
// 获取图片
|
||||
const fetchImageUrl = async () => {
|
||||
imageInfo.value = await fetchImages(props.chartConfig)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.chartConfig.key,
|
||||
() => fetchImageUrl(),
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
@@ -1,45 +0,0 @@
|
||||
<template>
|
||||
<n-radio-group :value="props.modelValue || INHERIT_VALUE" @update:value="handleChange">
|
||||
<n-space>
|
||||
<n-tooltip :show-arrow="false" trigger="hover" v-for="item in rendererList" :key="item.value">
|
||||
<template #trigger>
|
||||
<n-radio :value="item.value">
|
||||
{{ item.value }}
|
||||
</n-radio>
|
||||
</template>
|
||||
{{ item.desc }}
|
||||
</n-tooltip>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { type EchartsRenderer } from '@/settings/chartThemes'
|
||||
|
||||
const props = defineProps<{ modelValue?: EchartsRenderer; includeInherit?: boolean }>()
|
||||
const emits = defineEmits(['update:modelValue'])
|
||||
|
||||
const INHERIT_VALUE = 'inherit'
|
||||
|
||||
const handleChange = (val: EchartsRenderer & typeof INHERIT_VALUE) => {
|
||||
emits('update:modelValue', val === INHERIT_VALUE ? undefined : val)
|
||||
}
|
||||
|
||||
const rendererList = [
|
||||
{
|
||||
value: 'svg',
|
||||
desc: '在缩放场景下具有更好的表现'
|
||||
},
|
||||
{
|
||||
value: 'canvas',
|
||||
desc: '数据量较大(经验判断 > 1k)、较多交互时,建议选择'
|
||||
},
|
||||
...(props.includeInherit
|
||||
? [
|
||||
{
|
||||
value: INHERIT_VALUE,
|
||||
desc: '默认继承全局配置'
|
||||
}
|
||||
]
|
||||
: [])
|
||||
]
|
||||
</script>
|
||||
@@ -1,34 +1,4 @@
|
||||
<template>
|
||||
<collapse-item name="渲染器">
|
||||
<setting-item-box :alone="true">
|
||||
<template #name>
|
||||
<n-text>全局</n-text>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon size="21" :depth="3">
|
||||
<help-outline-icon></help-outline-icon>
|
||||
</n-icon>
|
||||
</template>
|
||||
<n-text>所有echarts图表组件默认都将采用所选的渲染器进行渲染</n-text>
|
||||
</n-tooltip>
|
||||
</template>
|
||||
<EchartsRendererSetting v-model="themeSetting.renderer" />
|
||||
</setting-item-box>
|
||||
<setting-item-box :alone="true">
|
||||
<template #name>
|
||||
<n-text>当前</n-text>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon size="21" :depth="3">
|
||||
<help-outline-icon></help-outline-icon>
|
||||
</n-icon>
|
||||
</template>
|
||||
<n-text>仅当前组件采用指定渲染器渲染</n-text>
|
||||
</n-tooltip>
|
||||
</template>
|
||||
<EchartsRendererSetting v-model="optionData.renderer" includeInherit />
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
<collapse-item v-if="title" name="标题">
|
||||
<template #header>
|
||||
<n-switch v-model:value="title.show" size="small"></n-switch>
|
||||
@@ -313,11 +283,6 @@ import { PropType, computed } from 'vue'
|
||||
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
|
||||
import { axisConfig } from '@/packages/chartConfiguration/echarts/index'
|
||||
import { CollapseItem, SettingItemBox, SettingItem, GlobalSettingPosition } from '@/components/Pages/ChartItemSetting'
|
||||
import { icon } from '@/plugins'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import EchartsRendererSetting from './EchartsRendererSetting.vue'
|
||||
|
||||
const { HelpOutlineIcon } = icon.ionicons5
|
||||
|
||||
const props = defineProps({
|
||||
optionData: {
|
||||
@@ -331,12 +296,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const chartEditStore = useChartEditStore()
|
||||
const themeSetting = computed(() => {
|
||||
const chartThemeSetting = chartEditStore.getEditCanvasConfig.chartThemeSetting
|
||||
return chartThemeSetting
|
||||
})
|
||||
|
||||
const title = computed(() => {
|
||||
return props.optionData.title
|
||||
})
|
||||
|
||||
@@ -99,7 +99,6 @@ const colorSelectHandle = (color: AppThemeColorType) => {
|
||||
overflow: hidden;
|
||||
border-radius: 5px;
|
||||
@extend .go-background-filter-shallow;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
&-color {
|
||||
width: 8px;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div class="model-footer">
|
||||
中国色列表来自于:
|
||||
<n-a href="http://zhongguose.com" target="_blank">http://zhongguose.com</n-a>
|
||||
<n-a href="http://zhongguose.com">http://zhongguose.com</n-a>
|
||||
</div>
|
||||
</div>
|
||||
</n-modal>
|
||||
@@ -157,7 +157,6 @@ $height: 85vh;
|
||||
}
|
||||
}
|
||||
.model-footer {
|
||||
z-index: 1;
|
||||
text-align: end;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,6 @@ export enum DragKeyEnum {
|
||||
DRAG_KEY = 'ChartData'
|
||||
}
|
||||
|
||||
// 不同页面保存操作
|
||||
export enum SavePageEnum {
|
||||
CHART = 'SaveChart',
|
||||
CHART_TO_PREVIEW = 'ChartToPreview',
|
||||
JSON = 'SaveJSON',
|
||||
CLOSE = 'close'
|
||||
}
|
||||
|
||||
// 操作枚举
|
||||
export enum MenuEnum {
|
||||
// 移动
|
||||
@@ -68,8 +60,7 @@ export enum WinKeyboard {
|
||||
ALT = ' alt',
|
||||
CTRL_SOURCE_KEY = 'control',
|
||||
SHIFT_SOURCE_KEY = 'shift',
|
||||
ALT_SOURCE_KEY = 'alt',
|
||||
SPACE = 'Space'
|
||||
ALT_SOURCE_KEY = 'alt'
|
||||
}
|
||||
|
||||
// Mac 键盘枚举
|
||||
@@ -80,8 +71,7 @@ export enum MacKeyboard {
|
||||
ALT = '⌥',
|
||||
CTRL_SOURCE_KEY = '⌘',
|
||||
SHIFT_SOURCE_KEY = '⇧',
|
||||
ALT_SOURCE_KEY = '⌥',
|
||||
SPACE = 'Space'
|
||||
ALT_SOURCE_KEY = '⌥'
|
||||
}
|
||||
|
||||
// 同步状态枚举
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
// 基础事件类型(vue不加 on)
|
||||
export enum BaseEvent {
|
||||
// 点击
|
||||
ON_CLICK = 'click',
|
||||
// 双击
|
||||
ON_DBL_CLICK = 'dblclick',
|
||||
// 移入
|
||||
ON_MOUSE_ENTER = 'mouseenter',
|
||||
// 移出
|
||||
ON_MOUSE_LEAVE = 'mouseleave'
|
||||
}
|
||||
|
||||
// 组件交互回调事件
|
||||
export enum InteractEvents {
|
||||
INTERACT_ON = 'interactOn',
|
||||
INTERACT_COMPONENT_ID = 'interactComponentId',
|
||||
INTERACT_FN = 'interactFn'
|
||||
}
|
||||
|
||||
// 全局组件交互回调事件触发的类型(当然可以自定义名称)
|
||||
export enum InteractEventOn {
|
||||
CLICK = 'click',
|
||||
CHANGE = 'change'
|
||||
}
|
||||
|
||||
// 确定交互组件触发类型 key名称
|
||||
export const COMPONENT_INTERACT_EVENT_KET = 'componentInteractEventKey'
|
||||
|
||||
// 交互式组件的触发配置
|
||||
export type InteractActionsType = {
|
||||
interactType: InteractEventOn
|
||||
interactName: string
|
||||
componentEmitEvents: { [T: string]: { value: any; label: string }[] }
|
||||
}
|
||||
|
||||
// vue3 生命周期事件
|
||||
export enum EventLife {
|
||||
// 渲染之后
|
||||
VNODE_MOUNTED = 'vnodeMounted',
|
||||
// 渲染之前
|
||||
VNODE_BEFORE_MOUNT = 'vnodeBeforeMount'
|
||||
}
|
||||
|
||||
// 内置字符串函数对象列表
|
||||
export const excludeParseEventKeyList = [
|
||||
EventLife.VNODE_BEFORE_MOUNT,
|
||||
EventLife.VNODE_MOUNTED,
|
||||
BaseEvent.ON_CLICK,
|
||||
BaseEvent.ON_DBL_CLICK,
|
||||
BaseEvent.ON_MOUSE_ENTER,
|
||||
BaseEvent.ON_MOUSE_LEAVE,
|
||||
//过滤器
|
||||
'filter'
|
||||
]
|
||||
// 内置字符串函数键值列表
|
||||
export const excludeParseEventValueList = [
|
||||
// 请求里的函数语句
|
||||
'javascript:'
|
||||
]
|
||||
@@ -1,10 +1,6 @@
|
||||
// 模块 Path 前缀分类
|
||||
export enum ModuleTypeEnum {
|
||||
SYSTEM = 'sys',
|
||||
PROJECT = 'project',
|
||||
}
|
||||
|
||||
// 请求结果集
|
||||
/**
|
||||
* @description: 请求结果集
|
||||
*/
|
||||
export enum ResultEnum {
|
||||
DATA_SUCCESS = 0,
|
||||
SUCCESS = 200,
|
||||
@@ -12,7 +8,7 @@ export enum ResultEnum {
|
||||
SERVER_FORBIDDEN = 403,
|
||||
NOT_FOUND = 404,
|
||||
TOKEN_OVERDUE = 886,
|
||||
TIMEOUT = 60000,
|
||||
TIMEOUT = 60000
|
||||
}
|
||||
|
||||
// 数据相关
|
||||
@@ -20,9 +16,7 @@ export enum RequestDataTypeEnum {
|
||||
// 静态数据
|
||||
STATIC = 0,
|
||||
// 请求数据
|
||||
AJAX = 1,
|
||||
// 数据池
|
||||
Pond = 2
|
||||
AJAX = 1
|
||||
}
|
||||
|
||||
// 请求主体类型
|
||||
@@ -39,7 +33,9 @@ export enum RequestHttpHeaderEnum {
|
||||
COOKIE = 'Cookie'
|
||||
}
|
||||
|
||||
// 请求方法
|
||||
/**
|
||||
* @description: 请求方法
|
||||
*/
|
||||
export enum RequestHttpEnum {
|
||||
GET = 'get',
|
||||
POST = 'post',
|
||||
@@ -120,7 +116,9 @@ export type RequestParams = {
|
||||
}
|
||||
}
|
||||
|
||||
// 常用的contentTyp类型
|
||||
/**
|
||||
* @description: 常用的contentTyp类型
|
||||
*/
|
||||
export enum ContentTypeEnum {
|
||||
// json
|
||||
JSON = 'application/json;charset=UTF-8',
|
||||
|
||||
@@ -12,12 +12,6 @@ export enum PreviewEnum {
|
||||
CHART_PREVIEW_NAME = 'ChartPreview',
|
||||
}
|
||||
|
||||
export enum EditEnum {
|
||||
// 图表JSON编辑
|
||||
CHART_EDIT = '/chart/edit/:id(.*)*',
|
||||
CHART_EDIT_NAME = 'ChartEdit',
|
||||
}
|
||||
|
||||
export enum PageEnum {
|
||||
// 登录
|
||||
BASE_LOGIN = '/login',
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
export enum StorageEnum {
|
||||
// 全局设置
|
||||
GO_SETTING_STORE = 'GO_SETTING',
|
||||
GO_SYSTEM_SETTING_STORE = 'GO_SYSTEM_SETTING',
|
||||
// token 等信息
|
||||
GO_ACCESS_TOKEN_STORE = 'GO_ACCESS_TOKEN',
|
||||
// 登录信息
|
||||
GO_SYSTEM_STORE = 'GO_SYSTEM',
|
||||
GO_LOGIN_INFO_STORE = 'GO_LOGIN_INFO',
|
||||
// 语言
|
||||
GO_LANG_STORE = 'GO_LANG',
|
||||
// 当前选择的主题
|
||||
|
||||
@@ -2,8 +2,4 @@ export * from '@/hooks/useTheme.hook'
|
||||
export * from '@/hooks/usePreviewScale.hook'
|
||||
export * from '@/hooks/useCode.hook'
|
||||
export * from '@/hooks/useChartDataFetch.hook'
|
||||
export * from '@/hooks/useSystemInit.hook'
|
||||
export * from '@/hooks/useChartDataPondFetch.hook'
|
||||
export * from '@/hooks/useLifeHandler.hook'
|
||||
export * from '@/hooks/useLang.hook'
|
||||
export * from '@/hooks/useChartInteract.hook'
|
||||
export * from '@/hooks/useLifeHandler.hook'
|
||||
@@ -1,26 +0,0 @@
|
||||
import { inject, type Ref } from 'vue'
|
||||
import { EchartsRenderer } from '@/settings/chartThemes'
|
||||
import { SCALE_KEY } from '@/views/preview/hooks/useScale.hook'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'
|
||||
|
||||
use([CanvasRenderer, SVGRenderer])
|
||||
|
||||
type InitOptions = {
|
||||
renderer: EchartsRenderer
|
||||
devicePixelRatio?: number
|
||||
}
|
||||
|
||||
// 获取需要给当前echarts组件设置什么初始值
|
||||
export function useCanvasInitOptions(option: any, themeSetting: any) {
|
||||
const renderer = option.renderer || themeSetting.renderer
|
||||
const initOptions: InitOptions = { renderer }
|
||||
const scaleRef = inject<Ref<{ width: number; height: number }>>(SCALE_KEY) || { value: { width: 1, height: 1 } }
|
||||
|
||||
if (renderer === 'canvas') {
|
||||
initOptions.devicePixelRatio = Math.ceil(
|
||||
Math.max(window.devicePixelRatio, scaleRef.value.width, scaleRef.value.height)
|
||||
)
|
||||
}
|
||||
return initOptions
|
||||
}
|
||||
@@ -1,123 +1,99 @@
|
||||
import { ref, toRefs, toRaw, watch } from 'vue'
|
||||
import type VChart from 'vue-echarts'
|
||||
import { customizeHttp } from '@/api/http'
|
||||
import { useChartDataPondFetch } from '@/hooks/'
|
||||
import { CreateComponentType, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { RequestDataTypeEnum } from '@/enums/httpEnum'
|
||||
import { isPreview, newFunctionHandle, intervalUnitHandle } from '@/utils'
|
||||
import { setOption } from '@/packages/public/chart'
|
||||
|
||||
// 获取类型
|
||||
type ChartEditStoreType = typeof useChartEditStore
|
||||
|
||||
/**
|
||||
* setdata 数据监听与更改
|
||||
* @param targetComponent
|
||||
* @param useChartEditStore 若直接引会报错,只能动态传递
|
||||
* @param updateCallback 自定义更新函数
|
||||
*/
|
||||
export const useChartDataFetch = (
|
||||
targetComponent: CreateComponentType,
|
||||
useChartEditStore: ChartEditStoreType,
|
||||
updateCallback?: (...args: any) => any
|
||||
) => {
|
||||
const vChartRef = ref<typeof VChart | null>(null)
|
||||
let fetchInterval: any = 0
|
||||
|
||||
// 数据池
|
||||
const { addGlobalDataInterface } = useChartDataPondFetch()
|
||||
|
||||
// 组件类型
|
||||
const { chartFrame } = targetComponent.chartConfig
|
||||
|
||||
// eCharts 组件配合 vChart 库更新方式
|
||||
const echartsUpdateHandle = (dataset: any) => {
|
||||
if (chartFrame === ChartFrameEnum.ECHARTS) {
|
||||
if (vChartRef.value) {
|
||||
setOption(vChartRef.value, { dataset: dataset })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const requestIntervalFn = () => {
|
||||
const chartEditStore = useChartEditStore()
|
||||
|
||||
// 全局数据
|
||||
const {
|
||||
requestOriginUrl,
|
||||
requestIntervalUnit: globalUnit,
|
||||
requestInterval: globalRequestInterval
|
||||
} = toRefs(chartEditStore.getRequestGlobalConfig)
|
||||
|
||||
// 目标组件
|
||||
const {
|
||||
requestDataType,
|
||||
requestUrl,
|
||||
requestIntervalUnit: targetUnit,
|
||||
requestInterval: targetInterval
|
||||
} = toRefs(targetComponent.request)
|
||||
|
||||
// 非请求类型
|
||||
if (requestDataType.value !== RequestDataTypeEnum.AJAX) return
|
||||
|
||||
try {
|
||||
// 处理地址
|
||||
// @ts-ignore
|
||||
if (requestUrl?.value) {
|
||||
// requestOriginUrl 允许为空
|
||||
const completePath = requestOriginUrl && requestOriginUrl.value + requestUrl.value
|
||||
if (!completePath) return
|
||||
|
||||
clearInterval(fetchInterval)
|
||||
|
||||
const fetchFn = async () => {
|
||||
const res = await customizeHttp(toRaw(targetComponent.request), toRaw(chartEditStore.getRequestGlobalConfig))
|
||||
if (res) {
|
||||
try {
|
||||
const filter = targetComponent.filter
|
||||
const { data } = res
|
||||
echartsUpdateHandle(newFunctionHandle(data, res, filter))
|
||||
// 更新回调函数
|
||||
if (updateCallback) {
|
||||
updateCallback(newFunctionHandle(data, res, filter))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 普通初始化与组件交互处理监听
|
||||
watch(
|
||||
() => targetComponent.request,
|
||||
() => {
|
||||
fetchFn()
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
// 定时时间
|
||||
const time = targetInterval && targetInterval.value ? targetInterval.value : globalRequestInterval.value
|
||||
// 单位
|
||||
const unit = targetInterval && targetInterval.value ? targetUnit.value : globalUnit.value
|
||||
// 开启轮询
|
||||
if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
|
||||
}
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
if (isPreview()) {
|
||||
// 判断是否是数据池类型
|
||||
targetComponent.request.requestDataType === RequestDataTypeEnum.Pond
|
||||
? addGlobalDataInterface(targetComponent, useChartEditStore, updateCallback || echartsUpdateHandle)
|
||||
: requestIntervalFn()
|
||||
}
|
||||
return { vChartRef }
|
||||
}
|
||||
import { ref, toRefs, toRaw } from 'vue'
|
||||
import type VChart from 'vue-echarts'
|
||||
import { customizeHttp } from '@/api/http'
|
||||
import { CreateComponentType, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { RequestDataTypeEnum } from '@/enums/httpEnum'
|
||||
import { isPreview, newFunctionHandle, intervalUnitHandle } from '@/utils'
|
||||
|
||||
// 获取类型
|
||||
type ChartEditStoreType = typeof useChartEditStore
|
||||
|
||||
/**
|
||||
* setdata 数据监听与更改
|
||||
* @param targetComponent
|
||||
* @param useChartEditStore 若直接引会报错,只能动态传递
|
||||
* @param updateCallback 自定义更新函数
|
||||
*/
|
||||
export const useChartDataFetch = (
|
||||
targetComponent: CreateComponentType,
|
||||
useChartEditStore: ChartEditStoreType,
|
||||
updateCallback?: (...args: any) => any
|
||||
) => {
|
||||
const vChartRef = ref<typeof VChart | null>(null)
|
||||
let fetchInterval: any = 0
|
||||
|
||||
const requestIntervalFn = () => {
|
||||
const chartEditStore = useChartEditStore()
|
||||
|
||||
// 全局数据
|
||||
const {
|
||||
requestOriginUrl,
|
||||
requestIntervalUnit: globalUnit,
|
||||
requestInterval: globalRequestInterval
|
||||
} = toRefs(chartEditStore.getRequestGlobalConfig)
|
||||
|
||||
// 目标组件
|
||||
const {
|
||||
requestDataType,
|
||||
requestUrl,
|
||||
requestIntervalUnit: targetUnit,
|
||||
requestInterval: targetInterval
|
||||
} = toRefs(targetComponent.request)
|
||||
|
||||
// 组件类型
|
||||
const { chartFrame } = targetComponent.chartConfig
|
||||
|
||||
// 非请求类型
|
||||
if (requestDataType.value !== RequestDataTypeEnum.AJAX) return
|
||||
|
||||
try {
|
||||
// 处理地址
|
||||
// @ts-ignore
|
||||
if (requestUrl?.value) {
|
||||
// requestOriginUrl 允许为空
|
||||
const completePath = requestOriginUrl && requestOriginUrl.value + requestUrl.value
|
||||
if (!completePath) return
|
||||
|
||||
clearInterval(fetchInterval)
|
||||
|
||||
const fetchFn = async () => {
|
||||
const res = await customizeHttp(toRaw(targetComponent.request), toRaw(chartEditStore.requestGlobalConfig))
|
||||
if (res) {
|
||||
try {
|
||||
const filter = targetComponent.filter
|
||||
// eCharts 组件配合 vChart 库更新方式
|
||||
if (chartFrame === ChartFrameEnum.ECHARTS) {
|
||||
if (vChartRef.value) {
|
||||
vChartRef.value.setOption({ dataset: newFunctionHandle(res?.data, res, filter) })
|
||||
}
|
||||
}
|
||||
// 更新回调函数
|
||||
if (updateCallback) {
|
||||
updateCallback(newFunctionHandle(res?.data, res, filter))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 立即调用
|
||||
fetchFn()
|
||||
|
||||
// 定时时间
|
||||
const time = targetInterval && targetInterval.value ? targetInterval.value : globalRequestInterval.value
|
||||
// 单位
|
||||
const unit = targetInterval && targetInterval.value ? targetUnit.value : globalUnit.value
|
||||
// 开启轮询
|
||||
if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
|
||||
}
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
isPreview() && requestIntervalFn()
|
||||
return { vChartRef }
|
||||
}
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
import { toRaw } from 'vue'
|
||||
import { customizeHttp } from '@/api/http'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import { RequestGlobalConfigType, RequestDataPondItemType } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||
import { newFunctionHandle, intervalUnitHandle } from '@/utils'
|
||||
|
||||
// 获取类型
|
||||
type ChartEditStoreType = typeof useChartEditStore
|
||||
|
||||
// 数据池存储的数据类型
|
||||
type DataPondMapType = {
|
||||
updateCallback: (...args: any) => any
|
||||
filter?: string | undefined
|
||||
}
|
||||
|
||||
// 数据池 Map 中请求对应 callback
|
||||
const mittDataPondMap = new Map<string, DataPondMapType[]>()
|
||||
|
||||
// 创建单个数据项轮询接口
|
||||
const newPondItemInterval = (
|
||||
requestGlobalConfig: RequestGlobalConfigType,
|
||||
requestDataPondItem: RequestDataPondItemType,
|
||||
dataPondMapItem?: DataPondMapType[]
|
||||
) => {
|
||||
if (!dataPondMapItem) return
|
||||
let fetchInterval: any = 0
|
||||
|
||||
clearInterval(fetchInterval)
|
||||
|
||||
// 请求
|
||||
const fetchFn = async () => {
|
||||
try {
|
||||
const res = await customizeHttp(toRaw(requestDataPondItem.dataPondRequestConfig), toRaw(requestGlobalConfig))
|
||||
|
||||
if (res) {
|
||||
try {
|
||||
// 遍历更新回调函数
|
||||
dataPondMapItem.forEach(item => {
|
||||
item.updateCallback(newFunctionHandle(res?.data, res, item.filter))
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return error
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
return error
|
||||
}
|
||||
}
|
||||
|
||||
// 立即调用
|
||||
fetchFn()
|
||||
|
||||
const targetInterval = requestDataPondItem.dataPondRequestConfig.requestInterval
|
||||
const targetUnit = requestDataPondItem.dataPondRequestConfig.requestIntervalUnit
|
||||
|
||||
const globalRequestInterval = requestGlobalConfig.requestInterval
|
||||
const globalUnit = requestGlobalConfig.requestIntervalUnit
|
||||
|
||||
// 定时时间
|
||||
const time = targetInterval ? targetInterval : globalRequestInterval
|
||||
// 单位
|
||||
const unit = targetInterval ? targetUnit : globalUnit
|
||||
// 开启轮询
|
||||
if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据池接口处理
|
||||
*/
|
||||
export const useChartDataPondFetch = () => {
|
||||
// 新增全局接口
|
||||
const addGlobalDataInterface = (
|
||||
targetComponent: CreateComponentType,
|
||||
useChartEditStore: ChartEditStoreType,
|
||||
updateCallback: (...args: any) => any
|
||||
) => {
|
||||
const chartEditStore = useChartEditStore()
|
||||
const { requestDataPond } = chartEditStore.getRequestGlobalConfig
|
||||
|
||||
// 组件对应的数据池 Id
|
||||
const requestDataPondId = targetComponent.request.requestDataPondId as string
|
||||
// 新增数据项
|
||||
const mittPondIdArr = mittDataPondMap.get(requestDataPondId) || []
|
||||
mittPondIdArr.push({
|
||||
updateCallback: updateCallback,
|
||||
filter: targetComponent.filter
|
||||
})
|
||||
mittDataPondMap.set(requestDataPondId, mittPondIdArr)
|
||||
}
|
||||
|
||||
// 清除旧数据
|
||||
const clearMittDataPondMap = () => {
|
||||
mittDataPondMap.clear()
|
||||
}
|
||||
|
||||
// 初始化数据池
|
||||
const initDataPond = (requestGlobalConfig: RequestGlobalConfigType) => {
|
||||
const { requestDataPond } = requestGlobalConfig
|
||||
// 根据 mapId 查找对应的数据池配置
|
||||
for (let pondKey of mittDataPondMap.keys()) {
|
||||
const requestDataPondItem = requestDataPond.find(item => item.dataPondId === pondKey)
|
||||
if (requestDataPondItem) {
|
||||
newPondItemInterval(requestGlobalConfig, requestDataPondItem, mittDataPondMap.get(pondKey))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
addGlobalDataInterface,
|
||||
clearMittDataPondMap,
|
||||
initDataPond
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
import { toRefs } from 'vue'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
|
||||
// 获取类型
|
||||
type ChartEditStoreType = typeof useChartEditStore
|
||||
|
||||
// Params 参数修改触发 api 更新图表请求
|
||||
export const useChartInteract = (
|
||||
chartConfig: CreateComponentType,
|
||||
useChartEditStore: ChartEditStoreType,
|
||||
param: { [T: string]: any },
|
||||
interactEventOn: string
|
||||
) => {
|
||||
const chartEditStore = useChartEditStore()
|
||||
const { interactEvents } = chartConfig.events
|
||||
const fnOnEvent = interactEvents.filter(item => {
|
||||
return item.interactOn === interactEventOn
|
||||
})
|
||||
|
||||
if (fnOnEvent.length === 0) return
|
||||
fnOnEvent.forEach(item => {
|
||||
const index = chartEditStore.fetchTargetIndex(item.interactComponentId)
|
||||
if (index === -1) return
|
||||
const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
|
||||
Object.keys(item.interactFn).forEach(key => {
|
||||
if (Params.value[key]) {
|
||||
Params.value[key] = param[item.interactFn[key]]
|
||||
}
|
||||
if (Header.value[key]) {
|
||||
Header.value[key] = param[item.interactFn[key]]
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 联动事件触发的 type 变更时,清除当前绑定内容
|
||||
export const clearInteractEvent = (chartConfig: CreateComponentType) => {
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { computed } from 'vue'
|
||||
import { LangEnum } from '@/enums/styleEnum'
|
||||
import { useLangStore } from '@/store/modules/langStore/langStore'
|
||||
import { zhCN, enUS, dateEnUS, dateZhCN } from 'naive-ui'
|
||||
|
||||
type LangStoreType = typeof useLangStore
|
||||
|
||||
// 语言切换
|
||||
export const useLang = () => {
|
||||
const lang = useLangStore()
|
||||
|
||||
const locale = computed(() => {
|
||||
return lang.getLang === LangEnum.ZH ? zhCN : enUS
|
||||
})
|
||||
|
||||
const dateLocale = computed(() => {
|
||||
return lang.getLang === LangEnum.ZH ? dateZhCN : dateEnUS
|
||||
})
|
||||
|
||||
return {
|
||||
locale,
|
||||
dateLocale
|
||||
}
|
||||
}
|
||||
@@ -1,68 +1,269 @@
|
||||
import { CreateComponentType, CreateComponentGroupType } from '@/packages/index.d'
|
||||
import { EventLife } from '@/enums/eventEnum'
|
||||
import { CreateComponentType, EventLife } from '@/packages/index.d'
|
||||
import * as echarts from 'echarts'
|
||||
import { BackEndFactory } from '@/backend/ibackend'
|
||||
import { reactive, toRef , watch, computed} from 'vue';
|
||||
|
||||
/**
|
||||
* 事件测试:
|
||||
*
|
||||
切换显示名称为 饼图 和 柱状图 的图标
|
||||
const range = runtime.fn.selectComponents("饼图 柱状图")
|
||||
const h = runtime.fn.getChartConfig(range, "hide")
|
||||
runtime.fn.setChartConfig(range, "hide", !h)
|
||||
|
||||
修改一个名称 柱状图001 组件id 2wolqibrx3c000 的图表数据,以下两句等效
|
||||
runtime.fn.setChartConfig("柱状图001", "dataset", {"dimensions":["product","data1","data2"],"source":[{"product":"Mon","data1":120,"data2":130}]})
|
||||
runtime.fn.setChartConfig("#2wolqibrx3c000", "dataset", {"dimensions":["product","data1","data2"],"source":[{"product":"Mon","data1":120,"data2":230}]})
|
||||
|
||||
找到一个组并隐藏
|
||||
const c = runtime.fn.selectOneComponent("分组")
|
||||
if(c){
|
||||
console.log(runtime.fn.getChartConfig(c, "isGroup" ))
|
||||
runtime.fn.setChartConfig(c, "hide", true)
|
||||
}
|
||||
|
||||
调用组件 exposed 函数的例子
|
||||
组件中增加: defineExpose({ actionTest:actionTest })
|
||||
以下调用名称为 柱状图 组件的 actionTest
|
||||
runtime.fn.callExposed("柱状图", "actionTest")
|
||||
|
||||
|
||||
数据驱动界面:
|
||||
图表A 的 MOUNTED 加入对 status1 的 Watch, = "0" 隐藏
|
||||
watch(()=>runtime.variables.status1, newValue => runtime.fn.setChartConfig(this, "hide", newValue == "0"))
|
||||
图表B 的 MOUNTED 也加入对 status1 的 Watch = "1" 隐藏
|
||||
watch(()=>runtime.variables.status1, newValue => runtime.fn.setChartConfig(this, "hide", newValue == "1"))
|
||||
点击事件代码,实现图表A 和 图表B 的切换显示:
|
||||
if(runtime.variables.status1 == "0"){
|
||||
runtime.variables.status1 = "1"
|
||||
} else{
|
||||
runtime.variables.status1 = "0"
|
||||
}
|
||||
|
||||
图表A 的 MOUNTED 加入对 data1 的 Watch
|
||||
watch(()=>runtime.datasets.data1,
|
||||
newValue => runtime.fn.setChartConfig(this, "dataset", newValue))
|
||||
图表B 的 MOUNTED 加入对 data1 的 Watch
|
||||
watch(()=>runtime.datasets.data1,
|
||||
newValue => runtime.fn.setChartConfig(this, "dataset", newValue))
|
||||
点击事件代码,修改datasets.data1,同时更新图表A 和 图表B 的数据 :
|
||||
runtime.datasets.data1 = {"dimensions":["product","data1","data2"],"source":[{"product":"Mon","data1":120,"data2":230}]}
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// * 初始化
|
||||
export const useSystemInit = async () => {
|
||||
const res = await BackEndFactory.init({}) as any;
|
||||
}
|
||||
|
||||
const getOneChartConfig = (component:any, configName:string, params?:any)=>{
|
||||
let root = null
|
||||
if(component.proxy.chartConfig) root = component.proxy.chartConfig
|
||||
else if (component.proxy.groupData) root = component.proxy.groupData
|
||||
// if(!root) return null
|
||||
switch(configName){
|
||||
case "hide":
|
||||
return root.status.hide
|
||||
break;
|
||||
case "dataset":
|
||||
return root.option.dataset
|
||||
break;
|
||||
case "isGroup":
|
||||
return root.isGroup
|
||||
break;
|
||||
case "key":
|
||||
return root.key
|
||||
break;
|
||||
case "attr":
|
||||
return root.attr
|
||||
break;
|
||||
case "name":
|
||||
return root.chartConfig.title
|
||||
}
|
||||
}
|
||||
|
||||
const setOneChartConfig = (component:any, configName:string, newValue:any, params?:any)=>{
|
||||
let root = null
|
||||
if(component.proxy.chartConfig) root = component.proxy.chartConfig
|
||||
else if (component.proxy.groupData) root = component.proxy.groupData
|
||||
switch(configName){
|
||||
case "hide":
|
||||
root.status.hide = newValue
|
||||
break;
|
||||
case "dataset":
|
||||
root.option.dataset = newValue
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 选择器语法:参考 css selectors
|
||||
* 名称 组件名称,不能有空格和特殊字符(. # 引号等)
|
||||
* [name=名称] Todo
|
||||
* #id 组件编号
|
||||
* .key 组件类型 Todo
|
||||
* @param selectors
|
||||
* @returns []
|
||||
*/
|
||||
const getComponentsBySelectors = (selectors:string):any[]=>{
|
||||
// 返回:数组,可能多个
|
||||
let rtn:any[] = []
|
||||
const ar = selectors.split(" ")
|
||||
for(let a of ar){
|
||||
rtn = rtn.concat(getComponentsBySelector(a))
|
||||
}
|
||||
return rtn
|
||||
}
|
||||
|
||||
const getComponentsBySelector = (selector:string):any[]=>{
|
||||
// 返回:数组,可能多个
|
||||
const rtn:any[] = []
|
||||
if(selector.substring(0,1) == "#")
|
||||
{
|
||||
const key = selector.substring(1)
|
||||
if(key in components){
|
||||
return [components[key]]
|
||||
}
|
||||
return rtn
|
||||
}
|
||||
for (let key in components) {
|
||||
if(getOneChartConfig(components[key], "name") == selector){
|
||||
rtn.push(components[key])
|
||||
}
|
||||
}
|
||||
return rtn
|
||||
}
|
||||
|
||||
|
||||
// 所有图表组件集合对象
|
||||
const components: { [K in string]?: any } = {}
|
||||
|
||||
// 项目提供的npm 包变量
|
||||
export const npmPkgs = { echarts }
|
||||
|
||||
// 组件事件处理 hook
|
||||
export const useLifeHandler = (chartConfig: CreateComponentType | CreateComponentGroupType) => {
|
||||
if (!chartConfig.events) return {}
|
||||
|
||||
// 处理基础事件
|
||||
const baseEvent: { [key: string]: any } = {}
|
||||
for (const key in chartConfig.events.baseEvent) {
|
||||
const fnStr: string | undefined = (chartConfig.events.baseEvent as any)[key]
|
||||
// 动态绑定基础事件
|
||||
if (fnStr) {
|
||||
baseEvent[key] = generateBaseFunc(fnStr)
|
||||
const runtime = {
|
||||
// 变量,管理各种状态
|
||||
variables:reactive({}),
|
||||
// 数据集
|
||||
datasets:reactive({}),
|
||||
// 组件列表 {}
|
||||
components:components,
|
||||
// 帮助类
|
||||
fn:{
|
||||
/**
|
||||
* 选择一个组件
|
||||
* @param selectors string 选择器语法 | component | [component]
|
||||
* @return 第一个符合要求的 component 或 null
|
||||
*/
|
||||
selectOneComponent:(selectors:any)=>{
|
||||
const cList = runtime.fn.selectComponents(selectors)
|
||||
if(cList.length > 0){
|
||||
return cList[0]
|
||||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* 选择组件
|
||||
* @param selectors string 选择器语法 | component | [component]
|
||||
* @return 要求的 [component] 或 []
|
||||
*/
|
||||
selectComponents:(selectors:any):any[]=>{
|
||||
if(!selectors) return []
|
||||
if(typeof selectors == "string") return getComponentsBySelectors(selectors)
|
||||
if(Array.isArray(selectors)) return selectors
|
||||
return [selectors]
|
||||
},
|
||||
/**
|
||||
* 获取组件的值,如果多个,使用第一个
|
||||
* @param selectors string 选择器语法 | component | [component]
|
||||
* @param configName 配置名称
|
||||
* @param params 备用参数,可选
|
||||
* @returns 配置的值
|
||||
*/
|
||||
getChartConfig:(selectors:any, configName:string, params?:any)=>{
|
||||
const component:any = runtime.fn.selectOneComponent(selectors)
|
||||
if(!component && !component.proxy) return null
|
||||
return getOneChartConfig(component, configName, params)
|
||||
},
|
||||
/**
|
||||
* 设置组件的值,支持多个
|
||||
* @param selectors string 选择器语法 | component | [component]
|
||||
* @param configName 配置名称
|
||||
* @param newValue 新值
|
||||
* @param params 备用参数,可选
|
||||
* @returns 配置的值
|
||||
*/
|
||||
setChartConfig:(selectors:any, configName:string, newValue:any, params?:any)=>{
|
||||
const cList:any[] = runtime.fn.selectComponents(selectors)
|
||||
for(let c of cList){
|
||||
if(!c && !c.proxy) return null
|
||||
setOneChartConfig(c, configName, newValue, params)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 调用组件暴露的函数,组件中使用 defineExpose 进行定义
|
||||
* @param selectors string 选择器语法 | component | [component]
|
||||
* @param action 组件中 defineExpose 的函数名
|
||||
* @param params 调用的参数只支持一个参数或没有参数
|
||||
* @returns 无
|
||||
*/
|
||||
callExposed:(selectors:any, action:string, params?:any)=>{
|
||||
const cList:any[] = runtime.fn.selectComponents(selectors)
|
||||
for(let c of cList){
|
||||
if(!c && !c.exposed) return null
|
||||
if(typeof c.exposed[action] == "function") c.exposed[action](params)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 项目提供的npm 包变量
|
||||
export const npmPkgs = { echarts, toRef , watch, computed, runtime }
|
||||
|
||||
export const useLifeHandler = (chartConfig: CreateComponentType) => {
|
||||
const events = chartConfig.events || {}
|
||||
console.log("chartConfig.events")
|
||||
console.log(chartConfig.events)
|
||||
// 生成生命周期事件
|
||||
const events = chartConfig.events.advancedEvents || {}
|
||||
const lifeEvents = {
|
||||
[EventLife.VNODE_BEFORE_MOUNT](e: any) {
|
||||
let lifeEvents = {
|
||||
[EventLife.BEFORE_MOUNT](e: any) {
|
||||
// 存储组件
|
||||
components[chartConfig.id] = e.component
|
||||
const fnStr = (events[EventLife.VNODE_BEFORE_MOUNT] || '').trim()
|
||||
generateFunc(fnStr, e)
|
||||
const fnStr = (events[EventLife.BEFORE_MOUNT] || '').trim()
|
||||
generateFunc(fnStr, e, e.component)
|
||||
},
|
||||
[EventLife.VNODE_MOUNTED](e: any) {
|
||||
const fnStr = (events[EventLife.VNODE_MOUNTED] || '').trim()
|
||||
generateFunc(fnStr, e)
|
||||
[EventLife.MOUNTED](e: any) {
|
||||
const fnStr = (events[EventLife.MOUNTED] || '').trim()
|
||||
generateFunc(fnStr, e, e.component)
|
||||
}
|
||||
}
|
||||
return { ...baseEvent, ...lifeEvents }
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成基础函数
|
||||
* @param fnStr 用户方法体代码
|
||||
* @param event 鼠标事件
|
||||
*/
|
||||
export function generateBaseFunc(fnStr: string) {
|
||||
try {
|
||||
return new Function(`
|
||||
return (
|
||||
async function(mouseEvent){
|
||||
${fnStr}
|
||||
// 遍历,按需侦听
|
||||
for(let key in EventLife)
|
||||
{
|
||||
if(key != "BEFORE_MOUNT" && key != "MOUNTED"){
|
||||
const k = EventLife[key as keyof typeof EventLife]
|
||||
const fnStr = (events[<EventLife>k] || '').trim()
|
||||
if(fnStr){
|
||||
lifeEvents[k as keyof typeof lifeEvents] = (e:any) => {
|
||||
const fnStr = (events[<EventLife>k] || '').trim()
|
||||
generateFunc(fnStr, e, components[chartConfig.id])
|
||||
}
|
||||
)`)()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
return lifeEvents
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成高级函数
|
||||
*
|
||||
* @param fnStr 用户方法体代码
|
||||
* @param e 执行生命周期的动态组件实例
|
||||
*/
|
||||
function generateFunc(fnStr: string, e: any) {
|
||||
function generateFunc(fnStr: string, e: any, component:any) {
|
||||
if(fnStr == "") return
|
||||
try {
|
||||
// npmPkgs 便于拷贝 echarts 示例时设置option 的formatter等相关内容
|
||||
Function(`
|
||||
@@ -72,7 +273,7 @@ function generateFunc(fnStr: string, e: any) {
|
||||
const {${Object.keys(npmPkgs).join()}} = node_modules;
|
||||
${fnStr}
|
||||
}
|
||||
)`)().bind(e?.component)(e, components, npmPkgs)
|
||||
)`)().bind(component)(e, components, npmPkgs)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { useSystemStore } from '@/store/modules/systemStore/systemStore'
|
||||
import { SystemStoreEnum } from '@/store/modules/systemStore/systemStore.d'
|
||||
import { ResultEnum } from '@/enums/httpEnum'
|
||||
import { ossUrlApi } from '@/api/path'
|
||||
|
||||
|
||||
// * 初始化
|
||||
export const useSystemInit = async () => {
|
||||
const systemStore = useSystemStore()
|
||||
|
||||
// 获取 OSS 信息的 url 地址,用来拼接展示图片的地址
|
||||
const getOssUrl = async () => {
|
||||
const res = await ossUrlApi({})
|
||||
if (res && res.code === ResultEnum.SUCCESS) {
|
||||
systemStore.setItem(SystemStoreEnum.FETCH_INFO, {
|
||||
OSSUrl: res.data?.bucketURL
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 执行
|
||||
getOssUrl()
|
||||
}
|
||||
@@ -23,8 +23,6 @@ export const langList = [
|
||||
]
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
globalInjection:true,
|
||||
locale: langStorage?.lang || lang,
|
||||
fallbackLocale: langStorage?.lang || lang,
|
||||
messages: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<n-layout-header bordered class="go-header">
|
||||
<header class="go-header-box" :class="{ 'is-project': isProject }">
|
||||
<header class="go-header-box">
|
||||
<div class="header-item left">
|
||||
<n-space>
|
||||
<slot name="left"></slot>
|
||||
@@ -23,29 +23,17 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { GoThemeSelect } from '@/components/GoThemeSelect'
|
||||
import { GoLangSelect } from '@/components/GoLangSelect'
|
||||
import { ThemeColorSelect } from '@/components/Pages/ThemeColorSelect'
|
||||
import { PageEnum } from '@/enums/pageEnum'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const isProject = computed(() => {
|
||||
return route.fullPath === PageEnum.BASE_HOME_ITEMS
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$min-width: 520px;
|
||||
$min-width: 400px;
|
||||
@include go(header) {
|
||||
&-box {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 33%);
|
||||
&.is-project {
|
||||
grid-template-columns: none;
|
||||
}
|
||||
grid-template-columns: repeat(3, 33.33%);
|
||||
.header-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -61,7 +49,7 @@ $min-width: 520px;
|
||||
}
|
||||
}
|
||||
height: $--header-height;
|
||||
padding: 0 20px 0 60px;
|
||||
padding: 0 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
<template>
|
||||
<router-view>
|
||||
<template #default="{ Component, route }">
|
||||
<component v-if="route.meta.noKeepAlive" :is="Component"></component>
|
||||
<component
|
||||
v-if="route.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component"></component>
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
</keep-alive>
|
||||
</template>
|
||||
</router-view>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<router-view #default="{ Component, route }">
|
||||
<transition name="fade" mode="out-in" appear>
|
||||
<component
|
||||
v-if="route.meta.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</template>
|
||||
<template>
|
||||
<router-view #default="{ Component, route }">
|
||||
<transition name="fade" mode="out-in" appear>
|
||||
<component
|
||||
v-if="route.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</template>
|
||||
|
||||
@@ -3,7 +3,7 @@ import App from './App.vue'
|
||||
import router, { setupRouter } from '@/router'
|
||||
import i18n from '@/i18n/index'
|
||||
import { setupStore } from '@/store'
|
||||
import { setupNaive, setupDirectives, setupCustomComponents, initFunction } from '@/plugins'
|
||||
import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins'
|
||||
import { GoAppProvider } from '@/components/GoAppProvider/index'
|
||||
import { setHtmlTheme } from '@/utils'
|
||||
|
||||
@@ -53,7 +53,4 @@ async function appInit() {
|
||||
window['$vue'] = app
|
||||
}
|
||||
|
||||
appInit().then(() => {
|
||||
initFunction()
|
||||
})
|
||||
|
||||
void appInit()
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './axis'
|
||||
export * from './line'
|
||||
export * from './label'
|
||||
export * from './line'
|
||||
@@ -1,7 +0,0 @@
|
||||
export const labelConfig = {
|
||||
position: [
|
||||
{ label: '外侧', value: 'outside' },
|
||||
{ label: '内部', value: 'inside' },
|
||||
{ label: '中心', value: 'center' }
|
||||
]
|
||||
}
|
||||
@@ -3,6 +3,12 @@
|
||||
<global-setting :optionData="optionData"></global-setting>
|
||||
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`柱状图-${index + 1}`" :expanded="true">
|
||||
<SettingItemBox name="图形">
|
||||
<SettingItem name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="item.itemStyle.color"></n-color-picker>
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<n-button size="small" @click="item.itemStyle.color = null"> 恢复默认 </n-button>
|
||||
</SettingItem>
|
||||
<SettingItem name="宽度">
|
||||
<n-input-number
|
||||
v-model:value="item.barWidth"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/bar_x.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const BarCommonConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.BAR,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'bar_x.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<template>
|
||||
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option" :manual-update="isPreview()"
|
||||
<v-chart
|
||||
ref="vChartRef"
|
||||
:theme="themeColor"
|
||||
:option="option"
|
||||
:manual-update="isPreview()"
|
||||
:update-options="{
|
||||
replaceMerge: replaceMergeArr
|
||||
}" autoresize></v-chart>
|
||||
}"
|
||||
autoresize
|
||||
></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, computed, watch, PropType } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
@@ -20,7 +25,6 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { isPreview } from '@/utils'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import isObject from 'lodash/isObject'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@@ -37,8 +41,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, BarChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
|
||||
const replaceMergeArr = ref<string[]>()
|
||||
@@ -55,23 +57,11 @@ watch(
|
||||
if (!isObject(newData) || !('dimensions' in newData)) return
|
||||
if (Array.isArray(newData?.dimensions)) {
|
||||
const seriesArr = []
|
||||
// 对oldData进行判断,防止传入错误数据之后对旧维度判断产生干扰
|
||||
// 此处计算的是dimensions的Y轴维度,若是dimensions.length为0或1,则默认为1,排除X轴维度干扰
|
||||
const oldDimensions = Array.isArray(oldData?.dimensions)&&oldData.dimensions.length >= 1 ? oldData.dimensions.length : 1;
|
||||
const newDimensions = newData.dimensions.length >= 1 ? newData.dimensions.length : 1;
|
||||
const dimensionsGap = newDimensions - oldDimensions;
|
||||
if (dimensionsGap < 0) {
|
||||
props.chartConfig.option.series.splice(newDimensions - 1)
|
||||
} else if (dimensionsGap > 0) {
|
||||
if(!oldData || !oldData?.dimensions || !Array.isArray(oldData?.dimensions) || !oldData?.dimensions.length ) {
|
||||
props.chartConfig.option.series=[]
|
||||
}
|
||||
for (let i = 0; i < dimensionsGap; i++) {
|
||||
seriesArr.push(cloneDeep(seriesItem))
|
||||
}
|
||||
props.chartConfig.option.series.push(...seriesArr)
|
||||
for (let i = 0; i < newData.dimensions.length - 1; i++) {
|
||||
seriesArr.push(seriesItem)
|
||||
}
|
||||
replaceMergeArr.value = ['series']
|
||||
props.chartConfig.option.series = seriesArr
|
||||
nextTick(() => {
|
||||
replaceMergeArr.value = []
|
||||
})
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
<global-setting :optionData="optionData"></global-setting>
|
||||
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`柱状图-${index+1}`" :expanded="true">
|
||||
<SettingItemBox name="图形">
|
||||
<SettingItem name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="item.itemStyle.color"></n-color-picker>
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<n-button size="small" @click="item.itemStyle.color = null">恢复默认</n-button>
|
||||
</SettingItem>
|
||||
<SettingItem name="宽度">
|
||||
<n-input-number
|
||||
v-model:value="item.barWidth"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/bar_y.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const BarCrossrangeConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.BAR,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'bar_y.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<v-chart
|
||||
ref="vChartRef"
|
||||
:init-options="initOptions"
|
||||
:theme="themeColor"
|
||||
:option="option"
|
||||
:manual-update="isPreview()"
|
||||
@@ -15,7 +14,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, computed, watch, PropType } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { BarChart } from 'echarts/charts'
|
||||
@@ -26,7 +24,6 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { isPreview } from '@/utils'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import isObject from 'lodash/isObject'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@@ -43,8 +40,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, BarChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
|
||||
const replaceMergeArr = ref<string[]>()
|
||||
@@ -62,7 +57,7 @@ watch(
|
||||
if (Array.isArray(newData?.dimensions)) {
|
||||
const seriesArr = []
|
||||
for (let i = 0; i < newData.dimensions.length - 1; i++) {
|
||||
seriesArr.push(cloneDeep(seriesItem))
|
||||
seriesArr.push(seriesItem)
|
||||
}
|
||||
replaceMergeArr.value = ['series']
|
||||
props.chartConfig.option.series = seriesArr
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { PublicConfigClass } from '@/packages/public'
|
||||
import { CapsuleChartConfig } from './index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { chartInitConfig } from '@/settings/designSetting'
|
||||
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const option = {
|
||||
dataset: dataJson,
|
||||
colors: ['#c4ebad', '#6be6c1', '#a0a7e6', '#96dee8', '#3fb1e3' ],
|
||||
unit: '',
|
||||
itemHeight: 10,
|
||||
valueFontSize: 16,
|
||||
paddingRight: 50,
|
||||
paddingLeft: 50,
|
||||
showValue: true
|
||||
}
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key: string = CapsuleChartConfig.key
|
||||
public attr = { ...chartInitConfig, zIndex: -1 }
|
||||
public chartConfig = cloneDeep(CapsuleChartConfig)
|
||||
public option = cloneDeep(option)
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<template>
|
||||
<!-- Echarts 全局设置 -->
|
||||
<global-setting :optionData="optionData"> </global-setting>
|
||||
<!-- 胶囊柱图 -->
|
||||
<collapse-item name="胶囊柱图" expanded>
|
||||
<SettingItemBox name="布局">
|
||||
<setting-item name="左侧边距">
|
||||
<n-input-number v-model:value="optionData.paddingLeft" :min="10" :step="1" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="右侧边距">
|
||||
<n-input-number v-model:value="optionData.paddingRight" :min="10" :step="1" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="每块高度(px)">
|
||||
<n-input-number v-model:value="optionData.itemHeight" :min="0" :step="1" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
</SettingItemBox>
|
||||
<SettingItemBox name="文本">
|
||||
<setting-item name="所有文字大小">
|
||||
<n-input-number v-model:value="optionData.valueFontSize" :min="0" :step="1" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="单位">
|
||||
<n-input v-model:value="optionData.unit" size="small"></n-input>
|
||||
</setting-item>
|
||||
|
||||
<SettingItem>
|
||||
<n-space>
|
||||
<n-switch v-model:value="optionData.showValue" size="small"></n-switch>
|
||||
<n-text>显示数值</n-text>
|
||||
</n-space>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
<SettingItemBox name="颜色">
|
||||
<setting-item v-for="(item, index) in optionData.colors" :key="index" :name="`颜色${index}`">
|
||||
<n-color-picker v-model:value="optionData.colors[index]" size="small" :modes="['hex']"></n-color-picker>
|
||||
</setting-item>
|
||||
</SettingItemBox>
|
||||
</collapse-item>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, computed } from 'vue'
|
||||
import { GlobalSetting, CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||
import { GlobalThemeJsonType } from '@/settings/chartThemes/index'
|
||||
|
||||
import { option } from './config'
|
||||
|
||||
const props = defineProps({
|
||||
optionData: {
|
||||
type: Object as PropType<typeof option & GlobalThemeJsonType>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"dimensions": ["name", "value"],
|
||||
"source": [
|
||||
{ "name": "厦门", "value": 20 },
|
||||
{ "name": "南阳", "value": 40 },
|
||||
{ "name": "北京", "value": 60 },
|
||||
{ "name": "上海", "value": 80 },
|
||||
{ "name": "新疆", "value": 100 }
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
export const CapsuleChartConfig: ConfigType = {
|
||||
key: 'CapsuleChart',
|
||||
chartKey: 'VCapsuleChart',
|
||||
conKey: 'VCCapsuleChart',
|
||||
title: '胶囊柱图',
|
||||
category: ChatCategoryEnum.BAR,
|
||||
categoryName: ChatCategoryEnumName.BAR,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.COMMON,
|
||||
image: 'capsule.png'
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="state.mergedConfig"
|
||||
class="go-dv-capsule-chart"
|
||||
:style="{
|
||||
fontSize: numberSizeHandle(state.mergedConfig.valueFontSize),
|
||||
paddingLeft: numberSizeHandle(state.mergedConfig.paddingLeft),
|
||||
paddingRight: numberSizeHandle(state.mergedConfig.paddingRight)
|
||||
}"
|
||||
>
|
||||
<div class="label-column">
|
||||
<div
|
||||
v-for="item in state.mergedConfig.dataset.source"
|
||||
:key="item[state.mergedConfig.dataset.dimensions[0]]"
|
||||
:style="{ height: state.capsuleItemHeight, lineHeight: state.capsuleItemHeight }"
|
||||
>
|
||||
{{ item[state.mergedConfig.dataset.dimensions[0]] }}
|
||||
</div>
|
||||
<div class="laset"> </div>
|
||||
</div>
|
||||
|
||||
<div class="capsule-container">
|
||||
<div
|
||||
v-for="(capsule, index) in state.capsuleLength"
|
||||
:key="index"
|
||||
class="capsule-item"
|
||||
:style="{ height: state.capsuleItemHeight }"
|
||||
>
|
||||
<div
|
||||
class="capsule-item-column"
|
||||
:style="`width: ${capsule * 100}%; background-color: ${
|
||||
state.mergedConfig.colors[index % state.mergedConfig.colors.length]
|
||||
};height:calc(100% - ${2}px);`"
|
||||
>
|
||||
<div v-if="state.mergedConfig.showValue" class="capsule-item-value">
|
||||
{{ state.capsuleValue[index] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="unit-label">
|
||||
<div v-for="(label, index) in state.labelData" :key="label + index">
|
||||
{{ label }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="state.mergedConfig.unit" class="unit-text">
|
||||
{{ state.mergedConfig.unit }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, watch, reactive, PropType } from 'vue'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||
import config, { option } from './config'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
|
||||
type DataProps = {
|
||||
name: string | number
|
||||
value: string | number
|
||||
[key: string]: string | number
|
||||
}
|
||||
|
||||
interface StateProps {
|
||||
defaultConfig: {
|
||||
dataset: {
|
||||
dimensions: Array<string>
|
||||
source: Array<DataProps>
|
||||
}
|
||||
colors: Array<string>
|
||||
unit: string
|
||||
showValue: boolean
|
||||
itemHeight: number
|
||||
valueFontSize: number
|
||||
paddingLeft: number
|
||||
paddingRight: number
|
||||
}
|
||||
mergedConfig: any
|
||||
capsuleLength: Array<number>
|
||||
capsuleValue: Array<string | Object>
|
||||
labelData: Array<number>
|
||||
capsuleItemHeight: string
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
type: Object as PropType<config>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const state = reactive<StateProps>({
|
||||
defaultConfig: option,
|
||||
mergedConfig: null,
|
||||
capsuleLength: [],
|
||||
capsuleValue: [],
|
||||
labelData: [],
|
||||
capsuleItemHeight: ''
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.chartConfig.option,
|
||||
newVal => {
|
||||
calcData(newVal)
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
)
|
||||
|
||||
const calcData = (data: any, type?: string) => {
|
||||
let cloneConfig = cloneDeep(props.chartConfig.option || {})
|
||||
state.mergedConfig = cloneConfig
|
||||
if (type == 'preview') {
|
||||
cloneConfig.dataset = data
|
||||
}
|
||||
calcCapsuleLengthAndLabelData(state.mergedConfig.dataset)
|
||||
}
|
||||
|
||||
// 数据解析
|
||||
const calcCapsuleLengthAndLabelData = (dataset: any) => {
|
||||
try {
|
||||
const { source } = dataset
|
||||
if (!source || !source.length) return
|
||||
|
||||
state.capsuleItemHeight = numberSizeHandle(state.mergedConfig.itemHeight)
|
||||
const capsuleValue = source.map((item: DataProps) => item[state.mergedConfig.dataset.dimensions[1]])
|
||||
|
||||
const maxValue = Math.max(...capsuleValue)
|
||||
|
||||
state.capsuleValue = capsuleValue
|
||||
|
||||
state.capsuleLength = capsuleValue.map((v: any) => (maxValue ? v / maxValue : 0))
|
||||
|
||||
const oneFifth = maxValue / 5
|
||||
|
||||
const labelData = Array.from(new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth))))
|
||||
|
||||
state.labelData = labelData
|
||||
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
}
|
||||
|
||||
const numberSizeHandle = (val: string | number) => {
|
||||
return val + 'px'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
calcData(props.chartConfig.option)
|
||||
})
|
||||
|
||||
// 预览
|
||||
useChartDataFetch(props.chartConfig, useChartEditStore, (newData: any) => {
|
||||
calcData(newData, 'preview')
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@include go('dv-capsule-chart') {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
padding-right: 50px;
|
||||
color: #b9b8cc;
|
||||
|
||||
.label-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
> div:not(:last-child) {
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.capsule-container {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.capsule-item {
|
||||
box-shadow: 0 0 3px #999;
|
||||
height: 10px;
|
||||
margin: 5px 0px;
|
||||
border-radius: 5px;
|
||||
|
||||
.capsule-item-column {
|
||||
position: relative;
|
||||
height: 8px;
|
||||
margin-top: 1px;
|
||||
border-radius: 5px;
|
||||
transition: all 0.3s;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.capsule-item-value {
|
||||
padding-left: 10px;
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.unit-label {
|
||||
height: 20px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.unit-text {
|
||||
text-align: right;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
line-height: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
import { BarCommonConfig } from './BarCommon/index'
|
||||
import { BarCrossrangeConfig } from './BarCrossrange/index'
|
||||
import { CapsuleChartConfig } from './CapsuleChart/index'
|
||||
|
||||
export default [BarCommonConfig, BarCrossrangeConfig, CapsuleChartConfig]
|
||||
export default [BarCommonConfig, BarCrossrangeConfig]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
|
||||
import { LineCommonConfig } from './index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
|
||||
@@ -47,7 +47,7 @@ export const option = {
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key: string = LineCommonConfig.key
|
||||
public chartConfig = cloneDeep(LineCommonConfig)
|
||||
public chartConfig = LineCommonConfig
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle(option, includes)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
<global-setting :optionData="optionData"></global-setting>
|
||||
<CollapseItem v-for="(item, index) in seriesList" :key="index" :name="`折线图-${index + 1}`" :expanded="true">
|
||||
<SettingItemBox name="线条">
|
||||
<setting-item name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="item.lineStyle.color"></n-color-picker>
|
||||
</setting-item>
|
||||
<SettingItem name="宽度">
|
||||
<n-input-number
|
||||
v-model:value="item.lineStyle.width"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/line.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const LineCommonConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.LINE,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'line.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<v-chart
|
||||
ref="vChartRef"
|
||||
:init-options="initOptions"
|
||||
:theme="themeColor"
|
||||
:option="option"
|
||||
:manual-update="isPreview()"
|
||||
@@ -16,7 +15,6 @@
|
||||
<script setup lang="ts">
|
||||
import { PropType, computed, watch, ref, nextTick } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { LineChart } from 'echarts/charts'
|
||||
@@ -43,8 +41,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
|
||||
const replaceMergeArr = ref<string[]>()
|
||||
|
||||
@@ -3,7 +3,6 @@ import { LineGradientSingleConfig } from './index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { graphic } from 'echarts/core'
|
||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
|
||||
@@ -59,7 +58,7 @@ const options = {
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key: string = LineGradientSingleConfig.key
|
||||
public chartConfig = cloneDeep(LineGradientSingleConfig)
|
||||
public chartConfig = LineGradientSingleConfig
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle(options, includes)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/line_gradient_single.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const LineGradientSingleConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.LINE,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'line_gradient_single.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
|
||||
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
|
||||
</v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch, PropType } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use, graphic } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { LineChart } from 'echarts/charts'
|
||||
@@ -16,7 +15,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { isPreview, colorGradientCustomMerge} from '@/utils'
|
||||
import { isPreview } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@@ -33,8 +32,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
const chartEditStore = useChartEditStore()
|
||||
|
||||
@@ -48,9 +45,7 @@ watch(
|
||||
(newColor: keyof typeof chartColorsSearch) => {
|
||||
try {
|
||||
if (!isPreview()) {
|
||||
const themeColor =
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
|
||||
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
|
||||
props.chartConfig.option.series.forEach((value: any, index: number) => {
|
||||
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ import { LineGradientsConfig } from './index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { graphic } from 'echarts/core'
|
||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
|
||||
@@ -86,7 +85,7 @@ const option = {
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key: string = LineGradientsConfig.key
|
||||
public chartConfig = cloneDeep(LineGradientsConfig)
|
||||
public chartConfig = LineGradientsConfig
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle(option, includes)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/line_gradient.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const LineGradientsConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.LINE,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'line_gradient.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize></v-chart>
|
||||
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, watch, PropType } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use, graphic } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { LineChart } from 'echarts/charts'
|
||||
@@ -15,7 +14,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { isPreview, colorGradientCustomMerge} from '@/utils'
|
||||
import { isPreview } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@@ -32,8 +31,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
const chartEditStore = useChartEditStore()
|
||||
|
||||
@@ -47,9 +44,7 @@ watch(
|
||||
(newColor: keyof typeof chartColorsSearch) => {
|
||||
try {
|
||||
if (!isPreview()) {
|
||||
const themeColor =
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
|
||||
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
|
||||
props.chartConfig.option.series.forEach((value: any, index: number) => {
|
||||
value.areaStyle.color = new graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@ import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
|
||||
import { LineLinearSingleConfig } from './index'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export const includes = ['legend', 'xAxis', 'yAxis', 'grid']
|
||||
@@ -55,7 +54,7 @@ export const option = {
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key: string = LineLinearSingleConfig.key
|
||||
public chartConfig = cloneDeep(LineLinearSingleConfig)
|
||||
public chartConfig = LineLinearSingleConfig
|
||||
// 图表配置项
|
||||
public option = echartOptionProfixHandle(option, includes)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import image from '@/assets/images/chart/charts/line_linear_single.png'
|
||||
import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
|
||||
import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d'
|
||||
|
||||
@@ -10,5 +11,5 @@ export const LineLinearSingleConfig: ConfigType = {
|
||||
categoryName: ChatCategoryEnumName.LINE,
|
||||
package: PackagesCategoryEnum.CHARTS,
|
||||
chartFrame: ChartFrameEnum.ECHARTS,
|
||||
image: 'line_linear_single.png'
|
||||
image
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
|
||||
<v-chart ref="vChartRef" :theme="themeColor" :option="option.value" :manual-update="isPreview()" autoresize>
|
||||
</v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, watch, reactive } from 'vue'
|
||||
import VChart from 'vue-echarts'
|
||||
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import { LineChart } from 'echarts/charts'
|
||||
@@ -16,7 +15,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import { useChartDataFetch } from '@/hooks'
|
||||
import { isPreview, colorGradientCustomMerge } from '@/utils'
|
||||
import { isPreview } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
@@ -33,8 +32,6 @@ const props = defineProps({
|
||||
}
|
||||
})
|
||||
|
||||
const initOptions = useCanvasInitOptions(props.chartConfig.option, props.themeSetting)
|
||||
|
||||
use([DatasetComponent, CanvasRenderer, LineChart, GridComponent, TooltipComponent, LegendComponent])
|
||||
|
||||
const chartEditStore = useChartEditStore()
|
||||
@@ -48,9 +45,7 @@ watch(
|
||||
(newColor: keyof typeof chartColorsSearch) => {
|
||||
try {
|
||||
if (!isPreview()) {
|
||||
const themeColor =
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[newColor] ||
|
||||
colorGradientCustomMerge(chartEditStore.getEditCanvasConfig.chartCustomThemeColorInfo)[defaultTheme]
|
||||
const themeColor = chartColorsSearch[newColor] || chartColorsSearch[defaultTheme]
|
||||
props.chartConfig.option.series.forEach((value: any) => {
|
||||
value.lineStyle.shadowColor = themeColor[2]
|
||||
value.lineStyle.color.colorStops.forEach((v: { color: string }, i: number) => {
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
import { PublicConfigClass } from '@/packages/public'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { MapAmapConfig } from './index'
|
||||
import { chartInitConfig } from '@/settings/designSetting'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import dataJson from './data.json'
|
||||
|
||||
export enum ThemeEnum {
|
||||
NORMAL = 'normal',
|
||||
DARK = 'dark',
|
||||
LIGHT = 'light',
|
||||
WHITES_MOKE = 'whitesmoke',
|
||||
FRESH = 'fresh',
|
||||
GREY = 'grey',
|
||||
GRAFFITI = 'graffiti',
|
||||
MACARON = 'macaron',
|
||||
BLUE = 'blue',
|
||||
DARKBLUE = 'darkblue',
|
||||
WINE = 'wine'
|
||||
}
|
||||
|
||||
export enum LangEnum {
|
||||
ZH_CN = 'zh_cn',
|
||||
EN = 'en',
|
||||
ZH_EN = 'zh_en'
|
||||
}
|
||||
|
||||
export enum ViewModeEnum {
|
||||
PLANE = '2D',
|
||||
STEREOSCOPIC = '3D'
|
||||
}
|
||||
|
||||
export enum FeaturesEnum {
|
||||
BG = 'bg',
|
||||
POINT = 'point',
|
||||
ROAD = 'road',
|
||||
BUILDING = 'building'
|
||||
}
|
||||
|
||||
export enum MarkerEnum {
|
||||
// 圆圈
|
||||
CIRCLE_MARKER = 'CircleMarker',
|
||||
// 定位标点
|
||||
MARKER = 'Marker',
|
||||
// 暂无
|
||||
NONE = 'none'
|
||||
}
|
||||
|
||||
export const option = {
|
||||
dataset: dataJson,
|
||||
mapOptions: {
|
||||
pitch: 60,
|
||||
skyColor: '#53A9DE',
|
||||
amapKey: 'd5f3e16589dbecae64d05fe90e2ba4f2',
|
||||
amapStyleKey: ThemeEnum.DARK,
|
||||
amapStyleKeyCustom: '',
|
||||
amapLon: 116.397428,
|
||||
amapLat: 39.90923,
|
||||
amapZindex: 11,
|
||||
marker: {
|
||||
fillColor: '#E98984FF',
|
||||
fillOpacity: 0.5,
|
||||
strokeColor: 'white',
|
||||
strokeWeight: 2,
|
||||
strokeOpacity: 0.5,
|
||||
zIndex: 10,
|
||||
bubble: true,
|
||||
cursor: 'pointer',
|
||||
clickable: true
|
||||
},
|
||||
mapMarkerType: MarkerEnum.CIRCLE_MARKER,
|
||||
viewMode: ViewModeEnum.PLANE,
|
||||
lang: LangEnum.ZH_CN,
|
||||
features: [FeaturesEnum.BG, FeaturesEnum.POINT, FeaturesEnum.ROAD, FeaturesEnum.BUILDING]
|
||||
}
|
||||
}
|
||||
|
||||
export default class Config extends PublicConfigClass implements CreateComponentType {
|
||||
public key = MapAmapConfig.key
|
||||
public attr = { ...chartInitConfig, w: 1000, h: 800, zIndex: -1 }
|
||||
public chartConfig = cloneDeep(MapAmapConfig)
|
||||
public option = cloneDeep(option)
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
<template>
|
||||
<collapse-item name="基础" :expanded="true">
|
||||
<setting-item-box name="语言类型" :alone="true">
|
||||
<setting-item>
|
||||
<n-select size="small" v-model:value="optionData.mapOptions.lang" :options="langOptions" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="Key" :alone="true">
|
||||
<setting-item name="请务必使用自己的高德应用 key">
|
||||
<n-input v-model:value="optionData.mapOptions.amapKey" size="small"></n-input>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="自定义地图样式ID" :alone="true">
|
||||
<setting-item>
|
||||
<n-input size="small" v-model:value="optionData.mapOptions.amapStyleKeyCustom" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
<collapse-item name="地图" :expanded="true">
|
||||
<setting-item-box name="主题">
|
||||
<setting-item>
|
||||
<n-select size="small" v-model:value="optionData.mapOptions.amapStyleKey" :options="themeOptions" />
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="内容" :alone="true">
|
||||
<n-checkbox-group v-model:value="optionData.mapOptions.features">
|
||||
<n-space item-style="display: flex;">
|
||||
<n-checkbox :value="item.value" :label="item.label" v-for="(item, index) in featuresOptions" :key="index" />
|
||||
</n-space>
|
||||
</n-checkbox-group>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="位置">
|
||||
<setting-item name="经度">
|
||||
<n-input-number v-model:value="optionData.mapOptions.amapLon" :show-button="false" size="small">
|
||||
<template #suffix>°</template>
|
||||
</n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="纬度">
|
||||
<n-input-number v-model:value="optionData.mapOptions.amapLat" :show-button="false" size="small">
|
||||
<template #suffix>°</template>
|
||||
</n-input-number>
|
||||
</setting-item>
|
||||
<setting-item name="初始缩放">
|
||||
<n-input-number v-model:value="optionData.mapOptions.amapZindex" :min="0" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<setting-item-box name="模式" :alone="true">
|
||||
<setting-item>
|
||||
<n-radio-group v-model:value="optionData.mapOptions.viewMode" name="radiogroup">
|
||||
<n-space>
|
||||
<n-radio v-for="song in viewModeOptions" :key="song.value" :value="song.value">
|
||||
{{ song.label }}
|
||||
</n-radio>
|
||||
</n-space>
|
||||
</n-radio-group>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
<template v-if="optionData.mapOptions.viewMode === '3D'">
|
||||
<setting-item-box>
|
||||
<setting-item name="天空色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.mapOptions.skyColor"></n-color-picker>
|
||||
</setting-item>
|
||||
<setting-item name="俯仰角">
|
||||
<n-input-number v-model:value="optionData.mapOptions.pitch" :min="0" :max="83" size="small"></n-input-number>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</template>
|
||||
</collapse-item>
|
||||
<collapse-item name="标记" :expanded="true">
|
||||
<setting-item-box name="样式">
|
||||
<setting-item name="类型">
|
||||
<n-select size="small" v-model:value="optionData.mapOptions.mapMarkerType" :options="MarkerOptions" />
|
||||
</setting-item>
|
||||
<setting-item name="颜色">
|
||||
<n-color-picker v-model:value="optionData.mapOptions.marker.fillColor" size="small"></n-color-picker>
|
||||
</setting-item>
|
||||
</setting-item-box>
|
||||
</collapse-item>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { option, MarkerEnum, ThemeEnum, LangEnum, ViewModeEnum, FeaturesEnum } from './config'
|
||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||
|
||||
defineProps({
|
||||
optionData: {
|
||||
type: Object as PropType<typeof option>,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const themeOptions = [
|
||||
{
|
||||
value: ThemeEnum.NORMAL,
|
||||
label: '标准'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.DARK,
|
||||
label: '幻影黑'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.LIGHT,
|
||||
label: '月光银'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.WHITES_MOKE,
|
||||
label: '远山黛'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.FRESH,
|
||||
label: '草色青'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.GREY,
|
||||
label: '雅士灰'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.GRAFFITI,
|
||||
label: '涂鸦'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.MACARON,
|
||||
label: '马卡龙'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.BLUE,
|
||||
label: '靛青蓝'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.DARKBLUE,
|
||||
label: '极夜蓝'
|
||||
},
|
||||
{
|
||||
value: ThemeEnum.WINE,
|
||||
label: '酱籽'
|
||||
}
|
||||
]
|
||||
|
||||
const langOptions = [
|
||||
{
|
||||
value: LangEnum.ZH_CN,
|
||||
label: '中文简体'
|
||||
},
|
||||
{
|
||||
value: LangEnum.EN,
|
||||
label: '英文'
|
||||
},
|
||||
{
|
||||
value: LangEnum.ZH_EN,
|
||||
label: '中英文对照'
|
||||
}
|
||||
]
|
||||
|
||||
const viewModeOptions = [
|
||||
{
|
||||
value: ViewModeEnum.PLANE,
|
||||
label: '2D'
|
||||
},
|
||||
{
|
||||
value: ViewModeEnum.STEREOSCOPIC,
|
||||
label: '3D'
|
||||
}
|
||||
]
|
||||
|
||||
const featuresOptions = [
|
||||
{
|
||||
value: FeaturesEnum.BG,
|
||||
label: '显示地图背景'
|
||||
},
|
||||
{
|
||||
value: FeaturesEnum.POINT,
|
||||
label: '显示标识'
|
||||
},
|
||||
{
|
||||
value: FeaturesEnum.ROAD,
|
||||
label: '显示道路'
|
||||
},
|
||||
{
|
||||
value: FeaturesEnum.BUILDING,
|
||||
label: '显示建筑'
|
||||
}
|
||||
]
|
||||
|
||||
const MarkerOptions = [
|
||||
{
|
||||
value: MarkerEnum.CIRCLE_MARKER,
|
||||
label: '圆形标点'
|
||||
},
|
||||
{
|
||||
value: MarkerEnum.MARKER,
|
||||
label: '定位标点'
|
||||
},
|
||||
{
|
||||
value: MarkerEnum.NONE,
|
||||
label: '隐藏标点'
|
||||
}
|
||||
]
|
||||
</script>
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"markers": [
|
||||
{
|
||||
"name": "某某地市",
|
||||
"value": 10,
|
||||
"position": [116.300467, 39.907761]
|
||||
},
|
||||
{
|
||||
"name": "某某地市",
|
||||
"value": 15,
|
||||
"position": [116.400567, 39.908761]
|
||||
},
|
||||
{
|
||||
"name": "某某地市",
|
||||
"value": 20,
|
||||
"position": [116.200467, 39.937761]
|
||||
}
|
||||
]
|
||||
}
|
||||