diff --git a/src/api/data/source.js b/src/api/data/source.js index e80f66a..3bbca13 100644 --- a/src/api/data/source.js +++ b/src/api/data/source.js @@ -59,12 +59,11 @@ export function getAssetList() { }) } -// 查询数据库下的表 -export function getChildrenList(data) { +// 查询数据库结构 +export function getChildrenList(id) { return request({ url: '/data/source/getChildrenList', - method: 'post', - data: data + method: 'get' }) } diff --git a/src/views/data/assetStructure/index.vue b/src/views/data/assetStructure/index.vue index eb3fc8d..04dad44 100644 --- a/src/views/data/assetStructure/index.vue +++ b/src/views/data/assetStructure/index.vue @@ -80,16 +80,9 @@ export default { if (data.type === 'dataSource') { this.assetId = data.id console.log(this.assetId) - getChildrenList(data).then(res => { + getChildrenList(data.id).then(res => { 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; @@ -114,7 +107,7 @@ export default { getTableDataCount(data.id).then(res => { this.count = res.data }) - getChildrenList(data).then(res => { + getChildrenList(data.id).then(res => { this.childrenList = res.data this.childrenList.forEach(children => { this.showTable.assetStructure = data