修改检测脚本页面
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user