Merge pull request #7690 from dataease/pr@dev-v2_dzz

Pr@dev v2 dzz
This commit is contained in:
dataeaseShu 2024-01-18 11:10:12 +08:00 committed by GitHub
commit 3e44b9c988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 2 deletions

View File

@ -168,6 +168,7 @@ const saveSelfSubject = () => {
position: absolute;
top: 4px;
right: 4px;
font-size: 12px;
}
}

View File

@ -124,6 +124,8 @@ const templateInnerPreview = e => {
.template-button {
justify-content: center;
width: 100%;
padding-bottom: 8px;
display: none;
}
.bottom-area {
@ -149,6 +151,11 @@ const templateInnerPreview = e => {
color: deepskyblue;
cursor: pointer;
}
.testcase-template:hover {
.template-button {
display: block;
}
}
.create-area {
bottom: -38px !important;
}

View File

@ -212,6 +212,18 @@ const dfsName = (arr, id) => {
return name
}
const dfsChild = arr => {
return arr.filter(ele => {
if (ele.leaf) {
return true
}
if (!!ele.children?.length) {
ele.children = dfsChild(ele.children || [])
}
return !!ele.children?.length
})
}
const getDsName = (id: string) => {
return dfsName(state.dataSourceList, id)
}
@ -860,9 +872,9 @@ const getDatasource = () => {
getDatasourceList().then(res => {
const _list = (res as unknown as DataSource[]) || []
if (_list && _list.length > 0 && _list[0].id === '0') {
state.dataSourceList = _list[0].children
state.dataSourceList = dfsChild(_list[0].children)
} else {
state.dataSourceList = _list
state.dataSourceList = dfsChild(_list)
}
})
}