From dd5ce34902d4ada62f1f5fd69b7a68e479578fff Mon Sep 17 00:00:00 2001
From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com>
Date: Thu, 22 Sep 2022 11:25:31 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A2=84=E8=A7=88=E6=95=B0=E6=8D=AE=20?=
=?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
frontend/src/views/dataset/add/AddApi.vue | 2 +-
frontend/src/views/dataset/add/AddDB.vue | 2 +-
frontend/src/views/dataset/add/AddSQL.vue | 36 ++++++++++---------
frontend/src/views/dataset/add/AddUnion.vue | 2 +-
.../views/dataset/add/union/UnionPreview.vue | 25 +++++++++++--
frontend/src/views/dataset/group/Group.vue | 1 -
6 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/frontend/src/views/dataset/add/AddApi.vue b/frontend/src/views/dataset/add/AddApi.vue
index 6a2c651051..dfa2afb486 100644
--- a/frontend/src/views/dataset/add/AddApi.vue
+++ b/frontend/src/views/dataset/add/AddApi.vue
@@ -281,7 +281,7 @@ export default {
const that = this
setTimeout(function() {
const currentHeight = document.documentElement.clientHeight
- that.height = currentHeight - 195 - 54
+ that.height = currentHeight - 56 - 64 - 75 - 32 - 24 - 16 - 10
}, 10)
},
setActiveName({ name, datasourceId, enableCheck }) {
diff --git a/frontend/src/views/dataset/add/AddDB.vue b/frontend/src/views/dataset/add/AddDB.vue
index 06d5c82607..abb2110b63 100644
--- a/frontend/src/views/dataset/add/AddDB.vue
+++ b/frontend/src/views/dataset/add/AddDB.vue
@@ -312,7 +312,7 @@ export default {
const that = this
setTimeout(function () {
const currentHeight = document.documentElement.clientHeight
- that.height = currentHeight - 195 - 54
+ that.height = currentHeight - 56 - 64 - 75 - 32 - 24 - 16 - 10
}, 10)
},
setActiveName({ name, datasourceId, enableCheck }) {
diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue
index 8fad55ec00..7e237a1848 100644
--- a/frontend/src/views/dataset/add/AddSQL.vue
+++ b/frontend/src/views/dataset/add/AddSQL.vue
@@ -371,7 +371,7 @@ import 'codemirror/addon/hint/sql-hint'
import 'codemirror/addon/hint/show-hint'
import { engineMode } from '@/api/system/engine'
import msgCfm from '@/components/msgCfm/index'
-
+import _ from 'lodash'
export default {
name: 'AddSQL',
components: { codemirror },
@@ -488,6 +488,11 @@ export default {
handler: function () {
this.initTableInfo()
}
+ },
+ sqlHeight: {
+ handler: function () {
+ this.calHeight()
+ }
}
},
mounted() {
@@ -560,14 +565,11 @@ export default {
this.tableData = response.data
})
},
- calHeight() {
- const that = this
- setTimeout(function () {
- const currentHeight = document.documentElement.clientHeight
- that.height =
- currentHeight - 56 - 30 - 26 - 25 - 43 - 160 - 10 - 37 - 20 - 10 - 16
- }, 10)
- },
+ calHeight: _.debounce(function() {
+ const sqlHeight = Math.max(this.sqlHeight, 248)
+ const currentHeight = document.documentElement.clientHeight
+ this.height = currentHeight - sqlHeight - 56 - 54 - 36 - 64
+ }, 200),
initDataSource() {
listDatasource().then((response) => {
this.options = response.data.filter((item) => item.type !== 'api')
@@ -636,7 +638,7 @@ export default {
return
}
this.parseVariable()
- this.loading = true;
+ this.loading = true
const table = {
id: this.param.tableId,
name: this.param.name,
@@ -651,12 +653,14 @@ export default {
isBase64Encryption: true
})
}
- post('/dataset/table/update', table).then((response) => {
- this.openMessageSuccess('deDataset.set_saved_successfully')
- this.cancel()
- }).finally(() => {
- this.loading = false;
- })
+ post('/dataset/table/update', table)
+ .then((response) => {
+ this.openMessageSuccess('deDataset.set_saved_successfully')
+ this.cancel()
+ })
+ .finally(() => {
+ this.loading = false
+ })
},
cancel() {
diff --git a/frontend/src/views/dataset/add/AddUnion.vue b/frontend/src/views/dataset/add/AddUnion.vue
index 29b2d09951..5cfd6c541f 100644
--- a/frontend/src/views/dataset/add/AddUnion.vue
+++ b/frontend/src/views/dataset/add/AddUnion.vue
@@ -41,7 +41,7 @@
}}
-
+
@@ -22,6 +22,7 @@