This commit is contained in:
caozehui
2024-12-30 14:41:34 +08:00
parent 45a5dcb068
commit c334c07b39
3 changed files with 76 additions and 37 deletions

View File

@@ -69,6 +69,7 @@ import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import {CheckData} from "@/api/check/interface";
import {getFormData, getTreeData, getCheckData} from "@/api/check/test";
import {useDictStore} from "@/stores/modules/dict";
const {appendToBody} = withDefaults(defineProps<{
appendToBody: boolean
@@ -79,6 +80,8 @@ const defaultProps = {
children: "children",
};
const dictStore = useDictStore()
const visible = ref(false)
// 表单数据
@@ -90,7 +93,7 @@ const formContent = reactive<CheckData.DataCheck>({
monitorIdx: '',
})
let deviceId: string = ''
let checkItemId: string = ''
let scriptType: string = ''
// 通道下拉列表
let chnList: any[] = []
@@ -125,7 +128,7 @@ const handleChnChange = (data: any) => {
console.log("通道号下拉框", data);
// 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
// const result = await getTreeData({deviceId, formContent.monitorIdx, checkItemId})
// const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
// treeDataUnQualified=[]
// treeDataAll=[]
@@ -136,7 +139,7 @@ const handleChnChange = (data: any) => {
// console.log("通道号下拉框", newVal, oldVal);
//
// // 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
// // const result = await getTreeData({deviceId, formContent.monitorIdx, checkItemId})
// // const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
// // treeDataUnQualified=[]
// // treeDataAll=[]
//
@@ -155,7 +158,7 @@ watch(checkedScriptId, (newVal, oldVal) => {
if (newVal) {
console.log("左侧树被选中的叶子节点id", newVal);
// 发起请求,查询该测试项的检测结果
// const result = await getCheckData({deviceId, formContent.monitorIdx, checkItemId})
// const result = await getCheckData({deviceId, formContent.monitorIdx, scriptType})
Object.assign(checkResultTableData, [{
chnNum: '1',
standardValue: 57.74,
@@ -308,27 +311,35 @@ watch(switchItem, (newVal, oldVal) => {
defaultExpandedKeys = [node?.id]
})
const open = async (_deviceId: string, chnNum: number, _checkItemId?: string) => {
console.log(deviceId, chnNum, checkItemId);
const open = async (_deviceId: string, chnNum: number, _scriptType?: string) => {
console.log(_deviceId, chnNum, _scriptType);
deviceId = _deviceId
checkItemId = _checkItemId ?? ''
scriptType = _scriptType ?? ''
switchItem.value = 0
// 发起后端请求,查询详细信息 当chnNum为-1时查询所有通道号
//const result1 = await getFormData({deviceId, chnNum})
// 数据处理
chnList = [
{value: 1, label: '1'},
{value: 2, label: '2 (不合格)'},
{value: 3, label: '3'},
{value: 4, label: '4 (不合格)'}]
Object.assign(formContent, {
let resFormContent = {
scriptName: 'Q/GDW 10650.4-2021 模拟式',
errorSysName: 'Q/GDW 10650.2-2021',
dataRule: '所有值',
dataRule: '505f063f9f91ab108d895a9fe96b5dce',
deviceName: '被检设备1',
monitorIdx: chnList[0].value
})
chnList:[
{value: '1', label: '1'},
{value: '2', label: '0'},
{value: '3', label: '1'},
{value: '4', label: '0'}],
}
chnList = resFormContent.chnList.map(item => ({
value: item.value,
label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)`
}))
let dataRuleName = dictStore.getDictData('Data_Rule').find(item=>item.id==resFormContent.dataRule)?.name
Object.assign(formContent, {...resFormContent,dataRule:dataRuleName,monitorIdx: chnList[0].value})
// const result2 = await getTreeData({deviceId, formContent.monitorIdx, checkItemId})
treeDataAll = [{