接口调整

This commit is contained in:
sjl
2025-08-11 15:59:29 +08:00
parent c85eac3888
commit 77d2176812
8 changed files with 153 additions and 321 deletions

View File

@@ -25,10 +25,26 @@
<el-option v-for="item in chnList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item v-if="checkStore.showDetailType===1">
<el-button type="primary" :icon="Postcard" >报告生成</el-button>
</el-form-item>
<el-form-item v-if="checkStore.showDetailType===0">
<el-button type="primary" :icon="Histogram" >重新计算</el-button>
</el-form-item>
</el-form>
</div>
<div class="data-check-body">
<div class="content-right">
<div class="content-right-title">
<div style="width: 840px;">
<span class="content-right-title-text">当前检测项目</span>
<span style="color: var(--el-color-primary);">频率</span>
</div>
<el-form-item style="margin-left: 280px;margin-bottom:0px !important;width: 280px;" label='测试项'>
<el-cascader v-model="currentCheckItem" :options="options" clearable />
</el-form-item>
</div>
<div class="content-right-Tabs">
<el-tabs type="border-card" v-model="activeTab">
<el-tab-pane label="检测结果" name="resultTab">
@@ -52,6 +68,7 @@ import CompareDataCheckResultTable from './compareDataCheckResultTable.vue'
import CompareDataCheckRawDataTable from './compareDataCheckRawDataTable.vue'
import {CheckData} from "@/api/check/interface";
import {useCheckStore} from "@/stores/modules/check";
import {Histogram, Postcard} from "@element-plus/icons-vue";
const {appendToBody} = withDefaults(defineProps<{
appendToBody: boolean
@@ -64,6 +81,9 @@ const visible = ref(false)
const treeRef = ref()
const searchValue = ref<string>('')
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
const activeTab = ref('resultTab')
const currentCheckItem = ref<any>()
watch(searchValue, (val) => {
treeRef.value!.filter(val)
})
@@ -92,8 +112,38 @@ const rawTableData = reactive<CheckData.RawDataItem[]>([])
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
visible.value = true;
// 设置默认选中第一个选项
if (options.length > 0) {
const firstOption = options[0];
currentCheckItem.value = [firstOption.value];
// 如果第一个选项有子选项,默认也选中第一个子选项
if (firstOption.children && firstOption.children.length > 0) {
currentCheckItem.value.push(firstOption.children[0].value);
}
}
}
const options = [
{
value: 'guide',
label: '谐波电压',
children: [
{
value: 'disciplines',
label: '2次',
},
{
value: 'disciplines',
label: '3次',
},
],
},
]
defineExpose({
open
@@ -158,7 +208,7 @@ defineExpose({
.content-right-title {
display: flex;
padding: 10px 0;
margin-top: 10px;
margin-top: 0px;
line-height: 1.5;
.content-right-title-text {