录波数据查询

This commit is contained in:
sjl
2025-09-09 09:14:42 +08:00
parent 4cd6302ee0
commit d7cfe665e2
3 changed files with 180 additions and 17 deletions

View File

@@ -69,14 +69,43 @@
/>
</div>
<div class="content-right">
<div class="content-right-title">
<div class="content-right-title">
<div style="width: 840px">
<span class="content-right-title-text">当前检测项目</span>
<span style="color: var(--el-color-primary)">{{ rowList.scriptName }}</span>
<!-- 当code为'wave_data'时显示下拉框 -->
<el-select
v-if="isWaveData"
v-model="scriptNameOptions[0]"
style="width: 200px"
@change="handleScriptNameChange"
>
<el-option
v-for="item in scriptNameOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<!-- 否则显示原来的文本 -->
<span v-else style="color: var(--el-color-primary)">{{ rowList.scriptName }}</span>
</div>
<el-form-item
style="margin-left: 280px; margin-bottom: 0px !important; width: 280px"
label="测试项"
style="margin: 0 auto; margin-bottom: 0px !important; width: 200px; position: absolute; left: 50%; transform: translateX(-50%);"
label="录波次数"
v-if="isWaveData"
>
<el-select v-model="waveNumber">
<el-option
v-for="i in waveNumCount"
:key="i-1"
:label="i"
:value="i-1"
/>
</el-select>
</el-form-item>
<el-form-item
style="margin-left: 280px; margin-bottom: 0px !important; width: 300px"
label="测试项"
>
<el-select v-model="currentCheckItem">
<el-option
@@ -151,7 +180,22 @@ const defaultProps = {
}
const chnMapList: any = ref({})
const waveNumCount = ref(0)
const waveNumber = ref(0)
// 添加以下内容
const isWaveData = ref(false)
const scriptNameOptions = ref<{label: string, value: string}[]>([])
// 添加处理scriptName变化的方法
const handleScriptNameChange = (value: string) => {
rowList.value.scriptName = value
// 查找选中项的scriptType
const selectedItem = scriptData.value.find(item => item.scriptName === value)
if (selectedItem) {
rowList.value.scriptType = selectedItem.id
getResults('wave_data')
}
}
// 表单数据
const formContent = reactive<CheckData.DataCheck>({
scriptName: '',
@@ -244,7 +288,7 @@ const getBasicInformation = async () => {
scriptType: rowList.value.scriptType,
deviceId: formContent.deviceId,
chnNum: formContent.chnNum,
num: formContent.num == '' ? null : parseInt(formContent.num)
num: formContent.num == '' ? null : parseInt(formContent.num),
}).then((res: any) => {
formContent.dataRule = res.data.dataRule
formContent.deviceName = res.data.deviceName
@@ -257,19 +301,35 @@ const getBasicInformation = async () => {
}
chnList.value = chnMap
formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum
waveNumCount.value = res.data.waveNumTotal
// 查询表格数据
getResults()
getResults('')
})
}
// 左边树变化
const handleNodeClick = (data: any) => {
console.log('data', data)
rowList.value.scriptName = data.scriptName
rowList.value.scriptType = data.id
getResults()
// 判断是否为录波数据
if (data.code === 'wave_data') {
isWaveData.value = true
// 过滤掉"录波"选项,设置下拉框数据
scriptNameOptions.value = scriptData.value
.filter(item => item.code !== 'wave_data')
.map(item => ({
label: item.scriptName,
value: item.scriptName
}))
} else {
isWaveData.value = false
getResults(data.code)
}
}
// 获取结果
const getResults = async () => {
const getResults = async (code: any) => {
checkResultData.value = []
rawTableData.value = []
@@ -278,7 +338,9 @@ const getResults = async () => {
scriptType: rowList.value.scriptType,
deviceId: formContent.deviceId,
chnNum: formContent.chnNum,
num: formContent.num == '' ? null : formContent.num
num: formContent.num == '' ? null : formContent.num,
waveNum: code == 'wave_data' ? null : 0 ,
isWave: code == 'wave_data' ? true : false
}).then((res: any) => {
let list: string[] = []
for (let key in res.data.resultMap) {