Compare commits
447 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7cfcc7855 | ||
|
|
05948aebf5 | ||
|
|
cca214aaf7 | ||
|
|
0111954c5e | ||
|
|
ce31499964 | ||
|
|
059864d193 | ||
|
|
6d2fb4dde8 | ||
|
|
49059d9c59 | ||
|
|
d2f7041988 | ||
|
|
f94372d20b | ||
|
|
9af98b034f | ||
|
|
341b8df5a9 | ||
|
|
7470f697bd | ||
|
|
c058b99a0d | ||
|
|
d5eed13f38 | ||
|
|
c27ee88182 | ||
|
|
e2559ffa65 | ||
|
|
a0bd32453c | ||
|
|
54e7a91841 | ||
|
|
042f6eef51 | ||
| c9857326c6 | |||
| 9c4e0094f9 | |||
| 781b27af51 | |||
|
|
37e257afc8 | ||
| 4d4fdd6190 | |||
|
|
0fd2d8252d | ||
|
|
3cf5019880 | ||
|
|
258d3d692f | ||
|
|
667ed3bcc0 | ||
|
|
a882189022 | ||
|
|
686e009243 | ||
|
|
30d5f3390c | ||
|
|
3398b414ca | ||
|
|
b6a2c42feb | ||
|
|
cb5a9050f2 | ||
|
|
661b27abd0 | ||
|
|
59a24c9ea2 | ||
|
|
6cf5da5d48 | ||
|
|
537f5e2f4c | ||
|
|
70531a0729 | ||
|
|
ded15e5c8b | ||
|
|
3021f7e4d3 | ||
|
|
876d9cfa00 | ||
|
|
8f28825162 | ||
|
|
0e6612f6bd | ||
|
|
39183fde5d | ||
|
|
b967419cb1 | ||
|
|
0712698638 | ||
|
|
d3a74e830f | ||
|
|
f68da773ab | ||
|
|
8db814dba4 | ||
|
|
7dcff99de5 | ||
|
|
97100dfa63 | ||
|
|
d41707fcf9 | ||
|
|
2377916f29 | ||
|
|
be2f40715a | ||
|
|
489c0882ac | ||
|
|
492db88b45 | ||
|
|
3b198eb4ed | ||
|
|
5efc27d4b6 | ||
|
|
ec9f270d04 | ||
|
|
afd2d467f3 | ||
|
|
ff0798450d | ||
|
|
fbefc70368 | ||
|
|
faa0bc54a6 | ||
|
|
bf5f4eab77 | ||
| 188456c970 | |||
|
|
c06334e96f | ||
| 82e8bf2e0b | |||
| 30382fb34d | |||
| c7e5ee0862 | |||
|
|
d6ac63586b | ||
|
|
e0fd42199f | ||
|
|
d9e3168484 | ||
|
|
dc7e91ca66 | ||
|
|
692358d278 | ||
| 3750031d6b | |||
| 0bae200241 | |||
|
|
61bd1a0d6a | ||
|
|
37cf3dfdd7 | ||
|
|
8be96ca64e | ||
|
|
d225391248 | ||
|
|
f2fd0b078e | ||
|
|
f71963ea3b | ||
|
|
6a635246bb | ||
|
|
d338ca6b25 | ||
|
|
193c3b963c | ||
|
|
cad4965b1b | ||
|
|
79306d846f | ||
|
|
f4ea510c5d | ||
|
|
07cc26fa8d | ||
|
|
f87e268242 | ||
|
|
1aeceffe0b | ||
|
|
fc97087767 | ||
|
|
61be97b04b | ||
|
|
934162875c | ||
|
|
4b3991099a | ||
|
|
b14a961c1a | ||
|
|
cbe41d80ce | ||
|
|
28203f2621 | ||
|
|
b8492dfbe6 | ||
|
|
15faac8079 | ||
|
|
ad850ca4ee | ||
|
|
6c05c6e06e | ||
|
|
8b2cda80b1 | ||
|
|
3f7756b417 | ||
|
|
5004e319b6 | ||
|
|
19035f2dc9 | ||
|
|
9d8a5c76b2 | ||
|
|
6300eb2f43 | ||
|
|
da58ffb621 | ||
|
|
1500fafb92 | ||
|
|
df53eea432 | ||
|
|
cc1771c208 | ||
|
|
5e881c0804 | ||
|
|
5666e01ae0 | ||
|
|
4acec8a2d6 | ||
|
|
426a511099 | ||
|
|
89303b44ae | ||
|
|
ffb82066bb | ||
|
|
f46b8c0a56 | ||
|
|
280289af37 | ||
| a0c7f79302 | |||
| bd1eecc106 | |||
|
|
1a23bcb510 | ||
|
|
942c28d3bd | ||
| 034b31ba47 | |||
|
|
7a76c2da8a | ||
|
|
1a9d8e8606 | ||
| 14583d919d | |||
|
|
629fd174e4 | ||
|
|
9080fe06a4 | ||
|
|
0e183bb5c1 | ||
| 8caf856d2d | |||
|
|
d28669e6b0 | ||
| 700884d01a | |||
| c06bd9fa24 | |||
| ce92a1d645 | |||
|
|
4f622da52c | ||
| 7d3e86a5fc | |||
|
|
c66d181b98 | ||
| f860630bfb | |||
|
|
6db4d79839 | ||
| e2924d5e57 | |||
| 92b9a82f21 | |||
|
|
c3f89ca1f8 | ||
|
|
8c435c91dd | ||
|
|
6e6cfa5be0 | ||
|
|
ea203d0ccc | ||
|
|
370cd52774 | ||
|
|
942bae3045 | ||
|
|
356548c8fb | ||
| 5c012c2bc9 | |||
| 9c9b8015a0 | |||
| bba0ced7f9 | |||
|
|
e8de7b56d9 | ||
|
|
95022f62a8 | ||
|
|
1d918f3335 | ||
|
|
f992637ad2 | ||
|
|
40f18bbdf8 | ||
|
|
3bb9cec08a | ||
|
|
6842260f59 | ||
|
|
305c30d725 | ||
|
|
e799dd2f08 | ||
| 1e83172e9a | |||
|
|
475d236b7e | ||
|
|
ddeb84fcfe | ||
|
|
b3aeebb7c7 | ||
|
|
b11f4839f4 | ||
|
|
4adc28a055 | ||
|
|
e46e9e1d3a | ||
|
|
4fcb26bbde | ||
|
|
6bd0e891fa | ||
|
|
15f1308557 | ||
|
|
9689197db9 | ||
|
|
4ad490657f | ||
|
|
9f8f8244e3 | ||
|
|
9206be2562 | ||
|
|
6065fd1f67 | ||
|
|
c16560a0ca | ||
|
|
440cfe1ac5 | ||
|
|
1ad1a0198e | ||
|
|
b603ac9bdb | ||
|
|
68aa4c409b | ||
|
|
f22b4e7fb8 | ||
|
|
400328d5fa | ||
|
|
cce3e6861a | ||
|
|
55368ce9b8 | ||
|
|
c6ef54f7d3 | ||
| 6f97c48226 | |||
| 5f45bc98fb | |||
|
|
5738594be2 | ||
|
|
ce47831992 | ||
| 634c2d84fc | |||
| 70855c5a21 | |||
|
|
b1e5e70411 | ||
|
|
bf2e3219fc | ||
|
|
2f5aeb9ffc | ||
| 9e8ed310fc | |||
| 07a5e32579 | |||
|
|
fe1bb04922 | ||
| a75e964adc | |||
|
|
87d22032e6 | ||
|
|
55ae64b3e1 | ||
|
|
891c6d8e93 | ||
|
|
ba7747dfe9 | ||
| b148c04059 | |||
|
|
4e179d61b5 | ||
|
|
b23ee84543 | ||
|
|
d02f85cea5 | ||
| ab02f8f1b3 | |||
| 8fc1d1ffc9 | |||
|
|
44b1da94c1 | ||
|
|
c2b63a7a3f | ||
|
|
56619c9140 | ||
|
|
99bbb5434d | ||
| 40c9c5fdad | |||
|
|
3ea2c93e43 | ||
|
|
6369c8ee63 | ||
|
|
da4bbf1e2c | ||
|
|
14e5535fd8 | ||
|
|
4e53bb3b27 | ||
| e793fdbe42 | |||
| 0e41a5b9f1 | |||
|
|
ac9dfd1669 | ||
|
|
72eb3e189b | ||
| 0cace11975 | |||
| b8e502b168 | |||
|
|
15502d0107 | ||
| cb4e4646bd | |||
| 93ce1b4994 | |||
|
|
1c452b5574 | ||
|
|
876c06ef54 | ||
|
|
37d65a944d | ||
|
|
7bc9321c86 | ||
|
|
ee564dccb6 | ||
| cdbb386c7c | |||
| 325ade7cdc | |||
|
|
fcd8c1a0dd | ||
|
|
fa1cb02a51 | ||
|
|
40fe12cd96 | ||
|
|
d83c04dc8b | ||
|
|
23b2974597 | ||
|
|
f5e78316ef | ||
|
|
cc2020f3d6 | ||
|
|
26cda335c5 | ||
|
|
171533cef0 | ||
|
|
69de6dd7a3 | ||
|
|
9039ed4bdc | ||
|
|
131d3b7018 | ||
|
|
454aabdc97 | ||
|
|
089c97d859 | ||
|
|
9ff5423368 | ||
|
|
f29d6e8d88 | ||
|
|
5199ee2db0 | ||
|
|
6de9e22b4c | ||
|
|
52968d9aaa | ||
|
|
b584142f5e | ||
|
|
edea30a406 | ||
|
|
1f3024eb91 | ||
| 8b9abba74b | |||
|
|
4dec1392f7 | ||
|
|
e54cbfbc0a | ||
|
|
505cd93446 | ||
|
|
f3ee11ebab | ||
|
|
45295ef898 | ||
|
|
0635dda6a0 | ||
|
|
f58f7b97e5 | ||
|
|
7556f0e5bc | ||
|
|
17fe29cb1b | ||
|
|
4bb4eb80d9 | ||
| ae1507e775 | |||
|
|
85d8a57bf7 | ||
|
|
42cf23a516 | ||
|
|
858cf75b46 | ||
|
|
de8a392d2c | ||
|
|
b614767b2d | ||
|
|
5ebb8549bf | ||
|
|
ead1feb379 | ||
|
|
1474c15bd9 | ||
|
|
f24f87dcc8 | ||
|
|
d416f46b3a | ||
| 352df35205 | |||
|
|
e5f201515e | ||
|
|
40520a7d30 | ||
|
|
cffbfe1380 | ||
|
|
839777ea4d | ||
|
|
5be1d22115 | ||
|
|
80d1912fd5 | ||
|
|
b94e0323d9 | ||
|
|
90f4e53e9f | ||
|
|
7ebad7d6b9 | ||
|
|
34534a1dbf | ||
| 645fac0681 | |||
| 0a23700403 | |||
|
|
c00f8843c0 | ||
|
|
8869974471 | ||
|
|
8125d60105 | ||
|
|
5a32d5b7a8 | ||
|
|
a1d113562b | ||
|
|
4a7535e4f5 | ||
|
|
de5548bbbd | ||
|
|
87c46e8477 | ||
|
|
edda224847 | ||
|
|
5ac6bbf04b | ||
|
|
b0a5329937 | ||
|
|
7a0626413d | ||
| fe04ad1573 | |||
|
|
689cc39bbc | ||
|
|
ba0c577514 | ||
|
|
a629907196 | ||
|
|
bf60bcfe12 | ||
|
|
27eb9a7d93 | ||
|
|
336ee843cc | ||
|
|
9eac101794 | ||
|
|
085fcc62aa | ||
|
|
99e6abbcfd | ||
| a4b96066e0 | |||
|
|
c4e2da8d67 | ||
|
|
1be15ee849 | ||
|
|
99bc54349b | ||
|
|
bf823ddff0 | ||
|
|
23e72f38a6 | ||
|
|
2d993b2f73 | ||
| 9703d35a3a | |||
|
|
d10a7a4884 | ||
|
|
938b9054d3 | ||
|
|
8a5bcca901 | ||
|
|
410cd53e51 | ||
|
|
4031724fa9 | ||
|
|
e95552e6b9 | ||
|
|
012f7e3346 | ||
|
|
cbe6c4a98d | ||
|
|
aa52778e99 | ||
|
|
5e8dda0b75 | ||
|
|
081aeacff7 | ||
|
|
65e54ee2b5 | ||
|
|
0fd6ebf810 | ||
|
|
fa4b5d26e5 | ||
|
|
23f45b38cb | ||
|
|
d76b055730 | ||
|
|
c334c07b39 | ||
|
|
45a5dcb068 | ||
|
|
3d9ba8b1cb | ||
|
|
c6836cad06 | ||
|
|
e70d1cb3f2 | ||
|
|
af454e1a56 | ||
|
|
6ce58e86ad | ||
| 2e17531c52 | |||
|
|
6b76d89507 | ||
|
|
e4025e39cb | ||
|
|
af12dc8d0a | ||
|
|
f0edeaee85 | ||
|
|
5cbdadecc4 | ||
|
|
30c1f90513 | ||
| c241d8b819 | |||
| 24f12a3590 | |||
|
|
f17f5c9925 | ||
|
|
99877b1c98 | ||
|
|
fdf91965d9 | ||
|
|
fd21d32f4a | ||
|
|
0a4385f29b | ||
|
|
63c6693d04 | ||
|
|
ff7084a332 | ||
|
|
b63e8897f5 | ||
|
|
dc3976f525 | ||
|
|
9b8765f001 | ||
| bbe23e1b14 | |||
|
|
5f0b36b3bb | ||
|
|
f0b75eae2f | ||
|
|
45e62b2750 | ||
|
|
d11e4822ed | ||
|
|
93b67fe845 | ||
|
|
ebc2ac1a41 | ||
|
|
4fd2f10ec6 | ||
|
|
2715871017 | ||
|
|
4cfca89895 | ||
| 53ead0e62f | |||
|
|
b00967159a | ||
|
|
1b37684e3c | ||
|
|
48f393be25 | ||
|
|
645fb83bce | ||
|
|
fe8bc407d3 | ||
|
|
d20cab57be | ||
|
|
68df3d5e23 | ||
|
|
8984bc577e | ||
|
|
07d02307e2 | ||
|
|
a027dc75c3 | ||
|
|
5da07d8631 | ||
|
|
d061fc9b32 | ||
|
|
ae47d429ba | ||
|
|
396d6a7336 | ||
|
|
fdf826d5f8 | ||
|
|
0db5fa650f | ||
|
|
53b4616a87 | ||
|
|
b923b7c35d | ||
|
|
8bd5351d29 | ||
|
|
726f7841e8 | ||
|
|
47883ce426 | ||
|
|
2459fc1848 | ||
|
|
cbc11f636a | ||
|
|
5dbd6eb8be | ||
|
|
167716e61b | ||
|
|
6d7f045bce | ||
|
|
a73417ea02 | ||
|
|
9c3850db98 | ||
| 393ad5fa0b | |||
|
|
9e8fe2c91f | ||
|
|
b57a7edf28 | ||
|
|
85cc5ebb27 | ||
| 0cd32fbb5f | |||
|
|
2833e65f57 | ||
|
|
5a29403636 | ||
|
|
9c0b9a7c93 | ||
|
|
69a4cbbbc2 | ||
|
|
e2b2382cc4 | ||
|
|
f8a4d05f57 | ||
|
|
d996c43f9f | ||
|
|
c195a58eb4 | ||
| b1c9375873 | |||
|
|
6010cbf20a | ||
|
|
11c32ed360 | ||
|
|
0494822ff4 | ||
|
|
2611f43d1f | ||
| ea4edfadd0 | |||
|
|
8e2a22cf61 | ||
|
|
3a1cfe0f31 | ||
|
|
5bdc44b301 | ||
|
|
92a1736667 | ||
|
|
57f9238033 | ||
|
|
1b171d4b8d | ||
|
|
c5acb84d97 | ||
|
|
63a1e9ec56 | ||
|
|
f06a8d6b15 | ||
| 92df927453 | |||
|
|
2878dce69d | ||
|
|
7d5d128b54 | ||
|
|
6e9e3db358 | ||
|
|
a415ffa12a | ||
|
|
9e8cdaead6 | ||
|
|
e5d4aae846 | ||
|
|
d6af35828d | ||
|
|
aa86c5e662 | ||
|
|
f99aa94b8f | ||
|
|
f5c226ba28 | ||
|
|
741020fe79 | ||
|
|
33004e081d |
@@ -1,112 +0,0 @@
|
||||
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from "axios";
|
||||
import { showFullScreenLoading, tryHideFullScreenLoading } from "@/components/Loading/fullScreen";
|
||||
import { LOGIN_URL } from "@/config";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ResultData } from "@/api/interface";
|
||||
import { ResultEnum } from "@/enums/httpEnum";
|
||||
import { checkStatus } from "./helper/checkStatus";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
import router from "@/routers";
|
||||
|
||||
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
||||
loading?: boolean;
|
||||
}
|
||||
|
||||
const config = {
|
||||
// 默认地址请求地址,可在 .env.** 文件中修改
|
||||
baseURL: import.meta.env.VITE_API_URL as string,
|
||||
// 设置超时时间
|
||||
timeout: ResultEnum.TIMEOUT as number,
|
||||
// 跨域时候允许携带凭证
|
||||
withCredentials: true,
|
||||
// post请求指定数据类型以及编码
|
||||
headers: { 'Content-Type': 'application/json;charset=utf-8' }
|
||||
};
|
||||
|
||||
class RequestHttp {
|
||||
service: AxiosInstance;
|
||||
public constructor(config: AxiosRequestConfig) {
|
||||
// 创建实例
|
||||
this.service = axios.create(config);
|
||||
|
||||
/**
|
||||
* @description 请求拦截器
|
||||
* 客户端发送请求 -> [请求拦截器] -> 服务器
|
||||
* token校验(JWT) : 接受服务器返回的 token,存储到 vuex/pinia/本地储存当中
|
||||
*/
|
||||
this.service.interceptors.request.use(
|
||||
(config: CustomAxiosRequestConfig) => {
|
||||
const userStore = useUserStore();
|
||||
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { loading: false } 来控制
|
||||
config.loading ?? (config.loading = true);
|
||||
config.loading && showFullScreenLoading();
|
||||
if (config.headers && typeof config.headers.set === "function") {
|
||||
config.headers.set("x-access-token", userStore.token);
|
||||
}
|
||||
return config;
|
||||
},
|
||||
(error: AxiosError) => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* @description 响应拦截器
|
||||
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
|
||||
*/
|
||||
this.service.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
const { data } = response;
|
||||
const userStore = useUserStore();
|
||||
tryHideFullScreenLoading();
|
||||
// 登陆失效
|
||||
if (data.code == ResultEnum.OVERDUE) {
|
||||
userStore.setToken("");
|
||||
router.replace(LOGIN_URL);
|
||||
ElMessage.error(data.message);
|
||||
return Promise.reject(data);
|
||||
}
|
||||
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
|
||||
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
||||
ElMessage.error(data.message);
|
||||
return Promise.reject(data);
|
||||
}
|
||||
// 成功请求(在页面上除非特殊情况,否则不用处理失败逻辑)
|
||||
return data;
|
||||
},
|
||||
async (error: AxiosError) => {
|
||||
const { response } = error;
|
||||
tryHideFullScreenLoading();
|
||||
// 请求超时 && 网络错误单独判断,没有 response
|
||||
if (error.message.indexOf("timeout") !== -1) ElMessage.error("请求超时!请您稍后重试");
|
||||
if (error.message.indexOf("Network Error") !== -1) ElMessage.error("网络错误!请您稍后重试");
|
||||
// 根据服务器响应的错误状态码,做不同的处理
|
||||
if (response) checkStatus(response.status);
|
||||
// 服务器结果都没有返回(可能服务器错误可能客户端断网),断网处理:可以跳转到断网页面
|
||||
if (!window.navigator.onLine) router.replace("/500");
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 常用请求方法封装
|
||||
*/
|
||||
get<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
|
||||
return this.service.get(url, { params, ..._object });
|
||||
}
|
||||
post<T>(url: string, params?: object | string, _object = {}): Promise<ResultData<T>> {
|
||||
return this.service.post(url, params, _object);
|
||||
}
|
||||
put<T>(url: string, params?: object, _object = {}): Promise<ResultData<T>> {
|
||||
return this.service.put(url, params, _object);
|
||||
}
|
||||
delete<T>(url: string, params?: any, _object = {}): Promise<ResultData<T>> {
|
||||
return this.service.delete(url, { params, ..._object });
|
||||
}
|
||||
download(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||
return this.service.post(url, params, { ..._object, responseType: "blob" });
|
||||
}
|
||||
}
|
||||
|
||||
export default new RequestHttp(config);
|
||||
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@@ -1,18 +1,28 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Analyse",
|
||||
"CHNFACTOR",
|
||||
"CHNPACTOR",
|
||||
"Chns",
|
||||
"Combox",
|
||||
"Datasource",
|
||||
"daterange",
|
||||
"devicedata",
|
||||
"errordata",
|
||||
"errordetail",
|
||||
"Interharmonic",
|
||||
"IRMS",
|
||||
"logdata",
|
||||
"MSQI",
|
||||
"Pids",
|
||||
"plandata",
|
||||
"PQDIF",
|
||||
"Preinvestment",
|
||||
"resourcedata",
|
||||
"resourcename",
|
||||
"rmark",
|
||||
"showtest"
|
||||
"showtest",
|
||||
"UNBAN",
|
||||
"VRMS"
|
||||
]
|
||||
}
|
||||
@@ -25,10 +25,10 @@ module.exports = (appInfo) => {
|
||||
*/
|
||||
config.windowsOption = {
|
||||
title: '自动检测平台',
|
||||
width: 1280,
|
||||
height: 850,
|
||||
minWidth: 1280,
|
||||
minHeight: 850,
|
||||
width: 1600,
|
||||
height: 950,
|
||||
minWidth: 1600,
|
||||
minHeight: 950,
|
||||
webPreferences: {
|
||||
//webSecurity: false,
|
||||
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
|
||||
|
||||
@@ -19,6 +19,7 @@ VITE_API_URL=/api
|
||||
|
||||
# 开发环境跨域代理,支持配置多个
|
||||
|
||||
#VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
|
||||
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||
|
||||
@@ -22,4 +22,5 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_PWA=true
|
||||
|
||||
# 线上环境接口地址
|
||||
#VITE_API_URL="/api" # 打包时用
|
||||
VITE_API_URL="http://192.168.1.125:18092/"
|
||||
|
||||
11
frontend/.prettierrc
Normal file
11
frontend/.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"tabWidth": 4,
|
||||
"printWidth": 120,
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"arrowParens": "avoid",
|
||||
"endOfLine": "lf",
|
||||
"htmlWhitespaceSensitivity": "ignore"
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"echarts": "^5.4.3",
|
||||
"echarts-liquidfill": "^3.1.0",
|
||||
"element-plus": "^2.7.8",
|
||||
"html2canvas": "^1.4.1",
|
||||
"md5": "^2.3.0",
|
||||
"mitt": "^3.0.1",
|
||||
"mkdirp": "^3.0.1",
|
||||
@@ -41,11 +42,13 @@
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.8.0",
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@types/html2canvas": "^1.0.0",
|
||||
"@types/md5": "^2.3.2",
|
||||
"@types/node": "^20.14.14",
|
||||
"@types/nprogress": "^0.2.0",
|
||||
"@types/qs": "^6.9.8",
|
||||
"@types/sortablejs": "^1.15.2",
|
||||
"@types/xlsx": "^0.0.36",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
||||
"@typescript-eslint/parser": "^6.7.0",
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:size='assemblySize'
|
||||
:button='buttonConfig'
|
||||
>
|
||||
<router-view :key='$route.fullPath' />
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
|
||||
197
frontend/src/api/check/interface/index.ts
Normal file
197
frontend/src/api/check/interface/index.ts
Normal file
@@ -0,0 +1,197 @@
|
||||
export namespace CheckData {
|
||||
export interface DataCheck {
|
||||
scriptName: string,
|
||||
errorSysId: string,
|
||||
dataRule: string,
|
||||
deviceName: string,
|
||||
chnNum: string,
|
||||
}
|
||||
|
||||
export interface PhaseCheckResult {
|
||||
// 检测源定值-标准值
|
||||
resultData: number,
|
||||
// 装置原始数据-被检值
|
||||
data: number,
|
||||
|
||||
|
||||
// 第几次谐波
|
||||
num?: number,
|
||||
//符合、不符合
|
||||
isData?: number,
|
||||
//最大误差值
|
||||
radius?: string,
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于定义 查看(设备)通道检测结果响应数据 类型
|
||||
*/
|
||||
export interface ResCheckResult {
|
||||
dataA?: PhaseCheckResult | null,
|
||||
dataB?: PhaseCheckResult | null,
|
||||
dataC?: PhaseCheckResult | null,
|
||||
dataT?: PhaseCheckResult | null,
|
||||
|
||||
// 第几次谐波
|
||||
//num: number | null,
|
||||
//符合、不符合
|
||||
isData?: number,
|
||||
//最大误差值
|
||||
radius?: string,
|
||||
//单位
|
||||
unit?: string,
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
|
||||
*/
|
||||
export interface CheckResult {
|
||||
stdA?: string,
|
||||
dataA?: string,
|
||||
errorA?: string,
|
||||
maxErrorA?: string,
|
||||
isDataA?: number,
|
||||
stdB?: string,
|
||||
dataB?: string,
|
||||
errorB?: string,
|
||||
maxErrorB?: string,
|
||||
isDataB?: number,
|
||||
stdC?: string,
|
||||
dataC?: string,
|
||||
errorC?: string,
|
||||
maxErrorC?: string,
|
||||
isDataC?: number,
|
||||
stdT?: string,
|
||||
dataT?: string,
|
||||
errorT?: string,
|
||||
maxErrorT?: string,
|
||||
isDataT?: number,
|
||||
|
||||
//最大误差值
|
||||
maxError?: string,
|
||||
unit?: string,
|
||||
//符合、不符合
|
||||
result?: number,
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于定义 具体通道的原始数据类型
|
||||
*/
|
||||
export interface RawDataItem {
|
||||
time?: string,
|
||||
harmNum?: number | null,
|
||||
dataA?: string,
|
||||
dataB?: string,
|
||||
dataC?: string,
|
||||
dataT?: string,
|
||||
unit?: string | null
|
||||
}
|
||||
|
||||
export interface Device {
|
||||
deviceId: string; //装置序号Id
|
||||
deviceName: string; //设备名称
|
||||
chnNum: number; //设备通道数
|
||||
|
||||
planId: string; //计划Id
|
||||
devType: string; //设备类型
|
||||
devVolt:number; //设备电压
|
||||
devCurr:number; //设备电流
|
||||
factorFlag:number; //是否支持系数校准
|
||||
}
|
||||
|
||||
// 用来描述检测脚本类型
|
||||
export interface ScriptItem {
|
||||
id: string,
|
||||
code: string,
|
||||
scriptName: string,
|
||||
}
|
||||
|
||||
// 用来描述 检测数据-左侧树结构
|
||||
export interface TreeItem {
|
||||
id:string | null,
|
||||
scriptTypeName: string | null,
|
||||
sourceDesc: string | null,
|
||||
harmNum: number | null,
|
||||
index: number | null,
|
||||
fly: number | null,
|
||||
children: TreeItem[] | null,
|
||||
}
|
||||
|
||||
// 用来描述 通道检测结果
|
||||
export enum ChnCheckResultEnum {
|
||||
UNKNOWN = -1,
|
||||
LOADING = 0,
|
||||
SUCCESS = 1,
|
||||
FAIL = 2,
|
||||
TIMEOUT = 3,
|
||||
ERRORDATA = 4
|
||||
}
|
||||
|
||||
export interface DeviceCheckResult {
|
||||
deviceId: string,
|
||||
deviceName: string,
|
||||
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||
}
|
||||
|
||||
//用来描述 某个脚本测试项对所有通道的检测结果
|
||||
export interface ScriptChnItem {
|
||||
scriptType: string
|
||||
scriptName?: string //可以不要该属性,有点多余
|
||||
|
||||
// 设备
|
||||
devices: Array<DeviceCheckResult>
|
||||
}
|
||||
|
||||
export enum ButtonColorEnum {
|
||||
INFO = '#909399',
|
||||
LOADING = '#003078',
|
||||
SUCCESS = '#67c23a',
|
||||
WARNING = '#e6a23c',
|
||||
DANGER = '#f56c6c',
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于描述 (设备)通道检测结果展示的按钮类型
|
||||
*/
|
||||
export interface ButtonResult {
|
||||
color: ButtonColorEnum
|
||||
icon: 'Minus' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled'
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于描述 脚本检测结果展示的按钮类型
|
||||
*/
|
||||
export interface ScriptChnViewItem {
|
||||
scriptType: string,
|
||||
scriptName?: string //脚本项名称,可以不要该属性,有点多余
|
||||
|
||||
// 设备
|
||||
devices: Array<{
|
||||
deviceId: string,
|
||||
deviceName: string,
|
||||
chnResult: ButtonResult[],
|
||||
}>
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定义检测日志类型
|
||||
*/
|
||||
export interface LogItem {
|
||||
type: 'info' | 'warning' | 'error'
|
||||
log: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义手动检测时,勾选的测试项
|
||||
*/
|
||||
export interface SelectTestItem {
|
||||
preTest: boolean,
|
||||
timeTest: boolean,
|
||||
channelsTest: boolean,
|
||||
test: boolean
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
63
frontend/src/api/check/test/index.ts
Normal file
63
frontend/src/api/check/test/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import http from "@/api";
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
|
||||
export const getBigTestItem = (params: {
|
||||
reCheckType:number,
|
||||
planId: string,
|
||||
devId: string,
|
||||
}) => {
|
||||
return http.post(`/adPlan/getBigTestItem`, params, {loading: false});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取弹出框表单数据
|
||||
* @param params 当为scriptType为null时,表示查询所有脚本类型,否则只查询指定脚本类型。当为chnNum为-1时,表示查询所有通道,否则只查询指定通道。
|
||||
*/
|
||||
export const getFormData = (params: {
|
||||
planId: string,
|
||||
deviceId: string,
|
||||
chnNum: string,
|
||||
scriptType: string | null
|
||||
}) => {
|
||||
return http.post("/result/formContent/", params, {loading: false});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取树形结构数据
|
||||
* @param params
|
||||
*/
|
||||
export const getTreeData = (params: {
|
||||
scriptId?: string,
|
||||
devId?: string,
|
||||
devNum?: string,
|
||||
scriptType?: string | null,
|
||||
code?: number,
|
||||
}) => {
|
||||
return http.post<CheckData.TreeItem[]>("/result/treeData/", params, {loading: true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检查数据
|
||||
* @param params
|
||||
*/
|
||||
export const getTableData = (params: {
|
||||
scriptType: string | null,
|
||||
scriptId: string,
|
||||
devId: string,
|
||||
devNum: string,
|
||||
code: number,
|
||||
index: number,
|
||||
}) => {
|
||||
return http.post("/result/resultData/", params, {loading: false});
|
||||
}
|
||||
|
||||
export const exportRawData = (params: {
|
||||
scriptType: string | null,
|
||||
scriptId: string,
|
||||
devId: string,
|
||||
devNum: string,
|
||||
code: number,
|
||||
index: number,
|
||||
}) => {
|
||||
return http.download("/result/exportRawData", params, {loading: false});
|
||||
}
|
||||
24
frontend/src/api/device/controlSource/index.ts
Normal file
24
frontend/src/api/device/controlSource/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
import type { controlSource } from '@/api/device/interface/controlSource'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 程控源管理模块
|
||||
*/
|
||||
|
||||
//通讯校验
|
||||
export const checkSimulate = (params: controlSource.ResControl) => {
|
||||
return http.post(`/prepare/ytxCheckSimulate`,params)
|
||||
}
|
||||
|
||||
//启动
|
||||
export const startSimulateTest = (params: controlSource.ResControl) => {
|
||||
return http.post(`prepare/startSimulateTest`,params,{loading:false})
|
||||
}
|
||||
|
||||
//停止
|
||||
export const closeSimulateTest = (params: controlSource.ResControl) => {
|
||||
return http.post(`/prepare/closeSimulateTest`,params,{loading:false})
|
||||
}
|
||||
|
||||
|
||||
29
frontend/src/api/device/devType/index.ts
Normal file
29
frontend/src/api/device/devType/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { DevType } from '@/api/device/interface/devType'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 设备类型管理模块
|
||||
*/
|
||||
|
||||
//获取设备类型
|
||||
export const getDevTypeList = (params: DevType.ReqPqDevTypeParams) => {
|
||||
return http.post(`/devType/list`, params)
|
||||
}
|
||||
|
||||
//添加设备类型
|
||||
export const addDevType = (params: DevType.ResPqDevType) => {
|
||||
return http.post(`/devType/add`, params)
|
||||
}
|
||||
|
||||
//编辑设备类型
|
||||
export const updateDevType = (params: DevType.ResPqDevType) => {
|
||||
return http.post(`/devType/update`, params)
|
||||
}
|
||||
|
||||
//删除设备类型
|
||||
export const deleteDevType = (params: string[]) => {
|
||||
return http.post(`/devType/delete`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,64 +48,64 @@ const data = [
|
||||
{
|
||||
id: '1', //装置序号ID
|
||||
name: '240001', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '2', //装置序号ID
|
||||
name: '240002', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '3', //装置序号ID
|
||||
name: '240003', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '4', //装置序号ID
|
||||
name: '240004', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '5', //装置序号ID
|
||||
name: '240005', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '有不合格项', //检测结果
|
||||
check_Result: '不符合', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
reCheck_Num: 1, //复检次数
|
||||
},
|
||||
{
|
||||
id: '6', //装置序号ID
|
||||
name: '240006', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '有不合格项', //检测结果
|
||||
check_Result: '不符合', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -114,9 +114,9 @@ const data = [
|
||||
{
|
||||
id: '7', //装置序号ID
|
||||
name: '240007', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
check_Result: '符合', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -125,20 +125,20 @@ const data = [
|
||||
{
|
||||
id: '8', //装置序号ID
|
||||
name: '240008', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
check_Result: '符合', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
reCheck_Num: 1, //复检次数
|
||||
},
|
||||
{
|
||||
id: '9', //装置序号ID
|
||||
name: '240009', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '有不合格项', //检测结果
|
||||
check_Result: '不符合', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -147,9 +147,9 @@ const data = [
|
||||
{
|
||||
id: '10', //装置序号ID
|
||||
name: '240010', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
check_Result: '符合', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -158,9 +158,9 @@ const data = [
|
||||
{
|
||||
id: '11', //装置序号ID
|
||||
name: '240011', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
check_Result: '符合', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '已归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -169,9 +169,9 @@ const data = [
|
||||
{
|
||||
id: '12', //装置序号ID
|
||||
name: '240012', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Type: 'PQS-882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
check_Result: '符合', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '已归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -180,89 +180,89 @@ const data = [
|
||||
{
|
||||
id: '13', //装置序号ID
|
||||
name: '240013', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '14', //装置序号ID
|
||||
name: '240014', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '15', //装置序号ID
|
||||
name: '240013', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
name: '240015', //设备名称
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '16', //装置序号ID
|
||||
name: '240014', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
name: '240016', //设备名称
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '17', //装置序号ID
|
||||
name: '240017', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '18', //装置序号ID
|
||||
name: '240018', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '19', //装置序号ID
|
||||
name: '240019', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '20', //装置序号ID
|
||||
name: '240020', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Type: 'PQS-882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
check_Result: '未检', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
check_State:'未检',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
]
|
||||
|
||||
@@ -25,15 +25,39 @@ export const deletePqDev = (params: string[]) => {
|
||||
return http.post(`/pqDev/delete`, params)
|
||||
}
|
||||
|
||||
//导出被检设备
|
||||
export const exportPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
return http.download(`/pqDev/export`, params)
|
||||
}
|
||||
export const downloadTemplate = () => {
|
||||
return http.download(`/pqDev/downloadTemplate`)
|
||||
}
|
||||
//导入被检设备
|
||||
export const importPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
return http.upload(`/pqDev/import`, params)
|
||||
// export const downloadTemplate = () => {
|
||||
// return http.download(`/pqDev/downloadTemplate`)
|
||||
// }
|
||||
|
||||
// //导入被检设备(比对)
|
||||
// export const importPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
// return http.upload(`/pqDev/import`, params)
|
||||
// }
|
||||
// //导入比对式被检设备
|
||||
// export const importContrastPqDev=(params: Device.ReqPqDevParams)=>{
|
||||
// return http.upload(`/pqDev/importContrast`, params)
|
||||
// }
|
||||
|
||||
//导出灿能二楼设备
|
||||
export const exportCNDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.download(`/pqDev/exportCNDev`, params)
|
||||
}
|
||||
|
||||
// 下载灿能二楼设备导入文件模板
|
||||
export const downloadCNDevTemplate = () => {
|
||||
return http.download(`/pqDev/downloadCNDevTemplate`)
|
||||
}
|
||||
|
||||
//导入灿能二楼设备
|
||||
export const importCNDev = (params: Device.ReqPqDevParams) => {
|
||||
return http.uploadExcel(`/pqDev/importCNDev`, params)
|
||||
}
|
||||
//根据设备类型决定(电源、icd、模板、通道数、额定电压、额定电流);
|
||||
export const getPqDev = () => {
|
||||
return http.get(`/devType/listAll`)
|
||||
}
|
||||
|
||||
//被检设备归档
|
||||
export const documentedPqDev = (ids: string[]) => {
|
||||
return http.post(`/pqDev/documented`, ids)
|
||||
}
|
||||
|
||||
@@ -30,177 +30,202 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
||||
},
|
||||
])
|
||||
|
||||
const errordetail = ref<ErrorSystem.Error_detail[]>([
|
||||
const errorADetail = ref<ErrorSystem.Error_detail[]>([
|
||||
{
|
||||
measured: '电压偏差',
|
||||
col1: '电压偏差',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: '10%~150%标称电压',
|
||||
maxErrorValue: '±0.1%Un'
|
||||
},
|
||||
{
|
||||
measured: '频率偏差',
|
||||
col1:'频率偏差',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'频率',
|
||||
condition: '42.5~57.5 Hz',
|
||||
maxErrorValue: '±0.01Hz'
|
||||
},
|
||||
{
|
||||
measured: '三相不平衡度',
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: '0.5%~5%',
|
||||
maxErrorValue: '±0.15%'
|
||||
},
|
||||
{
|
||||
measured: '三相不平衡度',
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: '5%(不包含)~ 40%',
|
||||
maxErrorValue: '±0.3%'
|
||||
},
|
||||
{
|
||||
measured: '三相不平衡度',
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: '',
|
||||
maxErrorValue: '±1%'
|
||||
},
|
||||
{
|
||||
measured: '电压波动幅值',
|
||||
col1:'电压波动',
|
||||
col2: '电压幅值',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: '',
|
||||
maxErrorValue: '±0.2%Un'
|
||||
},
|
||||
{
|
||||
measured: '电压波动持续时间',
|
||||
col1:'电压波动',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'时间',
|
||||
condition: '',
|
||||
maxErrorValue: '±1周波'
|
||||
},
|
||||
{
|
||||
measured: '闪变',
|
||||
col1:'闪变',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'短时间闪变',
|
||||
condition: 'Pst:0.2~10',
|
||||
maxErrorValue: '±5%'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh≥1%Un',
|
||||
maxErrorValue: '±5%Uh'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh<1%Un',
|
||||
maxErrorValue: '±0.05%Un'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: 'In≥3%In',
|
||||
maxErrorValue: '±5%Ih'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: 'In<3%In',
|
||||
maxErrorValue: '±0.15%In'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'相角',
|
||||
condition: '',
|
||||
maxErrorValue: 'h≤5,±1°*h'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'相角',
|
||||
condition: '',
|
||||
maxErrorValue: 'h>5,±5°'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'功率',
|
||||
condition: 'Ph≥150W',
|
||||
maxErrorValue: '±1%Ph'
|
||||
},
|
||||
{
|
||||
measured: '谐波和间谐波',
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'功率',
|
||||
condition: 'Ph<150W',
|
||||
maxErrorValue: '±1.5W'
|
||||
},
|
||||
{
|
||||
measured: '高频次谐波',
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh≥1%Un',
|
||||
maxErrorValue: '±5%Uh'
|
||||
},
|
||||
{
|
||||
measured: '高频次谐波',
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh<1%Un',
|
||||
maxErrorValue: '±0.05%Un'
|
||||
},
|
||||
{
|
||||
measured: '高频次谐波',
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: 'In≥3%In',
|
||||
maxErrorValue: '±5%Ih'
|
||||
},
|
||||
{
|
||||
measured: '高频次谐波',
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: 'In<3%In',
|
||||
maxErrorValue: '±0.15%In'
|
||||
},
|
||||
{
|
||||
measured: '功率',
|
||||
col1:'功率',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'功率',
|
||||
condition: '',
|
||||
maxErrorValue: '±0.5%'
|
||||
},
|
||||
{
|
||||
measured: '电流',
|
||||
col1:'电流',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: 'I≥0.05In',
|
||||
maxErrorValue: '±0.5%'
|
||||
},
|
||||
{
|
||||
measured: '电流',
|
||||
col1:'电流',
|
||||
col2: '',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电流',
|
||||
condition: '0.01In≤I<0.05In',
|
||||
maxErrorValue: '±1%'
|
||||
},
|
||||
{
|
||||
measured: '暂态电压幅值',
|
||||
col1: '电压暂降、电压暂升和短时中断',
|
||||
col2: '电压幅值',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'电压',
|
||||
condition: '',
|
||||
maxErrorValue: '±0.2%Un'
|
||||
},
|
||||
{
|
||||
measured: '暂态持续时间',
|
||||
col1: '电压暂降、电压暂升和短时中断',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'A',
|
||||
measurementType:'时间',
|
||||
condition: '',
|
||||
@@ -208,5 +233,191 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
||||
},
|
||||
])
|
||||
|
||||
const errorSDetail = ref<ErrorSystem.Error_detail[]>([
|
||||
{
|
||||
col1: '电压偏差',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: '20%~120%标称电压',
|
||||
maxErrorValue: '±0.5%'
|
||||
},
|
||||
{
|
||||
col1:'频率偏差',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'频率',
|
||||
condition: '42.5~57.5 Hz',
|
||||
maxErrorValue: '±0.05Hz'
|
||||
},
|
||||
{
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: '1%~5%',
|
||||
maxErrorValue: '±0.2%'
|
||||
},
|
||||
{
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: '5%(不包含)~ 40%',
|
||||
maxErrorValue: '±0.6%'
|
||||
},
|
||||
{
|
||||
col1:'三相不平衡度',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: '',
|
||||
maxErrorValue: '±1%'
|
||||
},
|
||||
{
|
||||
col1:'电压波动',
|
||||
col2: '电压幅值',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: '',
|
||||
maxErrorValue: '±1.0%Un'
|
||||
},
|
||||
{
|
||||
col1:'电压波动',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'时间',
|
||||
condition: '使用半波刷新方均根值',
|
||||
maxErrorValue: '±1周波'
|
||||
},
|
||||
{
|
||||
col1:'电压波动',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'时间',
|
||||
condition: '使用全波刷新方均根值',
|
||||
maxErrorValue: '±2周波'
|
||||
},
|
||||
{
|
||||
col1:'闪变',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'短时间闪变',
|
||||
condition: 'Pst:0.4~4',
|
||||
maxErrorValue: '±10%'
|
||||
},
|
||||
{
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh≥3%Un',
|
||||
maxErrorValue: '±5%Uh'
|
||||
},
|
||||
{
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh<3%Un',
|
||||
maxErrorValue: '±0.15%Un'
|
||||
},
|
||||
{
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: 'In≥10%In',
|
||||
maxErrorValue: '±5%Ih'
|
||||
},
|
||||
{
|
||||
col1:'谐波和间谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: 'In<10%In',
|
||||
maxErrorValue: '±0.5%In'
|
||||
},
|
||||
{
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh≥3%Un',
|
||||
maxErrorValue: '±5%Uh'
|
||||
},
|
||||
{
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: 'Uh<3%Un',
|
||||
maxErrorValue: '±0.15%Un'
|
||||
},
|
||||
{
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: 'In≥10%In',
|
||||
maxErrorValue: '±5%Ih'
|
||||
},
|
||||
{
|
||||
col1:'高频次谐波',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: 'In<10%In',
|
||||
maxErrorValue: '±0.5%In'
|
||||
},
|
||||
{
|
||||
col1:'功率',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'功率',
|
||||
condition: '',
|
||||
maxErrorValue: '±0.5%'
|
||||
},
|
||||
{
|
||||
col1:'电流',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: 'I≥0.05In',
|
||||
maxErrorValue: '±0.5%'
|
||||
},
|
||||
{
|
||||
col1:'电流',
|
||||
col2: '',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电流',
|
||||
condition: '0.01In≤I<0.05In',
|
||||
maxErrorValue: '±1%'
|
||||
},
|
||||
{
|
||||
col1: '电压暂降、电压暂升和短时中断',
|
||||
col2: '电压幅值',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'电压',
|
||||
condition: '',
|
||||
maxErrorValue: '±1.0%Un'
|
||||
},
|
||||
{
|
||||
col1: '电压暂降、电压暂升和短时中断',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'时间',
|
||||
condition: '使用半波刷新方均根值',
|
||||
maxErrorValue: '±1周波'
|
||||
},
|
||||
{
|
||||
col1: '电压暂降、电压暂升和短时中断',
|
||||
col2: '持续时间',
|
||||
deviceLevel: 'S',
|
||||
measurementType:'时间',
|
||||
condition: '使用全波刷新方均根值',
|
||||
maxErrorValue: '±2周波'
|
||||
},
|
||||
])
|
||||
|
||||
export default {errordata,errordetail}
|
||||
export default {errordata,errorADetail,errorSDetail}
|
||||
38
frontend/src/api/device/icd/index.ts
Normal file
38
frontend/src/api/device/icd/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { ICD } from '@/api/device/interface/icd'
|
||||
import http from '@/api'
|
||||
import { pa } from 'element-plus/es/locale/index.mjs'
|
||||
|
||||
/**
|
||||
* @name ICD管理模块
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//获取ICD分页
|
||||
export const getICDList = (params: ICD.ReqICDParams) => {
|
||||
return http.post(`/icd/list`,params)
|
||||
}
|
||||
|
||||
|
||||
//获取ICD
|
||||
export const getICDAllList = (params: ICD.ResICD) => {
|
||||
return http.get(`/icd/listAll`,params)
|
||||
}
|
||||
|
||||
//添加ICD
|
||||
export const addICD = (params: ICD.ResICD) => {
|
||||
return http.post(`/icd/add`, params)
|
||||
}
|
||||
|
||||
//编辑ICD
|
||||
export const updateICD = (params: ICD.ResICD) => {
|
||||
return http.post(`/icd/update`, params)
|
||||
}
|
||||
|
||||
//删除ICD
|
||||
export const deleteICD = (params: string[]) => {
|
||||
return http.post(`/icd/delete`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
15
frontend/src/api/device/interface/controlSource.ts
Normal file
15
frontend/src/api/device/interface/controlSource.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { ReqPage,ResPage } from '@/api/interface'
|
||||
|
||||
// 被检设备模块
|
||||
export namespace controlSource {
|
||||
|
||||
/**
|
||||
* 被检设备新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResControl {
|
||||
userPageId: string;
|
||||
scriptId: string;
|
||||
scriptIndex: number;
|
||||
sourceId: string;
|
||||
}
|
||||
}
|
||||
40
frontend/src/api/device/interface/devType.ts
Normal file
40
frontend/src/api/device/interface/devType.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
// 设备类型模块
|
||||
export namespace DevType {
|
||||
|
||||
/**
|
||||
* 设备类型数据表格分页查询参数
|
||||
*/
|
||||
export interface ReqPqDevTypeParams extends ReqPage {
|
||||
id: string; // 装置序号id 必填
|
||||
devType?: string; // 设备名称
|
||||
createTime?: string; //创建时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResPqDevType {
|
||||
id: string; //设备类型ID
|
||||
name: string;//设备类型名称
|
||||
icd: string| null;//设备关联的ICD
|
||||
power: string| null;//工作电源
|
||||
devVolt: number; //额定电压(V)
|
||||
devCurr: number; //额定电流(A)
|
||||
devChns: number; //设备通道数
|
||||
reportName: string| null;//报告模版名称
|
||||
state: number;
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResPqDevTypePage extends ResPage<ResPqDevType> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,22 @@ import type { ReqPage,ResPage } from '@/api/interface'
|
||||
export namespace Device {
|
||||
|
||||
/**
|
||||
* 电能质量指标字典数据表格分页查询参数
|
||||
* 被检设备表格分页查询参数
|
||||
*/
|
||||
export interface ReqPqDevParams extends ReqPage{
|
||||
id: string; // 装置序号id 必填
|
||||
name: string; //设备名称
|
||||
devType?: string; // 设备名称
|
||||
createTime?:string; //创建时间
|
||||
pattern:string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 被检设备表格分页查询参数
|
||||
*/
|
||||
export interface ReqDevReportParams extends ReqPage{
|
||||
planId?:string; // 计划id
|
||||
devId?:string; // 装置id
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -23,7 +33,7 @@ export namespace Device {
|
||||
devChns: number; //设备通道数
|
||||
devVolt: number; //额定电压(V)
|
||||
devCurr: number; //额定电流(A)
|
||||
manufacturer: string;//生产厂家
|
||||
manufacturer?: string | null;//生产厂家
|
||||
createDate: string; //生产日期
|
||||
createId: string; //出厂编号
|
||||
hardwareVersion: string; //固件版本
|
||||
@@ -42,18 +52,36 @@ export namespace Device {
|
||||
checkState?: number| null; //检测状态
|
||||
checkResult?: number| null; //检测结果
|
||||
reportState?: number| null; //报告状态
|
||||
documentState?: number| null; //归档状态
|
||||
reportPath?: string| null; //报告路径
|
||||
qRCode?: string| null; //设备关键信息二维码
|
||||
reCheckNum: number; //复检次数
|
||||
planId?:string;//检测计划Id
|
||||
timeCheckResult?:number;//守时检测结果(0:不符合1:符合)
|
||||
factorFlag?:number;//是否支持系数校准(0:不支持,1:支持)
|
||||
factorCheckResult?: number;//系数校准结果(0:不合格,1:合格,2:/表示没有做系数校准)
|
||||
state: number; //状态
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
|
||||
icdId: string| null;
|
||||
power: string| null;//工作电源
|
||||
preinvestmentPlan: string| null;
|
||||
}
|
||||
|
||||
|
||||
export interface ResDev{
|
||||
id: string;
|
||||
name: string ,
|
||||
icd:string ,
|
||||
power:string,
|
||||
devVolt:number,
|
||||
devCurr:number,
|
||||
devChns:number,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 被检设备表格查询分页返回的对象;
|
||||
*/
|
||||
|
||||
@@ -22,13 +22,14 @@ export namespace ErrorSystem {
|
||||
|
||||
// 查看详细误差体系
|
||||
export interface ErrorSystemDetail {
|
||||
nextId: number;
|
||||
sort: number;
|
||||
id:string;//误差体系子表ID
|
||||
errorSysId:string;//所属误差体系ID
|
||||
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段)
|
||||
startValue?:number;//误差判断起始值(误差范围)
|
||||
errorType: string;//误差类型,树形字典表(没有树形表则需要拆分字段)
|
||||
scriptType: string;//脚本类型
|
||||
startValue?:number | null;//误差判断起始值(误差范围)
|
||||
startFlag?:number;//是否包含起始值
|
||||
endValue?:number;//;误差判断结束值(误差范围)
|
||||
endValue?:number | null;//;误差判断结束值(误差范围)
|
||||
endFlag?:number;//是否包含结束值
|
||||
conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
|
||||
maxErrorValue:number;//误差最大值
|
||||
@@ -36,11 +37,12 @@ export namespace ErrorSystem {
|
||||
}
|
||||
|
||||
//查看详细误差体系
|
||||
// export interface Error_detail {
|
||||
// measured: string;
|
||||
// deviceLevel: string;
|
||||
// measurementType:string;
|
||||
// condition: string;
|
||||
// maxErrorValue: string;
|
||||
// }
|
||||
export interface Error_detail {
|
||||
col1: string;
|
||||
col2: string;
|
||||
deviceLevel: string;
|
||||
measurementType:string;
|
||||
condition: string;
|
||||
maxErrorValue: string;
|
||||
}
|
||||
}
|
||||
35
frontend/src/api/device/interface/icd.ts
Normal file
35
frontend/src/api/device/interface/icd.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
// ICD模块
|
||||
export namespace ICD {
|
||||
|
||||
/**
|
||||
* ICD表格分页查询参数
|
||||
*/
|
||||
export interface ReqICDParams extends ReqPage {
|
||||
id: string; // 装置序号id 必填
|
||||
devType?: string; // 设备名称
|
||||
createTime?: string; //创建时间
|
||||
}
|
||||
|
||||
/**
|
||||
* ICD新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResICD {
|
||||
id: string; //icdID
|
||||
name: string;//icd名称
|
||||
path: string;//icd存储地址
|
||||
state: number;
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
}
|
||||
|
||||
/**
|
||||
* ICD表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResICDPage extends ResPage<ResICD> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,22 +11,24 @@ export namespace TestScript {
|
||||
id: string; // 装置序号id 必填
|
||||
name: string;
|
||||
type: string;
|
||||
pattern:string;
|
||||
}
|
||||
|
||||
// 检测脚本接口
|
||||
export interface ResTestScript {
|
||||
id?: string; //检测脚本ID
|
||||
name: string; //检测脚本名称
|
||||
type: string; //检测脚本类型(字典表Code字段,脚本还是模板)
|
||||
type: string; //设定0为脚本,1为模板
|
||||
pattern: string;//检测脚本模式(字典表Code字段,数字、模拟、比对)
|
||||
valueType?: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无)
|
||||
standardName: string;//参照标准名称
|
||||
standardTime: string;//标准推行时间
|
||||
state:number;//
|
||||
state?:number;//
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
updateBy?: string;
|
||||
updateTime?: string;
|
||||
selectedValue?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ export namespace TestSource {
|
||||
// 检测源接口
|
||||
export interface ResTestSource {
|
||||
id: string; //检测源ID
|
||||
name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
||||
name?: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
||||
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
||||
type: string; //检测源类型(字典表Code字段,标准源、高精度设备)
|
||||
devType: string;//检测源设备类型(字典表Code字段)
|
||||
@@ -34,9 +34,9 @@ export namespace TestSource {
|
||||
}
|
||||
export interface ParameterType{
|
||||
id:string;
|
||||
sourceParamType:string;
|
||||
sourceParamDesc:string;
|
||||
sourceParamValue:string;
|
||||
type:string;
|
||||
desc:string;
|
||||
value:string|null;
|
||||
sort:number;
|
||||
pId:string;
|
||||
children?:ParameterType[];
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
import type { TestScript } from '@/api/device/interface/testScript'
|
||||
import http from '@/api'
|
||||
import { Loading } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* @name 检测脚本管理模块
|
||||
*/
|
||||
// 新增脚本
|
||||
export const pqScriptAdd = (params: TestScript.ResTestScript) => {
|
||||
return http.post(`/pqScript/add`, params)
|
||||
}
|
||||
// 修改脚本
|
||||
export const pqScriptUpdate = (params: TestScript.ResTestScript) => {
|
||||
return http.post(`/pqScript/update`, params)
|
||||
}
|
||||
// 获取检测脚本列表
|
||||
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
|
||||
return http.post(`/pqScript/list`, params)
|
||||
}
|
||||
|
||||
|
||||
//升级为模版
|
||||
export const updatePqScript = (params: TestScript.ResTestScript) => {
|
||||
return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
|
||||
@@ -19,3 +27,27 @@ export const updatePqScript = (params: TestScript.ResTestScript) => {
|
||||
export const deletePqScript = (params: string[]) => {
|
||||
return http.post(`/pqScript/delete`, params)
|
||||
}
|
||||
//添加检测脚本
|
||||
export const addScriptDtls = (params: any) => {
|
||||
return http.post(`/pqScript/addScriptDtls`, params)
|
||||
}
|
||||
//根据脚本id查询检测脚本详情
|
||||
export const dlsDetails = (params: any) => {
|
||||
return http.post(`/pqScript/dlsDetails`, params)
|
||||
}
|
||||
// 删除脚本
|
||||
export const deleteDtls = (params: any) => {
|
||||
return http.post(`/pqScript/deleteDtls`, params)
|
||||
}
|
||||
// 启用关闭脚本
|
||||
export const updateDtls = (params: any) => {
|
||||
return http.post(`/pqScript/updateDtls`, params)
|
||||
}
|
||||
// 根据通讯参数生成装置下发原始数据公式
|
||||
export const scriptDtlsCheckDataList = (params: any) => {
|
||||
return http.post(`/pqScript/scriptDtlsCheckDataList`, params,{loading: false})
|
||||
}
|
||||
// 通讯脚本回显
|
||||
export const checkDataList = (params: any) => {
|
||||
return http.post(`/pqScript/checkDataList`, params, { loading: true })
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ export const checkStatus = (status: number) => {
|
||||
case 400:
|
||||
ElMessage.error("请求失败!请您稍后重试");
|
||||
break;
|
||||
case 401:
|
||||
ElMessage.error("登录失效!请您重新登录");
|
||||
break;
|
||||
// case 401:
|
||||
// ElMessage.error("登录失效!请您重新登录");
|
||||
// break;
|
||||
case 403:
|
||||
ElMessage.error("当前账号无权限访问!");
|
||||
break;
|
||||
|
||||
6
frontend/src/api/home/channelsTest/index.ts
Normal file
6
frontend/src/api/home/channelsTest/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import http from "@/api";
|
||||
|
||||
//系数校准发送基本信息
|
||||
export const getCoefficientCheck = (params: any) => {
|
||||
return http.post(`/prepare/coefficientCheck`, params,{loading: false})
|
||||
}
|
||||
31
frontend/src/api/home/interface/channelsTest.ts
Normal file
31
frontend/src/api/home/interface/channelsTest.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// 系数校准模块
|
||||
export namespace ChannelsTest {
|
||||
|
||||
// 系数校准列表
|
||||
export interface CoefficientVO {
|
||||
devName?: string;//设备名称
|
||||
type?:string;//区分大小电压
|
||||
monitorNum: string;//监测点序号
|
||||
desc: string;//描述
|
||||
aVuData:string;//电压通道A数据
|
||||
aVuXi:string;//电压通道A系数
|
||||
bVuData:string;//电压通道B数据
|
||||
bVuXi:string;//电压通道B系数
|
||||
cVuData:string;//电压通道C数据
|
||||
cVuXi:string;//电压通道C系数
|
||||
aIeData:string;//电流通道A数据
|
||||
aIeXi:string;//电流通道A系数
|
||||
bIeData:string;//电流通道B数据
|
||||
bIeXi:string;//电流通道B系数
|
||||
cIeData:string;//电流通道C数据
|
||||
cIeXi:string;//电流通道C系数
|
||||
loading: boolean;
|
||||
aV:string;
|
||||
bV:string;
|
||||
cV:string;
|
||||
aI:string;
|
||||
bI:string;
|
||||
cI:string;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ElMessage, ElTreeSelect } from 'element-plus';
|
||||
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios'
|
||||
import { showFullScreenLoading, tryHideFullScreenLoading } from '@/components/Loading/fullScreen'
|
||||
import { LOGIN_URL } from '@/config'
|
||||
@@ -7,6 +8,7 @@ import { ResultEnum } from '@/enums/httpEnum'
|
||||
import { checkStatus } from './helper/checkStatus'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import router from '@/routers'
|
||||
import {refreshToken} from '@/api/user/login'
|
||||
|
||||
export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
|
||||
loading?: boolean;
|
||||
@@ -37,12 +39,14 @@ class RequestHttp {
|
||||
*/
|
||||
this.service.interceptors.request.use(
|
||||
(config: CustomAxiosRequestConfig) => {
|
||||
isFirst = true
|
||||
const userStore = useUserStore()
|
||||
// 当前请求不需要显示 loading,在 api 服务中通过指定的第三个参数: { loading: false } 来控制
|
||||
config.loading ?? (config.loading = true)
|
||||
config.loading && showFullScreenLoading()
|
||||
if (config.headers && typeof config.headers.set === 'function') {
|
||||
config.headers.set('Authorization', 'Bearer '+userStore.token)
|
||||
config.headers.set('Authorization', 'Bearer ' + userStore.accessToken)
|
||||
config.headers.set('Is-Refresh-Token', userStore.isRefreshToken+"")
|
||||
}
|
||||
return config
|
||||
},
|
||||
@@ -51,25 +55,55 @@ class RequestHttp {
|
||||
},
|
||||
)
|
||||
|
||||
let isFirst = true
|
||||
/**
|
||||
* @description 响应拦截器
|
||||
* 服务器换返回信息 -> [拦截统一处理] -> 客户端JS获取到信息
|
||||
*/
|
||||
this.service.interceptors.response.use(
|
||||
(response: AxiosResponse) => {
|
||||
async (response: AxiosResponse) => {
|
||||
const { data } = response
|
||||
const userStore = useUserStore()
|
||||
tryHideFullScreenLoading()
|
||||
|
||||
if(data.code === ResultEnum.ACCESSTOKEN_EXPIRED){
|
||||
// 用长token去换短token
|
||||
userStore.setAccessToken(userStore.refreshToken)
|
||||
userStore.setIsRefreshToken(true)
|
||||
const result = await refreshToken()
|
||||
if (result) { //获取新token成功的话
|
||||
// 有新的token后,重新请求
|
||||
userStore.setAccessToken(result.data.accessToken)
|
||||
userStore.setRefreshToken(result.data.refreshToken)
|
||||
userStore.setIsRefreshToken(false)
|
||||
response.config.headers.Authorization = `Bearer ${result.data.accessToken}`//重新请求前需要将更新后的新token更换掉之前无效的token,不然会死循环
|
||||
const resp = await this.service.request(response.config)
|
||||
return resp
|
||||
} else {
|
||||
// 刷新失效,跳转登录页
|
||||
}
|
||||
}
|
||||
// 登陆失效
|
||||
if (data.code == ResultEnum.OVERDUE) {
|
||||
userStore.setToken('')
|
||||
console.log("登陆失效")
|
||||
userStore.setAccessToken('')
|
||||
userStore.setRefreshToken('')
|
||||
userStore.setIsRefreshToken(false)
|
||||
userStore.setUserInfo({ name: '' })
|
||||
router.replace(LOGIN_URL)
|
||||
await router.replace(LOGIN_URL)
|
||||
if(isFirst){//临时处理token失效弹窗多次
|
||||
ElMessage.error(data.message)
|
||||
isFirst = false
|
||||
}
|
||||
return Promise.reject(data)
|
||||
}
|
||||
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
|
||||
if (data.code && data.code !== ResultEnum.SUCCESS) {
|
||||
if(data.message.includes('&')){
|
||||
const formattedMessage = data.message.split('&').join('<br>');
|
||||
ElMessage.error({ message: formattedMessage, dangerouslyUseHTMLString: true });
|
||||
return Promise.reject(data)
|
||||
}
|
||||
ElMessage.error(data.message)
|
||||
return Promise.reject(data)
|
||||
}
|
||||
@@ -79,6 +113,7 @@ class RequestHttp {
|
||||
async (error: AxiosError) => {
|
||||
const { response } = error
|
||||
tryHideFullScreenLoading()
|
||||
console.log('error', error.message)
|
||||
// 请求超时 && 网络错误单独判断,没有 response
|
||||
if (error.message.indexOf('timeout') !== -1) ElMessage.error('请求超时!请您稍后重试')
|
||||
if (error.message.indexOf('Network Error') !== -1) ElMessage.error('网络错误!请您稍后重试')
|
||||
@@ -115,9 +150,24 @@ class RequestHttp {
|
||||
}
|
||||
|
||||
upload(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||
return this.service.post(url, params, { ..._object, headers: { 'Content-Type': 'multipart/form-data' } })
|
||||
return this.service.post(url, params, {
|
||||
..._object,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对excel的上传,默认返回的是blob类型,Excel没问题时返回json特殊处理
|
||||
*/
|
||||
uploadExcel(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||
return this.service.post(url, params, {
|
||||
..._object,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default new RequestHttp(config)
|
||||
|
||||
@@ -2,75 +2,62 @@
|
||||
"code": "A0000",
|
||||
"data": [
|
||||
{
|
||||
"id": "0",
|
||||
"id": "1",
|
||||
"pid": "0",
|
||||
"name": "频率准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"pid": 0,
|
||||
"id": "0-1",
|
||||
"id": "1-1",
|
||||
"pid": "1",
|
||||
"name": "额定工作条件下的检测",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":1,
|
||||
"isChildNode":true,
|
||||
"pid": "0-1",
|
||||
"id": "0-1-1",
|
||||
"id": "1-1-1",
|
||||
"pid": "1-1",
|
||||
"name": "输入:频率 42.5Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":2,
|
||||
"isChildNode":true,
|
||||
"pid": "0-1",
|
||||
"id": "0-1-2",
|
||||
"id": "1-1-2",
|
||||
"pid": "1-1",
|
||||
"name": "输入:频率 50.0Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":3,
|
||||
"isChildNode":true,
|
||||
"pid": "0-1",
|
||||
"id": "0-1-3",
|
||||
"name": "输入:频率 50.05Hz..."
|
||||
"id": "1-1-3",
|
||||
"pid": "1-1",
|
||||
"name": "输入:频率 50.05Hz...."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 0,
|
||||
"id": "0-2",
|
||||
"id": "1-2",
|
||||
"pid": "1",
|
||||
"name": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":4,
|
||||
"isChildNode":true,
|
||||
"pid": "0-2",
|
||||
"id": "0-2-1",
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":5,
|
||||
"isChildNode":true,
|
||||
"pid": "0-2",
|
||||
"id": "0-2-1",
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":6,
|
||||
"isChildNode":true,
|
||||
"pid": "0-2",
|
||||
"id": "0-2-2",
|
||||
"id": "1-2-2",
|
||||
"pid": "1-2",
|
||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 0,
|
||||
"id": "0-3",
|
||||
"id": "1-3",
|
||||
"pid": "1",
|
||||
"name": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":7,
|
||||
"isChildNode":true,
|
||||
"pid": "0-3",
|
||||
"id": "0-3-1",
|
||||
"id": "1-3-1",
|
||||
"pid": "1-3",
|
||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
@@ -78,145 +65,125 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"id": "2",
|
||||
"pid": "0",
|
||||
"name": "电压准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"pid": 1,
|
||||
"id": "1-1",
|
||||
"name": "额定工作条件下的检测",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":8,
|
||||
"isChildNode":true,
|
||||
"pid": "1-1",
|
||||
"id": "1-1-1",
|
||||
"name": "输入:频率 42.5Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":9,
|
||||
"isChildNode":true,
|
||||
"pid": "1-1",
|
||||
"id": "1-1-2",
|
||||
"name": "输入:频率 50.0Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":10,
|
||||
"isChildNode":true,
|
||||
"pid": "1-1",
|
||||
"id": "1-1-3",
|
||||
"name": "输入:频率 50.05Hz..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 0,
|
||||
"id": "1-2",
|
||||
"name": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":11,
|
||||
"isChildNode":true,
|
||||
"pid": "1-2",
|
||||
"id": "1-2-1",
|
||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":12,
|
||||
"isChildNode":true,
|
||||
"pid": "1-2",
|
||||
"id": "1-2-1",
|
||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":13,
|
||||
"isChildNode":true,
|
||||
"pid": "1-2",
|
||||
"id": "1-2-2",
|
||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 0,
|
||||
"id": "0-3",
|
||||
"name": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":14,
|
||||
"isChildNode":true,
|
||||
"pid": "0-3",
|
||||
"id": "0-3-1",
|
||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"id": "2",
|
||||
"name": "谐波准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"pid": 2,
|
||||
"pid": "2",
|
||||
"id": "2-1",
|
||||
"name": "额定工作条件下的检测",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":15,
|
||||
"pid": "2-1",
|
||||
"id": "2-1-1",
|
||||
"pid": "2-1",
|
||||
"name": "输入:频率 42.5Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":16,
|
||||
"pid": "2-1",
|
||||
"id": "2-1-2",
|
||||
"pid": "2-1",
|
||||
"name": "输入:频率 50.0Hz..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":17,
|
||||
"pid": "2-1",
|
||||
"id": "2-1-3",
|
||||
"pid": "2-1",
|
||||
"name": "输入:频率 50.05Hz..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 2,
|
||||
"pid": "2",
|
||||
"id": "2-2",
|
||||
"name": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":18,
|
||||
"pid": "2-2",
|
||||
"id": "2-2-1",
|
||||
"pid": "2-2",
|
||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":19,
|
||||
"pid": "2-2",
|
||||
"id": "2-2-1",
|
||||
"pid": "2-2",
|
||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"scriptIdx":20,
|
||||
"pid": "2-2",
|
||||
"id": "2-2-2",
|
||||
"pid": "2-2",
|
||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"pid": 2,
|
||||
"pid": "2",
|
||||
"id": "2-3",
|
||||
"name": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"scriptIdx":21,
|
||||
"pid": "2-3",
|
||||
"id": "2-3-1",
|
||||
"pid": "2-3",
|
||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"pid": "0",
|
||||
"name": "谐波准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"id": "3-1",
|
||||
"pid": "3",
|
||||
"name": "额定工作条件下的检测",
|
||||
"children": [
|
||||
{
|
||||
"id": "3-1-1",
|
||||
"pid": "3-1",
|
||||
"name": "输入:频率 42.5Hz..."
|
||||
},
|
||||
{
|
||||
"id": "3-1-2",
|
||||
"pid": "3-1",
|
||||
"name": "输入:频率 50.0Hz..."
|
||||
},
|
||||
{
|
||||
"id": "3-1-3",
|
||||
"pid": "3-1",
|
||||
"name": "输入:频率 50.05Hz..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "3-2",
|
||||
"pid": "3",
|
||||
"name": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "3-2-1",
|
||||
"pid": "3-2",
|
||||
"name": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "3-2-1",
|
||||
"pid": "3-2",
|
||||
"name": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "3-2-2",
|
||||
"pid": "3-2",
|
||||
"name": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "3-3",
|
||||
"pid": "3",
|
||||
"name": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "3-3-1",
|
||||
"pid": "3-3",
|
||||
"name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,72 +1,44 @@
|
||||
import type { ReqPage } from '@/api/interface'
|
||||
import type { DatetimeFormatProps } from 'vue-i18n';
|
||||
|
||||
// 检测计划模块
|
||||
export namespace Plan {
|
||||
|
||||
// 检测计划接口
|
||||
export interface PlanBO {
|
||||
id?: string; //检测计划ID
|
||||
export interface ResPlan {
|
||||
id: string; //检测计划ID
|
||||
name: string; //检测计划名称
|
||||
pattern: string; //模式,字典表(数字、模拟、比对)
|
||||
father_Plan_Id?: string; //父计划ID
|
||||
dataSource_Id: string[]; //数据源ID
|
||||
script_Id: string; //检测脚本ID
|
||||
error_Sys_Id: string;//误差体系ID
|
||||
test_State: string; //检测状态
|
||||
report_State: string; //报告生成状态
|
||||
result: string;//检测结果
|
||||
create_Time?: string;//创建时间
|
||||
pattern?: string; //模式,字典表(数字、模拟、比对)
|
||||
fatherPlanId?: string; //父计划ID
|
||||
dataSourceId: string; //数据源ID
|
||||
scriptId: string; //检测脚本ID
|
||||
errorSysId: string;//误差体系ID
|
||||
timeCheck:number;//守时检测:0否,1。是
|
||||
testState: number; //检测状态:0:未检、1:检测中、2:检测完成,默认为 0
|
||||
reportState: number; //报告生成状态:0:未生成、1:部分生成、2:全部生成,默认为 0
|
||||
result: number;//检测结果:0:不符合、1:符合、2:/,默认为 2
|
||||
code:number; //自动生成,用于生成数据表后缀
|
||||
state: number;//;状态:0-删除 1-正常
|
||||
createBy?:string; //创建用户
|
||||
createTime?:string; //创建时间
|
||||
updateBy?:string; //更新用户
|
||||
updateTime?:string; //更新时间
|
||||
}
|
||||
|
||||
// 检测计划 + 分页
|
||||
export interface ReqPlanParams extends ReqPage,PlanBO {
|
||||
export interface ReqPlanParams extends ReqPage,ResPlan {
|
||||
|
||||
}
|
||||
|
||||
// 检测计划 + 检测源
|
||||
export interface PlanAndSourceBO extends PlanBO {
|
||||
testSourceName: string;//计划所属检测源
|
||||
source_Id: string[];
|
||||
device_Id?: string[];
|
||||
testSourceList?: string[];//临时测试
|
||||
dataSource_Ids:string;
|
||||
}
|
||||
// // 检测计划列表
|
||||
// export interface PlanList {
|
||||
// id: string; //检测计划ID
|
||||
// name: string; //检测计划名称
|
||||
// pattern: string; //模式,字典表(数字、模拟、比对)
|
||||
// father_Plan_Id: string; //父计划ID
|
||||
// dataSource_Id: string; //数据源ID
|
||||
// script_Id: string; //检测脚本ID
|
||||
// error_Sys_Id: string;//误差体系ID
|
||||
// test_State: string; //检测状态
|
||||
// report_State: string; //报告生成状态
|
||||
// result: string;//检测结果
|
||||
// state: number; //状态
|
||||
// create_By?: string; //创建用户
|
||||
// create_Time?: string;//创建时间
|
||||
// update_By?: string; //更新用户
|
||||
// update_Time?: string; //更新时间
|
||||
// }
|
||||
|
||||
// // 被检设备参数
|
||||
// export interface ReqPlanParams extends ReqPage {
|
||||
// id: string; //检测计划ID
|
||||
// name: string; //检测计划名称
|
||||
// pattern: string; //模式,字典表(数字、模拟、比对)
|
||||
// father_Plan_Id: string; //父计划ID
|
||||
// dataSource_Id: string; //数据源ID
|
||||
// script_Id: string; //检测脚本ID
|
||||
// error_Sys_Id: string;//误差体系ID
|
||||
// test_State: string; //检测状态
|
||||
// report_State: string; //报告生成状态
|
||||
// result: string;//检测结果
|
||||
// state: number; //状态
|
||||
// create_By?: string; //创建用户
|
||||
// create_Time?: string;//创建时间
|
||||
// update_By?: string; //更新用户
|
||||
// update_Time?: string; //更新时间
|
||||
// }
|
||||
export interface ReqPlan extends ResPlan {
|
||||
datasourceIds:string;
|
||||
sourceIds: string;
|
||||
planId:string;
|
||||
scriptName: string ;
|
||||
errorSysName: string;
|
||||
sourceName: string ;
|
||||
devIds: string[];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,27 +1,92 @@
|
||||
import { ResPage } from '@/api/interface'
|
||||
import { Plan } from './interface'
|
||||
import { ADMIN as rePrefix } from '@/api/config/serviceName'
|
||||
import type { Plan } from './interface'
|
||||
import http from '@/api'
|
||||
import type { ErrorSystem } from '../device/interface/error'
|
||||
import type { Device } from '../device/interface/device'
|
||||
import { ReqDevReportParams } from '@/api/device/interface/device'
|
||||
|
||||
/**
|
||||
* @name 检测计划管理模块
|
||||
*/
|
||||
// 获取检测计划列表
|
||||
export const getPlanList = (params: Plan.ReqPlanParams) => {
|
||||
return http.post<ResPage<Plan.PlanBO>>(`/plan/list`, params)
|
||||
return http.post(`/adPlan/list`, params)
|
||||
}
|
||||
|
||||
// 新增检测计划
|
||||
export const addPlan = (params: Plan.PlanBO) => {
|
||||
return http.post(`/role/add`, params)
|
||||
export const addPlan = (params: any) => {
|
||||
return http.post(`/adPlan/add`, params)
|
||||
}
|
||||
|
||||
// 编辑检测计划
|
||||
export const editPlan = (params: Plan.PlanBO) => {
|
||||
return http.post(`/role/edit`, params)
|
||||
export const updatePlan = (params: any) => {
|
||||
return http.post(`/adPlan/update`, params)
|
||||
}
|
||||
|
||||
// 删除检测计划
|
||||
export const deletePlan = (params: { id: string[] }) => {
|
||||
return http.post(`/role/del`, params)
|
||||
return http.post(`/adPlan/delete`, params)
|
||||
}
|
||||
|
||||
// 获取指定模式下所有检测源
|
||||
export const getTestSourceList = (params: Plan.ReqPlan) => {
|
||||
return http.get(`/pqSource/getAll?patternId=${params.pattern}`)
|
||||
}
|
||||
|
||||
// 获取指定模式下所有检测脚本
|
||||
export const getPqScriptList = (params: Plan.ReqPlan) => {
|
||||
return http.get(`/pqScript/getAll?patternId=${params.pattern}`)
|
||||
}
|
||||
|
||||
//获取所有误差体系
|
||||
export const getPqErrSysList = () => {
|
||||
return http.get<ErrorSystem.ErrorSystemList>(`/pqErrSys/getAll`)
|
||||
}
|
||||
|
||||
//获取指定模式下所有未绑定的设备
|
||||
export const getUnboundPqDevList = (params: Plan.ReqPlan) => {
|
||||
return http.get(`/pqDev/listUnbound?pattern=${params.pattern}`)
|
||||
}
|
||||
|
||||
//根据检测计划id查询出所有已绑定的设备
|
||||
export const getBoundPqDevList = (params: any) => {
|
||||
return http.post(`/pqDev/listByPlanId`, params)
|
||||
}
|
||||
|
||||
//检测计划绑定设备
|
||||
// export const BindPqDevList = (params: any) => {
|
||||
// return http.post(`/pqDev/bindDev`,params)
|
||||
// }
|
||||
|
||||
// 按照模式查询检测计划(用于首页展示)
|
||||
export const getPlanListByPattern = (params: Plan.ReqPlan) => {
|
||||
return http.get(`/adPlan/listByPattern?pattern=${params.pattern}`)
|
||||
}
|
||||
|
||||
// 导出检测计划
|
||||
export const exportCNPlan = (params: Device.ReqPqDevParams) => {
|
||||
return http.download(`/adPlan/exportCNPlan`, params)
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
export const downloadCNPlanTemplate = () => {
|
||||
return http.download(`/adPlan/downloadCNPlanTemplate`)
|
||||
}
|
||||
// 导入检测计划
|
||||
export const importCNPlan = (params: Device.ReqPqDevParams) => {
|
||||
return http.uploadExcel(`/adPlan/importCNPlan`, params)
|
||||
}
|
||||
|
||||
// 装置检测报告生成
|
||||
export const generateDevReport = (params: Device.ReqDevReportParams) => {
|
||||
return http.post(`/report/generateReport`, params)
|
||||
}
|
||||
|
||||
// 装置检测报告下载
|
||||
export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
||||
return http.download(`/report/downloadReport`, params)
|
||||
}
|
||||
|
||||
export const staticsAnalyse = (params: { id: string[] }) => {
|
||||
return http.download('/adPlan/analyse', params)
|
||||
}
|
||||
|
||||
|
||||
@@ -58,11 +58,15 @@ const dictReportState: Dict[] = [
|
||||
const dictResult: Dict[] = [
|
||||
{
|
||||
id: "0",
|
||||
label: '符合',
|
||||
label: '不符合',
|
||||
},
|
||||
{
|
||||
id: "1",
|
||||
label: '不符合',
|
||||
label: '符合',
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: '/',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -170,35 +174,35 @@ const testFatherPlanList: Dict[] = [
|
||||
const sourceDataList: Dict[] = [
|
||||
{
|
||||
id: "1",
|
||||
label: '标准源-福禄克-6100A',
|
||||
label: '标准源-FLUKE.6100A电能功率标准源-1',
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: '标准源-昂立-PF2',
|
||||
label: '标准源-ANGLI-FP2高性能数字信号源-1',
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
label: '标准源-丹迪克-DKLN1',
|
||||
label: '标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
label: '标准源-博电源-PQC600A',
|
||||
label: '标准源-PQC600A高精度电能功率标准源-1',
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
label: '高精度设备-PQV520-1',
|
||||
label: '高精度设备-PQV-520便携式电能质量监测装置-1',
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
label: '高精度设备-PQV520-2',
|
||||
label: '高精度设备-PQV-520便携式电能质量监测装置-2',
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
label: '高精度设备-PQV520-3',
|
||||
label: '高精度设备-PQV-520便携式电能质量监测装置-3',
|
||||
},
|
||||
{
|
||||
id: "8",
|
||||
label: '高精度设备-PQV520-4',
|
||||
label: '高精度设备-PQV-520便携式电能质量监测装置-4',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -206,46 +210,80 @@ const sourceDataList: Dict[] = [
|
||||
const deviceDataList: Dict[] = [
|
||||
{
|
||||
id: "1",
|
||||
label: '模拟装置1',
|
||||
label: '240001',
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: '模拟装置2',
|
||||
label: '240002',
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
label: '模拟装置3',
|
||||
label: '240003',
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
label: '模拟装置4',
|
||||
label: '240004',
|
||||
},
|
||||
{
|
||||
id: "5",
|
||||
label: '中电送检装置',
|
||||
label: '240005',
|
||||
},
|
||||
{
|
||||
id: "6",
|
||||
label: '易司拓测试装置',
|
||||
label: '240006',
|
||||
},
|
||||
{
|
||||
id: "7",
|
||||
label: '山大电力测试装置1',
|
||||
label: '240007',
|
||||
},
|
||||
{
|
||||
id: "8",
|
||||
label: '山大电力测试装置2',
|
||||
label: '240008',
|
||||
},
|
||||
|
||||
]
|
||||
// const deviceDataList: Dict[] = [
|
||||
// {
|
||||
// id: "1",
|
||||
// label: '模拟装置1',
|
||||
// },
|
||||
// {
|
||||
// id: "2",
|
||||
// label: '模拟装置2',
|
||||
// },
|
||||
// {
|
||||
// id: "3",
|
||||
// label: '模拟装置3',
|
||||
// },
|
||||
// {
|
||||
// id: "4",
|
||||
// label: '模拟装置4',
|
||||
// },
|
||||
// {
|
||||
// id: "5",
|
||||
// label: '中电送检装置',
|
||||
// },
|
||||
// {
|
||||
// id: "6",
|
||||
// label: '易司拓测试装置',
|
||||
// },
|
||||
// {
|
||||
// id: "7",
|
||||
// label: '山大电力测试装置1',
|
||||
// },
|
||||
// {
|
||||
// id: "8",
|
||||
// label: '山大电力测试装置2',
|
||||
// },
|
||||
|
||||
// ]
|
||||
|
||||
const planData = ref<Plan.PlanAndSourceBO[]>([
|
||||
{
|
||||
'id': '1',
|
||||
'name': '检测计划1',
|
||||
'name': '沧州110kV东光站装置送检',
|
||||
'pattern':'1',
|
||||
"source_Id" : ['1'],
|
||||
"testSourceName":'标准源-福禄克-6100A',
|
||||
"testSourceName":'标准源-FLUKE.6100A电能功率标准源-1',
|
||||
'dataSource_Id':['1'],
|
||||
'dataSource_Ids':'实时数据',
|
||||
'script_Id':'1',
|
||||
@@ -256,32 +294,32 @@ const planData = ref<Plan.PlanAndSourceBO[]>([
|
||||
},
|
||||
{
|
||||
'id': '2',
|
||||
'name': '检测计划2',
|
||||
'name': '邯郸2台安徽振兴终端送检',
|
||||
'pattern':'1',
|
||||
"source_Id" : ['5','6','7','8'],
|
||||
"testSourceName":'高精度设备-PQV520-1',
|
||||
"testSourceName":'高精度设备-PQV-520便携式电能质量监测装置-1',
|
||||
'father_Plan_Id':'1',
|
||||
'dataSource_Id':['5'],
|
||||
'dataSource_Ids':'分钟统计数据CP95值',
|
||||
'dataSource_Id':['1'],
|
||||
'dataSource_Ids':'实时数据',
|
||||
'script_Id':'2',
|
||||
'error_Sys_Id':'2',
|
||||
'test_State':'2',
|
||||
'report_State':'2',
|
||||
'result':'0',
|
||||
"testSourceList":[
|
||||
'高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-4'
|
||||
'高精度设备-PQV-520便携式电能质量监测装置-2','高精度设备-PQV-520便携式电能质量监测装置-3','高精度设备-PQV-520便携式电能质量监测装置-4'
|
||||
]
|
||||
},
|
||||
{
|
||||
'id': '3',
|
||||
'name': '检测子计划3',
|
||||
'name': '浙江分布式光伏电能质量试点',
|
||||
'pattern':'1',
|
||||
"source_Id" : ['3'],
|
||||
"testSourceName":'标准源-丹迪克-DKLN1',
|
||||
"testSourceName":'标准源-DKLN-1电能质量测试分析仪智能检定装置-1',
|
||||
'father_Plan_Id':'1',
|
||||
'dataSource_Id':['1'],
|
||||
'dataSource_Ids':'实时数据',
|
||||
'script_Id':'3',
|
||||
'script_Id':'4',
|
||||
'error_Sys_Id':'3',
|
||||
'test_State':'1',
|
||||
'report_State':'1',
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
"code": "200",
|
||||
"data": [
|
||||
{
|
||||
"name": "未检测",
|
||||
"name": "未检",
|
||||
"children": [
|
||||
{
|
||||
"id": 4,
|
||||
"pid": 1,
|
||||
"name": "邯郸220kV团城站等4座站电能质量检测"
|
||||
"name": "邯郸220kV团城站电能质量检测"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
@@ -17,7 +17,7 @@
|
||||
{
|
||||
"id": 6,
|
||||
"pid": 1,
|
||||
"name": "深圳市中电软件有限公司委托送检"
|
||||
"name": "深圳市中电公司委托送检"
|
||||
}
|
||||
],
|
||||
"id": 1
|
||||
@@ -28,17 +28,17 @@
|
||||
{
|
||||
"id": 7,
|
||||
"pid": 2,
|
||||
"name": "沧州220kV留古等4座变电站电能质量检测"
|
||||
"name": "沧州220kV留古站电能质量检测"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"pid": 2,
|
||||
"name": "沧州供电公司110kV东光站等10台装置送检"
|
||||
"name": "沧州110kV东光站装置送检"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"pid": 2,
|
||||
"name": "保定分布式光伏电能质量监测试点"
|
||||
"name": "浙江分布式光伏电能质量试点"
|
||||
}
|
||||
],
|
||||
"id": 2
|
||||
@@ -54,7 +54,7 @@
|
||||
{
|
||||
"id": 11,
|
||||
"pid": 3,
|
||||
"name": "北京2024现场检测"
|
||||
"name": "深圳2台中电终端委托送检"
|
||||
}
|
||||
],
|
||||
"id": 3
|
||||
|
||||
34
frontend/src/api/socket/socket.ts
Normal file
34
frontend/src/api/socket/socket.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import http from '@/api'
|
||||
|
||||
|
||||
export const startPreTest = (params) => {
|
||||
return http.post(`/prepare/startPreTest`, params, {loading: false})
|
||||
}
|
||||
|
||||
export const closePreTest = (params) => {
|
||||
return http.post(`/prepare/closePreTest`, params,{ loading: false })
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始正式检测
|
||||
* @param params
|
||||
*/
|
||||
export const startTest = (params) => {
|
||||
return http.post(`/prepare/startTest`, params, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停正式检测
|
||||
* @param params
|
||||
*/
|
||||
export const pauseTest = () => {
|
||||
return http.get(`/prepare/closePreTest`, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续正式检测
|
||||
* @param params
|
||||
*/
|
||||
export const resumeTest = (params) => {
|
||||
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
|
||||
}
|
||||
@@ -216,7 +216,7 @@ const dictData: Dict[] = [
|
||||
children: [
|
||||
{
|
||||
id: "0",
|
||||
label: 'FLUKE6100A电能功率标准源',
|
||||
label: 'FLUKE.6100A电能功率标准源',
|
||||
code: 0,
|
||||
},
|
||||
{
|
||||
@@ -236,7 +236,7 @@ const dictData: Dict[] = [
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
label: 'PQV-520电能质量检测装置',
|
||||
label: 'PQV-520便携式电能质量监测装置',
|
||||
code: 4,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import http from '@/api'
|
||||
import { type Dict } from '@/api/system/dictionary/interface'
|
||||
import { c } from 'vite/dist/node/types.d-aGj9QkWt'
|
||||
|
||||
//获取字典类型
|
||||
export const getDictTreeList = (params: Dict.ResDictTree) => {
|
||||
const name = params.name || '';
|
||||
return http.get(`/dictTree/getTree?keyword=${name}`, params)
|
||||
export const getDictTreeByCode = (params: Dict.ResDictTree) => {
|
||||
const code = params.code || ''
|
||||
return http.get(`/dictTree/getTreeByCode?code=${code}`, { loading: true })
|
||||
}
|
||||
|
||||
export const getDictTreeByName = (params: Dict.ResDictTree) => {
|
||||
const name = params.name || ''
|
||||
return http.get(`/dictTree/getTreeByName?name=${name}`)
|
||||
}
|
||||
|
||||
//添加字典类型
|
||||
@@ -21,4 +27,3 @@ export const updateDictTree = (params: Dict.ResDictTree) => {
|
||||
export const deleteDictTree = (params: Dict.ResDictTree) => {
|
||||
return http.post(`/dictTree/delete?id=${params.id}`)
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ export namespace Dict {
|
||||
name: string; // 名称
|
||||
code: string; // 编码
|
||||
sort: number; // 排序
|
||||
openValue?: number | null;
|
||||
level?: number | null; // 事件等级:0-普通;1-中等;2-严重 (默认为0)
|
||||
algoDescribe?: number | null; // 与高级算法内部Id描述对应
|
||||
value?: string | null; // 字典针对电压等级
|
||||
@@ -116,10 +117,10 @@ export namespace Dict {
|
||||
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
||||
curSts?:number | null;//sts、do的当前值;
|
||||
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
||||
maxNum?:number ;//设置最大值
|
||||
minNum?: number;//设置最小值
|
||||
maxNum?:number | null;//设置最大值
|
||||
minNum?: number| null;//设置最小值
|
||||
setValue?:string | null;//参数为enum可设置的所有值序列
|
||||
strlen?:number ;//参数string可设置字符串的长度上 限
|
||||
strlen?:number | null;//参数string可设置字符串的长度上 限
|
||||
defaultValue?:string | null; //参数缺省值、告警code值
|
||||
resourcesId?:string ; //报表数据来源(统计表表名)
|
||||
limitName?:string | null; //限值字段名称
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type {AuditLog } from '@/api/system/log/interface/log.ts'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 审计日志管理模块
|
||||
*/
|
||||
|
||||
//获取审计日志
|
||||
export const getAuditLog = (params: AuditLog.ReqAuditLogParams) => {
|
||||
return http.post(`/sysLog/list`, params)
|
||||
}
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
// 审计日志管理模块
|
||||
export namespace Sys_Log_Audit {
|
||||
// 日志列表
|
||||
export interface Audit_LogList {
|
||||
id: string;//日志表Id
|
||||
operate_Type:string;//日志类型
|
||||
export namespace AuditLog {
|
||||
|
||||
/**
|
||||
* 设备类型数据表格分页查询参数
|
||||
*/
|
||||
export interface ReqAuditLogParams extends ReqPage {
|
||||
id: string; //审计日志Id 必填
|
||||
createTime?: string; //创建时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
export interface ResAuditLog {
|
||||
id: string;//审计日志Id
|
||||
operate_Type:string;//操作类型
|
||||
ip:string;//操作IP
|
||||
result: string;//事件结果
|
||||
remark: string;//事件描述
|
||||
level:number;//告警等级
|
||||
warn:number;//告警标志
|
||||
create_By:string;//创建用户
|
||||
create_Time:string;//创建时间
|
||||
sort:number;//排序
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResAuditLogPage extends ResPage<ResAuditLog> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export namespace Login {
|
||||
}
|
||||
export interface ResLogin {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
userInfo:{
|
||||
name: string;
|
||||
}
|
||||
|
||||
@@ -30,3 +30,11 @@ export const getDictList = () =>{
|
||||
return http.get<Dict>('/dictData/dictDataCache')
|
||||
}
|
||||
|
||||
//token刷新
|
||||
export const refreshToken = () => {
|
||||
return http.get<Login.ResLogin>(`${rePrefix}/refreshToken`,
|
||||
{},
|
||||
{ loading: false }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
BIN
frontend/src/assets/images/transient.png
Normal file
BIN
frontend/src/assets/images/transient.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
@@ -1,53 +1,53 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" :title="`批量添加${parameter.title}`" :destroy-on-close="true" width="580px" draggable>
|
||||
<el-form class="drawer-multiColumn-form" label-width="100px">
|
||||
<el-form-item label="模板下载 :">
|
||||
<el-button type="primary" :icon="Download" @click="downloadTemp"> 点击下载 </el-button>
|
||||
<el-dialog v-model='dialogVisible' :title='`批量添加${parameter.title}`' :destroy-on-close='true' width='580px'
|
||||
draggable>
|
||||
<el-form class='drawer-multiColumn-form' label-width='100px'>
|
||||
<el-form-item label='模板下载 :'>
|
||||
<el-button type='primary' :icon='Download' @click='downloadTemp'> 点击下载</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件上传 :">
|
||||
<el-form-item label='文件上传 :'>
|
||||
<el-upload
|
||||
action="#"
|
||||
class="upload"
|
||||
:drag="true"
|
||||
:limit="excelLimit"
|
||||
:multiple="true"
|
||||
:show-file-list="true"
|
||||
:http-request="uploadExcel"
|
||||
:before-upload="beforeExcelUpload"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="excelUploadSuccess"
|
||||
:on-error="excelUploadError"
|
||||
action='#'
|
||||
class='upload'
|
||||
:drag='true'
|
||||
:limit='excelLimit'
|
||||
:multiple='true'
|
||||
:show-file-list='true'
|
||||
:http-request='uploadExcel'
|
||||
:before-upload='beforeExcelUpload'
|
||||
:on-exceed='handleExceed'
|
||||
:accept="parameter.fileType!.join(',')"
|
||||
>
|
||||
<slot name="empty">
|
||||
<el-icon class="el-icon--upload">
|
||||
<slot name='empty'>
|
||||
<el-icon class='el-icon--upload'>
|
||||
<upload-filled />
|
||||
</el-icon>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class='el-upload__text'>将文件拖到此处,或<em>点击上传</em></div>
|
||||
</slot>
|
||||
<template #tip>
|
||||
<slot name="tip">
|
||||
<div class="el-upload__tip">请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M</div>
|
||||
<slot name='tip'>
|
||||
<div class='el-upload__tip'>请上传 .xls , .xlsx 标准格式文件,文件最大为 {{ parameter.fileSize }}M</div>
|
||||
</slot>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="parameter.showCover" label="数据覆盖 :">
|
||||
<el-switch v-model="isCover" />
|
||||
<el-form-item v-if='parameter.showCover' label='数据覆盖 :'>
|
||||
<el-switch v-model='isCover' />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ImportExcel">
|
||||
import { ref } from "vue";
|
||||
import { useDownload } from "@/hooks/useDownload";
|
||||
import { Download } from "@element-plus/icons-vue";
|
||||
import { ElNotification, UploadRequestOptions, UploadRawFile } from "element-plus";
|
||||
<script setup lang='ts' name='ImportExcel'>
|
||||
import { ref } from 'vue'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import { Download } from '@element-plus/icons-vue'
|
||||
import { ElNotification, UploadRequestOptions, UploadRawFile, ElMessage } from 'element-plus'
|
||||
|
||||
export interface ExcelParameterProps {
|
||||
title: string; // 标题
|
||||
showCover?: boolean; // 是否显示”数据覆盖“选项
|
||||
patternId?: string; // 模式ID
|
||||
fileSize?: number; // 上传文件的大小
|
||||
fileType?: File.ExcelMimeType[]; // 上传文件的类型
|
||||
tempApi?: (params: any) => Promise<any>; // 下载模板的Api
|
||||
@@ -56,96 +56,132 @@ export interface ExcelParameterProps {
|
||||
}
|
||||
|
||||
// 是否覆盖数据
|
||||
const isCover = ref(false);
|
||||
const isCover = ref(false)
|
||||
// 最大文件上传数
|
||||
const excelLimit = ref(1);
|
||||
const excelLimit = ref(1)
|
||||
// dialog状态
|
||||
const dialogVisible = ref(false);
|
||||
const dialogVisible = ref(false)
|
||||
// 父组件传过来的参数
|
||||
const parameter = ref<ExcelParameterProps>({
|
||||
title: "",
|
||||
title: '',
|
||||
fileSize: 5,
|
||||
fileType: ["application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]
|
||||
});
|
||||
fileType: ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
||||
})
|
||||
|
||||
// 接收父组件参数
|
||||
const acceptParams = (params: ExcelParameterProps) => {
|
||||
parameter.value = { ...parameter.value, ...params };
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
parameter.value = { ...parameter.value, ...params }
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// Excel 导入模板下载
|
||||
const downloadTemp = () => {
|
||||
if (!parameter.value.tempApi) return;
|
||||
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`,{},true);
|
||||
};
|
||||
if (!parameter.value.tempApi) return
|
||||
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, {}, false)
|
||||
}
|
||||
|
||||
// 文件上传
|
||||
const uploadExcel = async (param: UploadRequestOptions) => {
|
||||
debugger
|
||||
let excelFormData = new FormData();
|
||||
excelFormData.append("file", param.file);
|
||||
isCover.value && excelFormData.append("isCover", isCover.value as unknown as Blob);
|
||||
await parameter.value.importApi!(excelFormData);
|
||||
parameter.value.getTableList && parameter.value.getTableList();
|
||||
dialogVisible.value = false;
|
||||
};
|
||||
let excelFormData = new FormData()
|
||||
excelFormData.append('file', param.file)
|
||||
if (parameter.value.patternId) {
|
||||
excelFormData.append('patternId', parameter.value.patternId)
|
||||
}
|
||||
isCover.value && excelFormData.append('isCover', isCover.value as unknown as Blob)
|
||||
//await parameter.value.importApi!(excelFormData);
|
||||
await parameter.value.importApi!(excelFormData)
|
||||
.then(res => handleImportResponse(res))
|
||||
parameter.value.getTableList && parameter.value.getTableList()
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
|
||||
async function handleImportResponse(res: any) {
|
||||
console.log(res)
|
||||
|
||||
if (res.type === 'application/json') {
|
||||
const fileReader = new FileReader()
|
||||
fileReader.onloadend = () => {
|
||||
try {
|
||||
const jsonData = JSON.parse(fileReader.result)
|
||||
if (jsonData.code === 'A0000') {
|
||||
ElMessage.success('导入成功')
|
||||
} else {
|
||||
ElMessage.error(jsonData.message)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
fileReader.readAsText(res)
|
||||
} else {
|
||||
ElMessage.error('导入失败,请查看下载附件!')
|
||||
let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '导入失败数据'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 文件上传之前判断
|
||||
* @param file 上传的文件
|
||||
* */
|
||||
const beforeExcelUpload = (file: UploadRawFile) => {
|
||||
const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType);
|
||||
const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!;
|
||||
const isExcel = parameter.value.fileType!.includes(file.type as File.ExcelMimeType)
|
||||
const fileSize = file.size / 1024 / 1024 < parameter.value.fileSize!
|
||||
if (!isExcel)
|
||||
ElNotification({
|
||||
title: "温馨提示",
|
||||
message: "上传文件只能是 xls / xlsx 格式!",
|
||||
type: "warning"
|
||||
});
|
||||
title: '温馨提示',
|
||||
message: '上传文件只能是 xls / xlsx 格式!',
|
||||
type: 'warning',
|
||||
})
|
||||
if (!fileSize)
|
||||
setTimeout(() => {
|
||||
ElNotification({
|
||||
title: "温馨提示",
|
||||
title: '温馨提示',
|
||||
message: `上传文件大小不能超过 ${parameter.value.fileSize}MB!`,
|
||||
type: "warning"
|
||||
});
|
||||
}, 0);
|
||||
return isExcel && fileSize;
|
||||
};
|
||||
type: 'warning',
|
||||
})
|
||||
}, 0)
|
||||
return isExcel && fileSize
|
||||
}
|
||||
|
||||
// 文件数超出提示
|
||||
const handleExceed = () => {
|
||||
ElNotification({
|
||||
title: "温馨提示",
|
||||
message: "最多只能上传一个文件!",
|
||||
type: "warning"
|
||||
});
|
||||
};
|
||||
title: '温馨提示',
|
||||
message: '最多只能上传一个文件!',
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
|
||||
// 上传错误提示
|
||||
const excelUploadError = () => {
|
||||
ElNotification({
|
||||
title: "温馨提示",
|
||||
message: `批量添加${parameter.value.title}失败,请您重新上传!`,
|
||||
type: "error"
|
||||
});
|
||||
};
|
||||
// const excelUploadError = () => {
|
||||
// ElNotification({
|
||||
// title: '温馨提示',
|
||||
// message: `批量添加${parameter.value.title}失败,请您重新上传!`,
|
||||
// type: 'error',
|
||||
// })
|
||||
// }
|
||||
|
||||
// 上传成功提示
|
||||
const excelUploadSuccess = () => {
|
||||
ElNotification({
|
||||
title: "温馨提示",
|
||||
message: `批量添加${parameter.value.title}成功!`,
|
||||
type: "success"
|
||||
});
|
||||
};
|
||||
// const excelUploadSuccess = () => {
|
||||
// ElNotification({
|
||||
// title: '温馨提示',
|
||||
// message: `批量添加${parameter.value.title}成功!`,
|
||||
// type: 'success',
|
||||
// })
|
||||
// }
|
||||
|
||||
defineExpose({
|
||||
acceptParams
|
||||
});
|
||||
acceptParams,
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
<style lang='scss' scoped>
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
:search-param='searchParam'
|
||||
:search-col='searchCol'
|
||||
/>
|
||||
|
||||
<!-- 表格主体 -->
|
||||
<div class='card table-main'>
|
||||
<div class='table-main' :class='{ card: showCard }' >
|
||||
<!-- 表格头部 操作按钮 -->
|
||||
<div class='table-header'>
|
||||
<div class='header-button-lf'>
|
||||
@@ -43,10 +42,11 @@
|
||||
>
|
||||
<!-- 默认插槽 -->
|
||||
<slot />
|
||||
|
||||
<template v-for='item in tableColumns' :key='item'>
|
||||
<!-- selection || radio || index || expand || sort -->
|
||||
<el-table-column
|
||||
v-if='item.type && columnTypes.includes(item.type)'
|
||||
v-if='item.type && columnTypes.includes(item.type) && item.isShow'
|
||||
v-bind='item'
|
||||
:align="item.align ?? 'center'"
|
||||
:reserve-selection="item.type == 'selection'"
|
||||
@@ -126,6 +126,7 @@ export interface ProTableProps {
|
||||
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
|
||||
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
|
||||
title?: string; // 表格标题 ==> 非必传
|
||||
showCard?: boolean; // 下个是否需要卡片
|
||||
pagination?: boolean; // 是否需要分页组件 ==> 非必传(默认为true)
|
||||
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{})
|
||||
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为true)
|
||||
@@ -141,6 +142,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
||||
pagination: true,
|
||||
initParam: {},
|
||||
border: true,
|
||||
showCard: true,
|
||||
toolButton: true,
|
||||
rowKey: 'id',
|
||||
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<el-button :icon='customIcons[iconValue]' />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-dialog v-model='dialogVisible' :title='placeholder' top='50px' width='66%'>
|
||||
<el-dialog v-model='dialogVisible' :title='placeholder' top='5%' width='30%' >
|
||||
<el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' />
|
||||
<el-scrollbar v-if='Object.keys(iconsList).length'>
|
||||
<div class='icon-list'>
|
||||
|
||||
@@ -126,6 +126,15 @@ const handleChange = (unit: string) => {
|
||||
endDate.value = new Date()
|
||||
}
|
||||
timeUnit.value = unit
|
||||
|
||||
// 确保开始时间和结束时间不为空
|
||||
if (!startDate.value) {
|
||||
startDate.value = new Date()
|
||||
}
|
||||
if (!endDate.value) {
|
||||
endDate.value = new Date()
|
||||
}
|
||||
|
||||
emitDateChange() // 变化时也发出更新事件
|
||||
updateNextButtonStatus()
|
||||
}
|
||||
@@ -172,7 +181,13 @@ const updateDateRange = () => {
|
||||
// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999
|
||||
// }
|
||||
}
|
||||
|
||||
// 确保开始时间和结束时间不为空
|
||||
if (!startDate.value) {
|
||||
startDate.value = new Date()
|
||||
}
|
||||
if (!endDate.value) {
|
||||
endDate.value = new Date()
|
||||
}
|
||||
|
||||
updateNextButtonStatus()
|
||||
}
|
||||
@@ -285,7 +300,10 @@ const disableEndDate = (date: Date) => {
|
||||
|
||||
|
||||
// 格式化日期yyyy-mm-dd
|
||||
function formatDate(date:Date) {
|
||||
function formatDate(date: Date | null): string {
|
||||
if (!date) {
|
||||
return '';
|
||||
}
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
|
||||
282
frontend/src/components/echarts/line/index.vue
Normal file
282
frontend/src/components/echarts/line/index.vue
Normal file
@@ -0,0 +1,282 @@
|
||||
<template>
|
||||
<div class="chart">
|
||||
<div ref="chartRef" class="my-chart" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref, defineExpose, watch, nextTick } from 'vue'
|
||||
// import echarts from './echarts'
|
||||
import * as echarts from 'echarts' // 全引入
|
||||
// import 'echarts/lib/component/dataZoom'
|
||||
|
||||
const color = [
|
||||
'var(--el-color-primary)',
|
||||
'#07CCCA',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B3B3B3'
|
||||
]
|
||||
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
|
||||
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
||||
let chart: echarts.ECharts | any = null
|
||||
const resizeHandler = () => {
|
||||
// 不在视野中的时候不进行resize
|
||||
if (!chartRef.value) return
|
||||
if (chartRef.value.offsetHeight == 0) return
|
||||
chart.getZr().painter.getViewportRoot().style.display = 'none'
|
||||
requestAnimationFrame(() => {
|
||||
chart.resize()
|
||||
chart.getZr().painter.getViewportRoot().style.display = ''
|
||||
})
|
||||
}
|
||||
const initChart = () => {
|
||||
if (!props.isInterVal && !props.pieInterVal) {
|
||||
chart?.dispose()
|
||||
}
|
||||
// chart?.dispose()
|
||||
chart = echarts.init(chartRef.value as HTMLDivElement)
|
||||
const options = {
|
||||
title: {
|
||||
left: 'center',
|
||||
// textStyle: {
|
||||
color: '#000',
|
||||
fontSize: 18,
|
||||
// },
|
||||
...(props.options?.title || null)
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
label: {
|
||||
color: '#fff',
|
||||
fontSize: 16
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0,
|
||||
confine: true,
|
||||
...(props.options?.tooltip || null)
|
||||
},
|
||||
|
||||
legend: {
|
||||
right: 20,
|
||||
top: 0,
|
||||
itemGap: 10,
|
||||
itemStyle: {},
|
||||
// textStyle: {
|
||||
fontSize: 12,
|
||||
padding: [2, 0, 0, 0], //[上、右、下、左]
|
||||
// },
|
||||
itemWidth: 15,
|
||||
itemHeight: 10,
|
||||
...(props.options?.legend || null)
|
||||
},
|
||||
grid: {
|
||||
top: '60px',
|
||||
left: '30px',
|
||||
right: '70px',
|
||||
bottom: props.options?.options?.dataZoom === null ? '10px' : '40px',
|
||||
containLabel: true,
|
||||
...(props.options?.grid || null)
|
||||
},
|
||||
xAxis: props.options?.xAxis ? handlerXAxis() : null,
|
||||
yAxis: props.options?.yAxis ? handlerYAxis() : null,
|
||||
dataZoom: props.options?.dataZoom || [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
color: props.options?.color || color,
|
||||
series: props.options?.series,
|
||||
...props.options?.options
|
||||
}
|
||||
// console.log(options.series,"获取x轴");
|
||||
handlerBar(options)
|
||||
|
||||
// 处理柱状图
|
||||
chart.setOption(options, true)
|
||||
|
||||
setTimeout(() => {
|
||||
chart.resize()
|
||||
}, 0)
|
||||
}
|
||||
const handlerBar = (options: any) => {
|
||||
if (Array.isArray(options.series)) {
|
||||
options.series.forEach((item: any) => {
|
||||
if (item.type === 'bar') {
|
||||
item.barMinHeight = 10
|
||||
item.barMaxWidth = 20
|
||||
item.itemStyle = Object.assign(
|
||||
{
|
||||
color: (params: any) => {
|
||||
if (params.value == 0 || params.value == 3.14159) {
|
||||
return '#ccc'
|
||||
} else {
|
||||
return props.options?.color
|
||||
? props.options?.color[params.seriesIndex]
|
||||
: color[params.seriesIndex]
|
||||
}
|
||||
}
|
||||
},
|
||||
item.itemStyle
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const handlerYAxis = () => {
|
||||
let temp = {
|
||||
type: 'value',
|
||||
nameGap: 15,
|
||||
nameTextStyle: {
|
||||
color: '#000'
|
||||
},
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#000'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#000',
|
||||
fontSize: 14,
|
||||
formatter: function (value) {
|
||||
return value.toFixed(0) // 格式化显示为一位小数
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: ['#ccc'],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
}
|
||||
// props.options?.xAxis 是数组还是对象
|
||||
if (Array.isArray(props.options?.yAxis)) {
|
||||
return props.options?.yAxis.map((item: any) => {
|
||||
return {
|
||||
...temp,
|
||||
...item
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return {
|
||||
...temp,
|
||||
...props.options?.yAxis
|
||||
}
|
||||
}
|
||||
}
|
||||
const handlerXAxis = () => {
|
||||
let temp = {
|
||||
type: 'category',
|
||||
axisTick: { show: false },
|
||||
nameTextStyle: {
|
||||
color: '#000'
|
||||
},
|
||||
axisLine: {
|
||||
// lineStyle: {
|
||||
color: '#000'
|
||||
// }
|
||||
},
|
||||
axisLabel: {
|
||||
// textStyle: {
|
||||
fontFamily: 'dinproRegular',
|
||||
color: '#000',
|
||||
fontSize: '12'
|
||||
// }
|
||||
}
|
||||
// boundaryGap: false,
|
||||
}
|
||||
// props.options?.xAxis 是数组还是对象
|
||||
if (Array.isArray(props.options?.xAxis)) {
|
||||
return props.options?.xAxis.map((item: any) => {
|
||||
return {
|
||||
...temp,
|
||||
...item
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return {
|
||||
...temp,
|
||||
...props.options?.xAxis
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let throttle: ReturnType<typeof setTimeout>
|
||||
// 动态计算table高度
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
for (const entry of entries) {
|
||||
if (throttle) {
|
||||
clearTimeout(throttle)
|
||||
}
|
||||
throttle = setTimeout(() => {
|
||||
resizeHandler()
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
onMounted(() => {
|
||||
initChart()
|
||||
resizeObserver.observe(chartRef.value!)
|
||||
})
|
||||
defineExpose({ initChart })
|
||||
onBeforeUnmount(() => {
|
||||
resizeObserver.unobserve(chartRef.value!)
|
||||
chart?.dispose()
|
||||
})
|
||||
watch(
|
||||
() => props.options,
|
||||
(newVal, oldVal) => {
|
||||
initChart()
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: -60px;
|
||||
}
|
||||
|
||||
.my-chart {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import * as echarts from "echarts";
|
||||
import { ref } from "vue";
|
||||
const chartsRef = ref();
|
||||
const props = defineProps({
|
||||
//饼图数据
|
||||
@@ -21,11 +22,16 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
|
||||
});
|
||||
const customData: any = ref({}),
|
||||
legendData: any = ref({}),
|
||||
chart: any = ref();
|
||||
|
||||
const labelIsShow = ref(true)//引导线台数和鼠标点击饼图是否弹出提示显示
|
||||
const init = () => {
|
||||
|
||||
|
||||
customData.value = {
|
||||
title: "", //标题
|
||||
textAlign: "left", //标题位置可选属性left 可选属性值 left,right,center
|
||||
@@ -34,13 +40,16 @@ const init = () => {
|
||||
isRadius: false, //是否圆角
|
||||
isSpace: false, //是否显示间隔
|
||||
isLabelLine: true, //是否显示引导线
|
||||
titleFontSize: '14px', //标题字体大小
|
||||
|
||||
...props.customData,
|
||||
|
||||
};
|
||||
legendData.value = {
|
||||
icon: "roundRect", // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
|
||||
orient: "vertical", //图例排列方向
|
||||
left: "right", //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
|
||||
itemGap: 1, // 设置图例项之间的间隔为20
|
||||
itemGap: 10, // 设置图例项之间的间隔为20
|
||||
...props.legendData,
|
||||
};
|
||||
chart.value = chartsRef.value && echarts.init(chartsRef.value);
|
||||
@@ -48,10 +57,27 @@ const init = () => {
|
||||
title: {
|
||||
text: customData.value.title,
|
||||
left: customData.value.textAlign,
|
||||
textStyle: {
|
||||
fontSize: customData.value.titleFontSize, // 使用 titleFontSize 属性
|
||||
},
|
||||
},
|
||||
legend:legendData.value,
|
||||
// legend: {
|
||||
// icon: legendData.value.icon, // 图例项的icon,类型包括 circle(圆形),rect(正方形),//roundRect(圆角正方形),triangle(三角形),diamond(菱形),//pin(大头针行),arrow(箭头形),none(无图例项的icon)
|
||||
// orient: "vertical", //图例排列方向
|
||||
// left: legendData.value.left, //可选属性left,right,top,bottom,可选属性值 left,right,top,bottom,px,百分比,数值,
|
||||
// itemGap: 1, // 设置图例项之间的间隔为20
|
||||
// formatter: function (name) {
|
||||
|
||||
// const item = props.chartsData.filter(item=>item.name==name)
|
||||
// console.log(item)
|
||||
// if(item)
|
||||
// return item[0].value;
|
||||
|
||||
// },
|
||||
// },
|
||||
tooltip: {
|
||||
show: true,
|
||||
show: labelIsShow.value,
|
||||
trigger: "item",
|
||||
formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ",
|
||||
borderWidth: 1,
|
||||
@@ -61,7 +87,13 @@ const init = () => {
|
||||
type: "pie",
|
||||
radius: customData.value.isRing ? ["55", "75"] : "80%",
|
||||
data: props.chartsData,
|
||||
center: ["55%", "50%"], // 设置饼图的中心位置
|
||||
formatter: function (name: any) {
|
||||
const item = props.chartsData.filter(item=>item.name==name)
|
||||
//console.log(item)
|
||||
if(item)
|
||||
return item[0].value;
|
||||
},
|
||||
center: ["55%", "55%"], // 设置饼图的中心位置
|
||||
// padAngle: 2,
|
||||
minAngle: 15, //最小角度
|
||||
startAngle: 270, //起始角度
|
||||
@@ -74,12 +106,15 @@ const init = () => {
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: "inside",
|
||||
show: labelIsShow.value,
|
||||
position: "outside",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
//color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
formatter: function (data) {
|
||||
return labelIsShow.value ? data.value + '台' : '';
|
||||
}
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
@@ -93,6 +128,7 @@ const init = () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
option && chart.value && chart.value.setOption(option);
|
||||
setTimeout(() => {
|
||||
chart.value.resize();
|
||||
@@ -108,7 +144,7 @@ const reSize = (widthValue: number,heightValue: number,silentValue: boolean) =>
|
||||
}
|
||||
};
|
||||
const resizeCharts = () => {
|
||||
console.log(chart.value,111111);
|
||||
//console.log(chart.value,111111);
|
||||
|
||||
if (chart.value) {
|
||||
chart.value.resize();
|
||||
@@ -128,6 +164,12 @@ watch(
|
||||
() => props.chartsData,
|
||||
(val, oldVal) => {
|
||||
if (val) {
|
||||
const item = props.chartsData.find(item => item.value === 0);
|
||||
if(item != undefined){
|
||||
labelIsShow.value = false;
|
||||
}else{
|
||||
labelIsShow.value = true;
|
||||
}
|
||||
init();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
// 首页地址(默认)
|
||||
export const HOME_URL: string = "/home/index";
|
||||
|
||||
// export const HOME_URL: string = "/machine/controlSource";
|
||||
|
||||
// 登录页地址(默认)
|
||||
export const LOGIN_URL: string = "/login";
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ const auth: Directive = {
|
||||
// console.log('1234',authStore.routeName)
|
||||
// console.log('123',currentPageRoles)
|
||||
if (value instanceof Array && value.length) {
|
||||
//console.log('123456',value)
|
||||
const hasPermission = value.every(item => currentPageRoles.includes(item))
|
||||
if (!hasPermission) el.remove()
|
||||
} else {
|
||||
//console.log('12345',value)
|
||||
if (!currentPageRoles.includes(value)) el.remove()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
export enum ResultEnum {
|
||||
SUCCESS = "A0000",
|
||||
ERROR = 500,
|
||||
OVERDUE = "401",
|
||||
ACCESSTOKEN_EXPIRED = 401,
|
||||
OVERDUE = 4001,
|
||||
TIMEOUT = 30000,
|
||||
TYPE = "success"
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
<!-- </el-button> -->
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="title = '模拟式模块'"
|
||||
<el-dropdown-item @click="handelOpen('模拟式')"
|
||||
>模拟式模块</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click="title = '数字式模块'"
|
||||
<el-dropdown-item @click="handelOpen('数字式')"
|
||||
>数字式模块</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click="title = '比对式模块'"
|
||||
<el-dropdown-item @click="handelOpen('比对式')"
|
||||
>比对式模块</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
@@ -39,13 +39,16 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
||||
const title = ref("模拟式模块");
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
const title = ref("模拟式模块");
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore();
|
||||
watch(() => modeStore.currentMode, (newVal) => {
|
||||
//console.log('当前模式:', newVal);
|
||||
switch (newVal) {
|
||||
|
||||
onMounted(() => {
|
||||
switch (modeStore.currentMode) {
|
||||
case '模拟式':
|
||||
title.value = '模拟式模块';
|
||||
break;
|
||||
@@ -59,6 +62,20 @@ watch(() => modeStore.currentMode, (newVal) => {
|
||||
title.value = '模拟式模块';
|
||||
}
|
||||
});
|
||||
|
||||
const handelOpen = async (item: string) => {
|
||||
await authStore.setShowMenu();
|
||||
modeStore.setCurrentMode(item); // 将模式code存入 store
|
||||
|
||||
//if (router.currentRoute.value.path === '/home/index') {
|
||||
// 强制刷新页面
|
||||
window.location.reload();
|
||||
//} else {
|
||||
// router.push({ path: '/home/index' });
|
||||
//}
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./index.scss";
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
<template>
|
||||
<!-- <div class="userInfo">-->
|
||||
<!-- <div class="icon">-->
|
||||
<!-- <Avatar/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="username">-->
|
||||
<!-- {{ username }}-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<el-dropdown trigger="click">
|
||||
<div class="userInfo">
|
||||
<div class="icon">
|
||||
@@ -56,14 +64,14 @@ import Message from "./components/Message.vue";
|
||||
import Fullscreen from "./components/Fullscreen.vue";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import {useDictStore} from "@/stores/modules/dict";
|
||||
import { useModeStore } from "@/stores/modules/mode";
|
||||
import { useModeStore,useAppSceneStore } from "@/stores/modules/mode";
|
||||
const userStore = useUserStore();
|
||||
const dictStore = useDictStore();
|
||||
const username = computed(() => userStore.userInfo.name);
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore();
|
||||
|
||||
const AppSceneStore = useAppSceneStore();
|
||||
// 退出登录
|
||||
const logout = () => {
|
||||
ElMessageBox.confirm("您是否确认退出登录?", "温馨提示", {
|
||||
@@ -74,10 +82,13 @@ const logout = () => {
|
||||
// 1.执行退出登录接口
|
||||
await logoutApi();
|
||||
// 2.清除 Token
|
||||
userStore.setToken("");
|
||||
userStore.setAccessToken("");
|
||||
userStore.setRefreshToken("");
|
||||
userStore.setUserInfo({name: ""});
|
||||
userStore.setIsRefreshToken(false)
|
||||
dictStore.setDictData([]);
|
||||
modeStore.setCurrentMode('');
|
||||
AppSceneStore.setCurrentMode('');
|
||||
// 3.重定向到登陆页
|
||||
router.replace(LOGIN_URL);
|
||||
ElMessage.success("退出登录成功!");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.el-main {
|
||||
box-sizing: border-box;
|
||||
padding: 20px;//主体padding
|
||||
overflow-x: hidden;
|
||||
padding: 15px;//主体padding
|
||||
overflow: hidden;
|
||||
background-color: var(--el-bg-color-page);
|
||||
}
|
||||
.el-footer {
|
||||
|
||||
@@ -2,21 +2,16 @@
|
||||
<Maximize v-show="maximize" />
|
||||
<Tabs v-if="tabs && showMenuFlag" />
|
||||
<el-main>
|
||||
<!-- style="height: calc(100vh - 157px);overflow-y:auto; overflow-x:hidden;" :style='{height:showMenuFlag?"calc(100vh - 157px)":" calc(100vh - 120px)"}' -->
|
||||
<router-view v-slot="{ Component, route }" style="height:100%;">
|
||||
<transition appear name="fade-transform" mode="out-in">
|
||||
<keep-alive :include="keepAliveName">
|
||||
<component
|
||||
:is="Component"
|
||||
v-if="isRouterShow"
|
||||
:key="route.fullPath"
|
||||
/>
|
||||
<!-- {{ keepAliveName}} -->
|
||||
<!-- <transition name="slide-right" mode="out-in"> -->
|
||||
<keep-alive :include="tabsMenuList" >
|
||||
<component :is="Component" :key="route.fullPath" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
</router-view>
|
||||
</el-main>
|
||||
<el-footer>
|
||||
<!-- v-show="footer" -->
|
||||
<Footer />
|
||||
</el-footer>
|
||||
</template>
|
||||
@@ -31,12 +26,15 @@ import Maximize from "./components/Maximize.vue";
|
||||
import Tabs from "@/layouts/components/Tabs/index.vue";
|
||||
import Footer from "@/layouts/components/Footer/index.vue";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useTabsStore } from '@/stores/modules/tabs'
|
||||
const tabStore = useTabsStore()
|
||||
const globalStore = useGlobalStore();
|
||||
const tabsMenuList = computed(() => tabStore.tabsMenuList.map(item => item.name))
|
||||
const authStore = useAuthStore();
|
||||
const { maximize, isCollapse, layout, tabs, footer } = storeToRefs(globalStore);
|
||||
|
||||
const keepAliveStore = useKeepAliveStore();
|
||||
const { keepAliveName } = storeToRefs(keepAliveStore);
|
||||
// console.log("🚀 ~ keepAliveName:", keepAliveName)
|
||||
//是否显示导航栏
|
||||
const showMenuFlag = computed(() => authStore.showMenuFlagGet);
|
||||
// 注入刷新页面方法
|
||||
@@ -65,6 +63,7 @@ watch(
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
|
||||
// 监听窗口大小变化,折叠侧边栏
|
||||
const screenWidth = ref(0);
|
||||
const listeningWindow = useDebounceFn(() => {
|
||||
|
||||
@@ -77,6 +77,7 @@ const initTabs = () => {
|
||||
name: item.name,
|
||||
close: !item.meta.isAffix,
|
||||
isKeepAlive: item.meta.isKeepAlive,
|
||||
unshift:true
|
||||
}
|
||||
tabStore.addTabs(tabsParams)
|
||||
}
|
||||
@@ -100,6 +101,7 @@ const tabsDrop = () => {
|
||||
// Tab Click
|
||||
const tabClick = (tabItem: TabsPaneContext) => {
|
||||
const fullPath = tabItem.props.name as string
|
||||
// console.log("🚀 ~ tabClick ~ fullPath:", tabItem)
|
||||
router.push(fullPath)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ const routerMode = {
|
||||
* @param meta.isKeepAlive ==> 当前路由是否缓存
|
||||
* */
|
||||
const router = createRouter({
|
||||
|
||||
history: routerMode[mode](),
|
||||
routes: [...staticRouter],
|
||||
// 不区分路由大小写,非严格模式下提供了更宽松的路径匹配
|
||||
@@ -46,14 +47,13 @@ router.beforeEach(async (to, from, next) => {
|
||||
const authStore = useAuthStore()
|
||||
// 1.NProgress 开始
|
||||
NProgress.start()
|
||||
|
||||
// 2.动态设置标题
|
||||
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title
|
||||
|
||||
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
|
||||
if (to.path.toLocaleLowerCase() === LOGIN_URL) {
|
||||
if (userStore.token) return next(from.fullPath)
|
||||
if (userStore.accessToken) return next(from.fullPath)
|
||||
resetRouter()
|
||||
return next()
|
||||
}
|
||||
@@ -62,17 +62,16 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (ROUTER_WHITE_LIST.includes(to.path)) return next()
|
||||
|
||||
// 5.判断是否有 Token,没有重定向到 login 页面
|
||||
if (!userStore.token) return next({ path: LOGIN_URL, replace: true })
|
||||
if (!userStore.accessToken) return next({ path: LOGIN_URL, replace: true })
|
||||
|
||||
// 6.如果没有菜单列表,就重新请求菜单列表并添加动态路由
|
||||
if (!authStore.authMenuListGet.length) {
|
||||
await initDynamicRouter()
|
||||
return next({ ...to, replace: true })
|
||||
}
|
||||
//console.log(to)
|
||||
|
||||
// 7.存储 routerName 做按钮权限筛选
|
||||
authStore.setRouteName(to.name as string)
|
||||
|
||||
// 8.正常访问页面
|
||||
next()
|
||||
})
|
||||
|
||||
@@ -28,7 +28,8 @@ export const initDynamicRouter = async () => {
|
||||
type: "warning",
|
||||
duration: 3000
|
||||
});
|
||||
userStore.setToken("");
|
||||
userStore.setAccessToken("");
|
||||
userStore.setRefreshToken("");
|
||||
router.replace(LOGIN_URL);
|
||||
return Promise.reject("No permission");
|
||||
}
|
||||
@@ -36,9 +37,11 @@ export const initDynamicRouter = async () => {
|
||||
// 3.添加动态路由
|
||||
authStore.flatMenuListGet.forEach(item => {
|
||||
item.children && delete item.children;
|
||||
|
||||
if (item.component && typeof item.component == "string") {
|
||||
item.component = modules["/src/views" + item.component + ".vue"];
|
||||
}
|
||||
|
||||
if (item.meta.isFull) {
|
||||
router.addRoute(item as unknown as RouteRecordRaw);
|
||||
} else {
|
||||
@@ -47,7 +50,8 @@ export const initDynamicRouter = async () => {
|
||||
});
|
||||
} catch (error) {
|
||||
// 当按钮 || 菜单请求出错时,重定向到登陆页
|
||||
userStore.setToken("");
|
||||
userStore.setAccessToken("");
|
||||
userStore.setRefreshToken("");
|
||||
router.replace(LOGIN_URL);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
@@ -1,122 +1,139 @@
|
||||
import { RouteRecordRaw } from "vue-router";
|
||||
import { HOME_URL, LOGIN_URL } from "@/config";
|
||||
export const Layout = () => import('@/layouts/index.vue');
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
import { HOME_URL, LOGIN_URL } from '@/config'
|
||||
export const Layout = () => import('@/layouts/index.vue')
|
||||
/**
|
||||
* staticRouter (静态路由)
|
||||
*/
|
||||
export const staticRouter: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/",
|
||||
redirect: HOME_URL,
|
||||
path: '/',
|
||||
redirect: HOME_URL
|
||||
},
|
||||
{
|
||||
path: LOGIN_URL,
|
||||
name: "login",
|
||||
component: () => import("@/views/login/index.vue"),
|
||||
name: 'login',
|
||||
component: () => import('@/views/login/index.vue'),
|
||||
meta: {
|
||||
title: "登录",
|
||||
},
|
||||
title: '登录'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/layout",
|
||||
name: "layout",
|
||||
path: '/layout',
|
||||
name: 'layout',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "/plan",
|
||||
name: "plan",
|
||||
redirect: "/plan/planList",
|
||||
path: '/plan',
|
||||
name: 'plan',
|
||||
redirect: '/plan/planList',
|
||||
children: [
|
||||
{
|
||||
path: "/plan/planList",
|
||||
name: "planList",
|
||||
component: () => import("@/views/plan/planList/index.vue"),
|
||||
meta: {
|
||||
title: "检测计划列表",
|
||||
icon: "List",
|
||||
isLink: "",
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/plan/singlePlanList",
|
||||
name: "singlePlanList",
|
||||
component: () => import("@/views/plan/singlePlanList/index.vue"),
|
||||
meta: {
|
||||
title: "单个计划列表",
|
||||
icon: "List",
|
||||
isLink: "",
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/plan/preTest",
|
||||
name: "preTest",
|
||||
component: () => import("@/views/plan/preTest/index.vue"),
|
||||
meta: {
|
||||
title: "预检测",
|
||||
icon: "List",
|
||||
isLink: "",
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/plan/autoTest",
|
||||
name: "autoTest",
|
||||
component: () => import("@/views/plan/autoTest/index.vue"),
|
||||
meta: {
|
||||
title: "自动检测",
|
||||
icon: "List",
|
||||
isLink: "",
|
||||
hideTab:true,
|
||||
parentPath:'/system/proTable',
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
},
|
||||
},
|
||||
// {
|
||||
// path: "/plan/planList",
|
||||
// name: "planList",
|
||||
// component: () => import("@/views/plan/planList/index.vue"),
|
||||
// meta: {
|
||||
// title: "检测计划列表",
|
||||
// icon: "List",
|
||||
// isLink: "",
|
||||
// isHide: false,
|
||||
// isFull: false,
|
||||
// isAffix: false,
|
||||
// isKeepAlive: true,//缓存改成true
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "/plan/singlePlanList",
|
||||
// name: "singlePlanList",
|
||||
// component: () => import("@/views/plan/singlePlanList/index.vue"),
|
||||
// meta: {
|
||||
// title: "单个计划列表",
|
||||
// icon: "List",
|
||||
// isLink: "",
|
||||
// isHide: false,
|
||||
// isFull: false,
|
||||
// isAffix: false,
|
||||
// isKeepAlive: true,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "/plan/preTest",
|
||||
// name: "preTest",
|
||||
// component: () => import("@/views/plan/preTest/index.vue"),
|
||||
// meta: {
|
||||
// title: "预检测",
|
||||
// icon: "List",
|
||||
// isLink: "",
|
||||
// isHide: false,
|
||||
// isFull: false,
|
||||
// isAffix: false,
|
||||
// isKeepAlive: false,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: "/plan/autoTest",
|
||||
// name: "autoTest",
|
||||
// component: () => import("@/views/plan/autoTest/index.vue"),
|
||||
// meta: {
|
||||
// title: "自动检测",
|
||||
// icon: "List",
|
||||
// isLink: "",
|
||||
// hideTab:true,
|
||||
// parentPath:'/system/proTable',
|
||||
// isHide: false,
|
||||
// isFull: false,
|
||||
// isAffix: false,
|
||||
// isKeepAlive: true,
|
||||
// },
|
||||
// },
|
||||
|
||||
// 错误页面路由
|
||||
{
|
||||
path: "/403",
|
||||
name: "403",
|
||||
component: () => import("@/components/ErrorMessage/403.vue"),
|
||||
path: '/403',
|
||||
name: '403',
|
||||
component: () => import('@/components/ErrorMessage/403.vue'),
|
||||
meta: {
|
||||
title: "403页面",
|
||||
},
|
||||
title: '403页面'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/404",
|
||||
name: "404",
|
||||
component: () => import("@/components/ErrorMessage/404.vue"),
|
||||
path: '/404',
|
||||
name: '404',
|
||||
component: () => import('@/components/ErrorMessage/404.vue'),
|
||||
meta: {
|
||||
title: "404页面",
|
||||
},
|
||||
title: '404页面'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/500",
|
||||
name: "500",
|
||||
component: () => import("@/components/ErrorMessage/500.vue"),
|
||||
path: '/500',
|
||||
name: '500',
|
||||
component: () => import('@/components/ErrorMessage/500.vue'),
|
||||
meta: {
|
||||
title: "500页面",
|
||||
},
|
||||
title: '500页面'
|
||||
}
|
||||
},
|
||||
// Resolve refresh page, route warnings
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
component: () => import("@/components/ErrorMessage/404.vue"),
|
||||
},
|
||||
],
|
||||
path: '/:pathMatch(.*)*',
|
||||
component: () => import('@/components/ErrorMessage/404.vue')
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
];
|
||||
{
|
||||
path: '/machine/testScriptAdd',
|
||||
name: 'testScriptAdd',
|
||||
component: () => import('@/views/machine/testScript/components/testScriptPopup.vue'),
|
||||
meta: {
|
||||
title: '检测脚本配置',
|
||||
icon: 'List',
|
||||
isLink: '',
|
||||
hideTab: true,
|
||||
parentPath: '/machine/testScript',
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -17,3 +17,5 @@ export const USER_STORE_KEY = "cn-user";
|
||||
// pinia中dict store的key
|
||||
export const DICT_STORE_KEY = "cn-dictData";
|
||||
|
||||
export const CHECK_STORE_KEY = "cn-check";
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ export interface GlobalState {
|
||||
|
||||
/* UserState */
|
||||
export interface UserState {
|
||||
token: string;
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
isRefreshToken: boolean;
|
||||
userInfo: { name: string };
|
||||
}
|
||||
|
||||
@@ -39,6 +41,7 @@ export interface TabsMenuProps {
|
||||
name: string;
|
||||
close: boolean;
|
||||
isKeepAlive: boolean;
|
||||
unshift?: boolean;
|
||||
}
|
||||
|
||||
/* TabsState */
|
||||
|
||||
49
frontend/src/stores/modules/check.ts
Normal file
49
frontend/src/stores/modules/check.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import {defineStore} from "pinia";
|
||||
import {CHECK_STORE_KEY} from "@/stores/constant";
|
||||
import type {CheckData} from "@/api/check/interface";
|
||||
import type {Plan} from '@/api/plan/interface'
|
||||
|
||||
|
||||
export const useCheckStore = defineStore("check", {
|
||||
id: CHECK_STORE_KEY,
|
||||
|
||||
state: () => ({
|
||||
devices: Array<CheckData.Device>(),
|
||||
plan: Object<Plan.ResPlan>(),
|
||||
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: true, channelsTest: false, test: true}),
|
||||
checkType:1, // 0:手动检测 1:自动检测
|
||||
reCheckType: 1, // 0:不合格项复检 1:全部复检
|
||||
showDetailType: 0 // 0:数据查询 1:误差体系跟换
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
|
||||
actions: {
|
||||
addDevices(device: CheckData.Device[]) {
|
||||
this.devices.push(...device);
|
||||
},
|
||||
setPlan(plan: Plan.ResPlan) {
|
||||
this.plan = plan
|
||||
},
|
||||
clearDevices() {
|
||||
this.devices = [];
|
||||
},
|
||||
initSelectTestItems() {
|
||||
this.selectTestItems.preTest = true
|
||||
this.selectTestItems.channelsTest = false
|
||||
this.selectTestItems.test = true
|
||||
},
|
||||
setSelectTestItems(selectTestItems: CheckData.SelectTestItem) {
|
||||
this.selectTestItems = selectTestItems
|
||||
},
|
||||
setCheckType(checkType: number) {
|
||||
this.checkType = checkType
|
||||
},
|
||||
setReCheckType(reCheckType: number) {
|
||||
this.reCheckType = reCheckType
|
||||
},
|
||||
setShowDetailType(showDetailType: number) {
|
||||
this.showDetailType = showDetailType
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -24,3 +24,16 @@ export const useModeStore = defineStore('mode', {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const useAppSceneStore = defineStore('scene', {
|
||||
state: () => ({
|
||||
currentScene: localStorage.getItem('currentScene') || '' as string,
|
||||
}),
|
||||
actions: {
|
||||
setCurrentMode(sceneName: string) {
|
||||
this.currentScene = sceneName;
|
||||
localStorage.setItem('currentScene', sceneName); // 保存到 localStorage
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -16,8 +16,14 @@ export const useTabsStore = defineStore({
|
||||
actions: {
|
||||
// Add Tabs
|
||||
async addTabs(tabItem: TabsMenuProps) {
|
||||
|
||||
if (this.tabsMenuList.every(item => item.path !== tabItem.path)) {
|
||||
if (tabItem?.unshift) {
|
||||
this.tabsMenuList.unshift(tabItem);
|
||||
}else{
|
||||
this.tabsMenuList.push(tabItem);
|
||||
|
||||
}
|
||||
}
|
||||
if (!keepAliveStore.keepAliveName.includes(tabItem.name) && tabItem.isKeepAlive) {
|
||||
keepAliveStore.addKeepAliveName(tabItem.name);
|
||||
|
||||
@@ -6,14 +6,22 @@ import { USER_STORE_KEY } from "@/stores/constant";
|
||||
export const useUserStore = defineStore({
|
||||
id: USER_STORE_KEY,
|
||||
state: (): UserState => ({
|
||||
token: "",
|
||||
accessToken: "",
|
||||
refreshToken: "",
|
||||
isRefreshToken:false,
|
||||
userInfo: { name: "admin" },
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
// Set Token
|
||||
setToken(token: string) {
|
||||
this.token = token;
|
||||
setAccessToken(accessToken: string) {
|
||||
this.accessToken = accessToken;
|
||||
},
|
||||
setRefreshToken(refreshToken: string) {
|
||||
this.refreshToken = refreshToken;
|
||||
},
|
||||
setIsRefreshToken(isRefreshToken: boolean) {
|
||||
this.isRefreshToken = isRefreshToken;
|
||||
},
|
||||
// Set setUserInfo
|
||||
setUserInfo(userInfo: UserState["userInfo"]) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
/* flex */
|
||||
.flx-center {
|
||||
display: flex;
|
||||
@@ -77,8 +79,8 @@
|
||||
|
||||
/* scroll bar */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 200px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
// background-color: var(--el-color-primary);
|
||||
}
|
||||
/* 滚动条实际可拖动部分的颜色 */
|
||||
|
||||
@@ -143,13 +143,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
.el-table__body {
|
||||
// border-left: 1px solid var(--el-table-border-color)
|
||||
}
|
||||
|
||||
// el-table 表格样式
|
||||
.el-table {
|
||||
// border: 1px solid var(--el-table-border-color);
|
||||
// flex: 1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
// 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
|
||||
border-left: 1px solid var(--el-table-border-color) // 修复 safari 浏览器表格错位 https://github.com/HalseySpicy/Geeker-Admin/issues/83
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -398,7 +402,7 @@
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px !important;
|
||||
height: 200px !important;
|
||||
height: 8px !important;
|
||||
// background-color: var(--el-color-primary);
|
||||
z-index: 3001;
|
||||
}
|
||||
@@ -441,7 +445,7 @@
|
||||
|
||||
.dialog-small {
|
||||
.el-dialog__body {
|
||||
max-height: 260px;
|
||||
max-height: 340px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,6 +461,81 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.cn-render-buttons {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin-left: 13px;
|
||||
line-height: 18px;
|
||||
padding: 2px;
|
||||
|
||||
.icon {
|
||||
font-size: 12px !important;
|
||||
// color: var(--ba-bg-color-overlay) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.el-message-box {
|
||||
padding: 0px !important;
|
||||
|
||||
.el-message-box__header {
|
||||
background-color: var(--el-color-primary);
|
||||
|
||||
.el-message-box__title {
|
||||
color: #fff;
|
||||
padding: 10px 10px 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-message-box__headerbtn {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.el-message-box__close {
|
||||
svg {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
:hover {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
.el-message-box__content {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #cccccc;
|
||||
}
|
||||
|
||||
.el-message-box__btns {
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-one {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.el-form-item {
|
||||
display: flex;
|
||||
width: 98%;
|
||||
margin-bottom: 15px !important;
|
||||
|
||||
.el-form-item__content {
|
||||
flex: 1;
|
||||
|
||||
.el-select,
|
||||
.el-cascader,
|
||||
.el-input__inner,
|
||||
.el-date-editor {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-two {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@@ -479,14 +558,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
.cn-render-buttons {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin-left: 13px;
|
||||
line-height: 18px;
|
||||
padding: 2px;
|
||||
.icon {
|
||||
font-size: 12px !important;
|
||||
// color: var(--ba-bg-color-overlay) !important;
|
||||
.form-three {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
// justify-content: space-between;
|
||||
.el-form-item {
|
||||
display: flex;
|
||||
width: 32.3%;
|
||||
|
||||
.el-form-item__content {
|
||||
flex: 1;
|
||||
|
||||
.el-select,
|
||||
.el-cascader,
|
||||
.el-input__inner,
|
||||
.el-date-editor {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-table__cell {
|
||||
border-right: 1px solid #ebeef5 !important;
|
||||
border-left: 1px solid #ebeef5 !important;
|
||||
}
|
||||
|
||||
@@ -4,24 +4,24 @@ import { ElNotification } from "element-plus";
|
||||
* @description 全局代码错误捕捉
|
||||
* */
|
||||
const errorHandler = (error: any) => {
|
||||
// 过滤 HTTP 请求错误
|
||||
if (error.status || error.status == 0) return false;
|
||||
let errorMap: { [key: string]: string } = {
|
||||
InternalError: "Javascript引擎内部错误",
|
||||
ReferenceError: "未找到对象",
|
||||
TypeError: "使用了错误的类型或对象",
|
||||
RangeError: "使用内置对象时,参数超范围",
|
||||
SyntaxError: "语法错误",
|
||||
EvalError: "错误的使用了Eval",
|
||||
URIError: "URI错误"
|
||||
};
|
||||
let errorName = errorMap[error.name] || "未知错误";
|
||||
ElNotification({
|
||||
title: errorName,
|
||||
message: error,
|
||||
type: "error",
|
||||
duration: 3000
|
||||
});
|
||||
// // 过滤 HTTP 请求错误
|
||||
// if (error.status || error.status == 0) return false;
|
||||
// let errorMap: { [key: string]: string } = {
|
||||
// InternalError: "Javascript引擎内部错误",
|
||||
// ReferenceError: "未找到对象",
|
||||
// TypeError: "使用了错误的类型或对象",
|
||||
// RangeError: "使用内置对象时,参数超范围",
|
||||
// SyntaxError: "语法错误",
|
||||
// EvalError: "错误的使用了Eval",
|
||||
// URIError: "URI错误"
|
||||
// };
|
||||
// let errorName = errorMap[error.name] || "未知错误";
|
||||
// ElNotification({
|
||||
// title: errorName,
|
||||
// message: error,
|
||||
// type: "error",
|
||||
// duration: 3000
|
||||
// });
|
||||
};
|
||||
|
||||
export default errorHandler;
|
||||
|
||||
183
frontend/src/utils/webSocketClient.ts
Normal file
183
frontend/src/utils/webSocketClient.ts
Normal file
@@ -0,0 +1,183 @@
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
|
||||
export default class SocketService {
|
||||
static instance = null;
|
||||
static get Instance() {
|
||||
if (!this.instance) {
|
||||
this.instance = new SocketService();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
// 和服务端连接的socket对象
|
||||
ws = null;
|
||||
// 存储回调函数
|
||||
callBackMapping = {};
|
||||
// 标识是否连接成功
|
||||
connected = false;
|
||||
// 记录重试的次数
|
||||
sendRetryCount = 0;
|
||||
// 重新连接尝试的次数
|
||||
connectRetryCount = 0;
|
||||
work:any;
|
||||
lastActivityTime= 0; // 上次活动时间戳
|
||||
lastResponseHeartTime = Date.now();//最后一次收到心跳回复时间
|
||||
|
||||
reconnectDelay= 5000; // 重新连接延迟,单位毫秒
|
||||
|
||||
// 定义连接服务器的方法
|
||||
connect() {
|
||||
|
||||
// 连接服务器
|
||||
if (!window.WebSocket) {
|
||||
return console.log('您的浏览器不支持WebSocket');
|
||||
}
|
||||
|
||||
// let token = $.cookie('123');
|
||||
// let token = '4E6EF539AAF119D82AC4C2BC84FBA21F';
|
||||
|
||||
|
||||
const url = 'ws://127.0.0.1:7777/hello?name=cdf'
|
||||
this.ws = new WebSocket(url);
|
||||
// 连接成功的事件
|
||||
this.ws.onopen = () => {
|
||||
ElMessage.success("webSocket连接服务端成功了");
|
||||
console.log('连接服务端成功了');
|
||||
this.connected = true;
|
||||
// 重置重新连接的次数
|
||||
this.connectRetryCount = 0;
|
||||
this.updateLastActivityTime();
|
||||
this.startHeartbeat();
|
||||
};
|
||||
// 1.连接服务端失败
|
||||
// 2.当连接成功之后, 服务器关闭的情况
|
||||
this.ws.onclose = () => {
|
||||
console.log('连接webSocket服务端关闭');
|
||||
this.connected = false;
|
||||
this.connectRetryCount++;
|
||||
this.clearHeartbeat();
|
||||
/* setTimeout(() => {
|
||||
this.connect();
|
||||
}, 500 * this.connectRetryCount);*/
|
||||
|
||||
|
||||
};
|
||||
|
||||
this.ws.onerror = () => {
|
||||
ElMessage.error("webSocket连接异常!");
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 得到服务端发送过来的数据
|
||||
this.ws.onmessage = (event) => {
|
||||
// console.log('🚀 ~ SocketService ~ connect ~ event:', event)
|
||||
if(event.data == 'over') {
|
||||
//心跳消息处理
|
||||
this.lastResponseHeartTime = Date.now();
|
||||
this.updateLastActivityTime(); // 收到心跳响应时更新活动时间
|
||||
}else {
|
||||
let message: { [key: string]: any };
|
||||
try {
|
||||
console.log('Received message:',event.data)
|
||||
message = JSON.parse(event.data);
|
||||
} catch (e) {
|
||||
return console.error("消息解析失败", event.data, e);
|
||||
}
|
||||
|
||||
/* 通过接受服务端发送的type字段来回调函数 */
|
||||
if (message?.type && this.callBackMapping[message.type]) {
|
||||
this.callBackMapping[message.type](message);
|
||||
} else {
|
||||
console.log("抛弃====>")
|
||||
console.log(event.data)
|
||||
/* 丢弃或继续写你的逻辑 */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
startHeartbeat() {
|
||||
this.lastResponseHeartTime = Date.now();
|
||||
const _this = this
|
||||
const url = window.URL.createObjectURL(new Blob(['(function(e){setInterval(function(){this.postMessage(null)},9000)})()']));
|
||||
this.workerBlobUrl = url; // 存储临时的Blob URL
|
||||
this.work = new Worker(url);
|
||||
this.work.onmessage = function(e){
|
||||
//判断多久没收到心跳响应
|
||||
|
||||
if(_this.lastActivityTime - _this.lastResponseHeartTime > 30000){
|
||||
//说明已经三轮心跳没收到回复了,关闭检测,提示用户。
|
||||
ElMessage.error("业务主体模块发生未知异常,请尝试重新启动!");
|
||||
_this.clearHeartbeat();
|
||||
return;
|
||||
}
|
||||
_this.sendHeartbeat();
|
||||
}
|
||||
|
||||
}
|
||||
sendHeartbeat() {
|
||||
console.log(new Date()+"进入心跳消息发送。。。。。。。。。。。。。")
|
||||
this.ws.send('alive');
|
||||
this.updateLastActivityTime(); // 发送心跳后更新活动时间
|
||||
}
|
||||
|
||||
|
||||
updateLastActivityTime() {
|
||||
this.lastActivityTime = Date.now();
|
||||
}
|
||||
|
||||
clearHeartbeat() {
|
||||
if (this.work) {
|
||||
this.work.terminate();
|
||||
this.work = null;
|
||||
}
|
||||
if (this.workerBlobUrl) {
|
||||
window.URL.revokeObjectURL(this.workerBlobUrl); // 释放临时的Blob URL
|
||||
this.workerBlobUrl = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 回调函数的注册
|
||||
registerCallBack(socketType, callBack) {
|
||||
this.callBackMapping[socketType] = callBack;
|
||||
}
|
||||
// 取消某一个回调函数
|
||||
unRegisterCallBack(socketType) {
|
||||
this.callBackMapping[socketType] = null;
|
||||
}
|
||||
// 发送数据的方法
|
||||
send(data) {
|
||||
// 判断此时此刻有没有连接成功
|
||||
if (this.connected) {
|
||||
this.sendRetryCount = 0;
|
||||
try {
|
||||
this.ws.send(JSON.stringify(data));
|
||||
} catch (e) {
|
||||
this.ws.send(data);
|
||||
}
|
||||
} else {
|
||||
this.sendRetryCount++;
|
||||
setTimeout(() => {
|
||||
this.send(data);
|
||||
}, this.sendRetryCount * 500);
|
||||
}
|
||||
}
|
||||
|
||||
// 断开方法
|
||||
closeWs() {
|
||||
if (this.connected) {
|
||||
this.ws.close()
|
||||
}
|
||||
console.log('执行WS关闭命令..');
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle">
|
||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' >
|
||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' class="form-two">
|
||||
<el-form-item label="上级菜单" prop="pid" :label-width="100">
|
||||
<el-tree-select
|
||||
v-model="displayPid"
|
||||
@@ -19,7 +19,7 @@
|
||||
<el-form-item label="编码" prop="code" :label-width="100">
|
||||
<el-input v-model="formContent.code" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图标" prop="icon" :label-width="100">
|
||||
<el-form-item v-if="!formContent.type" label="图标" prop="icon" :label-width="100">
|
||||
<IconSelect
|
||||
v-model="formContent.icon"
|
||||
:iconValue="formContent.icon"
|
||||
@@ -27,10 +27,10 @@
|
||||
placeholder="选择一个图标"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由地址" prop="path" :label-width="100">
|
||||
<el-form-item v-if="!formContent.type" label="路由地址" prop="path" :label-width="100">
|
||||
<el-input v-model="formContent.path" />
|
||||
</el-form-item>
|
||||
<el-form-item label="组件地址" prop="component" :label-width="100">
|
||||
<el-form-item v-if="!formContent.type" label="组件地址" prop="component" :label-width="100">
|
||||
<el-input v-model="formContent.component" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort" :label-width="100">
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
import ResourcePopup from './components/resourcePopup.vue'
|
||||
import {deleteFunction,getFunctionList} from '@/api/user/function/index'
|
||||
import * as Icons from '@element-plus/icons-vue'
|
||||
defineOptions({
|
||||
name: 'resource'
|
||||
})
|
||||
const dictStore = useDictStore()
|
||||
const resourcePopup = ref()
|
||||
// ProTable 实例
|
||||
|
||||
@@ -146,7 +146,6 @@ const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFu
|
||||
const allIds = getAllIds(AllFunction);
|
||||
// 匹配 roleFunctions 中的 id 并设置 checkedKeys
|
||||
const checkedKeys = allIds.filter(id => roleFunctions.some(roleFunc => roleFunc.id === id));
|
||||
|
||||
// 过滤出叶子节点
|
||||
const leafCheckedKeys = filterLeafNodes(AllFunction, checkedKeys);
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button v-auth.role="'add'" type='primary' :icon='CirclePlus' @click="openDrawer('新增角色')">新增</el-button>
|
||||
<el-button v-auth.role="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.role="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
@@ -39,6 +39,9 @@ import RolePopup from './components/rolePopup.vue'
|
||||
import RoleResourcePopup from './components/roleResourcePopup.vue'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
defineOptions({
|
||||
name: 'role'
|
||||
})
|
||||
const rolePopup = ref()
|
||||
const roleResourcePopup = ref()
|
||||
const dictStore = useDictStore()
|
||||
@@ -91,6 +94,22 @@ const columns = reactive<ColumnProps<Role.RoleBO>[]>([
|
||||
search: { el: 'input' },
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '类型',
|
||||
minWidth: 200,
|
||||
render: (scope) => {
|
||||
const typeMap: { [key: number]: { label: string; type: string } } = {
|
||||
0: { label: '超级管理员', type: 'primary' },
|
||||
1: { label: '管理员角色', type: 'success' },
|
||||
2: { label: '普通角色', type: 'info' },
|
||||
};
|
||||
const typeInfo = typeMap[scope.row.type] || { label: '未知', type: 'danger' };
|
||||
return (
|
||||
<el-tag type={typeInfo.type}>{typeInfo.label}</el-tag>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '描述',
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button v-auth.user="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.user="'batchDelete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
<el-button v-auth.user="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
@@ -43,6 +43,9 @@
|
||||
import {getUserList, deleteUser,getRoleList} from '@/api/user/user'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { type Role } from '@/api/user/interface/role'
|
||||
defineOptions({
|
||||
name: 'user'
|
||||
})
|
||||
const roleList = ref<Role.RoleBO[]>([])
|
||||
const dictStore = useDictStore()
|
||||
const userPopup = ref()
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
<!--双列-->
|
||||
<template>
|
||||
<el-dialog v-model='dialogVisible' :title='title' v-bind='dialogMiddle' >
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" label-width="auto" ref="formRef" class='form-two'>
|
||||
<el-form-item label="姓名" prop="username" >
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="身份证号" prop="id">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="居住地址" prop="address">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机" prop="phone">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="来源" prop="source">
|
||||
<el-input
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
|
||||
<template #footer>
|
||||
<div class='dialog-footer'>
|
||||
<el-button @click='close()'>取消</el-button>
|
||||
<el-button type='primary' @click='confirmForm()'>确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { dialogMiddle } from '@/utils/elementBind'
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('单列弹出框')
|
||||
const open = (textTitle: string) => {
|
||||
dialogVisible.value = true
|
||||
title.value = textTitle
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
const confirmForm = () => {
|
||||
ElMessage.info('业务数据提交')
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,210 +0,0 @@
|
||||
<template>
|
||||
<div class='table-box' ref='popupBaseView'>
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:data='userData'
|
||||
>
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增')">新增用户</el-button>
|
||||
<el-button type='primary' :icon='Upload' plain @click='batchAdd'>批量添加用户</el-button>
|
||||
<el-button type='primary' :icon='Download' plain @click='downloadFile'>导出用户数据</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除用户
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='View'
|
||||
@click="openDrawer('查看', scope.row)">查看
|
||||
</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Refresh' @click='resetPass(scope.row)'>重置密码</el-button>
|
||||
<el-button type='primary' link :icon='CirclePlus' @click='deleteAccount()'>下钻</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
<single-column ref='singleColumn' />
|
||||
<double-column ref='doubleColumn' />
|
||||
<open :width='viewWidth' :height='viewHeight' ref='openView' />
|
||||
</template>
|
||||
<script setup lang='tsx' name='useProTable'>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { User } from '@/api/user/interface'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import { useAuthButtons } from '@/hooks/useAuthButtons'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import ImportExcel from '@/components/ImportExcel/index.vue'
|
||||
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
||||
import { CirclePlus, Delete, EditPen, Download, Upload, View, Refresh } from '@element-plus/icons-vue'
|
||||
import userDataList from '@/api/user/userData'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import SingleColumn from '@/views/demo/proTable/singleColumn.vue'
|
||||
import Open from '@/views/demo/proTable/Open.vue'
|
||||
import DoubleColumn from '@/views/demo/proTable/doubleColumn.vue'
|
||||
import { useViewSize } from '@/hooks/useViewSize'
|
||||
|
||||
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
|
||||
|
||||
const dictStore = useDictStore()
|
||||
import {
|
||||
getUserList,
|
||||
deleteUser,
|
||||
changeUserStatus,
|
||||
exportUserInfo,
|
||||
BatchAddUser,
|
||||
} from '@/api/user/user'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
const userData = userDataList
|
||||
const singleColumn = ref()
|
||||
const doubleColumn = ref()
|
||||
const openView = ref()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
||||
const initParam = reactive({ type: 1 })
|
||||
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
|
||||
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
||||
const dataCallback = (data: any) => {
|
||||
return {
|
||||
list: data.list,
|
||||
total: data.total,
|
||||
}
|
||||
}
|
||||
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
||||
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
||||
const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
newParams.createTime && (newParams.startTime = newParams.createTime[0])
|
||||
newParams.createTime && (newParams.endTime = newParams.createTime[1])
|
||||
delete newParams.createTime
|
||||
return getUserList(newParams)
|
||||
}
|
||||
// 页面按钮权限(按钮权限既可以使用 hooks,也可以直接使用 v-auth 指令,指令适合直接绑定在按钮上,hooks 适合根据按钮权限显示不同的内容)
|
||||
const { BUTTONS } = useAuthButtons()
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'username',
|
||||
label: '姓名',
|
||||
width: 120,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'gender',
|
||||
label: '性别',
|
||||
// 字典数据(本地数据)
|
||||
enum: dictStore.getDictData('sex'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'age',
|
||||
label: '年龄',
|
||||
search: {
|
||||
// 自定义 search 显示内容
|
||||
render: ({ searchParam }) => {
|
||||
return (
|
||||
<div class='flx-center'>
|
||||
<el-input vModel_trim={searchParam.minAge} placeholder='最小年龄' />
|
||||
<span class='mr10 ml10'>-</span>
|
||||
<el-input vModel_trim={searchParam.maxAge} placeholder='最大年龄' />
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
},
|
||||
{ prop: 'idCard', label: '身份证号' },
|
||||
{ prop: 'email', label: '邮箱' },
|
||||
{ prop: 'address', label: '居住地址', width: 120 },
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
enum: dictStore.getDictData('status'),
|
||||
search: { el: 'tree-select', props: { filterable: true } },
|
||||
fieldNames: { label: 'userLabel', value: 'userStatus' },
|
||||
render: scope => {
|
||||
return (
|
||||
<>
|
||||
{BUTTONS.value.status ? (
|
||||
<el-switch
|
||||
model-value={scope.row.status}
|
||||
active-text={scope.row.status ? '启用' : '禁用'}
|
||||
active-value={1}
|
||||
inactive-value={0}
|
||||
onClick={() => changeStatus(scope.row)}
|
||||
/>
|
||||
) : (
|
||||
<el-tag type={scope.row.status ? 'success' : 'danger'}>{scope.row.status ? '启用' : '禁用'}</el-tag>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
span: 1,
|
||||
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
|
||||
defaultValue: ['2024-11-12', '2024-12-12'],
|
||||
},
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
|
||||
])
|
||||
|
||||
|
||||
// 下钻
|
||||
const deleteAccount = async () => {
|
||||
openView.value.open('测试弹出框')
|
||||
}
|
||||
// 批量删除用户信息
|
||||
const batchDelete = async (id: string[]) => {
|
||||
await useHandleData(deleteUser, { id }, '删除所选用户信息')
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
// 重置用户密码
|
||||
const resetPass = async (params: User.ResUserList) => {
|
||||
// await useHandleData(resetUserPassWord, { id: params.id }, `重置【${params.username}】用户密码`)
|
||||
// proTable.value?.getTableList()
|
||||
doubleColumn.value.open('双列弹出框')
|
||||
}
|
||||
// 切换用户状态
|
||||
const changeStatus = async (row: User.ResUserList) => {
|
||||
await useHandleData(changeUserStatus, {
|
||||
id: row.id,
|
||||
status: row.status == 1 ? 0 : 1,
|
||||
}, `切换【${row.username}】用户状态`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
// 导出用户列表
|
||||
const downloadFile = async () => {
|
||||
ElMessageBox.confirm('确认导出用户数据?', '温馨提示', { type: 'warning' }).then(() =>
|
||||
useDownload(exportUserInfo, '用户列表', proTable.value?.searchParam),
|
||||
)
|
||||
}
|
||||
// 批量添加用户
|
||||
const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||
const batchAdd = () => {
|
||||
const params = {
|
||||
title: '用户',
|
||||
tempApi: exportUserInfo,
|
||||
importApi: BatchAddUser,
|
||||
getTableList: proTable.value?.getTableList,
|
||||
}
|
||||
dialogRef.value?.acceptParams(params)
|
||||
}
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = (title: string, row: Partial<User.ResUserList> = {}) => {
|
||||
singleColumn.value.open('单列弹出框')
|
||||
}
|
||||
</script>
|
||||
@@ -1,177 +0,0 @@
|
||||
<!--单列-->
|
||||
<template>
|
||||
<el-dialog class='table-box'
|
||||
v-model='dialogVisible'
|
||||
top='114px'
|
||||
:style="{height:height+'px',maxHeight:height+'px',overflow:'hidden'}"
|
||||
:title='title'
|
||||
:width='width'
|
||||
:modal='false'>
|
||||
<div class='table-box' :style="{height:(height-64)+'px',maxHeight:(height-64)+'px',overflow:'hidden'}">
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:data='userData'
|
||||
>
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDrawer('新增')">新增用户</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='View'
|
||||
@click="openDrawer('查看', scope.row)">查看
|
||||
</el-button>
|
||||
<el-button type='primary' link :icon='EditPen' @click="openDrawer('编辑', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Refresh' @click='resetPass(scope.row)'>重置密码</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='deleteAccount(scope.row)'>删除</el-button>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang='tsx'>
|
||||
import { CirclePlus, Delete, EditPen, Refresh, View } from '@element-plus/icons-vue'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { useAuthButtons } from '@/hooks/useAuthButtons'
|
||||
import { reactive } from 'vue'
|
||||
import { ColumnProps } from '@/components/ProTable/interface'
|
||||
import { User } from '@/api/user/interface'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
import {
|
||||
changeUserStatus,
|
||||
} from '@/api/user/user'
|
||||
import userDataList from '@/api/user/userData'
|
||||
|
||||
const userData = userDataList
|
||||
const proTable = ref()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('单列弹出框')
|
||||
|
||||
const { BUTTONS } = useAuthButtons()
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<User.ResUserList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'username',
|
||||
label: '姓名',
|
||||
width: 120,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'gender',
|
||||
label: '性别',
|
||||
// 字典数据(本地数据)
|
||||
enum: dictStore.getDictData('sex'),
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'code' },
|
||||
},
|
||||
{
|
||||
prop: 'age',
|
||||
label: '年龄',
|
||||
search: {
|
||||
// 自定义 search 显示内容
|
||||
render: ({ searchParam }) => {
|
||||
return (
|
||||
<div class='flx-center'>
|
||||
<el-input vModel_trim={searchParam.minAge} placeholder='最小年龄' />
|
||||
<span class='mr10 ml10'>-</span>
|
||||
<el-input vModel_trim={searchParam.maxAge} placeholder='最大年龄' />
|
||||
</div>
|
||||
)
|
||||
},
|
||||
},
|
||||
},
|
||||
{ prop: 'idCard', label: '身份证号', search: { el: 'input' } },
|
||||
{ prop: 'email', label: '邮箱' },
|
||||
{ prop: 'address', label: '居住地址', width: 120 },
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
enum: dictStore.getDictData('status'),
|
||||
search: { el: 'tree-select', props: { filterable: true } },
|
||||
fieldNames: { label: 'userLabel', value: 'userStatus' },
|
||||
render: scope => {
|
||||
return (
|
||||
<>
|
||||
{BUTTONS.value.status ? (
|
||||
<el-switch
|
||||
model-value={scope.row.status}
|
||||
active-text={scope.row.status ? '启用' : '禁用'}
|
||||
active-value={1}
|
||||
inactive-value={0}
|
||||
onClick={() => changeStatus(scope.row)}
|
||||
/>
|
||||
) : (
|
||||
<el-tag type={scope.row.status ? 'success' : 'danger'}>{scope.row.status ? '启用' : '禁用'}</el-tag>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 180,
|
||||
search: {
|
||||
el: 'date-picker',
|
||||
span: 1,
|
||||
props: { type: 'daterange', valueFormat: 'YYYY-MM-DD' },
|
||||
defaultValue: ['2024-11-12', '2024-12-12'],
|
||||
},
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 330 },
|
||||
])
|
||||
|
||||
|
||||
const open = (textTitle: string) => {
|
||||
dialogVisible.value = true
|
||||
title.value = textTitle
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
width: {
|
||||
type: Number,
|
||||
default: 800,
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 744,
|
||||
},
|
||||
})
|
||||
|
||||
// 切换用户状态
|
||||
const changeStatus = async (row: User.ResUserList) => {
|
||||
await useHandleData(changeUserStatus, {
|
||||
id: row.id,
|
||||
status: row.status == 1 ? 0 : 1,
|
||||
}, `切换【${row.username}】用户状态`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
// 删除用户信息
|
||||
const deleteAccount = async (params: User.ResUserList) => {
|
||||
|
||||
}
|
||||
// 重置用户密码
|
||||
const resetPass = async (params: User.ResUserList) => {
|
||||
|
||||
}
|
||||
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = (title: string, row: Partial<User.ResUserList> = {}) => {
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,169 +0,0 @@
|
||||
<!--单列-->
|
||||
<template>
|
||||
<el-dialog v-model='dialogVisible' :title='title' v-bind='dialogSmall'>
|
||||
<el-scrollbar>
|
||||
<el-form
|
||||
:model='form'
|
||||
:inline='false'
|
||||
label-width='auto'
|
||||
ref='formRuleRef'
|
||||
:rules='rules'
|
||||
>
|
||||
<el-form-item label='姓名' prop='username'>
|
||||
<el-input
|
||||
v-model='form.username'
|
||||
placeholder='请输入姓名'
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label='性别' prop='gender'>
|
||||
<el-radio-group v-model='form.gender'>
|
||||
<el-radio-button :label='0'>男</el-radio-button>
|
||||
<el-radio-button :label='1'>女</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label='年龄' prop='age'>
|
||||
<el-input
|
||||
v-model='form.age'
|
||||
placeholder='年龄'
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label='身份证号' prop='idCard'>
|
||||
<el-input
|
||||
v-model='form.idCard'
|
||||
placeholder='身份证号'
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label='邮箱' prop='email'>
|
||||
<el-input
|
||||
v-model='form.email'
|
||||
placeholder='邮箱'
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label='居住地址' prop='address'>
|
||||
<el-input
|
||||
v-model='form.address'
|
||||
placeholder='居住地址'
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
|
||||
<template #footer>
|
||||
<div class='dialog-footer'>
|
||||
<el-button @click='close()'>取消</el-button>
|
||||
<el-button type='primary' @click='confirmForm()'>确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { dialogSmall } from '@/utils/elementBind'
|
||||
import { FormInstance, FormItemRule } from 'element-plus'
|
||||
|
||||
interface userForm {
|
||||
id?: string; //用户ID,作为唯一标识
|
||||
username: string; //用户名
|
||||
gender: number; // 性别
|
||||
age: number; // 年龄
|
||||
idCard: string; // 身份证
|
||||
email: string; // 邮箱
|
||||
address?: string; // 地址
|
||||
}
|
||||
|
||||
const form: Ref<userForm> = ref({
|
||||
username: '',
|
||||
gender: 0,
|
||||
age: 1,
|
||||
idCard: '',
|
||||
email: '',
|
||||
})
|
||||
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
username: [{ required: true, message: '用户名必填!', trigger: 'blur' }],
|
||||
age: [
|
||||
{ required: true, message: '年龄必填!', trigger: 'blur' },
|
||||
// 指定正则,此处是数字正则
|
||||
{ pattern: /^[1-9][0-9]?$|^100$/, message: '年龄必须在1到100之间', trigger: 'blur' },
|
||||
],
|
||||
idCard: [
|
||||
{ required: true, message: '身份证必填!', trigger: 'blur' },
|
||||
// 指定正则,此处是身份证正则
|
||||
{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确的身份证号码', trigger: 'blur' },
|
||||
],
|
||||
email: [
|
||||
{ required: true, message: '邮箱必填!', trigger: 'blur' },
|
||||
// 指定校验类型
|
||||
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] },
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
const resetForm = () => {
|
||||
form.value = {
|
||||
username: '',
|
||||
gender: 0,
|
||||
age: 1,
|
||||
idCard: '',
|
||||
email: '',
|
||||
address: '',
|
||||
}
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('单列弹出框')
|
||||
const open = (textTitle: string) => {
|
||||
dialogVisible.value = true
|
||||
title.value = textTitle
|
||||
}
|
||||
|
||||
// 关闭弹出框
|
||||
const close = () => {
|
||||
//重置表单内容
|
||||
//取消表单校验状态
|
||||
formRuleRef.value && formRuleRef.value.resetFields()
|
||||
dialogVisible.value = false
|
||||
resetForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验表单数据
|
||||
* 数据没问题,提交数据,并根据业务情况请求新增接口还是修改接口
|
||||
*/
|
||||
const confirmForm = () => {
|
||||
ElMessage.info('业务数据提交')
|
||||
try {
|
||||
formRuleRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
// 将表单数据转为json,发送到后端
|
||||
let confirmFormData = JSON.parse(JSON.stringify(form.value))
|
||||
|
||||
if ('是否新增') {
|
||||
// 执行新增接口
|
||||
} else {
|
||||
// 执行修改接口
|
||||
}
|
||||
} else {
|
||||
ElMessage.error('表单验证失败!')
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('验证过程中发生错误', error)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,127 +1,343 @@
|
||||
<template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="updateTime" label="上送时刻" />
|
||||
<el-table-column prop="deviceName" label="设备名称" />
|
||||
<el-table-column prop="MonitorIdx" label="监测点序号" />
|
||||
|
||||
<div class="table-container table-main">
|
||||
<el-table :data="tableData"
|
||||
:header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
style="width: 100%"
|
||||
max-height="400px"
|
||||
:span-method="objectSpanMethod">
|
||||
<el-table-column prop="monitorNum" label="监测点序号" width="80"/>
|
||||
<el-table-column prop="desc" label="描述" width="90"/>
|
||||
<el-table-column label="电压通道" >
|
||||
<el-table-column prop="Ua" label="L1">
|
||||
|
||||
<el-table-column prop="Ua" label="A相">
|
||||
<el-table-column prop="aVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.aVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="L2">
|
||||
|
||||
<el-table-column prop="aVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aVuXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
|
||||
误差值:{{ scope.row.aV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.aVuXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.aVuXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
|
||||
误差值:{{ scope.row.aV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.aVuXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<!-- <el-tag type="danger" v-if="scope.row.aVuXi === '不合格'">
|
||||
{{ scope.row.aVuXi }}
|
||||
</el-tag> -->
|
||||
<el-icon v-else-if="scope.row.aVuXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<!-- <span v-else>
|
||||
{{ scope.row.aVuXi }}
|
||||
</span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="B相">
|
||||
<el-table-column prop="bVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.bVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bVuXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
|
||||
误差值:{{ scope.row.bV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.bVuXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.bVuXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
|
||||
误差值:{{ scope.row.bV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.bVuXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<el-icon v-else-if="scope.row.bVuXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="C相">
|
||||
<el-table-column prop="cVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.cVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cVuXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4)+ 'V'}}<br/>
|
||||
误差值:{{ scope.row.cV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.cVuXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.cVuXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ (-0.001 * props.curV).toFixed(4) + 'V~' + (0.001 * props.curV).toFixed(4) + 'V'}}<br/>
|
||||
误差值:{{ scope.row.cV + 'V'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.cVuXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<el-icon v-else-if="scope.row.cVuXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="L3">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="电流通道" >
|
||||
<el-table-column prop="Ia" label="L1">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ib" label="L2">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ic" label="L3">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="校准结果">
|
||||
<el-table-column prop="Ia" label="A相">
|
||||
<el-table-column prop="aIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag>
|
||||
<el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.aIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="aIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aIeXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{-0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.aI + '%'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.aIeXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.aIeXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ -0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.aI + '%'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.aIeXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<el-icon v-else-if="scope.row.aIeXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ib" label="B相">
|
||||
<el-table-column prop="bIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.bIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bIeXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ -0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.bI + '%'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.bIeXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.bIeXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ -0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.bI + '%'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.bIeXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<el-icon v-else-if="scope.row.bIeXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ic" label="C相">
|
||||
<el-table-column prop="cIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.cIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cIeXi === '不合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ -0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.cI + '%'}}
|
||||
</template>
|
||||
<el-tag type="danger" class="tooltip-content">
|
||||
{{ scope.row.cIeXi }}
|
||||
</el-tag>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
v-else-if="scope.row.cIeXi === '合格'"
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom-start"
|
||||
>
|
||||
<template #content>
|
||||
误差范围: {{ -0.5 + "%~" +0.5 + "%" }}<br/>
|
||||
误差值:{{ scope.row.cI + '%'}}
|
||||
</template>
|
||||
<el-tag type="success" class="tooltip-content">{{ scope.row.cIeXi }}</el-tag>
|
||||
</el-tooltip>
|
||||
<el-icon v-else-if="scope.row.cIeXi === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ErrorSystemDialog">
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const dictStore = useDictStore()
|
||||
const props = defineProps<{
|
||||
tableData: {
|
||||
id: string;
|
||||
updateTime: string;
|
||||
deviceName:string;
|
||||
MonitorIdx:number;
|
||||
Ua:number;
|
||||
Ub:number;
|
||||
Uc:number;
|
||||
Ia:number;
|
||||
Ib:number;
|
||||
Ic:number;
|
||||
Result: string;
|
||||
import { defineProps, type PropType } from 'vue';
|
||||
import { ElIcon, ElLoading, ElTag } from 'element-plus';
|
||||
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
|
||||
import { number } from 'echarts';
|
||||
|
||||
interface Props {
|
||||
tableData: ChannelsTest.CoefficientVO[];
|
||||
big_V_loading: boolean;
|
||||
curV: number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
tableData: () => [],
|
||||
big_V_loading: false,
|
||||
curV: 0,
|
||||
});
|
||||
|
||||
function objectSpanMethod({ row, column, rowIndex, columnIndex }: { row: any, column: any, rowIndex: number, columnIndex: number }) {
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex % 4 === 0) {
|
||||
return {
|
||||
rowspan: 4,
|
||||
colspan: 1,
|
||||
};
|
||||
}>();
|
||||
|
||||
|
||||
// const tableData = ref([
|
||||
// {
|
||||
// id: '1',
|
||||
// updateTime: '2024-10-10 10:30:00',
|
||||
// deviceName:'被检设备1',
|
||||
// MonitorIdx: 1,
|
||||
// Ua:1.0003,
|
||||
// Ub:1.0003,
|
||||
// Uc:0.0096,
|
||||
// Ia:1.0003,
|
||||
// Ib:1.0003,
|
||||
// Ic:1.0008,
|
||||
// Result: '合格',
|
||||
// },
|
||||
// {
|
||||
// id: '2',
|
||||
// updateTime: '2024-10-10 10:30:00',
|
||||
// deviceName:'被检设备1',
|
||||
// MonitorIdx: 2,
|
||||
// Ua:1.0003,
|
||||
// Ub:1.0003,
|
||||
// Uc:0.0096,
|
||||
// Ia:1.0003,
|
||||
// Ib:1.0003,
|
||||
// Ic:1.0008,
|
||||
// Result: '合格',
|
||||
// },
|
||||
// {
|
||||
// id: '3',
|
||||
// updateTime: '2024-10-10 10:30:00',
|
||||
// deviceName:'被检设备1',
|
||||
// MonitorIdx: 3,
|
||||
// Ua:1.0003,
|
||||
// Ub:1.0003,
|
||||
// Uc:0.0096,
|
||||
// Ia:1.0003,
|
||||
// Ib:1.0003,
|
||||
// Ic:1.0008,
|
||||
// Result: '合格',
|
||||
// },
|
||||
// {
|
||||
// id: '4',
|
||||
// updateTime: '2024-10-10 10:30:00',
|
||||
// deviceName:'被检设备1',
|
||||
// MonitorIdx: 4,
|
||||
// Ua:1.0003,
|
||||
// Ub:1.0003,
|
||||
// Uc:0.0096,
|
||||
// Ia:1.0003,
|
||||
// Ib:1.0003,
|
||||
// Ic:1.0008,
|
||||
// Result: '合格',
|
||||
// },
|
||||
// ])
|
||||
} else {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
if (columnIndex === 1) {
|
||||
if (rowIndex % 2 === 0) {
|
||||
return {
|
||||
rowspan: 2,
|
||||
colspan: 1,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -157,4 +373,31 @@
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
|
||||
/* 确保 el-icon-loading 的动画效果没有被覆盖 */
|
||||
.loading-box {
|
||||
animation: rotate 2s linear infinite;
|
||||
}
|
||||
|
||||
.icon-margin {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.icon-align {
|
||||
vertical-align: 0px;
|
||||
}
|
||||
|
||||
.tooltip-content {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,60 +2,62 @@
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px">
|
||||
<div class="change-errsys-dialog">
|
||||
<div class="change-errsys-title">
|
||||
<el-form :model='formContent'>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称:" >
|
||||
<el-form :model='formContent' label-width="auto" class="form-three">
|
||||
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model='deviceName' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-form-item label="检测脚本">
|
||||
<el-input v-model='testScriptName' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数据处理原则:" >
|
||||
|
||||
<el-form-item label="数据原则">
|
||||
<el-input v-model='dataRule' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
|
||||
|
||||
<el-form-item label="误差体系">
|
||||
<el-select v-model="error_Sys_Id" autocomplete="off">
|
||||
<el-option
|
||||
v-for="plan in testErrSystDataList"
|
||||
:key="plan.id"
|
||||
:label="plan.label"
|
||||
:value="plan.id"
|
||||
:disabled = "plan.label === errorSysName"
|
||||
>
|
||||
<el-option v-for="plan in testErrSystDataList" :key="plan.id" :label="plan.label" :value="plan.id"
|
||||
:disabled="plan.label === errorSysName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item >
|
||||
|
||||
|
||||
<el-form-item label=" ">
|
||||
<el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button>
|
||||
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled" @click="openReportDlg">报告生成</el-button>
|
||||
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled"
|
||||
@click="openReportDlg">报告生成</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="change-errsys-content">
|
||||
<div class="tabs-title">
|
||||
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
|
||||
<el-button type="primary" v-if="activeIndex >= activeTotalNum">合格92项/共103项</el-button>
|
||||
<!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
|
||||
<el-button type="primary" v-if="activeIndex >= activeTotalNum" disabled>合格92项/共103项</el-button> -->
|
||||
<span style=" font-size: 18px;font-weight: 600;">
|
||||
数据已合格 <span style="color: #67C23A">{{ qualified }}</span> 项/共 <span style="color: green">{{ 103 }}</span>
|
||||
项
|
||||
</span>
|
||||
</div>
|
||||
<div class="dialog-content">
|
||||
<el-table :data="tableData" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border>
|
||||
<el-table :data="tableData" :cell-class-name="tableCell" row-key="id" height="450px"
|
||||
:header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' }" style="width: 100%"
|
||||
border>
|
||||
<el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" />
|
||||
|
||||
<el-table-column label="被检通道1" align="center">
|
||||
<el-table-column label="被检通道1" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道1</span>
|
||||
<el-tooltip content = "240001被检通道1" placement="top" style="align-items: bottom;">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
|
||||
<!-- <el-tooltip content = "info" placement="top">
|
||||
<i class="el-icon-info"></i>
|
||||
</el-tooltip> -->
|
||||
<el-tooltip :content="scope.row.resultType1==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
:disabled = "scope.row.resultType1=='info'"
|
||||
@@ -67,10 +69,15 @@
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道2" align="center">
|
||||
<el-table-column label="被检通道2" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道2</span>
|
||||
<el-tooltip content = "240001被检通道2" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType2==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -85,7 +92,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道3" align="center">
|
||||
<el-table-column label="被检通道3" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道3</span>
|
||||
<el-tooltip content = "240001被检通道3" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType3==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -100,7 +113,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道4" align="center">
|
||||
<el-table-column label="被检通道4" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道4</span>
|
||||
<el-tooltip content = "240001被检通道4" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType4==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -115,7 +134,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column p label="被检通道5" align="center">
|
||||
<el-table-column p label="被检通道5" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道5</span>
|
||||
<el-tooltip content = "240002被检通道1" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType5==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -130,7 +155,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道6" align="center">
|
||||
<el-table-column label="被检通道6" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道6</span>
|
||||
<el-tooltip content = "240002被检通道2" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType6==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -146,7 +177,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道7" align="center">
|
||||
<el-table-column label="被检通道7" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道7</span>
|
||||
<el-tooltip content = "240002被检通道3" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType7==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -161,7 +198,13 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="被检通道8" align="center">
|
||||
<el-table-column label="被检通道8" :min-width="minwidth" align="center">
|
||||
<template #header>
|
||||
<span>被检通道8</span>
|
||||
<el-tooltip content = "240002被检通道4" placement="top">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-tooltip :content="scope.row.resultType8==='info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||
<el-button
|
||||
@@ -176,6 +219,7 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column v-for="(item, index) in monitorList" :key="index" :prop="item.prop" :label="item.label">
|
||||
</el-table-column> -->
|
||||
|
||||
@@ -193,10 +237,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
|
||||
<dataCheckSingleChannelSingleTestPopup
|
||||
:visible="dataCheckSingleChannelSingleTestDialogVisable"
|
||||
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"
|
||||
></dataCheckSingleChannelSingleTestPopup>
|
||||
<dataCheckSingleChannelSingleTestPopup :visible="dataCheckSingleChannelSingleTestDialogVisable"
|
||||
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"></dataCheckSingleChannelSingleTestPopup>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
@@ -223,23 +265,22 @@ import ReportPopup from './reportPopup.vue'
|
||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
|
||||
|
||||
|
||||
const qualified = ref(0)
|
||||
const reportDisabled = ref(true)
|
||||
const reportDialogVisible = ref(false)
|
||||
const deviceName = ref('被检设备1');
|
||||
const error_Sys_Id = ref('2');
|
||||
const deviceName = ref('240001');
|
||||
const error_Sys_Id = ref('1');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2 - 2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const currentScriptDsc = ref('电压准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
pid: "pid",
|
||||
};
|
||||
const judge = (label:string) =>
|
||||
{
|
||||
const judge = (label: string) => {
|
||||
console.log(label, errorSysName.value)
|
||||
if (label === errorSysName.value)
|
||||
return true
|
||||
@@ -302,8 +343,11 @@ const props = defineProps<{
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
//clearInterval(timer.value);
|
||||
reportDisabled.value = true;
|
||||
activeIndex.value = 0;
|
||||
qualified.value = 0;
|
||||
tableData.value.length = 0;
|
||||
columnList.value.length = 0;
|
||||
tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
|
||||
};
|
||||
|
||||
@@ -378,9 +422,9 @@ const scrollContainer = ref<HTMLElement | null>(null); // 声明 scrollContainer
|
||||
|
||||
const scrollToBottom = () => {
|
||||
if (scrollContainer.value) {
|
||||
console.log(scrollContainer.value)
|
||||
//console.log(scrollContainer.value)
|
||||
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
|
||||
console.log(scrollContainer.value)
|
||||
//console.log(scrollContainer.value)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -390,8 +434,7 @@ function getRandomInt(max: number): number {
|
||||
const updateLog = () => {
|
||||
const currentTime = ref(new Date().toLocaleString());
|
||||
|
||||
switch(activeIndex.value)
|
||||
{
|
||||
switch (activeIndex.value) {
|
||||
case 1:
|
||||
testLogList.value.length = 0; // 清空数组
|
||||
testLogList.value.push({
|
||||
@@ -442,9 +485,23 @@ const testLogList = ref([
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
])
|
||||
|
||||
const columnList = ref([]);
|
||||
const tableKey = ref(0);
|
||||
function tableCell ({row,columnIndex}){
|
||||
let items = columnList?.value.filter((item) => item === row.id)
|
||||
|
||||
if(columnIndex === 0 && items.length > 0)
|
||||
{
|
||||
// console.log(row.id,items.length,columnList?.value)
|
||||
return 'warning-row'
|
||||
}
|
||||
|
||||
if(columnIndex === 0)
|
||||
{
|
||||
return 'header-row'
|
||||
}
|
||||
|
||||
}
|
||||
const tableRowClassName = ({
|
||||
row,
|
||||
rowIndex,
|
||||
@@ -475,20 +532,18 @@ const dataCheckSingleChannelSingleTestDialogVisable = ref(false);
|
||||
function traverseTableData(data: any[], id: string): void {
|
||||
data.forEach(item => {
|
||||
// 处理当前节点的数据
|
||||
if(item.id === id)
|
||||
{
|
||||
for(let i = 1;i<=8;i++)
|
||||
{
|
||||
if (item.id === id) {
|
||||
for (let i = 1; i <= 8; i++) {
|
||||
let field1 = "resultType" + i
|
||||
let field2 = "resultValue" + i
|
||||
|
||||
if(getRandomInt(10)>8 && activeIndex.value>2)
|
||||
{
|
||||
if (getRandomInt(10) > 8 && activeIndex.value > 2) {
|
||||
item[field1] = "danger";
|
||||
item[field2] = "×";
|
||||
columnList.value.push(activeIndex.value.toString());
|
||||
// console.log(id,activeIndex.value,columnList.value)
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
item[field1] = "success";
|
||||
item[field2] = "√";
|
||||
}
|
||||
@@ -506,7 +561,7 @@ function traverseTableData(data: any[],id: string): void {
|
||||
const updateTableData = (id: string) => {
|
||||
|
||||
traverseTableData(tableData.value, id);
|
||||
console.log(id)
|
||||
// console.log(id)
|
||||
};
|
||||
|
||||
let timer: any = ref("");
|
||||
@@ -527,7 +582,7 @@ const handleFinishTest = () => {
|
||||
};
|
||||
|
||||
const handleClick = (row: any) => {
|
||||
console.log(111,row)
|
||||
// console.log(111, row)
|
||||
dataCheckSingleChannelSingleTestDialogVisable.value = true;
|
||||
};
|
||||
|
||||
@@ -1830,13 +1885,11 @@ const startTimer = () => {
|
||||
//if (timer.value !== null) return; // 如果定时器已经启动,则不再重复启动
|
||||
timer.value = setInterval(() => {
|
||||
|
||||
console.log(activeIndex.value,111)
|
||||
if(activeIndex.value <= activeTotalNum.value)
|
||||
{
|
||||
// console.log(activeIndex.value, 111)
|
||||
if (activeIndex.value <= activeTotalNum.value) {
|
||||
activeIndex.value++;
|
||||
|
||||
switch(activeIndex.value)
|
||||
{
|
||||
switch (activeIndex.value) {
|
||||
case 1:
|
||||
updateTableData("1-1-1")
|
||||
updateTableData("1-1-2")
|
||||
@@ -1889,14 +1942,13 @@ const startTimer = () => {
|
||||
// }
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(activeIndex.value,222)
|
||||
else {
|
||||
// console.log(activeIndex.value, 222)
|
||||
clearInterval(timer.value)
|
||||
reportDisabled.value = false;
|
||||
console.log(activeIndex.value,333)
|
||||
// console.log(activeIndex.value, 333)
|
||||
}
|
||||
|
||||
qualified.value = 92
|
||||
}, 100);
|
||||
};
|
||||
|
||||
@@ -1915,7 +1967,21 @@ const resumeTimer = () => {
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-table .header-row) {
|
||||
// background-color:var(--el-color-warning-light-9);
|
||||
background-color:#f5f7fa;
|
||||
// color:red;
|
||||
// font-size:30px;
|
||||
// --el-table-tr-bg-color: var(--el-color-warning-light-9);
|
||||
}
|
||||
:deep(.el-table .warning-row) {
|
||||
// background-color:var(--el-color-warning-light-9);
|
||||
//background-color:#bed96557;
|
||||
color:red;
|
||||
// font-size:30px;
|
||||
// --el-table-tr-bg-color: var(--el-color-warning-light-9);
|
||||
}
|
||||
|
||||
.change-errsys-dialog {
|
||||
display: flex;
|
||||
@@ -1938,5 +2004,14 @@ const resumeTimer = () => {
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-button--small) {
|
||||
height: 20px !important;
|
||||
width: 20px !important;
|
||||
}
|
||||
|
||||
:deep(.el-table--default td) {
|
||||
padding: 5px 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -2,31 +2,21 @@
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" width="1065px" draggable>
|
||||
<div class="data-check-dialog">
|
||||
<div class="data-check-title">
|
||||
<el-form :model='formContent'>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-form :model='formContent' label-width="auto" class="form-three ">
|
||||
<el-form-item label="检测脚本">
|
||||
<el-input v-model='testScriptName' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="误差体系:" >
|
||||
<el-form-item label="误差体系">
|
||||
<el-input v-model='errorSysName' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="数据处理原则:" >
|
||||
<el-form-item label="数据原则">
|
||||
<el-input v-model='dataRule' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称:" >
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model='deviceName' :disabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label='复检次数:'>
|
||||
<el-select v-model="reCheckIdx">
|
||||
<el-option
|
||||
@@ -37,47 +27,43 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='通道号:'>
|
||||
</el-col> -->
|
||||
<el-form-item label='通道号'>
|
||||
<el-select v-model="monitorIdx">
|
||||
<el-option
|
||||
v-for="item in monitorIdxList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
/>
|
||||
<el-option v-for="item in monitorIdxList" :key="item.value" :label="item.value"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="data-check-content">
|
||||
<div class="content-left-tree">
|
||||
<div class="content-left-tree-switch">
|
||||
<el-switch
|
||||
<!-- <el-switch
|
||||
v-model="scriptSwitch"
|
||||
class="ml-2"
|
||||
inline-prompt
|
||||
style="--el-switch-on-color: #003078; --el-switch-off-color: #5a79a9"
|
||||
active-text="不合格测试项"
|
||||
inactive-text="全部测试项"
|
||||
/>
|
||||
/> -->
|
||||
<el-radio-group v-model="scriptSwitch">
|
||||
<el-radio-button label="不合格测试项" value="0" />
|
||||
<el-radio-button label="全部测试项" value="1" />
|
||||
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div>
|
||||
<el-tree
|
||||
:default-expanded-keys="['0','0-1','0-2','0-3','1']"
|
||||
node-key="id"
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
<div class="content-tree">
|
||||
<el-tree :default-expanded-keys="['0', '0-1', '0-2', '0-3', '1']" node-key="id" :data="data"
|
||||
:props="defaultProps" @node-click="handleNodeClick" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-right">
|
||||
<div class="content-right-title">
|
||||
<el-divider >当前检测项目:</el-divider>
|
||||
<!-- <el-divider>当前检测项目:</el-divider> -->
|
||||
<div>
|
||||
当前检测项目
|
||||
</div>
|
||||
<span>{{ currentScriptDsc }}</span>
|
||||
</div>
|
||||
<div class="content-right-Tabs">
|
||||
@@ -114,16 +100,16 @@ import { type Monitor } from '@/api/device/interface/monitor'
|
||||
import { data } from "@/api/plan/autoTest.json";
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
|
||||
const formContent = ref({})
|
||||
const activeName = ref('rawDataTab')
|
||||
const deviceName = ref('被检设备1');
|
||||
const deviceName = ref('240001');
|
||||
const monitorIdx = ref('1');
|
||||
const reCheckIdx = ref('3');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const scriptSwitch = ref("0");
|
||||
const currentScriptDsc = ref('电压准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
@@ -159,7 +145,7 @@ const monitorIdxList = [
|
||||
},
|
||||
]
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
@@ -185,7 +171,6 @@ const props = defineProps<{
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.data-check-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -200,23 +185,45 @@ const props = defineProps<{
|
||||
|
||||
.data-check-content {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/* flex-direction: row; */
|
||||
}
|
||||
|
||||
.content-left-tree {
|
||||
width: 20%;
|
||||
max-height: 475px;
|
||||
overflow-y: auto;
|
||||
width: 240px;
|
||||
max-height: 445px;
|
||||
/* overflow-y: auto; */
|
||||
padding: 10px 0;
|
||||
border: 1px solid #ccc;
|
||||
/* background-color: gray; */
|
||||
}
|
||||
|
||||
.content-tree {
|
||||
max-height: 405px;
|
||||
margin-top: 10px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.content-left-tree-switch {
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.content-right {
|
||||
margin-left: 20px;
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.content-right-Tabs {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
:deep(.el-divider--horizontal) {
|
||||
margin: 15px 0;
|
||||
}
|
||||
.content-right-title{
|
||||
div{
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,177 +1,63 @@
|
||||
<template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" height="310px" style="width: 100%" >
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="updateTime" label="数据时间" />
|
||||
<el-table-column prop="L1" label="L1(V)" />
|
||||
<el-table-column prop="L2" label="L2(V)" />
|
||||
<el-table-column prop="L3" label="L3(V)" />
|
||||
|
||||
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
|
||||
<div class="table-main">
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }" height="315px"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||
<el-table-column prop="time" label="数据时间"/>
|
||||
<template v-if="!isThreePhase && phaseT === 0">
|
||||
<el-table-column prop="dataA" :label="'A相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataB" :label="'B相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
<template v-if="!isThreePhase && phaseT === 1">
|
||||
<el-table-column prop="dataT" :label="tableHeader+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
<template v-if="isThreePhase">
|
||||
<el-table-column prop="dataB" :label="'负序不平衡度'+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const tableData = ref([
|
||||
{
|
||||
id: 1,
|
||||
updateTime: "2024-10-10 09:30:00",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
updateTime: "2024-10-10 09:30:03",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
updateTime: "2024-10-10 09:30:06",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
updateTime: "2024-10-10 09:30:09",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
updateTime: "2024-10-10 09:30:12",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
updateTime: "2024-10-10 09:30:15",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
updateTime: "2024-10-10 09:30:18",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
updateTime: "2024-10-10 09:30:21",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
updateTime: "2024-10-10 09:30:24",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
updateTime: "2024-10-10 09:30:27",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
updateTime: "2024-10-10 09:30:30",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
updateTime: "2024-10-10 09:30:33",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
updateTime: "2024-10-10 09:30:36",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
updateTime: "2024-10-10 09:30:39",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
updateTime: "2024-10-10 09:30:42",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
updateTime: "2024-10-10 09:30:45",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 17,
|
||||
updateTime: "2024-10-10 09:30:48",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 18,
|
||||
updateTime: "2024-10-10 09:30:51",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 19,
|
||||
updateTime: "2024-10-10 09:30:54",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
updateTime: "2024-10-10 09:30:57",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
])
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {computed} from "vue";
|
||||
|
||||
const {tableData, currentScriptTypeName} = defineProps<{
|
||||
tableData: CheckData.RawDataItem[]
|
||||
currentScriptTypeName: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['exportRawDataHandler'])
|
||||
|
||||
const unit = computed(() => {
|
||||
return tableData.length > 0 ? tableData[0].unit : '';
|
||||
})
|
||||
|
||||
const phaseT = computed(() => {
|
||||
return tableData[0].dataT == '/' ? 0 : 1
|
||||
})
|
||||
|
||||
const tableHeader = computed(() => {
|
||||
if (phaseT.value === 1) {
|
||||
let index = currentScriptTypeName.indexOf('=');
|
||||
return currentScriptTypeName.substring(0, index);
|
||||
}
|
||||
return currentScriptTypeName
|
||||
})
|
||||
|
||||
const isThreePhase = computed(() => {
|
||||
return currentScriptTypeName.includes('三相电压不平衡度') || currentScriptTypeName.includes('三相电流不平衡度')
|
||||
})
|
||||
|
||||
const exportData = () => {
|
||||
emit('exportRawDataHandler')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.table-container {
|
||||
max-height: 320px; /* 根据需要调整高度 */
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
</style>
|
||||
@@ -1,75 +1,134 @@
|
||||
<template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" max-height="300" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="standardValue" label="标准值(V)" />
|
||||
|
||||
<el-table-column label="L1(V)" >
|
||||
<el-table-column prop="L1" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L1_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="L2(V)" >
|
||||
<el-table-column prop="L2" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L2_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="L3(V)" >
|
||||
<el-table-column prop="L3" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L3_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="maxErrVaule" label="最大误差(V)">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="Result" label="检测结果">
|
||||
<div class="table-main">
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" height="357px" :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }">
|
||||
<!-- <el-table-column prop="chnNum" label="通道号" width="80">-->
|
||||
<!-- <template #default="{row}">-->
|
||||
<!-- {{ '通道' + row.chnNum }}-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column label="A相">
|
||||
<el-table-column prop="stdA" width="105" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataA" width="105" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataA" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag>
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
误差范围:{{ scope.row.maxErrorA }} <br/>
|
||||
误差值:{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.isDataA === 4">/</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="B相">
|
||||
<el-table-column prop="stdB" width="105" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataB" width="105" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataB" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
误差范围:{{ scope.row.maxErrorB }}<br/>
|
||||
误差值:{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.isDataB === 4">/</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="C相">
|
||||
<el-table-column prop="stdC" width="105" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataC" width="105" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataC" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
误差范围: {{ scope.row.maxErrorC }}<br/>
|
||||
误差值:{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.isDataC === 4">/</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
<template v-if="phaseT === 1">
|
||||
<el-table-column :label="tableHeader">
|
||||
<el-table-column prop="stdT" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataT" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataT" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
误差范围: {{ scope.row.maxErrorT }}<br/>
|
||||
误差值:{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.isDataT === 4">/</el-tag>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="maxError" label="误差范围"/>-->
|
||||
<!-- <el-table-column prop="result" label="检测结果">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <span v-if="scope.row.result === 1">符合</span>-->
|
||||
<!-- <el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>-->
|
||||
<!-- <span v-if="scope.row.result === 4">/</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</template>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {defineProps} from 'vue';
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
|
||||
const tableData = ref([
|
||||
{
|
||||
id: '1',
|
||||
standardValue: 57.74,
|
||||
L1:57.73,
|
||||
L1_errValue: 0.01,
|
||||
L2:57.73,
|
||||
L2_errValue: 0.01,
|
||||
L3:57.73,
|
||||
L3_errValue: 0.01,
|
||||
maxErrVaule: 0.05774,
|
||||
Result: '合格',
|
||||
},
|
||||
const {tableData, currentScriptTypeName} = defineProps<{
|
||||
tableData: CheckData.CheckResult[],
|
||||
currentScriptTypeName: string
|
||||
}>();
|
||||
|
||||
])
|
||||
|
||||
const unit = computed(() => {
|
||||
return tableData.length > 0 ? tableData[0].unit : '';
|
||||
})
|
||||
|
||||
const phaseT = computed(() => {
|
||||
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
|
||||
})
|
||||
|
||||
const tableHeader = computed(() => {
|
||||
if (phaseT.value === 1){
|
||||
let index = currentScriptTypeName.indexOf('=');
|
||||
return currentScriptTypeName.substring(0, index);
|
||||
}
|
||||
return currentScriptTypeName
|
||||
})
|
||||
|
||||
// const maxErrorStr = computed((data) => {
|
||||
// let result = tableData[0].maxError ?? '/'
|
||||
// let idx = result.indexOf('~');
|
||||
// if (idx > 0) {
|
||||
// result = result.substring(0, idx) + unit.value + result.substring(idx, result.length) + unit.value;
|
||||
// }
|
||||
// return result;
|
||||
// })
|
||||
|
||||
</script>
|
||||
|
||||
@@ -80,18 +139,22 @@ display: flex;
|
||||
flex-direction: row; /* 横向排列 */
|
||||
flex-wrap: wrap; /* 允许换行 */
|
||||
}
|
||||
|
||||
.form-grid .el-form-item {
|
||||
flex: 1 1 30%; /* 控件宽度 */
|
||||
margin-right: 20px; /* 控件间距 */
|
||||
}
|
||||
|
||||
.form-grid .el-form-item:last-child {
|
||||
margin-right: 0; /* 最后一个控件不需要右边距 */
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
|
||||
}
|
||||
|
||||
.el-tabs {
|
||||
margin-bottom: 20px; /* 添加底部边距 */
|
||||
}
|
||||
@@ -100,9 +163,4 @@ margin-bottom: 20px; /* 添加底部边距 */
|
||||
text-align: center; /* 所有单元格文字居中 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
max-height: 400px; /* 根据需要调整高度 */
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
</style>
|
||||
@@ -1,36 +1,95 @@
|
||||
<template>
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig" width="950px">
|
||||
<el-dialog :append-to-body="appendToBody" class="dialog" title="数据查询" :model-value='visible' @close="close"
|
||||
v-bind="dialogBig" :draggable="false">
|
||||
<div class="data-check-dialog">
|
||||
<div class="data-check-title">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-form-item label='通道号:'>
|
||||
<el-select v-model="monitorIdx">
|
||||
<div class="data-check-head">
|
||||
<el-form :model='formContent' label-width="auto" class="form-three ">
|
||||
<el-form-item label="检测脚本">
|
||||
<el-input v-model='formContent.scriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系">
|
||||
<el-select v-model="formContent.errorSysId" placeholder="请选择误差体系" autocomplete="off" :disabled="checkStore.showDetailType===0">
|
||||
<el-option
|
||||
v-for="item in monitorIdxList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
/>
|
||||
v-for="(option) in pqErrorList"
|
||||
:key="option.id"
|
||||
:label="option.name"
|
||||
:value="option.id"/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="数据原则">
|
||||
<el-input v-model='formContent.dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model='formContent.deviceName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='通道号'>
|
||||
<el-select v-model="formContent.chnNum">
|
||||
<el-option v-for="item in chnList" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label=" ">
|
||||
<el-button type="primary" :icon="Postcard" v-if="checkStore.showDetailType===1" @click="handleGenerateReport">报告生成</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="data-check-content">
|
||||
|
||||
<div class="data-check-body">
|
||||
<div class="content-left-tree">
|
||||
<div style="width: 99%;">
|
||||
<el-input
|
||||
placeholder='请输入测试项名称'
|
||||
clearable
|
||||
v-model='searchValue'
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="content-tree">
|
||||
<el-tree :filter-node-method='filterNode' :highlight-current="true" :default-expanded-keys="defaultExpandedKeys"
|
||||
node-key="index"
|
||||
:data="treeDataAll"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick" class="custom-tree" ref="treeRef">
|
||||
<template #default="{ node, data }">
|
||||
<el-tooltip effect="dark" :content="data.scriptTypeName" placement="top">
|
||||
<span class="custom-tree-node" :style="data.fly===2? 'color: #F56C6C;':data.fly===4? 'color: #e6a23c;':''">{{
|
||||
data.scriptTypeName
|
||||
}}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-right">
|
||||
<div class="content-right-title">
|
||||
<el-divider >当前检测项目:</el-divider>
|
||||
<span>{{currentScriptDsc}}</span>
|
||||
<div style="width: 750px;">
|
||||
<span class="content-right-title-text">当前检测项目:
|
||||
<el-popover trigger="hover" :content="currentDesc" :width="popoverWidth" placement="right">
|
||||
<template #reference>
|
||||
<el-button type="text" style="font-size: 14px;">
|
||||
{{ currentScriptTypeName }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popover>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 210px;" v-if="harmNumList.length" label='次数'>-->
|
||||
<!-- <el-select v-model="currentHarmNum">-->
|
||||
<!-- <el-option v-for="item in harmNumList" :key="item.value" :label="item.label" :value="item.value"/>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 230px;" v-if="checkList.length" label='测试项'>
|
||||
<el-select v-model="currentCheckItem">
|
||||
<el-option v-for="item in checkList" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="content-right-Tabs">
|
||||
<el-tabs type="border-card" v-model="activeName">
|
||||
<el-tabs type="border-card" v-model="activeTab">
|
||||
<el-tab-pane label="检测结果" name="resultTab">
|
||||
<DataCheckResultTable></DataCheckResultTable>
|
||||
<DataCheckResultTable :tableData="checkResultData" :currentScriptTypeName="currentScriptTypeName"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="原始数据" name="rawDataTab">
|
||||
<DataCheckRawDataTable></DataCheckRawDataTable>
|
||||
<DataCheckRawDataTable :tableData="rawTableData" :currentScriptTypeName="currentScriptTypeName" @exportRawDataHandler="exportRawDataHandler"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -41,111 +100,683 @@
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
|
||||
import IPAddress from '@/components/IpAddress/index.vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { addPqDev, updatePqDev } from '@/api/device/device'
|
||||
import { computed, reactive, type Ref, ref } from 'vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
import { getPqMonList } from '@/api/device/monitor'
|
||||
import { type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { type Monitor } from '@/api/device/interface/monitor'
|
||||
import { data } from "@/api/plan/autoTest.json";
|
||||
import {reactive, ref, watch} from 'vue'
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {useDictStore} from "@/stores/modules/dict";
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import {exportRawData, getFormData, getTableData, getTreeData} from "@/api/check/test";
|
||||
import {getPqErrSysList} from '@/api/plan/plan'
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {Postcard} from "@element-plus/icons-vue";
|
||||
|
||||
const {appendToBody} = withDefaults(defineProps<{
|
||||
appendToBody: boolean
|
||||
}>(), {appendToBody: true})
|
||||
|
||||
const activeName = ref('rawDataTab')
|
||||
const deviceName = ref('被检设备1');
|
||||
const monitorIdx = ref('1');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
label: "scriptTypeName",
|
||||
children: "children",
|
||||
label: "name",
|
||||
pid: "pid",
|
||||
};
|
||||
|
||||
const monitorIdxList = [
|
||||
{
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
},
|
||||
]
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
const checkStore = useCheckStore()
|
||||
|
||||
const visible = ref(false)
|
||||
const treeRef = ref()
|
||||
const searchValue = ref<string>('')
|
||||
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
|
||||
watch(searchValue, (val) => {
|
||||
treeRef.value!.filter(val)
|
||||
})
|
||||
|
||||
// 格式化数字
|
||||
const fixed = 4;
|
||||
|
||||
// 表单数据
|
||||
const formContent = reactive<CheckData.DataCheck>({
|
||||
scriptName: '',
|
||||
errorSysId: '',
|
||||
dataRule: '',
|
||||
deviceName: '',
|
||||
chnNum: '',
|
||||
})
|
||||
// 当前选中的谐波次数
|
||||
// const currentHarmNum = ref<string>("-1")
|
||||
// 谐波次数列表
|
||||
// const harmNumList = reactive<{ value: string, label: string }[]>([])
|
||||
// 当前选中的检测项
|
||||
const currentCheckItem = ref<string>("")
|
||||
// 检测项列表
|
||||
const checkList = reactive<{ value: string, label: string }[]>([])
|
||||
|
||||
let deviceId: string = ''
|
||||
let originScriptType: string | null = null
|
||||
let scriptType: string | null = null
|
||||
|
||||
// 通道下拉列表
|
||||
let chnList: any[] = []
|
||||
|
||||
|
||||
// 左侧树数据
|
||||
const treeDataAll = reactive<CheckData.TreeItem[]>([])
|
||||
|
||||
// 左侧树被选中的叶子节点id
|
||||
const checkIndex = ref<string>('')
|
||||
|
||||
// 当前检测项目名称
|
||||
const currentScriptTypeName = ref('')
|
||||
// 当前检测项目描述
|
||||
const currentDesc = ref('');
|
||||
// 右侧Tab选中项
|
||||
const activeTab = ref<string>('resultTab')
|
||||
|
||||
//存放相应的表格数据
|
||||
let resTableData: { resultData: Map<string, any>, rawData: Map<string, any> } = {resultData: new Map(), rawData: new Map()}
|
||||
|
||||
// 检测结果表格数据
|
||||
const checkResultData = reactive<CheckData.CheckResult[]>([])
|
||||
|
||||
const popoverWidth: ComputedRef<string> = computed(() => {
|
||||
// return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (harmNumList.length || checkList.length ? 160 : 0)}px`
|
||||
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 220 : 0)}px`
|
||||
})
|
||||
|
||||
|
||||
// 原始数据表格数据
|
||||
const rawTableData = reactive<CheckData.RawDataItem[]>([])
|
||||
|
||||
// 左侧树默认展开节点id
|
||||
let defaultExpandedKeys: string[] = []
|
||||
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true
|
||||
return data.scriptTypeName.includes(value)
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
// 点击左侧树节点触发事件
|
||||
const handleNodeClick = async (data: any) => {
|
||||
if (!data.children) {
|
||||
checkIndex.value = data.index
|
||||
currentScriptTypeName.value = data.scriptTypeName
|
||||
currentDesc.value = data.sourceDesc
|
||||
scriptType = data.scriptType ?? scriptType
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
console.log("点击左侧树节点触发事件handleNodeClick", checkIndex.value)
|
||||
if (checkIndex.value !== '') {
|
||||
await updateTableData()
|
||||
activeTab.value = 'resultTab'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
watch(() => formContent.errorSysId, async (newVal, oldVal) => {
|
||||
if (newVal != '') {
|
||||
console.log("切换误差体系");
|
||||
formContent.chnNum = chnList[0].value
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => formContent.chnNum, async (newVal, oldVal) => {
|
||||
// console.log("通道号", newVal);
|
||||
|
||||
if (newVal != '') {
|
||||
// 发起请求,查询该测试项的检测结果
|
||||
const {data: resTreeDataTemp}: { data: CheckData.TreeItem[] } = await getTreeData({
|
||||
scriptId: checkStore.plan.scriptId,
|
||||
devId: deviceId,
|
||||
devNum: formContent.chnNum + '',
|
||||
scriptType: originScriptType,
|
||||
code: parseInt(checkStore.plan.code)
|
||||
})
|
||||
updateTreeFly(resTreeDataTemp, 4)
|
||||
updateTreeFly(resTreeDataTemp, 2)
|
||||
|
||||
treeDataAll.length = 0
|
||||
|
||||
Object.assign(treeDataAll, resTreeDataTemp)
|
||||
|
||||
defaultOperate()
|
||||
await updateTableData()
|
||||
}
|
||||
activeTab.value = 'resultTab'
|
||||
})
|
||||
|
||||
|
||||
// watch(currentHarmNum, (newVal, oldVal) => {
|
||||
// console.log("谐波次数", newVal);
|
||||
// if (newVal !== '-1') {
|
||||
// let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal.toString())
|
||||
// setCheckResultData(resCheckResult)
|
||||
//
|
||||
// let tempRawData = resTableData.rawData.get(newVal.toString())
|
||||
// if (tempRawData) {
|
||||
// setRawData(tempRawData)
|
||||
// } else {
|
||||
// setRawData([])
|
||||
// }
|
||||
// }
|
||||
// activeTab.value = 'resultTab'
|
||||
// })
|
||||
|
||||
|
||||
watch(currentCheckItem, (newVal, oldVal) => {
|
||||
console.log("当前检测项", newVal);
|
||||
if (newVal !== '') {
|
||||
doCurrentCheckItemUpdate(newVal)
|
||||
} else {
|
||||
activeTab.value = 'resultTab'
|
||||
}
|
||||
})
|
||||
|
||||
// 默认操作
|
||||
const defaultOperate = () => {
|
||||
let node = getDefaultNode(treeDataAll)
|
||||
|
||||
if (node) {
|
||||
currentScriptTypeName.value = node.scriptTypeName
|
||||
currentDesc.value = node.sourceDesc
|
||||
checkIndex.value = node.index
|
||||
defaultExpandedKeys = [node.index]
|
||||
|
||||
treeRef.value?.setCurrentKey(node.index);
|
||||
scriptType = node.scriptType ?? scriptType
|
||||
} else {
|
||||
currentScriptTypeName.value = ''
|
||||
currentDesc.value = ''
|
||||
checkIndex.value = ''
|
||||
defaultExpandedKeys = []
|
||||
}
|
||||
}
|
||||
|
||||
const updateTableData = async () => {
|
||||
console.log("左侧树被选中的叶子节点checkIndex", checkIndex.value);
|
||||
if (checkIndex.value !== '') {
|
||||
// console.log("更新表格数据");
|
||||
// 发起请求,查询该测试项的检测结果
|
||||
const {data} = await getTableData({
|
||||
scriptType,
|
||||
scriptId: checkStore.plan.scriptId,
|
||||
devId: deviceId,
|
||||
devNum: formContent.chnNum + '',
|
||||
code: parseInt(checkStore.plan.code),
|
||||
index: parseInt(checkIndex.value),
|
||||
})
|
||||
|
||||
let keys1 = Object.keys(data.resultData)
|
||||
let resultData = new Map()
|
||||
for (let key of keys1) {
|
||||
resultData.set(key, data.resultData[key])
|
||||
}
|
||||
|
||||
let keys2 = Object.keys(data.rawData)
|
||||
let rawData = new Map()
|
||||
for (let key of keys2) {
|
||||
rawData.set(key, data.rawData[key])
|
||||
}
|
||||
|
||||
resTableData = {
|
||||
resultData,
|
||||
rawData
|
||||
}
|
||||
|
||||
let resCheckResult: CheckData.ResCheckResult = {}
|
||||
let resRawData: CheckData.RawDataItem[] = []
|
||||
|
||||
if (keys1.length === 0) {
|
||||
checkList.length = 0
|
||||
checkResultData.length = 0
|
||||
rawTableData.length = 0
|
||||
currentCheckItem.value = ''
|
||||
}
|
||||
|
||||
if (keys1.length === 1) {
|
||||
resCheckResult = resTableData.resultData.get(keys1[0])
|
||||
resRawData = resTableData.rawData.get(keys2[0])
|
||||
|
||||
resRawData = (resRawData == null || resRawData == undefined ? [] : resRawData)
|
||||
resCheckResult = (resCheckResult == null || resCheckResult == undefined ? {} : resCheckResult)
|
||||
setCheckResultData(resCheckResult)
|
||||
setRawData(resRawData)
|
||||
checkList.length = 0
|
||||
checkList.push({value: keys1[0], label: resCheckResult.isData === 1? `${keys1[0]}`:resCheckResult.isData === 4? `${keys1[0]}(/)` :`${keys1[0]}(不符合)`})
|
||||
if (currentCheckItem.value == checkList[0].value) {
|
||||
doCurrentCheckItemUpdate(checkList[0].value)
|
||||
} else {
|
||||
currentCheckItem.value = checkList[0].value
|
||||
}
|
||||
} else if (keys1.length != 0) {
|
||||
let tempCheckList = []
|
||||
for (let [key, value] of resTableData.resultData) {
|
||||
let hum = formatHarmNum(key)
|
||||
tempCheckList.push({
|
||||
value: key,
|
||||
label: value.isData === 1 ? hum : value.isData === 4 ? `${hum}(/)` : `${hum}(不符合)`
|
||||
})
|
||||
}
|
||||
|
||||
toAngleLast(tempCheckList)
|
||||
checkList.length = 0
|
||||
Object.assign(checkList, tempCheckList)
|
||||
|
||||
if (currentCheckItem.value == tempCheckList[0].value) {
|
||||
doCurrentCheckItemUpdate(tempCheckList[0].value)
|
||||
} else {
|
||||
currentCheckItem.value = tempCheckList[0].value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// setCheckResultData(resCheckResult)
|
||||
else {
|
||||
checkResultData.length = 0
|
||||
rawTableData.length = 0
|
||||
}
|
||||
}
|
||||
|
||||
const doCurrentCheckItemUpdate = (newVal: string) => {
|
||||
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal)
|
||||
setCheckResultData(resCheckResult)
|
||||
|
||||
let tempRawData = resTableData.rawData.get(newVal)
|
||||
if (tempRawData) {
|
||||
setRawData(tempRawData)
|
||||
} else {
|
||||
setRawData([])
|
||||
}
|
||||
|
||||
activeTab.value = 'resultTab'
|
||||
}
|
||||
|
||||
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
|
||||
deviceId = _deviceId
|
||||
originScriptType = _scriptType
|
||||
scriptType = _scriptType
|
||||
|
||||
// 发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号
|
||||
const {data: resFormContent}: { data: any } = await getFormData({
|
||||
planId: checkStore.plan.id,
|
||||
deviceId,
|
||||
chnNum,
|
||||
scriptType
|
||||
})
|
||||
|
||||
chnList = resFormContent.chnList.map((item: { value: string, label: string }) => ({
|
||||
value: item.value,
|
||||
label: item.value
|
||||
//label: item.label == '1' ? `${item.value}` : item.label == '2' ? `${item.value}(不符合)` : `${item.value}`
|
||||
}))
|
||||
|
||||
let dataRuleName = dictStore.getDictData('Data_Rule').find(item => item.id == resFormContent.dataRule)?.name
|
||||
|
||||
Object.assign(formContent, {
|
||||
...resFormContent,
|
||||
dataRule: dataRuleName,
|
||||
chnNum: chnList.length > 0 ? chnList[0].value : '',
|
||||
})
|
||||
|
||||
pqErrorList.length = 0
|
||||
let {data: resPqErrorList} = await getPqErrSysList()
|
||||
Object.assign(pqErrorList, resPqErrorList)
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
const handleGenerateReport = () => {
|
||||
console.log("生成报告", checkStore.plan.id, deviceId)
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
//数据清空
|
||||
Object.assign(formContent, {
|
||||
scriptName: '',
|
||||
errorSysName: '',
|
||||
dataRule: '',
|
||||
deviceName: '',
|
||||
chnNum: '',
|
||||
})
|
||||
treeDataAll.length = 0
|
||||
// harmNumList.length = 0
|
||||
// currentHarmNum.value = '-1'
|
||||
currentCheckItem.value = ''
|
||||
checkResultData.length = 0
|
||||
rawTableData.length = 0
|
||||
checkList.length = 0
|
||||
defaultExpandedKeys = []
|
||||
checkIndex.value = ''
|
||||
activeTab.value = 'resultTab'
|
||||
currentScriptTypeName.value = ''
|
||||
currentDesc.value = ''
|
||||
pqErrorList.length = 0
|
||||
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const setCheckResultData = (data: CheckData.ResCheckResult | null) => {
|
||||
// console.log("检测结果", data);
|
||||
let result: CheckData.CheckResult[] = []
|
||||
if (data == null || data == undefined) {
|
||||
Object.assign(checkResultData, [])
|
||||
return
|
||||
}
|
||||
if (data.dataA != null && data.dataB != null && data.dataC != null) {
|
||||
result.push({
|
||||
stdA: numberToFixed(data.dataA.resultData),
|
||||
dataA: numberToFixed(data.dataA.data),
|
||||
errorA: getError(data.dataA.resultData, data.dataA.data),
|
||||
maxErrorA: toMaxErrorStr(data.dataA.radius, data.unit),
|
||||
isDataA: data.dataA.isData,
|
||||
stdB: numberToFixed(data.dataB.resultData),
|
||||
dataB: numberToFixed(data.dataB.data),
|
||||
errorB: getError(data.dataB.resultData, data.dataB.data),
|
||||
maxErrorB: toMaxErrorStr(data.dataB.radius, data.unit),
|
||||
isDataB: data.dataB.isData,
|
||||
stdC: numberToFixed(data.dataC.resultData),
|
||||
dataC: numberToFixed(data.dataC.data),
|
||||
errorC: getError(data.dataC.resultData, data.dataC.data),
|
||||
maxErrorC: toMaxErrorStr(data.dataC.radius, data.unit),
|
||||
isDataC: data.dataC.isData,
|
||||
|
||||
maxError: data.radius,
|
||||
unit: data.unit,
|
||||
result: data.isData,
|
||||
})
|
||||
}
|
||||
|
||||
if (data.dataT != null) {
|
||||
result.push({
|
||||
stdT: numberToFixed(data.dataT.resultData),
|
||||
dataT: numberToFixed(data.dataT.data),
|
||||
errorT: getError(data.dataT.resultData, data.dataT.data),
|
||||
maxErrorT: toMaxErrorStr(data.dataT.radius, data.unit),
|
||||
isDataT: data.dataT?.isData,
|
||||
|
||||
maxError: data.radius,
|
||||
unit: data.unit,
|
||||
result: data.isData,
|
||||
})
|
||||
}
|
||||
Object.assign(checkResultData, result)
|
||||
}
|
||||
|
||||
const exportRawDataHandler = () => {
|
||||
useDownload(exportRawData, '原始数据.xlsx', {
|
||||
scriptType,
|
||||
scriptId: checkStore.plan.scriptId,
|
||||
devId: deviceId,
|
||||
devNum: formContent.chnNum + '',
|
||||
code: parseInt(checkStore.plan.code),
|
||||
index: parseInt(checkIndex.value),
|
||||
}, false, '.xlsx')
|
||||
}
|
||||
|
||||
const formatHarmNum = (num: string) => {
|
||||
// debugger
|
||||
if (num.includes('.5')) {
|
||||
return num
|
||||
} else {
|
||||
num = num.replace('.0', '')
|
||||
return num
|
||||
}
|
||||
}
|
||||
|
||||
const setRawData = (data: CheckData.RawDataItem[]) => {
|
||||
data.forEach((item: CheckData.RawDataItem) => {
|
||||
item.dataA = stringToFixed(item.dataA)
|
||||
item.dataB = stringToFixed(item.dataB)
|
||||
item.dataC = stringToFixed(item.dataC)
|
||||
item.dataT = stringToFixed(item.dataT)
|
||||
})
|
||||
rawTableData.length = 0
|
||||
Object.assign(rawTableData, data)
|
||||
console.log("原始数据", rawTableData)
|
||||
}
|
||||
|
||||
const numberToFixed = (num: number): string => {
|
||||
if (num == null || num == undefined) {
|
||||
return '/'
|
||||
} else {
|
||||
let result = num.toFixed(fixed)
|
||||
if (result === "-0.0000") {
|
||||
return result.replace(/-/g, "")
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
const stringToFixed = (str: string): string => {
|
||||
if (str == null || str == undefined) {
|
||||
return '/'
|
||||
} else {
|
||||
let num = Number(str)
|
||||
if (isNaN(num)) {
|
||||
return '/'
|
||||
} else {
|
||||
let result = num.toFixed(fixed)
|
||||
if (result === "-0.0000") {
|
||||
return result.replace(/-/g, "")
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const getError = (num1: number, num2: number): string => {
|
||||
if (num1 == null || num1 == undefined || num2 == null || num2 == undefined) {
|
||||
return '/'
|
||||
}
|
||||
return Math.abs(Number(numberToFixed(num1)) - Number(numberToFixed(num2))).toFixed(fixed)
|
||||
}
|
||||
|
||||
const toMaxErrorStr = (oldMaxErroe: any, unit: any) => {
|
||||
let result = oldMaxErroe ?? '/'
|
||||
let idx = result.indexOf('~');
|
||||
if (idx > 0) {
|
||||
let left = result.substring(0, idx)
|
||||
let right = result.substring(idx, result.length)
|
||||
result = left + unit + right + unit;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const findFirstLeafNode = (node: any): any => {
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return node;
|
||||
}
|
||||
|
||||
return findFirstLeafNode(node.children[0]);
|
||||
}
|
||||
const getDefaultNode = (data: any[]) => {
|
||||
if (!data || data.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const firstElement = data[0];
|
||||
|
||||
return findFirstLeafNode(firstElement);
|
||||
}
|
||||
|
||||
const toAngleLast = (data: any[]) => {
|
||||
let angleIndex = -1
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].value.toString().includes('相角')) {
|
||||
angleIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
if (angleIndex != -1) {
|
||||
let temp = data[angleIndex]
|
||||
data.splice(angleIndex, 1)
|
||||
data.push(temp)
|
||||
}
|
||||
}
|
||||
|
||||
// fly: 1合格 2不合格 4数据错误
|
||||
const filterTree = (treeData: any[], fly: number): any[] => {
|
||||
if (!treeData || treeData.length === 0) {
|
||||
return []
|
||||
}
|
||||
filter(treeData, fly)
|
||||
return treeData
|
||||
}
|
||||
|
||||
const filter = (treeData: any[], fly: number) => {
|
||||
for (let i = treeData.length - 1; i >= 0; i--) {
|
||||
let node = treeData[i]
|
||||
if (node.fly !== fly) {
|
||||
if (node.children && node.children.length > 0) {
|
||||
filter(node.children, fly)
|
||||
// 检查 children 是否被全部移除
|
||||
if (node.children.length === 0) {
|
||||
treeData.splice(i, 1);
|
||||
}
|
||||
} else {
|
||||
treeData.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const updateTreeFly = (treeData: any[], fly: number) => {
|
||||
// 递归函数
|
||||
function recursiveUpdate(node: any, targetFly: number) {
|
||||
//if (!node) return false; // 如果节点不存在,返回 false
|
||||
|
||||
// 如果当前节点是叶子节点且 fly 字段等于 targetFly
|
||||
if (!node.children || node.children.length === 0) {
|
||||
if (node.fly === targetFly) {
|
||||
node.fly = targetFly; // 确保叶子节点的 fly 字段被设置为 targetFly
|
||||
return true; // 返回 true 表示找到并更新了
|
||||
}
|
||||
return false; // 否则返回 false
|
||||
}
|
||||
|
||||
// 递归更新子节点
|
||||
let updated = false;
|
||||
for (let child of node.children) {
|
||||
if (recursiveUpdate(child, targetFly)) {
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果有子节点被更新了,则更新当前节点的 fly 字段
|
||||
if (updated) {
|
||||
node.fly = targetFly;
|
||||
}
|
||||
return updated;
|
||||
}
|
||||
|
||||
for (let i = 0; i < treeData.length; i++) {
|
||||
// 调用递归函数从根节点开始更新
|
||||
recursiveUpdate(treeData[i], fly);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
|
||||
|
||||
.data-check-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
overflow-y: hidden;
|
||||
|
||||
.data-check-title{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.data-check-content{
|
||||
.data-check-head {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.data-check-body {
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.content-left-tree {
|
||||
width: 18%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
max-height: 495px;
|
||||
|
||||
padding: 10px 0.5% 0px 0.5%;
|
||||
border: 1px solid #ccc;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
|
||||
.content-tree {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-top: 10px;
|
||||
|
||||
.custom-tree-node {
|
||||
overflow-x: hidden !important;
|
||||
white-space: nowrap !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-right {
|
||||
width: 100%;
|
||||
}
|
||||
width: 82%;
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
|
||||
.content-right-title {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
padding: 10px 0;
|
||||
margin-top: 10px;
|
||||
line-height: 1.5;
|
||||
|
||||
.content-right-title-text {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
//.el-divider--horizontal {
|
||||
// //margin-top: 0px;
|
||||
// margin-bottom: 5px;
|
||||
// height: 20px;
|
||||
//}
|
||||
|
||||
//.content-right-title-desc {
|
||||
// font-size: 16px;
|
||||
// height: 48px;
|
||||
// max-height: 48px;
|
||||
// overflow-y: auto;
|
||||
//}
|
||||
}
|
||||
|
||||
.content-right-Tabs {
|
||||
box-sizing: border-box;
|
||||
margin-top: 20px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
max-height: 400px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!--<style lang="scss">-->
|
||||
<!--.el-popover.popover-class {-->
|
||||
<!-- .el-popover__title {-->
|
||||
<!-- color: #fff;-->
|
||||
<!-- background-color: #003078 !important;-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
||||
814
frontend/src/views/home/components/factorTest.vue
Normal file
814
frontend/src/views/home/components/factorTest.vue
Normal file
@@ -0,0 +1,814 @@
|
||||
<template>
|
||||
<div class="dialog" v-bind="dialogBig">
|
||||
<div class="dialog-content">
|
||||
<div class="right-title">
|
||||
<!-- <div>系数校准表</div> -->
|
||||
<div>{{ outputDsc }}</div>
|
||||
<div>
|
||||
<span style=" font-size: 18px;font-weight: 600;">
|
||||
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">{{ total }}</span>
|
||||
台
|
||||
</span>
|
||||
<!-- <el-button type="primary" loading
|
||||
v-if="activeIndex > 0 && activeIndex < activeTotalNum">通道系数已校准3台/共3台</el-button>
|
||||
<el-button type="primary" :disabled="true" v-if="activeIndex === activeTotalNum">通道系数已校准3台/共3台</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="dialog-left">
|
||||
<el-steps direction="vertical" :active="active" :process-status="currentStepStatus" finish-status="success">
|
||||
<el-step title="开始"/>
|
||||
<el-step>
|
||||
<template #title>
|
||||
<span>大电压/电流系数下装</span><br/>
|
||||
<span class="spanStyle">源输出为:</span><br/>
|
||||
<span class="spanStyle" v-if="active > 0">{{ big_V_Download }}</span><br/>
|
||||
<span class="spanStyle" v-if="active > 0">{{ big_I_Download }}</span>
|
||||
<el-icon v-if="active === 1 " class="loading-box">
|
||||
<el-icon-loading/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step>
|
||||
<template #title>
|
||||
<span>小电压/电流系数下装</span><br/>
|
||||
<span class="spanStyle">源输出为:</span><br/>
|
||||
<span class="spanStyle" v-if="active > 1">{{ small_V_Download }}</span><br/>
|
||||
<span class="spanStyle" v-if="active > 1">{{ small_I_Download }}</span>
|
||||
<el-icon v-if="active === 2" class="loading-box">
|
||||
<el-icon-loading/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step>
|
||||
<template #title>
|
||||
<span>大电压/电流校准</span><br/>
|
||||
<span class="spanStyle">源输出为:</span><br/>
|
||||
<span class="spanStyle" v-if="active > 2">{{ big_V_Adjust }}</span><br/>
|
||||
<span class="spanStyle" v-if="active > 2">{{ big_I_Adjust }}</span>
|
||||
<el-icon v-if="active === 3" class="loading-box">
|
||||
<el-icon-loading/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step>
|
||||
<template #title>
|
||||
<span>小电压/电流校准</span><br/>
|
||||
<span class="spanStyle">源输出为:</span><br/>
|
||||
<span class="spanStyle" v-if="active > 3">{{ small_V_Adjust }}</span><br/>
|
||||
<span class="spanStyle" v-if="active > 3">{{ small_I_Adjust }}</span>
|
||||
<el-icon v-if="active === 4" class="loading-box">
|
||||
<el-icon-loading/>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="结束"/>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div class="right-content">
|
||||
<el-tabs type="border-card" v-model="editableTabsValue" :active-index="String(activeIndex)">
|
||||
<el-tab-pane v-for="(device, index) in name" :key="index" :label="device">
|
||||
<template #label>
|
||||
<span class="custom-tabs-label">
|
||||
<span>{{ device }}</span>
|
||||
<el-icon v-if="errorStates[index]" class="icon-style">
|
||||
<Failed/>
|
||||
</el-icon>
|
||||
</span>
|
||||
</template>
|
||||
<channelsTestTable
|
||||
:tableData="getTableDataForChannel(index)"
|
||||
:big_V_loading="big_V_loadingStates"
|
||||
:curV="CurV">
|
||||
</channelsTestTable>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup name="FactorTest">
|
||||
import {type Device} from '@/api/device/interface/device';
|
||||
import {Failed} from '@element-plus/icons-vue'
|
||||
import {onBeforeMount, type Ref, ref, toRef, watch} from 'vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {ElMessageBox} from 'element-plus';
|
||||
import {getCoefficientCheck} from '@/api/home/channelsTest/index'
|
||||
import type {ChannelsTest} from '@/api/home/interface/channelsTest';
|
||||
import type {Plan} from '@/api/plan/interface';
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
|
||||
const checkStore = useCheckStore()
|
||||
const activeIndex = ref(0)
|
||||
const activeTotalNum = ref(4)
|
||||
const qualified = ref(0)
|
||||
const outputDsc = ref('电压误差为:±0.1Un%; 电流误差为:±0.5%')
|
||||
const total = ref(0)
|
||||
const dialogVisible = ref(false)
|
||||
const active = ref(0)
|
||||
let timer1: NodeJS.Timeout | null = null; // 声明并初始化 timer1
|
||||
let timer2: NodeJS.Timeout | null = null; // 同样声明并初始化 timer2
|
||||
const name = ref<string[]>([])//系数校准所选设备名字数组
|
||||
const channel = ref<number[]>([])//系数校准所选设备通道数组
|
||||
const devIdArray = ref<string[]>([])//系数校准所选设备ID数组
|
||||
const select_Plan = ref<Plan.ReqPlan>()
|
||||
const planId = ref('')
|
||||
const isButtonDisabled = ref(false);
|
||||
const CurV = ref<number>()//额定电压
|
||||
// 在 setup 函数中
|
||||
const errorStates = ref(new Array(name.value.length).fill(false));
|
||||
//const loadingStates = ref(new Array(name.value.length).fill(false)); // 初始化 loading 状态
|
||||
const big_V_loadingStates = ref(false); // 初始化 大电压大电流下装loading 状态
|
||||
const small_V_loadingStates = ref(false); // 初始化 小电压小电流下装loading 状态
|
||||
const big_V_loadingStates2 = ref(false); // 初始化 大电压大电流校准loading 状态
|
||||
const small_V_loadingStates2 = ref(false); // 初始化 小电压小电流校准loading 状态
|
||||
const editableTabsValue = ref('0')
|
||||
const big_V_Download = ref('')
|
||||
const big_I_Download = ref('')
|
||||
const small_V_Download = ref('')
|
||||
const small_I_Download = ref('')
|
||||
const big_V_Adjust = ref('')
|
||||
const big_I_Adjust = ref('')
|
||||
const small_V_Adjust = ref('')
|
||||
const small_I_Adjust = ref('')
|
||||
const props = defineProps({
|
||||
testStatus: {
|
||||
type: String,
|
||||
default: 'wait'
|
||||
},
|
||||
webMsgSend: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
})
|
||||
|
||||
const testStatus = toRef(props, 'testStatus');
|
||||
const tableDataMap = new Map<number, Ref<ChannelsTest.CoefficientVO[]>>([]);
|
||||
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
|
||||
const webMsgSend = toRef(props, 'webMsgSend');
|
||||
|
||||
onBeforeMount(() => {
|
||||
// 初始化
|
||||
initData()
|
||||
})
|
||||
const initData = () => {
|
||||
|
||||
CurV.value = checkStore.devices[0]?.devVolt || 57.74;
|
||||
isButtonDisabled.value = false; // 恢复按钮
|
||||
select_Plan.value = checkStore.plan
|
||||
planId.value = checkStore.devices[0]?.planId || '';
|
||||
devIdArray.value = checkStore.devices.map(item => item.deviceId);
|
||||
name.value = checkStore.devices.map(item => item.deviceName)
|
||||
channel.value = checkStore.devices.map(item => item.chnNum)
|
||||
dialogVisible.value = true;
|
||||
total.value = name.value.length
|
||||
|
||||
|
||||
// 初始化 loadingStates 为 false
|
||||
// loadingStates.value = new Array(selection.length).fill(false);
|
||||
errorStates.value = new Array(checkStore.devices.length).fill(false);
|
||||
|
||||
for (let i = 0; i < channel.value.length; i++) {
|
||||
const currentTableData = initializeTableData(dataTemplates, i);
|
||||
tableDataMap.set(i, currentTableData)
|
||||
}
|
||||
//console.log('tableDataMap',tableDataMap);
|
||||
}
|
||||
|
||||
|
||||
watch(testStatus, function (newValue, oldValue) {
|
||||
if (newValue === 'start') {
|
||||
// 开始系数校准操作
|
||||
handleSubmit()
|
||||
}
|
||||
})
|
||||
|
||||
watch(webMsgSend, function (newValue, oldValue) {
|
||||
console.log('webMsgSend---code', newValue.code)
|
||||
console.log('webMsgSend---requestId', newValue.requestId)
|
||||
if (newValue.code == 10520) {
|
||||
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10521) {
|
||||
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10522) {
|
||||
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10523) {
|
||||
ElMessageBox.alert('源连接失败!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10524) {
|
||||
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10525) {
|
||||
ElMessageBox.alert('重置源失败!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10527) {
|
||||
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10528) {
|
||||
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10529) {
|
||||
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10550) {
|
||||
ElMessageBox.alert(`${newValue.data}设备连接异常!`, '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10551) {
|
||||
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗?
|
||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else {
|
||||
console.log('显示东西code', newValue.code)
|
||||
console.log('显示东西requestId', newValue.requestId)
|
||||
switch (newValue.requestId) {
|
||||
|
||||
case 'yjc_ytxjy':
|
||||
switch (newValue.operateCode) {
|
||||
case'INIT_GATHER':
|
||||
if (newValue.code == -1) {
|
||||
ElMessageBox.alert('源未知异常', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10523) {
|
||||
ElMessageBox.alert('源连接失败', '源连接失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'YJC_xujy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'OPER_GATHER':
|
||||
if (newValue.code == 10552) {
|
||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10520) {
|
||||
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
}
|
||||
break;
|
||||
case 'DATA_REQUEST$02':
|
||||
if (newValue.code == 25003) {
|
||||
ElMessageBox.alert('相序校验未通过,执行自动关闭,请重新发起检测', '相序校验未通过', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'yjc_sbtxjy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'INIT_GATHER$01':
|
||||
if (newValue.code == 10550) {
|
||||
ElMessageBox.alert('设备连接异常', '设备连接异常', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10551) {
|
||||
ElMessageBox.alert('设备触发报告异常', '设备触发报告异常', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10552) {
|
||||
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == 10520) {
|
||||
ElMessageBox.alert('解析报文异常,执行自动关闭,请重新发起检测', '解析报文异常', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'Coefficient_Check':
|
||||
console.log("Coefficient_Checkactive", active.value);
|
||||
switch (newValue.operateCode) {
|
||||
case 'big_end'://大电压,电流下装
|
||||
console.log('大电压,电流下装')
|
||||
active.value++;
|
||||
big_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||
big_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||
|
||||
tableLoading('small', '系数下装')
|
||||
break;
|
||||
}
|
||||
switch (newValue.operateCode) {
|
||||
case 'small_end'://小电压,电流下装
|
||||
console.log('小电压,电流下装')
|
||||
active.value++;
|
||||
small_V_Download.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||
small_I_Download.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||
|
||||
tableLoading('big', '系数校准')
|
||||
break;
|
||||
}
|
||||
switch (newValue.operateCode) {
|
||||
case 'big_comp_end'://大电压,电流校准
|
||||
console.log('大电压,电流校准')
|
||||
active.value++;
|
||||
big_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||
big_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||
|
||||
tableLoading('small', '系数校准')
|
||||
break;
|
||||
}
|
||||
switch (newValue.operateCode) {
|
||||
case 'small_comp_end'://小电压,电流校准
|
||||
console.log('小电压,电流校准')
|
||||
active.value++;
|
||||
small_V_Adjust.value = 'Ua=Ub=Uc=' + newValue.data.devVolt + 'V';
|
||||
small_I_Adjust.value = 'Ia=Ib=Ic=' + newValue.data.devCurr + 'A';
|
||||
active.value++;
|
||||
|
||||
for (let i = 0; i < name.value.length; i++) {
|
||||
const currentDataRef = tableDataMap.get(i);
|
||||
if (currentDataRef) {
|
||||
const currentData = currentDataRef.value;
|
||||
// 检查当前数据中有无不合格字段
|
||||
const hasError = checkForErrors(currentData);
|
||||
if (hasError) {
|
||||
} else {
|
||||
qualified.value++;
|
||||
}
|
||||
updateErrorState(i, hasError);
|
||||
}
|
||||
}
|
||||
|
||||
//editableTabsValue.value = (tabNumber.value).toString();//显示下一个tab
|
||||
isButtonDisabled.value = false; // 恢复按钮
|
||||
emit('update:testStatus', 'success')
|
||||
break;
|
||||
}
|
||||
switch (newValue.operateCode) {
|
||||
case 'DATA_CHNFACTOR$02'://表格
|
||||
// 输出 key 为 0 的数组中的第一条 ChannelsTest.CoefficientVO 对象
|
||||
console.log('表格',name.value)
|
||||
for (let i = 0; i < name.value.length; i++) {
|
||||
const targetArrayRef = tableDataMap.get(i);
|
||||
if (targetArrayRef) {
|
||||
const targetArray = targetArrayRef.value;
|
||||
if (targetArray.length > 0) {
|
||||
const firstCoefficientVO = targetArray.find(item => item.monitorNum === newValue.data.monitorNum &&
|
||||
item.type === newValue.data.type &&
|
||||
item.desc === newValue.data.desc &&
|
||||
item.devName === newValue.data.devName);
|
||||
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
|
||||
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) {
|
||||
firstCoefficientVO.aVuXi = (parseFloat(newValue.data.aVuXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.aVuXi = newValue.data.aVuXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) {
|
||||
firstCoefficientVO.bVuXi = (parseFloat(newValue.data.bVuXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.bVuXi = newValue.data.bVuXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) {
|
||||
firstCoefficientVO.cVuXi = (parseFloat(newValue.data.cVuXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.cVuXi = newValue.data.cVuXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) {
|
||||
firstCoefficientVO.aIeXi = (parseFloat(newValue.data.aIeXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.aIeXi = newValue.data.aIeXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) {
|
||||
firstCoefficientVO.bIeXi = (parseFloat(newValue.data.bIeXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.bIeXi = newValue.data.bIeXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
|
||||
|
||||
if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) {
|
||||
firstCoefficientVO.cIeXi = (parseFloat(newValue.data.cIeXi) / 10000).toFixed(4);
|
||||
} else {
|
||||
firstCoefficientVO.cIeXi = newValue.data.cIeXi;
|
||||
}
|
||||
|
||||
firstCoefficientVO.aV = newValue.data.aV;
|
||||
firstCoefficientVO.bV = newValue.data.bV;
|
||||
firstCoefficientVO.cV = newValue.data.cV;
|
||||
firstCoefficientVO.aI = newValue.data.aI;
|
||||
firstCoefficientVO.bI = newValue.data.bI;
|
||||
firstCoefficientVO.cI = newValue.data.cI;
|
||||
console.log(newValue.data.devName + '对象:', firstCoefficientVO);
|
||||
activeIndex.value++;
|
||||
} else {
|
||||
console.log('未找到匹配的'+ newValue.data.devName+'对象');
|
||||
}
|
||||
} else {
|
||||
console.log(newValue.data.devName + '数组为空');
|
||||
}
|
||||
} else {
|
||||
console.log('未找到'+newValue.data.devName+'对应的数组');
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'socket_timeout':
|
||||
switch (newValue.operateCode) {
|
||||
case 'VOLTAGE':
|
||||
ElMessageBox.alert('连接超时!', '连接超时', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'connect':
|
||||
switch (newValue.operateCode) {
|
||||
case "Source":
|
||||
ElMessageBox.alert('源服务端连接失败', '源服务端连接失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
break;
|
||||
case "Dev":
|
||||
ElMessageBox.alert('设备服务端连接失败', '设备服务端连接失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//出错系数检测初始化
|
||||
const TableInit = () => {
|
||||
console.log("出错系数检测",active.value);
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
// isButtonDisabled.value = false; // 恢复按钮
|
||||
// for (let i = 0; i < channel.value.length; i++) {
|
||||
// const currentTableData = initializeTableData(dataTemplates, i);
|
||||
// tableDataMap.set(i, currentTableData)
|
||||
// }
|
||||
// activeIndex.value = 0
|
||||
// qualified.value = 0
|
||||
// active.value = 0
|
||||
|
||||
}
|
||||
|
||||
//按行图标转动
|
||||
const tableLoading = (type: string, desc: string) => {
|
||||
console.log('转动',channel.value)
|
||||
for (let i = 0; i < channel.value.length; i++) {
|
||||
|
||||
const targetArrayRef = tableDataMap.get(i);
|
||||
if (targetArrayRef) {
|
||||
const targetArray = targetArrayRef.value;
|
||||
if (targetArray.length > 0) {
|
||||
for (let j = 0; j < channel.value[i]; j++) {
|
||||
const firstCoefficientVO = targetArray.find(item => item.monitorNum === (j + 1).toString() &&
|
||||
item.type === type &&
|
||||
item.desc === desc);
|
||||
if (firstCoefficientVO) {
|
||||
firstCoefficientVO.loading = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
console.log('不转了')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const dataTemplates: ChannelsTest.CoefficientVO[] = [
|
||||
{
|
||||
monitorNum: '1',
|
||||
desc: '系数下装',
|
||||
type: 'big',
|
||||
aVuData: '—',
|
||||
aVuXi: '—',
|
||||
bVuData: '—',
|
||||
bVuXi: '—',
|
||||
cVuData: '—',
|
||||
cVuXi: '—',
|
||||
aIeData: '—',
|
||||
aIeXi: '—',
|
||||
bIeData: '—',
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading: false,
|
||||
devName: '',
|
||||
aV: '—',
|
||||
bV: '—',
|
||||
cV: '—',
|
||||
aI: '—',
|
||||
bI: '—',
|
||||
cI: '—',
|
||||
},
|
||||
{
|
||||
monitorNum: '2',
|
||||
desc: '系数下装',
|
||||
type: 'small',
|
||||
aVuData: '—',
|
||||
aVuXi: '—',
|
||||
bVuData: '—',
|
||||
bVuXi: '—',
|
||||
cVuData: '—',
|
||||
cVuXi: '—',
|
||||
aIeData: '—',
|
||||
aIeXi: '—',
|
||||
bIeData: '—',
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading: false,
|
||||
devName: '',
|
||||
aV: '—',
|
||||
bV: '—',
|
||||
cV: '—',
|
||||
aI: '—',
|
||||
bI: '—',
|
||||
cI: '—',
|
||||
},
|
||||
{
|
||||
monitorNum: '3',
|
||||
desc: '系数校准',
|
||||
type: 'big',
|
||||
aVuData: '—',
|
||||
aVuXi: '—',
|
||||
bVuData: '—',
|
||||
bVuXi: '—',
|
||||
cVuData: '—',
|
||||
cVuXi: '—',
|
||||
aIeData: '—',
|
||||
aIeXi: '—',
|
||||
bIeData: '—',
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading: false,
|
||||
devName: '',
|
||||
aV: '—',
|
||||
bV: '—',
|
||||
cV: '—',
|
||||
aI: '—',
|
||||
bI: '—',
|
||||
cI: '—',
|
||||
},
|
||||
{
|
||||
monitorNum: '4',
|
||||
desc: '系数校准',
|
||||
type: 'small',
|
||||
aVuData: '—',
|
||||
aVuXi: '—',
|
||||
bVuData: '—',
|
||||
bVuXi: '—',
|
||||
cVuData: '—',
|
||||
cVuXi: '—',
|
||||
aIeData: '—',
|
||||
aIeXi: '—',
|
||||
bIeData: '—',
|
||||
bIeXi: '—',
|
||||
cIeData: '—',
|
||||
cIeXi: '—',
|
||||
loading: false,
|
||||
devName: '',
|
||||
aV: '—',
|
||||
bV: '—',
|
||||
cV: '—',
|
||||
aI: '—',
|
||||
bI: '—',
|
||||
cI: '—',
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
// 更新错误状态的方法
|
||||
const updateErrorState = (index: number, hasError: boolean) => {
|
||||
errorStates.value[index] = hasError;
|
||||
};
|
||||
|
||||
|
||||
// const emit = defineEmits<{
|
||||
|
||||
// (e: 'submitClicked', callback: (resolve: (value: boolean) => void) => void): void;
|
||||
// }>();
|
||||
|
||||
const emit = defineEmits(['update:testStatus']);
|
||||
|
||||
const getTableDataForChannel = (index: number): any[] => {
|
||||
const data = tableDataMap.get(index);
|
||||
return data ? data.value : [];
|
||||
}
|
||||
|
||||
|
||||
watch(activeIndex, function (newValue, oldValue) {
|
||||
if (activeIndex.value === 1) {
|
||||
outputDsc.value = "电压误差为:±0.1Un%; 电流误差为:±0.5%";
|
||||
// 当前源输出为:Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A"
|
||||
}
|
||||
})
|
||||
|
||||
// 示例的 checkForErrors 函数,根据实际需求进行调整
|
||||
const checkForErrors = (data: ChannelsTest.CoefficientVO[]): boolean => {
|
||||
// 这里假设不合格字段的标准是 status 为 '不合格' 或 isValid 为 false
|
||||
return data.some(item =>
|
||||
item.aVuXi === '不合格' ||
|
||||
item.bVuXi === '不合格' ||
|
||||
item.cVuXi === '不合格' ||
|
||||
item.aIeXi === '不合格' ||
|
||||
item.bIeXi === '不合格' ||
|
||||
item.cIeXi === '不合格'
|
||||
);
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
// 创建一个 Promise 来等待父组件的回调
|
||||
// const response = await new Promise<boolean>((resolve) => {
|
||||
// emit('submitClicked', resolve);
|
||||
// });
|
||||
|
||||
// if (!response) {
|
||||
// return;
|
||||
// }()
|
||||
|
||||
isButtonDisabled.value = true; // 禁用按钮
|
||||
tableLoading('big', '系数下装')
|
||||
await getCoefficientCheck({
|
||||
userPageId: "cdf",
|
||||
devIds: devIdArray.value,
|
||||
planId: planId.value,
|
||||
errorSysId: select_Plan.value?.errorSysId,
|
||||
scriptId: select_Plan.value?.scriptId,
|
||||
operateType: '0' // '0'为预检测、‘1‘为正式检测
|
||||
})
|
||||
active.value++;
|
||||
|
||||
console.log('开始检测active.value', active.value)
|
||||
};
|
||||
|
||||
// 提取初始化并填充 currentTableData 的函数
|
||||
const initializeTableData = (templates: ChannelsTest.CoefficientVO[], index: number): Ref<ChannelsTest.CoefficientVO[]> => {
|
||||
const currentTableData = ref<ChannelsTest.CoefficientVO[]>([]);
|
||||
for (let j = 0; j < channel.value[index]; j++) {
|
||||
templates.forEach((template) => {
|
||||
// 使用解构赋值排除 id 和 MonitorIdx 属性
|
||||
const {devName, monitorNum: __, ...rest} = template;
|
||||
currentTableData.value.push({
|
||||
monitorNum: (j + 1).toString(),
|
||||
devName: name.value[index],
|
||||
...rest,
|
||||
});
|
||||
});
|
||||
}
|
||||
return currentTableData;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 确保 el-icon-loading 的动画效果没有被覆盖 */
|
||||
.loading-box {
|
||||
animation: rotate 2s linear infinite;
|
||||
font-size: 30px; /* 增大图标的大小 */
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.right-title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/* 横向排列 */
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.custom-tabs-label .el-icon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.custom-tabs-label span {
|
||||
vertical-align: middle;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
height: 510px;
|
||||
}
|
||||
|
||||
.el-tabs--border-card {
|
||||
height: 470px;
|
||||
}
|
||||
|
||||
/* .el-icon svg {
|
||||
color: #ff7171;
|
||||
} */
|
||||
|
||||
.icon-style {
|
||||
color: #ff7171;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.dialog-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right-content {
|
||||
flex: 6;
|
||||
}
|
||||
|
||||
.spanStyle {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,16 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="预检测项目:">
|
||||
<el-tab-pane label="预检测项目">
|
||||
<div class="form-grid">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in detectionOptions"
|
||||
v-model="item.selected"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
|
||||
></el-checkbox
|
||||
>
|
||||
<el-checkbox v-for="(item, index) in detectionOptions" v-model="item.selected" :key="index"
|
||||
:label="item.name"></el-checkbox>
|
||||
<!-- disabled="true" -->
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@@ -18,41 +12,52 @@
|
||||
|
||||
<div class="test-dialog">
|
||||
<div class="dialog-left">
|
||||
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus" finish-status="success">
|
||||
<el-step title="源通讯校验" />
|
||||
<el-step title="设备通讯校验" />
|
||||
<el-step title="协议校验" />
|
||||
<el-step title="相序校验" />
|
||||
<el-step title="检测完成" />
|
||||
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus"
|
||||
finish-status="success">
|
||||
<el-step :status="step1" title="源通讯校验"/>
|
||||
<el-step :status="step2" title="设备通讯校验"/>
|
||||
<el-step :status="step3" title="协议校验"/>
|
||||
<el-step :status="step4" title="相序校验"/>
|
||||
<el-step :status="step5" title="检测完成"/>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div class="dialog-right">
|
||||
<el-collapse v-model="collapseActiveName" accordion>
|
||||
<el-collapse-item title="源通讯校验" name="1">
|
||||
<div class="div-log">
|
||||
<p v-for="(item, index) in step1InitLog" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
||||
<p v-for="(item, index) in step1InitLog" :key="index"
|
||||
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
||||
{{ item.log }} <br/>
|
||||
</p>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="设备通讯校验" name="2">
|
||||
<div class="div-log">
|
||||
<p v-for="(item, index) in step2InitLog" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
||||
<p v-for="(item, index) in step2InitLog" :key="index"
|
||||
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
||||
{{ item.log }} <br/>
|
||||
</p>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="协议校验" name="3">
|
||||
<div class="div-log">
|
||||
<p v-for="(item, index) in step3InitLog" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
||||
<p v-for="(item, index) in step3InitLog" :key="index"
|
||||
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
||||
{{ item.log }} <br/>
|
||||
</p>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="相序校验" name="4">
|
||||
<div class="div-log">
|
||||
<p v-for="(item, index) in step4InitLog" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
||||
{{ item.log }} <br />
|
||||
<p v-for="(item, index) in step4InitLog" :key="index"
|
||||
:style="{ color: item.type === 'error' ? '#F56C6C' : 'var(--el-text-color-regular)' }">
|
||||
{{ item.log.split('&&')[0] }}
|
||||
<br v-if="item.log.includes('&&')"/>
|
||||
{{ item.log.split('&&')[1] }}
|
||||
|
||||
<br v-if="item.log.includes('&&')"/>
|
||||
{{ item.log.split('&&')[2] }}
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@@ -63,6 +68,9 @@
|
||||
|
||||
</template>
|
||||
<script lang="tsx" setup name="preTest">
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {defineExpose, toRef} from 'vue';
|
||||
|
||||
const step1InitLog = ref([
|
||||
{
|
||||
type: 'info',
|
||||
@@ -87,19 +95,19 @@ const step2InitLog = ref([
|
||||
const step2Log = ref([
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备1通讯校验成功',
|
||||
log: '被检设备:240001通讯校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备2通讯校验成功',
|
||||
log: '被检设备:240002通讯校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备3通讯校验成功',
|
||||
log: '被检设备:240003通讯校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备4通讯校验成功',
|
||||
log: '被检设备:240004通讯校验成功',
|
||||
},
|
||||
])
|
||||
|
||||
@@ -113,19 +121,19 @@ const step3InitLog = ref([
|
||||
const step3Log = ref([
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备1协议校验成功',
|
||||
log: '被检设备:240001协议校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备2协议校验成功',
|
||||
log: '被检设备:240002协议校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备3协议校验成功',
|
||||
log: '被检设备:240003协议校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备4协议校验成功',
|
||||
log: '被检设备:240004协议校验成功',
|
||||
},
|
||||
])
|
||||
|
||||
@@ -140,25 +148,31 @@ const step4InitLog = ref([
|
||||
const step4Log = ref([
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备1相序校验成功',
|
||||
log: '被检设备:240001相序校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备2相序校验成功',
|
||||
log: '被检设备:240002相序校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备3相序校验成功',
|
||||
log: '被检设备:240003相序校验成功',
|
||||
},
|
||||
{
|
||||
type: 'info',
|
||||
log:'被检设备4相序校验成功',
|
||||
log: '被检设备:240004相序校验成功',
|
||||
},
|
||||
])
|
||||
|
||||
const collapseActiveName = ref('1')
|
||||
const activeIndex = ref(0)
|
||||
const activeTotalNum = ref(5)
|
||||
const step1 = ref('wait')
|
||||
const step2 = ref('wait')
|
||||
const step3 = ref('wait')
|
||||
const step4 = ref('wait')
|
||||
const step5 = ref('wait')
|
||||
|
||||
//定义与预检测配置数组
|
||||
const detectionOptions = ref([
|
||||
{
|
||||
@@ -207,61 +221,358 @@ const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process
|
||||
testStatus: {
|
||||
type: String,
|
||||
default: 'wait'
|
||||
},
|
||||
webMsgSend: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const testStatus = toRef(props, 'testStatus');
|
||||
const webMsgSend = toRef(props, 'webMsgSend');
|
||||
const ts = ref('');
|
||||
|
||||
watch(activeIndex, function (newValue, oldValue) {
|
||||
watch(webMsgSend, function (newValue, oldValue) {
|
||||
// console.log(newValue)
|
||||
|
||||
if(activeIndex.value === 1)
|
||||
{
|
||||
step1InitLog.value.length = 0;
|
||||
step1InitLog.value = step1Log.value;
|
||||
switch (newValue.requestId) {
|
||||
case 'yjc_ytxjy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'INIT_GATHER':
|
||||
if (newValue.code == 10200) {
|
||||
step1InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '源初始化成功!',
|
||||
})
|
||||
activeIndex.value = 1
|
||||
step1.value = 'success'
|
||||
step2.value = 'process'
|
||||
} else if (newValue.code == 10201) {
|
||||
step1.value = 'process'
|
||||
step1InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行源初始化!',
|
||||
}];
|
||||
} else if (newValue.code == 10552) {
|
||||
ElMessage.error(newValue.code)
|
||||
step1.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10523) {
|
||||
step1.value = 'error'
|
||||
ts.value = 'error'
|
||||
step1InitLog.value = [{
|
||||
type: 'error',
|
||||
log: '源连接失败!',
|
||||
}];
|
||||
} else if (newValue.code == -1) {
|
||||
step1.value = 'error'
|
||||
ts.value = 'error'
|
||||
step1InitLog.value = [{
|
||||
type: 'error',
|
||||
log: '源未知异常!',
|
||||
}];
|
||||
}
|
||||
if(activeIndex.value === 2)
|
||||
{
|
||||
step2InitLog.value.length = 0;
|
||||
step2InitLog.value = step2Log.value;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
if(activeIndex.value === 3)
|
||||
{
|
||||
step3InitLog.value.length = 0;
|
||||
step3InitLog.value = step3Log.value;
|
||||
break;
|
||||
case 'yjc_sbtxjy':
|
||||
|
||||
switch (newValue.operateCode) {
|
||||
case 'INIT_GATHER$01':
|
||||
if (newValue.code == 10200) {
|
||||
step2InitLog.value.push({
|
||||
type: 'info',
|
||||
log: newValue.data + '设备通讯校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step2.value = 'process'
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行设备通讯校验.....',
|
||||
}];
|
||||
} else if (newValue.code == 10550) {
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step2.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 25001) {
|
||||
activeIndex.value = 2
|
||||
step2.value = 'success'
|
||||
step3.value = 'process'
|
||||
}
|
||||
if(activeIndex.value > 3)
|
||||
{
|
||||
step4InitLog.value.length = 0;
|
||||
step4InitLog.value = step4Log.value;
|
||||
break;
|
||||
}
|
||||
if(activeIndex.value < activeTotalNum.value - 2)
|
||||
|
||||
break;
|
||||
case 'yjc_xyjy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'INIT_GATHER$01':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '统计数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step3.value = 'process'
|
||||
step3InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行通讯协议校验.....',
|
||||
}];
|
||||
} else if (newValue.code == 10550) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
step3.value = 'error'
|
||||
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step3InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
}
|
||||
break;
|
||||
case 'INIT_GATHER$02':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '实时数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step3.value = 'process'
|
||||
step3InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行通讯协议校验.....',
|
||||
}];
|
||||
} else if (newValue.code == 10550) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
step3.value = 'error'
|
||||
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step3InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
}
|
||||
break;
|
||||
case 'INIT_GATHER$03':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '暂态数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step3.value = 'process'
|
||||
} else if (newValue.code == 10550) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
//ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!")
|
||||
step3.value = 'error'
|
||||
step3InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 25001) {
|
||||
activeIndex.value = 3
|
||||
step3.value = 'success'
|
||||
step4.value = 'process'
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'YJC_xujy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'OPER_GATHER':
|
||||
if (newValue.code == 10200) {
|
||||
step4InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '源参数下发成功,等待校验中.....',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step4.value = 'process'
|
||||
step4InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '源参数下发中.....',
|
||||
}];
|
||||
} else if (newValue.code == 10552) {
|
||||
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step4.value = 'error'
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 10520) {
|
||||
step4.value = 'error'
|
||||
step4InitLog.value.push({
|
||||
type: 'error',
|
||||
log: '解析报文异常',
|
||||
})
|
||||
ts.value = 'error'
|
||||
}
|
||||
break;
|
||||
|
||||
case 'DATA_REQUEST$02':
|
||||
if (newValue.code == 10200) {
|
||||
let type = 'info'
|
||||
if (newValue.data.includes('不合格')) {
|
||||
type = 'error'
|
||||
}
|
||||
|
||||
newValue.data.split('<br/>')
|
||||
step4InitLog.value.push({
|
||||
type: type,
|
||||
log:newValue.data,
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step4.value = 'process'
|
||||
step4InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '获取数据相序校验数据!',
|
||||
}];
|
||||
} else if (newValue.code == 25003) {
|
||||
step4.value = 'error'
|
||||
step4InitLog.value.push({
|
||||
type: 'error',
|
||||
log: '相序校验未通过!',
|
||||
})
|
||||
ts.value = 'error'
|
||||
} else if (newValue.code == 25001) {
|
||||
step4.value = 'success'
|
||||
step5.value = 'success'
|
||||
step4InitLog.value.push({
|
||||
type: 'wait',
|
||||
log: '相序校验成功!',
|
||||
})
|
||||
}
|
||||
activeIndex.value = 5
|
||||
ts.value = 'success'
|
||||
console.log("@@@@",ts.value)
|
||||
break
|
||||
}
|
||||
|
||||
break;
|
||||
case 'quit':
|
||||
break;
|
||||
case 'connect':
|
||||
switch (newValue.operateCode) {
|
||||
case "Source":
|
||||
step1.value = 'error'
|
||||
step1InitLog.value = [{
|
||||
type: 'error',
|
||||
log: '源服务端连接失败!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
break;
|
||||
case "Dev":
|
||||
step2.value = 'error'
|
||||
step2InitLog.value = [{
|
||||
type: 'error',
|
||||
log: '设备服务端连接失败!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'unknown_operate':
|
||||
|
||||
break;
|
||||
case 'error_flow_end':
|
||||
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
ts.value = 'error'
|
||||
break;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
watch(activeIndex, function (newValue, oldValue) {
|
||||
if (newValue <= activeTotalNum.value - 2) {
|
||||
collapseActiveName.value = (newValue + 1).toString()
|
||||
else
|
||||
collapseActiveName.value = (activeTotalNum.value - 1).toString()
|
||||
} else {
|
||||
collapseActiveName.value = (newValue - 1).toString()
|
||||
}
|
||||
})
|
||||
|
||||
//监听goods_sn的变化
|
||||
watch(testStatus, function (newValue, oldValue) {
|
||||
ts.value = props.testStatus;
|
||||
if(ts.value==='start')
|
||||
{
|
||||
if (ts.value === 'start') {
|
||||
ts.value = 'process'
|
||||
|
||||
let timer = setInterval(() => {
|
||||
if(activeIndex.value < activeTotalNum.value - 2)
|
||||
activeIndex.value++
|
||||
else if(activeIndex.value === activeTotalNum.value -2)
|
||||
} else if (ts.value === 'waiting') {
|
||||
activeIndex.value = 0
|
||||
step1InitLog.value = [
|
||||
{
|
||||
activeIndex.value++
|
||||
activeIndex.value++
|
||||
}
|
||||
else
|
||||
{
|
||||
clearInterval(timer)
|
||||
ts.value = 'success'
|
||||
}
|
||||
|
||||
}, 1500);
|
||||
type: 'info',
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
]
|
||||
step1.value = 'finish'
|
||||
step2.value = 'wait'
|
||||
step3.value = 'wait'
|
||||
step4.value = 'wait'
|
||||
step5.value = 'wait'
|
||||
}
|
||||
})
|
||||
|
||||
@@ -272,19 +583,61 @@ watch(ts, function (newValue, oldValue) {
|
||||
emit('update:testStatus', ts.value)
|
||||
})
|
||||
|
||||
|
||||
// 定义一个初始化参数的方法
|
||||
function initializeParameters() {
|
||||
activeIndex.value = 0
|
||||
step1.value = 'process'
|
||||
step2.value = 'wait'
|
||||
step3.value = 'wait'
|
||||
step4.value = 'wait'
|
||||
step5.value = 'wait'
|
||||
|
||||
step1InitLog.value = [
|
||||
{
|
||||
type: 'info',
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
]
|
||||
step2InitLog.value = [
|
||||
{
|
||||
type: 'info',
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
]
|
||||
step3InitLog.value = [
|
||||
{
|
||||
type: 'info',
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
]
|
||||
step4InitLog.value = [
|
||||
{
|
||||
type: 'info',
|
||||
log: '暂无数据,等待检测开始',
|
||||
},
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
initializeParameters,
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
.test-dialog {
|
||||
height: 350px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: row; /* 横向排列 */
|
||||
flex-direction: row;
|
||||
/* 横向排列 */
|
||||
margin-top: 20px;
|
||||
/* .dialog-left{
|
||||
margin-right: 20px;
|
||||
} */
|
||||
}
|
||||
|
||||
.dialog-left {
|
||||
width: 15%;
|
||||
margin-left: 20px;
|
||||
@@ -309,12 +662,20 @@ watch(ts, function (newValue, oldValue) {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.dialog-right :deep(.el-collapse-item__header) {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.div-log {
|
||||
height: 100px;
|
||||
height: 145px;
|
||||
overflow-y: auto;
|
||||
padding-left: 10px;
|
||||
|
||||
p {
|
||||
margin: 5px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,57 +1,55 @@
|
||||
<template>
|
||||
<el-dialog title="报告生成" :model-value='visible' @close="handleCancel" width="832px">
|
||||
<el-dialog title="报告生成" :model-value='visible' @close="handleCancel" width="832px" draggable>
|
||||
<div class="report-dialog">
|
||||
<div class="report-title">
|
||||
<div>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<div class="report-title form-two">
|
||||
|
||||
<el-form-item label="检测脚本" label-width="100px">
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="误差体系" >
|
||||
|
||||
<el-form-item label="误差体系" label-width="100px">
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="12">
|
||||
<el-form-item label="数据处理原则" >
|
||||
|
||||
<el-form-item label="数据原则" label-width="100px">
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报告模板" >
|
||||
|
||||
<el-form-item label="报告模板" label-width="100px">
|
||||
<el-input v-model='reportTemplate' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="报告生成状态表:">
|
||||
<el-tab-pane label="报告生成进度">
|
||||
<div class="form-grid">
|
||||
<div class="tabs-title"><el-button type="primary" loading >已生成2台/共4台</el-button> </div>
|
||||
<el-table :data="reportData" stripe="" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border class="custom-table">
|
||||
<div class="tabs-title ">
|
||||
<el-button type="primary" :icon="Download" >报告下载</el-button>
|
||||
<span style=" font-size: 18px;font-weight: 600;">
|
||||
已生成 <span style="color: #67C23A">2</span> 台/共 <span style="color: green">3</span> 台
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="table-main">
|
||||
<el-table :data="reportData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border class="custom-table">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="id" width="70" label="序号" />
|
||||
<el-table-column prop="deviceName" width="150" label="设备名称" />
|
||||
<el-table-column label="生成进度" width="450">
|
||||
<el-table-column label="生成进度">
|
||||
<template #default="scope">
|
||||
<el-progress :color="customColors" :percentage="scope.row.processValue" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="action" label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<el-button type='primary' link :icon='View' :disabled="scope.row.processValue < 100">查看</el-button>
|
||||
<el-button type='primary' link :icon='Download' :disabled="scope.row.processValue < 100">下载</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -69,7 +67,7 @@ import { ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { addPqDev, updatePqDev } from '@/api/device/device'
|
||||
import { computed, reactive, type Ref, ref } from 'vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen,View } from '@element-plus/icons-vue'
|
||||
import { CirclePlus, Delete, Download,View } from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
|
||||
@@ -78,12 +76,12 @@ import { CirclePlus, Delete, EditPen,View } from '@element-plus/icons-vue'
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const currentScriptDsc = ref('电压准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
|
||||
const reportData = ref([
|
||||
{ id: '1', deviceName: '被检设备1', processValue: '100' , action:'查看' },
|
||||
{ id: '2', deviceName: '被检设备2', processValue: '100' , action:'查看' },
|
||||
{ id: '3', deviceName: '被检设备3', processValue: '10', action:'查看' },
|
||||
{ id: '1', deviceName: '240001', processValue: '100' , action:'查看' },
|
||||
{ id: '2', deviceName: '240002', processValue: '100' , action:'查看' },
|
||||
{ id: '3', deviceName: '240003', processValue: '10', action:'查看' },
|
||||
])
|
||||
const customColors = [
|
||||
{ color: "red", percentage: 0 },
|
||||
@@ -146,7 +144,7 @@ const props = defineProps<{
|
||||
}
|
||||
.tabs-title{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<div class="result-dialog">
|
||||
<div class="result-title">
|
||||
<el-row>
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-form-item label="检测脚本" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" >
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-form-item label="数据原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
110
frontend/src/views/home/components/selectTestItemPopup.vue
Normal file
110
frontend/src/views/home/components/selectTestItemPopup.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<el-dialog title="选择测试内容" v-model='dialogVisible' @close="handleClose" v-bind="dialogSmall" >
|
||||
<div>
|
||||
<el-form ref="dialogFormRef" :model="formContent" class="form-three">
|
||||
<el-form-item prop="preTest" :label-width="100">
|
||||
<el-checkbox v-model="formContent.preTest" label="预检测"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="checkStore.plan.timeCheck===1" prop="timeTest" :label-width="100">
|
||||
<el-checkbox v-model="formContent.timeTest" label="守时检测"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="channelsTest" :label-width="100">
|
||||
<el-checkbox v-model="formContent.channelsTest" label="系数校准"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="test" :label-width="100">
|
||||
<el-checkbox v-model="formContent.test" label="正式检测"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="handleStart">确定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx' name='selectTestItemPopup'>
|
||||
import {dialogSmall} from "@/utils/elementBind";
|
||||
import {ref} from "vue";
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import type {CheckData} from "@/api/check/interface";
|
||||
import {ElMessageBox} from "element-plus";
|
||||
|
||||
const emit = defineEmits(['openTestDialog'])
|
||||
const checkStore = useCheckStore();
|
||||
|
||||
const dialogFormRef = ref()
|
||||
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const formContent = reactive<CheckData.SelectTestItem>({preTest: true, timeTest: false, channelsTest: false, test: false})
|
||||
|
||||
const open = async () => {
|
||||
resetFormContent()
|
||||
checkStore.setSelectTestItems(formContent)
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 清空表单内容
|
||||
const resetFormContent = () => {
|
||||
Object.assign(formContent, {preTest: true, channelsTest: false, timeTest: false, test: false})
|
||||
}
|
||||
|
||||
const handleStart = () => {
|
||||
let count = 0
|
||||
for (let key in formContent) {
|
||||
if (formContent[key]) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
if (count === 0) {
|
||||
ElMessage.warning('请选择测试内容!')
|
||||
} else {
|
||||
if(formContent.channelsTest){
|
||||
const factorFlagArray = ref<string[]>([]) // 初始化为空数组
|
||||
for (let i = 0; i < checkStore.devices.length; i++) {
|
||||
const factorFlag = checkStore.devices[i].factorFlag
|
||||
if (factorFlag !== undefined && factorFlag !== null && factorFlag === 0) {
|
||||
factorFlagArray.value.push(checkStore.devices[i].deviceName.toString())
|
||||
}
|
||||
}
|
||||
if (factorFlagArray.value.length > 0) {
|
||||
const factorFlags = factorFlagArray.value.join(', ')
|
||||
ElMessageBox.confirm(
|
||||
factorFlags + '设备不支持系数校准,请重新选择',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
},
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
checkStore.setCheckType(0)
|
||||
checkStore.setSelectTestItems({...formContent})
|
||||
handleClose()
|
||||
emit('openTestDialog')
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
dialogFormRef.value?.resetFields()
|
||||
}
|
||||
|
||||
defineExpose({open})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,32 +1,61 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="visible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
|
||||
<el-dialog :title="dialogTitle" width="1550px" :model-value="dialogVisible" :before-close="beforeClose" @close="handleClose" height="1000px" draggable>
|
||||
|
||||
<div class="steps-container">
|
||||
<!-- simple -->
|
||||
<!-- :style="{color:node.label=='未检测'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" -->
|
||||
<el-steps class="test-head-steps" simple :active="stepsActiveIndex" process-status="finish" finish-status="success">
|
||||
<!-- style="height:100px" -->
|
||||
<!-- <el-step title="预检测" :icon="getIcon(0)" /> -->
|
||||
<el-step title="预检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :Edit" />
|
||||
<el-step title="守时检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :UploadFilled"/>
|
||||
<el-step title="系数校准" :icon="stepsActiveIndex > 2 ? SuccessFilled :Odometer" />
|
||||
<el-step title="正式检测" :icon="stepsActiveIndex > 3 ? SuccessFilled :Coin" />
|
||||
<el-step title="检测完成" :icon="stepsActiveIndex > 4 ? SuccessFilled :Key" />
|
||||
<el-step v-if="preTestSelected" title="预检测" :icon="stepsActive > 1 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :Edit" @click="handleStepClick(1)"/>
|
||||
<el-step v-if="timeTestSelected" title="守时检测" :icon="stepsActive > 2 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :UploadFilled" @click="handleStepClick(2)"/>
|
||||
<el-step v-if="channelsTestSelected" title="系数校准" :icon="stepsActive > 3 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :Odometer" @click="handleStepClick(3)"/>
|
||||
<el-step v-if="testSelected" title="正式检测" :icon="stepsActive > 4 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :Coin" @click="handleStepClick(4)"/>
|
||||
<el-step title="检测完成" :icon="stepsActiveIndex > stepsTotalNum-1 ? SuccessFilled :Key"/>
|
||||
</el-steps>
|
||||
</div>
|
||||
<preTest v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus"></preTest>
|
||||
<timeTest v-if="stepsActiveIndex === 1" v-model:testStatus="timeTestStatus"></timeTest>
|
||||
<channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest>
|
||||
<test v-if="stepsActiveIndex >= 3" v-model:testStatus="TestStatus"></test>
|
||||
|
||||
<preTest v-if="showComponent&&preTestSelected" v-show="preTestSelected && stepsActiveView==1" ref="preTestRef" v-model:testStatus="preTestStatus"
|
||||
:webMsgSend="webMsgSend"/>
|
||||
<timeTest v-if="showComponent&&timeTestSelected" v-show="timeTestSelected && stepsActiveView==2" v-model:testStatus="timeTestStatus"/>
|
||||
<!-- <channelsTest v-if="stepsActiveIndex === 3" v-model:testStatus="channelsTestStatus"></channelsTest>-->
|
||||
<factorTest v-if="showComponent&&channelsTestSelected" v-show="channelsTestSelected && stepsActiveView==3" v-model:testStatus="channelsTestStatus" :webMsgSend="webMsgSend"/>
|
||||
<test v-if="showComponent&&testSelected" v-show="testSelected && stepsActiveView==4" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend"
|
||||
@update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck" :stepsActive="stepsActive"/>
|
||||
|
||||
<template #footer>
|
||||
<div>
|
||||
<!-- <el-button @click="handleCancel">取 消</el-button> -->
|
||||
<el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < 2 && ActiveStatue != 'success'" :disabled="skipDisabled" @click="nextStep">跳过</el-button>
|
||||
<!-- <el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < stepsTotalNum && ActiveStatue != 'success'" @click="nextStep">跳过</el-button>-->
|
||||
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
|
||||
<el-button type="danger" :icon="Close" v-if="ActiveStatue === 'process'" @click="handleSubmit">停止检测</el-button>
|
||||
<el-button type="primary" :icon="Refresh" v-if="ActiveStatue === 'error'" @click="handleSubmit">重新检测</el-button>
|
||||
<el-button type="primary" :icon="Right" v-if="ActiveStatue === 'success'" @click="nextStep">{{nextStepText}}</el-button>
|
||||
<el-button type="primary"
|
||||
v-if="(stepsActiveIndex <= stepsTotalNum - 1) && (ActiveStatue !== 'success' &&ActiveStatue !== 'test_init' && ActiveStatue !=='paused_ing' && ActiveStatue !=='paused' && ActiveStatue !== 'waiting' && ActiveStatue !== 'error' && ActiveStatue !== 'test_init_fail' && ActiveStatue !== 'connect_timeout' && ActiveStatue!=='pause_timeout')"
|
||||
disabled>
|
||||
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
|
||||
<component :is="Refresh"/>
|
||||
</el-icon>
|
||||
检测中
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" v-if="ActiveStatue === 'process'" disabled>-->
|
||||
<!-- <el-icon class="loading-box" style="color: #fff;margin-right: 8px;">-->
|
||||
<!-- <component :is="Refresh"/>-->
|
||||
<!-- </el-icon>-->
|
||||
<!-- 检测中-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="warning" :icon="VideoPlay" v-if="TestStatus === 'paused'" @click="handleSubmit">继续检测</el-button>
|
||||
<!-- <el-button type="primary" :icon="RefreshLeft" v-if="ActiveStatue === 'recheck' || ActiveStatue ==='error' || ActiveStatue ==='test_init_fail' || ActiveStatue === 'pause_timeout' || ActiveStatue === 'connect_timeout'" @click="handleSubmit">重新检测</el-button>-->
|
||||
<el-button type="primary" v-if="TestStatus === 'test_init'" disabled>
|
||||
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
|
||||
<component :is="Refresh"/>
|
||||
</el-icon>
|
||||
初始化中
|
||||
</el-button>
|
||||
<el-button type="warning" v-if="TestStatus === 'paused_ing'" disabled>
|
||||
<el-icon class="loading-box" style="color: #fff;margin-right: 8px;">
|
||||
<component :is="Refresh"/>
|
||||
</el-icon>
|
||||
暂停中
|
||||
</el-button>
|
||||
<el-button :type="ActiveStatue==='success'?'primary':'danger'" :icon="Right"
|
||||
v-if="nextStepText !== '下一步' && (ActiveStatue === 'success'||ActiveStatue==='error'||ActiveStatue==='test_init_fail'||ActiveStatue==='connect_timeout'||ActiveStatue==='pause_timeout')"
|
||||
@click="nextStep">
|
||||
{{ nextStepText }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -35,95 +64,193 @@
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup name="testPopup">
|
||||
import { h } from 'vue';
|
||||
import{ElMessage, ElSelectV2, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument,Edit, Picture, UploadFilled, SuccessFilled,VideoPlay,Right,Refresh,Close, Odometer,Coin,Key, DArrowRight} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {reactive, ref, watch} from 'vue';
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {Coin, DArrowRight, Edit, Key, Odometer, Refresh, Right, SuccessFilled, UploadFilled, VideoPlay} from '@element-plus/icons-vue'
|
||||
import preTest from './preTest.vue'
|
||||
import timeTest from './timeTest.vue'
|
||||
import channelsTest from './channelsTest.vue'
|
||||
//import SvgIcon from '@/components/SvgIcon.vue';
|
||||
import factorTest from './factorTest.vue'
|
||||
import test from './test.vue'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import {pauseTest, resumeTest, startPreTest} from '@/api/socket/socket'
|
||||
|
||||
// import preTestIcon from '@/assets/icons/preTest.svg'
|
||||
|
||||
// const preTestIcon = `
|
||||
// <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
||||
// </svg>
|
||||
// `;
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
dialogTitle: string;
|
||||
|
||||
formData: {
|
||||
id: string;//误差体系表Id
|
||||
name: string;//误差体系名称
|
||||
standard_Name:string;//参照标准名称
|
||||
standard_Time:string;//标准推行时间
|
||||
dev_Level:string;//使用设备等级
|
||||
enable:number;//状态:0-不启用 1-启用
|
||||
state:number;//0-删除 1-正常
|
||||
};
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const skipDisabled = ref(false);
|
||||
const checkStore = useCheckStore();
|
||||
const nextStepText = ref('下一步');
|
||||
//定义与预检测配置数组
|
||||
const detectionOptions = ref([
|
||||
{
|
||||
id: 0,
|
||||
name: "源通讯检测",//判断源通讯是否正常
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "设备通讯检测",//判断设备的IP、Port、识别码、秘钥是否正常
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "协议校验",//ICD报告触发测试
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "相序校验",//判断装置的接线是否正确
|
||||
selected: true,
|
||||
},
|
||||
// {
|
||||
// id: 4,
|
||||
// name: "守时校验",//判断装置24小时内的守时误差是否小于1s
|
||||
// selected: true,
|
||||
// },
|
||||
// {
|
||||
// id: 5,
|
||||
// name: "通道系数校准",//通过私有协议与装置进行通讯,校准三相电压电流的通道系数
|
||||
// selected: true,
|
||||
// },
|
||||
// {
|
||||
// id: 6,
|
||||
// name: "实时数据比对",
|
||||
// },
|
||||
// {
|
||||
// id: 7,
|
||||
// name: "录波数据比对",
|
||||
// },
|
||||
]);
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const stepsTotalNum = ref(5);//步骤总数
|
||||
const stepsActiveIndex = ref(0); //当前正在执行的步骤索引
|
||||
const stepsTotalNum = ref(-1);//步骤总数
|
||||
const stepsActiveIndex = ref(1); //当前正在执行的步骤索引
|
||||
const stepsActiveView = ref(-1); //当前正在执行的步骤在(预处理、守时校验、系数校准、正式检测)中的排序,仅用于页面显示
|
||||
const stepsActive = ref(-1); //当前正在执行的步骤在(预处理、守时校验、系数校准、正式检测)中的排序,实际记录步骤的状态,用于切换步骤
|
||||
const ActiveStatue = ref('waiting');//当前步骤状态
|
||||
const preTestStatus = ref('waiting');//预检测执行状态
|
||||
const timeTestStatus = ref('waiting');//守时校验执行状态
|
||||
const channelsTestStatus = ref('waiting');//通道系数校准执行状态
|
||||
const TestStatus = ref('waiting');//正式检测执行状态
|
||||
const webMsgSend = ref();//webSocket推送的数据
|
||||
|
||||
const dialogTitle = ref('')
|
||||
const showComponent = ref(true)
|
||||
const preTestRef = ref(null)
|
||||
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
|
||||
// 勾选的检测内容
|
||||
const preTestSelected = ref(false)
|
||||
const timeTestSelected = ref(false)
|
||||
const channelsTestSelected = ref(false)
|
||||
const testSelected = ref(false)
|
||||
|
||||
const initOperate = () => {
|
||||
ActiveStatue.value = 'waiting'
|
||||
preTestStatus.value = 'waiting'
|
||||
timeTestStatus.value = 'waiting'
|
||||
channelsTestStatus.value = 'waiting'
|
||||
TestStatus.value = 'waiting'
|
||||
|
||||
stepsActiveIndex.value = 1
|
||||
showComponent.value = true
|
||||
// 初始化勾选的检测内容
|
||||
preTestSelected.value = checkStore.selectTestItems.preTest
|
||||
timeTestSelected.value = checkStore.selectTestItems.timeTest
|
||||
channelsTestSelected.value = checkStore.selectTestItems.channelsTest
|
||||
testSelected.value = checkStore.selectTestItems.test
|
||||
|
||||
let count = 0
|
||||
for (let key in checkStore.selectTestItems) {
|
||||
if (checkStore.selectTestItems[key]) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
stepsTotalNum.value = count + 1
|
||||
|
||||
if (preTestSelected.value) {
|
||||
stepsActiveView.value = 1
|
||||
stepsActive.value = 1
|
||||
return
|
||||
}
|
||||
if (timeTestSelected.value) {
|
||||
stepsActiveView.value = 2
|
||||
stepsActive.value = 2
|
||||
return
|
||||
}
|
||||
if (channelsTestSelected.value) {
|
||||
stepsActiveView.value = 3
|
||||
stepsActive.value = 3
|
||||
return
|
||||
}
|
||||
if (testSelected.value) {
|
||||
stepsActiveView.value = 4
|
||||
stepsActive.value = 4
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const open = (title: string) => {
|
||||
initOperate()
|
||||
dialogTitle.value = title;
|
||||
dialogVisible.value = true;
|
||||
|
||||
if (preTestRef.value) {
|
||||
preTestRef.value.initializeParameters();
|
||||
}
|
||||
|
||||
//开始创建webSocket客户端
|
||||
socketClient.Instance.connect();
|
||||
dataSocket.socketServe = socketClient.Instance;
|
||||
dataSocket.socketServe.registerCallBack('aaa', (res) => {
|
||||
// 处理来自服务器的消息
|
||||
// console.log('Received message:', res);
|
||||
// 根据需要在这里添加更多的处理逻辑
|
||||
if (res.code === 20000) {
|
||||
//ElMessage.error(message.message)
|
||||
// loading.close()
|
||||
} else {
|
||||
webMsgSend.value = res
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// let loading;
|
||||
const handleSubmit = () => {
|
||||
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||
let planId = checkStore.plan.id
|
||||
|
||||
if (!dataSocket.socketServe.connected) {
|
||||
ElMessage.error('webSocket连接中断!')
|
||||
return
|
||||
}
|
||||
console.log("handleSubmit",stepsActive.value,TestStatus.value)
|
||||
switch (stepsActive.value) {
|
||||
case 1:
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType: '1' // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '检测失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
preTestStatus.value = 'error'
|
||||
}
|
||||
})
|
||||
preTestStatus.value = 'start'
|
||||
// setTimeout(() => {
|
||||
// preTestStatus.value = 'success'
|
||||
// }, 5000)
|
||||
break;
|
||||
case 2:
|
||||
timeTestStatus.value = 'start'
|
||||
break;
|
||||
case 3:
|
||||
// 调用系数校准组件的handleSubmit方法
|
||||
channelsTestStatus.value = 'start'
|
||||
break;
|
||||
case 4:
|
||||
if (TestStatus.value == "waiting") {
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType: checkStore.reCheckType ==1 ?'2':'8' // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TestStatus.value = 'test_init_fail'
|
||||
}
|
||||
})
|
||||
TestStatus.value = 'start'
|
||||
} else if (TestStatus.value == 'paused') {
|
||||
// 发送继续指令
|
||||
sendResume()
|
||||
}
|
||||
// else if (TestStatus.value == 'recheck') {
|
||||
// // 发送重新检测指令
|
||||
// sendReCheck()
|
||||
// }
|
||||
// else if (TestStatus.value == 'success') {
|
||||
// handleClose()
|
||||
// }
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'quitClicked'): void;
|
||||
}>();
|
||||
|
||||
watch(preTestStatus, function (newValue, oldValue) {
|
||||
console.log(newValue, oldValue);
|
||||
@@ -147,143 +274,168 @@ const detectionOptions = ref([
|
||||
})
|
||||
|
||||
watch(ActiveStatue, function (newValue, oldValue) {
|
||||
|
||||
if(newValue === 'success' || newValue === 'error')
|
||||
skipDisabled.value = false
|
||||
|
||||
if(newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2)
|
||||
{
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
if (newValue === 'error') {
|
||||
// stepsActiveIndex.value = stepsTotalNum.value + 2
|
||||
nextStepText.value = '检测失败'
|
||||
}
|
||||
if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 1) {
|
||||
stepsActiveIndex.value += 2
|
||||
nextStepText.value = '检测完成'
|
||||
}
|
||||
if (newValue === 'test_init_fail') {
|
||||
stepsActiveIndex.value += 2
|
||||
nextStepText.value = '初始化失败'
|
||||
}
|
||||
if (newValue === 'connect_timeout') {
|
||||
stepsActiveIndex.value += 2
|
||||
nextStepText.value = '连接超时'
|
||||
}
|
||||
if (newValue === 'pause_timeout') {
|
||||
stepsActiveIndex.value += 2
|
||||
// nextStepText.value = '结束测试'
|
||||
nextStepText.value = '暂停超时'
|
||||
}
|
||||
if (newValue === 'success' && stepsActiveIndex.value < stepsTotalNum.value - 1) {
|
||||
nextStep() // 实现自动点击,进入下一个测试内容
|
||||
handleSubmit()
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
const getIcon = (index: number) => {
|
||||
if (stepsActiveIndex.value > index) return SuccessFilled;
|
||||
switch (index) {
|
||||
case 0: return h(<svg-icon name="preTest"></svg-icon>);
|
||||
case 1: return UploadFilled;
|
||||
case 2: return Odometer;
|
||||
case 3: return Coin;
|
||||
case 4: return Key;
|
||||
default: return null;
|
||||
const sendPause = () => {
|
||||
console.log('发起暂停请求')
|
||||
|
||||
TestStatus.value = 'paused_ing'
|
||||
pauseTest().then(res => {
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'preStopTest',
|
||||
operateCode: 'stop'
|
||||
})
|
||||
})
|
||||
// setTimeout(() => {
|
||||
// Object.assign(webMsgSend.value, {
|
||||
// requestId: 'preStopTest',
|
||||
// operateCode: 'stop'
|
||||
// })
|
||||
// }, 5000)
|
||||
}
|
||||
const sendResume = () => {
|
||||
console.log('发起继续检测请求')
|
||||
|
||||
resumeTest({
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.plan.id,
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
})
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Resume_Success'
|
||||
})
|
||||
}
|
||||
|
||||
const sendReCheck = () => {
|
||||
console.log('发送重新检测指令')
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.plan.id,
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TestStatus.value = 'test_init_fail'
|
||||
}
|
||||
})
|
||||
TestStatus.value = 'start'
|
||||
}
|
||||
};
|
||||
|
||||
const nextStep = () => {
|
||||
if(stepsActiveIndex.value < stepsTotalNum.value )
|
||||
{
|
||||
stepsActiveIndex.value++
|
||||
if (stepsActiveIndex.value == stepsTotalNum.value + 1 || ActiveStatue.value === 'error' || ActiveStatue.value === 'test_init_fail' || ActiveStatue.value === 'connect_timeout' || ActiveStatue.value === 'pause_timeout') {
|
||||
handleClose()
|
||||
return
|
||||
}
|
||||
if (ActiveStatue.value != 'error') {
|
||||
ActiveStatue.value = 'waiting'
|
||||
let tempStep = stepsActiveIndex.value
|
||||
let idx = 1
|
||||
stepsActiveIndex.value++
|
||||
for (let selectTestItemsKey in checkStore.selectTestItems) {
|
||||
if (tempStep == 0 && checkStore.selectTestItems[selectTestItemsKey]) {
|
||||
stepsActiveView.value = idx
|
||||
stepsActive.value = idx
|
||||
return
|
||||
}
|
||||
if (checkStore.selectTestItems[selectTestItemsKey] && tempStep != 0) {
|
||||
tempStep--
|
||||
}
|
||||
idx++
|
||||
}
|
||||
}
|
||||
else if(stepsActiveIndex.value === stepsTotalNum.value)
|
||||
{
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
clearData()
|
||||
|
||||
// if (stepsActiveIndex.value < stepsTotalNum.value && ActiveStatue.value != 'error') {
|
||||
// stepsActiveIndex.value++
|
||||
// if (!checkStore.selectTestItems.timeTest) { // 不具备守时检测
|
||||
// stepsActiveIndex.value++
|
||||
// }
|
||||
//
|
||||
// ActiveStatue.value = 'waiting'
|
||||
// } else if (stepsActiveIndex.value === stepsTotalNum.value || ActiveStatue.value === 'error') {
|
||||
// //emit('update:visible', false); // 关闭对话框
|
||||
// clearData()
|
||||
// dialogVisible.value = false;
|
||||
// }
|
||||
}
|
||||
|
||||
const handleStepClick = (step: number) => {
|
||||
if (step > stepsActive.value) {
|
||||
return
|
||||
} else {
|
||||
stepsActiveView.value = step
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function clearData() {
|
||||
stepsActiveIndex.value = 0;
|
||||
stepsTotalNum.value = -1
|
||||
stepsActiveIndex.value = 1
|
||||
stepsActiveView.value = -1
|
||||
preTestStatus.value = "waiting"
|
||||
timeTestStatus.value = "waiting"
|
||||
channelsTestStatus.value = "waiting"
|
||||
TestStatus.value = "waiting"
|
||||
ActiveStatue.value = "waiting"
|
||||
nextStepText.value = "下一步"
|
||||
}
|
||||
|
||||
const beforeClose = (done: () => void) => {
|
||||
console.log(stepsActiveIndex.value,stepsTotalNum.value)
|
||||
if(stepsActiveIndex.value < stepsTotalNum.value)
|
||||
{
|
||||
ElMessageBox.confirm(
|
||||
'检测未完成,是否退出当前检测流程?',
|
||||
'提示',
|
||||
{
|
||||
if (stepsActiveIndex.value < stepsTotalNum.value && ActiveStatue.value != 'error') {
|
||||
ElMessageBox.confirm('检测未完成,是否退出当前检测流程?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
clearData()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
|
||||
).then(() => {
|
||||
handleClose()
|
||||
})
|
||||
} else {
|
||||
handleClose()
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
dataSocket.socketServe.closeWs()
|
||||
dialogVisible.value = false;
|
||||
clearData()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
}
|
||||
// ElMessageBox.confirm('Are you sure to close this dialog?')
|
||||
// .then(() => {
|
||||
// done()
|
||||
// })
|
||||
// .catch(() => {
|
||||
// // catch error
|
||||
// })
|
||||
}
|
||||
const handleCancel = () => {
|
||||
// clearData()
|
||||
// emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
showComponent.value = false;
|
||||
|
||||
const handleSubmit = () => {
|
||||
skipDisabled.value = true
|
||||
switch (stepsActiveIndex.value) {
|
||||
case 0:
|
||||
preTestStatus.value = 'start'
|
||||
break;
|
||||
case 1:
|
||||
timeTestStatus.value = 'start'
|
||||
break;
|
||||
case 2:
|
||||
channelsTestStatus.value = 'start'
|
||||
break;
|
||||
case 3:
|
||||
TestStatus.value = 'start'
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
emit('quitClicked'); // 触发事件
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 当 props.visible 改变时,更新 formData
|
||||
watch(() => props.visible, (newVal) => {
|
||||
if (!newVal) {
|
||||
// 这里可以重置表单数据,如果需要的话
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//选中
|
||||
// 处理选择变化
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
multipleSelection.value = selection.map(row => row.id); // 更新选中的行
|
||||
|
||||
};
|
||||
const openAddDialog = () => {
|
||||
tableData.value.push({
|
||||
id: tableData.value.length + 1,
|
||||
type: '',
|
||||
startSelect: '',
|
||||
startRange: '',
|
||||
endSelect: '',
|
||||
endRange: '',
|
||||
unit:'',
|
||||
maxErrorValue:'',
|
||||
errorType:''
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 对外映射
|
||||
defineExpose({open})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -291,12 +443,6 @@ const getIcon = (index: number) => {
|
||||
:deep(.dialog-big .el-dialog__body) {
|
||||
max-height: 840px !important;
|
||||
}
|
||||
// :deep(.dialog-big){
|
||||
// max-height: 840px !important;
|
||||
// }
|
||||
// :deep(.el-dialog__body){
|
||||
// max-height: 840px !important;
|
||||
// }
|
||||
|
||||
.steps-container :deep(.test-head-steps) {
|
||||
height: 80px;
|
||||
@@ -324,6 +470,19 @@ const getIcon = (index: number) => {
|
||||
line-height: 1; /* 调整行高以确保底部对齐 */
|
||||
}
|
||||
|
||||
.loading-box {
|
||||
animation: loading 1.5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
// :deep(.test-head-steps){
|
||||
// height: 100px;
|
||||
// margin-bottom: 20px;
|
||||
|
||||
@@ -1,8 +1,37 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="守时误差">
|
||||
<div class="right-title" >
|
||||
<span v-if="activeIndex <= 1"> </span>
|
||||
<span v-if="activeIndex > 1" class="time-text">
|
||||
标准时间: <span style="color: #003078">{{ gpsTime }}</span>
|
||||
</span>
|
||||
<div class="error-dsc">
|
||||
<div class="green-div"></div>
|
||||
<span class="description-text">
|
||||
合格≤1000ms
|
||||
</span>
|
||||
|
||||
<div class="red-div"></div>
|
||||
<span class="description-text unqualified">
|
||||
不合格>1000ms
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="test-dialog">
|
||||
<div class="dialog-left">
|
||||
<el-timeline style="max-width: 600px">
|
||||
<el-steps direction="vertical" :active="stepsIndex" :process-status="currentStepStatus"
|
||||
finish-status="success">
|
||||
<el-step title="开始检测" />
|
||||
<el-step title="触发设备检测GPS时刻的标准时间"/>
|
||||
<el-step title="设备开始上送"/>
|
||||
<el-step title="设备结束上送"/>
|
||||
<el-step title="检测完成"/>
|
||||
</el-steps>
|
||||
<!-- <el-timeline style="max-width: 600px">
|
||||
<el-timeline-item
|
||||
v-for="(activity, index) in activities"
|
||||
:key="index"
|
||||
@@ -15,24 +44,68 @@
|
||||
>
|
||||
{{ activity.content }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-timeline> -->
|
||||
</div>
|
||||
<div class="dialog-right">
|
||||
<div class="right-title">
|
||||
<!-- <div>设备上送时刻表</div> -->
|
||||
<div>
|
||||
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
|
||||
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button>
|
||||
|
||||
<!-- <span v-if="activeIndex <= 1"> </span>
|
||||
<span v-if="activeIndex > 1" style=" font-size: 18px;font-weight: 600;">
|
||||
标准时间: <span style="color: #003078">{{ gpsTime }}</span>
|
||||
</span>
|
||||
<div class="error-dsc">
|
||||
<div class="green-div"></div>
|
||||
<span style=" color: #606266; font-size: 16px;font-weight: 600;">
|
||||
守时误差≤1000ms
|
||||
</span>
|
||||
|
||||
<div class="red-div"></div>
|
||||
<span style=" color: #F56C6c; font-size: 16px;font-weight: 600;">
|
||||
守时误差>1000ms
|
||||
</span>
|
||||
</div> -->
|
||||
<!-- <span style=" font-size: 18px;font-weight: 600;">
|
||||
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">4</span> 台
|
||||
</span> -->
|
||||
<!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
|
||||
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="right-content">
|
||||
<el-table :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
||||
<el-table-column prop="deviceName" label="设备名" />
|
||||
<div class="right-content table-main">
|
||||
<el-empty description="暂无数据,等待检测开始" v-if="activeIndex === 0" />
|
||||
<!-- <ProTable v-if="activeIndex > 0" ref='proTable' :pagination='false' :toolButton='false' :showCard='false' :columns='columns'
|
||||
:data='deviceOperatorData' stripe :header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }" style="width: 100%; height:435px" border>
|
||||
</ProTable> -->
|
||||
|
||||
<el-table
|
||||
v-if="activeIndex > 0"
|
||||
:data="deviceOperatorData"
|
||||
stripe
|
||||
:header-cell-class-name="'el-table-header'"
|
||||
:cell-class-name="'el-table-cell'"
|
||||
class="el-table"
|
||||
border>
|
||||
<el-table-column prop="deviceName" label="设备名称" />
|
||||
<el-table-column prop="updataTime" label="上送时刻" />
|
||||
<el-table-column prop="ErrorValue" label="守时误差(ms)" />
|
||||
<el-table-column prop="ErrorValue" label="守时误差(ms)">
|
||||
<!-- <template #header>
|
||||
<span>守时误差(ms)</span>
|
||||
<el-tooltip content = "守时误差 = |设备上送时间 - 标准时间|,最大显示值为9999毫秒,超过该值的统一用ErrorMax来表示" placement="top" style="align-items: bottom;">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column prop="Result" label="检测结果">
|
||||
<!-- <template #header>
|
||||
<span>检测结果</span>
|
||||
<el-tooltip content = "守时误差小于等于1000毫秒为合格,否则不合格" placement="top" style="align-items: bottom;">
|
||||
<el-icon><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</template> -->
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag>
|
||||
<el-tag v-if="scope.row.Result === '不合格'" type="danger">{{ scope.row.Result }}</el-tag>
|
||||
<span v-if="scope.row.Result != '不合格'">{{scope.row.Result}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -44,9 +117,16 @@
|
||||
</template>
|
||||
<script lang="tsx" setup name="timeTest">
|
||||
import { SuccessFilled } from '@element-plus/icons-vue'
|
||||
import { reactive, ref, toRef, watch } from 'vue'
|
||||
|
||||
const stepsIndex = ref(0)
|
||||
const activeIndex = ref(0)
|
||||
const activeTotalNum = ref(5)
|
||||
const activeTotalNum = ref(7)
|
||||
const startTime = ref('')
|
||||
const gpsTime = ref('')
|
||||
const devStartTime = ref('')
|
||||
const devEndTime = ref('')
|
||||
const finishTime = ref('')
|
||||
|
||||
interface Activity {
|
||||
content: string;
|
||||
@@ -56,6 +136,7 @@ interface Activity {
|
||||
color?: string;
|
||||
icon?: any;
|
||||
}
|
||||
const qualified = ref(0)
|
||||
const activities = ref<Activity[]>([
|
||||
{
|
||||
content: '开始检测',
|
||||
@@ -63,55 +144,30 @@ const activities = ref<Activity[]>([
|
||||
},])
|
||||
|
||||
|
||||
const deviceOperatorData = ref([
|
||||
{
|
||||
deviceName: '被检设备1',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备2',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备3',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备4',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
])
|
||||
const deviceOperatorData = ref([])
|
||||
|
||||
const deviceData = ref([
|
||||
{
|
||||
deviceName: '被检设备1',
|
||||
updataTime: '10:30:08.136',
|
||||
deviceName: '240001',
|
||||
updataTime: '2024-12-05 10:30:08.136',
|
||||
ErrorValue: '148',
|
||||
Result: '合格',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备2',
|
||||
updataTime: '10:30:08.136',
|
||||
deviceName: '240002',
|
||||
updataTime: '2024-12-05 10:30:08.136',
|
||||
ErrorValue: '136',
|
||||
Result: '合格',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备3',
|
||||
updataTime: '10:30:09.006',
|
||||
deviceName: '240003',
|
||||
updataTime: '2024-12-05 10:30:09.006',
|
||||
ErrorValue: '1006',
|
||||
Result: '不合格',
|
||||
},
|
||||
{
|
||||
deviceName: '被检设备4',
|
||||
updataTime: '10:30:08.736',
|
||||
deviceName: '240004',
|
||||
updataTime: '2024-12-05 10:30:08.736',
|
||||
ErrorValue: '736',
|
||||
Result: '合格',
|
||||
},
|
||||
@@ -126,82 +182,154 @@ const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process
|
||||
})
|
||||
const testStatus = toRef(props, 'testStatus');
|
||||
const ts = ref('');
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive([
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'deviceName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'updataTime',
|
||||
label: '上送时刻',
|
||||
// width: 230,
|
||||
},
|
||||
{
|
||||
prop: 'ErrorValue',
|
||||
label: '守时误差(ms)',
|
||||
// width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'Result',
|
||||
label: '检测结果',
|
||||
// width: 100,
|
||||
render: (scope: { row: { Result: string } }) => {
|
||||
if (scope.row.Result === '不合格') {
|
||||
return (
|
||||
<el-tag type='danger'>{scope.row.Result}</el-tag>
|
||||
)
|
||||
}
|
||||
else {
|
||||
return (
|
||||
<span>{scope.row.Result}</span>
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
])
|
||||
//监听testStatus的变化
|
||||
watch(testStatus, function (newValue, oldValue) {
|
||||
ts.value = props.testStatus;
|
||||
if(ts.value==='start')
|
||||
{
|
||||
if (ts.value === 'start') {
|
||||
ts.value = 'process'
|
||||
|
||||
let timer = setInterval(() => {
|
||||
if(activeIndex.value < activeTotalNum.value - 2)
|
||||
if (activeIndex.value < activeTotalNum.value)
|
||||
activeIndex.value++
|
||||
else if(activeIndex.value === activeTotalNum.value -2)
|
||||
{
|
||||
activeIndex.value++
|
||||
activeIndex.value++
|
||||
}
|
||||
else
|
||||
{
|
||||
// else if (activeIndex.value === activeTotalNum.value - 2) {
|
||||
// activeIndex.value++
|
||||
// activeIndex.value++
|
||||
// }
|
||||
else {
|
||||
clearInterval(timer)
|
||||
ts.value = 'success'
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
function formatDateTime(date: Date) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
const milliseconds = String(date.getMilliseconds()).padStart(3, '0');
|
||||
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
|
||||
}
|
||||
|
||||
function addMillisecondsToDate(dateString: string, millisecondsToAdd: number): Date {
|
||||
// 解析字符串为 Date 对象
|
||||
const [datePart, timePart] = dateString.split(' ');
|
||||
const [year, month, day] = datePart.split('-').map(Number);
|
||||
const [hours, minutes, seconds, milliseconds] = timePart.split(':').flatMap(part => part.split('.')).map(Number);
|
||||
|
||||
// 创建 Date 对象(注意:月份是从 0 开始的)
|
||||
const date = new Date(year, month - 1, day, hours, minutes, seconds, milliseconds);
|
||||
|
||||
// 增加指定的毫秒数
|
||||
date.setMilliseconds(date.getMilliseconds() + millisecondsToAdd);
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
watch(activeIndex, function (newValue, oldValue) {
|
||||
|
||||
if(activeIndex.value === 1)
|
||||
{
|
||||
activities.value.length = 0;
|
||||
activities.value.push({
|
||||
content: '开始检测',
|
||||
timestamp: '2018-04-12 20:46',
|
||||
size: 'large',
|
||||
color: '#0bbd87',
|
||||
icon: SuccessFilled,
|
||||
});
|
||||
}
|
||||
if(activeIndex.value === 2)
|
||||
{
|
||||
activities.value.push({
|
||||
content: 'GPS上送时刻',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
color: '#0bbd87',
|
||||
icon: SuccessFilled,
|
||||
size: 'large',
|
||||
});
|
||||
}
|
||||
if(activeIndex.value === 3)
|
||||
{
|
||||
activities.value.push({
|
||||
content: '设备最早上送时刻',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
color: '#0bbd87',
|
||||
icon: SuccessFilled,
|
||||
size: 'large',
|
||||
});
|
||||
console.log(activeIndex.value,111,stepsIndex.value,222)
|
||||
|
||||
if (activeIndex.value === 1) {
|
||||
startTime.value = formatDateTime(new Date());
|
||||
stepsIndex.value = 1;
|
||||
// activities.value.length = 0;
|
||||
// activities.value.push({
|
||||
// content: '开始检测',
|
||||
// timestamp: '2018-04-12 20:46',
|
||||
// size: 'large',
|
||||
// color: '#0bbd87',
|
||||
// icon: SuccessFilled,
|
||||
// });
|
||||
}
|
||||
if (activeIndex.value === 2) {
|
||||
stepsIndex.value = 2;
|
||||
gpsTime.value = formatDateTime(new Date());
|
||||
// activities.value.push({
|
||||
// content: 'GPS上送时刻',
|
||||
// timestamp: '2018-04-03 20:46',
|
||||
// color: '#0bbd87',
|
||||
// icon: SuccessFilled,
|
||||
// size: 'large',
|
||||
// });
|
||||
}
|
||||
if (activeIndex.value === 3) {
|
||||
stepsIndex.value = 3;
|
||||
deviceOperatorData.value.length = 0;
|
||||
deviceOperatorData.value = deviceData.value;
|
||||
}
|
||||
if(activeIndex.value > 3)
|
||||
{
|
||||
activities.value.push({
|
||||
content: '设备最晚上送时刻',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
color: '#0bbd87',
|
||||
icon: SuccessFilled,
|
||||
size: 'large',
|
||||
});
|
||||
activities.value.push({
|
||||
content: '检测结束',
|
||||
timestamp: '2018-04-03 20:46',
|
||||
color: '#0bbd87',
|
||||
icon: SuccessFilled,
|
||||
size: 'large',
|
||||
// deviceOperatorData.value = deviceData.value;
|
||||
deviceOperatorData.value.push({
|
||||
deviceName: '240002',
|
||||
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 136)),
|
||||
ErrorValue: '136',
|
||||
Result: '合格',
|
||||
});
|
||||
}
|
||||
if (activeIndex.value === 4) {
|
||||
deviceOperatorData.value.push({
|
||||
deviceName: '240001',
|
||||
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 148)),
|
||||
ErrorValue: '148',
|
||||
Result: '合格',
|
||||
});
|
||||
}
|
||||
if (activeIndex.value === 5) {
|
||||
deviceOperatorData.value.push({
|
||||
deviceName: '240004',
|
||||
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 736)),
|
||||
ErrorValue: '736',
|
||||
Result: '合格',
|
||||
});
|
||||
}
|
||||
if (activeIndex.value === 6) {
|
||||
stepsIndex.value = 5;
|
||||
deviceOperatorData.value.push({
|
||||
deviceName: '240003',
|
||||
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 1006)),
|
||||
ErrorValue: '1006',
|
||||
Result: '不合格',
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
const emit = defineEmits(['update:testStatus']);
|
||||
//监听sn
|
||||
@@ -213,31 +341,69 @@ watch(ts, function (newValue, oldValue) {
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
|
||||
.test-dialog {
|
||||
height: 350px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: row; /* 横向排列 */
|
||||
flex-direction: row;
|
||||
/* 横向排列 */
|
||||
margin-top: 20px;
|
||||
min-height: 300px;
|
||||
/* .dialog-left{
|
||||
margin-right: 20px;
|
||||
} */
|
||||
}
|
||||
|
||||
.dialog-left {
|
||||
margin-left: 20px;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.dialog-right {
|
||||
margin-top: 25px;
|
||||
margin-left: 20px;
|
||||
/* margin-top: 25px;
|
||||
margin-left: 20px; */
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.right-title {
|
||||
height: 32px;
|
||||
display: flex;
|
||||
flex-direction: row; /* 横向排列 */
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
flex-direction: row;
|
||||
/* 横向排列 */
|
||||
justify-content: space-between;
|
||||
/* margin-bottom: 10px; */
|
||||
|
||||
}
|
||||
|
||||
.error-dsc{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.green-div{
|
||||
width: 20px;
|
||||
height: 14px;
|
||||
border-radius: 4px;
|
||||
background-color: #606266;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.red-div{
|
||||
width: 20px;
|
||||
height: 14px;
|
||||
border-radius: 4px;
|
||||
background-color: #F56C6C;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.right-content{
|
||||
height: 440px;
|
||||
}
|
||||
|
||||
/* width: 100%;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
@@ -250,4 +416,70 @@ watch(ts, function (newValue, oldValue) {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px 20px 10px 20px;
|
||||
box-sizing: border-box; */
|
||||
|
||||
.right-title .time-text {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.right-title .gps-time {
|
||||
color: #003078;
|
||||
}
|
||||
|
||||
.error-dsc {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 10px; /* 根据需要调整 */
|
||||
}
|
||||
|
||||
.error-dsc .green-div,
|
||||
.error-dsc .red-div {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.error-dsc .green-div {
|
||||
background-color: #67C23A;
|
||||
}
|
||||
|
||||
.error-dsc .red-div {
|
||||
background-color: #F56C6C;
|
||||
}
|
||||
|
||||
.error-dsc .description-text {
|
||||
color: #606266;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.error-dsc .description-text.unqualified {
|
||||
color: #F56C6C;
|
||||
}
|
||||
|
||||
.el-table-header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-table-cell {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-table {
|
||||
margin-top: -30px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tooltip-icon {
|
||||
margin-left: 4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.result-tag {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.result-text {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
<div class='search_view'>
|
||||
<el-input
|
||||
placeholder='请输入计划名称'
|
||||
clearable
|
||||
v-model='searchForm.planName'
|
||||
></el-input>
|
||||
<el-tooltip content="检测计划列表" placement="top">
|
||||
<Menu style='width: 26px;height: 26px; margin-left: 8px;cursor: pointer;color:var(--el-color-primary)'
|
||||
@click.stop='detail()' />
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class='tree_container'>
|
||||
<el-tree
|
||||
@@ -15,6 +18,8 @@
|
||||
:filter-node-method='filterNode'
|
||||
:props='defaultProps'
|
||||
node-key='id'
|
||||
class="filter-tree"
|
||||
:highlight-current="true"
|
||||
default-expand-all
|
||||
:default-checked-keys='defaultChecked'
|
||||
@node-click='handleNodeClick'
|
||||
@@ -22,7 +27,7 @@
|
||||
<template #default='{ node, data }'>
|
||||
<span class='custom-tree-node' style='display: flex;align-items: center;'>
|
||||
<Platform v-if='!data.pid' style='width:18px;height: 18px;margin-right:8px;'
|
||||
:style="{color:node.label=='未检测'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" />
|
||||
:style="{color:node.label=='未检'?'#fac858':node.label=='检测中'?'#ee6666':'#91cc75'}" />
|
||||
<span>{{ node.label }}</span>
|
||||
<!-- <Menu v-if="data.pid" @click.stop="detail(data)" style="width: 12px;margin-left: 8px;"/> -->
|
||||
</span>
|
||||
@@ -32,10 +37,17 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang='ts' setup>
|
||||
import { type Plan } from '@/api/plan/interface';
|
||||
import { Menu, Platform, CircleCheck,Loading } from '@element-plus/icons-vue'
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import { ElTooltip } from 'element-plus';
|
||||
|
||||
const router = useRouter()
|
||||
const checkStore = useCheckStore()
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
const data: any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
@@ -45,14 +57,54 @@ const defaultProps = {
|
||||
const searchForm = ref({
|
||||
planName: '',
|
||||
})
|
||||
const defaultChecked = ref([])
|
||||
const defaultChecked = ref<string[]>([]) // 明确类型为 number[]
|
||||
const tree = ref(false)//确保左侧树高凉只执行一次
|
||||
const getTreeData = (val: any) => {
|
||||
defaultChecked.value = [];
|
||||
data.value = val;
|
||||
|
||||
for (let item of data.value) {
|
||||
if (item.children.length > 0) {
|
||||
let node = item.children[0];
|
||||
defaultChecked.value.push(node.id);
|
||||
checkStore.setPlan(node);
|
||||
// 高亮显示第一个节点
|
||||
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(node.id);
|
||||
idd.value = node.id;
|
||||
});
|
||||
// 找到第一个符合条件的 children 后跳出循环
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//点击表格后左侧树刷新,高亮显示对应节点
|
||||
const clickTableToTree = (val: any,id:any) => {
|
||||
|
||||
defaultChecked.value = []
|
||||
data.value = val
|
||||
defaultChecked.value.push(data.value[0].children[0].id)
|
||||
let node = ref('')
|
||||
if (data.value.length > 0) {
|
||||
for (let i = 0; i < data.value.length; i++){
|
||||
for (let j = 0; j < data.value[i].children.length; j++) {
|
||||
if (data.value[i].children[j].id == id) {
|
||||
node.value = data.value[i].children[j].id
|
||||
break;
|
||||
}
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
}
|
||||
}
|
||||
|
||||
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(node.value);
|
||||
idd.value = node.value
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const {updateSelectedTreeNode} = defineProps<{
|
||||
updateSelectedTreeNode:Function;
|
||||
}>();
|
||||
@@ -65,31 +117,47 @@ watch(
|
||||
deep: true,
|
||||
},
|
||||
)
|
||||
const handleNodeClick = (data) => {
|
||||
// console.log(data)
|
||||
updateSelectedTreeNode()
|
||||
|
||||
const idd = ref('')
|
||||
const handleNodeClick = (data: Plan.ResPlan) => {
|
||||
|
||||
if (data.name === '未检' || data.name === '检测中' || data.name === '检测完成') {
|
||||
// 如果是父节点,不执行任何操作
|
||||
//console.log('父节点不执行任何操作');
|
||||
// 设置当前高亮节点
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(idd.value);
|
||||
});
|
||||
return;
|
||||
}
|
||||
const filterNode = (value: string, data) => {
|
||||
|
||||
idd.value = data.id
|
||||
|
||||
checkStore.setPlan(data);
|
||||
updateSelectedTreeNode(data.id)
|
||||
}
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true
|
||||
return data.name.includes(value)
|
||||
}
|
||||
|
||||
|
||||
// 点击详情
|
||||
const detail = () => {
|
||||
router.push('/plan')
|
||||
router.push('/plan/planList')
|
||||
}
|
||||
onMounted(() => {
|
||||
// console.log()
|
||||
})
|
||||
defineExpose({ getTreeData })
|
||||
defineExpose({ getTreeData ,clickTableToTree})
|
||||
|
||||
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.plan_tree {
|
||||
// width: 200px;
|
||||
// height: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 5px;
|
||||
// height: calc(100% - 70px);
|
||||
background-color: #fff;
|
||||
|
||||
.search_view {
|
||||
@@ -112,13 +180,52 @@ defineExpose({ getTreeData })
|
||||
}
|
||||
|
||||
.tree_container {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
|
||||
.el-tree {
|
||||
// height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.filter-tree {
|
||||
// border: 1px solid #dcdfe6;
|
||||
min-width: 100%;
|
||||
height: 97%;
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
margin-top: 12px;
|
||||
|
||||
}
|
||||
|
||||
//.filter-tree span {
|
||||
// font-size: 16px;
|
||||
// display:block;
|
||||
// overflow:hidden;
|
||||
// word-break:keep-all;
|
||||
// white-space:nowrap;
|
||||
// text-overflow:ellipsis;
|
||||
// padding-right: 12px;
|
||||
//}
|
||||
.leftBox {
|
||||
// float: left;
|
||||
// width: 20%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.left {
|
||||
height: calc(100% - 45px);
|
||||
overflow: auto;
|
||||
}
|
||||
/* 设置滚动条宽度 */
|
||||
:deep(.bodyTwo ::-webkit-scrollbar) {
|
||||
width: 3px !important;
|
||||
height: 6px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,7 +37,10 @@ import { useAuthStore } from "@/stores/modules/auth";
|
||||
|
||||
import model from "./tabs/model.vue";
|
||||
import dashboard from "./tabs/dashboard.vue";
|
||||
import { onMounted } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
// defineOptions({
|
||||
// name: 'home'
|
||||
// })
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const activeIndex = ref("1-1");
|
||||
@@ -46,22 +49,21 @@ const modeList = [
|
||||
{
|
||||
name: "模拟式模式",
|
||||
code:"模拟式",
|
||||
subName: "未启用模拟式检测计划",
|
||||
img: "/src/assets/images/dashboard/1.svg",
|
||||
img: new URL('/src/assets/images/dashboard/1.svg', import.meta.url).href,
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
name: "数字式模式",
|
||||
code:"数字式",
|
||||
subName: "启用数字检测计划",
|
||||
img: "/src/assets/images/dashboard/2.svg",
|
||||
img: new URL('/src/assets/images/dashboard/2.svg', import.meta.url).href,
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
name: "比对式模式",
|
||||
code:"比对式",
|
||||
subName: "启用比对式检测计划",
|
||||
img: "/src/assets/images/dashboard/3.svg",
|
||||
img: new URL('/src/assets/images/dashboard/3.svg', import.meta.url).href,
|
||||
isActive: false,
|
||||
},
|
||||
];
|
||||
@@ -81,7 +83,8 @@ const handleSelect = (key: string, keyPath: string[]) => {
|
||||
//console.log(key, keyPath);
|
||||
};
|
||||
onMounted(() => {
|
||||
//console.log();
|
||||
//console.log(111);
|
||||
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -1,83 +1,87 @@
|
||||
<!-- 真正的首页 -->
|
||||
<template>
|
||||
<div class="static">
|
||||
<div class="left_tree">
|
||||
<tree ref="treeRef" :updateSelectedTreeNode="getPieData || (() => {})"/>
|
||||
<div class='static'>
|
||||
<el-row :gutter='10'>
|
||||
<el-col :lg='4' :xl='4' :md='4' :sm='4'>
|
||||
<div class='left_tree'>
|
||||
<!-- <tree ref='treeRef' :updateSelectedTreeNode='getPieData || (() => {})' /> -->
|
||||
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' />
|
||||
</div>
|
||||
<!-- <span class="new_span">测试scss颜色</span> -->
|
||||
<div class="right_container">
|
||||
</el-col>
|
||||
<el-col :lg='20' :xl='20' :md='20' :sm='20'>
|
||||
<div class='right_container'>
|
||||
<!-- 功能选择 -->
|
||||
<div class="container_function">
|
||||
<div class='container_function'>
|
||||
<div
|
||||
class="function_item"
|
||||
:class="
|
||||
item.checked ? 'function_item checked_function' : 'function_item'
|
||||
"
|
||||
v-for="(item, index) in tabsList"
|
||||
:key="index"
|
||||
@click="handleCheckFunction(item.value)"
|
||||
class='function_item'
|
||||
:class="item.checked ? 'function_item checked_function' : 'function_item'"
|
||||
v-for='(item, index) in tabsList'
|
||||
:key='index'
|
||||
@click='handleCheckFunction(item.value)'
|
||||
>
|
||||
<div class="item_img">
|
||||
<img :src="item.img" alt="" />
|
||||
<div class='item_img'>
|
||||
<img :src='item.img' />
|
||||
</div>
|
||||
<div class="item_text">
|
||||
<div class='item_text'>
|
||||
<p>{{ item.label }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-collapse v-model="activeNames" @change="handleChange">
|
||||
<el-collapse-item title="检测进度展示" name="1"> -->
|
||||
<div class="container_pieShow">
|
||||
<el-collapse model-value="1" accordion @change="handleCollapseChange">
|
||||
<el-collapse-item title="    检测进度展示:" name="1">
|
||||
<!--检测计划统计 饼图统计-->
|
||||
<div class='container_pieShow'>
|
||||
<el-collapse model-value='1' accordion @change='handleCollapseChange'>
|
||||
<el-collapse-item name='1'>
|
||||
<template #title>
|
||||
<div class='container_pieShow_title'>
|
||||
<span>检测计划统计</span>
|
||||
<span>{{ planName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 饼图 -->
|
||||
<div class="container_charts">
|
||||
<div class="charts_info">
|
||||
<div class='container_charts'>
|
||||
<div class='charts_info' ref='chartsInfoRef'>
|
||||
<pie
|
||||
:customData="{
|
||||
title: '设备检测状态',
|
||||
textAlign: 'right',
|
||||
textAlign: 'left',
|
||||
}"
|
||||
:legendData="{
|
||||
icon: 'circle',
|
||||
left: 'left',
|
||||
top: 'bottom',
|
||||
}"
|
||||
:chartsData="chartsData1"
|
||||
ref="pieRef1"
|
||||
:chartsData='chartsData1'
|
||||
ref='pieRef1'
|
||||
></pie>
|
||||
</div>
|
||||
<div class="charts_info">
|
||||
<div class='charts_info'>
|
||||
<pie
|
||||
:customData="{
|
||||
title: '设备检测结果',
|
||||
textAlign: 'right',
|
||||
textAlign: 'left',
|
||||
}"
|
||||
:legendData="{
|
||||
icon: 'circle',
|
||||
left: 'left',
|
||||
top: 'bottom',
|
||||
}"
|
||||
:chartsData="chartsData2"
|
||||
ref="pieRef2"
|
||||
:chartsData='chartsData2'
|
||||
ref='pieRef2'
|
||||
></pie>
|
||||
</div>
|
||||
<div class="charts_info">
|
||||
<div class='charts_info'>
|
||||
<pie
|
||||
:customData="{
|
||||
title: '设备报告状态',
|
||||
textAlign: 'right',
|
||||
label: {
|
||||
normal: {
|
||||
position: 'inner',
|
||||
},
|
||||
},
|
||||
textAlign: 'left',
|
||||
}"
|
||||
:legendData="{
|
||||
icon: 'circle',
|
||||
left: 'left',
|
||||
top: 'bottom',
|
||||
}"
|
||||
:chartsData="chartsData3"
|
||||
ref="pieRef3"
|
||||
:chartsData='chartsData3'
|
||||
ref='pieRef3'
|
||||
></pie>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,35 +89,43 @@
|
||||
</el-collapse>
|
||||
</div>
|
||||
|
||||
<el-tabs class="tabs-menu" type="border-card" @tab-change="handleTabsChange" v-model="editableTabsValue" :style="{ height: tabsHeight }">
|
||||
<el-tab-pane :label="tabLabel1" :style="{ height: tabPaneHeight }">
|
||||
<!--下方表格数据-->
|
||||
<el-tabs class='tabs-menu' type='border-card' @tab-change='handleTabsChange' v-model='editableTabsValue'
|
||||
:style='{ height: tabsHeight }'>
|
||||
<el-tab-pane :label='tabLabel1' :style='{ height: tabPaneHeight}'>
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table" :style="{ height: tableHeight }">
|
||||
<Table ref="tableRef1"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="已检设备" v-if="tabShow" :style="{ height: tabPaneHeight }">
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table" :style="{ height: tableHeight }">
|
||||
<Table ref="tableRef2"></Table>
|
||||
<div class='container_table' :style='{ height: tableHeight }'>
|
||||
<Table ref='tableRef1' :id='currentId' :plan = 'select_Plan' @batchGenerateClicked="handleBatchGenerate"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getStaticTreeData } from "@/api/plan/static";
|
||||
import pie from "@/components/echarts/pie/default.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import tree from "../components/tree.vue";
|
||||
import Table from "../components/table.vue";
|
||||
import { data } from "@/api/plan/static.json";
|
||||
<script lang='ts' setup>
|
||||
import pie from '@/components/echarts/pie/default.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import tree from '../components/tree.vue'
|
||||
import Table from '../components/table.vue'
|
||||
import deviceDataList from '@/api/device/device/deviceData'
|
||||
import { getBoundPqDevList, getPlanListByPattern } from '@/api/plan/plan.ts'
|
||||
import { onBeforeMount, onUnmounted, ref, watch } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { type Plan } from '@/api/plan/interface'
|
||||
import type { CollapseModelValue } from 'element-plus/es/components/collapse/src/collapse.mjs'
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { ResultData } from '@/api/interface'
|
||||
|
||||
const planName = ref('')
|
||||
const dictStore = useDictStore()
|
||||
const modeStore = useModeStore()
|
||||
const chartsInfoRef = ref<HTMLElement | null>(null)
|
||||
const chartsWidth = ref<number>(0)
|
||||
const deviceData = deviceDataList.plan_devicedata
|
||||
const treeRef = ref();
|
||||
const treeRef = ref()
|
||||
const form: any = ref({
|
||||
activeTabs: 0, //功能选择,例如报告生成
|
||||
activeChildTabs: 0,//子功能选择,例如未检设备报告生成,或已检设备更换误差体系生成
|
||||
@@ -123,80 +135,72 @@ const form: any = ref({
|
||||
deviceBindStatus: 0, //绑定状态
|
||||
deviceType: 0, //设备类型
|
||||
manufacturer: 0, //制造厂商
|
||||
});
|
||||
const router = useRouter();
|
||||
const activeNames = ref(['2'])
|
||||
const tabShow= ref(false);
|
||||
})
|
||||
const router = useRouter()
|
||||
const tabShow = ref(false)
|
||||
const tabLabel1 = ref('设备检测')
|
||||
const editableTabsValue = ref('0')
|
||||
const tabsHeight = ref('calc(100vh - 538px)'); // 初始高度
|
||||
const checkStateTable = ref<number[]>([0, 1, 2])
|
||||
const tabsHeight = ref('calc(100vh - 522px)') // 初始高度
|
||||
const tabPaneHeight = ref('calc(100% - 5px)') // 初始高度
|
||||
const tableHeight = ref('calc(100% - 50px)') // 初始高度
|
||||
|
||||
const tabPaneHeight = ref('calc(100% - 5px)'); // 初始高度
|
||||
const tableHeight = ref('calc(100% - 5px)'); // 初始高度
|
||||
const handleChange = (val: string[]) => {
|
||||
// console.log(val)
|
||||
}
|
||||
const planList = ref<ResultData<Plan.ReqPlan[]>>()
|
||||
const select_Plan = ref<Plan.ReqPlan>()
|
||||
const isLabelLineShow = ref(true)
|
||||
const handleCollapseChange = (val: CollapseModelValue) => {
|
||||
|
||||
const handleCollapseChange = (val: string[]) => {
|
||||
|
||||
console.log(val)
|
||||
console.log(val.length)
|
||||
// 计算新的高度
|
||||
const newHeight = val.length > 0 ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)';
|
||||
//const newtableHeight= val.length > 0 ? 'calc(100vh - 638px)' : 'calc(100vh - 433px)';
|
||||
tabsHeight.value = newHeight;
|
||||
tabPaneHeight.value = `calc(100% - 5px)`;
|
||||
tableHeight.value = `calc(100% - 5px)`;
|
||||
let newHeight
|
||||
if (Array.isArray(val)) {
|
||||
newHeight = val.length > 0 ? 'calc(100vh - 522px)' : 'calc(100vh - 333px)'
|
||||
} else {
|
||||
newHeight = val ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)'
|
||||
}
|
||||
tabsHeight.value = newHeight
|
||||
tabPaneHeight.value = `calc(100% - 5px)`
|
||||
tableHeight.value = `calc(100% - 5px)`
|
||||
}
|
||||
|
||||
// tableRef1.value.resize();
|
||||
// tableRef2.value.resize();
|
||||
};
|
||||
|
||||
const handleTabsChange = (val) => {
|
||||
form.value.activeTabs = 0;
|
||||
form.value.activeTabs = 3;
|
||||
form.value.activeChildTabs = Number(val);
|
||||
console.log(val)
|
||||
const handleTabsChange = (val: any) => {
|
||||
form.value.activeTabs = 0
|
||||
form.value.activeTabs = 3
|
||||
form.value.activeChildTabs = Number(val)
|
||||
|
||||
}
|
||||
localStorage.setItem("color", "red");
|
||||
localStorage.setItem('color', 'red')
|
||||
//功能选择数据
|
||||
const tabsList = ref([
|
||||
{
|
||||
label: "设备检测",
|
||||
label: '设备检测',
|
||||
value: 0,
|
||||
img: "/src/assets/images/plan/static/1.svg",
|
||||
img: new URL('/src/assets/images/plan/static/1.svg', import.meta.url).href,
|
||||
checked: true,
|
||||
},
|
||||
// {
|
||||
// label: "设备复检",
|
||||
// value: 2,
|
||||
// img: "/src/assets/images/plan/static/2.svg",
|
||||
// checked: false,
|
||||
// },
|
||||
{
|
||||
label: "报告生成",
|
||||
label: '报告生成',
|
||||
value: 3,
|
||||
img: "/src/assets/images/plan/static/3.svg",
|
||||
img: new URL('/src/assets/images/plan/static/3.svg', import.meta.url).href,
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
label: "数据查询",
|
||||
label: '设备归档',
|
||||
value: 4,
|
||||
img: new URL('/src/assets/images/plan/static/4.svg', import.meta.url).href,
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
label: '数据操作',
|
||||
value: 5,
|
||||
img: "/src/assets/images/plan/static/5.svg",
|
||||
img: new URL('/src/assets/images/plan/static/5.svg', import.meta.url).href,
|
||||
checked: false,
|
||||
},
|
||||
// {
|
||||
// label: "设备归档",
|
||||
// value: 4,
|
||||
// img: "/src/assets/images/plan/static/4.svg",
|
||||
// checked: false,
|
||||
// },
|
||||
]);
|
||||
])
|
||||
|
||||
form.value.activeTabs = tabsList.value[0].value;
|
||||
const tableRef1 = ref();
|
||||
const tableRef2 = ref();
|
||||
form.value.activeTabs = tabsList.value[0].value
|
||||
const tableRef1 = ref()
|
||||
const tableRef2 = ref()
|
||||
const currentId = ref('')
|
||||
|
||||
|
||||
watch(
|
||||
@@ -204,176 +208,352 @@ watch(
|
||||
(val, oldVal) => {
|
||||
if (val) {
|
||||
|
||||
console.log(form.value.activeTabs,111);
|
||||
|
||||
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
|
||||
if (form.value.activeTabs === 0)//设备检测
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.document_State === "未归档")
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
|
||||
}
|
||||
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
|
||||
const tabledata = deviceData.filter((item) => item.document_State === '未归档')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
} else if (form.value.activeTabs === 4)//设备归档
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.check_State === "检测完成");
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
|
||||
const tabledata = deviceData.filter((item) => item.check_State === '检测完成' && item.document_State === '未归档')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
} else if (form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.check_State === '检测完成')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
watch(
|
||||
() => form.value,
|
||||
(val, oldVal) => {
|
||||
if (val) {
|
||||
tableRef2.value && tableRef2.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs);
|
||||
console.log(form.value.activeTabs,form.value.activeChildTabs);
|
||||
tableRef2.value && tableRef2.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
||||
const pieRef1 = ref(),
|
||||
pieRef2 = ref(),
|
||||
pieRef3 = ref();
|
||||
const changeSelect = () => {
|
||||
console.log(form.value.activeTabs);
|
||||
getPieData();
|
||||
};
|
||||
pieRef3 = ref()
|
||||
|
||||
const chartsData1: any = ref([]),
|
||||
chartsData2: any = ref([]),
|
||||
chartsData3: any = ref([]);
|
||||
const getPieData = () => {
|
||||
chartsData3: any = ref([])
|
||||
|
||||
const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefined => {
|
||||
for (const plan of plans) {
|
||||
if (plan.id === id) {
|
||||
return plan
|
||||
}
|
||||
if (plan.children) {
|
||||
const foundPlan = findPlanById(plan.children, id)
|
||||
if (foundPlan) {
|
||||
return foundPlan
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
||||
const updateData = (id: string) => {
|
||||
getPieData(id);//刷新饼图
|
||||
|
||||
//获取点击树的父节点名字
|
||||
const parentNodeName = ref('')
|
||||
for (let i = 0; i < planList.value.data.length; i++) {
|
||||
if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
|
||||
for (let j = 0; j < planList.value.data[i].children.length; j++) {
|
||||
if (planList.value.data[i].children[j].id === id) {
|
||||
parentNodeName.value = planList.value.data[i].name
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(parentNodeName.value === '检测完成'){
|
||||
handleCheckFunction(5)
|
||||
}else{
|
||||
handleCheckFunction(0)
|
||||
}
|
||||
}
|
||||
|
||||
const getPieData = async (id: string) => {
|
||||
currentId.value = id // 设置当前ID
|
||||
// 初始化计数对象
|
||||
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
|
||||
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
const reportStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
if (id) {
|
||||
const boundPqDevList = ref<Device.ResPqDev[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
const plan = findPlanById(planList.value?.data || [], id)
|
||||
planName.value = '所选计划:' + plan.name
|
||||
|
||||
select_Plan.value = plan
|
||||
|
||||
const pqDevList_Result2 = await getBoundPqDevList({ 'planId': id, 'checkStateList': [0, 1, 2, 3] })
|
||||
boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[]
|
||||
// 遍历 boundPqDevList 并更新计数对象
|
||||
boundPqDevList.value.forEach(t => {
|
||||
if (t.checkState !== undefined && t.checkState !== null && checkStateCount[t.checkState] !== undefined) {
|
||||
checkStateCount[t.checkState]++
|
||||
}
|
||||
})
|
||||
boundPqDevList.value.forEach(t => {
|
||||
if (t.checkResult !== undefined && t.checkResult !== null && checkResultCount[t.checkResult] !== undefined) {
|
||||
checkResultCount[t.checkResult]++
|
||||
}
|
||||
})
|
||||
boundPqDevList.value.forEach(t => {
|
||||
if (t.reportState !== undefined && t.reportState !== null && reportStateCount[t.reportState] !== undefined) {
|
||||
reportStateCount[t.reportState]++
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 检查 checkStateCount 是否全为 0
|
||||
if(boundPqDevList.value.length != 0){
|
||||
|
||||
isLabelLineShow.value = true;
|
||||
const allZero = Object.values(checkStateCount).every(count => count === 0);
|
||||
chartsData1.value = [
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测", itemStyle: { color: '#fac858' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "检测中", itemStyle: { color: '#ee6666' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "检测完成", itemStyle: { color: '#91cc75' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "归档", itemStyle: { color: '#5470c6' } },
|
||||
{ value: allZero ? 0 : checkStateCount[0] === 0 ? null : checkStateCount[0], name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: allZero ? 0 : checkStateCount[1] === 0 ? null : checkStateCount[1], name: '检测中', itemStyle: { color: '#ee6666' } },
|
||||
{ value: allZero ? 0 : checkStateCount[2] === 0 ? null : checkStateCount[2], name: '检测完成', itemStyle: { color: '#91cc75' } },
|
||||
{ value: allZero ? 0 : checkStateCount[3] === 0 ? null : checkStateCount[3], name: '归档', itemStyle: { color: '#5470c6' } },
|
||||
];
|
||||
// 同样处理 chartsData2 和 chartsData3
|
||||
const allZeroResult = Object.values(checkResultCount).every(count => count === 0);
|
||||
chartsData2.value = [
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "有不合格项" , itemStyle: { color: '#ee6666' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "全部合格", itemStyle: { color: '#91cc75' } },
|
||||
{ value: allZeroResult ? 0 : checkResultCount[2] === 0 ? null : checkResultCount[2], name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: allZeroResult ? 0 : checkResultCount[0] === 0 ? null : checkResultCount[0], name: '不符合', itemStyle: { color: '#ee6666' } },
|
||||
{ value: allZeroResult ? 0 : checkResultCount[1] === 0 ? null : checkResultCount[1], name: '符合', itemStyle: { color: '#91cc75' } },
|
||||
];
|
||||
// pieRef2.value.init();
|
||||
|
||||
|
||||
// 检查 reportStateCount 是否全为 0
|
||||
const allZeroReport = Object.values(reportStateCount).every(count => count === 0);
|
||||
chartsData3.value = [
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "已生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "未生成报告" },
|
||||
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "未生成" , itemStyle: { color: '#ee6666' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "已生成", itemStyle: { color: '#91cc75' } },
|
||||
|
||||
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项未生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格未生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项已生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格已生成报告" },
|
||||
{ value: allZeroReport ? 0 : reportStateCount[2] === 0 ? null : reportStateCount[2], name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: allZeroReport ? 0 : reportStateCount[0] === 0 ? null : reportStateCount[0], name: '未生成', itemStyle: { color: '#ee6666' } },
|
||||
{ value: allZeroReport ? 0 : reportStateCount[1] === 0 ? null : reportStateCount[1], name: '已生成', itemStyle: { color: '#91cc75' } },
|
||||
];
|
||||
// pieRef3.value.init();
|
||||
pieRef1.value.init();
|
||||
pieRef2.value.init();
|
||||
pieRef3.value.init();
|
||||
pieRef1.value.reSize(470,145,true);
|
||||
pieRef2.value.reSize(470,145,true);
|
||||
pieRef3.value.reSize(470,145,true);
|
||||
};
|
||||
const getTree = () => {
|
||||
treeRef.value.getTreeData(data);
|
||||
// getStaticTreeData({ userName: "zhangsan", planName: "111" }).then((res) => {
|
||||
// console.log(res, "99999999");
|
||||
// // treeRef.value.getTreeData(res.data);
|
||||
// treeRef.value.getTreeData(data);
|
||||
// });
|
||||
};
|
||||
|
||||
}else{
|
||||
|
||||
isLabelLineShow.value = false;//不展示引导线
|
||||
chartsData1.value = [
|
||||
{ value: null , name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: null , name: '检测中', itemStyle: { color: '#ee6666' } },
|
||||
{ value: null , name: '检测完成', itemStyle: { color: '#91cc75' } },
|
||||
{ value: null , name: '归档', itemStyle: { color: '#5470c6' } },
|
||||
{ value: 0 , itemStyle: { color: '#eeeeee' } },
|
||||
];
|
||||
|
||||
chartsData2.value = [
|
||||
{ value: null, name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: null, name: '不符合', itemStyle: { color: '#ee6666' } },
|
||||
{ value: null, name: '符合', itemStyle: { color: '#91cc75' } },
|
||||
{ value: 0 , itemStyle: { color: '#eeeeee' } },
|
||||
];
|
||||
|
||||
chartsData3.value = [
|
||||
{ value: null, name: '未检', itemStyle: { color: '#fac858' } },
|
||||
{ value: null, name: '未生成', itemStyle: { color: '#ee6666' } },
|
||||
{ value: null, name: '已生成', itemStyle: { color: '#91cc75' } },
|
||||
{ value: 0 , itemStyle: { color: '#eeeeee' } },
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
planName.value = '所选计划:'
|
||||
}
|
||||
|
||||
|
||||
|
||||
pieRef1.value.init()
|
||||
pieRef2.value.init()
|
||||
pieRef3.value.init()
|
||||
}
|
||||
const getTree = (data?: any) => {
|
||||
treeRef.value.getTreeData(data)
|
||||
}
|
||||
//前往检测
|
||||
const handleDetection = () => {
|
||||
router.push({
|
||||
path: "/detection",
|
||||
});
|
||||
};
|
||||
path: '/detection',
|
||||
})
|
||||
}
|
||||
//前往计划详情
|
||||
const planDetail = () => {
|
||||
router.push({
|
||||
path: "/plan/planList",
|
||||
});
|
||||
};
|
||||
path: '/plan/planList',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//功能选择css切换
|
||||
const handleCheckFunction = (val: any) => {
|
||||
|
||||
editableTabsValue.value = '0';
|
||||
form.value.activeChildTabs = 0;
|
||||
editableTabsValue.value = '0'
|
||||
form.value.activeChildTabs = 0
|
||||
tabsList.value.map((item: any, index: any) => {
|
||||
if (val == item.value) {
|
||||
item.checked = true;
|
||||
item.checked = true
|
||||
} else {
|
||||
item.checked = false;
|
||||
item.checked = false
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
tabShow.value = false;
|
||||
tabShow.value = false
|
||||
|
||||
switch (val) {
|
||||
case 0://自动检测
|
||||
tabLabel1.value = "设备检测";
|
||||
break;
|
||||
checkStateTable.value = [0, 1, 2]
|
||||
tabLabel1.value = '设备检测'
|
||||
break
|
||||
case 1://手动检测
|
||||
tabLabel1.value = "手动检测";
|
||||
break;
|
||||
tabLabel1.value = '手动检测'
|
||||
break
|
||||
case 2://设备复检
|
||||
tabLabel1.value = "设备复检";
|
||||
break;
|
||||
tabLabel1.value = '设备复检'
|
||||
break
|
||||
case 3://报告生成
|
||||
tabLabel1.value = "报告生成";
|
||||
checkStateTable.value = [2, 3]
|
||||
tabLabel1.value = '报告生成'
|
||||
//tabShow.value = true;
|
||||
break;
|
||||
break
|
||||
case 4://设备归档
|
||||
tabLabel1.value = "设备归档";
|
||||
break;
|
||||
checkStateTable.value = [2]
|
||||
tabLabel1.value = '设备归档'
|
||||
break
|
||||
case 5://数据查询
|
||||
tabLabel1.value = "数据查询";
|
||||
break;
|
||||
checkStateTable.value = [2, 3]
|
||||
tabLabel1.value = '数据查询'
|
||||
break
|
||||
}
|
||||
form.value.activeTabs = val
|
||||
}
|
||||
|
||||
form.value.activeTabs = val;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
// console.log();
|
||||
getTree();
|
||||
getPieData();
|
||||
});
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
for (let entry of entries) {
|
||||
chartsWidth.value = entry.contentRect.width
|
||||
//console.log('Charts Info Width:', chartsWidth.value);
|
||||
|
||||
pieRef1.value?.reSize(chartsWidth.value * 0.95, 180, true)
|
||||
pieRef2.value?.reSize(chartsWidth.value * 0.95, 180, true)
|
||||
pieRef3.value?.reSize(chartsWidth.value * 0.95, 180, true)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const initPlan = async () => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
|
||||
const reqPlan: Plan.ReqPlan = {
|
||||
pattern: patternId,
|
||||
datasourceIds: '',
|
||||
sourceIds: '',
|
||||
planId: '',
|
||||
scriptName: '',
|
||||
errorSysName: '',
|
||||
sourceName: '',
|
||||
devIds: [],
|
||||
id: '',
|
||||
name: '',
|
||||
dataSourceId: '',
|
||||
scriptId: '',
|
||||
errorSysId: '',
|
||||
timeCheck: 0,
|
||||
testState: 0,
|
||||
reportState: 0,
|
||||
result: 0,
|
||||
code: 0,
|
||||
state: 0,
|
||||
}
|
||||
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
await initPlan()
|
||||
for (let i = 0; i < planList.value.data.length; i++) {
|
||||
if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
|
||||
currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id
|
||||
break; // 确保只执行一次
|
||||
}
|
||||
}
|
||||
|
||||
// if (planList.value.data[0].children[0]) {
|
||||
// currentId.value = planList.value.data[0].children[0].id
|
||||
// console.log('currentId.value',planList.value.data[0])
|
||||
// }
|
||||
|
||||
if (chartsInfoRef.value) {
|
||||
resizeObserver.observe(chartsInfoRef.value)
|
||||
}
|
||||
getTree(planList.value.data)
|
||||
|
||||
getPieData(currentId.value)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (chartsInfoRef.value) {
|
||||
resizeObserver.unobserve(chartsInfoRef.value)
|
||||
}
|
||||
})
|
||||
|
||||
const handleBatchGenerate = async () => {
|
||||
// console.log('批量生成按钮被点击了');
|
||||
// 在这里添加其他逻辑,比如显示对话框、更新状态等
|
||||
await initPlan()
|
||||
treeRef.value.clickTableToTree(planList.value.data,currentId.value)
|
||||
getPieData(currentId.value)
|
||||
|
||||
if (form.value.activeTabs === 0)//设备检测
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.document_State === '未归档')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
} else if (form.value.activeTabs === 4)//设备归档
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.check_State === '检测完成' && item.document_State === '未归档')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
} else if (form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
|
||||
{
|
||||
const tabledata = deviceData.filter((item) => item.check_State === '检测完成')
|
||||
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs, tabledata)
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
<style lang='scss' scoped>
|
||||
|
||||
.static {
|
||||
width: 100%;
|
||||
// height: calc(100vh - 165px);
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
//background-color: #eee;
|
||||
|
||||
.left_tree {
|
||||
width: 14% !important;
|
||||
height: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.right_container {
|
||||
flex: none;
|
||||
width: 85.8%;
|
||||
// padding: 0 10px 0 10px;
|
||||
margin-left: 10px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
//justify-content: space-between;
|
||||
//align-items: center;
|
||||
//box-sizing: border-box;
|
||||
|
||||
|
||||
.container_function {
|
||||
@@ -401,6 +581,7 @@ onMounted(() => {
|
||||
border-radius: 8px;
|
||||
padding: 0px 30px;
|
||||
margin-right: 50px;;
|
||||
|
||||
.item_img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
@@ -430,7 +611,7 @@ onMounted(() => {
|
||||
p {
|
||||
margin: 0;
|
||||
font-weight: 800;
|
||||
color: var(--el-color-primary);
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-family: "Microsoft YaHei", "微软雅黑", "Arial", sans-serif;
|
||||
}
|
||||
@@ -453,131 +634,49 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// .container_function {
|
||||
// width: 100%;
|
||||
// height: auto;
|
||||
// background: #fff;
|
||||
// border-radius: 4px;
|
||||
// display: flex;
|
||||
// // justify-content: space-around;
|
||||
// // justify-content: space-evenly;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
// margin-bottom: 10px;
|
||||
// padding: 10px 20px 10px 20px;
|
||||
// box-sizing: border-box;
|
||||
|
||||
// .function_item {
|
||||
// flex: none;
|
||||
// width: 6%;
|
||||
// height: 40px;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
// flex-direction: row;
|
||||
// cursor: pointer;
|
||||
// background-color: #607eab;
|
||||
// border-radius: 8px;
|
||||
// padding: 0px 30px;
|
||||
|
||||
// .item_img {
|
||||
// width: 30px;
|
||||
// height: 30px;
|
||||
// border-radius: 50%;
|
||||
// // background-color: #607eab;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
// margin-right: 5px;
|
||||
// img {
|
||||
// width: 20px;
|
||||
// height: auto;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .item_img:nth-child(3),
|
||||
// .item_img:nth-child(6) {
|
||||
// padding: 10px !important;
|
||||
|
||||
// img {
|
||||
// width: 20px !important;
|
||||
// height: auto;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .item_text {
|
||||
// p {
|
||||
// width: 80px;
|
||||
// margin: 0;
|
||||
// font-weight: 800;
|
||||
// color: var(--el-color-primary);
|
||||
// font-size: 14px;
|
||||
// font-family: "Microsoft YaHei", "微软雅黑", "Arial", sans-serif;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// .function_item:hover,
|
||||
// .checked_function {
|
||||
// background-color: var(--el-color-primary);
|
||||
|
||||
// .item_img {
|
||||
// // background-color: var(--el-color-primary);
|
||||
// }
|
||||
|
||||
// .item_text {
|
||||
// p {
|
||||
// // color: var(--el-color-primary);
|
||||
// color: #fff;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
.container_pieShow {
|
||||
width: 100% !important;
|
||||
//min-height: 200px !important;
|
||||
height: auto;
|
||||
background-color: #eee;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// padding-left: 2ch;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.container_pieShow_title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-collapse {
|
||||
width: 100% !important;
|
||||
// min-height: 200px !important;
|
||||
height: 100% !important;
|
||||
background-color: #eee;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// padding-left: 2ch;
|
||||
// margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-collapse-item {
|
||||
width: 100% !important;
|
||||
// min-height: 200px !important;
|
||||
height: 100% !important;
|
||||
background-color: #eee;
|
||||
// display: flex !important;
|
||||
}
|
||||
|
||||
.container_charts {
|
||||
width: 100%;
|
||||
//min-height: 180px !important;
|
||||
height:90%;
|
||||
height: 100%;
|
||||
background-color: #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.charts_info {
|
||||
margin-top: 1px;
|
||||
flex: none;
|
||||
width: 32.9%;
|
||||
width: 33.1%;
|
||||
height: 100% !important;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,9 +685,13 @@ onMounted(() => {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tabs-menu {
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.container_table {
|
||||
// width: 100%;
|
||||
flex: 1 !important;
|
||||
@@ -604,4 +707,26 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__header) {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 14px;
|
||||
font-family: "Microsoft YaHei", "微软雅黑", "Arial", sans-serif;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__conten) {
|
||||
padding-bottom: 0px !important;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__content ) {
|
||||
padding-bottom: 0px !important;
|
||||
}
|
||||
|
||||
:deep(.el-tabs--border-card > .el-tabs__content) {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
<!-- 模式切换页面 -->
|
||||
<template>
|
||||
<div class="main_container">
|
||||
<div class="main_container box">
|
||||
<!-- :style="{
|
||||
height: authStore?.showMenuFlag
|
||||
? 'calc(100vh - 165px)'
|
||||
: 'calc(100vh - 125px)',
|
||||
}" -->
|
||||
<div class="mode" v-for="(item, index) in modeList" :key="index">
|
||||
|
||||
<el-carousel :interval="5000" type="card" style="width: 60%;margin-left: 20%;height: 70%;">
|
||||
<el-carousel-item class="mode" :class="{ modeBG: index != 0 }" v-for="(item, index) in modeList" :key="index">
|
||||
|
||||
<div class="mode_top">
|
||||
<div class="mode_name">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mode_img">
|
||||
<img :src="item.img" />
|
||||
</div>
|
||||
<div class="test_button">
|
||||
<el-button size="large" type="primary" @click="handelOpen(item)"
|
||||
:disabled="item.isActive == false">进入检测</el-button>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
|
||||
|
||||
|
||||
<!-- <div class="mode" :class="{ modeBG: index != 0 }" v-for="(item, index) in modeList" :key="index">
|
||||
<div class="mode_top">
|
||||
<div class="mode_name">
|
||||
<p>
|
||||
@@ -14,28 +36,25 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="test_button">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handelOpen(item)"
|
||||
:disabled="item.isActive == false"
|
||||
>进入检测</el-button
|
||||
>
|
||||
<el-button size="small" type="primary" @click="handelOpen(item)"
|
||||
:disabled="item.isActive == false">进入检测</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mode_img">
|
||||
<img :src="item.img" />
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useModeStore } from "@/stores/modules/mode"; // 引入模式 store
|
||||
import { useModeStore, useAppSceneStore } from "@/stores/modules/mode"; // 引入模式 store
|
||||
import { ref } from "vue";
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore(); // 使用模式 store
|
||||
const AppSceneStore = useAppSceneStore();
|
||||
const activeIndex = ref("1-1");
|
||||
const router = useRouter();
|
||||
const modeList = [
|
||||
@@ -43,37 +62,37 @@ const modeList = [
|
||||
name: "模拟式模块",
|
||||
code: "模拟式",
|
||||
subName: "未启用模拟式检测计划",
|
||||
img: "/src/assets/images/dashboard/1.svg",
|
||||
img: new URL('/src/assets/images/dashboard/1.svg', import.meta.url).href,
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
name: "数字式模块",
|
||||
code: "数字式",
|
||||
subName: "启用数字检测计划",
|
||||
img: "/src/assets/images/dashboard/2.svg",
|
||||
isActive: true,
|
||||
img: new URL('/src/assets/images/dashboard/2.svg', import.meta.url).href,
|
||||
isActive: false,
|
||||
},
|
||||
{
|
||||
name: "比对式模块",
|
||||
code: "比对式",
|
||||
subName: "启用比对式检测计划",
|
||||
img: "/src/assets/images/dashboard/3.svg",
|
||||
isActive: true,
|
||||
img: new URL('/src/assets/images/dashboard/3.svg', import.meta.url).href,
|
||||
isActive: false,
|
||||
},
|
||||
];
|
||||
const handelOpen = async (item: any) => {
|
||||
|
||||
await authStore.setShowMenu();
|
||||
modeStore.setCurrentMode(item.code); // 将模式code存入 store
|
||||
AppSceneStore.setCurrentMode('1');//0:省级平台,1:设备出厂,2:研发自测
|
||||
await authStore.setShowMenu();
|
||||
return;
|
||||
if (isActive) {
|
||||
router.push({ path: "/static" });
|
||||
} else {
|
||||
ElMessage({
|
||||
message: "当前模式未配置",
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
// if (isActive) {
|
||||
// router.push({ path: "/static" });
|
||||
// } else {
|
||||
// ElMessage({
|
||||
// message: "当前模式未配置",
|
||||
// type: "warning",
|
||||
// });
|
||||
// }
|
||||
};
|
||||
const handleSelect = (key: string, keyPath: string[]) => {
|
||||
console.log(key, keyPath);
|
||||
@@ -83,7 +102,23 @@ onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.box {
|
||||
background: #ededed;
|
||||
// background-image: url("/src/assets/images/dashboard/DT.jpg");
|
||||
// /* 背景图垂直、水平均居中 */
|
||||
// // background-position: center center;
|
||||
// /* 背景图不平铺 */
|
||||
// background-repeat: no-repeat;
|
||||
// /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */
|
||||
// background-attachment: fixed;
|
||||
// /* 让背景图基于容器大小伸缩 */
|
||||
// background-size: cover;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.main_container {
|
||||
|
||||
width: 100%;
|
||||
// height: calc(100vh - 165px);
|
||||
height: 100%;
|
||||
@@ -92,55 +127,45 @@ onMounted(() => {
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
// padding: 20px 2%;
|
||||
|
||||
.mode {
|
||||
flex: none;
|
||||
margin-top: 3px;
|
||||
width: 32.5%;
|
||||
|
||||
height: 99.5% !important;
|
||||
border: 1px solid #eee;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
background: linear-gradient(180deg,
|
||||
rgba(0, 153, 255, 1) 0%,
|
||||
rgba(0, 153, 255, 1) 0%,
|
||||
rgba(0, 102, 255, 1) 65%,
|
||||
rgba(0, 51, 255, 1) 100%,
|
||||
rgba(0, 51, 255, 1) 100%
|
||||
);
|
||||
rgba(0, 51, 255, 1) 100%);
|
||||
|
||||
position: absolute;
|
||||
|
||||
|
||||
// padding: 40px 0;
|
||||
.mode_top {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #008aff;
|
||||
border-radius: 6px 6px 0 0;
|
||||
|
||||
.mode_name {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
p {
|
||||
font-family: "微软雅黑 Bold", "微软雅黑", "微软雅黑", sans-serif;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
// background: #fff;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
// margin-top: 20px;
|
||||
}
|
||||
|
||||
.mode_subName {
|
||||
font-family: "微软雅黑", sans-serif;
|
||||
font-weight: 400;
|
||||
@@ -155,14 +180,16 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.test_button {
|
||||
width: 150px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.mode_img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@@ -171,32 +198,46 @@ onMounted(() => {
|
||||
justify-content: center;
|
||||
// padding: 30px 0 50px;
|
||||
margin-top: 100px;
|
||||
// margin-bottom: 100px;
|
||||
|
||||
img:nth-child(1) {
|
||||
width: 60%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
img:nth-child(2) {
|
||||
width: 70%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
img:nth-child(3) {
|
||||
width: 60%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.mode_test {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
.test_button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.test_button {
|
||||
width: 120px;
|
||||
height: 100%;
|
||||
border: 1px solid rgba(121, 121, 121, 1);
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-radius: 5px;
|
||||
font-family: "微软雅黑", sans-serif;
|
||||
font-weight: 400;
|
||||
@@ -206,36 +247,58 @@ onMounted(() => {
|
||||
line-height: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.test_button:hover {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.mode:nth-child(3n + 3) {
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
background: linear-gradient(180deg,
|
||||
rgba(0, 153, 255, 1) 0%,
|
||||
rgba(0, 153, 255, 1) 0%,
|
||||
rgba(0, 102, 255, 1) 39%,
|
||||
rgba(102, 51, 204, 1) 100%,
|
||||
rgba(102, 51, 204, 1) 100%
|
||||
);
|
||||
rgba(102, 51, 204, 1) 100%);
|
||||
|
||||
}
|
||||
|
||||
.mode_off {
|
||||
|
||||
.mode_name,
|
||||
.mode_subName,
|
||||
.test_button {
|
||||
color: #fff !important;
|
||||
|
||||
}
|
||||
|
||||
.test_button:hover {
|
||||
// background: rgba(0, 0, 0, 0.2) !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-sub-menu__title) {
|
||||
border-bottom: 0 !important;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
// .modeBG {
|
||||
// &::before {
|
||||
// content: "";
|
||||
// position: absolute;
|
||||
// top: 0;
|
||||
// left: 0;
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// background-color: #70707080;
|
||||
// ;
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
:deep(.el-carousel__container) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
:deep(.el-carousel__item) {
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:data='logData'
|
||||
:request-api='getTableList'
|
||||
@selection-change='handleSelectionChange'
|
||||
type='selection'
|
||||
>
|
||||
@@ -21,32 +21,39 @@
|
||||
<script setup lang='tsx' name='useProTable'>
|
||||
// 根据实际路径调整
|
||||
import TimeControl from '@/components/TimeControl/index.vue'
|
||||
import { type Sys_Log_Audit } from '@/api/system/interface/log'
|
||||
import { type AuditLog} from '@/api/system/log/interface/log.ts'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import { Upload ,DataAnalysis} from '@element-plus/icons-vue'
|
||||
import logDataList from '@/api/system/log/logData'
|
||||
import type { ColumnProps, ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { reactive,ref,watch } from 'vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
let multipleSelection = ref<string[]>([])
|
||||
const logData = logDataList
|
||||
const dictStore = useDictStore()
|
||||
// 定义包含和排除的单位
|
||||
const includedUnits = ['日', '周', '月', '自定义']; // 可以根据需要包含的单位
|
||||
const excludedUnits = ['季度','年']; // 要排除的单位
|
||||
const defaultUnits = '日'; // 默认的单位
|
||||
import {
|
||||
getAuditLog,
|
||||
} from '@/api/system/log/index.ts'
|
||||
|
||||
|
||||
// defineOptions({
|
||||
// name: 'log'
|
||||
// })
|
||||
|
||||
const startDate = ref('')
|
||||
const endDate = ref('')
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
newParams.searchEndTime = endDate.value
|
||||
newParams.searchBeginTime = startDate.value
|
||||
return getAuditLog(newParams)
|
||||
}
|
||||
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<Sys_Log_Audit.Audit_LogList>[]>([
|
||||
const columns = reactive<ColumnProps<AuditLog.ReqAuditLogParams>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'id',
|
||||
label: '序号',
|
||||
width: 70,
|
||||
},
|
||||
{
|
||||
prop: 'create_By',
|
||||
prop: 'createBy',
|
||||
label: '操作用户',
|
||||
search: { el: 'input' },
|
||||
minWidth: 100,
|
||||
@@ -57,18 +64,17 @@ const columns = reactive<ColumnProps<Sys_Log_Audit.Audit_LogList>[]>([
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'create_Time',
|
||||
prop: 'createTime',
|
||||
label: '记录时间',
|
||||
minWidth: 180,
|
||||
search: {
|
||||
span: 2,
|
||||
render: () => {
|
||||
return (
|
||||
<div class='flx-flex-start'>
|
||||
<TimeControl
|
||||
include={includedUnits}
|
||||
exclude={excludedUnits}
|
||||
default={defaultUnits}
|
||||
include={['日', '周', '月', '自定义']}
|
||||
default={'月'}
|
||||
onUpdate-dates={handleDateChange}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
@@ -96,21 +102,20 @@ const columns = reactive<ColumnProps<Sys_Log_Audit.Audit_LogList>[]>([
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'operate_Type',
|
||||
prop: 'operateType',
|
||||
label: '日志类型',
|
||||
width: 100,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
},
|
||||
])
|
||||
|
||||
//选中
|
||||
// 处理选择变化
|
||||
const handleSelectionChange = (selection: Sys_Log_Audit.Audit_LogList[]) => {
|
||||
multipleSelection.value = selection.map(row => row.id) // 更新选中的行
|
||||
|
||||
// 处理日期变化的回调函数
|
||||
const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
startDate.value = startDateTemp
|
||||
endDate.value = endDateTemp
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -103,7 +103,8 @@ const login = (formEl: FormInstance | undefined) => {
|
||||
...loginForm,
|
||||
password: loginForm.password,
|
||||
})
|
||||
userStore.setToken(data.accessToken)
|
||||
userStore.setAccessToken(data.accessToken)
|
||||
userStore.setRefreshToken(data.refreshToken)
|
||||
userStore.setUserInfo(data.userInfo)
|
||||
const response = await getDictList()
|
||||
const dictData = response.data as unknown as Dict[]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user