@@ -125,16 +136,18 @@ const modeStore = useModeStore()
const dictStore = useDictStore()
const visible = ref(false)
const treeRef = ref()
-const searchValue = ref
('')
+
const pqErrorList = reactive<{ id: string; name: string }[]>([])
const activeTab = ref('resultTab')
const currentCheckItem = ref()
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({
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([])
-
+// 检测脚本配置数据
+const scriptData = ref([])
// 原始数据表格数据
const rawTableData = ref([])
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;
+}
diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue
index 8226d25..8e82781 100644
--- a/frontend/src/views/home/components/table.vue
+++ b/frontend/src/views/home/components/table.vue
@@ -4,176 +4,198 @@
支持手动/一键检测、批量操作、通道配对等高级功能
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查询
-
- 重置
-
-
- 通道配对
-
-
- 手动检测
-
- 一键检测
-
-
-
- 报告生成
-
-
-
- 归档
-
-
-
-
-
-
-
- 报告下载
-
-
- 报告生成
-
-
- 归档
-
-
- 检测数据查询
-
-
- 误差体系更换
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+ 通道配对
+
+
+ 手动检测
+
+
+ 一键检测
+
+
+
+ 报告生成
+
+
+
+ 归档
+
+
+
+
+
+
+
+
+ 报告下载
+
+
+
+ 报告生成
+
+
+
+ 归档
+
+
+
+ 检测数据查询
+
+
+
+ 误差体系更换
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-