This commit is contained in:
GGJ
2025-01-14 16:19:51 +08:00
14 changed files with 168 additions and 115 deletions

View File

@@ -19,6 +19,6 @@ VITE_API_URL=/api
# 开发环境跨域代理,支持配置多个 # 开发环境跨域代理,支持配置多个
VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] #VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文

View File

@@ -46,7 +46,6 @@ router.beforeEach(async (to, from, next) => {
const authStore = useAuthStore() const authStore = useAuthStore()
// 1.NProgress 开始 // 1.NProgress 开始
NProgress.start() NProgress.start()
// 2.动态设置标题 // 2.动态设置标题
const title = import.meta.env.VITE_GLOB_APP_TITLE const title = import.meta.env.VITE_GLOB_APP_TITLE
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title document.title = to.meta.title ? `${to.meta.title} - ${title}` : title

View File

@@ -36,6 +36,7 @@ export const initDynamicRouter = async () => {
// 3.添加动态路由 // 3.添加动态路由
authStore.flatMenuListGet.forEach(item => { authStore.flatMenuListGet.forEach(item => {
item.children && delete item.children; item.children && delete item.children;
if (item.component && typeof item.component == "string") { if (item.component && typeof item.component == "string") {
item.component = modules["/src/views" + item.component + ".vue"]; item.component = modules["/src/views" + item.component + ".vue"];
} }

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-model='dialogVisible' title="系数校准" v-bind="dialogBig" width="1500px" @close="handleCancel"> <el-dialog v-model='dialogVisible' title="系数校准" v-bind="dialogBig" width="1550px" @close="handleCancel">
<div class="test-dialog" > <div class="test-dialog" >
<div class="dialog-content"> <div class="dialog-content">
<div class="right-title"> <div class="right-title">
@@ -241,17 +241,17 @@ watch(webMsgSend,function (newValue,oldValue){
item.devName === newValue.data.devName); item.devName === newValue.data.devName);
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在 if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4); firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
firstCoefficientVO.aVuXi = newValue.data.aVuXi; firstCoefficientVO.aVuXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4); firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
firstCoefficientVO.bVuXi = newValue.data.bVuXi; firstCoefficientVO.bVuXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4); firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
firstCoefficientVO.cVuXi = newValue.data.cVuXi; firstCoefficientVO.cVuXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4); firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
firstCoefficientVO.aIeXi = newValue.data.aIeXi; firstCoefficientVO.aIeXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4); firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
firstCoefficientVO.bIeXi = newValue.data.bIeXi; firstCoefficientVO.bIeXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4); firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
firstCoefficientVO.cIeXi = newValue.data.cIeXi; firstCoefficientVO.cIeXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString();
//console.log(newValue.data.devName + '对象:', firstCoefficientVO); //console.log(newValue.data.devName + '对象:', firstCoefficientVO);
activeIndex.value++; activeIndex.value++;
} else { } else {
@@ -511,6 +511,11 @@ const updateErrorState = (index: number, hasError: boolean) => {
//console.log('tableDataMap',tableDataMap); //console.log('tableDataMap',tableDataMap);
} }
const emit = defineEmits<{
(e: 'quitClicked'): void;
}>();
const handleCancel=() => { const handleCancel=() => {
// 清空 name, channel, total // 清空 name, channel, total
name.value = []; name.value = [];
@@ -521,6 +526,7 @@ const updateErrorState = (index: number, hasError: boolean) => {
active.value = 0 active.value = 0
dialogVisible.value = false dialogVisible.value = false
editableTabsValue.value = '0' editableTabsValue.value = '0'
emit('quitClicked'); // 触发事件
} }
const getTableDataForChannel = (index: number): any[] => { const getTableDataForChannel = (index: number): any[] => {

View File

@@ -9,8 +9,8 @@
<el-table-column prop="monitorNum" label="监测点序号" width="80"/> <el-table-column prop="monitorNum" label="监测点序号" width="80"/>
<el-table-column prop="desc" label="描述" width="90"/> <el-table-column prop="desc" label="描述" width="90"/>
<el-table-column label="电压通道" > <el-table-column label="电压通道" >
<el-table-column prop="Ua" label="L1(V)"> <el-table-column prop="Ua" label="A相">
<el-table-column prop="aVuData" label="被检值"> <el-table-column prop="aVuData" label="被检值(V)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -20,7 +20,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="aVuXi" label="检测结果"> <el-table-column prop="aVuXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.aVuXi === '不合格'" v-if="scope.row.aVuXi === '不合格'"
@@ -54,8 +54,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="Ub" label="L2(V)"> <el-table-column prop="Ub" label="B相">
<el-table-column prop="bVuData" label="被检值"> <el-table-column prop="bVuData" label="被检值(V)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -65,7 +65,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="bVuXi" label="检测结果"> <el-table-column prop="bVuXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.bVuXi === '不合格'" v-if="scope.row.bVuXi === '不合格'"
@@ -93,8 +93,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="Uc" label="L3(V)"> <el-table-column prop="Uc" label="C相">
<el-table-column prop="cVuData" label="被检值"> <el-table-column prop="cVuData" label="被检值(V)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -104,7 +104,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cVuXi" label="检测结果"> <el-table-column prop="cVuXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.cVuXi === '不合格'" v-if="scope.row.cVuXi === '不合格'"
@@ -134,8 +134,8 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="电流通道" > <el-table-column label="电流通道" >
<el-table-column prop="Ia" label="L1(A)"> <el-table-column prop="Ia" label="A相">
<el-table-column prop="aIeData" label="被检值"> <el-table-column prop="aIeData" label="被检值(A)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -145,7 +145,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="aIeXi" label="检测结果"> <el-table-column prop="aIeXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.aIeXi === '不合格'" v-if="scope.row.aIeXi === '不合格'"
@@ -173,8 +173,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="Ib" label="L2(A)"> <el-table-column prop="Ib" label="B相">
<el-table-column prop="bIeData" label="被检值"> <el-table-column prop="bIeData" label="被检值(A)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -184,7 +184,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="bIeXi" label="检测结果"> <el-table-column prop="bIeXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.bIeXi === '不合格'" v-if="scope.row.bIeXi === '不合格'"
@@ -212,8 +212,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="Ic" label="L3(A)"> <el-table-column prop="Ic" label="C相">
<el-table-column prop="cIeData" label="被检值"> <el-table-column prop="cIeData" label="被检值(A)" width="100px">
<template #default="scope"> <template #default="scope">
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box"> <el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
<el-icon-loading /> <el-icon-loading />
@@ -223,7 +223,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cIeXi" label="检测结果"> <el-table-column prop="cIeXi" label="检测结果" width="90px">
<template #default="scope"> <template #default="scope">
<el-tooltip <el-tooltip
v-if="scope.row.cIeXi === '不合格'" v-if="scope.row.cIeXi === '不合格'"

View File

@@ -7,12 +7,12 @@
<el-table-column type="index" label="序号" width="70" fixed="left"/> <el-table-column type="index" label="序号" width="70" fixed="left"/>
<el-table-column prop="time" label="数据时间"/> <el-table-column prop="time" label="数据时间"/>
<template v-if="phaseT === 0"> <template v-if="phaseT === 0">
<el-table-column prop="dataA" :label="'A'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataA" :label="'A'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataB" :label="'B'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataB" :label="'B'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataC" :label="'C'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataC" :label="'C'+(unit==''?'':''+unit+'')"/>
</template> </template>
<template v-if="phaseT === 1"> <template v-if="phaseT === 1">
<el-table-column prop="dataT" :label="'T'+(unit==''?'':''+unit+'')"/> <el-table-column prop="dataT" :label="'T'+(unit==''?'':''+unit+'')"/>
</template> </template>
</el-table> </el-table>
</div> </div>

View File

@@ -9,7 +9,7 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<template v-if="phaseT === 0"> <template v-if="phaseT === 0">
<el-table-column :label="'A'+(unit==''?'':''+unit+'')"> <el-table-column :label="'A'+(unit==''?'':''+unit+'')">
<el-table-column prop="stdA" width="100" label="标准值"/> <el-table-column prop="stdA" width="100" label="标准值"/>
<el-table-column prop="dataA" width="100" label="被检值"/> <el-table-column prop="dataA" width="100" label="被检值"/>
<el-table-column prop="isDataA" label="检测结果"> <el-table-column prop="isDataA" label="检测结果">
@@ -26,7 +26,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column :label="'B'+(unit==''?'':''+unit+'')"> <el-table-column :label="'B'+(unit==''?'':''+unit+'')">
<el-table-column prop="stdB" width="100" label="标准值"/> <el-table-column prop="stdB" width="100" label="标准值"/>
<el-table-column prop="dataB" width="100" label="被检值"/> <el-table-column prop="dataB" width="100" label="被检值"/>
<el-table-column prop="isDataB" label="检测结果"> <el-table-column prop="isDataB" label="检测结果">
@@ -43,7 +43,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column :label="'C'+(unit==''?'':''+unit+'')"> <el-table-column :label="'C'+(unit==''?'':''+unit+'')">
<el-table-column prop="stdC" width="100" label="标准值"/> <el-table-column prop="stdC" width="100" label="标准值"/>
<el-table-column prop="dataC" width="100" label="被检值"/> <el-table-column prop="dataC" width="100" label="被检值"/>
<el-table-column prop="isDataC" label="检测结果"> <el-table-column prop="isDataC" label="检测结果">
@@ -63,7 +63,7 @@
</template> </template>
<template v-if="phaseT === 1"> <template v-if="phaseT === 1">
<el-table-column :label="'T'+(unit==''?'':''+unit+'')"> <el-table-column :label="'T'+(unit==''?'':''+unit+'')">
<el-table-column prop="stdT" label="标准值"/> <el-table-column prop="stdT" label="标准值"/>
<el-table-column prop="dataT" label="被检值"/> <el-table-column prop="dataT" label="被检值"/>
<el-table-column prop="isDataT" label="检测结果"> <el-table-column prop="isDataT" label="检测结果">

View File

@@ -206,8 +206,8 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
scriptType, scriptType,
code: parseInt(checkStore.planCode) code: parseInt(checkStore.planCode)
}) })
updateTreeFly(resTreeDataTemp, 2)
updateTreeFly(resTreeDataTemp, 4) updateTreeFly(resTreeDataTemp, 4)
updateTreeFly(resTreeDataTemp, 2)
Object.assign(treeDataAll, resTreeDataTemp) Object.assign(treeDataAll, resTreeDataTemp)
@@ -237,16 +237,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
watch(currentCheckItem, (newVal, oldVal) => { watch(currentCheckItem, (newVal, oldVal) => {
// console.log("当前检测项", newVal); // console.log("当前检测项", newVal);
if (newVal) { if (newVal) {
// let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间' doCurrentCheckItemUpdate(newVal)
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal)
setCheckResultData(resCheckResult)
let tempRawData = resTableData.rawData.get(newVal)
if (tempRawData) {
setRawData(tempRawData)
} else {
setRawData([])
}
} }
activeTab.value = 'resultTab' activeTab.value = 'resultTab'
}) })
@@ -312,6 +303,13 @@ const updateTableData = async () => {
let resCheckResult: CheckData.ResCheckResult = {} let resCheckResult: CheckData.ResCheckResult = {}
let resRawData: CheckData.RawDataItem[] = [] let resRawData: CheckData.RawDataItem[] = []
if (keys1.length === 0) {
checkList.length = 0
checkResultData.length = 0
rawTableData.length = 0
currentCheckItem.value = ''
}
if (keys1.length === 1) { if (keys1.length === 1) {
resCheckResult = resTableData.resultData.get(keys1[0]) resCheckResult = resTableData.resultData.get(keys1[0])
resRawData = resTableData.rawData.get(keys2[0]) resRawData = resTableData.rawData.get(keys2[0])
@@ -364,10 +362,12 @@ const updateTableData = async () => {
}) })
} }
// debugger
Object.assign(checkList, tempCheckList) Object.assign(checkList, tempCheckList)
if (currentCheckItem.value == tempCheckList[0].value) {
currentCheckItem.value = checkList[0].value doCurrentCheckItemUpdate(tempCheckList[0].value)
} else {
currentCheckItem.value = tempCheckList[0].value
}
} }
} }
@@ -378,6 +378,20 @@ const updateTableData = async () => {
} }
} }
const doCurrentCheckItemUpdate = (newVal: string)=>{
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal)
setCheckResultData(resCheckResult)
let tempRawData = resTableData.rawData.get(newVal)
if (tempRawData) {
setRawData(tempRawData)
} else {
setRawData([])
}
activeTab.value = 'resultTab'
}
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => { const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
deviceId = _deviceId deviceId = _deviceId
scriptType = _scriptType scriptType = _scriptType
@@ -433,9 +447,13 @@ const close = () => {
visible.value = false; visible.value = false;
}; };
const setCheckResultData = (data: CheckData.ResCheckResult) => { const setCheckResultData = (data: CheckData.ResCheckResult|null) => {
// console.log("检测结果", data); // console.log("检测结果", data);
let result: CheckData.CheckResult[] = [] let result: CheckData.CheckResult[] = []
if (data == null || data == undefined) {
Object.assign(checkResultData, [])
return
}
if (data.dataA != null && data.dataB != null && data.dataC != null) { if (data.dataA != null && data.dataB != null && data.dataC != null) {
result.push({ result.push({
stdA: numberToFixed(data.dataA.resultData), stdA: numberToFixed(data.dataA.resultData),

View File

@@ -87,9 +87,9 @@
> >
<!-- :disabled='!scope.isSelected' --> <!-- :disabled='!scope.isSelected' -->
<el-button type="primary" :icon="Download" @click="handleTest('批量下载')" v-if="form.activeTabs === 3" <!-- <el-button type="primary" :icon="Download" @click="handleTest('批量下载')" v-if="form.activeTabs === 3"
>报告下载</el-button >报告下载</el-button
> > -->
<!-- :disabled='!scope.isSelected' --> <!-- :disabled='!scope.isSelected' -->
<!-- <el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3" <!-- <el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
>报告生成</el-button >报告生成</el-button
@@ -116,13 +116,13 @@
v-if="form.activeTabs === 3 && form.activeChildTabs === 1" v-if="form.activeTabs === 3 && form.activeChildTabs === 1"
>查看</el-button> >查看</el-button>
<el-button <!-- <el-button
type="primary" type="primary"
link link
:icon="Download" :icon="Download"
@click="openDrawer('报告下载', scope.row)" @click="openDrawer('报告下载', scope.row)"
v-if="form.activeTabs === 3 && form.activeChildTabs === 0 && scope.row.reportState === 1" v-if="form.activeTabs === 3 && form.activeChildTabs === 0 && scope.row.reportState === 1"
>报告下载</el-button> >报告下载</el-button> -->
<!-- <div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0"> <!-- <div class='cn-render-buttons' v-if="form.activeTabs === 3 && form.activeChildTabs === 0">
<el-dropdown trigger='click'> <el-dropdown trigger='click'>
@@ -178,20 +178,20 @@
v-if="form.activeTabs === 5" v-if="form.activeTabs === 5"
>误差体系更换</el-button> >误差体系更换</el-button>
<div class='cn-render-buttons' v-if="form.activeTabs === 5 "> <!-- <div class='cn-render-buttons' v-if="form.activeTabs === 5 ">
<el-dropdown trigger='click'> <el-dropdown trigger='click'>
<el-button link type='primary' :icon="Download" class='table-operate'> <el-button link type='primary' :icon="Download" class='table-operate'>
<div class='table-operate-text'>报告下载</div> <div class='table-operate-text'>报告下载</div>
</el-button> </el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<!-- <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>Q/GDW 1650.2-2016 报告</el-dropdown-item>
<el-dropdown-item>GBT 19862-2016 报告</el-dropdown-item> <el-dropdown-item>GBT 19862-2016 报告</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div> -->
<!-- <el-button <!-- <el-button
dictType="primary" dictType="primary"
link link
@@ -229,7 +229,7 @@
></matchPopup> ></matchPopup>
<!--系数校准--> <!--系数校准-->
<ChannelsTest ref="channelsTest" :webMsgSend="webMsgSend"></ChannelsTest> <ChannelsTest ref="channelsTest" :webMsgSend="webMsgSend" @quitClicked="handleQuitClicked"></ChannelsTest>
</div> </div>
</template> </template>
@@ -451,6 +451,13 @@ const getTableList = async (params: any) => {
'reportState': form.value.checkReportStatus, 'reportState': form.value.checkReportStatus,
'name':form.value.search 'name':form.value.search
}); });
}else{//点击树根节点,表格显示无数据
return getBoundPqDevList({'planId': '',
'checkStateList': [0],
'checkResult': form.value.checkResult,
'reportState': form.value.checkReportStatus,
'name':form.value.search
});
} }
}; };
@@ -579,9 +586,6 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
}, },
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow}, { prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
]) ])
// 跳转详情页 // 跳转详情页
const toDetail = () => { const toDetail = () => {
router.push( router.push(
@@ -1025,7 +1029,6 @@ const handleTest = async (val:string) => {
}; };
// 打开 drawer(新增、查看、编辑) // 打开 drawer(新增、查看、编辑)
const openDrawer = async (title: string, row: any) => { const openDrawer = async (title: string, row: any) => {
if (title === '查看') if (title === '查看')
@@ -1109,9 +1112,6 @@ onBeforeMount(async () => {
})) }))
}) })
const handleQuitClicked = () => { const handleQuitClicked = () => {
emit('batchGenerateClicked'); // 触发事件 emit('batchGenerateClicked'); // 触发事件
}; };

View File

@@ -247,12 +247,12 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
} }
} else { } else {
let tempChnResult: CheckData.ChnCheckResultEnum = device.chnResult[0] let tempChnResult: CheckData.ChnCheckResultEnum = device.chnResult[0]
if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.FAIL)) {
tempChnResult = CheckData.ChnCheckResultEnum.FAIL
}
if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.ERRORDATA)) { if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.ERRORDATA)) {
tempChnResult = CheckData.ChnCheckResultEnum.ERRORDATA tempChnResult = CheckData.ChnCheckResultEnum.ERRORDATA
} }
if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.FAIL)) {
tempChnResult = CheckData.ChnCheckResultEnum.FAIL
}
if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.TIMEOUT)) { if (device.chnResult.some(item => item == CheckData.ChnCheckResultEnum.TIMEOUT)) {
tempChnResult = CheckData.ChnCheckResultEnum.TIMEOUT tempChnResult = CheckData.ChnCheckResultEnum.TIMEOUT
} }
@@ -296,6 +296,7 @@ watch(testStatus, function (newValue, oldValue) {
if (newValue == 'start') { if (newValue == 'start') {
ElMessage.success('初始化开始!') ElMessage.success('初始化开始!')
startData.value = new Date();
showTestLog() showTestLog()
if (oldValue == 'error') { if (oldValue == 'error') {
@@ -423,16 +424,16 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'Pause_Success': case 'Pause_Success':
ElMessage.success('暂停成功') ElMessage.success('暂停成功')
emit('update:testStatus', 'paused')
handlePauseTest() handlePauseTest()
emit('update:testStatus', 'paused')
break; break;
// case 'Pause_Fail': // case 'Pause_Fail':
// ElMessage.error('暂停失败') // ElMessage.error('暂停失败')
// break; // break;
case 'Resume_Success': case 'Resume_Success':
ElMessage.success('开始继续检测') ElMessage.success('开始继续检测')
emit('update:testStatus', 'process')
handleResumeTest() handleResumeTest()
emit('update:testStatus', 'process')
break; break;
// case 'Resume_Fail': // case 'Resume_Fail':
// ElMessage.error('无法继续检测') // ElMessage.error('无法继续检测')
@@ -606,8 +607,6 @@ watch(webMsgSend, function (newValue, oldValue) {
} }
break; break;
case 'Quit': case 'Quit':
//updatePercentage()
//updateLog(false)
console.log('检测结束') console.log('检测结束')
break; break;
} }
@@ -750,6 +749,9 @@ function getTimeDifference(timeDifference: number): string {
return `: ${minutes} 分钟, ${seconds}` return `: ${minutes} 分钟, ${seconds}`
} }
} }
watch(testLogList, () => {
scrollToBottom();
}, {deep: true})
// 更新日志 // 更新日志
const updateLog = (isStart: boolean) => { const updateLog = (isStart: boolean) => {
@@ -763,7 +765,6 @@ const updateLog = (isStart: boolean) => {
// debugger // debugger
if (activeIndex <= checkTotal) { if (activeIndex <= checkTotal) {
if (isStart) { if (isStart) {
startData.value = new Date();
testLogList.push({ testLogList.push({
type: 'info', type: 'info',
log: currentTime.value + ` ${scriptData[activeIndex - 1].scriptName}准确度检测:开始`, log: currentTime.value + ` ${scriptData[activeIndex - 1].scriptName}准确度检测:开始`,
@@ -809,8 +810,6 @@ const updateLog = (isStart: boolean) => {
} }
} }
} }
scrollToBottom();
} }
// 动态获取表格单元格样式 // 动态获取表格单元格样式
@@ -832,6 +831,9 @@ const setErrorCheckItem = (scriptType: string, devices: CheckData.DeviceCheckRes
tempChnResult.push(...devices[i].chnResult) tempChnResult.push(...devices[i].chnResult)
} }
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.ERRORDATA)) {
type = CheckData.ChnCheckResultEnum.ERRORDATA
}
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.FAIL)) { if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.FAIL)) {
type = CheckData.ChnCheckResultEnum.FAIL type = CheckData.ChnCheckResultEnum.FAIL
} }
@@ -846,9 +848,6 @@ const setErrorCheckItem = (scriptType: string, devices: CheckData.DeviceCheckRes
} }
} }
} }
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.ERRORDATA)) {
type = CheckData.ChnCheckResultEnum.ERRORDATA
}
errorCheckItem.push({scriptType, type: type}) errorCheckItem.push({scriptType, type: type})
} }
@@ -885,7 +884,7 @@ const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: Ch
// chnResult: [1, 1, 1, 1], // chnResult: [1, 1, 1, 1],
// deviceId: "2957b271f39d4240a1c5e275c453676c", // deviceId: "2957b271f39d4240a1c5e275c453676c",
// deviceName: "测试003" // deviceName: "测试003"
// }, // }
// ] // ]
let temp = null let temp = null
if (isStart) { if (isStart) {
@@ -1019,12 +1018,6 @@ const handleClick = (item: any, chnNum: number, scriptType: string) => {
type: 'warning', type: 'warning',
}) })
} }
// if (flag === 1) {
// ElMessageBox.alert('该测试项数据异常', '数据异常', {
// confirmButtonText: '确定',
// type: 'warning',
// })
// }
if (flag === -1 || flag === 1) { if (flag === -1 || flag === 1) {
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType); dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType);
} }

View File

@@ -202,10 +202,6 @@ const tableRef2 = ref()
const currentId = ref('') const currentId = ref('')
watch( watch(
() => form.value, () => form.value,
(val, oldVal) => { (val, oldVal) => {
@@ -271,7 +267,6 @@ const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefin
const getPieData = async (id: string) => { const getPieData = async (id: string) => {
currentId.value = id // 设置当前ID currentId.value = id // 设置当前ID
// 初始化计数对象 // 初始化计数对象
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 } const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 } const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
@@ -306,6 +301,10 @@ const getPieData = async (id: string) => {
reportStateCount[t.reportState]++ reportStateCount[t.reportState]++
} }
}) })
}else{
planName.value = '所选计划:'
} }
// 检查 checkStateCount 是否全为 0 // 检查 checkStateCount 是否全为 0
@@ -339,6 +338,7 @@ chartsData3.value = [
pieRef3.value.init() pieRef3.value.init()
} }
const getTree = (data?: any) => { const getTree = (data?: any) => {
treeRef.value.getTreeData(data) treeRef.value.getTreeData(data)
} }
//前往检测 //前往检测
@@ -434,9 +434,18 @@ onBeforeMount(async () => {
} }
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]> planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
if (planList.value.data[0].children[0]) { for (let i = 0; i < planList.value.data.length; i++) {
currentId.value = planList.value.data[0].children[0].id if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id
break; // 确保只执行一次
}
} }
// if (planList.value.data[0].children[0]) {
// currentId.value = planList.value.data[0].children[0].id
// console.log('currentId.value',planList.value.data[0])
// }
if (chartsInfoRef.value) { if (chartsInfoRef.value) {
resizeObserver.observe(chartsInfoRef.value) resizeObserver.observe(chartsInfoRef.value)
} }
@@ -452,7 +461,7 @@ onUnmounted(() => {
}) })
const handleBatchGenerate = () => { const handleBatchGenerate = () => {
// console.log('批量生成按钮被点击了'); console.log('批量生成按钮被点击了');
// 在这里添加其他逻辑,比如显示对话框、更新状态等 // 在这里添加其他逻辑,比如显示对话框、更新状态等
getPieData(currentId.value) getPieData(currentId.value)

View File

@@ -21,16 +21,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='设备模式' prop='pattern' > <!-- <el-form-item label='设备模式' prop='pattern' >-->
<el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled> <!-- <el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled>-->
<el-option <!-- <el-option -->
v-for="item in dictStore.getDictData('Pattern')" <!-- v-for="item in dictStore.getDictData('Pattern')"-->
:key="item.id" <!-- :key="item.id"-->
:label="item.name" <!-- :label="item.name"-->
:value="item.id" <!-- :value="item.id"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item> -->
<el-form-item label='设备厂家' prop='manufacturer' v-if="scene != '1'"> <el-form-item label='设备厂家' prop='manufacturer' v-if="scene != '1'">
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家"> <el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家">
<el-option <el-option
@@ -41,7 +41,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出厂日期" prop="createDate" > <el-form-item label="出厂日期" prop="createDate" v-if="scene === '0'">
<el-date-picker <el-date-picker
v-model="formContent.createDate" v-model="formContent.createDate"
placeholder="请选择出厂日期" placeholder="请选择出厂日期"
@@ -200,7 +200,7 @@ const disabledDate = (time: Date) => {
hardwareVersion: '', hardwareVersion: '',
softwareVersion: '', softwareVersion: '',
protocol: 'MMS', protocol: 'MMS',
ip: '192.168.1.200', ip: '172.17.102.200',
port: 102, port: 102,
encryptionFlag: 0, encryptionFlag: 0,
reCheckNum:0, reCheckNum:0,
@@ -229,7 +229,7 @@ const disabledDate = (time: Date) => {
hardwareVersion: '', hardwareVersion: '',
softwareVersion: '', softwareVersion: '',
protocol: 'MMS', protocol: 'MMS',
ip: '192.168.1.200', ip: '172.17.102.200',
port: 102, port: 102,
encryptionFlag: 0, encryptionFlag: 0,
reCheckNum:0, reCheckNum:0,
@@ -262,7 +262,6 @@ const baseRules: Record<string, Array<FormItemRule>> = {
{ required: true, message: '额定电流必填!', trigger: 'blur' }, { required: true, message: '额定电流必填!', trigger: 'blur' },
{ pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' } { pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' }
], ],
createDate: [{ required: true, message: '生产日期必填!', trigger: 'blur' }],
createId: [{ required: true, message: '出厂编号必填!', trigger: 'blur' }], createId: [{ required: true, message: '出厂编号必填!', trigger: 'blur' }],
ip: [ ip: [
{ required: true, message: 'IP地址必填', trigger: 'blur' }, { required: true, message: 'IP地址必填', trigger: 'blur' },
@@ -282,18 +281,25 @@ const baseRules: Record<string, Array<FormItemRule>> = {
const rules = computed(() => { const rules = computed(() => {
const dynamicRules = { ...baseRules }; const dynamicRules = { ...baseRules };
if (scene.value === '0'){//只有电科院需要展示
dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }];
}
if (scene.value !== '0') { if (scene.value !== '0') {
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }]; dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }];
dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }]; dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }];
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
} }
if (scene.value !== '2') { if (scene.value !== '2') {
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
} }
return dynamicRules; return dynamicRules;
}); });

View File

@@ -73,10 +73,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{ {
prop: 'name', prop: 'name',
label: '名称', label: '名称',
isShow: appSceneStore.currentScene != '1', search: { el: 'input' },
...(appSceneStore.currentScene != '1' ? { // isShow: appSceneStore.currentScene != '1',
search: { el: 'input' }, // ...(appSceneStore.currentScene != '1' ? {
} : {}), // search: { el: 'input' },
// } : {}),
minWidth: 200, minWidth: 200,
}, },
{ {
@@ -93,9 +94,10 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'createDate', prop: 'createDate',
label: '出厂日期', label: '出厂日期',
minWidth: 200, minWidth: 200,
search: { isShow: appSceneStore.currentScene === '0',
span: 2, ...(appSceneStore.currentScene === '0' ? {
render: () => { search: {
render: () => {
return ( return (
<div class='flx-flex-start'> <div class='flx-flex-start'>
<TimeControl <TimeControl
@@ -105,7 +107,21 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
</div> </div>
) )
}, },
}, },
} : {}),
// search: {
// span: 2,
// render: () => {
// return (
// <div class='flx-flex-start'>
// <TimeControl
// default={'月'}
// onUpdate-dates={handleDateChange}
// />
// </div>
// )
// },
// },
}, },
{ {
prop: 'devChns', prop: 'devChns',

View File

@@ -44,6 +44,11 @@ import ValueTypePopup from './components/valueTypePopup.vue'
} from '@/api/device/testScript/index' } from '@/api/device/testScript/index'
import { computed, reactive, ref } from 'vue' import { computed, reactive, ref } from 'vue'
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
defineOptions({
name: '/testScript'
})
const comparisonPopup = ref() const comparisonPopup = ref()
const testScriptPopup = ref() const testScriptPopup = ref()
const valueTypePopup = ref() const valueTypePopup = ref()