diff --git a/frontend/src/views/dataset/add/AddUnion.vue b/frontend/src/views/dataset/add/AddUnion.vue index 68d13975d1..81dc14445a 100644 --- a/frontend/src/views/dataset/add/AddUnion.vue +++ b/frontend/src/views/dataset/add/AddUnion.vue @@ -88,7 +88,7 @@ import UnionNode from '@/views/dataset/add/union/UnionNode' import NodeItem from '@/views/dataset/add/union/NodeItem' import DatasetGroupSelectorTree from '@/views/dataset/common/DatasetGroupSelectorTree' import UnionEdit from '@/views/dataset/add/union/UnionEdit' -import { getTable, post } from '@/api/dataset/dataset' +import { post } from '@/api/dataset/dataset' import UnionPreview from '@/views/dataset/add/union/UnionPreview' export default { name: 'AddUnion', @@ -151,6 +151,7 @@ export default { }, watch: { 'param.tableId': function() { + this.resetComponent() this.initTableData() } }, @@ -280,7 +281,7 @@ export default { initTableData() { if (this.param.tableId) { - getTable(this.param.tableId).then(response => { + post('/dataset/table/get/' + this.param.tableId, null).then(response => { const table = JSON.parse(JSON.stringify(response.data)) this.name = table.name this.dataset = JSON.parse(table.info).union @@ -299,6 +300,11 @@ export default { info: '{"union":' + JSON.stringify(this.dataset) + '}' } this.showPreview = true + }, + + resetComponent() { + this.dataset = [] + this.name = '关联数据集' } } }