diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index a5b058a2aa..64031a1c50 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -88,6 +88,11 @@ export default { } }, watch: { + 'param.tableId': { + handler: function() { + this.resetComponent() + } + }, 'checkedList': function() { // console.log(this.checkedList) this.getUnionData() @@ -239,8 +244,15 @@ export default { } }, - dataReset() { - + resetComponent() { + this.name = '自定义数据集' + this.table = {} + this.checkedList = [] + this.unionData = [] + this.height = 500 + this.data = [] + this.fields = [] + this.customType = ['db', 'sql', 'excel'] } } diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 759c5f6ccd..cb8873deb4 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -163,6 +163,7 @@ export default { watch: { 'param.tableId': { handler: function() { + this.resetComponent() this.initTableInfo() } } @@ -302,6 +303,20 @@ export default { // console.log(newCode) this.sql = newCode this.$emit('codeChange', this.sql) + }, + + resetComponent() { + this.dataSource = '' + this.options = [] + this.name = '' + this.sql = '' + this.data = [] + this.fields = [] + this.mode = '0' + this.syncType = 'sync_now' + this.height = 500 + this.kettleRunning = false + this.$refs.plxTable.reloadData(this.data) } } }