联调检测结果查询弹框
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
border
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
max-height="282px"
|
||||
height="368px"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="table-main">
|
||||
<el-table
|
||||
:data="prop.tableData"
|
||||
height="357px"
|
||||
height="368px"
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
>
|
||||
|
||||
@@ -57,6 +57,17 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<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-title">
|
||||
<div style="width: 840px">
|
||||
@@ -125,16 +136,18 @@ const modeStore = useModeStore()
|
||||
const dictStore = useDictStore()
|
||||
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>()
|
||||
const rowList: any = ref([])
|
||||
let scriptType: string | null = null
|
||||
|
||||
watch(searchValue, val => {
|
||||
treeRef.value!.filter(val)
|
||||
})
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'scriptName'
|
||||
}
|
||||
|
||||
const chnMapList: any = ref({})
|
||||
|
||||
// 表单数据
|
||||
@@ -147,6 +160,7 @@ const formContent = reactive<CheckData.DataCheck>({
|
||||
deviceId: '',
|
||||
num: ''
|
||||
})
|
||||
const source = ref('1') //1:正式检测进入页面 2:检测数据查询进入
|
||||
|
||||
// 通道下拉列表
|
||||
const chnList: any = ref([])
|
||||
@@ -155,7 +169,8 @@ const chnList: any = ref([])
|
||||
const currentScriptTypeName = ref('')
|
||||
// 检测结果表格数据
|
||||
const checkResultData = ref<CheckData.CheckResult[]>([])
|
||||
|
||||
// 检测脚本配置数据
|
||||
const scriptData = ref<CheckData.ScriptItem[]>([])
|
||||
// 原始数据表格数据
|
||||
const rawTableData = ref<CheckData.RawDataItem[]>([])
|
||||
const tesList: any = ref([])
|
||||
@@ -168,12 +183,17 @@ const currentRawTableData = computed(() => {
|
||||
const data = rawTableData.value[currentCheckItem.value]
|
||||
return Array.isArray(data) ? data : []
|
||||
})
|
||||
|
||||
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
|
||||
rowList.value = {}
|
||||
formContent.deviceId = deviceId || ''
|
||||
formContent.chnNum = chnNum
|
||||
if (source == 1) {
|
||||
// 正式检测进入页面
|
||||
rowList.value = row
|
||||
formContent.chnNum = chnNum
|
||||
formContent.deviceId = deviceId || ''
|
||||
} else if (source == 2) {
|
||||
// 检测数据查询进入
|
||||
await initScriptData(row)
|
||||
}
|
||||
visible.value = true
|
||||
|
||||
@@ -186,8 +206,32 @@ const open = async (row: any, chnNum: string, deviceId: string | null, source: n
|
||||
Object.assign(pqErrorList, resPqErrorList)
|
||||
// 获取基本信息
|
||||
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 () => {
|
||||
@@ -207,16 +251,17 @@ const getBasicInformation = async () => {
|
||||
chnMap.push(key)
|
||||
}
|
||||
chnList.value = chnMap
|
||||
formContent.chnNum = formContent.chnNum == null ? chnList.value[0] : formContent.chnNum
|
||||
// 查询表格数据
|
||||
getResults()
|
||||
})
|
||||
}
|
||||
// 获取测试项
|
||||
const getTestItem = async () => {
|
||||
getBigTestItem({
|
||||
reCheckType: 1,
|
||||
planId: checkStore.plan.id,
|
||||
devIds: [formContent.deviceId],
|
||||
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
|
||||
}).then((res: any) => {})
|
||||
|
||||
// 左边树变化
|
||||
const handleNodeClick = (data: any) => {
|
||||
rowList.value.scriptName = data.scriptName
|
||||
rowList.value.scriptType = data.id
|
||||
getResults()
|
||||
}
|
||||
// 获取结果
|
||||
const getResults = async () => {
|
||||
@@ -255,13 +300,10 @@ defineExpose({
|
||||
.dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
|
||||
.data-check-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: hidden;
|
||||
|
||||
.data-check-head {
|
||||
display: flex;
|
||||
@@ -322,9 +364,23 @@ defineExpose({
|
||||
box-sizing: border-box;
|
||||
margin-top: 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>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user