This commit is contained in:
sjl
2024-12-11 19:39:16 +08:00
12 changed files with 340 additions and 225 deletions

View File

@@ -50,10 +50,10 @@ const data = [
name: '240001', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -61,10 +61,10 @@ const data = [
name: '240002', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -72,10 +72,10 @@ const data = [
name: '240003', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -83,10 +83,10 @@ const data = [
name: '240004', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -94,7 +94,7 @@ const data = [
name: '240005', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '不合', //检测结果
check_Result: '不合', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -105,7 +105,7 @@ const data = [
name: '240006', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '不合', //检测结果
check_Result: '不合', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -116,7 +116,7 @@ const data = [
name: '240007', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '合', //检测结果
check_Result: '合', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -127,7 +127,7 @@ const data = [
name: '240008', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '合', //检测结果
check_Result: '合', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -138,7 +138,7 @@ const data = [
name: '240009', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '不合', //检测结果
check_Result: '不合', //检测结果
report_State: '已生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -149,7 +149,7 @@ const data = [
name: '240010', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '合', //检测结果
check_Result: '合', //检测结果
report_State: '已生成', //报告状态
document_State: '未归档', //归档状态
check_State:'检测完成',//检测状态
@@ -160,7 +160,7 @@ const data = [
name: '240011', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '合', //检测结果
check_Result: '合', //检测结果
report_State: '已生成', //报告状态
document_State: '已归档', //归档状态
check_State:'检测完成',//检测状态
@@ -171,7 +171,7 @@ const data = [
name: '240012', //设备名称
dev_Type: 'PQS-882B4',//设备类型
dev_Chns: 4, //设备通道数
check_Result: '合', //检测结果
check_Result: '合', //检测结果
report_State: '已生成', //报告状态
document_State: '已归档', //归档状态
check_State:'检测完成',//检测状态
@@ -182,10 +182,10 @@ const data = [
name: '240013', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -193,32 +193,32 @@ const data = [
name: '240014', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '15', //装置序号ID
name: '240013', //设备名称
name: '240015', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
id: '16', //装置序号ID
name: '240014', //设备名称
name: '240016', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -226,10 +226,10 @@ const data = [
name: '240017', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -237,10 +237,10 @@ const data = [
name: '240018', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -248,10 +248,10 @@ const data = [
name: '240019', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
{
@@ -259,10 +259,10 @@ const data = [
name: '240020', //设备名称
dev_Type: 'PQS-882A',//设备类型
dev_Chns: 1, //设备通道数
check_Result: '未检', //检测结果
check_Result: '未检', //检测结果
report_State: '未生成', //报告状态
document_State: '未归档', //归档状态
check_State:'未检',//检测状态
check_State:'未检',//检测状态
reCheck_Num: 0, //复检次数
},
]

View File

@@ -2,7 +2,7 @@
"code": "200",
"data": [
{
"name": "未检",
"name": "未检",
"children": [
{
"id": 4,

View File

@@ -268,8 +268,8 @@ import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingl
const qualified = ref(0)
const reportDisabled = ref(true)
const reportDialogVisible = ref(false)
const deviceName = ref('被检设备1');
const error_Sys_Id = ref('2');
const deviceName = ref('240001');
const error_Sys_Id = ref('1');
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
const errorSysName = ref('Q/GDW 10650.2 - 2021');
const dataRule = ref('所有值');

View File

@@ -9,7 +9,7 @@
<el-form-item label="误差体系">
<el-input v-model='errorSysName' :disabled="true" />
</el-form-item>
<el-form-item label="数据处理原则">
<el-form-item label="数据原则">
<el-input v-model='dataRule' :disabled="true" />
</el-form-item>
<el-form-item label="设备名称">
@@ -102,7 +102,7 @@ import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
const formContent = ref({})
const activeName = ref('rawDataTab')
const deviceName = ref('被检设备1');
const deviceName = ref('240001');
const monitorIdx = ref('1');
const reCheckIdx = ref('3');
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');

View File

@@ -21,7 +21,7 @@
<el-form-item label="关键字">
<el-input v-model="form.search" placeholder="请输入设备名称、类型"></el-input>
</el-form-item>
<el-form-item label="检测状态" v-if="form.activeTabs != 3 && form.activeTabs != 5">
<el-form-item label="检测状态" v-if="form.activeTabs != 3 && form.activeTabs != 4 && form.activeTabs != 5">
<el-select v-model="form.checkStatus" clearable>
<el-option
v-for="(item, index) in checkStatusList"
@@ -45,7 +45,7 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报告状态" v-if="form.activeTabs != 0 && form.activeTabs != 4">
<el-form-item label="报告状态" v-if="form.activeTabs != 0">
<el-select v-model="form.checkReportStatus" clearable>
<el-option
v-for="(item, index) in checkReportStatusList"
@@ -110,12 +110,10 @@
>
<!-- :disabled="!scope.isSelected || scope.selectedList.filter((item) => item.check_State === '检测完成').length === 0" -->
<el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 0"
>归档</el-button
>
<el-button type="primary" :icon="CirclePlus" @click="addDevice('设备新增')" v-if="form.activeTabs === 0"
>设备新增</el-button
>
<el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4"
>归档</el-button>
<!-- <el-button type="primary" :icon="CirclePlus" @click="addDevice('设备新增')" v-if="form.activeTabs === 0"
>设备新增</el-button> -->
</el-form-item>
</el-form>
@@ -130,7 +128,17 @@
v-if="form.activeTabs === 3 && form.activeChildTabs === 1"
>查看</el-button
>
<div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0">
<el-button
type="primary"
link
:icon="Download"
@click="openDrawer('报告下载', scope.row)"
v-if="form.activeTabs === 3 && form.activeChildTabs === 0"
>报告下载</el-button
>
<!-- <div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0">
<el-dropdown trigger='click'>
<el-button link type='primary' :icon="Download" class='table-operate'>
<div class='table-operate-text'>报告下载</div>
@@ -143,7 +151,7 @@
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</div> -->
<el-button
type="primary"
@@ -166,7 +174,7 @@
link
:icon="Notebook"
@click="openDrawer('归档', scope.row)"
v-if="form.activeTabs === 0"
v-if="form.activeTabs === 4"
:disabled = "scope.row.check_State != '检测完成'"
>归档</el-button
>
@@ -183,9 +191,24 @@
link
:icon="Switch"
@click="openDrawer('误差体系更换', scope.row)"
v-if="form.activeTabs === 5"
v-if="form.activeTabs === 5 && scope.row.document_State === '已归档'"
>误差体系更换</el-button
>
<div class='cn-render-buttons' v-if="form.activeTabs === 5 && scope.row.document_State === '已归档'">
<el-dropdown trigger='click'>
<el-button link type='primary' :icon="Download" class='table-operate'>
<div class='table-operate-text'>报告下载</div>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<!-- <el-dropdown-item>Q/GDW 10650.2-2021 报告</el-dropdown-item> -->
<el-dropdown-item>Q/GDW 1650.2-2016 报告</el-dropdown-item>
<el-dropdown-item>GBT 19862-2016 报告</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<!-- <el-button
dictType="primary"
link
@@ -286,7 +309,7 @@ const selectionShow = ref(true);
//检测状态数据
let checkStatusList = reactive([
{
label: "未检",
label: "未检",
value: 0,
disabled: false,
},
@@ -309,7 +332,7 @@ let checkStatusList = reactive([
//检测报告状态数据
let checkReportStatusList = reactive([
{
label: "未检",
label: "未检",
value: 0,
disabled: false,
},
@@ -327,17 +350,17 @@ let checkReportStatusList = reactive([
//检测结果数组
let checkResultList = reactive([
{
label: "未检",
label: "未检",
value: 0,
disabled: false,
},
{
label: "不合",
label: "不合",
value: 1,
disabled: false,
},
{
label: "合",
label: "合",
value: 2,
disabled: false,
},
@@ -434,7 +457,7 @@ const columns = reactive([
minWidth: 100,
sortable:true,
render: (scope) => {
if(scope.row.check_Result === '不合')
if(scope.row.check_Result === '不合')
{
return (
<el-tag type='danger'>{ scope.row.check_Result }</el-tag>
@@ -553,7 +576,7 @@ const columns = reactive([
// width: 120,
// render: (scope) => {
// return scope.row.checkStatus == 1
// ? "未检"
// ? "未检"
// : scope.row.checkStatus == 2
// ? "检测中"
// : scope.row.checkStatus == 3
@@ -636,7 +659,7 @@ const handleSelectionChange = (selection: any[]) => {
}
devTestedNum = selection.filter((item) => item.check_State === '检测完成').length;
const result = selection.filter((item) => item.check_Result != "不合")
const result = selection.filter((item) => item.check_Result != "不合")
if(result.length > 0)
{
testType= "test";
@@ -650,10 +673,14 @@ const handleSelectionChange = (selection: any[]) => {
//查询
const handleSearch = () => {
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
if(form.value.activeTabs === 0)//设备检测、设备归档
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
}
else if(form.value.activeTabs === 4)
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成" && item.document_State === "未归档");
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成");
@@ -668,11 +695,14 @@ const handleRefresh = () => {
form.value.checkResult = null;
form.value.checkReportStatus = null;
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
if(form.value.activeTabs === 0)//设备检测、设备归档
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.document_State === "未归档")
}
else if(form.value.activeTabs === 4)
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成" && item.document_State === "未归档");
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
deviceData.value = deviceDataList.plan_devicedata.filter((item) => item.check_State === "检测完成");
@@ -691,42 +721,7 @@ const sortTable = ({
ElMessage.success("修改列表排序成功");
};
// 删除用户信息
const deleteAccount = async (params: User.ResUserList) => {
await useHandleData(
deleteUser,
{ id: [params.id] },
`删除【${params.username}`
);
proTable.value?.getTableList();
};
// 批量删除用户信息
const batchDelete = async (id: string[]) => {
await useHandleData(deleteUser, { id }, "删除所选用户信息");
proTable.value?.clearSelection();
proTable.value?.getTableList();
};
// 重置用户密码
const resetPass = async (params: User.ResUserList) => {
await useHandleData(
resetUserPassWord,
{ id: params.id },
`重置【${params.username}】用户密码`
);
proTable.value?.getTableList();
};
// 切换用户状态
const changeStatus = async (row: User.ResUserList) => {
await useHandleData(
changeUserStatus,
{ id: row.id, status: row.status == 1 ? 0 : 1 },
`切换【${row.username}】用户状态`
);
proTable.value?.getTableList();
};
//顶部功能切换时修改activeTabs
const changeActiveTabs = (val: number,val2: number,tabledata:any[]) => {
form.value.activeTabs = val;
@@ -745,9 +740,9 @@ function tableHeaderInit(val: number) {
//disableCheckStatus("检测中")
disableCheckStatus("归档")
// operationShow.value = false;
columns[columns.length - 1].minWidth = 100;
// columns[columns.length - 1].minWidth = 100;
tableKey.value ++;
operationShow.value = true;
operationShow.value = false;
documentStateShow.value = false;
checkStateShow.value = true;
selectionShow.value = true;
@@ -756,7 +751,7 @@ function tableHeaderInit(val: number) {
// form.value.checkStatus = 2;//检测状态默认为检测完成
// form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
// form.value.checkResult = 1;//检测结果默认为不合格
// disableCheckStatus("未检")
// disableCheckStatus("未检")
// disableCheckStatus("检测中")
// disableCheckStatus("归档")
// disablecheckResultList("未出结果")
@@ -766,11 +761,11 @@ function tableHeaderInit(val: number) {
// form.value.checkStatus = 2;//检测状态默认为检测完成
// form.value.checkReportStatus = 0;//检测报告状态默认为未生成报告
// form.value.checkResult = 2;//检测结果默认为合格
// disableCheckStatus("未检")
// disableCheckStatus("未检")
// disableCheckStatus("检测中")
// disableCheckStatus("归档")
disablecheckResultList("未检")
disableCheckReportStatus("未检")
disablecheckResultList("未检")
disableCheckReportStatus("未检")
columns[columns.length - 1].minWidth = 180;
tableKey.value += 1;
operationShow.value = true;
@@ -782,22 +777,22 @@ function tableHeaderInit(val: number) {
// form.value.checkStatus = 2;//检测状态默认为检测完成
// form.value.checkReportStatus = 1;//检测报告状态默认为已生成报告
// form.value.checkResult = 2;//检测结果默认为合格
// disableCheckStatus("未检")
// disableCheckStatus("未检")
// disableCheckStatus("检测中")
// disableCheckStatus("归档")
disableCheckReportStatus("未生成报告")
disablecheckResultList("未出结果")
disablecheckResultList("未")
disableCheckReportStatus("未")
columns[columns.length - 1].minWidth = 100;
tableKey.value ++;
tableKey.value += 1;
operationShow.value = true;
documentStateShow.value = true;
documentStateShow.value = false;
checkStateShow.value = false;
selectionShow.value = true;
break;
case 5://数据查询
disablecheckResultList("未检")
disableCheckReportStatus("未检")
columns[columns.length - 1].minWidth = 250;
disablecheckResultList("未检")
disableCheckReportStatus("未检")
columns[columns.length - 1].minWidth = 290;
operationShow.value = true;
documentStateShow.value = true;
checkStateShow.value = false;

View File

@@ -8,10 +8,11 @@
:color="customColors"
/>
<!-- v-if="!isPause && activeIndex < activeTotalNum" -->
<el-button
type="primary"
v-if="!isPause && activeIndex < activeTotalNum"
:disabled="activeIndex===0"
:disabled="activeIndex===0 && activeIndex >= activeTotalNum"
:icon="VideoPause"
@click="handlePauseTest"
>暂停检测</el-button
@@ -24,13 +25,13 @@
>继续检测</el-button
>
<el-button
<!-- <el-button
type="warning"
v-if="activeIndex >= activeTotalNum"
:icon="Refresh"
@click="handleReCheck"
>重新检测</el-button
>
> -->
<!-- <el-button type="danger" :icon="Close" @click="handleFinishTest"
>停止检测</el-button
> -->
@@ -228,7 +229,7 @@
</div>
<div style="height: 98px;">
<el-collapse model-value="1" accordion>
<el-collapse-item title="检测日志:" name="1">
<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)'}">
{{ item.log }} <br />
@@ -323,6 +324,41 @@ const scrollToBottom = () => {
function getRandomInt(max: number): number {
return Math.floor(Math.random() * max);
}
//判断该检测项(例如 频率准确度检测)是否全部合格(所有设备所有通道所有子检测项目全部合格为合格,否则为不合格)
function getItemCheckResult(index:number):boolean{
let items = columnList?.value.filter((item) => item === index.toString())
if(items.length > 0)
{
return false
}
else
return true
}
//测试项开始检测时间(或继续检测时间)
const startData = ref(new Date())
//测试项检测结束时间(或暂停时的时间)
const endData= ref(new Date())
let timeDifference = ref(0)
function getTimeDifference(timeDifference:number): string {
// 将时间差转换为天、小时、分钟、秒
const millisecondsPerDay = 1000 * 60 * 60 * 24;
const millisecondsPerHour = 1000 * 60 * 60;
const millisecondsPerMinute = 1000 * 60;
const millisecondsPerSecond = 1000;
const days = Math.floor(timeDifference / millisecondsPerDay);
const hours = Math.floor((timeDifference % millisecondsPerDay) / millisecondsPerHour);
const minutes = Math.floor((timeDifference % millisecondsPerHour) / millisecondsPerMinute);
const seconds = Math.floor((timeDifference % millisecondsPerMinute) / millisecondsPerSecond);
return `时间差: ${days} 天, ${hours} 小时, ${minutes} 分钟, ${seconds}`
}
const updateLog = () => {
const currentTime = ref(new Date().toLocaleString());
@@ -334,14 +370,23 @@ const updateLog = () => {
type: 'info',
log: currentTime.value + ':频率准确度检测开始',
})
break;
case 2:
if(getItemCheckResult(activeIndex.value - 1))
{
testLogList.value.push({
type: 'info',
log:currentTime.value + ':频率准确度检测完成',
log:currentTime.value + ':频率准确度检测合格',
})
}
else
{
testLogList.value.push({
type: 'error',
log:currentTime.value + ':频率准确度检测不合格',
})
}
testLogList.value.push({
type: 'info',
log:currentTime.value + ':电压准确度检测开始',
@@ -1919,7 +1964,17 @@ watch(ts, function (newValue, oldValue) {
color:red;
// font-size:30px;
// --el-table-tr-bg-color: var(--el-color-warning-light-9);
// background-color:#f5f7fa;
// position: relative;
}
// :deep(.el-table .warning-row::before) {
// content: '*'; /* 必须设置content属性 */
// position: absolute;
// color:red;
// background-color:#f5f7fa;
// }
.el-table .success-row {
--el-table-tr-bg-color: var(--el-color-success-light-9);
}

View File

@@ -3,7 +3,7 @@
<div class="steps-container">
<!-- simple -->
<!-- :style="{color:node.label=='未检'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" -->
<!-- :style="{color:node.label=='未检'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" -->
<el-steps class="test-head-steps" simple :active="stepsActiveIndex" process-status="finish" finish-status="success" >
<!-- style="height:100px" -->
<!-- <el-step title="预检测" :icon="getIcon(0)" /> -->

View File

@@ -2,13 +2,13 @@
<div>
<div class="test-dialog">
<div class="dialog-left">
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus"
<el-steps direction="vertical" :active="stepsIndex" :process-status="currentStepStatus"
finish-status="success">
<el-step title="开始检测" :description="startTime" />
<el-step title="GPS完成上送" :description="gpsTime" />
<el-step title="设备开始上送时刻" :description="devStartTime" />
<el-step title="设备最晚上送时刻" :description="devEndTime" />
<el-step title="检测完成" :description="finishTime" />
<el-step title="开始检测" />
<el-step title="触发设备检测GPS时刻的标准时间"/>
<el-step title="设备开始上送"/>
<el-step title="设备结束上送"/>
<el-step title="检测完成"/>
</el-steps>
<!-- <el-timeline style="max-width: 600px">
<el-timeline-item
@@ -28,31 +28,58 @@
<div class="dialog-right">
<div class="right-title">
<!-- <div>设备上送时刻表</div> -->
<span style=" font-size: 18px;font-weight: 600;">
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> / <span style="color: green">4</span>
<span v-if="activeIndex <= 1"> </span>
<span v-if="activeIndex > 1" style=" font-size: 18px;font-weight: 600;">
标准时间: <span style="color: #003078">{{ gpsTime }}</span>
</span>
<div>
<div class="error-dsc">
<div class="green-div"></div>
<span style=" color: #67C23A; font-size: 16px;font-weight: 600;">
守时误差1000ms
</span>
<div class="red-div"></div>
<span style=" color: #F56C6c; font-size: 16px;font-weight: 600;">
守时误差>1000ms
</span>
</div>
<!-- <span style=" font-size: 18px;font-weight: 600;">
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> / <span style="color: green">4</span>
</span> -->
<!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button> -->
</div>
</div>
<div class="right-content">
<ProTable ref='proTable' :pagination='false' :toolButton='false' :showCard='false' :columns='columns'
<div class="right-content table-main">
<el-empty description="暂无数据,等待检测开始" v-if="activeIndex === 0" />
<!-- <ProTable v-if="activeIndex > 0" ref='proTable' :pagination='false' :toolButton='false' :showCard='false' :columns='columns'
:data='deviceOperatorData' stripe :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" style="width: 100%; height:435px" border>
</ProTable>
</ProTable> -->
<!-- <el-table :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
<el-table-column prop="deviceName" label="设备名" />
<el-table v-if="activeIndex > 0" :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
<el-table-column prop="deviceName" label="设备名" />
<el-table-column prop="updataTime" label="上送时刻" />
<el-table-column prop="ErrorValue" label="守时误差(ms)" />
<el-table-column prop="ErrorValue" label="守时误差(ms)">
<!-- <template #header>
<span>守时误差(ms)</span>
<el-tooltip content = "守时误差 = |设备上送时间 - 标准时间|最大显示值为9999毫秒超过该值的统一用ErrorMax来表示" placement="top" style="align-items: bottom;">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template> -->
</el-table-column>
<el-table-column prop="Result" label="检测结果">
<!-- <template #header>
<span>检测结果</span>
<el-tooltip content = "守时误差小于等于1000毫秒为合格否则不合格" placement="top" style="align-items: bottom;">
<el-icon><InfoFilled /></el-icon>
</el-tooltip>
</template> -->
<template #default="scope">
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag>
</template>
</el-table-column>
</el-table> -->
</el-table-column>
</el-table>
</div>
</div>
</div>
@@ -62,8 +89,9 @@
<script lang="tsx" setup name="timeTest">
import { SuccessFilled } from '@element-plus/icons-vue'
const stepsIndex = ref(0)
const activeIndex = ref(0)
const activeTotalNum = ref(5)
const activeTotalNum = ref(7)
const startTime = ref('')
const gpsTime = ref('')
const devStartTime = ref('')
@@ -86,32 +114,7 @@ const activities = ref<Activity[]>([
},])
const deviceOperatorData = ref([
{
deviceName: '240001',
updataTime: '—',
ErrorValue: '—',
Result: '—',
},
{
deviceName: '240002',
updataTime: '—',
ErrorValue: '—',
Result: '—',
},
{
deviceName: '240003',
updataTime: '—',
ErrorValue: '—',
Result: '—',
},
{
deviceName: '240004',
updataTime: '—',
ErrorValue: '—',
Result: '—',
},
])
const deviceOperatorData = ref([])
const deviceData = ref([
{
@@ -164,7 +167,7 @@ const columns = reactive([
},
{
prop: 'ErrorValue',
label: '守时误差',
label: '守时误差ms',
// width: 100,
},
{
@@ -192,12 +195,12 @@ watch(testStatus, function (newValue, oldValue) {
ts.value = 'process'
let timer = setInterval(() => {
if (activeIndex.value < activeTotalNum.value - 2)
if (activeIndex.value < activeTotalNum.value)
activeIndex.value++
else if (activeIndex.value === activeTotalNum.value - 2) {
activeIndex.value++
activeIndex.value++
}
// else if (activeIndex.value === activeTotalNum.value - 2) {
// activeIndex.value++
// activeIndex.value++
// }
else {
clearInterval(timer)
ts.value = 'success'
@@ -218,11 +221,28 @@ function formatDateTime(date) {
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
}
function addMillisecondsToDate(dateString: string, millisecondsToAdd: number): Date {
// 解析字符串为 Date 对象
const [datePart, timePart] = dateString.split(' ');
const [year, month, day] = datePart.split('-').map(Number);
const [hours, minutes, seconds, milliseconds] = timePart.split(':').flatMap(part => part.split('.')).map(Number);
// 创建 Date 对象(注意:月份是从 0 开始的)
const date = new Date(year, month - 1, day, hours, minutes, seconds, milliseconds);
// 增加指定的毫秒数
date.setMilliseconds(date.getMilliseconds() + millisecondsToAdd);
return date;
}
watch(activeIndex, function (newValue, oldValue) {
console.log(activeIndex.value,111,stepsIndex.value,222)
if (activeIndex.value === 1) {
startTime.value = formatDateTime(new Date());
stepsIndex.value = 1;
// activities.value.length = 0;
// activities.value.push({
// content: '开始检测',
@@ -233,6 +253,7 @@ watch(activeIndex, function (newValue, oldValue) {
// });
}
if (activeIndex.value === 2) {
stepsIndex.value = 2;
gpsTime.value = formatDateTime(new Date());
// activities.value.push({
// content: 'GPS上送时刻',
@@ -243,37 +264,42 @@ watch(activeIndex, function (newValue, oldValue) {
// });
}
if (activeIndex.value === 3) {
// activities.value.push({
// content: '设备最早上送时刻',
// timestamp: '2018-04-03 20:46',
// color: '#0bbd87',
// icon: SuccessFilled,
// size: 'large',
// });
devStartTime.value = formatDateTime(new Date());
stepsIndex.value = 3;
deviceOperatorData.value.length = 0;
deviceOperatorData.value = deviceData.value;
qualified.value = 3
// deviceOperatorData.value = deviceData.value;
deviceOperatorData.value.push({
deviceName: '240002',
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 136)),
ErrorValue: '136',
Result: '合格',
});
}
if (activeIndex.value === 4) {
deviceOperatorData.value.push({
deviceName: '240001',
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 148)),
ErrorValue: '148',
Result: '合格',
});
}
if (activeIndex.value === 5) {
deviceOperatorData.value.push({
deviceName: '240004',
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 736)),
ErrorValue: '736',
Result: '合格',
});
}
if (activeIndex.value === 6) {
stepsIndex.value = 5;
deviceOperatorData.value.push({
deviceName: '240003',
updataTime: formatDateTime(addMillisecondsToDate(gpsTime.value, 1006)),
ErrorValue: '1006',
Result: '不合格',
});
}
if (activeIndex.value > 3) {
devEndTime.value = formatDateTime(new Date());
finishTime.value = formatDateTime(new Date());
// activities.value.push({
// content: '设备最晚上送时刻',
// timestamp: '2018-04-03 20:46',
// color: '#0bbd87',
// icon: SuccessFilled,
// size: 'large',
// });
// activities.value.push({
// content: '检测结束',
// timestamp: '2018-04-03 20:46',
// color: '#0bbd87',
// icon: SuccessFilled,
// size: 'large',
// });
}
})
const emit = defineEmits(['update:testStatus']);
//监听sn
@@ -313,11 +339,40 @@ watch(ts, function (newValue, oldValue) {
display: flex;
flex-direction: row;
/* 横向排列 */
justify-content: flex-end;
justify-content: space-between;
/* margin-bottom: 10px; */
}
.error-dsc{
display: flex;
flex-direction: row;
justify-content: center;
align-items: baseline;
}
.green-div{
width: 20px;
height: 14px;
border-radius: 4px;
background-color: #67C23A;
margin-left: 5px;
margin-right: 5px;
}
.red-div{
width: 20px;
height: 14px;
border-radius: 4px;
background-color: #F56C6C;
margin-left: 5px;
margin-right: 5px;
}
.right-content{
height: 440px;
}
/* width: 100%;
height: auto;
background: #fff;

View File

@@ -23,7 +23,7 @@
<template #default='{ node, data }'>
<span class='custom-tree-node' style='display: flex;align-items: center;'>
<Platform v-if='!data.pid' style='width:18px;height: 18px;margin-right:8px;'
:style="{color:node.label=='未检'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" />
:style="{color:node.label=='未检'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" />
<span>{{ node.label }}</span>
<!-- <Menu v-if="data.pid" @click.stop="detail(data)" style="width: 12px;margin-left: 8px;"/> -->
</span>

View File

@@ -30,7 +30,7 @@
<el-collapse-item title="检测进度展示" name="1"> -->
<div class="container_pieShow">
<el-collapse model-value="1" accordion @change="handleCollapseChange">
<el-collapse-item title="&nbsp&nbsp&nbsp&nbsp检测计划统计" name="1">
<el-collapse-item title="&nbsp&nbsp&nbsp&nbsp&nbsp检测计划统计" name="1">
<!-- 饼图 -->
<div class="container_charts">
<div class="charts_info" ref="chartsInfoRef">
@@ -183,17 +183,17 @@ const tabsList = ref([
checked: false,
},
{
label: "数据查询",
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,
},
// {
// label: "设备归档",
// value: 4,
// img: "/src/assets/images/plan/static/4.svg",
// checked: false,
// },
]);
form.value.activeTabs = tabsList.value[0].value;
@@ -208,11 +208,16 @@ watch(
console.log(form.value.activeTabs,111);
if(form.value.activeTabs === 0 || form.value.activeTabs === 4)//设备检测、设备归档
if(form.value.activeTabs === 0 )//设备检测
{
const tabledata = deviceData.filter((item) => item.document_State === "未归档")
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
}
else if(form.value.activeTabs === 4)//设备归档
{
const tabledata = deviceData.filter((item) => item.check_State === "检测完成" && item.document_State === "未归档")
tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs,tabledata);
}
else if(form.value.activeTabs === 3 || form.value.activeTabs === 5)//报告生成、数据查询
{
const tabledata = deviceData.filter((item) => item.check_State === "检测完成");
@@ -251,15 +256,15 @@ const chartsData1: any = ref([]),
const getPieData = () => {
chartsData1.value = [
{ value: 12, name: "未检", itemStyle: { color: '#fac858' } },
{ value: 12, name: "未检", itemStyle: { color: '#fac858' } },
{ value: 0, name: "检测中", itemStyle: { color: '#ee6666' } },
{ value: 6, name: "检测完成", itemStyle: { color: '#91cc75' } },
{ value: 2, name: "归档", itemStyle: { color: '#5470c6' } },
];
chartsData2.value = [
{ value: 12, name: "未检" , itemStyle: { color: '#fac858' } },
{ value: 3, name: "不合" , itemStyle: { color: '#ee6666' } },
{ value: 5, name: "合", itemStyle: { color: '#91cc75' } },
{ value: 12, name: "未检" , itemStyle: { color: '#fac858' } },
{ value: 3, name: "不合" , itemStyle: { color: '#ee6666' } },
{ value: 5, 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' } },
];
@@ -268,12 +273,12 @@ const getPieData = () => {
// { value: Math.floor(Math.random() * 100) + 1, name: "已生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "未生成报告" },
{ value: 12, name: "未检" , itemStyle: { color: '#fac858' } },
{ value: 12, name: "未检" , itemStyle: { color: '#fac858' } },
{ value: 4, name: "未生成" , itemStyle: { color: '#ee6666' } },
{ value: 4, name: "已生成", itemStyle: { color: '#91cc75' } },
// { 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: "全部合格未生成报告" },
// { value: Math.floor(Math.random() * 100) + 1, name: "有不合格项已生成报告" },
@@ -631,6 +636,11 @@ onUnmounted(() => {
}
}
}
:deep(.el-collapse-item__header){
color: var(--el-color-primary);
font-size: 14px;
font-family: "Microsoft YaHei", "微软雅黑", "Arial", sans-serif;
}
:deep(.el-collapse-item__conten){
// background-color:#f6f6f6;
padding-bottom: 0px !important;

View File

@@ -157,7 +157,7 @@ tableHeight.value = window.innerHeight - 630;
//检测状态数据
const checkStatusList = [
{
label: "未检",
label: "未检",
value: 0,
},
{
@@ -385,7 +385,7 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
// width: 120,
// render: (scope) => {
// return scope.row.checkStatus == 1
// ? "未检"
// ? "未检"
// : scope.row.checkStatus == 2
// ? "检测中"
// : scope.row.checkStatus == 3

View File

@@ -36,7 +36,7 @@
<el-form-item label="检测状态">
<el-select v-model="searchForm.checkStatus">
<el-option :value="0" label="全部"></el-option>
<el-option :value="1" label="未检"></el-option>
<el-option :value="1" label="未检"></el-option>
<el-option :value="2" label="检测中"></el-option>
<el-option :value="3" label="检测完成"></el-option>
</el-select>
@@ -342,7 +342,7 @@ const columns = reactive<ColumnProps<User.ResUserList>[]>([
width: 120,
render: (scope) => {
return scope.row.checkStatus == 1
? "未检"
? "未检"
: scope.row.checkStatus == 2
? "检测中"
: scope.row.checkStatus == 3