样式调整
This commit is contained in:
@@ -44,113 +44,112 @@ const data = [
|
||||
deviceModel: "模拟式",
|
||||
},
|
||||
]
|
||||
|
||||
const plan_devicedata = [
|
||||
{
|
||||
id: '1', //装置序号ID
|
||||
name: '模拟装置1', //设备名称
|
||||
name: '240001', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '2', //装置序号ID
|
||||
name: '模拟装置2', //设备名称
|
||||
name: '240002', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '/', //检测结果
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'未检',//检测状态
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '3', //装置序号ID
|
||||
name: '模拟装置3', //设备名称
|
||||
name: '240003', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '/', //检测结果
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测中',//检测状态
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '4', //装置序号ID
|
||||
name: '模拟装置4', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
name: '240004', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 1, //复检次数
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '5', //装置序号ID
|
||||
name: '中电测试装置', //设备名称
|
||||
dev_Type: 'PMC-680M-22-22-00-115ANBC',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
name: '240005', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '有不合格项', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 1, //复检次数
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '6', //装置序号ID
|
||||
name: '易司拓测试装置1', //设备名称
|
||||
dev_Type: 'E703A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
name: '240006', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '有不合格项', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 1, //复检次数
|
||||
},
|
||||
{
|
||||
id: '7', //装置序号ID
|
||||
name: '易司拓测试装置2', //设备名称
|
||||
dev_Type: 'E703A',//设备类型
|
||||
name: '240007', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
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: '不合格', //检测结果
|
||||
name: '240008', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
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: '已生成', //报告状态
|
||||
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',//设备类型
|
||||
name: '240010', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
check_Result: '全部合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
@@ -158,59 +157,281 @@ const data = [
|
||||
},
|
||||
{
|
||||
id: '11', //装置序号ID
|
||||
name: '山大电力测试装置2', //设备名称
|
||||
dev_Type: 'SDL-3002C',//设备类型
|
||||
name: '240011', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
check_Result: '全部合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
document_State: '已归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 2, //复检次数
|
||||
reCheck_Num: 1, //复检次数
|
||||
},
|
||||
{
|
||||
id: '12', //装置序号ID
|
||||
name: '山大电力测试装置2', //设备名称
|
||||
dev_Type: 'SDL-3002C',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
name: '240012', //设备名称
|
||||
dev_Type: 'PQS882B4',//设备类型
|
||||
dev_Chns: 4, //设备通道数
|
||||
check_Result: '全部合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
document_State: '已归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 2, //复检次数
|
||||
},
|
||||
{
|
||||
id: '13', //装置序号ID
|
||||
name: '山大电力测试装置2', //设备名称
|
||||
dev_Type: 'SDL-3002C',//设备类型
|
||||
name: '240013', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 2, //复检次数
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '14', //装置序号ID
|
||||
name: '山大电力测试装置3', //设备名称
|
||||
dev_Type: 'SDL-3002C',//设备类型
|
||||
name: '240014', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 2, //复检次数
|
||||
check_State:'未检测',//检测状态
|
||||
reCheck_Num: 0, //复检次数
|
||||
},
|
||||
{
|
||||
id: '15', //装置序号ID
|
||||
name: '山大电力测试装置4', //设备名称
|
||||
dev_Type: 'SDL-3002C',//设备类型
|
||||
name: '240013', //设备名称
|
||||
dev_Type: 'PQS882A',//设备类型
|
||||
dev_Chns: 1, //设备通道数
|
||||
check_Result: '不合格', //检测结果
|
||||
report_State: '已生成', //报告状态
|
||||
check_Result: '未检测', //检测结果
|
||||
report_State: '未生成', //报告状态
|
||||
document_State: '未归档', //归档状态
|
||||
check_State:'检测完成',//检测状态
|
||||
reCheck_Num: 2, //复检次数
|
||||
check_State:'未检测',//检测状态
|
||||
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}
|
||||
@@ -1,41 +1,34 @@
|
||||
// 误差体系模块
|
||||
export namespace ErrorSystem {
|
||||
// 误差体系列表
|
||||
export interface ErrorSystemList {
|
||||
id: string;//误差体系表Id
|
||||
name: string;//误差体系名称
|
||||
standard_Name:string;//参照标准名称
|
||||
standard_Time:string;//标准推行时间
|
||||
dev_Level:string;//使用设备等级
|
||||
enable?:number;//状态:0-不启用 1-启用
|
||||
state:number;//0-删除 1-正常
|
||||
create_By?:string;//创建用户
|
||||
create_Time?:string;//创建时间
|
||||
update_By?:string;//修改用户
|
||||
update_Time?:string;//修改时间
|
||||
}
|
||||
import type { ErrorSystem } from '@/api/device/interface/error'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 误差体系管理模块
|
||||
*/
|
||||
|
||||
//获取误差体系
|
||||
export const getPqErrSysList = (params: ErrorSystem.ErrorSystemList) => {
|
||||
return http.post(`/pqErrSys/list`, params)
|
||||
}
|
||||
|
||||
//根据id查询误差体系
|
||||
export const getPqErrSysListById = (params: ErrorSystem.ErrorSystemList) => {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,46 @@
|
||||
import type { ReqPage } from "@/api/interface";
|
||||
|
||||
// 误差体系模块
|
||||
export namespace ErrorSystem {
|
||||
// 误差体系列表
|
||||
export interface ErrorSystemList {
|
||||
id: string;//误差体系表Id
|
||||
name: string;//误差体系名称
|
||||
standard_Name:string;//参照标准名称
|
||||
standard_Time:string;//标准推行时间
|
||||
dev_Level:string;//使用设备等级
|
||||
enable?:number;//状态:0-不启用 1-启用
|
||||
state:number;//0-删除 1-正常
|
||||
create_By?:string;//创建用户
|
||||
create_Time?:string;//创建时间
|
||||
update_By?:string;//修改用户
|
||||
update_Time?:string;//修改时间
|
||||
|
||||
// 误差体系列表
|
||||
export interface ErrorSystemList {
|
||||
id: string;//误差体系表Id
|
||||
name: string;//误差体系名称
|
||||
standardName:string;//参照标准名称
|
||||
standardTime:string;//标准推行时间
|
||||
devLevel:string;//使用设备等级
|
||||
enable:number;//状态:0-不启用 1-启用
|
||||
state:number;//0-删除 1-正常
|
||||
createBy?:string;//创建用户
|
||||
createTime?:string;//创建时间
|
||||
updateBy?:string;//修改用户
|
||||
updateTime?:string;//修改时间
|
||||
pqErrSysDtlsList?: ErrorSystemDetail[];//误差体系子表列表
|
||||
}
|
||||
|
||||
|
||||
// 查看详细误差体系
|
||||
export interface ErrorSystemDetail {
|
||||
nextId: number;
|
||||
id:string;//误差体系子表ID
|
||||
errorSysId:string;//所属误差体系ID
|
||||
type: string;//检测脚本类型,树形字典表(没有树形表则需要拆分字段)
|
||||
startValue?:number;//误差判断起始值(误差范围)
|
||||
startFlag?:number;//是否包含起始值
|
||||
endValue?:number;//;误差判断结束值(误差范围)
|
||||
endFlag?:number;//是否包含结束值
|
||||
conditionType?:string;//判断条件值类型(包括值类型,绝对值、相对值)
|
||||
maxErrorValue:number;//误差最大值
|
||||
errorValueType:string;//误差值类型(包括值类型,绝对值、相对值1、相对值2)
|
||||
}
|
||||
|
||||
|
||||
// 查看详细误差体系
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 查看详细误差体系
|
||||
// export interface Error_detail {
|
||||
// measured: string;
|
||||
// deviceLevel: string;
|
||||
// measurementType:string;
|
||||
// condition: string;
|
||||
// maxErrorValue: string;
|
||||
// }
|
||||
}
|
||||
@@ -5,7 +5,7 @@ export namespace TestScript {
|
||||
|
||||
|
||||
/**
|
||||
* 电能质量指标字典数据表格分页查询参数
|
||||
* 检测脚本表格分页查询参数
|
||||
*/
|
||||
export interface ReqTestScriptParams extends ReqPage{
|
||||
id: string; // 装置序号id 必填
|
||||
@@ -30,9 +30,9 @@ export namespace TestScript {
|
||||
}
|
||||
|
||||
/**
|
||||
* 被检设备表格查询分页返回的对象;
|
||||
* 检测脚本查询分页返回的对象;
|
||||
*/
|
||||
export interface ResPqDevPage extends ResPage<ResTestScript> {
|
||||
export interface ResTestScriptPage extends ResPage<ResTestScript> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,35 @@
|
||||
import type { ReqPage } from '@/api/interface'
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
// 检测源模块
|
||||
export namespace TestSource {
|
||||
|
||||
/**
|
||||
* 检测脚本表格分页查询参数
|
||||
*/
|
||||
export interface ReqTestSourceParams extends ReqPage{
|
||||
id: string; // 装置序号id 必填
|
||||
name: string;
|
||||
pattern: string;
|
||||
}
|
||||
|
||||
// 检测源接口
|
||||
export interface TestSourceBO {
|
||||
id?: string; //检测源ID
|
||||
name: string; //检测源名称
|
||||
export interface ResTestSource {
|
||||
id: string; //检测源ID
|
||||
name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
||||
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
||||
type: 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> {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,27 @@ import http from '@/api'
|
||||
/**
|
||||
* @name 检测源管理模块
|
||||
*/
|
||||
// 获取检测脚本列表
|
||||
// 获取检测源列表
|
||||
export const getTestSourceList = (params: TestSource.ReqTestSourceParams) => {
|
||||
return http.post<ResPage<TestSource.TestSourceBO>>(`/testSource/list`, params)
|
||||
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/testSource/list`, params)
|
||||
return http.post(`/pqSource/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)
|
||||
}
|
||||
|
||||
@@ -98,8 +98,18 @@ const init = () => {
|
||||
chart.value.resize();
|
||||
}, 0);
|
||||
};
|
||||
const reSize = (widthValue: number,heightValue: number,silentValue: boolean) => {
|
||||
if (chart.value) {
|
||||
chart.value.resize({
|
||||
width: widthValue,
|
||||
height: heightValue,
|
||||
silent: silentValue,
|
||||
});
|
||||
}
|
||||
};
|
||||
const resizeCharts = () => {
|
||||
|
||||
console.log(chart.value,111111);
|
||||
|
||||
if (chart.value) {
|
||||
chart.value.resize();
|
||||
}
|
||||
@@ -128,7 +138,7 @@ watch(
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
defineExpose({ init });
|
||||
defineExpose({ init,reSize });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.pie {
|
||||
|
||||
@@ -124,19 +124,20 @@
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Function.ResFunction> = {}) => {
|
||||
resourcePopup.value?.open(titleType, row)
|
||||
|
||||
}
|
||||
|
||||
// 删除用户信息
|
||||
// 删除菜单信息
|
||||
const handleDelete = async (params: Function.ResFunction) => {
|
||||
await useHandleData(deleteFunction, params , `删除【${params.name}】用户`)
|
||||
proTable.value?.getTableList()
|
||||
await useHandleData(deleteFunction, params , `删除【${params.name}】菜单`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 批量删除用户信息
|
||||
// 批量删除菜单信息
|
||||
const batchDelete = async (id: string[]) => {
|
||||
await useHandleData(deleteFunction, { id }, '删除所选用户信息')
|
||||
await useHandleData(deleteFunction, { id }, '删除所选菜单信息')
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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-title">
|
||||
<el-form :model='formContent'>
|
||||
@@ -32,7 +32,6 @@
|
||||
:disabled = "plan.label === errorSysName"
|
||||
>
|
||||
</el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -305,8 +304,7 @@ const props = defineProps<{
|
||||
//clearInterval(timer.value);
|
||||
activeIndex.value = 0;
|
||||
tableData.value.length = 0;
|
||||
tableData.value = operatorTableData.value;
|
||||
|
||||
tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
|
||||
};
|
||||
|
||||
const openReportDlg = () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="table_info">
|
||||
<!-- :request-api="getTableList" -->
|
||||
<!-- :request-api="getTableList" -->
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
:columns="columns"
|
||||
@@ -18,9 +18,9 @@
|
||||
<template #tableHeader="scope">
|
||||
<el-form :model="form" label-width="80px" :inline="true">
|
||||
<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 label="检测状态">
|
||||
<el-form-item label="检测状态" v-if="form.activeTabs != 3 && form.activeTabs != 5">
|
||||
<el-select v-model="form.checkStatus" clearable>
|
||||
<el-option
|
||||
v-for="(item, index) in checkStatusList"
|
||||
@@ -31,17 +31,6 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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-select v-model="form.checkResult" clearable>
|
||||
<el-option
|
||||
@@ -53,10 +42,35 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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-button type="primary" :icon="Search" @click="handleSearch"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button :icon="Delete" @click="handleRefresh"
|
||||
>重置</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Clock"
|
||||
@@ -78,10 +92,13 @@
|
||||
>全部复检</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 type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4"
|
||||
>批量归档</el-button
|
||||
>
|
||||
@@ -100,8 +117,8 @@
|
||||
>
|
||||
<div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0">
|
||||
<el-dropdown trigger='click'>
|
||||
<el-button link type='primary' :icon="View" class='table-operate'>
|
||||
<div class='table-operate-text'>查看</div>
|
||||
<el-button link type='primary' :icon="Download" class='table-operate'>
|
||||
<div class='table-operate-text'>下载</div>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
@@ -134,7 +151,7 @@
|
||||
link
|
||||
:icon="Notebook"
|
||||
@click="openDrawer('归档', scope.row)"
|
||||
v-if="form.activeTabs === 4"
|
||||
v-if="form.activeTabs === 0"
|
||||
>归档</el-button
|
||||
>
|
||||
<el-button
|
||||
@@ -201,7 +218,7 @@ import { ElMessage, ElMessageBox, ElLoading} from "element-plus";
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
|
||||
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";
|
||||
import { getPlanList } from "@/api/plan/planList";
|
||||
import deviceDataList from '@/api/device/device/deviceData'
|
||||
@@ -209,7 +226,7 @@ import testPopup from "./testPopup.vue";
|
||||
import reportPopup from "./reportPopup.vue";
|
||||
import dataCheckPopup from "./dataCheckPopup.vue";
|
||||
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
||||
import { isVisible } from "element-plus/es/utils";
|
||||
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
const tableKey = ref(0);
|
||||
@@ -234,9 +251,12 @@ const dialogForm = ref<any>({
|
||||
});
|
||||
//console.log(window.innerHeight, "+++++++++");
|
||||
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 operationMinWidth = ref(200);
|
||||
|
||||
//下拉框数据
|
||||
//检测状态数据
|
||||
let checkStatusList = reactive([
|
||||
@@ -263,31 +283,36 @@ let checkStatusList = reactive([
|
||||
]);
|
||||
//检测报告状态数据
|
||||
let checkReportStatusList = reactive([
|
||||
{
|
||||
label: "未生成报告",
|
||||
{
|
||||
label: "未检测",
|
||||
value: 0,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: "已生成报告",
|
||||
label: "未生成",
|
||||
value: 1,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: "已生成",
|
||||
value: 2,
|
||||
disabled: false,
|
||||
},
|
||||
]);
|
||||
//检测结果数组
|
||||
let checkResultList = reactive([
|
||||
{
|
||||
label: "未出结果",
|
||||
label: "未检测",
|
||||
value: 0,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: "不合格",
|
||||
label: "有不合格项",
|
||||
value: 1,
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
label: "合格",
|
||||
label: "全部合格",
|
||||
value: 2,
|
||||
disabled: false,
|
||||
},
|
||||
@@ -350,10 +375,11 @@ let checkResultList = reactive([
|
||||
//查询条件
|
||||
const form: any = ref({
|
||||
activeTabs: 0, //功能选择
|
||||
search: "",//搜索内容
|
||||
activeChildTabs: 0,//子功能选择
|
||||
checkStatus: 0, //检测状态
|
||||
checkReportStatus: 0, //检测报告状态
|
||||
checkResult: 0, //检测结果
|
||||
checkStatus: null, //检测状态
|
||||
checkResult: null, //检测结果
|
||||
checkReportStatus: null, //检测报告状态
|
||||
deviceBindStatus: 0, //绑定状态
|
||||
deviceType: 0, //设备类型
|
||||
manufacturer: 0, //制造厂商
|
||||
@@ -416,8 +442,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'report_State',
|
||||
label: '报告状态',
|
||||
prop: 'check_State',
|
||||
label: '检测状态',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
@@ -426,8 +452,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
prop: 'check_State',
|
||||
label: '检测状态',
|
||||
prop: 'report_State',
|
||||
label: '报告状态',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
@@ -599,17 +625,51 @@ const resetSearchForm = () => {
|
||||
checkResult: 0,
|
||||
};
|
||||
};
|
||||
let testType = "test";//检测还是复检
|
||||
const handleSelectionChange = (selection: any[]) => {
|
||||
|
||||
const result = selection.filter((item) => item.check_Result != "有不合格项")
|
||||
if(result.length > 0)
|
||||
{
|
||||
testType= "test";
|
||||
}
|
||||
else
|
||||
{
|
||||
testType= "reTest";
|
||||
}
|
||||
console.log(selection);
|
||||
}
|
||||
|
||||
//查询
|
||||
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();
|
||||
};
|
||||
//重置
|
||||
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 = ({
|
||||
@@ -661,75 +721,77 @@ const changeStatus = async (row: User.ResUserList) => {
|
||||
proTable.value?.getTableList();
|
||||
};
|
||||
//顶部功能切换时修改activeTabs
|
||||
const changeActiveTabs = (val: number,val2: number) => {
|
||||
const changeActiveTabs = (val: number,val2: number,tabledata:any[]) => {
|
||||
form.value.activeTabs = val;
|
||||
form.value.activeChildTabs= val2;
|
||||
deviceData.value = tabledata;
|
||||
tableHeaderInit(val)
|
||||
console.log(form,val,val2,666)
|
||||
|
||||
};
|
||||
|
||||
//根据当前功能,初始化表头下拉框中的默认值和禁用值
|
||||
function tableHeaderInit(val: number) {
|
||||
refreshStatusList()
|
||||
|
||||
switch (val) {
|
||||
case 0://自动检测
|
||||
case 0://设备检测
|
||||
case 1://手动检测
|
||||
form.value.checkStatus = 0;//检测状态默认为未检
|
||||
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;
|
||||
case 2://设备复检
|
||||
form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
|
||||
form.value.checkResult = 1;//检测结果默认为不合格
|
||||
disableCheckStatus("未检测")
|
||||
disableCheckStatus("检测中")
|
||||
disableCheckStatus("归档")
|
||||
disablecheckResultList("未出结果")
|
||||
operationShow.value = false;
|
||||
// form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
// form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
|
||||
// form.value.checkResult = 1;//检测结果默认为不合格
|
||||
// disableCheckStatus("未检测")
|
||||
// disableCheckStatus("检测中")
|
||||
// disableCheckStatus("归档")
|
||||
// disablecheckResultList("未出结果")
|
||||
// operationShow.value = false;
|
||||
break;
|
||||
case 3://报告生成
|
||||
form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
|
||||
form.value.checkResult = 2;//检测结果默认为合格
|
||||
disableCheckStatus("未检测")
|
||||
disableCheckStatus("检测中")
|
||||
disableCheckStatus("归档")
|
||||
disablecheckResultList("未出结果")
|
||||
// form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
// form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
|
||||
// form.value.checkResult = 2;//检测结果默认为合格
|
||||
// disableCheckStatus("未检测")
|
||||
// disableCheckStatus("检测中")
|
||||
// disableCheckStatus("归档")
|
||||
disablecheckResultList("未检测")
|
||||
disableCheckReportStatus("未检测")
|
||||
columns[columns.length - 1].minWidth = 150;
|
||||
tableKey.value += 1;
|
||||
operationShow.value = true;
|
||||
break;
|
||||
case 4://设备归档
|
||||
form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
form.value.checkReportStatus = 1;//检测报告状态默认为已生成报告
|
||||
form.value.checkResult = 2;//检测结果默认为合格
|
||||
disableCheckStatus("未检测")
|
||||
disableCheckStatus("检测中")
|
||||
disableCheckStatus("归档")
|
||||
// form.value.checkStatus = 2;//检测状态默认为检测完成
|
||||
// form.value.checkReportStatus = 1;//检测报告状态默认为已生成报告
|
||||
// form.value.checkResult = 2;//检测结果默认为合格
|
||||
// disableCheckStatus("未检测")
|
||||
// disableCheckStatus("检测中")
|
||||
// disableCheckStatus("归档")
|
||||
disableCheckReportStatus("未生成报告")
|
||||
disablecheckResultList("未出结果")
|
||||
|
||||
columns[columns.length - 1].minWidth = 100;
|
||||
|
||||
tableKey.value ++;
|
||||
operationShow.value = true;
|
||||
break;
|
||||
case 5://数据查询
|
||||
|
||||
disablecheckResultList("未检测")
|
||||
disableCheckReportStatus("未检测")
|
||||
columns[columns.length - 1].minWidth = 250;
|
||||
tableKey.value += 1;
|
||||
|
||||
operationShow.value = true;
|
||||
break;
|
||||
}
|
||||
console.log("test",columns);
|
||||
|
||||
}
|
||||
|
||||
tableHeaderInit(0)
|
||||
function refreshStatusList(){
|
||||
checkStatusList.map((item: any, index: any) => {
|
||||
if (item.disabled) {
|
||||
@@ -746,6 +808,10 @@ function refreshStatusList(){
|
||||
item.disabled = false;
|
||||
}
|
||||
});
|
||||
|
||||
form.value.checkStatus = null;//检测状态默认为未检
|
||||
form.value.checkReportStatus = null;//检测报告状态默认为未生成报告
|
||||
form.value.checkResult = null;//检测结果默认为未出结果
|
||||
}
|
||||
|
||||
function disableCheckStatus(val: string){
|
||||
@@ -775,9 +841,41 @@ const handleTest = (val:string) => {
|
||||
|
||||
if(val==='手动检测'||val==='自动检测'||val==='不合格项复检'||val==='全部复检' )
|
||||
{
|
||||
ElMessage.success(val);
|
||||
if(testType === "reTest")
|
||||
{
|
||||
ElMessageBox.confirm(
|
||||
'请选择复检检测方式',
|
||||
'设备复检',
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '不合格项复检',
|
||||
cancelButtonText: '全部复检',
|
||||
type: 'warning',
|
||||
},
|
||||
)
|
||||
.then(() => {
|
||||
ElMessage.success(val);
|
||||
dialogTitle.value = val;
|
||||
dialogFormVisible.value = true; // 打开对话框
|
||||
})
|
||||
// .catch((action: Action) => {
|
||||
// ElMessage({
|
||||
// type: 'info',
|
||||
// message:
|
||||
// action === 'cancel'
|
||||
// ? '以当前数据为主完成数据覆盖'
|
||||
// : '取消本次导入操作',
|
||||
// })
|
||||
// })
|
||||
}
|
||||
else
|
||||
{
|
||||
ElMessage.success(val);
|
||||
dialogTitle.value = val;
|
||||
dialogFormVisible.value = true; // 打开对话框
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(val==='批量生成')
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<div >
|
||||
<el-collapse model-value="1" accordion>
|
||||
<el-collapse model-value="0" accordion>
|
||||
<el-collapse-item title="检测日志:" name="1">
|
||||
<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)'}">
|
||||
@@ -451,22 +451,19 @@ function traverseTableData(data: any[],id: string): void {
|
||||
}
|
||||
|
||||
const updateTableData = (id: string) => {
|
||||
|
||||
traverseTableData(tableData.value,id);
|
||||
console.log(id)
|
||||
};
|
||||
|
||||
const handleReCheck = () => {
|
||||
|
||||
console.log(tableData.value,operatorTableData.value)
|
||||
activeIndex.value = 0;
|
||||
percentage.value = 0;
|
||||
tableData.value.length = 0;
|
||||
testLogList.value.length = 0;
|
||||
tableData.value = operatorTableData.value;
|
||||
console.log(tableData.value,operatorTableData.value)
|
||||
|
||||
resumeTimer()
|
||||
console.log(tableData.value,operatorTableData.value)
|
||||
tableData.value = JSON.parse(JSON.stringify(operatorTableData.value));
|
||||
resumeTimer()
|
||||
};
|
||||
let timer: any = ref("");
|
||||
const handlePauseTest = () => {
|
||||
@@ -1849,7 +1846,8 @@ const startTimer = () => {
|
||||
} else {
|
||||
percentage.value = 100;
|
||||
clearInterval(timer.value)
|
||||
|
||||
timer.value = null;
|
||||
|
||||
ts.value = 'success'
|
||||
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
|
||||
// if you want to disable its autofocus
|
||||
@@ -1863,6 +1861,7 @@ const startTimer = () => {
|
||||
else
|
||||
{
|
||||
clearInterval(timer.value)
|
||||
timer.value = null;
|
||||
ts.value = 'success'
|
||||
}
|
||||
|
||||
@@ -1878,6 +1877,7 @@ const pauseTimer = () => {
|
||||
|
||||
const resumeTimer = () => {
|
||||
if (timer.value === null) {
|
||||
console.log('startTimer')
|
||||
startTimer();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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">
|
||||
<!-- simple -->
|
||||
@@ -193,26 +193,41 @@ const getIcon = (index: number) => {
|
||||
TestStatus.value = "waiting"
|
||||
nextStepText.value = "下一步"
|
||||
}
|
||||
const beforeClose = (done: () => void) => {
|
||||
console.log(stepsActiveIndex.value,stepsTotalNum.value)
|
||||
if(stepsActiveIndex.value < stepsTotalNum.value)
|
||||
{
|
||||
ElMessageBox.confirm(
|
||||
'检测未完成,是否退出当前检测流程?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
clearData()
|
||||
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 = () => {
|
||||
// if(stepsActiveIndex.value < stepsTotalNum.value)
|
||||
// {
|
||||
// ElMessageBox.confirm(
|
||||
// '是否退出当前检测流程?',
|
||||
// '提示',
|
||||
// {
|
||||
// confirmButtonText: '确定',
|
||||
// cancelButtonText: '取消',
|
||||
// type: 'warning',
|
||||
// }
|
||||
// )
|
||||
// .then(() => {
|
||||
// // clearData()
|
||||
// // emit('update:visible', false); // 关闭对话框
|
||||
//
|
||||
// })
|
||||
// }
|
||||
clearData()
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
// clearData()
|
||||
// emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
<!-- <el-collapse v-model="activeNames" @change="handleChange">
|
||||
<el-collapse-item title="检测进度展示" name="1"> -->
|
||||
<!-- <div class="dialog-log">
|
||||
<el-collapse model-value="1" accordion>
|
||||
<el-collapse-item title="检测进度展示:" name="1"> -->
|
||||
<div class="container_pieShow">
|
||||
<el-collapse model-value="1" accordion @change="handleCollapseChange">
|
||||
<el-collapse-item title="    检测进度展示:" name="1">
|
||||
<!-- 饼图 -->
|
||||
<div class="container_charts">
|
||||
<div class="charts_info">
|
||||
@@ -81,27 +81,25 @@
|
||||
></pie>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </el-collapse-item>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div> -->
|
||||
|
||||
<el-tabs type="border-card" @tab-change="handleTabsChange" v-model="editableTabsValue">
|
||||
<el-tab-pane :label="tabLabel1">
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table">
|
||||
<Table ref="tableRef1"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="已检设备" v-if="tabShow">
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table">
|
||||
<Table ref="tableRef2"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</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 }">
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table" :style="{ height: tableHeight }">
|
||||
<Table ref="tableRef1"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="已检设备" v-if="tabShow" :style="{ height: tabPaneHeight }">
|
||||
<!-- 列表数据 -->
|
||||
<div class="container_table" :style="{ height: tableHeight }">
|
||||
<Table ref="tableRef2"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -112,6 +110,9 @@ import { useRouter } from "vue-router";
|
||||
import tree from "../components/tree.vue";
|
||||
import Table from "../components/table.vue";
|
||||
import { data } from "@/api/plan/static.json";
|
||||
import deviceDataList from '@/api/device/device/deviceData'
|
||||
|
||||
const deviceData = deviceDataList.plan_devicedata
|
||||
const treeRef = ref();
|
||||
const form: any = ref({
|
||||
activeTabs: 0, //功能选择,例如报告生成
|
||||
@@ -128,10 +129,26 @@ const activeNames = ref(['2'])
|
||||
const tabShow= ref(false);
|
||||
const tabLabel1 = ref('设备检测')
|
||||
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[]) => {
|
||||
// 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) => {
|
||||
form.value.activeTabs = 0;
|
||||
form.value.activeTabs = 3;
|
||||
@@ -148,12 +165,12 @@ const tabsList = ref([
|
||||
img: "/src/assets/images/plan/static/1.svg",
|
||||
checked: true,
|
||||
},
|
||||
{
|
||||
label: "设备复检",
|
||||
value: 2,
|
||||
img: "/src/assets/images/plan/static/2.svg",
|
||||
checked: false,
|
||||
},
|
||||
// {
|
||||
// label: "设备复检",
|
||||
// value: 2,
|
||||
// img: "/src/assets/images/plan/static/2.svg",
|
||||
// checked: false,
|
||||
// },
|
||||
{
|
||||
label: "报告生成",
|
||||
value: 3,
|
||||
@@ -166,59 +183,36 @@ const tabsList = ref([
|
||||
img: "/src/assets/images/plan/static/5.svg",
|
||||
checked: false,
|
||||
},
|
||||
{
|
||||
label: "设备归档",
|
||||
value: 4,
|
||||
img: "/src/assets/images/plan/static/4.svg",
|
||||
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: "设备归档",
|
||||
// value: 4,
|
||||
// img: "/src/assets/images/plan/static/4.svg",
|
||||
// checked: false,
|
||||
// },
|
||||
// {
|
||||
// label: "设备浏览",
|
||||
// value: 5,
|
||||
// img: "/src/assets/images/plan/static/5.svg",
|
||||
// checked: false,
|
||||
// },
|
||||
// ]);
|
||||
|
||||
form.value.activeTabs = tabsList.value[0].value;
|
||||
const tableRef1 = ref();
|
||||
const tableRef2 = ref();
|
||||
|
||||
|
||||
watch(
|
||||
() => form.value,
|
||||
(val, oldVal) => {
|
||||
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 = [
|
||||
{ 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: '#91cc75' } },
|
||||
];
|
||||
// pieRef2.value.init();
|
||||
chartsData3.value = [
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "已生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "未生成报告" },
|
||||
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "有不合格项未生成报告" },
|
||||
{ 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: '#ee6666' } },
|
||||
{ value: Math.floor(Math.random() * 100) + 1, name: "已生成", itemStyle: { color: '#91cc75' } },
|
||||
|
||||
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "未检测" , itemStyle: { color: '#fac858' } },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项未生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格未生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项已生成报告" },
|
||||
// { value: Math.floor(Math.random() * 100) + 1, name: "全部合格已生成报告" },
|
||||
];
|
||||
// pieRef3.value.init();
|
||||
pieRef1.value.init();
|
||||
pieRef2.value.init();
|
||||
pieRef3.value.init();
|
||||
pieRef1.value.reSize(470,145,true);
|
||||
pieRef2.value.reSize(470,145,true);
|
||||
pieRef3.value.reSize(470,145,true);
|
||||
};
|
||||
const getTree = () => {
|
||||
treeRef.value.getTreeData(data);
|
||||
@@ -308,7 +313,7 @@ const handleCheckFunction = (val: any) => {
|
||||
});
|
||||
|
||||
tabShow.value = false;
|
||||
console.log("test",val,tabLabel1.value);
|
||||
|
||||
switch (val) {
|
||||
case 0://自动检测
|
||||
tabLabel1.value = "设备检测";
|
||||
@@ -330,7 +335,7 @@ const handleCheckFunction = (val: any) => {
|
||||
tabLabel1.value = "数据查询";
|
||||
break;
|
||||
}
|
||||
console.log("test",val,tabLabel1.value);
|
||||
|
||||
form.value.activeTabs = val;
|
||||
};
|
||||
|
||||
@@ -367,14 +372,13 @@ onMounted(() => {
|
||||
//align-items: center;
|
||||
//box-sizing: border-box;
|
||||
|
||||
|
||||
.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;
|
||||
@@ -384,27 +388,27 @@ onMounted(() => {
|
||||
.function_item {
|
||||
flex: none;
|
||||
width: 6%;
|
||||
height: 40px;
|
||||
height: 70px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
cursor: pointer;
|
||||
background-color: #607eab;
|
||||
border-radius: 8px;
|
||||
padding: 0px 30px;
|
||||
|
||||
.item_img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
// background-color: #607eab;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 5px;
|
||||
|
||||
img {
|
||||
width: 20px;
|
||||
width: 40px;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
@@ -421,7 +425,6 @@ onMounted(() => {
|
||||
|
||||
.item_text {
|
||||
p {
|
||||
width: 80px;
|
||||
margin: 0;
|
||||
font-weight: 800;
|
||||
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;
|
||||
min-height: 200px !important;
|
||||
//min-height: 200px !important;
|
||||
height:auto;
|
||||
background-color: #eee;
|
||||
// display: flex;
|
||||
@@ -461,26 +544,26 @@ onMounted(() => {
|
||||
.el-collapse {
|
||||
width: 100% !important;
|
||||
// min-height: 200px !important;
|
||||
height:auto;
|
||||
height:100% !important;
|
||||
background-color: #eee;
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// padding-left: 2ch;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
// margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-collapse-item{
|
||||
width: 100% !important;
|
||||
.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%;
|
||||
//min-height: 180px !important;
|
||||
height:90%;
|
||||
background-color: #eee;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -500,10 +583,14 @@ onMounted(() => {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tabs-menu{
|
||||
height: 100%;
|
||||
}
|
||||
.container_table {
|
||||
// width: 100%;
|
||||
flex: 1 !important;
|
||||
height: calc(100vh - 360px - 147px);
|
||||
height: calc(100vh - 360px - 180px);
|
||||
//height: 100% !important;
|
||||
border-radius: 4px;
|
||||
width: 100% !important;
|
||||
// display: none;
|
||||
|
||||
@@ -319,8 +319,14 @@ const disabledDate = (time: Date) => {
|
||||
manufacturer: [{ required: true, message: '生产厂家必选!', trigger: 'change' }],
|
||||
encryptionFlag: [{ required: true, message: '是否加密必选!', trigger: 'change' }],
|
||||
protocol: [{ required: true, message: '通讯协议必选!', trigger: 'change' }],
|
||||
series: [],
|
||||
devKey: []
|
||||
// series: [],
|
||||
// devKey: []
|
||||
series : [
|
||||
{ required: true, message: '请输入识别码', trigger: 'blur' }
|
||||
],
|
||||
devKey : [
|
||||
{ required: true, message: '请输入密钥', trigger: 'blur' }
|
||||
],
|
||||
})
|
||||
|
||||
// 关闭弹窗
|
||||
@@ -335,7 +341,7 @@ const disabledDate = (time: Date) => {
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
try {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
|
||||
if (formContent.value.encryptionFlag === 1) {
|
||||
@@ -353,7 +359,17 @@ const disabledDate = (time: Date) => {
|
||||
if (formContent.value.id) {
|
||||
await updatePqDev(formContent.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);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
|
||||
@@ -373,8 +389,6 @@ const disabledDate = (time: Date) => {
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
mode.value = currentMode
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
@@ -397,30 +411,23 @@ const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
resetFormContent()
|
||||
handleEncryptionChange(1)
|
||||
}
|
||||
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
}
|
||||
const handleEncryptionChange = (value: number) => {
|
||||
// 根据是否加密来显示或隐藏识别码和密钥
|
||||
|
||||
if(value === 1){
|
||||
IsPasswordShow.value = true
|
||||
rules.value.series = [
|
||||
{ required: true, message: '请输入识别码', trigger: 'blur' }
|
||||
];
|
||||
rules.value.devKey = [
|
||||
{ required: true, message: '请输入密钥', trigger: 'blur' }
|
||||
];
|
||||
|
||||
}else
|
||||
{
|
||||
IsPasswordShow.value = false
|
||||
formContent.value.series = ''
|
||||
formContent.value.devKey = ''
|
||||
rules.value.series = [];
|
||||
rules.value.devKey = [];
|
||||
IsPasswordShow.value = false
|
||||
// formContent.value.series = ''
|
||||
// formContent.value.devKey = ''
|
||||
// rules.value.series = [];
|
||||
// rules.value.devKey = [];
|
||||
}
|
||||
|
||||
// 如果选择"是",则显示;否则隐藏
|
||||
dialogFormRef.value?.clearValidate(); // 清除验证状态
|
||||
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
|
||||
@@ -29,9 +29,8 @@
|
||||
import { getPqMonList } from '@/api/device/monitor'
|
||||
import { type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { type Monitor } from '@/api/device/interface/monitor'
|
||||
const props = defineProps({
|
||||
MonIsShow: Boolean,
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// 表格配置项
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user