Files
pqs-9100_client/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue

593 lines
18 KiB
Vue
Raw Normal View History

<template>
2024-12-18 20:26:18 +08:00
<el-dialog :append-to-body="appendToBody" class="dialog" title="数据查询" :model-value='visible' @close="close"
v-bind="dialogBig" :draggable="false" style="margin-left: 20%;">
2024-12-18 18:53:55 +08:00
<div class="data-check-dialog">
<div class="data-check-head">
<el-form :model='formContent' label-width="auto" class="form-three ">
<el-form-item label="检测脚本">
2024-12-25 13:22:54 +08:00
<el-input v-model='formContent.scriptName' :disabled="true"/>
2024-12-18 18:53:55 +08:00
</el-form-item>
<el-form-item label="误差体系">
<el-input v-model='formContent.errorSysName' :disabled="true"/>
</el-form-item>
<el-form-item label="数据原则">
<el-input v-model='formContent.dataRule' :disabled="true"/>
</el-form-item>
<el-form-item label="设备名称">
<el-input v-model='formContent.deviceName' :disabled="true"/>
</el-form-item>
<el-form-item label='通道号'>
2024-12-31 19:03:52 +08:00
<el-select v-model="formContent.chnNum">
2025-01-06 19:20:36 +08:00
<el-option v-for="item in chnList" :key="item.value" :label="item.label" :value="item.value"/>
2024-12-18 18:53:55 +08:00
</el-select>
</el-form-item>
</el-form>
</div>
<div class="data-check-body">
<div class="content-left-tree">
2024-12-18 20:26:18 +08:00
<div>
2024-12-31 19:03:52 +08:00
<el-radio-group v-model="switchItem" @change="handleSwitchChange">
2024-12-25 13:22:54 +08:00
<el-radio-button label="不符合测试项" :value="0"/>
<el-radio-button label="全部测试项" :value="1"/>
2024-12-18 18:53:55 +08:00
</el-radio-group>
</div>
<div class="content-tree">
2025-01-03 18:57:35 +08:00
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="index"
2025-01-05 14:52:37 +08:00
:data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick"
class="custom-tree">
2024-12-31 19:54:27 +08:00
<template #default="{ node, data }">
2025-01-03 18:57:35 +08:00
<span class="custom-tree-node">{{ data.scriptTypeName }}</span>
2024-12-31 19:54:27 +08:00
</template>
</el-tree>
2025-01-03 18:57:35 +08:00
<el-tree v-if="switchItem === 1" :default-expanded-keys="defaultExpandedKeys" node-key="index"
2024-12-31 19:54:27 +08:00
:data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick" class="custom-tree">
<template #default="{ node, data }">
2025-01-03 18:57:35 +08:00
<span class="custom-tree-node">{{ data.scriptTypeName }}</span>
2024-12-31 19:54:27 +08:00
</template>
</el-tree>
2024-12-18 18:53:55 +08:00
</div>
</div>
<div class="content-right">
<div class="content-right-title">
2025-01-06 14:50:36 +08:00
<div style="width: 680px;">
<span class="content-right-title-text">当前检测项目
<el-popover trigger="hover" :content="currentDesc? currentDesc : '无'" :width="popoverWidth" placement="right">
<template #reference>
<el-button type="text" style="font-size: 16px;">
{{ currentScriptTypeName ? currentScriptTypeName : '无' }}
</el-button>
</template>
</el-popover>
</span>
</div>
<el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 210px;" v-if="harmNumList.length" label='谐波次数'>
<el-select v-model="currentHarmNum">
<el-option v-for="item in harmNumList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 210px;" v-if="checkList.length" label='测试项'>
<el-select v-model="currentCheckItem">
<el-option v-for="item in checkList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
2024-12-18 18:53:55 +08:00
</div>
<div class="content-right-Tabs">
2024-12-25 18:04:16 +08:00
<el-tabs type="border-card" v-model="activeTab">
2024-12-18 18:53:55 +08:00
<el-tab-pane label="检测结果" name="resultTab">
2025-01-06 14:50:36 +08:00
<DataCheckResultTable :tableData="checkResultData"/>
2024-12-18 18:53:55 +08:00
</el-tab-pane>
<el-tab-pane label="原始数据" name="rawDataTab">
2025-01-03 18:57:35 +08:00
<DataCheckRawDataTable :tableData="rawTableData"/>
2024-12-18 18:53:55 +08:00
</el-tab-pane>
</el-tabs>
</div>
</div>
2024-12-18 18:53:55 +08:00
</div>
</div>
</el-dialog>
</template>
<script setup lang='ts'>
2024-12-18 18:53:55 +08:00
import {dialogBig} from '@/utils/elementBind'
import {reactive, ref} from 'vue'
import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
2024-12-23 13:23:28 +08:00
import {CheckData} from "@/api/check/interface";
2024-12-30 14:41:34 +08:00
import {useDictStore} from "@/stores/modules/dict";
import {useCheckStore} from "@/stores/modules/check";
2025-01-06 19:20:36 +08:00
import {getFormData, getTreeData, getTableData} from "@/api/check/test";
2024-12-18 18:53:55 +08:00
const {appendToBody} = withDefaults(defineProps<{
appendToBody: boolean
}>(), {appendToBody: true})
2024-12-18 20:26:18 +08:00
2024-12-25 18:04:16 +08:00
const defaultProps = {
2025-01-03 18:57:35 +08:00
label: "scriptTypeName",
2024-12-25 18:04:16 +08:00
children: "children",
};
2024-12-30 14:41:34 +08:00
const dictStore = useDictStore()
const checkStore = useCheckStore()
2024-12-30 14:41:34 +08:00
2024-12-28 16:50:32 +08:00
const visible = ref(false)
2025-01-06 08:51:14 +08:00
// 格式化数字
2025-01-06 19:20:36 +08:00
const fixed = 4;
2025-01-06 08:51:14 +08:00
2024-12-25 18:04:16 +08:00
// 表单数据
2024-12-23 13:23:28 +08:00
const formContent = reactive<CheckData.DataCheck>({
2024-12-25 13:22:54 +08:00
scriptName: '',
errorSysName: '',
dataRule: '',
deviceName: '',
2024-12-31 19:03:52 +08:00
chnNum: '',
2024-12-18 18:53:55 +08:00
})
2025-01-06 08:51:14 +08:00
// 当前选中的谐波次数
const currentHarmNum = ref<string>("-1")
// 谐波次数列表
2025-01-06 14:50:36 +08:00
const harmNumList = reactive<{ value: string, label: string }[]>([])
// 当前选中的检测项
const currentCheckItem = ref<string>("")
// 检测项列表
const checkList = reactive<{ value: string, label: string }[]>([])
2025-01-06 08:51:14 +08:00
2024-12-28 16:50:32 +08:00
let deviceId: string = ''
2024-12-31 14:27:36 +08:00
let scriptType: string | null = null
2024-12-28 16:50:32 +08:00
2024-12-25 18:04:16 +08:00
// 通道下拉列表
2024-12-28 16:50:32 +08:00
let chnList: any[] = []
2024-12-25 18:04:16 +08:00
// 不符合测试项、全部测试项切换
2025-01-06 19:20:36 +08:00
let switchItem = ref(0)
2025-01-04 16:33:23 +08:00
2024-12-31 19:03:52 +08:00
// 左侧树数据
2025-01-03 18:57:35 +08:00
let treeDataUnqualified: CheckData.TreeItem[] = []
let treeDataAll: CheckData.TreeItem[] = []
2025-01-06 08:51:14 +08:00
2024-12-25 13:22:54 +08:00
// 左侧树被选中的叶子节点id
2025-01-03 18:57:35 +08:00
const checkIndex = ref<string>('')
2024-12-18 18:53:55 +08:00
2025-01-05 14:52:37 +08:00
// 当前检测项目名称
const currentScriptTypeName = ref('')
// 当前检测项目描述
2025-01-03 18:57:35 +08:00
const currentDesc = ref('');
2024-12-25 18:04:16 +08:00
// 右侧Tab选中项
const activeTab = ref<string>('resultTab')
2025-01-03 11:27:36 +08:00
2025-01-06 08:51:14 +08:00
//存放相应的表格数据
2025-01-06 14:50:36 +08:00
let resTableData: { resultData: Map<string, any>, rawData: Map<string, any> } = {resultData: new Map(), rawData: new Map()}
2025-01-06 08:51:14 +08:00
2024-12-25 13:22:54 +08:00
// 检测结果表格数据
2025-01-06 08:51:14 +08:00
const checkResultData = reactive<CheckData.CheckResult[]>([])
2025-01-06 14:50:36 +08:00
const popoverWidth: ComputedRef<string> = computed(() => {
return `${680 - currentScriptTypeName.value.length * 16 - (harmNumList.length || checkList.length ? 120 : 0)}px`
})
2025-01-06 08:51:14 +08:00
2024-12-25 13:22:54 +08:00
// 原始数据表格数据
2025-01-03 18:57:35 +08:00
const rawTableData = reactive<CheckData.RawDataItem[]>([])
2024-12-18 15:56:59 +08:00
2024-12-25 18:04:16 +08:00
// 左侧树默认展开节点id
2024-12-28 16:50:32 +08:00
let defaultExpandedKeys: string[] = []
2024-12-25 13:22:54 +08:00
// 点击左侧树节点触发事件
2024-12-31 19:03:52 +08:00
const handleNodeClick = async (data: any) => {
2024-12-25 13:22:54 +08:00
if (!data.children) {
2025-01-03 18:57:35 +08:00
checkIndex.value = data.index
2025-01-05 14:52:37 +08:00
currentScriptTypeName.value = data.scriptTypeName
2025-01-03 18:57:35 +08:00
currentDesc.value = data.sourceDesc
2024-12-31 19:03:52 +08:00
2025-01-03 18:57:35 +08:00
if (checkIndex.value) {
2024-12-31 19:03:52 +08:00
await updateTableData()
}
2024-12-25 13:22:54 +08:00
}
};
2024-12-25 18:04:16 +08:00
2024-12-31 19:03:52 +08:00
watch(() => formContent.chnNum, async (newVal, oldVal) => {
console.log("通道号", newVal);
2025-01-03 11:27:36 +08:00
if (newVal) {
2024-12-28 16:50:32 +08:00
// 发起请求,查询该测试项的检测结果
2025-01-03 18:57:35 +08:00
const {data: resTreeDataTemp}: { data: CheckData.TreeItem[] } = await getTreeData({
2025-01-02 20:27:36 +08:00
scriptId: checkStore.scriptId,
devId: deviceId,
2025-01-02 20:27:36 +08:00
devNum: formContent.chnNum + '',
2025-01-06 19:20:36 +08:00
scriptType: scriptType,
code: parseInt(checkStore.planCode)
2025-01-02 20:27:36 +08:00
})
2025-01-03 11:27:36 +08:00
treeDataAll = resTreeDataTemp
2025-01-03 18:57:35 +08:00
2025-01-03 11:27:36 +08:00
let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
filterTree(treeDataTemp, 2)
treeDataUnqualified = treeDataTemp
2025-01-06 19:20:36 +08:00
switchItem.value = 0
2025-01-03 11:27:36 +08:00
await handleSwitchChange(0)
2024-12-25 13:22:54 +08:00
}
2025-01-03 11:27:36 +08:00
})
2025-01-06 14:50:36 +08:00
2025-01-06 08:51:14 +08:00
watch(currentHarmNum, (newVal, oldVal) => {
console.log("谐波次数", newVal);
2025-01-06 14:50:36 +08:00
if (newVal !== '-1') {
2025-01-06 08:51:14 +08:00
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal.toString())
setCheckResultData(resCheckResult)
2025-01-06 19:20:36 +08:00
setRawData(resTableData.resultData.get(newVal.toString()))
2025-01-06 08:51:14 +08:00
}
})
2025-01-06 14:50:36 +08:00
watch(currentCheckItem, (newVal, oldVal) => {
console.log("当前检测项", newVal);
if (newVal) {
2025-01-06 19:20:36 +08:00
let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间'
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(key)
2025-01-06 14:50:36 +08:00
setCheckResultData(resCheckResult)
2025-01-06 19:20:36 +08:00
setRawData(resTableData.resultData.get(key))
2025-01-06 14:50:36 +08:00
}
})
2025-01-03 11:27:36 +08:00
const handleSwitchChange = async (data: any) => {
console.log("切换不合格测试项、全部测试项", data);
2024-12-31 19:03:52 +08:00
defaultOperate()
await updateTableData()
}
// 默认操作
const defaultOperate = () => {
2024-12-28 16:50:32 +08:00
let node = null
2025-01-06 19:20:36 +08:00
if (switchItem.value === 0) {
2024-12-31 19:03:52 +08:00
node = getDefaultNode(treeDataUnqualified)
} else {
2024-12-28 16:50:32 +08:00
node = getDefaultNode(treeDataAll)
2024-12-25 18:04:16 +08:00
}
2025-01-02 20:27:36 +08:00
if (node) {
2025-01-05 14:52:37 +08:00
currentScriptTypeName.value = node.scriptTypeName
2025-01-03 18:57:35 +08:00
currentDesc.value = node.sourceDesc
checkIndex.value = node.index
defaultExpandedKeys = [node.index]
2025-01-02 20:27:36 +08:00
} else {
2025-01-05 14:52:37 +08:00
currentScriptTypeName.value = ''
2025-01-03 18:57:35 +08:00
currentDesc.value = ''
checkIndex.value = ''
2025-01-02 20:27:36 +08:00
defaultExpandedKeys = []
}
2024-12-31 19:03:52 +08:00
}
const updateTableData = async () => {
2025-01-03 18:57:35 +08:00
console.log("左侧树被选中的叶子节点checkIndex", checkIndex.value);
if (checkIndex.value) {
2025-01-04 14:09:01 +08:00
console.log("更新表格数据");
2025-01-03 11:27:36 +08:00
// 发起请求,查询该测试项的检测结果
2025-01-06 19:20:36 +08:00
const {data} = await getTableData({
scriptType,
scriptId: checkStore.scriptId,
devId: deviceId,
devNum: formContent.chnNum + '',
code: parseInt(checkStore.planCode),
index: parseInt(checkIndex.value),
2025-01-06 14:50:36 +08:00
})
2025-01-06 19:20:36 +08:00
let keys1 = Object.keys(data.resultData)
let resultData = new Map()
for (let key of keys1) {
resultData.set(key, data.resultData[key])
}
2025-01-05 14:52:37 +08:00
2025-01-06 19:20:36 +08:00
let keys2 = Object.keys(data.rawData)
2025-01-06 08:51:14 +08:00
let rawData = new Map()
2025-01-06 19:20:36 +08:00
for (let key of keys2) {
rawData.set(key, data.rawData[key])
}
2025-01-06 08:51:14 +08:00
resTableData = {
2025-01-06 14:50:36 +08:00
resultData,
rawData
2025-01-06 08:51:14 +08:00
}
2025-01-06 14:50:36 +08:00
let resCheckResult: CheckData.ResCheckResult = {}
2025-01-06 19:20:36 +08:00
let resRawData: CheckData.RawDataItem = {}
2025-01-06 08:51:14 +08:00
2025-01-06 19:20:36 +08:00
if (keys1.length === 1) {
resCheckResult = resTableData.resultData.get(keys1[0])
resRawData = resTableData.rawData.get(keys2[0])
2025-01-06 08:51:14 +08:00
Object.assign(harmNumList, [])
currentHarmNum.value = '-1'
setCheckResultData(resCheckResult)
2025-01-06 19:20:36 +08:00
setRawData(resRawData)
2025-01-06 08:51:14 +08:00
} else {
if (resTableData.resultData.get('电压幅值') || resTableData.resultData.get('持续时间')) {
2025-01-06 14:50:36 +08:00
let tempCheckList = []
2025-01-06 08:51:14 +08:00
if (resTableData.resultData.get('电压幅值')) {
2025-01-06 14:50:36 +08:00
tempCheckList.push({value: 'Voltage', label: '电压幅值'})
2025-01-06 19:20:36 +08:00
//resCheckResult = resTableData.resultData.get('电压幅值')
2025-01-06 08:51:14 +08:00
}
if (resTableData.resultData.get('持续时间')) {
2025-01-06 14:50:36 +08:00
tempCheckList.push({value: 'Duration', label: '持续时间'})
2025-01-06 19:20:36 +08:00
//resCheckResult = resTableData.resultData.get('持续时间')
2025-01-06 08:51:14 +08:00
}
2025-01-06 14:50:36 +08:00
Object.assign(checkList, tempCheckList)
currentCheckItem.value = checkList[0].value
2025-01-06 08:51:14 +08:00
Object.assign(harmNumList, [])
currentHarmNum.value = '-1'
2025-01-06 14:50:36 +08:00
//setCheckResultData(resCheckResult)
2025-01-06 19:20:36 +08:00
} else if (keys1.length != 0) {
2025-01-06 14:50:36 +08:00
let tempHarmNumList: { value: string, label: string }[] = []
for (let [key, value] of resTableData.resultData) {
tempHarmNumList.push({value: key, label: key})
}
2025-01-06 08:51:14 +08:00
Object.assign(harmNumList, tempHarmNumList)
2025-01-06 19:20:36 +08:00
currentHarmNum.value = harmNumList.length > 0 ? harmNumList[0].value : '-1'
2025-01-06 08:51:14 +08:00
}
}
// setCheckResultData(resCheckResult)
2025-01-06 19:20:36 +08:00
} else {
checkResultData.length = 0
rawTableData.length = 0
2025-01-03 11:27:36 +08:00
}
2024-12-31 19:03:52 +08:00
}
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
// console.log(checkStore.scriptId, _deviceId, chnNum, _scriptType);
2024-12-28 16:50:32 +08:00
deviceId = _deviceId
2024-12-31 14:27:36 +08:00
scriptType = _scriptType
2024-12-31 19:03:52 +08:00
2024-12-28 16:50:32 +08:00
// 发起后端请求,查询详细信息 当chnNum为-1时查询所有通道号
2025-01-03 11:27:36 +08:00
const {data: resFormContent}: { data: any } = await getFormData({
planId: checkStore.planId,
deviceId,
chnNum,
scriptType
})
2024-12-18 15:56:59 +08:00
2025-01-03 11:27:36 +08:00
chnList = resFormContent.chnList.map((item: { value: string, label: string }) => ({
2024-12-30 14:41:34 +08:00
value: item.value,
label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)`
}))
2024-12-31 14:27:36 +08:00
let dataRuleName = dictStore.getDictData('Data_Rule').find(item => item.id == resFormContent.dataRule)?.name
2024-12-30 14:41:34 +08:00
Object.assign(formContent, {
...resFormContent,
dataRule: dataRuleName,
2025-01-03 11:27:36 +08:00
chnNum: chnList.length > 0 ? chnList[0].value : '',
})
2024-12-31 19:03:52 +08:00
2024-12-18 15:56:59 +08:00
visible.value = true;
}
2024-12-28 16:50:32 +08:00
const close = () => {
//数据清空
Object.assign(formContent, {
scriptName: '',
errorSysName: '',
dataRule: '',
deviceName: '',
2024-12-31 19:03:52 +08:00
chnNum: '',
2024-12-28 16:50:32 +08:00
})
2024-12-31 19:03:52 +08:00
treeDataUnqualified = []
2024-12-28 16:50:32 +08:00
treeDataAll = []
2025-01-06 19:20:36 +08:00
treeDataUnqualified.length = 0
treeDataAll.length = 0
harmNumList.length = 0
2025-01-06 08:51:14 +08:00
currentHarmNum.value = '-1'
2025-01-06 19:20:36 +08:00
checkResultData.length = 0
rawTableData.length = 0
2025-01-04 16:33:23 +08:00
defaultExpandedKeys = []
2025-01-03 18:57:35 +08:00
checkIndex.value = ''
activeTab.value = 'resultTab'
2025-01-05 14:52:37 +08:00
currentScriptTypeName.value = ''
2025-01-03 18:57:35 +08:00
currentDesc.value = ''
2025-01-06 19:20:36 +08:00
switchItem.value = 0
2024-12-28 16:50:32 +08:00
visible.value = false;
};
2025-01-06 14:50:36 +08:00
const setCheckResultData = (data: CheckData.ResCheckResult) => {
2025-01-06 08:51:14 +08:00
let result: CheckData.CheckResult[] = []
2025-01-06 14:50:36 +08:00
if (data.dataA && data.dataB && data.dataC) {
result.push({
2025-01-06 19:20:36 +08:00
aStd: data.dataA?.resultData.toFixed(fixed),
aData: data.dataA?.data?.toFixed(fixed),
2025-01-06 14:50:36 +08:00
aError: getError(data.dataA?.resultData, data.dataA?.data),
2025-01-06 19:20:36 +08:00
bStd: data.dataB?.resultData?.toFixed(fixed),
bData: data.dataB?.data?.toFixed(fixed),
bError: getError(data.dataB?.resultData, data.dataB?.data),
cStd: data.dataC?.resultData?.toFixed(fixed),
cData: data.dataC?.data?.toFixed(fixed),
cError: getError(data.dataC?.resultData, data.dataC?.data),
2025-01-06 14:50:36 +08:00
maxError: data.radius,
2025-01-06 19:20:36 +08:00
unit: data.unit,
2025-01-06 14:50:36 +08:00
result: data.isData,
})
}
if (data.dataT) {
result.push({
2025-01-06 19:20:36 +08:00
tStd: data.dataT?.resultData?.toFixed(fixed),
tData: data.dataT?.data?.toFixed(fixed),
2025-01-06 14:50:36 +08:00
tError: getError(data.dataT?.resultData, data.dataT?.data),
maxError: data.radius,
2025-01-06 19:20:36 +08:00
unit: data.unit,
2025-01-06 14:50:36 +08:00
result: data.isData,
})
}
2025-01-06 08:51:14 +08:00
Object.assign(checkResultData, result)
}
2025-01-06 19:20:36 +08:00
const setRawData = (data: CheckData.RawDataItem[]) => {
2025-01-07 09:01:10 +08:00
data.forEach((item: CheckData.RawDataItem) => {
item.dataA = Number(item.dataA).toFixed(fixed)
item.dataB = Number(item.dataB).toFixed(fixed)
item.dataC = Number(item.dataC).toFixed(fixed)
item.dataT = Number(item.dataT).toFixed(fixed)
})
2025-01-06 19:20:36 +08:00
Object.assign(rawTableData, data)
}
2025-01-06 14:50:36 +08:00
const getError = (num1: number, num2: number): string => {
2025-01-06 19:20:36 +08:00
if (num1 == null || num1 == undefined || num2 == null || num2 == undefined) {
return ''
}
return Math.abs(Number(num1.toFixed(fixed)) - Number(num2.toFixed(fixed))).toFixed(fixed)
2025-01-06 14:50:36 +08:00
}
2025-01-06 19:20:36 +08:00
2024-12-28 16:50:32 +08:00
const findFirstLeafNode = (node: any): any => {
2024-12-25 18:04:16 +08:00
if (!node.children || node.children.length === 0) {
2024-12-28 16:50:32 +08:00
return node;
2024-12-25 18:04:16 +08:00
}
return findFirstLeafNode(node.children[0]);
}
2024-12-28 16:50:32 +08:00
const getDefaultNode = (data: any[]) => {
2024-12-25 18:04:16 +08:00
if (!data || data.length === 0) {
return null;
2024-12-25 13:22:54 +08:00
}
2024-12-25 18:04:16 +08:00
const firstElement = data[0];
return findFirstLeafNode(firstElement);
2024-12-25 13:22:54 +08:00
}
2025-01-02 20:27:36 +08:00
// fly: 1合格 2不合格 4数据错误
const filterTree = (treeData: any[], fly: number): any[] => {
if (!treeData || treeData.length === 0) {
return []
}
filter(treeData, fly)
return treeData
}
const filter = (treeData: any[], fly: number) => {
2025-01-04 14:09:01 +08:00
for (let i = treeData.length - 1; i >= 0; i--) {
2025-01-02 20:27:36 +08:00
let node = treeData[i]
2025-01-04 14:09:01 +08:00
if (node.fly !== fly) {
2025-01-02 20:27:36 +08:00
if (node.children && node.children.length > 0) {
filter(node.children, fly)
2025-01-03 18:57:35 +08:00
// 检查 children 是否被全部移除
if (node.children.length === 0) {
treeData.splice(i, 1);
}
2025-01-02 20:27:36 +08:00
} else {
treeData.splice(i, 1)
}
}
}
}
2024-12-18 15:56:59 +08:00
defineExpose({
open
})
</script>
2024-12-18 18:53:55 +08:00
<style lang="scss" scoped>
2024-12-18 20:26:18 +08:00
.dialog {
2024-12-18 18:53:55 +08:00
display: flex;
flex-direction: column;
2024-12-18 20:26:18 +08:00
overflow-y: hidden;
overflow-x: hidden;
2024-12-23 13:23:28 +08:00
2024-12-18 18:53:55 +08:00
2024-12-18 20:26:18 +08:00
.data-check-dialog {
display: flex;
2024-12-18 20:26:18 +08:00
flex-direction: column;
2025-01-04 16:33:23 +08:00
overflow-y: hidden;
2024-12-18 20:26:18 +08:00
.data-check-head {
display: flex;
flex-direction: row;
width: 100%;
2024-12-18 18:53:55 +08:00
}
2024-12-18 20:26:18 +08:00
.data-check-body {
2025-01-04 16:33:23 +08:00
height: 500px;
2024-12-23 13:23:28 +08:00
width: 100%;
2024-12-18 20:26:18 +08:00
display: flex;
flex-direction: row;
.content-left-tree {
2025-01-06 19:20:36 +08:00
width: 20%;
2024-12-18 20:26:18 +08:00
display: flex;
flex-direction: column;
align-items: center;
2024-12-23 13:23:28 +08:00
max-height: 473px;
2024-12-18 20:26:18 +08:00
padding: 10px 0;
border: 1px solid #ccc;
2024-12-31 19:54:27 +08:00
overflow-y: auto;
2024-12-24 19:21:43 +08:00
2024-12-18 20:26:18 +08:00
.content-tree {
2024-12-31 19:54:27 +08:00
width: 100%;
2024-12-23 13:23:28 +08:00
height: 100%;
max-height: 100%;
2024-12-18 20:26:18 +08:00
margin-top: 10px;
2024-12-31 19:54:27 +08:00
.custom-tree-node {
overflow-x: hidden !important; // 溢出部分隐藏
white-space: nowrap !important; //禁止自动换行
text-overflow: ellipsis !important; // 使溢出部分以省略号显示
}
2024-12-18 18:53:55 +08:00
}
}
2024-12-18 20:26:18 +08:00
.content-right {
2025-01-06 19:20:36 +08:00
width: 80%;
2024-12-18 20:26:18 +08:00
margin-left: 10px;
flex: 1;
.content-right-title {
2025-01-06 14:50:36 +08:00
display: flex;
padding: 10px 0;
2025-01-05 14:52:37 +08:00
margin-top: 10px;
line-height: 1.5;
2025-01-04 16:33:23 +08:00
2025-01-05 14:52:37 +08:00
.content-right-title-text {
2024-12-18 20:26:18 +08:00
font-size: 16px;
2025-01-05 14:52:37 +08:00
font-weight: bold;
2024-12-18 20:26:18 +08:00
}
}
2024-12-18 18:53:55 +08:00
2025-01-05 14:52:37 +08:00
//.el-divider--horizontal {
// //margin-top: 0px;
// margin-bottom: 5px;
// height: 20px;
//}
//.content-right-title-desc {
// font-size: 16px;
// height: 48px;
// max-height: 48px;
// overflow-y: auto;
//}
}
.content-right-Tabs {
box-sizing: border-box;
margin-top: 10px;
margin-bottom: 10px;
max-height: 400px;
2024-12-18 20:26:18 +08:00
}
2024-12-18 18:53:55 +08:00
}
}
}
2025-01-05 14:52:37 +08:00
</style>
<!--<style lang="scss">-->
<!--.el-popover.popover-class {-->
<!-- .el-popover__title {-->
<!-- color: #fff;-->
<!-- background-color: #003078 !important;-->
<!-- }-->
<!--}-->
<!--</style>-->