Files
pqs-9100_client/frontend/src/views/home/components/dataCheckChangeErrSysPopup.vue

1282 lines
34 KiB
Vue
Raw Normal View History

<template>
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig">
<div class="change-errsys-dialog">
<div class="change-errsys-title">
2024-11-21 23:02:43 +08:00
<el-form :model='formContent'>
<el-row :gutter="24" >
<el-col :span="8">
<el-form-item label="设备名称:" >
<el-input v-model='deviceName' :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检测脚本:" >
<el-input v-model='testScriptName' :disabled="true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数据处理原则:" >
<el-input v-model='dataRule' :disabled="true"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" >
<el-col :span="8">
<el-form-item label="误差体系">
<el-select v-model="error_Sys_Id" autocomplete="off">
<el-option
v-for="plan in testErrSystDataList"
:key="plan.id"
:label="plan.label"
:value="plan.id">
</el-option>
</el-select>
2024-11-21 23:02:43 +08:00
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item >
<el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button>
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled" @click="openReportDlg">报告生成</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="change-errsys-content">
2024-11-21 23:02:43 +08:00
<div class="tabs-title">
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
<el-button type="primary" v-if="activeIndex === activeTotalNum">合格92项/共103项</el-button>
</div>
<div class="dialog-content">
<el-table :data="tableData" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border>
<el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" />
<el-table-column label="被检通道1" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType1==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType1=='info'"
:type="scope.row.resultType1"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue1 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道2" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType2==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType2=='info'"
:type="scope.row.resultType2"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue2 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道3" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType3==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType3=='info'"
:type="scope.row.resultType3"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue3 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道4" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType4==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType4=='info'"
:type="scope.row.resultType4"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue4 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column p label="被检通道5" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType5==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType5=='info'"
:type="scope.row.resultType5"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue5 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道6" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType6==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
tip
:disabled = "scope.row.resultType6=='info'"
:type="scope.row.resultType6"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue6 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道7" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType7==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType7=='info'"
:type="scope.row.resultType7"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue7 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="被检通道8" align="center">
<template #default="scope">
<el-tooltip :content="scope.row.resultType8==='info' ? '暂无数据' : '点击查看详情'" placement="top">
<el-button
:disabled = "scope.row.resultType8=='info'"
:type="scope.row.resultType8"
size="small"
@click="handleClick(scope.row)"
>
{{ scope.row.resultValue8 }}
</el-button>
</el-tooltip>
</template>
</el-table-column>
<!-- <el-table-column v-for="(item, index) in monitorList" :key="index" :prop="item.prop" :label="item.label">
</el-table-column> -->
</el-table>
</div>
<!-- <el-table :data="testData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
<el-table-column fixed prop="deviceName" label="检测项目" />
<el-table-column prop="updataTime" label="被检通道1" />
<el-table-column prop="ErrorValue" label="被检通道2" />
<el-table-column prop="Result" label="被检通道3" />
2024-11-21 23:02:43 +08:00
</el-table> -->
</div>
</div>
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
</el-dialog>
</template>
<script setup lang='ts'>
import IPAddress from '@/components/IpAddress/index.vue'
import { dialogBig } from '@/utils/elementBind'
import { type Device } from '@/api/device/interface/device'
import { ElMessage, type FormItemRule } from 'element-plus'
import { addPqDev, updatePqDev } from '@/api/device/device'
import { computed, reactive, type Ref, ref } from 'vue'
import { useDictStore } from '@/stores/modules/dict'
import { CirclePlus, Delete, EditPen,Postcard, VideoPlay} from '@element-plus/icons-vue'
// 使用 dayjs 库格式化
import dayjs from 'dayjs'
import { getPqMonList } from '@/api/device/monitor'
import { type ColumnProps } from '@/components/ProTable/interface'
import { type Monitor } from '@/api/device/interface/monitor'
import { data } from "@/api/plan/autoTest.json";
import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,sourceDataList,deviceDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData'
import ReportPopup from './reportPopup.vue'
2024-11-21 23:02:43 +08:00
const reportDisabled = ref(true)
const reportDialogVisible = ref(false)
const deviceName = ref('被检设备1');
const error_Sys_Id = ref('2');
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
const errorSysName = ref('Q/GDW 10650.2-2021');
const dataRule = ref('所有值');
const scriptSwitch = ref(true);
const currentScriptDsc = ref('频率准确度检测频率42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
const defaultProps = {
children: "children",
label: "name",
pid: "pid",
};
const testData = ref([
{
deviceName: '额定条件下频率检测42.5Hz',
updataTime: '√',
ErrorValue:'×',
Result: '/',
},
{
deviceName: '额定条件下频率检测50Hz',
updataTime: '/',
ErrorValue:'√',
Result: '×',
},
{
deviceName: '额定条件下频率检测50.05Hz',
updataTime: '—',
ErrorValue:'—',
Result: '—',
},
{
deviceName: '额定条件下频率检测57.5Hz',
updataTime: '—',
ErrorValue:'—',
Result: '—',
},
])
const handleNodeClick = (data) => {
console.log(data);
};
const MonIsShow = ref(false)
const DevIsShow = ref(false)
const IsPasswordShow = ref(false)
const dictStore = useDictStore()
// 定义弹出组件元信息
const dialogFormRef = ref()
const disabledDate = (time: Date) => {
return time.getTime() > Date.now()
}
const props = defineProps<{
visible: boolean;
}>();
const emit = defineEmits<{
(e: 'update:visible', value: boolean): void;
(e: 'submit', data: any): void;
}>();
const handleCancel = () => {
emit('update:visible', false); // 关闭对话框
};
const openReportDlg = () => {
reportDialogVisible.value = true
}
2024-11-21 23:02:43 +08:00
const dealData = () => {
startTimer()
}
const activeIndex = ref(0)
const activeTotalNum = ref(12)
const currentRow = ref<{ id: number; scriptItemName: string; name: string; address: string; hasChildren?: boolean; children?: User[] } | null>(null);
// const currentRow = ref(null); // 用于存储当前选中的行
const monitorList = ref([
{
deviceID: '1',
deviceName: '被检设备1',
monitorIdx: 1,
label:'被检设备1通道1',
prop: 'Result1',
},
{
deviceID: '1',
deviceName: '被检设备1',
monitorIdx: 2,
label:'被检设备1通道2',
prop: 'Result2',
},
{
deviceID: '2',
deviceName: '被检设备2',
monitorIdx: 1,
label:'被检设备2通道1',
prop: 'Result3',
},
{
deviceID: '2',
deviceName: '被检设备2',
monitorIdx: 2,
label:'被检设备2通道2',
prop: 'Result4',
}
])
const tableData1= [
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
]
const scrollContainer = ref<HTMLElement | null>(null); // 声明 scrollContainer
const scrollToBottom = () => {
if (scrollContainer.value) {
console.log(scrollContainer.value)
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
console.log(scrollContainer.value)
}
};
function getRandomInt(max: number): number {
return Math.floor(Math.random() * max);
}
const updateLog = () => {
const currentTime = ref(new Date().toLocaleString());
switch(activeIndex.value)
{
case 1:
testLogList.value.length = 0; // 清空数组
testLogList.value.push({
type: 'info',
log: currentTime.value + ':频率准确度检测开始',
})
break;
case 2:
testLogList.value.push({
type: 'info',
log:currentTime.value + ':频率准确度检测完成',
})
testLogList.value.push({
type: 'info',
log:currentTime.value + ':电压准确度检测开始',
})
break;
case 3:
testLogList.value.push({
type: 'error',
log:currentTime.value + ':电压准确度检测不合格',
})
testLogList.value.push({
type: 'info',
log:currentTime.value + ':谐波电压准确度检测开始',
})
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
updateTableData(activeIndex.value.toString())
break;
}
scrollToBottom();
}
const testLogList = ref([
{
type: 'info',
log:'暂无数据,等待检测开始',
},
])
const tableKey = ref(0);
const tableRowClassName = ({
row,
rowIndex,
}: {
row: any
rowIndex: number
}) => {
// console.log(activeIndex.value,rowIndex,row)
if (row.id === activeIndex.value.toString()) {
return 'warning-row'
}
// else if (rowIndex === 3) {
// return 'success-row'
// }
return ''
}
const percentage = ref(0);
const customColors = [
{ color: "#5cb87a", percentage: 100 }, //绿
];
//暂停检测
const isPause = ref<boolean>(false);
const resultDialogVisible = ref(false)
const dataCheckSingleChannelSingleTestDialogVisable = ref(false);
function clear() {
}
function traverseTableData(data: any[],id: string): void {
data.forEach(item => {
// 处理当前节点的数据
if(item.id === id)
{
for(let i = 1;i<=8;i++)
{
let field1 = "resultType"+i
let field2 = "resultValue"+i
if(getRandomInt(10)>8 && activeIndex.value>2)
{
item[field1] = "danger";
item[field2] = "×";
}
else
{
item[field1] = "success";
item[field2] = "√";
}
}
return;
}
// 如果当前节点有 children并且 children 是一个数组,则递归遍历
if (Array.isArray(item.children)) {
traverseTableData(item.children,id);
}
});
}
const updateTableData = (id: string) => {
traverseTableData(tableData.value,id);
console.log(id)
};
let timer: any = ref("");
const handlePauseTest = () => {
if (!isPause.value) {
pauseTimer()
} else {
resumeTimer()
}
isPause.value = !isPause.value;
};
//完成检测
const handleFinishTest = () => {
resultDialogVisible.value = true
ElMessage.success("完成检测");
};
const handleClick = (row:any) => {
console.log(111,row)
dataCheckSingleChannelSingleTestDialogVisable.value = true;
};
interface User {
id: number
scriptItemName: string
name: string
address: string
hasChildren?: boolean
children?: User[]
}
//resultType2: 'success',
// resultValue2:'√',
// resultType3: 'danger',
// resultValue3:'×',
const tableData = ref([
{
id: '1',
scriptItemName: '频率',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '1-1',
scriptItemName: '额定条件下的测量',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '1-1-1',
scriptItemName: '频率42.5Hz',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '1-1-2',
scriptItemName: '频率50Hz',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '1-1-3',
scriptItemName: '频率50.5Hz',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '1-1-4',
scriptItemName: '频率57.5Hz',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
{
id: '1-2',
scriptItemName: '电压对频率测量的影响',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '1-2-1',
scriptItemName: '频率50.5Hz 电压10%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
{
id: '1-3',
scriptItemName: '谐波对频率测量的影响',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '1-3-1',
scriptItemName: '频率50.5Hz 谐波电压h3 10%Un;h7 10%Un;h11 10%Un;h15 4%Un; h19 5%Un; h23 5%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
],
},
{
id: '2',
scriptItemName: '电压',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '2-1',
scriptItemName: '额定条件下的测量',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '2-1-1',
scriptItemName: '频率50Hz 电压10%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '2-1-2',
scriptItemName: '频率50Hz 电压45%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '2-1-3',
scriptItemName: '频率50Hz 电压80%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '2-1-4',
scriptItemName: '频率50Hz 电压115%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '2-1-5',
scriptItemName: '频率50Hz 电压150%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
{
id: '2-2',
scriptItemName: '频率对电压测量的影响',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '2-2-1',
scriptItemName: '频率42.5Hz 电压80%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
{
id: '2-3',
scriptItemName: '谐波对电压测量的影响',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
children: [
{
id: '2-3-1',
scriptItemName: '频率50Hz 电压80%Un 谐波电压h3 10%Un;h7 10%Un;h11 10%Un;h15 4%Un; h19 5%Un; h23 5%Un',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
],
},
],
},
{
id: '3',
scriptItemName: '谐波电压',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '4',
scriptItemName: '谐波电流',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '5',
scriptItemName: '谐波有功功率',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '6',
scriptItemName: '间谐波电压',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '7',
scriptItemName: '间谐波电流',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '8',
scriptItemName: '暂态',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '9',
scriptItemName: '电流',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '10',
scriptItemName: '电压不平衡度',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '11',
scriptItemName: '电流不平衡度',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
{
id: '12',
scriptItemName: '短时闪变',
resultType1: 'info',
resultValue1:'-',
resultType2: 'info',
resultValue2:'-',
resultType3: 'info',
resultValue3:'-',
resultType4: 'info',
resultValue4:'-',
resultType5: 'info',
resultValue5:'-',
resultType6: 'info',
resultValue6:'-',
resultType7: 'info',
resultValue7:'-',
resultType8: 'info',
resultValue8:'-',
},
])
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
const ts = ref('');
const startTimer = () => {
//if (timer.value !== null) return; // 如果定时器已经启动,则不再重复启动
timer.value = setInterval(() => {
if(activeIndex.value <= activeTotalNum.value)
{
activeIndex.value++;
updateLog()
switch(activeIndex.value)
{
case 1:
updateTableData("1-1-1")
updateTableData("1-1-2")
updateTableData("1-1-3")
updateTableData("1-1-4")
updateTableData("1-1")
updateTableData("1-2-1")
updateTableData("1-2")
updateTableData("1-3-1")
updateTableData("1-3")
updateTableData("1")
break;
case 2:
updateTableData("2-1-1")
updateTableData("2-1-2")
updateTableData("2-1-3")
updateTableData("2-1-4")
updateTableData("2-1-5")
updateTableData("2-1")
updateTableData("2-2-1")
updateTableData("2-2")
updateTableData("2-3-1")
updateTableData("2-3")
updateTableData("2")
break;
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
updateTableData(activeIndex.value.toString())
break;
}
if (percentage.value < 100) {
percentage.value = Math.trunc(activeIndex.value/activeTotalNum.value * 100);
} else {
percentage.value = 100;
clearInterval(timer)
reportDisabled.value = false;
clear();
}
}
else
{
clearInterval(timer)
reportDisabled.value = false;
}
}, 100);
};
const pauseTimer = () => {
if (timer.value !== null) {
clearInterval(timer.value);
timer.value = null;
}
};
const resumeTimer = () => {
if (timer.value === null) {
startTimer();
}
};
</script>
<style scoped>
.change-errsys-dialog{
display: flex;
flex-direction: column;
}
.change-errsys-title{
display: flex;
flex-direction: row;
margin-top: 10px;
}
.change-errsys-content{
display: flex;
flex-direction: column;
}
.tabs-title{
display: flex;
justify-content: flex-end;
margin-bottom: 10px;
}
</style>