Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -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.138:8080/"]]张文
|
||||
|
||||
@@ -46,7 +46,6 @@ router.beforeEach(async (to, from, next) => {
|
||||
const authStore = useAuthStore()
|
||||
// 1.NProgress 开始
|
||||
NProgress.start()
|
||||
|
||||
// 2.动态设置标题
|
||||
const title = import.meta.env.VITE_GLOB_APP_TITLE
|
||||
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title
|
||||
|
||||
@@ -36,6 +36,7 @@ export const initDynamicRouter = async () => {
|
||||
// 3.添加动态路由
|
||||
authStore.flatMenuListGet.forEach(item => {
|
||||
item.children && delete item.children;
|
||||
|
||||
if (item.component && typeof item.component == "string") {
|
||||
item.component = modules["/src/views" + item.component + ".vue"];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<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="dialog-content">
|
||||
<div class="right-title">
|
||||
@@ -241,17 +241,17 @@ watch(webMsgSend,function (newValue,oldValue){
|
||||
item.devName === newValue.data.devName);
|
||||
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
|
||||
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.bVuXi = newValue.data.bVuXi;
|
||||
firstCoefficientVO.bVuXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString();
|
||||
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.aIeXi = newValue.data.aIeXi;
|
||||
firstCoefficientVO.aIeXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString();
|
||||
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.cIeXi = newValue.data.cIeXi;
|
||||
firstCoefficientVO.cIeXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString();
|
||||
//console.log(newValue.data.devName + '对象:', firstCoefficientVO);
|
||||
activeIndex.value++;
|
||||
} else {
|
||||
@@ -511,6 +511,11 @@ const updateErrorState = (index: number, hasError: boolean) => {
|
||||
//console.log('tableDataMap',tableDataMap);
|
||||
}
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'quitClicked'): void;
|
||||
}>();
|
||||
|
||||
const handleCancel=() => {
|
||||
// 清空 name, channel, total
|
||||
name.value = [];
|
||||
@@ -521,6 +526,7 @@ const updateErrorState = (index: number, hasError: boolean) => {
|
||||
active.value = 0
|
||||
dialogVisible.value = false
|
||||
editableTabsValue.value = '0'
|
||||
emit('quitClicked'); // 触发事件
|
||||
}
|
||||
|
||||
const getTableDataForChannel = (index: number): any[] => {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
<el-table-column prop="monitorNum" label="监测点序号" width="80"/>
|
||||
<el-table-column prop="desc" label="描述" width="90"/>
|
||||
<el-table-column label="电压通道" >
|
||||
<el-table-column prop="Ua" label="L1(V)">
|
||||
<el-table-column prop="aVuData" label="被检值">
|
||||
<el-table-column prop="Ua" label="A相">
|
||||
<el-table-column prop="aVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.aVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -20,7 +20,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="aVuXi" label="检测结果">
|
||||
<el-table-column prop="aVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aVuXi === '不合格'"
|
||||
@@ -54,8 +54,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="L2(V)">
|
||||
<el-table-column prop="bVuData" label="被检值">
|
||||
<el-table-column prop="Ub" label="B相">
|
||||
<el-table-column prop="bVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -65,7 +65,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bVuXi" label="检测结果">
|
||||
<el-table-column prop="bVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bVuXi === '不合格'"
|
||||
@@ -93,8 +93,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="L3(V)">
|
||||
<el-table-column prop="cVuData" label="被检值">
|
||||
<el-table-column prop="Uc" label="C相">
|
||||
<el-table-column prop="cVuData" label="被检值(V)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cVuData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -104,7 +104,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cVuXi" label="检测结果">
|
||||
<el-table-column prop="cVuXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cVuXi === '不合格'"
|
||||
@@ -134,8 +134,8 @@
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="电流通道" >
|
||||
<el-table-column prop="Ia" label="L1(A)">
|
||||
<el-table-column prop="aIeData" label="被检值">
|
||||
<el-table-column prop="Ia" label="A相">
|
||||
<el-table-column prop="aIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.aIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -145,7 +145,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="aIeXi" label="检测结果">
|
||||
<el-table-column prop="aIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.aIeXi === '不合格'"
|
||||
@@ -173,8 +173,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ib" label="L2(A)">
|
||||
<el-table-column prop="bIeData" label="被检值">
|
||||
<el-table-column prop="Ib" label="B相">
|
||||
<el-table-column prop="bIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.bIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -184,7 +184,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bIeXi" label="检测结果">
|
||||
<el-table-column prop="bIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.bIeXi === '不合格'"
|
||||
@@ -212,8 +212,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ic" label="L3(A)">
|
||||
<el-table-column prop="cIeData" label="被检值">
|
||||
<el-table-column prop="Ic" label="C相">
|
||||
<el-table-column prop="cIeData" label="被检值(A)" width="100px">
|
||||
<template #default="scope">
|
||||
<el-icon v-if="scope.row.cIeData === '—'&& scope.row.loading" class="loading-box">
|
||||
<el-icon-loading />
|
||||
@@ -223,7 +223,7 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cIeXi" label="检测结果">
|
||||
<el-table-column prop="cIeXi" label="检测结果" width="90px">
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
v-if="scope.row.cIeXi === '不合格'"
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||
<el-table-column prop="time" label="数据时间"/>
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column prop="dataA" :label="'A'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataB" :label="'B'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataC" :label="'C'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataA" :label="'A相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataB" :label="'B相'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
<template v-if="phaseT === 1">
|
||||
<el-table-column prop="dataT" :label="'T'+(unit==''?'':'('+unit+')')"/>
|
||||
<el-table-column prop="dataT" :label="'T相'+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<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="dataA" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataA" label="检测结果">
|
||||
@@ -26,7 +26,7 @@
|
||||
</template>
|
||||
</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="dataB" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataB" label="检测结果">
|
||||
@@ -43,7 +43,7 @@
|
||||
</template>
|
||||
</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="dataC" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataC" label="检测结果">
|
||||
@@ -63,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<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="dataT" label="被检值"/>
|
||||
<el-table-column prop="isDataT" label="检测结果">
|
||||
|
||||
@@ -206,8 +206,8 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
|
||||
scriptType,
|
||||
code: parseInt(checkStore.planCode)
|
||||
})
|
||||
updateTreeFly(resTreeDataTemp, 2)
|
||||
updateTreeFly(resTreeDataTemp, 4)
|
||||
updateTreeFly(resTreeDataTemp, 2)
|
||||
|
||||
Object.assign(treeDataAll, resTreeDataTemp)
|
||||
|
||||
@@ -237,16 +237,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
|
||||
watch(currentCheckItem, (newVal, oldVal) => {
|
||||
// console.log("当前检测项", newVal);
|
||||
if (newVal) {
|
||||
// let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间'
|
||||
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal)
|
||||
setCheckResultData(resCheckResult)
|
||||
|
||||
let tempRawData = resTableData.rawData.get(newVal)
|
||||
if (tempRawData) {
|
||||
setRawData(tempRawData)
|
||||
} else {
|
||||
setRawData([])
|
||||
}
|
||||
doCurrentCheckItemUpdate(newVal)
|
||||
}
|
||||
activeTab.value = 'resultTab'
|
||||
})
|
||||
@@ -312,6 +303,13 @@ const updateTableData = async () => {
|
||||
let resCheckResult: CheckData.ResCheckResult = {}
|
||||
let resRawData: CheckData.RawDataItem[] = []
|
||||
|
||||
if (keys1.length === 0) {
|
||||
checkList.length = 0
|
||||
checkResultData.length = 0
|
||||
rawTableData.length = 0
|
||||
currentCheckItem.value = ''
|
||||
}
|
||||
|
||||
if (keys1.length === 1) {
|
||||
resCheckResult = resTableData.resultData.get(keys1[0])
|
||||
resRawData = resTableData.rawData.get(keys2[0])
|
||||
@@ -364,10 +362,12 @@ const updateTableData = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
// debugger
|
||||
Object.assign(checkList, tempCheckList)
|
||||
|
||||
currentCheckItem.value = checkList[0].value
|
||||
if (currentCheckItem.value == tempCheckList[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) => {
|
||||
deviceId = _deviceId
|
||||
scriptType = _scriptType
|
||||
@@ -433,9 +447,13 @@ const close = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const setCheckResultData = (data: CheckData.ResCheckResult) => {
|
||||
const setCheckResultData = (data: CheckData.ResCheckResult|null) => {
|
||||
// console.log("检测结果", data);
|
||||
let result: CheckData.CheckResult[] = []
|
||||
if (data == null || data == undefined) {
|
||||
Object.assign(checkResultData, [])
|
||||
return
|
||||
}
|
||||
if (data.dataA != null && data.dataB != null && data.dataC != null) {
|
||||
result.push({
|
||||
stdA: numberToFixed(data.dataA.resultData),
|
||||
|
||||
@@ -87,9 +87,9 @@
|
||||
>
|
||||
|
||||
<!-- :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
|
||||
>
|
||||
> -->
|
||||
<!-- :disabled='!scope.isSelected' -->
|
||||
<!-- <el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
|
||||
>报告生成</el-button
|
||||
@@ -116,13 +116,13 @@
|
||||
v-if="form.activeTabs === 3 && form.activeChildTabs === 1"
|
||||
>查看</el-button>
|
||||
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
type="primary"
|
||||
link
|
||||
:icon="Download"
|
||||
@click="openDrawer('报告下载', scope.row)"
|
||||
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">
|
||||
<el-dropdown trigger='click'>
|
||||
@@ -178,20 +178,20 @@
|
||||
v-if="form.activeTabs === 5"
|
||||
>误差体系更换</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-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>
|
||||
</div> -->
|
||||
<!-- <el-button
|
||||
dictType="primary"
|
||||
link
|
||||
@@ -229,7 +229,7 @@
|
||||
></matchPopup>
|
||||
|
||||
<!--系数校准-->
|
||||
<ChannelsTest ref="channelsTest" :webMsgSend="webMsgSend"></ChannelsTest>
|
||||
<ChannelsTest ref="channelsTest" :webMsgSend="webMsgSend" @quitClicked="handleQuitClicked"></ChannelsTest>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -451,6 +451,13 @@ const getTableList = async (params: any) => {
|
||||
'reportState': form.value.checkReportStatus,
|
||||
'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},
|
||||
])
|
||||
|
||||
|
||||
|
||||
// 跳转详情页
|
||||
const toDetail = () => {
|
||||
router.push(
|
||||
@@ -1025,7 +1029,6 @@ const handleTest = async (val:string) => {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = async (title: string, row: any) => {
|
||||
if (title === '查看')
|
||||
@@ -1109,9 +1112,6 @@ onBeforeMount(async () => {
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
const handleQuitClicked = () => {
|
||||
emit('batchGenerateClicked'); // 触发事件
|
||||
};
|
||||
|
||||
@@ -247,12 +247,12 @@ const checkResultView: ComputedRef<CheckData.ScriptChnViewItem[]> = computed(()
|
||||
}
|
||||
} else {
|
||||
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)) {
|
||||
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)) {
|
||||
tempChnResult = CheckData.ChnCheckResultEnum.TIMEOUT
|
||||
}
|
||||
@@ -296,6 +296,7 @@ watch(testStatus, function (newValue, oldValue) {
|
||||
if (newValue == 'start') {
|
||||
ElMessage.success('初始化开始!')
|
||||
|
||||
startData.value = new Date();
|
||||
showTestLog()
|
||||
|
||||
if (oldValue == 'error') {
|
||||
@@ -423,16 +424,16 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
break;
|
||||
case 'Pause_Success':
|
||||
ElMessage.success('暂停成功')
|
||||
emit('update:testStatus', 'paused')
|
||||
handlePauseTest()
|
||||
emit('update:testStatus', 'paused')
|
||||
break;
|
||||
// case 'Pause_Fail':
|
||||
// ElMessage.error('暂停失败')
|
||||
// break;
|
||||
case 'Resume_Success':
|
||||
ElMessage.success('开始继续检测')
|
||||
emit('update:testStatus', 'process')
|
||||
handleResumeTest()
|
||||
emit('update:testStatus', 'process')
|
||||
break;
|
||||
// case 'Resume_Fail':
|
||||
// ElMessage.error('无法继续检测')
|
||||
@@ -606,8 +607,6 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
}
|
||||
break;
|
||||
case 'Quit':
|
||||
//updatePercentage()
|
||||
//updateLog(false)
|
||||
console.log('检测结束')
|
||||
break;
|
||||
}
|
||||
@@ -750,6 +749,9 @@ function getTimeDifference(timeDifference: number): string {
|
||||
return `: ${minutes} 分钟, ${seconds} 秒`
|
||||
}
|
||||
}
|
||||
watch(testLogList, () => {
|
||||
scrollToBottom();
|
||||
}, {deep: true})
|
||||
|
||||
// 更新日志
|
||||
const updateLog = (isStart: boolean) => {
|
||||
@@ -763,7 +765,6 @@ const updateLog = (isStart: boolean) => {
|
||||
// debugger
|
||||
if (activeIndex <= checkTotal) {
|
||||
if (isStart) {
|
||||
startData.value = new Date();
|
||||
testLogList.push({
|
||||
type: 'info',
|
||||
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)
|
||||
}
|
||||
|
||||
if (tempChnResult.some(item => item === CheckData.ChnCheckResultEnum.ERRORDATA)) {
|
||||
type = CheckData.ChnCheckResultEnum.ERRORDATA
|
||||
}
|
||||
if (tempChnResult.some(item => item === 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})
|
||||
}
|
||||
@@ -885,7 +884,7 @@ const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: Ch
|
||||
// chnResult: [1, 1, 1, 1],
|
||||
// deviceId: "2957b271f39d4240a1c5e275c453676c",
|
||||
// deviceName: "测试003"
|
||||
// },
|
||||
// }
|
||||
// ]
|
||||
let temp = null
|
||||
if (isStart) {
|
||||
@@ -1019,12 +1018,6 @@ const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
||||
type: 'warning',
|
||||
})
|
||||
}
|
||||
// if (flag === 1) {
|
||||
// ElMessageBox.alert('该测试项数据异常', '数据异常', {
|
||||
// confirmButtonText: '确定',
|
||||
// type: 'warning',
|
||||
// })
|
||||
// }
|
||||
if (flag === -1 || flag === 1) {
|
||||
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType);
|
||||
}
|
||||
|
||||
@@ -202,10 +202,6 @@ const tableRef2 = ref()
|
||||
const currentId = ref('')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
watch(
|
||||
() => form.value,
|
||||
(val, oldVal) => {
|
||||
@@ -271,7 +267,6 @@ const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefin
|
||||
|
||||
const getPieData = async (id: string) => {
|
||||
currentId.value = id // 设置当前ID
|
||||
|
||||
// 初始化计数对象
|
||||
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
|
||||
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
|
||||
@@ -306,6 +301,10 @@ const getPieData = async (id: string) => {
|
||||
reportStateCount[t.reportState]++
|
||||
}
|
||||
})
|
||||
|
||||
}else{
|
||||
|
||||
planName.value = '所选计划:'
|
||||
}
|
||||
|
||||
// 检查 checkStateCount 是否全为 0
|
||||
@@ -339,6 +338,7 @@ chartsData3.value = [
|
||||
pieRef3.value.init()
|
||||
}
|
||||
const getTree = (data?: any) => {
|
||||
|
||||
treeRef.value.getTreeData(data)
|
||||
}
|
||||
//前往检测
|
||||
@@ -434,9 +434,18 @@ onBeforeMount(async () => {
|
||||
}
|
||||
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
|
||||
|
||||
if (planList.value.data[0].children[0]) {
|
||||
currentId.value = planList.value.data[0].children[0].id
|
||||
for (let i = 0; i < planList.value.data.length; i++) {
|
||||
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) {
|
||||
resizeObserver.observe(chartsInfoRef.value)
|
||||
}
|
||||
@@ -452,7 +461,7 @@ onUnmounted(() => {
|
||||
})
|
||||
|
||||
const handleBatchGenerate = () => {
|
||||
// console.log('批量生成按钮被点击了');
|
||||
console.log('批量生成按钮被点击了');
|
||||
// 在这里添加其他逻辑,比如显示对话框、更新状态等
|
||||
getPieData(currentId.value)
|
||||
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备模式' prop='pattern' >
|
||||
<el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled>
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Pattern')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label='设备模式' prop='pattern' >-->
|
||||
<!-- <el-select v-model="formContent.pattern" clearable placeholder="请选择设备模式" disabled>-->
|
||||
<!-- <el-option -->
|
||||
<!-- v-for="item in dictStore.getDictData('Pattern')"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item> -->
|
||||
<el-form-item label='设备厂家' prop='manufacturer' v-if="scene != '1'">
|
||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家">
|
||||
<el-option
|
||||
@@ -41,7 +41,7 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂日期" prop="createDate" >
|
||||
<el-form-item label="出厂日期" prop="createDate" v-if="scene === '0'">
|
||||
<el-date-picker
|
||||
v-model="formContent.createDate"
|
||||
placeholder="请选择出厂日期"
|
||||
@@ -200,7 +200,7 @@ const disabledDate = (time: Date) => {
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '192.168.1.200',
|
||||
ip: '172.17.102.200',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum:0,
|
||||
@@ -229,7 +229,7 @@ const disabledDate = (time: Date) => {
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '192.168.1.200',
|
||||
ip: '172.17.102.200',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum:0,
|
||||
@@ -262,7 +262,6 @@ const baseRules: Record<string, Array<FormItemRule>> = {
|
||||
{ required: true, message: '额定电流必填!', trigger: 'blur' },
|
||||
{ pattern: /^\d+(\.\d+)?$/, message: '额定电流格式错误', trigger: 'blur' }
|
||||
],
|
||||
createDate: [{ required: true, message: '生产日期必填!', trigger: 'blur' }],
|
||||
createId: [{ required: true, message: '出厂编号必填!', trigger: 'blur' }],
|
||||
ip: [
|
||||
{ required: true, message: 'IP地址必填!', trigger: 'blur' },
|
||||
@@ -282,18 +281,25 @@ const baseRules: Record<string, Array<FormItemRule>> = {
|
||||
const rules = computed(() => {
|
||||
const dynamicRules = { ...baseRules };
|
||||
|
||||
if (scene.value === '0'){//只有电科院需要展示
|
||||
dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }];
|
||||
}
|
||||
if (scene.value !== '0') {
|
||||
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
|
||||
dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }];
|
||||
dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }];
|
||||
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
|
||||
|
||||
}
|
||||
|
||||
if (scene.value !== '2') {
|
||||
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
|
||||
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return dynamicRules;
|
||||
});
|
||||
|
||||
|
||||
@@ -73,10 +73,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
isShow: appSceneStore.currentScene != '1',
|
||||
...(appSceneStore.currentScene != '1' ? {
|
||||
search: { el: 'input' },
|
||||
} : {}),
|
||||
// isShow: appSceneStore.currentScene != '1',
|
||||
// ...(appSceneStore.currentScene != '1' ? {
|
||||
// search: { el: 'input' },
|
||||
// } : {}),
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
@@ -93,8 +94,9 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
prop: 'createDate',
|
||||
label: '出厂日期',
|
||||
minWidth: 200,
|
||||
isShow: appSceneStore.currentScene === '0',
|
||||
...(appSceneStore.currentScene === '0' ? {
|
||||
search: {
|
||||
span: 2,
|
||||
render: () => {
|
||||
return (
|
||||
<div class='flx-flex-start'>
|
||||
@@ -106,6 +108,20 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
)
|
||||
},
|
||||
},
|
||||
} : {}),
|
||||
// search: {
|
||||
// span: 2,
|
||||
// render: () => {
|
||||
// return (
|
||||
// <div class='flx-flex-start'>
|
||||
// <TimeControl
|
||||
// default={'月'}
|
||||
// onUpdate-dates={handleDateChange}
|
||||
// />
|
||||
// </div>
|
||||
// )
|
||||
// },
|
||||
// },
|
||||
},
|
||||
{
|
||||
prop: 'devChns',
|
||||
|
||||
@@ -44,6 +44,11 @@ import ValueTypePopup from './components/valueTypePopup.vue'
|
||||
} from '@/api/device/testScript/index'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
defineOptions({
|
||||
name: '/testScript'
|
||||
})
|
||||
|
||||
|
||||
const comparisonPopup = ref()
|
||||
const testScriptPopup = ref()
|
||||
const valueTypePopup = ref()
|
||||
|
||||
Reference in New Issue
Block a user