fix:重构资产结构同步方法

ruoyi_test
sunshine7058 2024-04-28 20:59:39 +08:00
parent ca87c5e438
commit 7d98af43e8
2 changed files with 6 additions and 14 deletions

View File

@ -59,12 +59,11 @@ export function getAssetList() {
}) })
} }
// 查询数据库下的表 // 查询数据库结构
export function getChildrenList(data) { export function getChildrenList(id) {
return request({ return request({
url: '/data/source/getChildrenList', url: '/data/source/getChildrenList',
method: 'post', method: 'get'
data: data
}) })
} }

View File

@ -80,16 +80,9 @@ export default {
if (data.type === 'dataSource') { if (data.type === 'dataSource') {
this.assetId = data.id this.assetId = data.id
console.log(this.assetId) console.log(this.assetId)
getChildrenList(data).then(res => { getChildrenList(data.id).then(res => {
this.childrenList = res.data this.childrenList = res.data
resolve(this.childrenList)
this.childrenList.forEach(children => {
this.showTable.assetStructure = data
this.showTable.tableName = children.name
addTableData(this.showTable).then(res => {
// console.log(res)
})
})
}) })
} }
// this.showAssets = data.type; // this.showAssets = data.type;
@ -114,7 +107,7 @@ export default {
getTableDataCount(data.id).then(res => { getTableDataCount(data.id).then(res => {
this.count = res.data this.count = res.data
}) })
getChildrenList(data).then(res => { getChildrenList(data.id).then(res => {
this.childrenList = res.data this.childrenList = res.data
this.childrenList.forEach(children => { this.childrenList.forEach(children => {
this.showTable.assetStructure = data this.showTable.assetStructure = data