Merge remote-tracking branch 'origin/master'

This commit is contained in:
贾同学
2025-08-25 14:53:06 +08:00
4 changed files with 930 additions and 895 deletions

View File

@@ -6,7 +6,7 @@
border border
:header-cell-style="{ textAlign: 'center' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
max-height="282px" height="368px"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="index" label="序号" width="70" fixed="left" /> <el-table-column type="index" label="序号" width="70" fixed="left" />

View File

@@ -2,7 +2,7 @@
<div class="table-main"> <div class="table-main">
<el-table <el-table
:data="prop.tableData" :data="prop.tableData"
height="357px" height="368px"
:header-cell-style="{ textAlign: 'center' }" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"
> >

View File

@@ -57,6 +57,17 @@
</el-form> </el-form>
</div> </div>
<div class="data-check-body"> <div class="data-check-body">
<div class="content-left-tree">
<el-tree
style="width: 200px"
:data="scriptData"
:props="defaultProps"
highlight-current
node-key="id"
ref="treeRef"
@node-click="handleNodeClick"
/>
</div>
<div class="content-right"> <div class="content-right">
<div class="content-right-title"> <div class="content-right-title">
<div style="width: 840px"> <div style="width: 840px">
@@ -125,16 +136,18 @@ const modeStore = useModeStore()
const dictStore = useDictStore() const dictStore = useDictStore()
const visible = ref(false) const visible = ref(false)
const treeRef = ref() const treeRef = ref()
const searchValue = ref<string>('')
const pqErrorList = reactive<{ id: string; name: string }[]>([]) const pqErrorList = reactive<{ id: string; name: string }[]>([])
const activeTab = ref('resultTab') const activeTab = ref('resultTab')
const currentCheckItem = ref<any>() const currentCheckItem = ref<any>()
const rowList: any = ref([]) const rowList: any = ref([])
let scriptType: string | null = null let scriptType: string | null = null
watch(searchValue, val => { const defaultProps = {
treeRef.value!.filter(val) children: 'children',
}) label: 'scriptName'
}
const chnMapList: any = ref({}) const chnMapList: any = ref({})
// 表单数据 // 表单数据
@@ -147,6 +160,7 @@ const formContent = reactive<CheckData.DataCheck>({
deviceId: '', deviceId: '',
num: '' num: ''
}) })
const source = ref('1') //1:正式检测进入页面 2:检测数据查询进入
// 通道下拉列表 // 通道下拉列表
const chnList: any = ref([]) const chnList: any = ref([])
@@ -155,7 +169,8 @@ const chnList: any = ref([])
const currentScriptTypeName = ref('') const currentScriptTypeName = ref('')
// 检测结果表格数据 // 检测结果表格数据
const checkResultData = ref<CheckData.CheckResult[]>([]) const checkResultData = ref<CheckData.CheckResult[]>([])
// 检测脚本配置数据
const scriptData = ref<CheckData.ScriptItem[]>([])
// 原始数据表格数据 // 原始数据表格数据
const rawTableData = ref<CheckData.RawDataItem[]>([]) const rawTableData = ref<CheckData.RawDataItem[]>([])
const tesList: any = ref([]) const tesList: any = ref([])
@@ -168,12 +183,17 @@ const currentRawTableData = computed(() => {
const data = rawTableData.value[currentCheckItem.value] const data = rawTableData.value[currentCheckItem.value]
return Array.isArray(data) ? data : [] return Array.isArray(data) ? data : []
}) })
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => { const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
rowList.value = {}
formContent.deviceId = deviceId || ''
formContent.chnNum = chnNum
if (source == 1) { if (source == 1) {
// 正式检测进入页面 // 正式检测进入页面
rowList.value = row rowList.value = row
formContent.chnNum = chnNum } else if (source == 2) {
formContent.deviceId = deviceId || '' // 检测数据查询进入
await initScriptData(row)
} }
visible.value = true visible.value = true
@@ -186,8 +206,32 @@ const open = async (row: any, chnNum: string, deviceId: string | null, source: n
Object.assign(pqErrorList, resPqErrorList) Object.assign(pqErrorList, resPqErrorList)
// 获取基本信息 // 获取基本信息
await getBasicInformation() await getBasicInformation()
await getTestItem()
await getResults()
}
// 查询大项树
const initScriptData = async (row: any) => {
const pattern = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
let response: any = await getBigTestItem({
reCheckType: checkStore.reCheckType,
planId: checkStore.plan.id,
devIds: checkStore.devices.map(item => item.deviceId),
patternId: pattern
})
// 格式化脚本数据
let temp = response.data.map((item: any) => {
return {
...item,
scriptName: item.scriptName
}
})
rowList.value.scriptName = temp[0].scriptName
rowList.value.scriptType = temp[0].id
// 保存脚本数据并设置总数
scriptData.value = temp
setTimeout(() => {
treeRef.value?.setCurrentKey(temp[0].id)
}, 0)
} }
//获取基本信息 //获取基本信息
const getBasicInformation = async () => { const getBasicInformation = async () => {
@@ -207,16 +251,17 @@ const getBasicInformation = async () => {
chnMap.push(key) chnMap.push(key)
} }
chnList.value = chnMap chnList.value = chnMap
formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum
// 查询表格数据
getResults()
}) })
} }
// 获取测试项
const getTestItem = async () => { // 左边树变化
getBigTestItem({ const handleNodeClick = (data: any) => {
reCheckType: 1, rowList.value.scriptName = data.scriptName
planId: checkStore.plan.id, rowList.value.scriptType = data.id
devIds: [formContent.deviceId], getResults()
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
}).then((res: any) => {})
} }
// 获取结果 // 获取结果
const getResults = async () => { const getResults = async () => {
@@ -255,13 +300,10 @@ defineExpose({
.dialog { .dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden;
overflow-x: hidden;
.data-check-dialog { .data-check-dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden;
.data-check-head { .data-check-head {
display: flex; display: flex;
@@ -322,9 +364,23 @@ defineExpose({
box-sizing: border-box; box-sizing: border-box;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
max-height: 400px; display: flex;
.el-tabs {
width: 100%;
}
}
.content-left {
height: 100%;
border: 1px solid #e0e0e0;
padding: 10px;
margin-right: 10px;
height: 410px;
overflow-y: auto;
} }
} }
} }
} }
:deep(.el-tabs--border-card > .el-tabs__content) {
height: 367px;
}
</style> </style>

File diff suppressed because it is too large Load Diff