Compare commits
161 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"CHNFACTOR",
|
||||
"CHNPACTOR",
|
||||
"Chns",
|
||||
"Combox",
|
||||
"Datasource",
|
||||
@@ -14,6 +16,7 @@
|
||||
"Pids",
|
||||
"plandata",
|
||||
"PQDIF",
|
||||
"Preinvestment",
|
||||
"resourcedata",
|
||||
"resourcename",
|
||||
"rmark",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:size='assemblySize'
|
||||
:button='buttonConfig'
|
||||
>
|
||||
<router-view :key='$route.fullPath' />
|
||||
<router-view />
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,36 +4,86 @@ export namespace CheckData {
|
||||
errorSysName: string,
|
||||
dataRule: string,
|
||||
deviceName: string,
|
||||
monitorIdx: 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 {
|
||||
chnNum: string,
|
||||
standardValue: number,
|
||||
A?: number,
|
||||
A_errValue?: number,
|
||||
B?: number,
|
||||
B_errValue?: number,
|
||||
C?: number,
|
||||
C_errValue?: number,
|
||||
T?: number,
|
||||
T_errValue?: number,
|
||||
maxErrVaule: number,
|
||||
result: string,
|
||||
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 {
|
||||
updateTime: string,
|
||||
A?: number,
|
||||
B?: number,
|
||||
C?: number
|
||||
T?: number
|
||||
time?: string,
|
||||
harmNum?: number | null,
|
||||
dataA?: string,
|
||||
dataB?: string,
|
||||
dataC?: string,
|
||||
dataT?: string,
|
||||
unit?: string | null
|
||||
}
|
||||
|
||||
export interface Device {
|
||||
@@ -44,36 +94,49 @@ export namespace CheckData {
|
||||
|
||||
// 用来描述检测脚本类型
|
||||
export interface ScriptItem {
|
||||
id: string,
|
||||
code: string,
|
||||
scriptName: string,
|
||||
scriptType?: string,
|
||||
children?: ScriptItem1[]
|
||||
}
|
||||
|
||||
// 用来描述 检测数据-左侧树结构
|
||||
export interface TreeItem {
|
||||
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,
|
||||
UNCONNECTED = 3,
|
||||
TIMEOUT = 3,
|
||||
ERRORDATA = 4
|
||||
}
|
||||
|
||||
export interface DeviceCheckResult {
|
||||
deviceId: string,
|
||||
deviceName: string,
|
||||
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||
}
|
||||
|
||||
//用来描述 某个脚本测试项对所有通道的检测结果
|
||||
export interface ScriptChnItem {
|
||||
scriptType: string
|
||||
scriptName?: string //可以不要该属性,有点多余
|
||||
|
||||
// 设备
|
||||
devices: Array<{
|
||||
deviceId: string,
|
||||
deviceName: string,
|
||||
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||
}>
|
||||
devices: Array<DeviceCheckResult>
|
||||
}
|
||||
|
||||
export enum ButtonColorEnum {
|
||||
INFO = '#909399',
|
||||
LOADING = '#607eab',
|
||||
LOADING = '#003078',
|
||||
SUCCESS = '#67c23a',
|
||||
WARNING = '#e6a23c',
|
||||
DANGER = '#f56c6c',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import http from "@/api";
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
|
||||
export const getBigTestItem = (planId: string) => {
|
||||
return http.get(`/adPlan/getBigTestItem?planId=${planId}`, {loading: false});
|
||||
@@ -23,12 +24,12 @@ export const getFormData = (params: {
|
||||
*/
|
||||
export const getTreeData = (params: {
|
||||
scriptId: string,
|
||||
deviceId: string,
|
||||
devId: string,
|
||||
devNum: string,
|
||||
scriptType: string | null,
|
||||
code: string
|
||||
code: number,
|
||||
}) => {
|
||||
return http.post("/result/treeData/", params, {loading: false});
|
||||
return http.post<CheckData.TreeItem[]>("/result/treeData/", params, {loading: true});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,10 +37,23 @@ export const getTreeData = (params: {
|
||||
* @param params
|
||||
*/
|
||||
export const getTableData = (params: {
|
||||
scriptType: string | null,
|
||||
scriptId: string,
|
||||
deviceId: string,
|
||||
chnNum: string,
|
||||
scriptType: string | null
|
||||
devId: string,
|
||||
devNum: string,
|
||||
code: number,
|
||||
index: number,
|
||||
}) => {
|
||||
return http.post("/result/tableData/", params, {loading: false});
|
||||
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});
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
|
||||
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> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,14 @@ export namespace Device {
|
||||
pattern:string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 被检设备表格分页查询参数
|
||||
*/
|
||||
export interface ReqDevReportParams extends ReqPage{
|
||||
planId?:string; // 计划id
|
||||
devId?:string; // 装置id
|
||||
}
|
||||
|
||||
/**
|
||||
* 被检设备新增、修改、根据id查询返回的对象
|
||||
*/
|
||||
@@ -25,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; //固件版本
|
||||
@@ -44,22 +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:符合)
|
||||
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,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 被检设备表格查询分页返回的对象;
|
||||
*/
|
||||
|
||||
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> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
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;
|
||||
@@ -42,7 +44,8 @@ class RequestHttp {
|
||||
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('Refresh-Token', userStore.refreshToken)
|
||||
}
|
||||
return config
|
||||
},
|
||||
@@ -51,25 +54,53 @@ 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
|
||||
const result = await refreshToken()
|
||||
if (result) { //获取新token成功的话
|
||||
// 有新的token后,重新请求
|
||||
userStore.setAccessToken(result.data.accessToken)
|
||||
userStore.setRefreshToken(result.data.refreshToken)
|
||||
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.setUserInfo({ name: '' })
|
||||
router.replace(LOGIN_URL)
|
||||
if(data.code != ResultEnum.OVERDUE){//临时处理token失效弹窗多次
|
||||
ElMessage.error(data.message)
|
||||
}else if(isFirst){
|
||||
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 +110,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 +147,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)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import type { ResPage } from '@/api/interface'
|
||||
import type { Plan } from './interface'
|
||||
import http from '@/api'
|
||||
import type { TestSource } from '../device/interface/testSource'
|
||||
import type { TestScript } from '../device/interface/testScript'
|
||||
import type { ErrorSystem } from '../device/interface/error'
|
||||
import type { Device } from '../device/interface/device'
|
||||
import { ReqDevReportParams } from '@/api/device/interface/device'
|
||||
|
||||
/**
|
||||
* @name 检测计划管理模块
|
||||
@@ -77,3 +75,13 @@ export const downloadTemplate = () => {
|
||||
export const importPlan = (params: Device.ReqPqDevParams) => {
|
||||
return http.upload(`/adPlan/import`, params)
|
||||
}
|
||||
|
||||
// 装置检测报告生成
|
||||
export const generateDevReport = (params: Device.ReqDevReportParams) => {
|
||||
return http.post(`/report/generateReport`, params)
|
||||
}
|
||||
|
||||
// 装置检测报告下载
|
||||
export const downloadDevData = (params: Device.ReqDevReportParams) => {
|
||||
return http.download(`/report/downloadReport`, params)
|
||||
}
|
||||
@@ -21,8 +21,8 @@ export const startTest = (params) => {
|
||||
* 暂停正式检测
|
||||
* @param params
|
||||
*/
|
||||
export const pauseTest = (params) => {
|
||||
return http.post(`/test/pauseTest`, params, {loading: false})
|
||||
export const pauseTest = () => {
|
||||
return http.get(`/prepare/closePreTest`, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,5 +30,5 @@ export const pauseTest = (params) => {
|
||||
* @param params
|
||||
*/
|
||||
export const resumeTest = (params) => {
|
||||
return http.post(`/test/resumeTest`, params, {loading: false})
|
||||
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
|
||||
}
|
||||
|
||||
@@ -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; // 字典针对电压等级
|
||||
|
||||
@@ -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 }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,49 +1,48 @@
|
||||
<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; // 标题
|
||||
@@ -57,98 +56,130 @@ 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}模板`,{},false);
|
||||
};
|
||||
if (!parameter.value.tempApi) return
|
||||
useDownload(parameter.value.tempApi, `${parameter.value.title}模板`, {}, false)
|
||||
}
|
||||
|
||||
// 文件上传
|
||||
const uploadExcel = async (param: UploadRequestOptions) => {
|
||||
let excelFormData = new FormData();
|
||||
excelFormData.append("file", param.file);
|
||||
let excelFormData = new FormData()
|
||||
excelFormData.append('file', param.file)
|
||||
if (parameter.value.patternId) {
|
||||
excelFormData.append("patternId",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) {
|
||||
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()
|
||||
}
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
||||
/**
|
||||
* @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>
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
line-height: 40px;
|
||||
width: 110%;
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
padding-inline-start: 0px;
|
||||
padding-left: 10px;
|
||||
|
||||
@@ -22,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
|
||||
@@ -35,7 +40,10 @@ 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)
|
||||
@@ -49,6 +57,9 @@ const init = () => {
|
||||
title: {
|
||||
text: customData.value.title,
|
||||
left: customData.value.textAlign,
|
||||
textStyle: {
|
||||
fontSize: customData.value.titleFontSize, // 使用 titleFontSize 属性
|
||||
},
|
||||
},
|
||||
legend:legendData.value,
|
||||
// legend: {
|
||||
@@ -66,7 +77,7 @@ const init = () => {
|
||||
// },
|
||||
// },
|
||||
tooltip: {
|
||||
show: true,
|
||||
show: labelIsShow.value,
|
||||
trigger: "item",
|
||||
formatter: customData.value.ratio ? `{b} : {c} ({d}%)` : "{b} :{c} ",
|
||||
borderWidth: 1,
|
||||
@@ -82,7 +93,7 @@ const init = () => {
|
||||
if(item)
|
||||
return item[0].value;
|
||||
},
|
||||
center: ["55%", "50%"], // 设置饼图的中心位置
|
||||
center: ["55%", "55%"], // 设置饼图的中心位置
|
||||
// padAngle: 2,
|
||||
minAngle: 15, //最小角度
|
||||
startAngle: 270, //起始角度
|
||||
@@ -95,14 +106,14 @@ const init = () => {
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
show: labelIsShow.value,
|
||||
position: "outside",
|
||||
textStyle: {
|
||||
//color: "#fff",
|
||||
fontSize: 12,
|
||||
},
|
||||
formatter: function (data) {
|
||||
return data.value +'台'
|
||||
return labelIsShow.value ? data.value + '台' : '';
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -117,6 +128,7 @@ const init = () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
option && chart.value && chart.value.setOption(option);
|
||||
setTimeout(() => {
|
||||
chart.value.resize();
|
||||
@@ -152,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();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -66,12 +66,14 @@ onMounted(() => {
|
||||
const handelOpen = async (item: string) => {
|
||||
await authStore.setShowMenu();
|
||||
modeStore.setCurrentMode(item); // 将模式code存入 store
|
||||
if (router.currentRoute.value.path === '/home/index') {
|
||||
|
||||
//if (router.currentRoute.value.path === '/home/index') {
|
||||
// 强制刷新页面
|
||||
window.location.reload();
|
||||
} else {
|
||||
router.push({ path: '/home/index' });
|
||||
}
|
||||
//} else {
|
||||
// router.push({ path: '/home/index' });
|
||||
//}
|
||||
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
@@ -56,14 +56,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 +74,12 @@ const logout = () => {
|
||||
// 1.执行退出登录接口
|
||||
await logoutApi();
|
||||
// 2.清除 Token
|
||||
userStore.setToken("");
|
||||
userStore.setAccessToken("");
|
||||
userStore.setRefreshToken("");
|
||||
userStore.setUserInfo({name: ""});
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,14 +46,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,7 +61,7 @@ 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) {
|
||||
|
||||
@@ -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,6 +37,7 @@ 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"];
|
||||
}
|
||||
@@ -47,7 +49,8 @@ export const initDynamicRouter = async () => {
|
||||
});
|
||||
} catch (error) {
|
||||
// 当按钮 || 菜单请求出错时,重定向到登陆页
|
||||
userStore.setToken("");
|
||||
userStore.setAccessToken("");
|
||||
userStore.setRefreshToken("");
|
||||
router.replace(LOGIN_URL);
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export const staticRouter: RouteRecordRaw[] = [
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
isKeepAlive: true,//缓存改成true
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -52,7 +52,7 @@ export const staticRouter: RouteRecordRaw[] = [
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
isKeepAlive: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -82,7 +82,7 @@ export const staticRouter: RouteRecordRaw[] = [
|
||||
isHide: false,
|
||||
isFull: false,
|
||||
isAffix: false,
|
||||
isKeepAlive: false,
|
||||
isKeepAlive: true,
|
||||
},
|
||||
},
|
||||
// 错误页面路由
|
||||
|
||||
@@ -39,6 +39,7 @@ export interface TabsMenuProps {
|
||||
name: string;
|
||||
close: boolean;
|
||||
isKeepAlive: boolean;
|
||||
unshift?: boolean;
|
||||
}
|
||||
|
||||
/* TabsState */
|
||||
|
||||
@@ -11,6 +11,7 @@ export const useCheckStore = defineStore("check", {
|
||||
planId: String(""),
|
||||
planCode: String(""),
|
||||
scriptId: String(""),
|
||||
errorSysId: String(""),
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
@@ -34,6 +35,10 @@ export const useCheckStore = defineStore("check", {
|
||||
|
||||
setScriptId(scriptId: string) {
|
||||
this.scriptId = scriptId
|
||||
},
|
||||
|
||||
setErrorSysId(errorSysId: string) {
|
||||
this.errorSysId = errorSysId
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -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,18 @@ import { USER_STORE_KEY } from "@/stores/constant";
|
||||
export const useUserStore = defineStore({
|
||||
id: USER_STORE_KEY,
|
||||
state: (): UserState => ({
|
||||
token: "",
|
||||
accessToken: "",
|
||||
refreshToken: "",
|
||||
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;
|
||||
},
|
||||
// Set setUserInfo
|
||||
setUserInfo(userInfo: UserState["userInfo"]) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export default class SocketService {
|
||||
static instance = null;
|
||||
static get Instance() {
|
||||
@@ -18,18 +22,25 @@ export default class SocketService {
|
||||
sendRetryCount = 0;
|
||||
// 重新连接尝试的次数
|
||||
connectRetryCount = 0;
|
||||
work:any;
|
||||
heartbeatTimer;
|
||||
heartbeatInterval = 6000; // 心跳间隔,单位毫秒
|
||||
lastActivityTime= 0; // 上次活动时间戳
|
||||
reconnectDelay= 5000; // 重新连接延迟,单位毫秒
|
||||
|
||||
// 定义连接服务器的方法
|
||||
connect(url) {
|
||||
connect() {
|
||||
|
||||
// 连接服务器
|
||||
if (!window.WebSocket) {
|
||||
return console.log('您的浏览器不支持WebSocket');
|
||||
}
|
||||
console.log(url)
|
||||
|
||||
// let token = $.cookie('123');
|
||||
// let token = '4E6EF539AAF119D82AC4C2BC84FBA21F';
|
||||
|
||||
|
||||
const url = 'ws://localhost:7777/hello?name=cdf'
|
||||
this.ws = new WebSocket(url);
|
||||
// 连接成功的事件
|
||||
this.ws.onopen = () => {
|
||||
@@ -38,6 +49,8 @@ export default class SocketService {
|
||||
this.connected = true;
|
||||
// 重置重新连接的次数
|
||||
this.connectRetryCount = 0;
|
||||
this.updateLastActivityTime();
|
||||
this.startHeartbeat();
|
||||
};
|
||||
// 1.连接服务端失败
|
||||
// 2.当连接成功之后, 服务器关闭的情况
|
||||
@@ -45,14 +58,27 @@ export default class SocketService {
|
||||
console.log('连接服务端失败');
|
||||
this.connected = false;
|
||||
this.connectRetryCount++;
|
||||
this.clearHeartbeat();
|
||||
setTimeout(() => {
|
||||
// this.connect();
|
||||
}, 500 * this.connectRetryCount);
|
||||
|
||||
|
||||
};
|
||||
|
||||
this.ws.onerror = () => {
|
||||
ElMessage.error("webSocket连接异常!");
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 得到服务端发送过来的数据
|
||||
this.ws.onmessage = (event) => {
|
||||
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);
|
||||
@@ -62,11 +88,57 @@ export default class SocketService {
|
||||
if (message?.type && this.callBackMapping[message.type]) {
|
||||
this.callBackMapping[message.type](message);
|
||||
} else {
|
||||
console.log("抛弃====>"+message)
|
||||
console.log("抛弃====>")
|
||||
console.log(event.data)
|
||||
/* 丢弃或继续写你的逻辑 */
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
startHeartbeat() {
|
||||
let _this = this
|
||||
var url = window.URL.createObjectURL(new Blob(['(function(e){setInterval(function(){this.postMessage(null)},3000)})()']));
|
||||
this.work = new Worker(url)
|
||||
this.work.onmessage = function(e){
|
||||
if ((Date.now() - _this.lastActivityTime) > _this.heartbeatInterval) {
|
||||
// 如果超过心跳间隔没有活动,发送心跳消息
|
||||
_this.sendHeartbeat();
|
||||
}
|
||||
|
||||
}
|
||||
// this.heartbeatTimer = setInterval(() => {
|
||||
// if ((Date.now() - this.lastActivityTime) > this.heartbeatInterval) {
|
||||
// // 如果超过心跳间隔没有活动,发送心跳消息
|
||||
// this.sendHeartbeat();
|
||||
// }
|
||||
// }, this.heartbeatInterval/2); // 每半个心跳间隔检查一次
|
||||
}
|
||||
sendHeartbeat() {
|
||||
console.log("进入心跳消息发送。。。。。。。。。。。。。")
|
||||
this.ws.send('alive');
|
||||
this.updateLastActivityTime(); // 发送心跳后更新活动时间
|
||||
}
|
||||
|
||||
|
||||
updateLastActivityTime() {
|
||||
this.lastActivityTime = Date.now();
|
||||
}
|
||||
|
||||
clearHeartbeat() {
|
||||
this.work.terminate();
|
||||
if (this.heartbeatTimer) {
|
||||
|
||||
clearInterval(this.heartbeatTimer);
|
||||
this.heartbeatTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 回调函数的注册
|
||||
registerCallBack(socketType, callBack) {
|
||||
this.callBackMapping[socketType] = callBack;
|
||||
|
||||
@@ -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 实例
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,200 +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 { useHandleData } from '@/hooks/useHandleData'
|
||||
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 { 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,
|
||||
} 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<any>[]>([
|
||||
{ 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: any) => {
|
||||
// await useHandleData(resetUserPassWord, { id: params.id }, `重置【${params.username}】用户密码`)
|
||||
// proTable.value?.getTableList()
|
||||
doubleColumn.value.open('双列弹出框')
|
||||
}
|
||||
// 切换用户状态
|
||||
const changeStatus = async (row: any) => {
|
||||
// await useHandleData(changeUserStatus, {
|
||||
// id: row.id,
|
||||
// status: row.status == 1 ? 0 : 1,
|
||||
// }, `切换【${row.username}】用户状态`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
// 导出用户列表
|
||||
const downloadFile = async () => {
|
||||
|
||||
}
|
||||
// 批量添加用户
|
||||
const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||
const batchAdd = () => {
|
||||
const params = {
|
||||
title: '用户',
|
||||
getTableList: proTable.value?.getTableList,
|
||||
}
|
||||
dialogRef.value?.acceptParams(params)
|
||||
}
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = (title: string, row: Partial<any> = {}) => {
|
||||
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
@@ -6,202 +6,309 @@
|
||||
style="width: 100%"
|
||||
max-height="400px"
|
||||
:span-method="objectSpanMethod">
|
||||
<el-table-column prop="MonitorIdx" label="监测点序号" width="80"/>
|
||||
<!-- <el-table-column prop="updateTime" label="上送时刻" width="180"/> -->
|
||||
<el-table-column prop="deviceName" label="描述" width="90"/>
|
||||
<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="UaData" label="数据(V)">
|
||||
<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.UaData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.UaData }}
|
||||
{{ scope.row.aVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="UaChannel" label="系数">
|
||||
<el-table-column prop="aVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.UaChannel === '不合格'">
|
||||
{{ scope.row.UaChannel }}
|
||||
<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-icon v-else-if="scope.row.UaChannel === '—'&& loading" class="loading-box">
|
||||
</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.UaChannel }}
|
||||
</span>
|
||||
<!-- <el-tag type="danger" v-if="scope.row.UaChannel === '不合格'">{{ scope.row.UaChannel }}</el-tag> -->
|
||||
<!-- <span v-else>
|
||||
{{ scope.row.aVuXi }}
|
||||
</span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="L2">
|
||||
<el-table-column prop="UbData" label="数据(V)">
|
||||
<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.UbData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.UbData }}
|
||||
{{ scope.row.bVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="UbChannel" label="系数">
|
||||
<el-table-column prop="bVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.UbChannel === '不合格'">
|
||||
{{ scope.row.UbChannel }}
|
||||
<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-icon v-else-if="scope.row.UbChannel === '—'&& loading" class="loading-box">
|
||||
</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>
|
||||
<span v-else>
|
||||
{{ scope.row.UbChannel }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="L3">
|
||||
<el-table-column prop="UcData" label="数据(V)">
|
||||
<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.UcData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.UcData }}
|
||||
{{ scope.row.cVuData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="UcChannel" label="系数">
|
||||
<el-table-column prop="cVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.UcChannel === '不合格'">
|
||||
{{ scope.row.UcChannel }}
|
||||
<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-icon v-else-if="scope.row.UcChannel === '—'&& loading" class="loading-box">
|
||||
</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>
|
||||
<span v-else>
|
||||
{{ scope.row.UcChannel }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="电流通道" >
|
||||
<el-table-column prop="Ia" label="L1">
|
||||
<el-table-column prop="IaData" label="数据(A)">
|
||||
<el-table-column prop="Ia" label="A相">
|
||||
<el-table-column prop="aIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.IaData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.IaData }}
|
||||
{{ scope.row.aIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="IaChannel" label="系数">
|
||||
<el-table-column prop="aIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.IaChannel === '不合格'">
|
||||
{{ scope.row.IaChannel }}
|
||||
<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-icon v-else-if="scope.row.IaChannel === '—'&& loading" class="loading-box">
|
||||
</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>
|
||||
<span v-else>
|
||||
{{ scope.row.IaChannel }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ib" label="L2">
|
||||
<el-table-column prop="IbData" label="数据(A)">
|
||||
<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.IbData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.IbData }}
|
||||
{{ scope.row.bIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="IbChannel" label="系数">
|
||||
<el-table-column prop="bIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.IbChannel === '不合格'">
|
||||
{{ scope.row.IbChannel }}
|
||||
<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-icon v-else-if="scope.row.IbChannel === '—'&& loading" class="loading-box">
|
||||
</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>
|
||||
<span v-else>
|
||||
{{ scope.row.IbChannel }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ic" label="L3">
|
||||
<el-table-column prop="IcData" label="数据(A)">
|
||||
<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.IcData === '—'&& loading" class="loading-box">
|
||||
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
</el-icon>
|
||||
<span v-else>
|
||||
{{ scope.row.IcData }}
|
||||
{{ scope.row.cIeData }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="IcChannel" label="系数">
|
||||
<el-table-column prop="cIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.IcChannel === '不合格'">
|
||||
{{ scope.row.IcChannel }}
|
||||
<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-icon v-else-if="scope.row.IcChannel === '—'&& loading" class="loading-box">
|
||||
</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>
|
||||
<span v-else>
|
||||
{{ scope.row.IcChannel }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="校准结果">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.Result === '不合格'">{{ scope.row.Result }}</el-tag>
|
||||
<span v-if="scope.row.Result != '不合格'">{{ scope.row.Result }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="ErrorSystemDialog">
|
||||
import { defineProps } from 'vue';
|
||||
import { defineProps, type PropType } from 'vue';
|
||||
import { ElIcon, ElLoading, ElTag } from 'element-plus';
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import type { ChannelsTest } from '@/api/home/interface/channelsTest';
|
||||
import { number } from 'echarts';
|
||||
|
||||
const props = defineProps<{
|
||||
tableData: Array<{
|
||||
id: string;
|
||||
deviceName?: string;
|
||||
MonitorIdx: number;
|
||||
UaData?: number | string;
|
||||
UaChannel?: number | string;
|
||||
UbData?: number | string;
|
||||
UbChannel?: number | string;
|
||||
UcData?: number | string;
|
||||
UcChannel?: number | string;
|
||||
IaData?: number | string;
|
||||
IaChannel?: number | string;
|
||||
IbData?: number | string;
|
||||
IbChannel?: number | string;
|
||||
IcData?: number | string;
|
||||
IcChannel?: number | string;
|
||||
Result?: string | string;
|
||||
updateTime?: string;
|
||||
}>
|
||||
loading: boolean; // 定义 loading 属性
|
||||
}>();
|
||||
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) {
|
||||
@@ -232,64 +339,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 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: '合格',
|
||||
// },
|
||||
// ])
|
||||
|
||||
|
||||
// 监听 tableData 的变化
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -330,6 +379,19 @@
|
||||
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);
|
||||
|
||||
@@ -422,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)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -541,7 +541,7 @@ function traverseTableData(data: any[], id: string): void {
|
||||
item[field1] = "danger";
|
||||
item[field2] = "×";
|
||||
columnList.value.push(activeIndex.value.toString());
|
||||
console.log(id,activeIndex.value,columnList.value)
|
||||
// console.log(id,activeIndex.value,columnList.value)
|
||||
}
|
||||
else {
|
||||
item[field1] = "success";
|
||||
@@ -561,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("");
|
||||
@@ -582,7 +582,7 @@ const handleFinishTest = () => {
|
||||
};
|
||||
|
||||
const handleClick = (row: any) => {
|
||||
console.log(111, row)
|
||||
// console.log(111, row)
|
||||
dataCheckSingleChannelSingleTestDialogVisable.value = true;
|
||||
};
|
||||
|
||||
@@ -1885,7 +1885,7 @@ const startTimer = () => {
|
||||
//if (timer.value !== null) return; // 如果定时器已经启动,则不再重复启动
|
||||
timer.value = setInterval(() => {
|
||||
|
||||
console.log(activeIndex.value, 111)
|
||||
// console.log(activeIndex.value, 111)
|
||||
if (activeIndex.value <= activeTotalNum.value) {
|
||||
activeIndex.value++;
|
||||
|
||||
@@ -1943,10 +1943,10 @@ const startTimer = () => {
|
||||
|
||||
}
|
||||
else {
|
||||
console.log(activeIndex.value, 222)
|
||||
// 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);
|
||||
|
||||
@@ -145,7 +145,7 @@ const monitorIdxList = [
|
||||
},
|
||||
]
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
<template>
|
||||
|
||||
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
|
||||
<div class="table-main">
|
||||
<el-table :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }" height="335px"
|
||||
<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="updateTime" label="数据时间"/>
|
||||
<template v-if="phaseFlag === 0">
|
||||
<el-table-column prop="A" :label="`A(${unit})`"/>
|
||||
<el-table-column prop="B" :label="`B(${unit})`"/>
|
||||
<el-table-column prop="C" :label="`C(${unit})`"/>
|
||||
<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="phaseFlag === 1">
|
||||
<el-table-column prop="T" :label="`T(${unit})`"/>
|
||||
<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>
|
||||
@@ -20,26 +23,39 @@
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {computed} from "vue";
|
||||
|
||||
const {tableData} = defineProps<{
|
||||
const {tableData, currentScriptTypeName} = defineProps<{
|
||||
tableData: CheckData.RawDataItem[]
|
||||
currentScriptTypeName: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits(['exportRawDataHandler'])
|
||||
|
||||
const unit = computed(() => {
|
||||
return "V"
|
||||
return tableData.length > 0 ? tableData[0].unit : '';
|
||||
})
|
||||
|
||||
const phaseFlag = computed(() => {
|
||||
let result = 0;
|
||||
if (tableData.length > 0) {
|
||||
result = !tableData[0].T ? 0 : 1;
|
||||
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 result;
|
||||
return currentScriptTypeName
|
||||
})
|
||||
|
||||
const isThreePhase = computed(() => {
|
||||
return currentScriptTypeName.includes('三相电压不平衡度') || currentScriptTypeName.includes('三相电流不平衡度')
|
||||
})
|
||||
|
||||
const exportData = () => {
|
||||
emit('exportRawDataHandler')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,74 +1,96 @@
|
||||
<template>
|
||||
|
||||
<div class="table-main">
|
||||
<el-table :data="tableData" height="335px" :header-cell-style="{ textAlign: 'center' } "
|
||||
<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="phaseFlag === 0">
|
||||
<el-table-column :label="`A(${unit})`">
|
||||
<el-table-column prop="standardValue" width="74" label="标准值(V)"/>
|
||||
<el-table-column prop="A" width="74" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="A_errValue" width="74" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`B(${unit})`">
|
||||
<el-table-column prop="standardValue" width="74" label="标准值(V)"/>
|
||||
<el-table-column prop="B" width="74" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="B_errValue" width="74" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`C(${unit})`">
|
||||
<el-table-column prop="standardValue" width="74" label="标准值(V)"/>
|
||||
<el-table-column prop="C" width="74" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="C_errValue" width="74" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="maxErrVaule" label="最大误差(V)">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="检测结果" width="70">
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column label="A相">
|
||||
<el-table-column prop="stdA" width="110" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataA" width="110" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataA" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.result === '不合格'">{{ scope.row.result }}</el-tag>
|
||||
<span v-if="scope.row.result != '不合格'">{{ scope.row.result }}</span>
|
||||
<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>
|
||||
</template>
|
||||
<template v-if="phaseFlag === 1">
|
||||
<el-table-column :label="`T(${unit})`">
|
||||
<el-table-column prop="standardValue" label="标准值(V)"/>
|
||||
<el-table-column prop="T" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="T_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="maxErrVaule" label="最大误差(V)">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="result" label="检测结果">
|
||||
<el-table-column label="B相">
|
||||
<el-table-column prop="stdB" width="110" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataB" width="110" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="isDataB" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tag type="danger" v-if="scope.row.result === '不合格'">{{ scope.row.result }}</el-tag>
|
||||
<span v-if="scope.row.result != '不合格'">{{ scope.row.result }}</span>
|
||||
<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="110" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataC" width="110" :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>
|
||||
@@ -77,22 +99,37 @@
|
||||
import {defineProps} from 'vue';
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
|
||||
const {tableData} = defineProps<{
|
||||
const {tableData, currentScriptTypeName} = defineProps<{
|
||||
tableData: CheckData.CheckResult[],
|
||||
currentScriptTypeName: string
|
||||
}>();
|
||||
|
||||
|
||||
const unit = computed(() => {
|
||||
return "V"
|
||||
return tableData.length > 0 ? tableData[0].unit : '';
|
||||
})
|
||||
|
||||
const phaseFlag = computed(() => {
|
||||
let result = 0;
|
||||
if (tableData.length > 0) {
|
||||
result = !tableData[0].T ? 0:1;
|
||||
}
|
||||
return result;
|
||||
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>
|
||||
|
||||
<style scoped>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -51,7 +51,13 @@
|
||||
<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 />
|
||||
{{ 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>
|
||||
@@ -62,8 +68,9 @@
|
||||
|
||||
</template>
|
||||
<script lang="tsx" setup name="preTest">
|
||||
import {ElMessage} from "element-plus";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {defineExpose} from 'vue';
|
||||
|
||||
const step1InitLog = ref([
|
||||
{
|
||||
type: 'info',
|
||||
@@ -222,9 +229,6 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const testStatus = toRef(props, 'testStatus');
|
||||
const webMsgSend = toRef(props, 'webMsgSend');
|
||||
const ts = ref('');
|
||||
@@ -239,7 +243,7 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
if (newValue.code == 10200) {
|
||||
step1InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '源校验成功!',
|
||||
log: '源初始化成功!',
|
||||
})
|
||||
activeIndex.value = 1
|
||||
step1.value = 'success'
|
||||
@@ -248,18 +252,30 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
step1.value = 'process'
|
||||
step1InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行源校验!',
|
||||
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: '源未知异常!',
|
||||
}];
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 'yjc_sbtxjy':
|
||||
@@ -284,7 +300,7 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
@@ -330,7 +346,7 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
@@ -367,7 +383,7 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
@@ -400,7 +416,7 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
ts.value = 'error'
|
||||
// ts.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
type: 'error',
|
||||
@@ -431,14 +447,14 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
if (newValue.code == 10200) {
|
||||
step4InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '源已接通!',
|
||||
log: '源参数下发成功,等待校验中.....',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step4.value = 'process'
|
||||
step4InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在接通源.....',
|
||||
log: '源参数下发中.....',
|
||||
}];
|
||||
} else if (newValue.code == 10552) {
|
||||
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
@@ -456,9 +472,15 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
|
||||
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: 'info',
|
||||
log: '相序校验:'+newValue.data,
|
||||
type: type,
|
||||
log:newValue.data,
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
@@ -467,8 +489,14 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
type: 'wait',
|
||||
log: '获取数据相序校验数据!',
|
||||
}];
|
||||
}
|
||||
else if (newValue.code == 25001) {
|
||||
} 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({
|
||||
@@ -504,6 +532,16 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'unknown_operate':
|
||||
|
||||
break;
|
||||
case 'error_flow_end':
|
||||
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
ts.value = 'error'
|
||||
break;
|
||||
}
|
||||
|
||||
})
|
||||
@@ -546,8 +584,6 @@ watch(ts, function (newValue, oldValue) {
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
// 定义一个初始化参数的方法
|
||||
function initializeParameters() {
|
||||
activeIndex.value = 0
|
||||
@@ -585,9 +621,6 @@ function initializeParameters() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
initializeParameters,
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" :model-value="dialogVisible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
|
||||
<el-dialog :title="dialogTitle" :model-value="dialogVisible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px"
|
||||
draggable>
|
||||
|
||||
<div class="steps-container">
|
||||
<!-- simple -->
|
||||
@@ -17,19 +18,39 @@
|
||||
<preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest>
|
||||
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
|
||||
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
|
||||
<test ref="testRef" v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume"></test>
|
||||
<test v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event"
|
||||
@sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck"></test>
|
||||
|
||||
<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="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="danger" :icon="Close" v-if="ActiveStatue === 'paused'" @click="handleSubmit">继续检测</el-button>
|
||||
<el-button type="primary" :icon="RefreshLeft" v-if="ActiveStatue === 'error'" @click="handleSubmit">重新检测</el-button>
|
||||
<el-button type="primary" :icon="Refresh" v-if="ActiveStatue === 'preTest_process'" disabled>预检测中</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="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit" :disabled="btnState">开始检测</el-button>
|
||||
<el-button type="primary" v-if="TestStatus === 'process'" @click="handleSubmit" 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="TestStatus === 'test_recheck'" @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="ActiveStatue === 'success'||ActiveStatue==='preTest_fail'" @click="nextStep">
|
||||
v-if="ActiveStatue === 'success'||ActiveStatue==='error'||ActiveStatue==='test_init_fail'||ActiveStatue==='connect_timeout'||ActiveStatue==='pause_timeout'"
|
||||
@click="nextStep">
|
||||
{{ nextStepText }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -55,14 +76,15 @@
|
||||
SuccessFilled,
|
||||
UploadFilled,
|
||||
VideoPlay,
|
||||
RefreshLeft
|
||||
RefreshLeft, Loading
|
||||
} from '@element-plus/icons-vue'
|
||||
import preTest from './preTest.vue'
|
||||
import timeTest from './timeTest.vue'
|
||||
import {Device} from '@/api/device/interface/device';
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import {startPreTest,startTest,pauseTest,resumeTest} from '@/api/socket/socket'
|
||||
import {startPreTest, pauseTest, resumeTest} from '@/api/socket/socket'
|
||||
import {showFullScreenLoading} from "@/components/Loading/fullScreen";
|
||||
|
||||
|
||||
//import SvgIcon from '@/components/SvgIcon.vue';
|
||||
@@ -92,7 +114,7 @@
|
||||
// (e: 'update:visible', value: boolean): void;
|
||||
// (e: 'submit', data: any): void;
|
||||
// }>();
|
||||
|
||||
const btnState = ref(false)
|
||||
const checkStore = useCheckStore();
|
||||
const skipDisabled = ref(false);
|
||||
const nextStepText = ref('下一步');
|
||||
@@ -151,12 +173,14 @@ const detectionOptions = ref([
|
||||
const dialogTitle = ref('');
|
||||
const isTimeCheck = ref(false)
|
||||
const preTestRef = ref(null);
|
||||
const testRef = ref(null);
|
||||
|
||||
|
||||
// const devIdArr = ref([])
|
||||
// const planId = ref('')
|
||||
|
||||
|
||||
const dataSocket = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (selection: Device.ResPqDev[], title: string, time: boolean) => {
|
||||
|
||||
@@ -191,15 +215,12 @@ const detectionOptions = ref([
|
||||
|
||||
preTestStatus.value = 'waiting';//预检测执行状态
|
||||
//开始创建webSocket客户端
|
||||
const data = reactive({
|
||||
socketServe: socketClient.Instance,
|
||||
});
|
||||
const url = 'ws://localhost:7777/hello?name=cdf';
|
||||
socketClient.Instance.connect(url);
|
||||
data.socketServe = socketClient.Instance;
|
||||
data.socketServe.registerCallBack('aaa', (res) => {
|
||||
|
||||
socketClient.Instance.connect();
|
||||
dataSocket.socketServe = socketClient.Instance;
|
||||
dataSocket.socketServe.registerCallBack('aaa', (res) => {
|
||||
// 处理来自服务器的消息
|
||||
console.log('Received message:', res);
|
||||
// console.log('Received message:', res);
|
||||
// 根据需要在这里添加更多的处理逻辑
|
||||
|
||||
if (res.code === 20000) {
|
||||
@@ -215,35 +236,44 @@ const detectionOptions = ref([
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
let loading;
|
||||
const handleSubmit = () => {
|
||||
skipDisabled.value = true
|
||||
//btnState.value = true
|
||||
console.log('=============', stepsActiveIndex.value)
|
||||
|
||||
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||
let planId = checkStore.planId
|
||||
|
||||
|
||||
if(!dataSocket.socketServe.connected){
|
||||
ElMessage.error('webSocket连接中断!')
|
||||
return
|
||||
}
|
||||
|
||||
switch (stepsActiveIndex.value) {
|
||||
case 0:
|
||||
preTestStatus.value = 'start'
|
||||
// preTestStatus.value = 'start'
|
||||
|
||||
|
||||
/* loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '',
|
||||
background: 'rgb(255, 255, 255, 0)',
|
||||
})*/
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType:'0' // '0'为预检测、‘1‘为正式检测
|
||||
operateType: '1' // '1'为预检测、‘2‘为正式检测
|
||||
}).then(res => {
|
||||
|
||||
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '检测失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TestStatus.value = 'error'
|
||||
}
|
||||
})
|
||||
preTestStatus.value = 'start'
|
||||
break;
|
||||
case 1:
|
||||
timeTestStatus.value = 'start'
|
||||
@@ -253,45 +283,38 @@ const detectionOptions = ref([
|
||||
// break;
|
||||
case 2:
|
||||
if (TestStatus.value == "waiting") {
|
||||
// startTest({
|
||||
// userPageId: "cdf",
|
||||
// devIds:deviceIds,
|
||||
// planId:planId,
|
||||
// operateType:'1' // '0'为预检测、‘1‘为正式检测
|
||||
// }).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'start'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
// })
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType: '2' // '1'为预检测、‘2‘为正式检测
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TestStatus.value = 'test_init_fail'
|
||||
}
|
||||
/* if (res.code === 20000) {
|
||||
TestStatus.value = 'start'
|
||||
webMsgSend.value = ''
|
||||
} else {
|
||||
ElMessage.error(res.message)
|
||||
}*/
|
||||
})
|
||||
TestStatus.value = 'start'
|
||||
} else if (TestStatus.value == 'process') {
|
||||
// 发送暂停指令
|
||||
// pauseTest({deviceIds}).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'paused'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
// })
|
||||
TestStatus.value = 'paused'
|
||||
} else if (TestStatus.value == 'paused') {
|
||||
// 发送继续指令
|
||||
// resumeTest({deviceIds}).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'process'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
// })
|
||||
TestStatus.value = 'process'
|
||||
sendResume()
|
||||
} else if (TestStatus.value == 'test_recheck') {
|
||||
// 发送重新检测指令
|
||||
sendReCheck()
|
||||
|
||||
|
||||
}else if (TestStatus.value == 'success') {
|
||||
emit('quitClicked'); // 触发事件
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -299,11 +322,13 @@ const detectionOptions = ref([
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'quitClicked'): void;
|
||||
}>();
|
||||
|
||||
watch(preTestStatus, function (newValue, oldValue) {
|
||||
console.log(newValue, oldValue);
|
||||
|
||||
@@ -331,52 +356,101 @@ const detectionOptions = ref([
|
||||
skipDisabled.value = false
|
||||
}
|
||||
|
||||
if(newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2)
|
||||
{
|
||||
if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
nextStepText.value = '检测完成'
|
||||
}
|
||||
if(newValue === 'preTest_fail' && stepsActiveIndex.value === stepsTotalNum.value - 2)
|
||||
{
|
||||
if (newValue === 'error' && stepsActiveIndex.value === stepsTotalNum.value - 3) {
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
nextStepText.value = '预检测失败'
|
||||
nextStepText.value = '检测失败'
|
||||
}
|
||||
if (newValue === 'test_init_fail' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
nextStepText.value = '初始化失败'
|
||||
}
|
||||
if (newValue === 'connect_timeout' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
nextStepText.value = '连接超时'
|
||||
}
|
||||
if (newValue === 'pause_timeout' && stepsActiveIndex.value === stepsTotalNum.value - 2) {
|
||||
stepsActiveIndex.value++;
|
||||
stepsActiveIndex.value++;
|
||||
nextStepText.value = '结束测试'
|
||||
}
|
||||
})
|
||||
|
||||
const sendPause = () => {
|
||||
console.log('发送暂停指令')
|
||||
console.log('发起暂停请求')
|
||||
|
||||
TestStatus.value = 'paused_ing'
|
||||
pauseTest()
|
||||
}
|
||||
const sendResume = () => {
|
||||
console.log('发送继续检测指令')
|
||||
console.log('发起继续检测请求')
|
||||
|
||||
resumeTest({
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.planId,
|
||||
operateType: '2' // '1'为预检测、‘2‘为正式检测
|
||||
}).then(res => {
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Resume_Success'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const sendReCheck = () => {
|
||||
console.log('发送重新检测指令')
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.planId,
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TestStatus.value = 'test_init_fail'
|
||||
}
|
||||
})
|
||||
TestStatus.value = 'start'
|
||||
}
|
||||
|
||||
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;
|
||||
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 nextStep = () => {
|
||||
if(stepsActiveIndex.value < stepsTotalNum.value )
|
||||
{
|
||||
if (stepsActiveIndex.value < stepsTotalNum.value && ActiveStatue.value != 'error') {
|
||||
stepsActiveIndex.value++
|
||||
if (!isTimeCheck.value) {//不具备守时检测,预检测后直接跳正式检测
|
||||
stepsActiveIndex.value++
|
||||
}
|
||||
|
||||
ActiveStatue.value = 'waiting'
|
||||
}
|
||||
else if(stepsActiveIndex.value === stepsTotalNum.value)
|
||||
{
|
||||
} else if (stepsActiveIndex.value === stepsTotalNum.value || ActiveStatue.value === 'error') {
|
||||
//emit('update:visible', false); // 关闭对话框
|
||||
clearData()
|
||||
dialogVisible.value = false;
|
||||
@@ -393,10 +467,10 @@ const getIcon = (index: number) => {
|
||||
skipDisabled.value = false
|
||||
nextStepText.value = "下一步"
|
||||
}
|
||||
|
||||
const beforeClose = (done: () => void) => {
|
||||
console.log(stepsActiveIndex.value, stepsTotalNum.value)
|
||||
if(stepsActiveIndex.value < stepsTotalNum.value)
|
||||
{
|
||||
if (stepsActiveIndex.value < stepsTotalNum.value) {
|
||||
ElMessageBox.confirm(
|
||||
'检测未完成,是否退出当前检测流程?',
|
||||
'提示',
|
||||
@@ -412,9 +486,7 @@ const getIcon = (index: number) => {
|
||||
//emit('update:visible', false); // 关闭对话框
|
||||
dialogVisible.value = false;
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
clearData()
|
||||
//emit('update:visible', false); // 关闭对话框
|
||||
dialogVisible.value = false;
|
||||
@@ -428,13 +500,14 @@ const getIcon = (index: number) => {
|
||||
// })
|
||||
}
|
||||
const handleCancel = () => {
|
||||
dataSocket.socketServe.closeWs()
|
||||
|
||||
emit('quitClicked'); // 触发事件
|
||||
// clearData()
|
||||
// emit('update:visible', false); // 关闭对话框
|
||||
testRef.value?.clear()
|
||||
};
|
||||
|
||||
|
||||
|
||||
// // 当 props.visible 改变时,更新 formData
|
||||
// watch(() => props.visible, (newVal) => {
|
||||
// if (!newVal) {
|
||||
@@ -452,6 +525,7 @@ const getIcon = (index: number) => {
|
||||
:deep(.dialog-big .el-dialog__body) {
|
||||
max-height: 840px !important;
|
||||
}
|
||||
|
||||
// :deep(.dialog-big){
|
||||
// max-height: 840px !important;
|
||||
// }
|
||||
@@ -485,6 +559,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;
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
<el-tab-pane label="守时误差">
|
||||
<div class="right-title" >
|
||||
<span v-if="activeIndex <= 1"> </span>
|
||||
<span v-if="activeIndex > 1" style=" font-size: 18px;font-weight: 600;">
|
||||
<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 style=" color: #606266; font-size: 16px;font-weight: 600;">
|
||||
<span class="description-text">
|
||||
合格≤1000ms
|
||||
</span>
|
||||
|
||||
<div class="red-div"></div>
|
||||
<span style=" color: #F56C6c; font-size: 16px;font-weight: 600;">
|
||||
<span class="description-text unqualified">
|
||||
不合格>1000ms
|
||||
</span>
|
||||
</div>
|
||||
@@ -78,7 +78,14 @@
|
||||
:cell-style="{ textAlign: 'center' }" style="width: 100%; height:435px" border>
|
||||
</ProTable> -->
|
||||
|
||||
<el-table v-if="activeIndex > 0" :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="margin-top: -30px;width: 100%" border>
|
||||
<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)">
|
||||
@@ -110,6 +117,7 @@
|
||||
</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)
|
||||
@@ -196,7 +204,7 @@ const columns = reactive([
|
||||
prop: 'Result',
|
||||
label: '检测结果',
|
||||
// width: 100,
|
||||
render: (scope) => {
|
||||
render: (scope: { row: { Result: string } }) => {
|
||||
if (scope.row.Result === '不合格') {
|
||||
return (
|
||||
<el-tag type='danger'>{scope.row.Result}</el-tag>
|
||||
@@ -231,7 +239,7 @@ watch(testStatus, function (newValue, oldValue) {
|
||||
}
|
||||
})
|
||||
|
||||
function formatDateTime(date) {
|
||||
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');
|
||||
@@ -408,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,6 +3,7 @@
|
||||
<div class='search_view'>
|
||||
<el-input
|
||||
placeholder='请输入计划名称'
|
||||
clearable
|
||||
v-model='searchForm.planName'
|
||||
></el-input>
|
||||
<Menu style='width: 26px;height: 26px; margin-left: 8px;cursor: pointer;color:var(--el-color-primary)'
|
||||
@@ -16,6 +17,7 @@
|
||||
:props='defaultProps'
|
||||
node-key='id'
|
||||
class="filter-tree"
|
||||
:highlight-current="true"
|
||||
default-expand-all
|
||||
:default-checked-keys='defaultChecked'
|
||||
@node-click='handleNodeClick'
|
||||
@@ -23,7 +25,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>
|
||||
@@ -35,13 +37,14 @@
|
||||
<script lang='ts' setup>
|
||||
import { type Plan } from '@/api/plan/interface';
|
||||
import { Menu, Platform, CircleCheck,Loading } from '@element-plus/icons-vue'
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
|
||||
const router = useRouter()
|
||||
const checkStore = useCheckStore()
|
||||
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
const data: any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
@@ -51,18 +54,57 @@ const defaultProps = {
|
||||
const searchForm = ref({
|
||||
planName: '',
|
||||
})
|
||||
const defaultChecked = ref<number[]>([]) // 明确类型为 number[]
|
||||
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.setPlanId(node.id);
|
||||
checkStore.setPlanCode(node.code);
|
||||
checkStore.setScriptId(node.scriptId);
|
||||
checkStore.setErrorSysId(node.errorSysId);
|
||||
// 高亮显示第一个节点
|
||||
// 使用 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
|
||||
if (data.value.length > 0 && data.value[0].children.length > 0) {
|
||||
defaultChecked.value.push(data.value[0].children[0].id as number)
|
||||
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;
|
||||
}
|
||||
checkStore.setPlanId(defaultChecked.value[0])
|
||||
checkStore.setPlanCode(data.value[0].code)
|
||||
}
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
}
|
||||
|
||||
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(node.value);
|
||||
idd.value = node.value
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const {updateSelectedTreeNode} = defineProps<{
|
||||
updateSelectedTreeNode:Function;
|
||||
}>();
|
||||
@@ -75,16 +117,34 @@ watch(
|
||||
deep: true,
|
||||
},
|
||||
)
|
||||
|
||||
const idd = ref('')
|
||||
const handleNodeClick = (data: Plan.ResPlan) => {
|
||||
|
||||
if (data.name === '未检' || data.name === '检测中' || data.name === '检测完成') {
|
||||
// 如果是父节点,不执行任何操作
|
||||
//console.log('父节点不执行任何操作');
|
||||
// 设置当前高亮节点
|
||||
nextTick(() => {
|
||||
treeRef.value?.setCurrentKey(idd.value);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
idd.value = data.id
|
||||
|
||||
checkStore.setPlanId(data.id)
|
||||
checkStore.setPlanCode(data.code)
|
||||
checkStore.setScriptId(data.scriptId)
|
||||
checkStore.setErrorSysId(data.errorSysId)
|
||||
updateSelectedTreeNode(data.id)
|
||||
}
|
||||
const filterNode = (value: string, data: any) => {
|
||||
if (!value) return true
|
||||
return data.name.includes(value)
|
||||
}
|
||||
|
||||
|
||||
// 点击详情
|
||||
const detail = () => {
|
||||
router.push('/plan')
|
||||
@@ -92,16 +152,15 @@ const detail = () => {
|
||||
onMounted(() => {
|
||||
// console.log()
|
||||
})
|
||||
defineExpose({ getTreeData })
|
||||
defineExpose({ getTreeData ,clickTableToTree})
|
||||
|
||||
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.plan_tree {
|
||||
// width: 200px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 5px;
|
||||
// height: calc(100% - 70px);
|
||||
background-color: #fff;
|
||||
|
||||
.search_view {
|
||||
@@ -136,6 +195,8 @@ defineExpose({ getTreeData })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.filter-tree {
|
||||
// border: 1px solid #dcdfe6;
|
||||
min-width: 100%;
|
||||
@@ -143,6 +204,7 @@ defineExpose({ getTreeData })
|
||||
display: inline-block;
|
||||
overflow: auto;
|
||||
margin-top: 12px;
|
||||
|
||||
}
|
||||
|
||||
//.filter-tree span {
|
||||
@@ -154,7 +216,6 @@ defineExpose({ getTreeData })
|
||||
// text-overflow:ellipsis;
|
||||
// padding-right: 12px;
|
||||
//}
|
||||
|
||||
.leftBox {
|
||||
// float: left;
|
||||
// width: 20%;
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
<!-- 真正的首页 -->
|
||||
<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 name="1">
|
||||
<!--检测计划统计 饼图统计-->
|
||||
<div class='container_pieShow'>
|
||||
<el-collapse model-value='1' accordion @change='handleCollapseChange'>
|
||||
<el-collapse-item name='1'>
|
||||
<template #title>
|
||||
<div style="display: flex; justify-content: space-between; width: 100%;">
|
||||
<span style="font-weight: bold;margin-left: 15px;">检测计划统计</span>
|
||||
<span style="font-weight: bold;margin-right: 15px;">{{ planName }}</span>
|
||||
<div class='container_pieShow_title'>
|
||||
<span>检测计划统计</span>
|
||||
<span>{{ planName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 饼图 -->
|
||||
<div class="container_charts">
|
||||
<div class="charts_info" ref="chartsInfoRef">
|
||||
<div class='container_charts'>
|
||||
<div class='charts_info' ref='chartsInfoRef'>
|
||||
<pie
|
||||
:customData="{
|
||||
title: '设备检测状态',
|
||||
@@ -50,11 +50,11 @@
|
||||
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: '设备检测结果',
|
||||
@@ -65,28 +65,23 @@
|
||||
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: 'left',
|
||||
label: {
|
||||
normal: {
|
||||
position: 'inner',
|
||||
},
|
||||
},
|
||||
}"
|
||||
:legendData="{
|
||||
icon: 'circle',
|
||||
left: 'left',
|
||||
top: 'bottom',
|
||||
}"
|
||||
:chartsData="chartsData3"
|
||||
ref="pieRef3"
|
||||
:chartsData='chartsData3'
|
||||
ref='pieRef3'
|
||||
></pie>
|
||||
</div>
|
||||
</div>
|
||||
@@ -94,46 +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" :id='currentId' :isTimeCheck='isTimeCheck'></Table>
|
||||
<div class='container_table' :style='{ height: tableHeight }'>
|
||||
<Table ref='tableRef1' :id='currentId' :isTimeCheck='isTimeCheck' :plan = 'select_Plan' @batchGenerateClicked="handleBatchGenerate"></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" :id='currentId'></Table>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
<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 { 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 { 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";
|
||||
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 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,//子功能选择,例如未检设备报告生成,或已检设备更换误差体系生成
|
||||
@@ -143,84 +135,74 @@ 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 checkStateTable = ref<number[]>([0, 1, 2])
|
||||
const tabsHeight = ref('calc(100vh - 538px)'); // 初始高度
|
||||
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[]) => {
|
||||
}
|
||||
const isTimeCheck = ref<boolean>(false);
|
||||
const planList = ref<ResultData<Plan.ReqPlan[]>>();
|
||||
const isTimeCheck = ref<boolean>(false)
|
||||
const planList = ref<ResultData<Plan.ReqPlan[]>>()
|
||||
const select_Plan = ref<Plan.ReqPlan>()
|
||||
const isLabelLineShow = ref(true)
|
||||
const handleCollapseChange = (val: CollapseModelValue) => {
|
||||
|
||||
// 计算新的高度
|
||||
let newHeight;
|
||||
let newHeight
|
||||
if (Array.isArray(val)) {
|
||||
newHeight = val.length > 0 ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)';
|
||||
newHeight = val.length > 0 ? 'calc(100vh - 522px)' : 'calc(100vh - 333px)'
|
||||
} else {
|
||||
newHeight = val ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)';
|
||||
newHeight = val ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)'
|
||||
}
|
||||
tabsHeight.value = newHeight
|
||||
tabPaneHeight.value = `calc(100% - 5px)`
|
||||
tableHeight.value = `calc(100% - 5px)`
|
||||
}
|
||||
//const newtableHeight= val.length > 0 ? 'calc(100vh - 638px)' : 'calc(100vh - 433px)';
|
||||
tabsHeight.value = newHeight;
|
||||
tabPaneHeight.value = `calc(100% - 5px)`;
|
||||
tableHeight.value = `calc(100% - 5px)`;
|
||||
|
||||
// tableRef1.value.resize();
|
||||
// tableRef2.value.resize();
|
||||
};
|
||||
|
||||
const handleTabsChange = (val: any) => {
|
||||
form.value.activeTabs = 0;
|
||||
form.value.activeTabs = 3;
|
||||
form.value.activeChildTabs = Number(val);
|
||||
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: "/src/assets/images/plan/static/4.svg",
|
||||
img: new URL('/src/assets/images/plan/static/4.svg', import.meta.url).href,
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
label: "数据操作",
|
||||
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,
|
||||
},
|
||||
]);
|
||||
])
|
||||
|
||||
form.value.activeTabs = tabsList.value[0].value
|
||||
const tableRef1 = ref()
|
||||
const tableRef2 = ref()
|
||||
const currentId = ref('')
|
||||
|
||||
form.value.activeTabs = tabsList.value[0].value;
|
||||
const tableRef1 = ref();
|
||||
const tableRef2 = ref();
|
||||
const currentId = ref('');
|
||||
|
||||
watch(
|
||||
() => form.value,
|
||||
@@ -229,261 +211,357 @@ watch(
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
tableRef2.value && tableRef2.value.changeActiveTabs(form.value.activeTabs, form.value.activeChildTabs)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
||||
const pieRef1 = ref(),
|
||||
pieRef2 = ref(),
|
||||
pieRef3 = ref();
|
||||
pieRef3 = ref()
|
||||
|
||||
const chartsData1: any = ref([]),
|
||||
chartsData2: any = ref([]),
|
||||
chartsData3: any = ref([]);
|
||||
chartsData3: any = ref([])
|
||||
|
||||
const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefined => {
|
||||
for (const plan of plans) {
|
||||
if (plan.id === id) {
|
||||
return plan;
|
||||
return plan
|
||||
}
|
||||
if (plan.children) {
|
||||
const foundPlan = findPlanById(plan.children, id);
|
||||
const foundPlan = findPlanById(plan.children, id)
|
||||
if (foundPlan) {
|
||||
return foundPlan;
|
||||
return foundPlan
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
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
|
||||
//handleCheckFunction(0)//切换左侧树,默认css功能是设备检测
|
||||
|
||||
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};
|
||||
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);
|
||||
const plan = findPlanById(planList.value?.data || [], id)
|
||||
planName.value = '所选计划:' + plan.name
|
||||
|
||||
select_Plan.value = plan
|
||||
if (plan) {
|
||||
//isTimeCheck.value = plan.timeCheck === 1; // 将 1 转换为 true,0 转换为 false
|
||||
isTimeCheck.value = false; // 将 1 转换为 true,0 转换为 false ----目前不用守时检测,先去除
|
||||
isTimeCheck.value = false // 将 1 转换为 true,0 转换为 false ----目前不用守时检测,先去除
|
||||
} else {
|
||||
// 处理未找到计划的情况
|
||||
isTimeCheck.value = false; // 或者其他默认值
|
||||
isTimeCheck.value = false // 或者其他默认值
|
||||
}
|
||||
const pqDevList_Result2 = await getBoundPqDevList({'planId': id, 'checkStateList': [0, 1, 2, 3]});
|
||||
boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[];
|
||||
|
||||
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]++;
|
||||
checkStateCount[t.checkState]++
|
||||
}
|
||||
});
|
||||
})
|
||||
boundPqDevList.value.forEach(t => {
|
||||
if (t.checkResult !== undefined && t.checkResult !== null && checkResultCount[t.checkResult] !== undefined) {
|
||||
checkResultCount[t.checkResult]++;
|
||||
checkResultCount[t.checkResult]++
|
||||
}
|
||||
});
|
||||
})
|
||||
boundPqDevList.value.forEach(t => {
|
||||
if (t.reportState !== undefined && t.reportState !== null && reportStateCount[t.reportState] !== undefined) {
|
||||
reportStateCount[t.reportState]++;
|
||||
}
|
||||
});
|
||||
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: checkStateCount[0], name: "未检", itemStyle: {color: '#fac858'}},
|
||||
{value: checkStateCount[1], name: "检测中", itemStyle: {color: '#ee6666'}},
|
||||
{value: checkStateCount[2], name: "检测完成", itemStyle: {color: '#91cc75'}},
|
||||
{value: checkStateCount[3], 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: checkResultCount[2], name: "未检", itemStyle: {color: '#fac858'}},
|
||||
{value: checkResultCount[0], name: "不符合", itemStyle: {color: '#ee6666'}},
|
||||
{value: checkResultCount[1], name: "符合", itemStyle: {color: '#91cc75'}},
|
||||
];
|
||||
chartsData3.value = [
|
||||
{value: reportStateCount[2], name: "未检", itemStyle: {color: '#fac858'}},
|
||||
{value: reportStateCount[0], name: "未生成", itemStyle: {color: '#ee6666'}},
|
||||
{value: reportStateCount[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' } },
|
||||
];
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
// 检查 reportStateCount 是否全为 0
|
||||
const allZeroReport = Object.values(reportStateCount).every(count => count === 0);
|
||||
chartsData3.value = [
|
||||
{ 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' } },
|
||||
];
|
||||
|
||||
}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);
|
||||
};
|
||||
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://自动检测
|
||||
checkStateTable.value = [0, 1, 2]
|
||||
tabLabel1.value = "设备检测";
|
||||
break;
|
||||
tabLabel1.value = '设备检测'
|
||||
break
|
||||
case 1://手动检测
|
||||
tabLabel1.value = "手动检测";
|
||||
break;
|
||||
tabLabel1.value = '手动检测'
|
||||
break
|
||||
case 2://设备复检
|
||||
tabLabel1.value = "设备复检";
|
||||
break;
|
||||
tabLabel1.value = '设备复检'
|
||||
break
|
||||
case 3://报告生成
|
||||
checkStateTable.value = [2, 3]
|
||||
tabLabel1.value = "报告生成";
|
||||
tabLabel1.value = '报告生成'
|
||||
//tabShow.value = true;
|
||||
break;
|
||||
break
|
||||
case 4://设备归档
|
||||
checkStateTable.value = [2]
|
||||
tabLabel1.value = "设备归档";
|
||||
break;
|
||||
tabLabel1.value = '设备归档'
|
||||
break
|
||||
case 5://数据查询
|
||||
checkStateTable.value = [2, 3]
|
||||
tabLabel1.value = "数据查询";
|
||||
break;
|
||||
tabLabel1.value = '数据查询'
|
||||
break
|
||||
}
|
||||
form.value.activeTabs = val
|
||||
}
|
||||
form.value.activeTabs = val;
|
||||
};
|
||||
|
||||
|
||||
const resizeObserver = new ResizeObserver(entries => {
|
||||
for (let entry of entries) {
|
||||
chartsWidth.value = entry.contentRect.width;
|
||||
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);
|
||||
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)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
onBeforeMount(async () => {
|
||||
|
||||
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: "",
|
||||
datasourceIds: '',
|
||||
sourceIds: '',
|
||||
planId: '',
|
||||
scriptName: '',
|
||||
errorSysName: '',
|
||||
sourceName: '',
|
||||
devIds: [],
|
||||
id: "",
|
||||
name: "",
|
||||
dataSourceId: "",
|
||||
scriptId: "",
|
||||
errorSysId: "",
|
||||
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[]>;
|
||||
|
||||
if (planList.value.data[0].children[0]) {
|
||||
currentId.value = planList.value.data[0].children[0].id;
|
||||
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);
|
||||
resizeObserver.observe(chartsInfoRef.value)
|
||||
}
|
||||
getTree(planList.value.data);
|
||||
getTree(planList.value.data)
|
||||
|
||||
getPieData(currentId.value);
|
||||
});
|
||||
getPieData(currentId.value)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
if (chartsInfoRef.value) {
|
||||
resizeObserver.unobserve(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 {
|
||||
@@ -565,134 +643,48 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
// .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: 100%;
|
||||
background-color: #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.charts_info {
|
||||
margin-top: 5px;
|
||||
border-radius: 4px;
|
||||
margin-top: 1px;
|
||||
flex: none;
|
||||
width: 33.1%;
|
||||
height: 100% !important;
|
||||
background-color: #fff;
|
||||
// border-radius: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,8 +693,11 @@ onUnmounted(() => {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tabs-menu {
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.container_table {
|
||||
@@ -728,12 +723,18 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__conten) {
|
||||
// background-color:#f6f6f6;
|
||||
padding-bottom: 0px !important;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__content ) {
|
||||
// background-color:#f6f6f6;
|
||||
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,26 +62,27 @@ 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) => {
|
||||
modeStore.setCurrentMode(item.code); // 将模式code存入 store
|
||||
AppSceneStore.setCurrentMode('1');//0:省级平台,1:设备出厂,2:研发自测
|
||||
await authStore.setShowMenu();
|
||||
return;
|
||||
// if (isActive) {
|
||||
@@ -82,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%;
|
||||
@@ -91,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;
|
||||
@@ -154,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;
|
||||
@@ -170,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;
|
||||
@@ -205,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>
|
||||
|
||||
@@ -28,6 +28,11 @@ 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'
|
||||
|
||||
defineOptions({
|
||||
name: 'log'
|
||||
})
|
||||
|
||||
let multipleSelection = ref<string[]>([])
|
||||
const logData = logDataList
|
||||
const dictStore = useDictStore()
|
||||
@@ -37,6 +42,10 @@ const excludedUnits = ['季度','年']; // 要排除的单位
|
||||
const defaultUnits = '日'; // 默认的单位
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
|
||||
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<Sys_Log_Audit.Audit_LogList>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
|
||||
@@ -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[]
|
||||
|
||||
217
frontend/src/views/machine/devType/components/devTypePopup.vue
Normal file
217
frontend/src/views/machine/devType/components/devTypePopup.vue
Normal file
@@ -0,0 +1,217 @@
|
||||
<template>
|
||||
<!-- 基础信息弹出框 -->
|
||||
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogMiddle" @close="close" >
|
||||
<div>
|
||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' class="form-two">
|
||||
<el-form-item label="名称" prop="name" >
|
||||
<el-input v-model='formContent.name' placeholder="请输入设备类型名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工作电源" prop="power" >
|
||||
<el-select v-model="formContent.power" clearable placeholder="请选择工作电源">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Power')"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道数" prop="devChns" >
|
||||
<el-select v-model="formContent.devChns" clearable placeholder="请选择设备通道数">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Chns')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电压(V)" prop="devVolt" >
|
||||
<el-select v-model="formContent.devVolt" clearable placeholder="请选择额定电压">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Volt')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电流(A)" prop="devCurr" >
|
||||
<el-select v-model="formContent.devCurr" clearable placeholder="请选择额定电流">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Curr')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报告模版名称" prop="reportName" >
|
||||
<el-select v-model="formContent.reportName" clearable placeholder="请选择报告模版">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Report_Template')"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备关联ICD" prop="icd" >
|
||||
<el-select v-model="formContent.icd" clearable placeholder="请选择ICD">
|
||||
<el-option
|
||||
v-for="item in icdOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="save()" >
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import{ ElMessage, type FormInstance,type FormItemRule } from 'element-plus'
|
||||
import type { ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { ref,computed, Ref } from 'vue'
|
||||
import { type DevType } from '@/api/device/interface/devType'
|
||||
import { type ICD } from '@/api/device/interface/icd'
|
||||
import {dialogMiddle} from '@/utils/elementBind'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {addDevType,updateDevType} from '@/api/device/devType'
|
||||
import {getICDAllList} from '@/api/device/icd'
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const icdOptions = ref<ICD.ResICD[]>([])
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const titleType = ref('add')
|
||||
const formContent = ref<DevType.ResPqDevType>({
|
||||
id: '', //设备类型ID
|
||||
name: '',//设备类型名称
|
||||
icd: '',//设备关联的ICD
|
||||
power: 'AC/DC 110V-220V',//工作电源
|
||||
devVolt: 57.74, //额定电压(V)
|
||||
devCurr: 5, //额定电流(A)
|
||||
devChns: 1, //设备通道数
|
||||
reportName: '',//报告模版名称
|
||||
state: 1,
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||
|
||||
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
formContent.value = {
|
||||
id: '', //设备类型ID
|
||||
name: '',//设备类型名称
|
||||
icd: '',//设备关联的ICD
|
||||
power: 'AC/DC 110V-220V',//工作电源
|
||||
devVolt: 57.74, //额定电压(V)
|
||||
devCurr: 5, //额定电流(A)
|
||||
devChns: 1, //设备通道数
|
||||
reportName: '',//报告模版名称
|
||||
state: 1,
|
||||
}
|
||||
}
|
||||
|
||||
let dialogTitle = computed(() => {
|
||||
return titleType.value === 'add' ? '新增设备类型' : '编辑设备类型'
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
//定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{ required: true, message: '设备类型名称必填!', trigger: 'blur' }],
|
||||
power: [
|
||||
{ required: true, message: '工作电源必选!', trigger: 'change' }
|
||||
],
|
||||
devChns: [
|
||||
{ required: true, message: '设备通道数必选!', trigger: 'change' }
|
||||
],
|
||||
devVolt: [
|
||||
{ required: true, message: '额定电压必选!', trigger: 'change' }
|
||||
],
|
||||
devCurr: [
|
||||
{ required: true, message: '额定电流必选!', trigger: 'change' }
|
||||
],
|
||||
reportName: [
|
||||
{ required: true, message: '报告模版名称必选!', trigger: 'change' }
|
||||
],
|
||||
icd: [
|
||||
{ required: true, message: '设备关联ICD必选!', trigger: 'change' }
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (formContent.value.id) {
|
||||
await updateDevType(formContent.value);
|
||||
} else {
|
||||
await addDevType(formContent.value);
|
||||
}
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
close()
|
||||
// 刷新表格
|
||||
await props.refreshTable!()
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
//error('验证过程中出现错误', err)
|
||||
}
|
||||
}
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: DevType.ResPqDevType,icd: ICD.ResICD[]) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
icdOptions.value = icd
|
||||
|
||||
if (data.id) {
|
||||
formContent.value = { ...data }
|
||||
} else {
|
||||
resetFormContent()
|
||||
}
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
}>()
|
||||
|
||||
</script>
|
||||
173
frontend/src/views/machine/devType/index.vue
Normal file
173
frontend/src/views/machine/devType/index.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class='table-box' ref='popupBaseView'>
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:request-api='getTableList'
|
||||
>
|
||||
<!-- :requestApi="getRoleList" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button v-auth.devType="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.devType="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button v-auth.devType="'edit'" type='primary' link :icon='EditPen' :model-value='false'
|
||||
@click="openDialog('edit', scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button v-auth.devType="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
</div>
|
||||
<DevTypePopup :refresh-table='proTable?.getTableList' ref='devTypePopup' />
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx' name='useRole'>
|
||||
import TimeControl from '@/components/TimeControl/index.vue'
|
||||
import { type DevType } from '@/api/device/interface/devType'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { CirclePlus, Delete, EditPen, Download, Upload } from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {
|
||||
getDevTypeList,
|
||||
deleteDevType,
|
||||
} from '@/api/device/devType/index.ts'
|
||||
import { onBeforeMount, reactive, ref } from 'vue'
|
||||
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
||||
import { getICDAllList } from '@/api/device/icd'
|
||||
import type { ICD } from '@/api/device/interface/icd'
|
||||
|
||||
// defineOptions({
|
||||
// name: 'devType',
|
||||
// })
|
||||
const modeStore = useModeStore()
|
||||
const dictStore = useDictStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const devTypePopup = ref()
|
||||
const icdOptions = ref<ICD.ResICD[]>([])
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
return getDevTypeList(newParams)
|
||||
}
|
||||
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<DevType.ResPqDevType>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
search: { el: 'input' },
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'power',
|
||||
label: '工作电源',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
label: '通道数',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'devVolt',
|
||||
label: '额定电压(V)',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'devCurr',
|
||||
label: '额定电流(A)',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'reportName',
|
||||
label: '报告模版名称',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'icd',
|
||||
label: '设备关联ICD',
|
||||
minWidth: 200,
|
||||
render: (scope) => {
|
||||
// 查找ICD名称
|
||||
const name = icdOptions.value.find(option => option.id === scope.row.icd)
|
||||
return <span>{name?.name}</span>
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 200,
|
||||
render: scope => {
|
||||
if (scope.row.createTime) {
|
||||
const date = new Date(scope.row.createTime);
|
||||
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');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
])
|
||||
|
||||
|
||||
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<DevType.ResPqDevType> = {}) => {
|
||||
devTypePopup.value?.open(titleType, row,icdOptions.value)
|
||||
}
|
||||
|
||||
|
||||
// 批量删除设备
|
||||
const batchDelete = async (id: string[]) => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
|
||||
await useHandleData(deleteDevType, id, '删除所选设备类型')
|
||||
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
const handleDelete = async (params: DevType.ResPqDevType) => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
await useHandleData(deleteDevType, [params.id] , `删除【${params.name}】设备类型`)
|
||||
proTable.value?.getTableList()
|
||||
|
||||
}
|
||||
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const response = await getICDAllList({
|
||||
id: '',
|
||||
name: '',
|
||||
path: '',
|
||||
state: 1
|
||||
})
|
||||
icdOptions.value = (response.data as ICD.ResICD[]).map(item => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
path: item.path,
|
||||
state: item.state,
|
||||
}))
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
@@ -5,31 +5,44 @@
|
||||
<div >
|
||||
<el-form :model='formContent' ref='dialogFormRef' :rules='rules' :disabled="false" label-width="auto" class="form-three">
|
||||
<el-divider >设备信息</el-divider>
|
||||
<el-form-item label="装置编号" prop="createId" >
|
||||
<el-input v-model="formContent.createId" placeholder="请输入装置编号" @input="handleInput" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name" >
|
||||
<el-input v-model='formContent.name' placeholder="请输入设备名称"/>
|
||||
<el-input v-model='formContent.name' placeholder="请输入设备名称" :disabled="scene === '1'"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备类型' prop='devType' >
|
||||
<el-select v-model="formContent.devType" filterable clearable placeholder="请选择设备类型">
|
||||
<el-select v-model="formContent.devType" filterable clearable placeholder="请选择设备类型" @change="handleDevTypeChange">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Type')"
|
||||
v-for="item in devTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备模式' prop='pattern' >
|
||||
<el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled>
|
||||
<el-form-item label='预投计划' prop='preinvestmentPlan' v-if="scene ==='1'">
|
||||
<el-select v-model="formContent.preinvestmentPlan" clearable placeholder="请选择预投计划">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Pattern')"
|
||||
v-for="item in dictStore.getDictData('Preinvestment_Plan')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备厂家' prop='manufacturer' >
|
||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择生产厂商">
|
||||
<!-- <el-form-item label='设备模式' prop='pattern' >-->
|
||||
<!-- <el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled>-->
|
||||
<!-- <el-option -->
|
||||
<!-- v-for="item in dictStore.getDictData('Pattern')"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item> -->
|
||||
<el-form-item label='设备厂家' prop='manufacturer' v-if="scene != '1'">
|
||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Manufacturers')"
|
||||
:key="item.id"
|
||||
@@ -38,52 +51,29 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂日期" prop="createDate" >
|
||||
<el-form-item label="出厂日期" prop="createDate" v-if="scene === '0'">
|
||||
<el-date-picker
|
||||
v-model="formContent.createDate"
|
||||
placeholder="请选择出厂日期"
|
||||
:disabled-date="disabledDate"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="createId" >
|
||||
<el-input v-model="formContent.createId" placeholder="请输入设备序列号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="固件版本" prop="hardwareVersion" >
|
||||
|
||||
<el-form-item label="固件版本" prop="hardwareVersion" v-if="scene === '0'">
|
||||
<el-input v-model="formContent.hardwareVersion" placeholder="请输入固件版本"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="软件版本" prop="softwareVersion" >
|
||||
<el-form-item label="软件版本" prop="softwareVersion" v-if="scene === '0'">
|
||||
<el-input v-model="formContent.softwareVersion" placeholder="请输入软件版本"/>
|
||||
</el-form-item>
|
||||
<el-divider >参数信息</el-divider>
|
||||
<el-form-item label="通道数" prop="devChns" >
|
||||
<el-select v-model="formContent.devChns" clearable placeholder="请选择设备通道数">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Chns')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model='formContent.devChns' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电压(V)" prop="devVolt" >
|
||||
<el-select v-model="formContent.devVolt" clearable placeholder="请选择额定电压">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Volt')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model='formContent.devVolt' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="额定电流(A)" prop="devCurr" >
|
||||
<el-select v-model="formContent.devCurr" clearable placeholder="请选择额定电流">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Curr')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model='formContent.devCurr' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='通讯协议' prop='protocol' >
|
||||
<el-select v-model="formContent.protocol" clearable placeholder="请选择通讯协议" >
|
||||
@@ -113,10 +103,10 @@
|
||||
<el-form-item label='密钥' prop='devKey' clearable v-if="formContent.encryptionFlag">
|
||||
<el-input v-model='formContent.devKey' placeholder="请输入密钥" show-password/>
|
||||
</el-form-item>
|
||||
<el-form-item label='样品编号' prop='sampleID' clearable v-if="DevIsShow">
|
||||
<el-form-item label='样品编号' prop='sampleID' clearable v-if="DevIsShow && scene === '0'">
|
||||
<el-input v-model='formContent.sampleID' placeholder="请输入样品编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label='送样日期' prop='arrivedDate' >
|
||||
<el-form-item label='送样日期' prop='arrivedDate' v-if="scene === '0'">
|
||||
<el-date-picker
|
||||
v-model="formContent.arrivedDate"
|
||||
placeholder="请选择送样日期"
|
||||
@@ -170,9 +160,12 @@ import MonitorTable from '@/views/machine/device/components/monitorTab.vue';
|
||||
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
// const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
const mode = ref()
|
||||
const scene = ref('')
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
@@ -189,19 +182,22 @@ const disabledDate = (time: Date) => {
|
||||
devType:'',
|
||||
devChns:1,
|
||||
devVolt:57.74,
|
||||
devCurr:1,
|
||||
devCurr:5,
|
||||
manufacturer:'',
|
||||
createDate: dayjs().format('YYYY-MM-DD'),
|
||||
createId: '',
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '192.168.1.200',
|
||||
ip: '172.17.102.200',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum:0,
|
||||
state: 1,
|
||||
factorFlag:0,
|
||||
icdId:'',
|
||||
power:'',
|
||||
preinvestmentPlan:''
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
@@ -216,19 +212,22 @@ const disabledDate = (time: Date) => {
|
||||
devType:'',
|
||||
devChns:1,
|
||||
devVolt:57.74,
|
||||
devCurr:1,
|
||||
devCurr:5,
|
||||
manufacturer: '',
|
||||
createDate: dayjs().format('YYYY-MM-DD'),
|
||||
createId: '',
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '192.168.1.200',
|
||||
ip: '172.17.102.200',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum:0,
|
||||
state: 1,
|
||||
factorFlag:0,
|
||||
icdId:'',
|
||||
power:'',
|
||||
preinvestmentPlan:''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,37 +238,68 @@ const disabledDate = (time: Date) => {
|
||||
|
||||
|
||||
// 定义表单校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
const baseRules: Record<string, Array<FormItemRule>> = {
|
||||
devType: [{ required: true, message: '设备类型必选!', trigger: 'change' }],
|
||||
pattern: [{ required: true, message: '设备模式必填!', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '设备名称必填!', trigger: 'blur' }],
|
||||
devChns: [{ required: true, message: '设备通道数必填!', trigger: 'blur' },
|
||||
// 指定正则,此处是数字正则
|
||||
{ pattern: /^[1-9]\d*$/, message: '设备通道数为大于1的整数', trigger: 'blur' }],
|
||||
devVolt: [{ required: true, message: '额定电压必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+(\.\d+)?$/, message: '额定电压格式错误', trigger: 'blur' }],
|
||||
devCurr: [{ required: true, message: '额定电流必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' }],
|
||||
createDate: [{ required: true, message: '生产日期必填!', trigger: 'blur' }],
|
||||
createId: [{ required: true, message: '出厂编号必填!', trigger: 'blur' }],
|
||||
hardwareVersion: [{ required: true, message: '固件版本必填!', trigger: 'blur' }],
|
||||
softwareVersion: [{ required: true, message: '软件版本必填!', trigger: 'blur' }],
|
||||
ip:[{ required: true, message: 'IP地址必填!', trigger: 'blur' } ,
|
||||
{ pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, message: 'IP地址格式错误', trigger: 'blur' }],
|
||||
port:[{ required: true, message: '端口号必填!', trigger: 'blur' },
|
||||
{ pattern: /^(6553[0-5]|655[0-2][0-9]|64[0-9]{3}|[1-5]?[0-9]{1,4})$/, message: '端口号范围0到65535的整数', trigger: 'blur' }],
|
||||
manufacturer: [{ required: true, message: '生产厂家必选!', trigger: 'change' }],
|
||||
devChns: [
|
||||
{ required: true, message: '设备通道数必填!', trigger: 'blur' },
|
||||
{ pattern: /^[1-9]\d*$/, message: '设备通道数为大于1的整数', trigger: 'blur' }
|
||||
],
|
||||
devVolt: [
|
||||
{ required: true, message: '额定电压必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+(\.\d+)?$/, message: '额定电压格式错误', trigger: 'blur' }
|
||||
],
|
||||
devCurr: [
|
||||
{ required: true, message: '额定电流必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' }
|
||||
],
|
||||
createId: [{ required: true, message: '装置编号必填!', trigger: 'blur' }
|
||||
],
|
||||
ip: [
|
||||
{ required: true, message: 'IP地址必填!', trigger: 'blur' },
|
||||
{ pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, message: 'IP地址格式错误', trigger: 'blur' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: '端口号必填!', trigger: 'blur' },
|
||||
{ pattern: /^(6553[0-5]|655[0-2][0-9]|64[0-9]{3}|[1-5]?[0-9]{1,4})$/, message: '端口号范围0到65535的整数', trigger: 'blur' }
|
||||
],
|
||||
encryptionFlag: [{ required: true, message: '是否加密必选!', trigger: 'change' }],
|
||||
protocol: [{ required: true, message: '通讯协议必选!', trigger: 'change' }],
|
||||
// series: [],
|
||||
// devKey: []
|
||||
series : [
|
||||
{ required: true, message: '请输入识别码', trigger: 'blur' }
|
||||
],
|
||||
devKey : [
|
||||
{ required: true, message: '请输入密钥', trigger: 'blur' }
|
||||
],
|
||||
})
|
||||
series: [{ required: true, message: '请输入识别码', trigger: 'blur' }],
|
||||
devKey: [{ required: true, message: '请输入密钥', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
// 使用计算属性根据 scene 动态生成规则
|
||||
const rules = computed(() => {
|
||||
const dynamicRules = { ...baseRules };
|
||||
|
||||
if (scene.value === '0'){//只有电科院需要展示
|
||||
dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }];
|
||||
}
|
||||
if (scene.value === '1'){//只有楼下出厂需要展示
|
||||
dynamicRules.preinvestmentPlan= [{ required: true, message: '预投计划必选!', trigger: 'change' }];
|
||||
dynamicRules.createId= [{ required: true, message: '装置编号必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+$/, message: '装置编号为数字', trigger: 'blur' }
|
||||
];
|
||||
}
|
||||
if (scene.value !== '0') {
|
||||
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
|
||||
dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }];
|
||||
dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }];
|
||||
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
|
||||
|
||||
}
|
||||
|
||||
if (scene.value !== '2') {
|
||||
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
|
||||
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return dynamicRules;
|
||||
});
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
@@ -292,10 +322,18 @@ const disabledDate = (time: Date) => {
|
||||
}
|
||||
if (valid) {
|
||||
formContent.value.createDate = dayjs(formContent.value.createDate).format('YYYY-MM-DD');
|
||||
formContent.value.name = formContent.value.createId
|
||||
if (formContent.value.arrivedDate)
|
||||
{
|
||||
formContent.value.arrivedDate = dayjs(formContent.value.arrivedDate).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
//保存时判是否加密,把识别码密钥字段清空
|
||||
if(formContent.value.encryptionFlag === 0){
|
||||
formContent.value.series = null
|
||||
formContent.value.devKey = null
|
||||
}
|
||||
|
||||
if (formContent.value.id) {
|
||||
await updatePqDev(formContent.value);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
@@ -314,6 +352,7 @@ const disabledDate = (time: Date) => {
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
|
||||
}
|
||||
|
||||
close()
|
||||
// 刷新表格
|
||||
await props.refreshTable!()
|
||||
@@ -327,8 +366,10 @@ const disabledDate = (time: Date) => {
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
const open = async (sign: string, data: Device.ResPqDev,currentMode: string,currentScene: string,devType:Device.ResDev[] ) => {
|
||||
devTypeOptions.value = devType
|
||||
mode.value = currentMode
|
||||
scene.value = currentScene
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
@@ -349,6 +390,14 @@ const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
formContent.value = { ...data }
|
||||
} else {
|
||||
resetFormContent()
|
||||
if(scene.value === '2'){
|
||||
const manufacturers = dictStore.getDictData('Dev_Manufacturers');
|
||||
const nanjingCanxuan = manufacturers.find(item => item.name === '南京灿能');
|
||||
if(nanjingCanxuan){
|
||||
formContent.value.manufacturer = nanjingCanxuan.id;
|
||||
}
|
||||
}
|
||||
|
||||
//handleEncryptionChange(1)
|
||||
}
|
||||
|
||||
@@ -370,6 +419,35 @@ const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
// }
|
||||
// }
|
||||
|
||||
const handleDevTypeChange = (value: string) => {
|
||||
// 在这里处理选中事件的逻辑
|
||||
const dev = devTypeOptions.value.find(t =>t.id === value)
|
||||
if (dev) {
|
||||
formContent.value.devChns = dev.devChns; // 默认值为1
|
||||
formContent.value.devCurr = dev.devCurr; // 默认值为1
|
||||
formContent.value.devVolt = dev.devVolt; // 默认值为1
|
||||
formContent.value.icdId = dev.icd
|
||||
formContent.value.power = dev.power
|
||||
} else {
|
||||
formContent.value.devChns = 1; // 默认值为1
|
||||
formContent.value.devCurr = 1; // 默认值为1
|
||||
formContent.value.devVolt = 57.74; // 默认值为1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const handleInput = (value: string) => {
|
||||
// 在这里处理选中事件的逻辑
|
||||
if(scene.value === '1'){
|
||||
formContent.value.name = value
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -10,7 +10,12 @@
|
||||
<template #tableHeader='scope'>
|
||||
<el-button v-auth.device="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.device="'export'" type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
|
||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()' v-if='modeStore.currentMode === "比对式"'>导入</el-button>
|
||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('')"
|
||||
v-if='modeStore.currentMode != "比对式"'>导入
|
||||
</el-button>
|
||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')"
|
||||
v-if='modeStore.currentMode === "比对式"'>导入
|
||||
</el-button>
|
||||
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
删除
|
||||
@@ -18,8 +23,11 @@
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button v-auth.device="'edit'" type='primary' link :icon='EditPen' :model-value="false" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button v-auth.device="'edit'" type='primary' link :icon='EditPen' :model-value='false'
|
||||
@click="openDialog('edit', scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
@@ -39,20 +47,30 @@ import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/i
|
||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||
import { CirclePlus, Delete, EditPen, Download, Upload } from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { getPqDevList, deletePqDev, exportPqDev, downloadTemplate, importPqDev } from '@/api/device/device/index.ts'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
import {
|
||||
getPqDevList,
|
||||
deletePqDev,
|
||||
getPqDev,
|
||||
exportCNDev,
|
||||
downloadCNDevTemplate,
|
||||
importCNDev,
|
||||
} from '@/api/device/device/index.ts'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { onBeforeMount, reactive, ref } from 'vue'
|
||||
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
||||
|
||||
const modeStore = useModeStore();
|
||||
// defineOptions({
|
||||
// name: 'device',
|
||||
// })
|
||||
const modeStore = useModeStore()
|
||||
const dictStore = useDictStore()
|
||||
const appSceneStore = useAppSceneStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const devicePopup = ref()
|
||||
// 定义包含和排除的单位
|
||||
|
||||
|
||||
const boundPqDevList = ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
@@ -72,21 +90,29 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
search: { el: 'input' },
|
||||
// isShow: appSceneStore.currentScene != '1',
|
||||
// ...(appSceneStore.currentScene != '1' ? {
|
||||
// search: { el: 'input' },
|
||||
// } : {}),
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'devType',
|
||||
label: '设备类型',
|
||||
minWidth: 200,
|
||||
enum: dictStore.getDictData('Dev_Type'),
|
||||
fieldNames: { label: 'name', value: 'id' },
|
||||
render: (scope) => {
|
||||
// 查找设备类型名称
|
||||
const name = devTypeOptions.value.find(option => option.id === scope.row.devType)
|
||||
return <span>{name?.name}</span>
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'createDate',
|
||||
label: '出厂日期',
|
||||
minWidth: 200,
|
||||
isShow: appSceneStore.currentScene === '0',
|
||||
...(appSceneStore.currentScene === '0' ? {
|
||||
search: {
|
||||
span: 2,
|
||||
render: () => {
|
||||
return (
|
||||
<div class='flx-flex-start'>
|
||||
@@ -98,6 +124,20 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
)
|
||||
},
|
||||
},
|
||||
} : {}),
|
||||
// search: {
|
||||
// span: 2,
|
||||
// render: () => {
|
||||
// return (
|
||||
// <div class='flx-flex-start'>
|
||||
// <TimeControl
|
||||
// default={'月'}
|
||||
// onUpdate-dates={handleDateChange}
|
||||
// />
|
||||
// </div>
|
||||
// )
|
||||
// },
|
||||
// },
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
@@ -121,10 +161,31 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
prop: 'manufacturer',
|
||||
label: '设备厂家',
|
||||
enum: dictStore.getDictData('Dev_Manufacturers'),
|
||||
isShow: appSceneStore.currentScene != '1',
|
||||
...(appSceneStore.currentScene != '1' ? {
|
||||
search: { el: 'select', props: { filterable: true }, order: 1 },
|
||||
fieldNames: { label: 'name', value: 'id' },
|
||||
} : {}),
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 200,
|
||||
render: scope => {
|
||||
if (scope.row.createTime) {
|
||||
const date = new Date(scope.row.createTime);
|
||||
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');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
])
|
||||
|
||||
@@ -138,15 +199,15 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
}
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
devicePopup.value?.open(titleType, row,modeStore.currentMode)
|
||||
devicePopup.value?.open(titleType, row, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 批量删除设备
|
||||
const batchDelete = async (id: string[]) => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
|
||||
await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
|
||||
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
@@ -156,37 +217,64 @@ const handleDelete = async (params: Device.ResPqDev) => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
await useHandleData(deletePqDev, { 'ids': [params.id], 'pattern': patternId }, `删除【${params.name}】设备`)
|
||||
proTable.value?.getTableList()
|
||||
|
||||
}
|
||||
|
||||
// 导出设备
|
||||
const downloadFile = async () => {
|
||||
// 获取当前的搜索参数
|
||||
const searchParam = proTable.value?.searchParam || {};
|
||||
const searchParam = proTable.value?.searchParam || {}
|
||||
|
||||
// 将开始时间和结束时间添加到搜索参数中
|
||||
searchParam.searchBeginTime = startDate.value;
|
||||
searchParam.searchEndTime = endDate.value;
|
||||
searchParam.searchBeginTime = startDate.value
|
||||
searchParam.searchEndTime = endDate.value
|
||||
|
||||
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() => {
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
useDownload(exportPqDev,'被检设备导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
|
||||
useDownload(exportCNDev, '被检设备导出数据', { ...proTable.value?.searchParam, pattern: patternId }, false, '.xlsx')
|
||||
})
|
||||
}
|
||||
|
||||
//导入设备
|
||||
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||
|
||||
const importFile = async () => {
|
||||
const importFile = async (pattern: string) => {
|
||||
|
||||
if (pattern === '比对式') {
|
||||
// const params = {
|
||||
// title: '被检设备',
|
||||
// showCover: false,
|
||||
// tempApi: downloadTemplate,
|
||||
// importApi: importPqDev,
|
||||
// getTableList: proTable.value?.getTableList,
|
||||
// }
|
||||
// deviceImportExcel.value?.acceptParams(params)
|
||||
} else {
|
||||
const params = {
|
||||
title: '被检设备',
|
||||
showCover: false,
|
||||
tempApi: downloadTemplate,
|
||||
importApi: importPqDev,
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id,
|
||||
tempApi: downloadCNDevTemplate,
|
||||
importApi: importCNDev,
|
||||
// importApi: modeStore.currentMode === "比对式"? importContrastPqDev: importCNDev,
|
||||
getTableList: proTable.value?.getTableList,
|
||||
}
|
||||
deviceImportExcel.value?.acceptParams(params)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const response = await getPqDev()
|
||||
devTypeOptions.value = (response.data as Device.ResDev[]).map(item => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
icd: item.icd,
|
||||
power: item.power,
|
||||
devVolt: item.devVolt,
|
||||
devCurr: item.devCurr,
|
||||
devChns: item.devChns,
|
||||
}))
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -37,6 +37,9 @@ import ErrorStandardPopup from '@/views/machine/errorSystem/components/errorStan
|
||||
import type { ErrorSystem } from '@/api/device/interface/error'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { getPqErrSysList, deletePqErrSys} from '@/api/device/error/index'
|
||||
defineOptions({
|
||||
name: 'errorSystem'
|
||||
})
|
||||
const dictStore = useDictStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
127
frontend/src/views/machine/icd/components/icdPopup.vue
Normal file
127
frontend/src/views/machine/icd/components/icdPopup.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<!-- 基础信息弹出框 -->
|
||||
<el-dialog :model-value="dialogVisible" :title="dialogTitle" v-bind="dialogSmall" @close="close" >
|
||||
<div>
|
||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules'>
|
||||
<el-form-item label="名称" prop="name" >
|
||||
<el-input v-model='formContent.name' placeholder="请输入icd名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="存储地址" prop="path" >
|
||||
<el-input v-model='formContent.path' placeholder="请输入icd存储地址"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="save()" >
|
||||
保存
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import{ ElMessage, type FormInstance,type FormItemRule } from 'element-plus'
|
||||
import type { ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { ref,computed, Ref} from 'vue'
|
||||
import { type ICD } from '@/api/device/interface/icd'
|
||||
import {dialogSmall} from '@/utils/elementBind'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {addICD,updateICD} from '@/api/device/icd'
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const titleType = ref('add')
|
||||
const formContent = ref<ICD.ResICD>({
|
||||
id: '',
|
||||
name: '',
|
||||
path: '',
|
||||
state: 1,
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||
|
||||
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
formContent.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
path: '',
|
||||
state: 1,
|
||||
}
|
||||
}
|
||||
|
||||
let dialogTitle = computed(() => {
|
||||
return titleType.value === 'add' ? '新增ICD' : '编辑ICD'
|
||||
})
|
||||
|
||||
|
||||
|
||||
//定义规则
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{ required: true, message: 'icd名称必填!', trigger: 'blur' }],
|
||||
path: [{ required: true, message: 'icd存储地址必填!', trigger: 'blur' }],
|
||||
})
|
||||
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (formContent.value.id) {
|
||||
await updateICD(formContent.value);
|
||||
} else {
|
||||
await addICD(formContent.value);
|
||||
}
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
close()
|
||||
// 刷新表格
|
||||
await props.refreshTable!()
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
//error('验证过程中出现错误', err)
|
||||
}
|
||||
}
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: ICD.ResICD) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
if (data.id) {
|
||||
formContent.value = { ...data }
|
||||
} else {
|
||||
resetFormContent()
|
||||
}
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
}>()
|
||||
|
||||
</script>
|
||||
119
frontend/src/views/machine/icd/index.vue
Normal file
119
frontend/src/views/machine/icd/index.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div class='table-box' ref='popupBaseView'>
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:request-api='getTableList'
|
||||
>
|
||||
<!-- :requestApi="getRoleList" -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button v-auth.devType="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button v-auth.devType="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button v-auth.devType="'edit'" type='primary' link :icon='EditPen' :model-value='false'
|
||||
@click="openDialog('edit', scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button v-auth.devType="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
</div>
|
||||
<IcdPopup :refresh-table='proTable?.getTableList' ref='icdPopup' />
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx' name='useRole'>
|
||||
import TimeControl from '@/components/TimeControl/index.vue'
|
||||
import { type ICD } from '@/api/device/interface/icd'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { CirclePlus, Delete, EditPen, Download, Upload } from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {
|
||||
getICDList,
|
||||
deleteICD,
|
||||
} from '@/api/device/icd/index.ts'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
||||
|
||||
defineOptions({
|
||||
name: 'devType',
|
||||
})
|
||||
const modeStore = useModeStore()
|
||||
const dictStore = useDictStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const icdPopup = ref()
|
||||
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
return getICDList(newParams)
|
||||
}
|
||||
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<ICD.ResICD>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'path',
|
||||
label: '存储地址',
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
render: scope => {
|
||||
if (scope.row.createTime) {
|
||||
const date = new Date(scope.row.createTime);
|
||||
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');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
])
|
||||
|
||||
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<ICD.ResICD> = {}) => {
|
||||
icdPopup.value?.open(titleType, row)
|
||||
}
|
||||
|
||||
|
||||
// 批量删除设备
|
||||
const batchDelete = async (id: string[]) => {
|
||||
await useHandleData(deleteICD, id, '删除所选icd')
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
const handleDelete = async (params: ICD.ResICD) => {
|
||||
await useHandleData(deleteICD, [params.id] , `删除【${params.name}】icd`)
|
||||
proTable.value?.getTableList()
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -35,8 +35,11 @@
|
||||
<el-tab-pane label="全局设置菜单">
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div class="form-item-container">
|
||||
<el-form-item label="频率(Hz)" prop='name'>
|
||||
<el-input />
|
||||
<el-form-item label="频率:" prop='name'>
|
||||
<div class="input-label-container">
|
||||
<el-input style="width: 100px;" />
|
||||
<label>Hz</label>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="button-label-container">
|
||||
@@ -214,6 +217,13 @@ defineExpose({ open })
|
||||
.button-label-container label {
|
||||
margin-right: 10px; /* 按钮和文字之间的距离 */
|
||||
}
|
||||
.input-label-container {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
}
|
||||
|
||||
.input-label-container label {
|
||||
margin-left: 5px; /* 添加标签与输入框之间的间距 */
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="editor-container">
|
||||
<div class="left-editor">
|
||||
<!-- 左侧编辑区域内容 -->
|
||||
<canvas ref="canvas" width="600" height="165"></canvas>
|
||||
|
||||
</div>
|
||||
<div class="right-editor">
|
||||
<!-- 右侧编辑区域内容 -->
|
||||
@@ -30,12 +30,14 @@ canvas {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.left-editor {
|
||||
flex: 3; /* 左侧区域占据 3/4 的宽度 */
|
||||
margin-right: 10px; /* 可选:添加间距 */
|
||||
margin-left: 150px; /* 可选:添加间距 */
|
||||
}
|
||||
|
||||
.right-editor {
|
||||
flex: 1; /* 右侧区域占据 1/4 的宽度 */
|
||||
margin-right: 250px; /* 向左侧移动一点 */
|
||||
}
|
||||
</style>
|
||||
@@ -13,7 +13,10 @@
|
||||
<el-input />
|
||||
</el-form-item>
|
||||
<el-form-item label="波动类型" prop='name'>
|
||||
<el-input />
|
||||
<el-select placeholder="请选择波动类型" style="width: 150px;">
|
||||
<el-option label="Hz" :value="1"></el-option>
|
||||
<el-option label="CPM" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
@@ -23,7 +26,11 @@
|
||||
<!-- 全局设置菜单内容 -->
|
||||
<div >
|
||||
<el-form-item label="波类型" prop='name'>
|
||||
<el-input />
|
||||
<el-select placeholder="请选择波类型">
|
||||
<el-option label="RECT" :value="2"></el-option>
|
||||
<el-option label="SIN" :value="1"></el-option>
|
||||
<el-option label="SQU" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div >
|
||||
|
||||
@@ -6,27 +6,39 @@
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData1" border class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" width="60"/>
|
||||
<el-table-column prop="date" label="谐波含有率" width="125">
|
||||
<el-table-column prop="date" label="谐波含有率" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" width="125">
|
||||
<el-table-column prop="name" label="谐波相角" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData2" border class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" width="60"/>
|
||||
<el-table-column prop="date" label="谐波含有率" width="125">
|
||||
<el-table-column prop="date" label="谐波含有率" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" width="125">
|
||||
<el-table-column prop="name" label="谐波相角" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -39,28 +51,39 @@
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData1" border class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" width="60"/>
|
||||
<el-table-column prop="date" label="谐波含有率" width="125">
|
||||
<el-table-column prop="date" label="谐波含有率" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>123%</label>
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" width="125">
|
||||
<el-table-column prop="name" label="谐波相角" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData2" border class="half-width-table">
|
||||
<el-table-column prop="date" label="次数" width="60"/>
|
||||
<el-table-column prop="date" label="谐波含有率" width="125">
|
||||
<el-table-column prop="date" label="谐波含有率" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>%</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="谐波相角" width="125">
|
||||
<el-table-column prop="name" label="谐波相角" width="120">
|
||||
<template #default="scope">
|
||||
<div class="input-label-container">
|
||||
<el-input />
|
||||
<label>°</label>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -132,4 +155,12 @@ for (let i = 26; i <= 50; i++) {
|
||||
margin-right: 0; /* 最后一个表格不需要右侧间距 */
|
||||
}
|
||||
|
||||
.input-label-container {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
}
|
||||
|
||||
.input-label-container label {
|
||||
margin-left: 5px; /* 添加标签与输入框之间的间距 */
|
||||
}
|
||||
</style>
|
||||
@@ -122,7 +122,7 @@ const open = async (sign: string,row: any,currentMode: string,id:string) => {
|
||||
}
|
||||
});
|
||||
|
||||
console.log('secondLevelOptions',secondLevelOptions);
|
||||
//console.log('secondLevelOptions',secondLevelOptions);
|
||||
|
||||
if(id != ''){//新增的时候才会重新赋值值类型
|
||||
formContent.value.valueType = id
|
||||
|
||||
@@ -20,7 +20,82 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
const canvas = ref<HTMLCanvasElement | null>(null);
|
||||
|
||||
onMounted(() => {
|
||||
if (canvas.value) {
|
||||
const ctx = canvas.value.getContext('2d');
|
||||
if (ctx) {
|
||||
drawSineWave(ctx);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function drawSineWave(ctx: CanvasRenderingContext2D) {
|
||||
const width = canvas.value!.width;
|
||||
const height = canvas.value!.height;
|
||||
const amplitude = 50; // 振幅
|
||||
const frequency = 0.02; // 频率
|
||||
const offset = height / 2; // 偏移量
|
||||
|
||||
// 绘制横轴
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, offset);
|
||||
ctx.lineTo(width, offset);
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.stroke();
|
||||
|
||||
// 绘制纵轴
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, 0);
|
||||
ctx.lineTo(0, height);
|
||||
ctx.stroke();
|
||||
|
||||
// 绘制横轴刻度
|
||||
const xStep = width / 10;
|
||||
for (let x = 0; x <= width; x += xStep) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, offset - 5);
|
||||
ctx.lineTo(x, offset + 5);
|
||||
ctx.stroke();
|
||||
|
||||
// 添加横轴刻度标签
|
||||
ctx.font = '12px Arial';
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText((x / xStep).toFixed(0), x, offset + 20);
|
||||
}
|
||||
|
||||
// 绘制纵轴刻度
|
||||
const yStep = height / 10;
|
||||
for (let y = 0; y <= height; y += yStep) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(-5, y);
|
||||
ctx.lineTo(5, y);
|
||||
ctx.stroke();
|
||||
|
||||
// 添加纵轴刻度标签
|
||||
ctx.font = '12px Arial';
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.textAlign = 'right';
|
||||
ctx.fillText(((offset - y) / yStep - 5).toFixed(1), -10, y + 5);
|
||||
}
|
||||
|
||||
// 绘制正弦波
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(0, offset);
|
||||
|
||||
for (let x = 0; x < width; x++) {
|
||||
const y = offset + amplitude * Math.sin(frequency * x);
|
||||
ctx.lineTo(x, y);
|
||||
}
|
||||
|
||||
ctx.strokeStyle = 'red';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -35,10 +110,11 @@ canvas {
|
||||
|
||||
.left-editor {
|
||||
flex: 3; /* 左侧区域占据 3/4 的宽度 */
|
||||
margin-right: 10px; /* 可选:添加间距 */
|
||||
margin-left: 150px; /* 可选:添加间距 */
|
||||
}
|
||||
|
||||
.right-editor {
|
||||
flex: 1; /* 右侧区域占据 1/4 的宽度 */
|
||||
margin-right: 250px; /* 向左侧移动一点 */
|
||||
}
|
||||
</style>
|
||||
@@ -44,6 +44,11 @@ import ValueTypePopup from './components/valueTypePopup.vue'
|
||||
} from '@/api/device/testScript/index'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
defineOptions({
|
||||
name: 'testScript'
|
||||
})
|
||||
|
||||
|
||||
const comparisonPopup = ref()
|
||||
const testScriptPopup = ref()
|
||||
const valueTypePopup = ref()
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
} from '@/api/device/testSource/index'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
defineOptions({
|
||||
name: 'testSource'
|
||||
})
|
||||
const testSourcePopup = ref()
|
||||
const dictStore = useDictStore()
|
||||
const modeStore = useModeStore();
|
||||
|
||||
@@ -517,7 +517,6 @@ const interValTest = () => {
|
||||
children: deviceData.value,
|
||||
// status: Math.floor(Math.random() * 4),
|
||||
});
|
||||
// console.log(deviceTestList.value,11111);
|
||||
currentIndex++;
|
||||
treeRef.value && treeRef.value.getCurrentIndex(currentIndex)
|
||||
refreshProgress();
|
||||
|
||||
@@ -64,6 +64,10 @@ import {getTestSourceById} from '@/api/device/testSource/index'
|
||||
import ImportExcel from "@/components/ImportExcel/index.vue";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportPqDev} from "@/api/device/device";
|
||||
|
||||
// defineOptions({
|
||||
// name: 'planList'
|
||||
// })
|
||||
const dictStore = useDictStore()
|
||||
const openDeviceView = ref()
|
||||
const openSourceView = ref()
|
||||
@@ -111,6 +115,64 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
width: 220,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'testState',
|
||||
label: '检测状态',
|
||||
width: 120,
|
||||
enum:dictTestState,
|
||||
search: { el:'select',props: { filterable: true }},
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
return (
|
||||
scope.row.testState === 0 ? '未检' : scope.row.testState === 1 ? '检测中' : '检测完成'
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'reportState',
|
||||
label: '检测报告状态',
|
||||
width: 120,
|
||||
enum:dictReportState,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
return (
|
||||
scope.row.reportState === 0 ? '未生成' : scope.row.reportState === 1 ? '部分生成' : '全部生成'
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'result',
|
||||
label: '检测结果',
|
||||
width: 120,
|
||||
enum:dictResult,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
console.log('检测结果',scope.row.result)
|
||||
return (
|
||||
scope.row.result === 0 ? '不符合' : scope.row.result === 1 ? '符合' : '/'
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 200,
|
||||
render: scope => {
|
||||
if (scope.row.createTime) {
|
||||
const date = new Date(scope.row.createTime);
|
||||
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');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'sourceName',
|
||||
label: '检测源',
|
||||
@@ -190,45 +252,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
return dictItem ? dictItem.name : '/' // 如果找到匹配的项,返回对应的 name
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'testState',
|
||||
label: '检测状态',
|
||||
width: 120,
|
||||
enum:dictTestState,
|
||||
search: { el:'select',props: { filterable: true }},
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
return (
|
||||
scope.row.testState === 0 ? '未检' : scope.row.testState === 1 ? '检测中' : '检测完成'
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'reportState',
|
||||
label: '检测报告状态',
|
||||
width: 120,
|
||||
enum:dictReportState,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
return (
|
||||
scope.row.reportState === 0 ? '未生成' : scope.row.reportState === 1 ? '部分生成' : '全部生成'
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'result',
|
||||
label: '检测结果',
|
||||
width: 120,
|
||||
enum:dictResult,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
render: scope => {
|
||||
return (
|
||||
scope.row.result === 0 ? '不符合' : scope.row.result === 1 ? '符合' : '/'
|
||||
)
|
||||
},
|
||||
},
|
||||
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
|
||||
])
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ import {
|
||||
Search,
|
||||
} from "@element-plus/icons-vue";
|
||||
import { getPlanList } from "@/api/plan/planList";
|
||||
|
||||
const router = useRouter();
|
||||
const value1 = ref("");
|
||||
const value2 = ref("");
|
||||
|
||||
@@ -192,7 +192,9 @@
|
||||
import {getRegRes,updateRegRes } from '@/api/system/versionRegister/index'
|
||||
import { ElMessage, FormItemRule } from 'element-plus'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
defineOptions({
|
||||
name: 'base'
|
||||
})
|
||||
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
|
||||
@@ -12,10 +12,16 @@
|
||||
<el-form-item label="编码" :label-width="100" prop="code">
|
||||
<el-input v-model="formContent.code" placeholder="请输入" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="值" :label-width="100" prop="dictValue">
|
||||
<el-input v-model="formContent.dictValue" placeholder="请输入" autocomplete="off"/>
|
||||
<el-form-item label="开启值描述" :label-width="100" >
|
||||
<el-radio-group v-model="formContent.openValue" @change="handleOpenValueChange">
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件等级" :label-width="100" prop="level">
|
||||
<el-form-item label="值" :label-width="100" prop="value" v-if="formContent.openValue==1">
|
||||
<el-input v-model="formContent.value" placeholder="请输入" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="事件等级" :label-width="100" prop="level" v-if="false">
|
||||
<el-select v-model.number="formContent.level">
|
||||
<el-option label="普通" :value="0"/>
|
||||
<el-option label="中等" :value="1"/>
|
||||
@@ -42,7 +48,7 @@ import {dialogSmall} from "@/utils/elementBind";
|
||||
import {addDictData, updateDictData} from "@/api/system/dictionary/dictData/index.ts";
|
||||
import {Dict} from "@/api/system/dictionary/interface";
|
||||
import {ElMessage, FormItemRule} from "element-plus";
|
||||
import type {Ref} from "vue";
|
||||
import {computed, Ref} from "vue";
|
||||
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{required: true, message: '类型名称必填!', trigger: 'blur'}],
|
||||
@@ -63,10 +69,11 @@ function useMetaInfo() {
|
||||
name: "",
|
||||
code: "",
|
||||
value: "",
|
||||
dictValue: "",
|
||||
//dictValue: "",
|
||||
level: 0,
|
||||
sort: 100,
|
||||
state: 1,
|
||||
openValue:0
|
||||
})
|
||||
|
||||
return {dialogVisible, titleType, formContent, dictTypeName};
|
||||
@@ -83,10 +90,18 @@ const resetFormContent = () => {
|
||||
name: "",
|
||||
code: "",
|
||||
value: "",
|
||||
dictValue: "",
|
||||
//dictValue: "",
|
||||
level: 0,
|
||||
sort: 100,
|
||||
state: 1,
|
||||
openValue:0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handleOpenValueChange = ()=> {
|
||||
if(formContent.value.openValue == 0){
|
||||
formContent.value.value = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,15 +121,18 @@ const open = (sign: string, typeId: string, name: string, data: Dict.ResDictData
|
||||
dialogVisible.value = true
|
||||
if (data.id) {
|
||||
formContent.value = {...data}
|
||||
formContent.value.dictValue = data.value
|
||||
//formContent.value.dictValue = data.value
|
||||
}
|
||||
}
|
||||
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if(formContent.value.openValue === 0){
|
||||
formContent.value.value = null
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
formContent.value.value = formContent.value.dictValue
|
||||
if (formContent.value.id) {
|
||||
await updateDictData(formContent.value)
|
||||
} else {
|
||||
|
||||
@@ -33,7 +33,10 @@ import {useHandleData} from '@/hooks/useHandleData'
|
||||
import {deleteDictData, getDictDataListByTypeId, exportDictData} from "@/api/system/dictionary/dictData/index";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportDictType} from "@/api/system/dictionary/dictType";
|
||||
|
||||
import { isShallow } from 'vue';
|
||||
defineOptions({
|
||||
name: 'dict'
|
||||
})
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const dialogVisible = ref(false)
|
||||
//字典数据所属的字典类型Id
|
||||
@@ -78,12 +81,19 @@ const columns = reactive<ColumnProps<Dict.ResDictData>[]>([
|
||||
{
|
||||
prop: 'value',
|
||||
label: '值',
|
||||
minWidth: 180
|
||||
minWidth: 180,
|
||||
render: (scope) => {
|
||||
if (scope.row.openValue === 0 || scope.row.value === null || scope.row.value === '') {
|
||||
return <span>/</span>; // 使用 JSX 返回 VNode
|
||||
}
|
||||
return <span>{scope.row.value}</span>; // 使用 JSX 返回 VNode
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'level',
|
||||
label: '事件等级',
|
||||
minWidth: 180,
|
||||
isShow:false,
|
||||
render: scope => {
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -34,7 +34,9 @@ import {
|
||||
deleteDictPq,
|
||||
} from '@/api/system/dictionary/dictPq'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'dictPq'
|
||||
})
|
||||
const dictStore = useDictStore()
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const pqPopup = ref()
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
deleteDictTree,
|
||||
} from '@/api/system/dictionary/dictTree'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'dictTree'
|
||||
})
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
<el-form-item label='类型编码' :label-width='100' prop='code'>
|
||||
<el-input v-model='formContent.code' placeholder='请输入' autocomplete='off' />
|
||||
</el-form-item>
|
||||
<el-form-item label="开启等级" :label-width="100">
|
||||
<el-form-item label="开启等级" :label-width="100" v-if="false">
|
||||
<el-radio-group v-model="formContent.openLevel" >
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开启描述" :label-width="100">
|
||||
<el-form-item label="开启描述" :label-width="100" v-if="false">
|
||||
<el-radio-group v-model="formContent.openDescribe" >
|
||||
<el-radio-button label="开启" :value="1"></el-radio-button>
|
||||
<el-radio-button label="关闭" :value="0"></el-radio-button>
|
||||
|
||||
@@ -35,7 +35,9 @@ import { useViewSize } from '@/hooks/useViewSize'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import { deleteDictType, getDictTypeList, exportDictType } from '@/api/system/dictionary/dictType'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'dict'
|
||||
})
|
||||
const { popupBaseView, viewWidth, viewHeight } = useViewSize()
|
||||
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
Reference in New Issue
Block a user