数据查询检测次数默认最后一次
This commit is contained in:
@@ -34,7 +34,7 @@
|
|||||||
<el-input v-model="formContent.deviceName" :disabled="true" />
|
<el-input v-model="formContent.deviceName" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通道号">
|
<el-form-item label="通道号">
|
||||||
<el-select v-model="formContent.chnNum" @change="getResults" :disabled="sourceKey == 1">
|
<el-select v-model="formContent.chnNum" @change="handleChnNumChange" :disabled="sourceKey == 1">
|
||||||
<el-option v-for="item in chnList" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in chnList" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -305,7 +305,7 @@ const getBasicInformation = async () => {
|
|||||||
formContent.deviceName = res.data.deviceName
|
formContent.deviceName = res.data.deviceName
|
||||||
formContent.errorSysId = res.data.errorSysId
|
formContent.errorSysId = res.data.errorSysId
|
||||||
chnMapList.value = res.data.chnMap
|
chnMapList.value = res.data.chnMap
|
||||||
formContent.num = res.data.checkNum
|
//formContent.num = res.data.checkNum
|
||||||
|
|
||||||
let chnMap: string[] = []
|
let chnMap: string[] = []
|
||||||
for (let key in res.data.chnMap) {
|
for (let key in res.data.chnMap) {
|
||||||
@@ -313,6 +313,12 @@ const getBasicInformation = async () => {
|
|||||||
}
|
}
|
||||||
chnList.value = chnMap
|
chnList.value = chnMap
|
||||||
formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum
|
formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum
|
||||||
|
// 新增:设置检测次数默认值为chnMap数组的最后一位
|
||||||
|
if (chnMapList.value[formContent.chnNum] && chnMapList.value[formContent.chnNum].length > 0) {
|
||||||
|
// 获取当前通道号对应的检测次数数组,并设置为最后一个值(最大值)
|
||||||
|
const numList = chnMapList.value[formContent.chnNum]
|
||||||
|
formContent.num = numList[numList.length - 1]
|
||||||
|
}
|
||||||
waveNumCount.value = res.data.waveNumTotal
|
waveNumCount.value = res.data.waveNumTotal
|
||||||
|
|
||||||
// 查询表格数据
|
// 查询表格数据
|
||||||
@@ -343,6 +349,24 @@ const getBasicInformation = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleChnNumChange = (value: string) => {
|
||||||
|
formContent.chnNum = value
|
||||||
|
// 更新检测次数为当前通道的最后一条记录
|
||||||
|
updateCheckNumForChn(value)
|
||||||
|
// 获取结果数据
|
||||||
|
getResults('')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新检测次数为指定通道的最后一条记录
|
||||||
|
const updateCheckNumForChn = (chnNum: string) => {
|
||||||
|
if (chnMapList.value[chnNum] && chnMapList.value[chnNum].length > 0) {
|
||||||
|
// 获取当前通道号对应的检测次数数组,并设置为最后一个值(最大值)
|
||||||
|
const numList = chnMapList.value[chnNum]
|
||||||
|
formContent.num = numList[numList.length - 1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 左边树变化
|
// 左边树变化
|
||||||
const handleNodeClick = (data: any) => {
|
const handleNodeClick = (data: any) => {
|
||||||
rowList.value.scriptName = data.scriptName
|
rowList.value.scriptName = data.scriptName
|
||||||
@@ -377,17 +401,22 @@ const handleNodeClick = (data: any) => {
|
|||||||
}
|
}
|
||||||
// 获取结果
|
// 获取结果
|
||||||
const getResults = async (code: any) => {
|
const getResults = async (code: any) => {
|
||||||
|
console.log('getResults', code)
|
||||||
checkResultData.value = []
|
checkResultData.value = []
|
||||||
rawTableData.value = []
|
rawTableData.value = []
|
||||||
|
|
||||||
|
|
||||||
|
// 判断是否为录波数据请求
|
||||||
|
const isWaveDataRequest = code === 'wave_data' || isWaveData.value
|
||||||
|
|
||||||
getContrastResult({
|
getContrastResult({
|
||||||
planId: checkStore.plan.id,
|
planId: checkStore.plan.id,
|
||||||
scriptType: rowList.value.scriptType,
|
scriptType: rowList.value.scriptType,
|
||||||
deviceId: formContent.deviceId,
|
deviceId: formContent.deviceId,
|
||||||
chnNum: formContent.chnNum,
|
chnNum: formContent.chnNum,
|
||||||
num: formContent.num == '' ? null : formContent.num,
|
num: formContent.num == '' ? null : formContent.num,
|
||||||
waveNum: code == 'wave_data' ? waveNumber.value : null,
|
waveNum: isWaveDataRequest ? waveNumber.value : null,
|
||||||
isWave: code == 'wave_data' ? true : false ,
|
isWave: isWaveDataRequest ,
|
||||||
patternId: pattern.value
|
patternId: pattern.value
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
let list: string[] = []
|
let list: string[] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user