修改测试bug

This commit is contained in:
GGJ
2024-11-27 16:01:08 +08:00
parent 0898cd20d3
commit 52b41a3248
11 changed files with 471 additions and 264 deletions

View File

@@ -22,8 +22,8 @@ const setData = (data: any, targetType: any) => {
dataList.value = JSON.parse(JSON.stringify(data))
console.log("🚀 ~ setData ~ targetType:", targetType[0].code)
if (targetType[0].code == 'base_data' || targetType[0].code == '1') {
if (targetType[0].name == '基本数据' ) {
column.value = [
{ field: 'otherName', title: '名称', },
{ field: 'valueA', title: 'A相', },
@@ -31,27 +31,7 @@ const setData = (data: any, targetType: any) => {
{ field: 'valueC', title: 'C相', },
{ field: 'valueM', title: '', },
]
} else if (targetType[0].code == 'other_data') {
let list: any = []
data.forEach((item: any, i: any) => {
if (i % 2 == 0) {
list.push(item)
} else {
list[list.length - 1].otherName1 = item.otherName
list[list.length - 1].valueM1 = item.valueM
}
})
dataList.value = JSON.parse(JSON.stringify(list))
column.value = [
{ field: 'otherName', title: '名称', },
{ field: 'valueM', title: '', },
{ field: 'otherName1', title: '名称', },
{ field: 'valueM1', title: '', },
]
} else {
} else {
column.value = [
{ field: 'otherName', title: '谐波次数', },
{ field: 'valueA', title: 'A相', },
@@ -62,7 +42,7 @@ const setData = (data: any, targetType: any) => {
key.value += 1
}
const formatter = (row: any) => {
return row.cellValue || '/'
return row.cellValue==null? '/':row.cellValue
}
defineExpose({ setData })