样式调整

This commit is contained in:
GYYM
2024-11-29 13:45:48 +08:00
parent a1d3485ba7
commit b39c076879
17 changed files with 871 additions and 939 deletions

View File

@@ -44,113 +44,112 @@ const data = [
deviceModel: "模拟式", deviceModel: "模拟式",
}, },
] ]
const plan_devicedata = [ const plan_devicedata = [
{ {
id: '1', //装置序号ID id: '1', //装置序号ID
name: '模拟装置1', //设备名称 name: '240001', //设备名称
dev_Type: 'PQS882A',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '合格', //检测结果 check_Result: '未检测', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '归档', //归档状态 document_State: '归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '2', //装置序号ID id: '2', //装置序号ID
name: '模拟装置2', //设备名称 name: '240002', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '/', //检测结果 check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'未检',//检测状态 check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '3', //装置序号ID id: '3', //装置序号ID
name: '模拟装置3', //设备名称 name: '240003', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS882B4',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '/', //检测结果 check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 0, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '4', //装置序号ID id: '4', //装置序号ID
name: '模拟装置4', //设备名称 name: '240004', //设备名称
dev_Type: 'PQS882B4',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 1, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '5', //装置序号ID id: '5', //装置序号ID
name: '中电测试装置', //设备名称 name: '240005', //设备名称
dev_Type: 'PMC-680M-22-22-00-115ANBC',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 4, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '不合格', //检测结果
report_State: '未生成', //报告状态 report_State: '未生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 1, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '6', //装置序号ID id: '6', //装置序号ID
name: '易司拓测试装置1', //设备名称 name: '240006', //设备名称
dev_Type: 'E703A',//设备类型 dev_Type: 'PQS882B4',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '不合格', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 1, //复检次数 reCheck_Num: 1, //复检次数
}, },
{ {
id: '7', //装置序号ID id: '7', //装置序号ID
name: '易司拓测试装置2', //设备名称 name: '240007', //设备名称
dev_Type: 'E703A',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '合格', //检测结果 check_Result: '全部合格', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 1, //复检次数 reCheck_Num: 1, //复检次数
}, },
{ {
id: '8', //装置序号ID id: '8', //装置序号ID
name: '山大电力测试装置1', //设备名称 name: '240008', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882B4',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '合格', //检测结果 check_Result: '全部合格', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '9', //装置序号ID
name: '240009', //设备名称
dev_Type: 'PQS882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '有不合格项', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 1, //复检次数 reCheck_Num: 1, //复检次数
}, },
{
id: '9', //装置序号ID
name: '山大电力测试装置2', //设备名称
dev_Type: 'SDL-3002C',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果
report_State: '已生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
reCheck_Num: 2, //复检次数
},
{ {
id: '10', //装置序号ID id: '10', //装置序号ID
name: '山大电力测试装置2', //设备名称 name: '240010', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '合格', //检测结果 check_Result: '全部合格', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
@@ -158,59 +157,281 @@ const data = [
}, },
{ {
id: '11', //装置序号ID id: '11', //装置序号ID
name: '山大电力测试装置2', //设备名称 name: '240011', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '合格', //检测结果 check_Result: '全部合格', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '归档', //归档状态 document_State: '归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 2, //复检次数 reCheck_Num: 1, //复检次数
}, },
{ {
id: '12', //装置序号ID id: '12', //装置序号ID
name: '山大电力测试装置2', //设备名称 name: '240012', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882B4',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 4, //设备通道数
check_Result: '合格', //检测结果 check_Result: '全部合格', //检测结果
report_State: '已生成', //报告状态 report_State: '已生成', //报告状态
document_State: '归档', //归档状态 document_State: '归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测完成',//检测状态
reCheck_Num: 2, //复检次数 reCheck_Num: 2, //复检次数
}, },
{ {
id: '13', //装置序号ID id: '13', //装置序号ID
name: '山大电力测试装置2', //设备名称 name: '240013', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '未检测', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 2, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '14', //装置序号ID id: '14', //装置序号ID
name: '山大电力测试装置3', //设备名称 name: '240014', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '未检测', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 2, //复检次数 reCheck_Num: 0, //复检次数
}, },
{ {
id: '15', //装置序号ID id: '15', //装置序号ID
name: '山大电力测试装置4', //设备名称 name: '240013', //设备名称
dev_Type: 'SDL-3002C',//设备类型 dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数 dev_Chns: 1, //设备通道数
check_Result: '不合格', //检测结果 check_Result: '未检测', //检测结果
report_State: '生成', //报告状态 report_State: '生成', //报告状态
document_State: '未归档', //归档状态 document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态 check_State:'检测',//检测状态
reCheck_Num: 2, //复检次数 reCheck_Num: 0, //复检次数
},
{
id: '16', //装置序号ID
name: '240014', //设备名称
dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检测',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '17', //装置序号ID
name: '240017', //设备名称
dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检测',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '18', //装置序号ID
name: '240018', //设备名称
dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检测',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '19', //装置序号ID
name: '240019', //设备名称
dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检测',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '20', //装置序号ID
name: '240020', //设备名称
dev_Type: 'PQS882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检测', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检测',//检测状态
reCheck_Num: 0, //复检次数
}, },
] ]
// const plan_devicedata = [
// {
// id: '1', //装置序号ID
// name: '模拟装置1', //设备名称
// dev_Type: 'PQS882A',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 0, //复检次数
// },
// {
// id: '2', //装置序号ID
// name: '模拟装置2', //设备名称
// dev_Type: 'PQS882B4',//设备类型
// dev_Chns: 4, //设备通道数
// check_Result: '/', //检测结果
// report_State: '未生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'未检',//检测状态
// reCheck_Num: 0, //复检次数
// },
// {
// id: '3', //装置序号ID
// name: '模拟装置3', //设备名称
// dev_Type: 'PQS882B4',//设备类型
// dev_Chns: 4, //设备通道数
// check_Result: '/', //检测结果
// report_State: '未生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测中',//检测状态
// reCheck_Num: 0, //复检次数
// },
// {
// id: '4', //装置序号ID
// name: '模拟装置4', //设备名称
// dev_Type: 'PQS882B4',//设备类型
// dev_Chns: 4, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '未生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 1, //复检次数
// },
// {
// id: '5', //装置序号ID
// name: '中电测试装置', //设备名称
// dev_Type: 'PMC-680M-22-22-00-115ANBC',//设备类型
// dev_Chns: 4, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '未生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 1, //复检次数
// },
// {
// id: '6', //装置序号ID
// name: '易司拓测试装置1', //设备名称
// dev_Type: 'E703A',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 1, //复检次数
// },
// {
// id: '7', //装置序号ID
// name: '易司拓测试装置2', //设备名称
// dev_Type: 'E703A',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 1, //复检次数
// },
// {
// id: '8', //装置序号ID
// name: '山大电力测试装置1', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 1, //复检次数
// },
// {
// id: '9', //装置序号ID
// name: '山大电力测试装置2', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '10', //装置序号ID
// name: '山大电力测试装置2', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '11', //装置序号ID
// name: '山大电力测试装置2', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '12', //装置序号ID
// name: '山大电力测试装置2', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '13', //装置序号ID
// name: '山大电力测试装置2', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '14', //装置序号ID
// name: '山大电力测试装置3', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// {
// id: '15', //装置序号ID
// name: '山大电力测试装置4', //设备名称
// dev_Type: 'SDL-3002C',//设备类型
// dev_Chns: 1, //设备通道数
// check_Result: '不合格', //检测结果
// report_State: '已生成', //报告状态
// document_State: '未归档', //归档状态
// check_State:'检测完成',//检测状态
// reCheck_Num: 2, //复检次数
// },
// ]
export default {data,plan_devicedata} export default {data,plan_devicedata}

View File

@@ -1,41 +1,34 @@
// 误差体系模块 import type { ErrorSystem } from '@/api/device/interface/error'
export namespace ErrorSystem { import http from '@/api'
// 误差体系列表
export interface ErrorSystemList { /**
id: string;//误差体系表Id * @name 误差体系管理模块
name: string;//误差体系名称 */
standard_Name:string;//参照标准名称
standard_Time:string;//标准推行时间 //获取误差体系
dev_Level:string;//使用设备等级 export const getPqErrSysList = (params: ErrorSystem.ErrorSystemList) => {
enable?:number;//状态0-不启用 1-启用 return http.post(`/pqErrSys/list`, params)
state:number;//0-删除 1-正常 }
create_By?:string;//创建用户
create_Time?:string;//创建时间 //根据id查询误差体系
update_By?:string;//修改用户 export const getPqErrSysListById = (params: ErrorSystem.ErrorSystemList) => {
update_Time?:string;//修改时间 return http.get(`/pqErrSys/getById?id=${params.id}`)
}
//添加误差体系
export const addPqErrSys = (params: ErrorSystem.ErrorSystemList) => {
return http.post(`/pqErrSys/add`, params)
}
//编辑误差体系
export const updatePqErrSys = (params: ErrorSystem.ErrorSystemList) => {
return http.post(`/pqErrSys/update`, params)
}
//删除误差体系
export const deletePqErrSys = (params: string[]) => {
return http.post(`/pqErrSys/delete`, params)
} }
// 查看详细误差体系
export interface ErrorSystemDetail {
id:string;//误差体系子表ID
error_Sys_Id:string;//所属误差体系ID
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段)
JudgeConditionStart?:number;//误差判断起始值(误差范围)
IsContainStart?:number;//是否包含起始值
JudgeConditionEnd?:number;//误差判断结束值(误差范围)
IsContainEnd?:number;//是否包含结束值
JudgeConditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
MaxErrorValue:number;//误差最大值
ErrorValueType:string;//误差值类型包括值类型绝对值、相对值1、相对值2
}
// 查看详细误差体系
export interface Error_detail {
measured: string;
deviceLevel: string;
measurementType:string;
condition: string;
maxErrorValue: string;
}
}

View File

@@ -1,41 +1,46 @@
import type { ReqPage } from "@/api/interface";
// 误差体系模块 // 误差体系模块
export namespace ErrorSystem { export namespace ErrorSystem {
// 误差体系列表 // 误差体系列表
export interface ErrorSystemList { export interface ErrorSystemList {
id: string;//误差体系表Id id: string;//误差体系表Id
name: string;//误差体系名称 name: string;//误差体系名称
standard_Name:string;//参照标准名称 standardName:string;//参照标准名称
standard_Time:string;//标准推行时间 standardTime:string;//标准推行时间
dev_Level:string;//使用设备等级 devLevel:string;//使用设备等级
enable?:number;//状态0-不启用 1-启用 enable:number;//状态0-不启用 1-启用
state:number;//0-删除 1-正常 state:number;//0-删除 1-正常
create_By?:string;//创建用户 createBy?:string;//创建用户
create_Time?:string;//创建时间 createTime?:string;//创建时间
update_By?:string;//修改用户 updateBy?:string;//修改用户
update_Time?:string;//修改时间 updateTime?:string;//修改时间
pqErrSysDtlsList?: ErrorSystemDetail[];//误差体系子表列表
} }
// 查看详细误差体系 // 查看详细误差体系
export interface ErrorSystemDetail { export interface ErrorSystemDetail {
nextId: number;
id:string;//误差体系子表ID id:string;//误差体系子表ID
error_Sys_Id:string;//所属误差体系ID errorSysId:string;//所属误差体系ID
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段) type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段)
JudgeConditionStart?:number;//误差判断起始值(误差范围) startValue?:number;//误差判断起始值(误差范围)
IsContainStart?:number;//是否包含起始值 startFlag?:number;//是否包含起始值
JudgeConditionEnd?:number;//误差判断结束值(误差范围) endValue?:number;//;误差判断结束值(误差范围)
IsContainEnd?:number;//是否包含结束值 endFlag?:number;//是否包含结束值
JudgeConditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值) conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
MaxErrorValue:number;//误差最大值 maxErrorValue:number;//误差最大值
ErrorValueType:string;//误差值类型包括值类型绝对值、相对值1、相对值2 errorValueType:string;//误差值类型包括值类型绝对值、相对值1、相对值2
} }
// 查看详细误差体系 // 查看详细误差体系
export interface Error_detail { // export interface Error_detail {
measured: string; // measured: string;
deviceLevel: string; // deviceLevel: string;
measurementType:string; // measurementType:string;
condition: string; // condition: string;
maxErrorValue: string; // maxErrorValue: string;
} // }
} }

View File

@@ -5,7 +5,7 @@ export namespace TestScript {
/** /**
* 电能质量指标字典数据表格分页查询参数 * 检测脚本表格分页查询参数
*/ */
export interface ReqTestScriptParams extends ReqPage{ export interface ReqTestScriptParams extends ReqPage{
id: string; // 装置序号id 必填 id: string; // 装置序号id 必填
@@ -30,9 +30,9 @@ export namespace TestScript {
} }
/** /**
* 被检设备表格查询分页返回的对象; * 检测脚本查询分页返回的对象;
*/ */
export interface ResPqDevPage extends ResPage<ResTestScript> { export interface ResTestScriptPage extends ResPage<ResTestScript> {
} }
} }

View File

@@ -1,20 +1,35 @@
import type { ReqPage } from '@/api/interface' import type { ReqPage, ResPage } from '@/api/interface'
// 检测源模块 // 检测源模块
export namespace TestSource { export namespace TestSource {
/**
* 检测脚本表格分页查询参数
*/
export interface ReqTestSourceParams extends ReqPage{
id: string; // 装置序号id 必填
name: string;
pattern: string;
}
// 检测源接口 // 检测源接口
export interface TestSourceBO { export interface ResTestSource {
id?: string; //检测源ID id: string; //检测源ID
name: string; //检测源名称 name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
pattern: string;//检测源模式(字典表Code字段数字、模拟、比对) pattern: string;//检测源模式(字典表Code字段数字、模拟、比对)
type: string; //检测源类型(字典表Code字段标准源、高精度设备) type: string; //检测源类型(字典表Code字段标准源、高精度设备)
devType: string;//检测源设备类型(字典表Code字段) devType: string;//检测源设备类型(字典表Code字段)
parameters: string;//源参数JSON字符串 parameter?: string;//源参数JSON字符串
state:number;//
createBy?: string;
createTime?: string;
updateBy?: string;
updateTime?: string;
} }
// 检测源+分页 /* 检测脚本查询分页返回的对象;
export interface ReqTestSourceParams extends ReqPage,TestSourceBO { */
export interface ResTestSourcePage extends ResPage<ResTestSource> {
} }
} }

View File

@@ -5,8 +5,27 @@ import http from '@/api'
/** /**
* @name 检测源管理模块 * @name 检测源管理模块
*/ */
// 获取检测脚本列表 // 获取检测列表
export const getTestSourceList = (params: TestSource.ReqTestSourceParams) => { export const getTestSourceList = (params: TestSource.ReqTestSourceParams) => {
return http.post<ResPage<TestSource.TestSourceBO>>(`/testSource/list`, params) return http.post(`/pqSource/list`, params)
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/testSource/list`, params) }
//根据id查询检测源
export const getTestSourceById = (params: TestSource.ResTestSource) => {
return http.get(`/pqSource/getById?id=${params.id}`)
}
//添加检测源
export const addTestSource = (params: TestSource.ResTestSource) => {
return http.post(`/pqSource/add`, params)
}
//编辑检测源
export const updateTestSource = (params: TestSource.ResTestSource) => {
return http.post(`/pqSource/update`, params)
}
//删除检测源
export const deleteTestSource = (params: string[]) => {
return http.post(`/pqSource/delete`, params)
} }

View File

@@ -98,7 +98,17 @@ const init = () => {
chart.value.resize(); chart.value.resize();
}, 0); }, 0);
}; };
const reSize = (widthValue: number,heightValue: number,silentValue: boolean) => {
if (chart.value) {
chart.value.resize({
width: widthValue,
height: heightValue,
silent: silentValue,
});
}
};
const resizeCharts = () => { const resizeCharts = () => {
console.log(chart.value,111111);
if (chart.value) { if (chart.value) {
chart.value.resize(); chart.value.resize();
@@ -128,7 +138,7 @@ watch(
onMounted(() => { onMounted(() => {
init(); init();
}); });
defineExpose({ init }); defineExpose({ init,reSize });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pie { .pie {

View File

@@ -124,19 +124,20 @@
// 打开 drawer(新增、编辑) // 打开 drawer(新增、编辑)
const openDialog = (titleType: string, row: Partial<Function.ResFunction> = {}) => { const openDialog = (titleType: string, row: Partial<Function.ResFunction> = {}) => {
resourcePopup.value?.open(titleType, row) resourcePopup.value?.open(titleType, row)
} }
// 删除用户信息 // 删除菜单信息
const handleDelete = async (params: Function.ResFunction) => { const handleDelete = async (params: Function.ResFunction) => {
await useHandleData(deleteFunction, params , `删除【${params.name}用户`) await useHandleData(deleteFunction, params , `删除【${params.name}菜单`)
proTable.value?.getTableList() proTable.value?.getTableList()
} }
// 批量删除用户信息 // 批量删除菜单信息
const batchDelete = async (id: string[]) => { const batchDelete = async (id: string[]) => {
await useHandleData(deleteFunction, { id }, '删除所选用户信息') await useHandleData(deleteFunction, { id }, '删除所选菜单信息')
proTable.value?.clearSelection() proTable.value?.clearSelection()
proTable.value?.getTableList() proTable.value?.getTableList()
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig"> <el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px">
<div class="change-errsys-dialog"> <div class="change-errsys-dialog">
<div class="change-errsys-title"> <div class="change-errsys-title">
<el-form :model='formContent'> <el-form :model='formContent'>
@@ -32,7 +32,6 @@
:disabled = "plan.label === errorSysName" :disabled = "plan.label === errorSysName"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@@ -305,8 +304,7 @@ const props = defineProps<{
//clearInterval(timer.value); //clearInterval(timer.value);
activeIndex.value = 0; activeIndex.value = 0;
tableData.value.length = 0; tableData.value.length = 0;
tableData.value = operatorTableData.value; tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
}; };
const openReportDlg = () => { const openReportDlg = () => {

View File

@@ -18,9 +18,9 @@
<template #tableHeader="scope"> <template #tableHeader="scope">
<el-form :model="form" label-width="80px" :inline="true"> <el-form :model="form" label-width="80px" :inline="true">
<el-form-item label="模糊搜索"> <el-form-item label="模糊搜索">
<el-input v-model="form.search" placeholder="请输入搜索内容" clearable></el-input> <el-input v-model="form.search" placeholder="请输入搜索内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测状态"> <el-form-item label="检测状态" v-if="form.activeTabs != 3 && form.activeTabs != 5">
<el-select v-model="form.checkStatus" clearable> <el-select v-model="form.checkStatus" clearable>
<el-option <el-option
v-for="(item, index) in checkStatusList" v-for="(item, index) in checkStatusList"
@@ -31,17 +31,6 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报告状态">
<el-select v-model="form.checkReportStatus" clearable>
<el-option
v-for="(item, index) in checkReportStatusList"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
:key="index"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果"> <el-form-item label="检测结果">
<el-select v-model="form.checkResult" clearable> <el-select v-model="form.checkResult" clearable>
<el-option <el-option
@@ -53,10 +42,35 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报告状态" v-if="form.activeTabs != 0 && form.activeTabs != 4">
<el-select v-model="form.checkReportStatus" clearable>
<el-option
v-for="(item, index) in checkReportStatusList"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
:key="index"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="检测结果">
<el-select v-model="form.checkResult" clearable>
<el-option
v-for="(item, index) in checkResultList"
:label="item.label"
:value="item.value"
:disabled="item.disabled"
:key="index"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" :icon="Search" @click="handleSearch" <el-button type="primary" :icon="Search" @click="handleSearch"
>查询</el-button >查询</el-button
> >
<el-button :icon="Delete" @click="handleRefresh"
>重置</el-button
>
<el-button <el-button
type="primary" type="primary"
:icon="Clock" :icon="Clock"
@@ -78,10 +92,13 @@
>全部复检</el-button >全部复检</el-button
> >
<el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
<el-button type="primary" :icon="Download" :disabled='!scope.isSelected' @click="handleTest('批量下载')" v-if="form.activeTabs === 3"
>批量下载</el-button
>
<el-button type="primary" :icon="Postcard" :disabled='!scope.isSelected' @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
>批量生成</el-button >批量生成</el-button
> >
<el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4" <el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4"
>批量归档</el-button >批量归档</el-button
> >
@@ -100,8 +117,8 @@
> >
<div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0"> <div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0">
<el-dropdown trigger='click'> <el-dropdown trigger='click'>
<el-button link type='primary' :icon="View" class='table-operate'> <el-button link type='primary' :icon="Download" class='table-operate'>
<div class='table-operate-text'>查看</div> <div class='table-operate-text'>下载</div>
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
@@ -134,7 +151,7 @@
link link
:icon="Notebook" :icon="Notebook"
@click="openDrawer('归档', scope.row)" @click="openDrawer('归档', scope.row)"
v-if="form.activeTabs === 4" v-if="form.activeTabs === 0"
>归档</el-button >归档</el-button
> >
<el-button <el-button
@@ -201,7 +218,7 @@ import { ElMessage, ElMessageBox, ElLoading} from "element-plus";
import ProTable from "@/components/ProTable/index.vue"; import ProTable from "@/components/ProTable/index.vue";
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface' import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
import { import {
Search,View,EditPen,Clock,ChatLineRound,ChatLineSquare,ChatDotSquare,Postcard,Notebook,Switch,PieChart Search,View,Delete,Download,EditPen,Clock,ChatLineRound,ChatLineSquare,ChatDotSquare,Postcard,Notebook,Switch,PieChart
} from "@element-plus/icons-vue"; } from "@element-plus/icons-vue";
import { getPlanList } from "@/api/plan/planList"; import { getPlanList } from "@/api/plan/planList";
import deviceDataList from '@/api/device/device/deviceData' import deviceDataList from '@/api/device/device/deviceData'
@@ -209,7 +226,7 @@ import testPopup from "./testPopup.vue";
import reportPopup from "./reportPopup.vue"; import reportPopup from "./reportPopup.vue";
import dataCheckPopup from "./dataCheckPopup.vue"; import dataCheckPopup from "./dataCheckPopup.vue";
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue"; import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
import { isVisible } from "element-plus/es/utils";
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
const tableKey = ref(0); const tableKey = ref(0);
@@ -234,9 +251,12 @@ const dialogForm = ref<any>({
}); });
//console.log(window.innerHeight, "+++++++++"); //console.log(window.innerHeight, "+++++++++");
tableHeight.value = window.innerHeight - 600; tableHeight.value = window.innerHeight - 600;
const deviceData = deviceDataList.plan_devicedata //const deviceData = deviceDataList.plan_devicedata
const deviceData = ref([]);
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
const operationShow = ref(false); const operationShow = ref(false);
const operationMinWidth = ref(200); const operationMinWidth = ref(200);
//下拉框数据 //下拉框数据
//检测状态数据 //检测状态数据
let checkStatusList = reactive([ let checkStatusList = reactive([
@@ -264,30 +284,35 @@ let checkStatusList = reactive([
//检测报告状态数据 //检测报告状态数据
let checkReportStatusList = reactive([ let checkReportStatusList = reactive([
{ {
label: "未生成报告", label: "未检测",
value: 0, value: 0,
disabled: false, disabled: false,
}, },
{ {
label: "生成报告", label: "生成",
value: 1, value: 1,
disabled: false, disabled: false,
}, },
{
label: "已生成",
value: 2,
disabled: false,
},
]); ]);
//检测结果数组 //检测结果数组
let checkResultList = reactive([ let checkResultList = reactive([
{ {
label: "未出结果", label: "未检测",
value: 0, value: 0,
disabled: false, disabled: false,
}, },
{ {
label: "不合格", label: "不合格",
value: 1, value: 1,
disabled: false, disabled: false,
}, },
{ {
label: "合格", label: "全部合格",
value: 2, value: 2,
disabled: false, disabled: false,
}, },
@@ -350,10 +375,11 @@ let checkResultList = reactive([
//查询条件 //查询条件
const form: any = ref({ const form: any = ref({
activeTabs: 0, //功能选择 activeTabs: 0, //功能选择
search: "",//搜索内容
activeChildTabs: 0,//子功能选择 activeChildTabs: 0,//子功能选择
checkStatus: 0, //检测状态 checkStatus: null, //检测状态
checkReportStatus: 0, //检测报告状态 checkResult: null, //检测结果
checkResult: 0, //检测结果 checkReportStatus: null, //检测报告状态
deviceBindStatus: 0, //绑定状态 deviceBindStatus: 0, //绑定状态
deviceType: 0, //设备类型 deviceType: 0, //设备类型
manufacturer: 0, //制造厂商 manufacturer: 0, //制造厂商
@@ -416,8 +442,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
minWidth: 100, minWidth: 100,
}, },
{ {
prop: 'report_State', prop: 'check_State',
label: '报告状态', label: '检测状态',
minWidth: 100, minWidth: 100,
}, },
{ {
@@ -426,8 +452,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
minWidth: 100, minWidth: 100,
}, },
{ {
prop: 'check_State', prop: 'report_State',
label: '检测状态', label: '报告状态',
minWidth: 100, minWidth: 100,
}, },
{ {
@@ -599,17 +625,51 @@ const resetSearchForm = () => {
checkResult: 0, checkResult: 0,
}; };
}; };
let testType = "test";//检测还是复检
const handleSelectionChange = (selection: any[]) => { const handleSelectionChange = (selection: any[]) => {
const result = selection.filter((item) => item.check_Result != "有不合格项")
if(result.length > 0)
{
testType= "test";
}
else
{
testType= "reTest";
}
console.log(selection); console.log(selection);
} }
//查询 //查询
const handleSearch = () => { const handleSearch = () => {
matchDialogVisible.value = true;
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成");
}
//matchDialogVisible.value = true;
//proTable.value?.getTableList(); //proTable.value?.getTableList();
}; };
//重置 //重置
const handleRefresh = () => { const handleRefresh = () => {
proTable.value?.getTableList(); form.value.search = "";
form.value.checkStatus = null;
form.value.checkResult = null;
form.value.checkReportStatus = null;
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成");
}
}; };
// 表格拖拽排序 // 表格拖拽排序
const sortTable = ({ const sortTable = ({
@@ -661,75 +721,77 @@ const changeStatus = async (row: User.ResUserList) => {
proTable.value?.getTableList(); proTable.value?.getTableList();
}; };
//顶部功能切换时修改activeTabs //顶部功能切换时修改activeTabs
const changeActiveTabs = (val: number,val2: number) => { const changeActiveTabs = (val: number,val2: number,tabledata:any[]) => {
form.value.activeTabs = val; form.value.activeTabs = val;
form.value.activeChildTabs= val2; form.value.activeChildTabs= val2;
deviceData.value = tabledata;
tableHeaderInit(val) tableHeaderInit(val)
console.log(form,val,val2,666) console.log(form,val,val2,666)
}; };
//根据当前功能,初始化表头下拉框中的默认值和禁用值 //根据当前功能,初始化表头下拉框中的默认值和禁用值
function tableHeaderInit(val: number) { function tableHeaderInit(val: number) {
refreshStatusList() refreshStatusList()
switch (val) { switch (val) {
case 0://自动检测 case 0://设备检测
case 1://手动检测 case 1://手动检测
form.value.checkStatus = 0;//检测状态默认为未检 //disableCheckStatus("检测中")
form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
form.value.checkResult = 0;//检测结果默认为未出结果
disableCheckStatus("检测中")
disableCheckStatus("归档") disableCheckStatus("归档")
operationShow.value = false; // operationShow.value = false;
columns[columns.length - 1].minWidth = 100;
tableKey.value ++;
operationShow.value = true;
break; break;
case 2://设备复检 case 2://设备复检
form.value.checkStatus = 2;//检测状态默认为检测完成 // form.value.checkStatus = 2;//检测状态默认为检测完成
form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告 // form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
form.value.checkResult = 1;//检测结果默认为不合格 // form.value.checkResult = 1;//检测结果默认为不合格
disableCheckStatus("未检测") // disableCheckStatus("未检测")
disableCheckStatus("检测中") // disableCheckStatus("检测中")
disableCheckStatus("归档") // disableCheckStatus("归档")
disablecheckResultList("未出结果") // disablecheckResultList("未出结果")
operationShow.value = false; // operationShow.value = false;
break; break;
case 3://报告生成 case 3://报告生成
form.value.checkStatus = 2;//检测状态默认为检测完成 // form.value.checkStatus = 2;//检测状态默认为检测完成
form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告 // form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
form.value.checkResult = 2;//检测结果默认为合格 // form.value.checkResult = 2;//检测结果默认为合格
disableCheckStatus("未检测") // disableCheckStatus("未检测")
disableCheckStatus("检测中") // disableCheckStatus("检测中")
disableCheckStatus("归档") // disableCheckStatus("归档")
disablecheckResultList("未出结果") disablecheckResultList("未检测")
disableCheckReportStatus("未检测")
columns[columns.length - 1].minWidth = 150; columns[columns.length - 1].minWidth = 150;
tableKey.value += 1; tableKey.value += 1;
operationShow.value = true; operationShow.value = true;
break; break;
case 4://设备归档 case 4://设备归档
form.value.checkStatus = 2;//检测状态默认为检测完成 // form.value.checkStatus = 2;//检测状态默认为检测完成
form.value.checkReportStatus = 1;//检测报告状态默认为已生成报告 // form.value.checkReportStatus = 1;//检测报告状态默认为已生成报告
form.value.checkResult = 2;//检测结果默认为合格 // form.value.checkResult = 2;//检测结果默认为合格
disableCheckStatus("未检测") // disableCheckStatus("未检测")
disableCheckStatus("检测中") // disableCheckStatus("检测中")
disableCheckStatus("归档") // disableCheckStatus("归档")
disableCheckReportStatus("未生成报告") disableCheckReportStatus("未生成报告")
disablecheckResultList("未出结果") disablecheckResultList("未出结果")
columns[columns.length - 1].minWidth = 100; columns[columns.length - 1].minWidth = 100;
tableKey.value ++; tableKey.value ++;
operationShow.value = true; operationShow.value = true;
break; break;
case 5://数据查询 case 5://数据查询
disablecheckResultList("未检测")
disableCheckReportStatus("未检测")
columns[columns.length - 1].minWidth = 250; columns[columns.length - 1].minWidth = 250;
tableKey.value += 1; tableKey.value += 1;
operationShow.value = true; operationShow.value = true;
break; break;
} }
console.log("test",columns); console.log("test",columns);
} }
tableHeaderInit(0)
function refreshStatusList(){ function refreshStatusList(){
checkStatusList.map((item: any, index: any) => { checkStatusList.map((item: any, index: any) => {
if (item.disabled) { if (item.disabled) {
@@ -746,6 +808,10 @@ function refreshStatusList(){
item.disabled = false; item.disabled = false;
} }
}); });
form.value.checkStatus = null;//检测状态默认为未检
form.value.checkReportStatus = null;//检测报告状态默认为未生成报告
form.value.checkResult = null;//检测结果默认为未出结果
} }
function disableCheckStatus(val: string){ function disableCheckStatus(val: string){
@@ -775,9 +841,41 @@ const handleTest = (val:string) => {
if(val==='手动检测'||val==='自动检测'||val==='不合格项复检'||val==='全部复检' ) if(val==='手动检测'||val==='自动检测'||val==='不合格项复检'||val==='全部复检' )
{ {
if(testType === "reTest")
{
ElMessageBox.confirm(
'请选择复检检测方式',
'设备复检',
{
distinguishCancelAndClose: true,
confirmButtonText: '不合格项复检',
cancelButtonText: '全部复检',
type: 'warning',
},
)
.then(() => {
ElMessage.success(val); ElMessage.success(val);
dialogTitle.value = val; dialogTitle.value = val;
dialogFormVisible.value = true; // 打开对话框 dialogFormVisible.value = true; // 打开对话框
})
// .catch((action: Action) => {
// ElMessage({
// type: 'info',
// message:
// action === 'cancel'
// ? '以当前数据为主完成数据覆盖'
// : '取消本次导入操作',
// })
// })
}
else
{
ElMessage.success(val);
dialogTitle.value = val;
dialogFormVisible.value = true; // 打开对话框
}
} }
if(val==='批量生成') if(val==='批量生成')

View File

@@ -227,7 +227,7 @@
</el-table> </el-table>
</div> </div>
<div > <div >
<el-collapse model-value="1" accordion> <el-collapse model-value="0" accordion>
<el-collapse-item title="检测日志:" name="1"> <el-collapse-item title="检测日志:" name="1">
<div ref="scrollContainer" class="dialog-log"> <div ref="scrollContainer" class="dialog-log">
<p v-for="(item, index) in testLogList" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}"> <p v-for="(item, index) in testLogList" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
@@ -451,21 +451,18 @@ function traverseTableData(data: any[],id: string): void {
} }
const updateTableData = (id: string) => { const updateTableData = (id: string) => {
traverseTableData(tableData.value,id); traverseTableData(tableData.value,id);
console.log(id) console.log(id)
}; };
const handleReCheck = () => { const handleReCheck = () => {
console.log(tableData.value,operatorTableData.value)
activeIndex.value = 0; activeIndex.value = 0;
percentage.value = 0; percentage.value = 0;
tableData.value.length = 0; tableData.value.length = 0;
testLogList.value.length = 0; testLogList.value.length = 0;
tableData.value = operatorTableData.value;
console.log(tableData.value,operatorTableData.value)
console.log(tableData.value,operatorTableData.value)
tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
resumeTimer() resumeTimer()
}; };
let timer: any = ref(""); let timer: any = ref("");
@@ -1849,6 +1846,7 @@ const startTimer = () => {
} else { } else {
percentage.value = 100; percentage.value = 100;
clearInterval(timer.value) clearInterval(timer.value)
timer.value = null;
ts.value = 'success' ts.value = 'success'
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', { ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
@@ -1863,6 +1861,7 @@ const startTimer = () => {
else else
{ {
clearInterval(timer.value) clearInterval(timer.value)
timer.value = null;
ts.value = 'success' ts.value = 'success'
} }
@@ -1878,6 +1877,7 @@ const pauseTimer = () => {
const resumeTimer = () => { const resumeTimer = () => {
if (timer.value === null) { if (timer.value === null) {
console.log('startTimer')
startTimer(); startTimer();
} }
}; };

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogBig" width="1200px" height="1200px"> <el-dialog :title="dialogTitle" :model-value="visible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
<div class="steps-container"> <div class="steps-container">
<!-- simple --> <!-- simple -->
@@ -193,26 +193,41 @@ const getIcon = (index: number) => {
TestStatus.value = "waiting" TestStatus.value = "waiting"
nextStepText.value = "下一步" nextStepText.value = "下一步"
} }
const handleCancel = () => { const beforeClose = (done: () => void) => {
// if(stepsActiveIndex.value < stepsTotalNum.value) console.log(stepsActiveIndex.value,stepsTotalNum.value)
// { if(stepsActiveIndex.value < stepsTotalNum.value)
// ElMessageBox.confirm( {
// '是否退出当前检测流程?', ElMessageBox.confirm(
// '提示', '检测未完成,是否退出当前检测流程?',
// { '提示',
// confirmButtonText: '确定', {
// cancelButtonText: '取消', confirmButtonText: '确定',
// type: 'warning', cancelButtonText: '取消',
// } type: 'warning',
// ) }
// .then(() => { )
// // clearData() .then(() => {
// // emit('update:visible', false); // 关闭对话框
//
// })
// }
clearData() clearData()
emit('update:visible', false); // 关闭对话框 emit('update:visible', false); // 关闭对话框
})
}
else
{
clearData()
emit('update:visible', false); // 关闭对话框
}
// ElMessageBox.confirm('Are you sure to close this dialog?')
// .then(() => {
// done()
// })
// .catch(() => {
// // catch error
// })
}
const handleCancel = () => {
// clearData()
// emit('update:visible', false); // 关闭对话框
}; };
const handleSubmit = () => { const handleSubmit = () => {

View File

@@ -28,9 +28,9 @@
<!-- <el-collapse v-model="activeNames" @change="handleChange"> <!-- <el-collapse v-model="activeNames" @change="handleChange">
<el-collapse-item title="检测进度展示" name="1"> --> <el-collapse-item title="检测进度展示" name="1"> -->
<!-- <div class="dialog-log"> <div class="container_pieShow">
<el-collapse model-value="1" accordion> <el-collapse model-value="1" accordion @change="handleCollapseChange">
<el-collapse-item title="检测进度展示:" name="1"> --> <el-collapse-item title="&nbsp&nbsp&nbsp&nbsp检测进度展示:" name="1">
<!-- 饼图 --> <!-- 饼图 -->
<div class="container_charts"> <div class="container_charts">
<div class="charts_info"> <div class="charts_info">
@@ -81,27 +81,25 @@
></pie> ></pie>
</div> </div>
</div> </div>
<!-- </el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</div> --> </div>
<el-tabs type="border-card" @tab-change="handleTabsChange" v-model="editableTabsValue"> <el-tabs class="tabs-menu" type="border-card" @tab-change="handleTabsChange" v-model="editableTabsValue" :style="{ height: tabsHeight }">
<el-tab-pane :label="tabLabel1"> <el-tab-pane :label="tabLabel1" :style="{ height: tabPaneHeight }">
<!-- 列表数据 --> <!-- 列表数据 -->
<div class="container_table"> <div class="container_table" :style="{ height: tableHeight }">
<Table ref="tableRef1"></Table> <Table ref="tableRef1"></Table>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已检设备" v-if="tabShow"> <el-tab-pane label="已检设备" v-if="tabShow" :style="{ height: tabPaneHeight }">
<!-- 列表数据 --> <!-- 列表数据 -->
<div class="container_table"> <div class="container_table" :style="{ height: tableHeight }">
<Table ref="tableRef2"></Table> <Table ref="tableRef2"></Table>
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
</template> </template>
@@ -112,6 +110,9 @@ import { useRouter } from "vue-router";
import tree from "../components/tree.vue"; import tree from "../components/tree.vue";
import Table from "../components/table.vue"; import Table from "../components/table.vue";
import { data } from "@/api/plan/static.json"; import { data } from "@/api/plan/static.json";
import deviceDataList from '@/api/device/device/deviceData'
const deviceData = deviceDataList.plan_devicedata
const treeRef = ref(); const treeRef = ref();
const form: any = ref({ const form: any = ref({
activeTabs: 0, //功能选择,例如报告生成 activeTabs: 0, //功能选择,例如报告生成
@@ -128,10 +129,26 @@ const activeNames = ref(['2'])
const tabShow= ref(false); const tabShow= ref(false);
const tabLabel1 = ref('设备检测') const tabLabel1 = ref('设备检测')
const editableTabsValue = ref('0') const editableTabsValue = ref('0')
const tabsHeight = ref('calc(100vh - 538px)'); // 初始高度
const tabPaneHeight = ref('calc(100% - 5px)'); // 初始高度
const tableHeight = ref('calc(100% - 5px)'); // 初始高度
const handleChange = (val: string[]) => { const handleChange = (val: string[]) => {
// console.log(val) // console.log(val)
} }
const handleCollapseChange = (val: string[]) => {
console.log(val)
console.log(val.length)
// 计算新的高度
const newHeight = val.length > 0 ? 'calc(100vh - 538px)' : 'calc(100vh - 333px)';
//const newtableHeight= val.length > 0 ? 'calc(100vh - 638px)' : 'calc(100vh - 433px)';
tabsHeight.value = newHeight;
tabPaneHeight.value = `calc(100% - 5px)`;
tableHeight.value = `calc(100% - 5px)`;
};
const handleTabsChange = (val) => { const handleTabsChange = (val) => {
form.value.activeTabs = 0; form.value.activeTabs = 0;
form.value.activeTabs = 3; form.value.activeTabs = 3;
@@ -148,12 +165,12 @@ const tabsList = ref([
img: "/src/assets/images/plan/static/1.svg", img: "/src/assets/images/plan/static/1.svg",
checked: true, checked: true,
}, },
{ // {
label: "设备复检", // label: "设备复检",
value: 2, // value: 2,
img: "/src/assets/images/plan/static/2.svg", // img: "/src/assets/images/plan/static/2.svg",
checked: false, // checked: false,
}, // },
{ {
label: "报告生成", label: "报告生成",
value: 3, value: 3,
@@ -166,59 +183,36 @@ const tabsList = ref([
img: "/src/assets/images/plan/static/5.svg", img: "/src/assets/images/plan/static/5.svg",
checked: false, checked: false,
}, },
{
label: "设备归档",
value: 4,
img: "/src/assets/images/plan/static/4.svg",
checked: false,
},
]);
// const tabsList = ref([
// {
// label: "自动检测",
// value: 0,
// img: "/src/assets/images/plan/static/1.svg",
// checked: true,
// },
// {
// label: "手动检测",
// value: 1,
// img: "/src/assets/images/plan/static/2.svg",
// checked: false,
// },
// {
// label: "设备复检",
// value: 2,
// img: "/src/assets/images/plan/static/6.svg",
// checked: false,
// },
// {
// label: "报告生成",
// value: 3,
// img: "/src/assets/images/plan/static/3.svg",
// checked: false,
// },
// { // {
// label: "设备归档", // label: "设备归档",
// value: 4, // value: 4,
// img: "/src/assets/images/plan/static/4.svg", // img: "/src/assets/images/plan/static/4.svg",
// checked: false, // checked: false,
// }, // },
// { ]);
// label: "设备浏览",
// value: 5,
// img: "/src/assets/images/plan/static/5.svg",
// checked: false,
// },
// ]);
form.value.activeTabs = tabsList.value[0].value; form.value.activeTabs = tabsList.value[0].value;
const tableRef1 = ref(); const tableRef1 = ref();
const tableRef2 = ref(); const tableRef2 = ref();
watch( watch(
() => form.value, () => form.value,
(val, oldVal) => { (val, oldVal) => {
if (val) { if (val) {
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs);
console.log(form.value.activeTabs,111);
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
{
const tabledata = deviceData.filter((item) => item.document_State === "未归档")
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
const tabledata = deviceData.filter((item) => item.check_State === "检测完成");
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
}
} }
}, },
{ {
@@ -258,21 +252,32 @@ const getPieData = () => {
]; ];
chartsData2.value = [ chartsData2.value = [
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } }, { value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "全部合格", itemStyle: { color: '#91cc75' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "有不合格项" , itemStyle: { color: '#ee6666' } }, { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项" , itemStyle: { color: '#ee6666' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "全部合格", itemStyle: { color: '#91cc75' } },
]; ];
// pieRef2.value.init(); // pieRef2.value.init();
chartsData3.value = [ chartsData3.value = [
// { value: Math.floor(Math.random() * 100) + 1, name: "已生成报告" }, // { value: Math.floor(Math.random() * 100) + 1, name: "已生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "未生成报告" }, // { value: Math.floor(Math.random() * 100) + 1, name: "未生成报告" },
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } }, { value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "有不合格项未生成报告" }, { value: Math.floor(Math.random() * 100) + 1, name: "未生成" , itemStyle: { color: '#ee6666' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "全部合格未生成报告" }, { value: Math.floor(Math.random() * 100) + 1, name: "已生成", itemStyle: { color: '#91cc75' } },
{ value: Math.floor(Math.random() * 100) + 1, name: "有不合格项已生成报告" },
{ value: Math.floor(Math.random() * 100) + 1, name: "全部合格已生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项未生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格未生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项已生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格已生成报告" },
]; ];
// pieRef3.value.init(); // pieRef3.value.init();
pieRef1.value.init(); pieRef1.value.init();
pieRef2.value.init();
pieRef3.value.init();
pieRef1.value.reSize(470,145,true);
pieRef2.value.reSize(470,145,true);
pieRef3.value.reSize(470,145,true);
}; };
const getTree = () => { const getTree = () => {
treeRef.value.getTreeData(data); treeRef.value.getTreeData(data);
@@ -308,7 +313,7 @@ const handleCheckFunction = (val: any) => {
}); });
tabShow.value = false; tabShow.value = false;
console.log("test",val,tabLabel1.value);
switch (val) { switch (val) {
case 0://自动检测 case 0://自动检测
tabLabel1.value = "设备检测"; tabLabel1.value = "设备检测";
@@ -330,7 +335,7 @@ const handleCheckFunction = (val: any) => {
tabLabel1.value = "数据查询"; tabLabel1.value = "数据查询";
break; break;
} }
console.log("test",val,tabLabel1.value);
form.value.activeTabs = val; form.value.activeTabs = val;
}; };
@@ -367,14 +372,13 @@ onMounted(() => {
//align-items: center; //align-items: center;
//box-sizing: border-box; //box-sizing: border-box;
.container_function { .container_function {
width: 100%; width: 100%;
height: auto; height: auto;
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
// justify-content: space-around;
// justify-content: space-evenly;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
@@ -384,27 +388,27 @@ onMounted(() => {
.function_item { .function_item {
flex: none; flex: none;
width: 6%; width: 6%;
height: 40px; height: 70px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-direction: row; flex-direction: column;
cursor: pointer; cursor: pointer;
background-color: #607eab; background-color: #607eab;
border-radius: 8px; border-radius: 8px;
padding: 0px 30px; padding: 0px 30px;
.item_img { .item_img {
width: 30px; width: 60px;
height: 30px; height: 60px;
border-radius: 50%; border-radius: 50%;
// background-color: #607eab; // background-color: #607eab;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 5px;
img { img {
width: 20px; width: 40px;
height: auto; height: auto;
} }
} }
@@ -421,7 +425,6 @@ onMounted(() => {
.item_text { .item_text {
p { p {
width: 80px;
margin: 0; margin: 0;
font-weight: 800; font-weight: 800;
color: var(--el-color-primary); color: var(--el-color-primary);
@@ -447,10 +450,90 @@ onMounted(() => {
} }
} }
} }
// .container_function {
// width: 100%;
// height: auto;
// background: #fff;
// border-radius: 4px;
// display: flex;
// // justify-content: space-around;
// // justify-content: space-evenly;
// justify-content: space-between;
// align-items: center;
// margin-bottom: 10px;
// padding: 10px 20px 10px 20px;
// box-sizing: border-box;
.dialog-log{ // .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; width: 100% !important;
min-height: 200px !important; //min-height: 200px !important;
height:auto; height:auto;
background-color: #eee; background-color: #eee;
// display: flex; // display: flex;
@@ -461,12 +544,12 @@ onMounted(() => {
.el-collapse { .el-collapse {
width: 100% !important; width: 100% !important;
// min-height: 200px !important; // min-height: 200px !important;
height:auto; height:100% !important;
background-color: #eee; background-color: #eee;
// display: flex; // display: flex;
// justify-content: space-between; // justify-content: space-between;
// padding-left: 2ch; // padding-left: 2ch;
margin-bottom: 10px; // margin-bottom: 10px;
} }
.el-collapse-item{ .el-collapse-item{
@@ -479,8 +562,8 @@ onMounted(() => {
.container_charts { .container_charts {
width: 100%; width: 100%;
min-height: 180px !important; //min-height: 180px !important;
// height:100%; height:90%;
background-color: #eee; background-color: #eee;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -500,10 +583,14 @@ onMounted(() => {
border-radius: 4px; border-radius: 4px;
} }
.tabs-menu{
height: 100%;
}
.container_table { .container_table {
// width: 100%; // width: 100%;
flex: 1 !important; flex: 1 !important;
height: calc(100vh - 360px - 147px); height: calc(100vh - 360px - 180px);
//height: 100% !important;
border-radius: 4px; border-radius: 4px;
width: 100% !important; width: 100% !important;
// display: none; // display: none;

View File

@@ -319,8 +319,14 @@ const disabledDate = (time: Date) => {
manufacturer: [{ required: true, message: '生产厂家必选!', trigger: 'change' }], manufacturer: [{ required: true, message: '生产厂家必选!', trigger: 'change' }],
encryptionFlag: [{ required: true, message: '是否加密必选!', trigger: 'change' }], encryptionFlag: [{ required: true, message: '是否加密必选!', trigger: 'change' }],
protocol: [{ required: true, message: '通讯协议必选!', trigger: 'change' }], protocol: [{ required: true, message: '通讯协议必选!', trigger: 'change' }],
series: [], // series: [],
devKey: [] // devKey: []
series : [
{ required: true, message: '请输入识别码', trigger: 'blur' }
],
devKey : [
{ required: true, message: '请输入密钥', trigger: 'blur' }
],
}) })
// 关闭弹窗 // 关闭弹窗
@@ -354,6 +360,16 @@ const disabledDate = (time: Date) => {
await updatePqDev(formContent.value); await updatePqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` }) ElMessage.success({ message: `${dialogTitle.value}成功!` })
} else { } else {
// 新增需要把设备模式转成字典ID
const patternItem = dictStore.getDictData('Pattern').find(item => item.name === formContent.value.pattern);
if (patternItem) {
formContent.value.pattern = patternItem.id;
}
// 新增需要把通讯协议转成字典ID
const protocolItem = dictStore.getDictData('Protocol').find(item => item.name === formContent.value.protocol);
if (protocolItem) {
formContent.value.protocol = protocolItem.id;
}
await addPqDev(formContent.value); await addPqDev(formContent.value);
ElMessage.success({ message: `${dialogTitle.value}成功!` }) ElMessage.success({ message: `${dialogTitle.value}成功!` })
@@ -373,8 +389,6 @@ const disabledDate = (time: Date) => {
// 打开弹窗,可能是新增,也可能是编辑 // 打开弹窗,可能是新增,也可能是编辑
const open = (sign: string, data: Device.ResPqDev,currentMode: string) => { const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
mode.value = currentMode mode.value = currentMode
// 重置表单
dialogFormRef.value?.resetFields()
titleType.value = sign titleType.value = sign
dialogVisible.value = true dialogVisible.value = true
@@ -397,30 +411,23 @@ const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
resetFormContent() resetFormContent()
handleEncryptionChange(1) handleEncryptionChange(1)
} }
// 重置表单
dialogFormRef.value?.resetFields()
} }
const handleEncryptionChange = (value: number) => { const handleEncryptionChange = (value: number) => {
// 根据是否加密来显示或隐藏识别码和密钥 // 根据是否加密来显示或隐藏识别码和密钥
if(value === 1){ if(value === 1){
IsPasswordShow.value = true IsPasswordShow.value = true
rules.value.series = [
{ required: true, message: '请输入识别码', trigger: 'blur' }
];
rules.value.devKey = [
{ required: true, message: '请输入密钥', trigger: 'blur' }
];
}else }else
{ {
IsPasswordShow.value = false IsPasswordShow.value = false
formContent.value.series = '' // formContent.value.series = ''
formContent.value.devKey = '' // formContent.value.devKey = ''
rules.value.series = []; // rules.value.series = [];
rules.value.devKey = []; // rules.value.devKey = [];
} }
// 如果选择"是",则显示;否则隐藏
dialogFormRef.value?.clearValidate(); // 清除验证状态
} }
// 对外映射 // 对外映射

View File

@@ -29,9 +29,8 @@
import { getPqMonList } from '@/api/device/monitor' import { getPqMonList } from '@/api/device/monitor'
import { type ColumnProps } from '@/components/ProTable/interface' import { type ColumnProps } from '@/components/ProTable/interface'
import { type Monitor } from '@/api/device/interface/monitor' import { type Monitor } from '@/api/device/interface/monitor'
const props = defineProps({
MonIsShow: Boolean,
});
// 表格配置项 // 表格配置项

View File

@@ -1,150 +0,0 @@
<template>
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogBig">
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" :span-method="spanMethod" border class="custom-table">
<el-table-column prop="measured" label="被测量" />
<el-table-column prop="deviceLevel" label="检测装置级别" />
<el-table-column prop="measurementType" label="测量类型" />
<el-table-column prop="condition" label="测量条件" />
<el-table-column prop="maxErrorValue" label="最大误差" />
</el-table>
</el-dialog>
</template>
<script lang="ts" setup name="IndicatorTypeDialog">
import { defineProps, defineEmits, reactive,watch,ref,computed } from 'vue';
import { dialogBig} from '@/utils/elementBind'
import type { ColumnProps } from '@/components/ProTable/interface'
import type { ErrorSystem } from '@/api/device/interface/error'
import errorDataList from '@/api/device/error/errorData'
import type { TableColumnCtx } from 'element-plus'
const errorData = errorDataList.errordetail
// 表格配置项
const columns = reactive<ColumnProps<ErrorSystem.Error_detail>[]>([
{
prop: 'measured',
label: '被测量',
},
{
prop: 'deviceLevel',
label: '检测装置级别',
},
{
prop: 'condition',
label: '测量条件',
},
{
prop: 'measurementType',
label: '测量类型',
},
{
prop: 'maxErrorValue',
label: '最大误差',
},
])
interface SpanMethodProps {
row: ErrorSystem.Error_detail
column: TableColumnCtx<ErrorSystem.Error_detail>
rowIndex: number
columnIndex: number
}
const spanMethod = ({
row,
column,
rowIndex,
columnIndex,
}: SpanMethodProps) => {
if (columnIndex === 0 ) { // 检查是否为第一列
if (rowIndex === 2 || rowIndex === 21) { // 检查是否为第三行
return {
rowspan: 2, // 合并行数
colspan: 1, // 单元格列数
};
}else if (rowIndex === 8) { //
return {
rowspan: 8,
colspan: 1,
};
}
else if (rowIndex === 16) { //
return {
rowspan: 4,
colspan: 1,
};
}
else if (rowIndex === 3 || rowIndex === 9 || rowIndex === 10|| rowIndex === 11
|| rowIndex === 12|| rowIndex === 13|| rowIndex === 14|| rowIndex === 15
|| rowIndex === 17 || rowIndex === 18|| rowIndex === 19
|| rowIndex === 22) { // 检查是否为第四行
return {
rowspan: 0, // 不显示该单元格
colspan: 0,
};
}
}
else if(columnIndex === 2) { // 检查是否为第三列
if (rowIndex === 2
|| rowIndex === 8|| rowIndex === 10|| rowIndex === 12|| rowIndex === 14
|| rowIndex === 16|| rowIndex === 18
|| rowIndex === 21) {
return {
rowspan: 2,
colspan: 1,
};
}
else if (rowIndex === 3
|| rowIndex === 9|| rowIndex === 11|| rowIndex === 13|| rowIndex === 15
|| rowIndex === 17|| rowIndex === 19
|| rowIndex === 22) { // 检查是否为第四行
return {
rowspan: 0, // 不显示该单元格
colspan: 0,
};
}
}
};
const props = defineProps<{
visible: boolean;
dialogTitle: string;
formData: {
measured: string,
deviceLevel: string,
condition: string,
maxErrorValue: string
};
}>();
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'submit', data: any): void;
}>();
const handleCancel = () => {
emit('update:visible', false); // 关闭对话框
};
// 当 props.visible 改变时,更新 formData
watch(() => props.visible, (newVal) => {
if (!newVal) {
// 这里可以重置表单数据,如果需要的话
}
});
</script>
<style>
</style>

View File

@@ -1,386 +0,0 @@
<template>
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogBig">
<el-tabs type="border-card">
<el-tab-pane label="基础信息">
<div class="form-grid">
<el-form :model="formData" ref='formRuleRef' :rules='rules'>
<el-row :gutter="120" >
<el-col :span="9">
<el-form-item label="误差体系名称" prop="name">
<el-input v-model='formData.name' placeholder="标准号+年份+设备等级"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参照标准名称" prop="standard_Name">
<el-input v-model='formData.standard_Name'/>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="发布时间" prop="standard_Time">
<el-input v-model="formData.standard_Time" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="120" >
<el-col :span="9">
<el-form-item label="适用设备等级" prop="dev_Level">
<el-select v-model='formData.dev_Level' placeholder="请选择设备等级">
<el-option
v-for="item in dictStore.getDictData('errorLevel')"
:key="item.id"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="状态" prop="enable">
<el-select v-model='formData.enable' placeholder="请选择状态">
<el-option
v-for="item in dictStore.getDictData('status')"
:key="item.id"
:label="item.label"
:value="item.code"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
<div class="dialog-footer">
<el-button :icon='CirclePlus' type="primary" @click="openAddDialog">新增</el-button>
<el-button :icon='Delete' type="danger" plain :disabled='!multipleSelection.length' @click="deleteSelectedRows">批量删除</el-button>
</div>
<div class="table-container">
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" @selection-change="handleSelectionChange" >
<el-table-column type="selection" width="55" />
<el-table-column prop="id" label="序号" width="60" />
<el-table-column prop="type" label="电能质量检测指标类型" width="181">
<template #default="{ row }">
<el-select v-model="row.type" placeholder="选择指标类型">
<el-option v-for="option in typeList" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="起止范围" >
<el-table-column label="起始">
<template #default="{ row }">
<el-row type="flex">
<el-col :span="14">
<el-select v-model="row.startSelect" placeholder="选择起始值" style="width: 70px;">
<el-option v-for="option in errorStartOptions" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</el-col>
<el-col :span="10">
<el-input v-model= "row.startRange" style="width: 70px;"
/>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column label="结束">
<template #default="{ row }">
<el-row type="flex" >
<el-col :span="14">
<el-select v-model="row.endSelect" placeholder="选择结束值" style="width: 70px;">
<el-option v-for="option in errorEndOptions" :key="option.value" :label="option.label" :value="option.value"/>
</el-select>
</el-col>
<el-col :span="10">
<el-input v-model= "row.endRange" style="width: 70px;"/>
</el-col>
</el-row>
</template>
</el-table-column>
<el-table-column label="单位" width="115">
<template #default="{ row }">
<el-select v-model="row.unit" placeholder="选择单位">
<el-option
v-for="option in errorUnitOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="最大误差">
<el-table-column prop="maxErrorValue" label="最大误差值" width="100">
<template #default="{ row }">
<el-input v-model= "row.startRange" style="width: 70px;"/>
</template>
</el-table-column>
<el-table-column label="误差类型">
<template #default="{ row }">
<el-select v-model="row.errorType" placeholder="选择误差类型">
<el-option
v-for="option in errorTypeOptions"
:key="option.value"
:label="option.label"
:value="option.value"
/>
</el-select>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button type="primary" link :icon='CopyDocument' @click="copyRow(row)">复制</el-button>
<el-button type='primary' link :icon='Delete' @click="deleteRow(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<div >
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup name="ErrorSystemDialog">
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
import { useDictStore } from '@/stores/modules/dict'
const dictStore = useDictStore()
const props = defineProps<{
visible: boolean;
dialogTitle: string;
formData: {
id: string;//误差体系表Id
name: string;//误差体系名称
standard_Name:string;//参照标准名称
standard_Time:string;//标准推行时间
dev_Level:string;//使用设备等级
enable:number;//状态0-不启用 1-启用
state:number;//0-删除 1-正常
};
}>();
// 定义规则
const formRuleRef = ref<FormInstance>()
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
name: [{ required: true, message: '误差体系名称必填!', trigger: 'blur' }],
standard_Name: [{ required: true, message: '参照标准名称必填!', trigger: 'blur' }],
standard_Time: [{ required: true, message: '标准推行时间必填!', trigger: 'blur' }],
dev_Level:[{ required: true, message: '请选择一项设备等级', trigger: 'change' },],
enable:[{ required: true, message: '请选择一项状态', trigger: 'change '},]
});
let multipleSelection = ref<number[]>([])
const errorTypeOptions = [
{ label: '绝对值-标称值', value: 'type1' },
{ label: '相对值-I类', value: 'type2' },
{ label: '相对值-II类', value: 'type3' },
{ label: '绝对值-值类型', value: 'type4' },
];
const errorUnitOptions = [
{ label: '标称值', value: 'type1' },
{ label: '值', value: 'type2' },
{ label: '无', value: 'type3' },
];
const errorStartOptions = [
{ label: '>', value: 'type1' },
{ label: '>=', value: 'type2' },
{ label: '无', value: 'type3' },
];
const errorEndOptions = [
{ label: '<', value: 'type1' },
{ label: '<=', value: 'type2' },
{ label: '无', value: 'type3' },
];
const typeList = [
{ label: '电压', value: '电压' },
{ label: '频率', value: '频率' },
{ label: '电压三相不平衡度', value: '电压三相不平衡度' },
{ label: '电流三相不平衡度', value: '电流三相不平衡度' },
{ label: '电压波动', value: '电压波动' },
{ label: '短时闪变', value: '短时闪变' },
{ label: '谐波电压', value: '谐波电压' },
{ label: '谐波电流', value: '谐波电流' },
{ label: '谐波相角', value: '谐波相角' },
{ label: '谐波功率', value: '谐波功率' },
{ label: '间谐波电压', value: '间谐波电压' },
{ label: '间谐波电流', value: '间谐波电流' },
{ label: '功率', value: '功率' },
{ label: '电流', value: '电流' },
{ label: '暂态电压幅值', value: '暂态电压幅值' },
{ label: '暂态持续时间', value: '暂态持续时间' },
];
const tableData = ref([
{
id: 1,
type: '电压',
startSelect: 'type1',
startRange: '0.1',
endSelect: 'type2',
endRange: '1.5',
unit:'type1',
maxErrorValue:'0.001',
errorType:'type1'
},
{
id: 2,
type: '电流',
startSelect: 'type2',
startRange: '0.01',
endSelect: 'type1',
endRange: '0.05',
unit:'type1',
maxErrorValue:'0.005',
errorType:'type1'
},
{
id: 3,
type: '频率',
startSelect: 'type2',
startRange: '42.5',
endSelect: 'type2',
endRange: '57.5',
unit:'type1',
maxErrorValue:'0.01',
errorType:'type4'
},
])
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'submit', data: any): void;
}>();
const handleCancel = () => {
//重置表单内容
//取消表单校验状态
formRuleRef.value && formRuleRef.value.resetFields()
emit('update:visible', false); // 关闭对话框
};
const handleSubmit = () => {
//ElMessage.info('业务数据提交')
try {
formRuleRef.value?.validate((valid: boolean) => {
if (valid)
{
// 将表单数据转为json,发送到后端
let confirmFormData = JSON.parse(JSON.stringify(props.formData));
// console.log(confirmFormData)
emit('submit', props.formData); // 提交表单数据
emit('update:visible', false); // 提交后关闭对话框
}
else
{
ElMessage.error('表单验证失败!')
}
})
} catch (error) {
console.error('验证过程中发生错误', error)
}
};
// 当 props.visible 改变时,更新 formData
watch(() => props.visible, (newVal) => {
if (!newVal) {
// 这里可以重置表单数据,如果需要的话
}
});
//选中
// 处理选择变化
const handleSelectionChange = (selection: any[]) => {
multipleSelection.value = selection.map(row => row.id); // 更新选中的行
};
const openAddDialog = () => {
tableData.value.push({
id: tableData.value.length + 1,
type: '',
startSelect: '',
startRange: '',
endSelect: '',
endRange: '',
unit:'',
maxErrorValue:'',
errorType:''
});
};
const copyRow = (row: any) => {
tableData.value.push({ ...row, id: tableData.value.length + 1, });
};
const deleteRow = (row: { id: number; type: string; startSelect: string; startRange: string; endSelect: string; endRange: string; unit: string; maxErrorValue: string; errorType: string; }) => {
const index = tableData.value.indexOf(row);
if (index !== -1) {
tableData.value.splice(index, 1);
}
};
const deleteSelectedRows = () => {
tableData.value = tableData.value.filter(row => !multipleSelection.value.includes(row.id));
multipleSelection.value = []; // 清空已选择的行
};
</script>
<style scoped>
.form-grid {
display: flex;
flex-direction: row; /* 横向排列 */
flex-wrap: wrap; /* 允许换行 */
}
.form-grid .el-form-item {
flex: 1 1 30%; /* 控件宽度 */
margin-right: 20px; /* 控件间距 */
}
.form-grid .el-form-item:last-child {
margin-right: 0; /* 最后一个控件不需要右边距 */
}
.dialog-footer {
display: flex;
justify-content: flex-start;
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
}
.el-tabs {
margin-bottom: 20px; /* 添加底部边距 */
}
.el-table th, .el-table td {
text-align: center; /* 所有单元格文字居中 */
}
.table-container {
max-height: 400px; /* 根据需要调整高度 */
overflow-y: auto; /* 允许垂直滚动 */
overflow-x: hidden; /* 隐藏水平滚动条 */
}
</style>