From 990c6778df512ee8fb856082fa943283c3ca7b5c Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 28 Jul 2021 11:32:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=88=87=E6=8D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddCustom.vue | 16 ++++++++++++++-- frontend/src/views/dataset/add/AddSQL.vue | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) 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) } } }