修改检测脚本页面

This commit is contained in:
GGJ
2025-02-17 16:44:02 +08:00
parent 5c012c2bc9
commit 92b9a82f21
8 changed files with 289 additions and 151 deletions

View File

@@ -6,7 +6,7 @@
</div>
<div class="data-check-content">
<div class="content-tree">
<Tree />
<Tree :scriptId="props.scriptId" />
</div>
<div class="content-tree" style="width: 400px">
<Commun :options="props.options" />
@@ -114,6 +114,10 @@ const props = defineProps({
options: {
type: Array as PropType<TabOption[]>,
required: true
},
scriptId: {
type: String,
required: true
}
})
const activeName = ref('')
@@ -136,24 +140,28 @@ const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> =
}
// 新增保存
const addTab = (row: any) => {
let flag = false
let data = JSON.parse(JSON.stringify(row))
let flag = true
let list: any = {}
let childrenList = {}
tabData.value.forEach(item => {
if (item.value == activeName.value) {
// item.children.push(JSON.parse(JSON.stringify(row)))
list = item
item.children.forEach(k => {
if (k.value == row.value) {
flag = true
flag = false
childrenList = k
}
})
}
})
if (flag) {
list.children.push(row)
list.children.push(data)
} else {
childrenList.children.push(data)
}
// if (tab.length == 0) {
// tabData.value.filter(item => item.value == activeName.value)[0].children?.push(row)
// }
console.log('🚀 ~ addTab ~ tabData.value:', tabData.value)
}
onMounted(() => {
props.options.forEach(item => {