检测脚本查看隐藏显示

This commit is contained in:
sjl
2025-03-04 16:01:34 +08:00
parent 3b198eb4ed
commit 492db88b45

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-dialog v-model="dialogVisible" :title= "titleType" v-bind="dialogBig"> <el-dialog v-model="dialogVisible" :title= "titleType" v-bind="dialogBig" >
<!-- <el-descriptions :column="5" border> <!-- <el-descriptions :column="5" border>
<el-descriptions-item label="脚本名称">测试</el-descriptions-item> <el-descriptions-item label="脚本名称">测试</el-descriptions-item>
<el-descriptions-item label="参照标准名称">GBT 19862</el-descriptions-item> <el-descriptions-item label="参照标准名称">GBT 19862</el-descriptions-item>
@@ -82,8 +82,8 @@
</div> </div>
</el-descriptions> --> </el-descriptions> -->
<div style="display: flex" class="mt10"> <div style="display: flex" class="mt10">
<el-tabs type="border-card" style="flex: 1"> <el-tabs type="border-card" style="flex: 1" v-if="harmVIsShow">
<el-tab-pane label="谐波电压"> <el-tab-pane label="谐波电压" >
<el-table <el-table
:data="tableData?.channelList[item * 2 - 2].harmList" :data="tableData?.channelList[item * 2 - 2].harmList"
border border
@@ -103,7 +103,7 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-tabs type="border-card" class="ml10" style="flex: 1"> <el-tabs type="border-card" class="ml10" style="flex: 1" v-if="harmAIsShow">
<el-tab-pane label="谐波电流"> <el-tab-pane label="谐波电流">
<el-table <el-table
:data="tableData?.channelList[item * 2 - 1].harmList" :data="tableData?.channelList[item * 2 - 1].harmList"
@@ -126,7 +126,7 @@
</el-tabs> </el-tabs>
</div> </div>
<div style="display: flex" class="mt10"> <div style="display: flex" class="mt10">
<el-tabs type="border-card" style="flex: 1"> <el-tabs type="border-card" style="flex: 1" v-if="iHarmVIsShow">
<el-tab-pane label="间谐波电压"> <el-tab-pane label="间谐波电压">
<el-table <el-table
:data="tableData?.channelList[item * 2 - 2].inharmList" :data="tableData?.channelList[item * 2 - 2].inharmList"
@@ -147,7 +147,7 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-tabs type="border-card" class="ml10" style="flex: 1"> <el-tabs type="border-card" class="ml10" style="flex: 1" v-if="iHarmAIsShow">
<el-tab-pane label="间谐波电流"> <el-tab-pane label="间谐波电流">
<el-table <el-table
:data="tableData?.channelList[item * 2 - 1].inharmList" :data="tableData?.channelList[item * 2 - 1].inharmList"
@@ -173,6 +173,7 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="参考设定值列表"> <el-tab-pane label="参考设定值列表">
<div class="tabPane">
<el-table <el-table
:data="setValue_TableData" :data="setValue_TableData"
:header-cell-style="{ :header-cell-style="{
@@ -182,7 +183,7 @@
}" }"
stripe stripe
:cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
height="550px" height="450px"
> >
<el-table-column type="index" label="序号" width="60" /> <el-table-column type="index" label="序号" width="60" />
<el-table-column prop="pname" label="参考设定值类型" /> <el-table-column prop="pname" label="参考设定值类型" />
@@ -211,8 +212,8 @@
{{ row.errorFlag == 0 ? '否' : '是' }} {{ row.errorFlag == 0 ? '否' : '是' }}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</el-dialog> </el-dialog>
@@ -222,11 +223,16 @@ import { ref, reactive } from 'vue'
import { dialogBig } from '@/utils/elementBind' import { dialogBig } from '@/utils/elementBind'
import { getDictTreeByCode } from '@/api/system/dictionary/dictTree' import { getDictTreeByCode } from '@/api/system/dictionary/dictTree'
import { scriptDtlsCheckDataList } from '@/api/device/testScript/index' import { scriptDtlsCheckDataList } from '@/api/device/testScript/index'
import { Dictionary } from 'lodash'
const dialogVisible = ref(false) const dialogVisible = ref(false)
const titleType = ref('') const titleType = ref('')
const tableData: any = ref({}) const tableData: any = ref({})
const setValue_TableData: any = ref([]) const setValue_TableData: any = ref([])
const copyRowList = ref({}) const copyRowList = ref({})
const harmVIsShow = ref(false)
const harmAIsShow = ref(false)
const iHarmVIsShow = ref(false)
const iHarmAIsShow = ref(false)
const props = defineProps({ const props = defineProps({
activeName: { activeName: {
type: String, type: String,
@@ -262,8 +268,23 @@ const typeList = [
value: 'max' value: 'max'
} }
] ]
const tabVisibilityMap: { [key: string]: { harmVIsShow: boolean, harmAIsShow: boolean, iHarmVIsShow: boolean, iHarmAIsShow: boolean } } = {
'谐波电压': { harmVIsShow: true, harmAIsShow: false, iHarmVIsShow: false, iHarmAIsShow: false },
'谐波电流': { harmVIsShow: false, harmAIsShow: true, iHarmVIsShow: false, iHarmAIsShow: false },
'间谐波电压': { harmVIsShow: false, harmAIsShow: false, iHarmVIsShow: true, iHarmAIsShow: false },
'间谐波电流': { harmVIsShow: false, harmAIsShow: false, iHarmVIsShow: false, iHarmAIsShow: true },
'谐波有功功率': { harmVIsShow: true, harmAIsShow: true, iHarmVIsShow: false, iHarmAIsShow: false },
};
const open = async (row: any,communicationList:any,parentTabName:string,childrenTabName:string) => { const open = async (row: any,communicationList:any,parentTabName:string,childrenTabName:string) => {
//对应表格显示隐藏
const visibilitySettings = tabVisibilityMap[parentTabName] || { harmVIsShow: false, harmAIsShow: false, iHarmVIsShow: false, iHarmAIsShow: false };
harmVIsShow.value = visibilitySettings.harmVIsShow;
harmAIsShow.value = visibilitySettings.harmAIsShow;
iHarmVIsShow.value = visibilitySettings.iHarmVIsShow;
iHarmAIsShow.value = visibilitySettings.iHarmAIsShow;
titleType.value = parentTabName + '_' + childrenTabName+ '_详情' titleType.value = parentTabName + '_' + childrenTabName+ '_详情'
//console.log('🚀 ~ open ~ row:', row) //console.log('🚀 ~ open ~ row:', row)
tableData.value = row tableData.value = row
@@ -367,7 +388,7 @@ defineExpose({ open })
width: 12.5%; width: 12.5%;
} }
:deep(.tabPane) { :deep(.tabPane) {
height: 550px; height: 450px;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>