From 74445fe9551403eb35c4b185a5aaab9249e9cb53 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 29 Jun 2022 16:46:11 +0800 Subject: [PATCH 01/14] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8D=A1=E5=85=B6=E8=99=9A=E6=8B=9F=E5=8C=96=E5=90=8E?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E9=80=89=E6=8B=A9=E5=87=BA=E7=8E=B0=E7=A9=BA?= =?UTF-8?q?=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ElVisualSelect/index.vue | 10 +++++++--- frontend/src/components/widget/DeWidget/DeSelect.vue | 9 ++++++++- frontend/src/utils/index.js | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue index 3799166a96..e97ac20409 100644 --- a/frontend/src/components/ElVisualSelect/index.vue +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -69,12 +69,16 @@ export default { }, list() { this.resetList() - this.init() + this.$nextTick(() => { + this.init() + }) } }, mounted() { this.resetList() - this.init() + this.$nextTick(() => { + this.init() + }) }, methods: { addScrollDiv(selectDom) { @@ -101,13 +105,13 @@ export default { if (this.defaultFirst && this.list.length > 0) { this.selectValue = this.list[0].value } + if (!this.list || !this.list.length) return const selectDom = document.querySelector( `.${this.classId} .el-select-dropdown .el-select-dropdown__wrap` ) this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`) this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`) - if (!this.slectBoxDom || !this.slectBoxDom.style) return this.slectBoxDom.style.display = 'flex' this.slectBoxDom.style.flexDirection = 'row' this.domList = selectDom.querySelector( diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 1cbdf5a8da..fb655c29b1 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -36,6 +36,7 @@ import ElVisualSelect from '@/components/ElVisualSelect' import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset' import bus from '@/utils/bus' +import { isSameVueObj } from '@/utils' import { getLinkToken, getToken } from '@/utils/auth' import customInput from '@/components/widget/DeWidget/customInput' import { textSelectWidget } from '@/components/widget/DeWidget/serviceNameFn.js' @@ -143,7 +144,9 @@ export default { }) }, 'element.options.attrs.sort': function(value, old) { - if (value === null || typeof value === 'undefined' || value === old) return + if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return + this.show = false + this.datas = [] let method = multFieldValues @@ -160,6 +163,10 @@ export default { this.element.options.attrs.fieldId.length > 0 && method(param).then(res => { this.datas = this.optionDatas(res.data) + this.$nextTick(() => { + this.show = true + this.handleCoustomStyle() + }) }) || (this.element.options.value = '') } diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 7c4a9510f1..e6db4df3c2 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -278,3 +278,11 @@ export function isMobile() { const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) return flag } + +export const isSameVueObj = (source, target) => { + if (!source && !target) return true + if (!!source && !!target) { + return JSON.stringify(source) === JSON.stringify(target) + } + return false +} From 54e1ed31ad9039622a815fb3e55a2e93f0e52377 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Thu, 30 Jun 2022 11:37:44 +0800 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20sql=20=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 3 +- frontend/src/lang/tw.js | 3 +- frontend/src/lang/zh.js | 3 +- frontend/src/views/dataset/add/AddSQL.vue | 95 +++++++++++------------ 4 files changed, 51 insertions(+), 53 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 2add74060d..4d40e9cd2d 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1122,7 +1122,8 @@ export default { max_more_than_mix: 'Max must more than Min' }, dataset: { - sql_variable_limit: 'SQL variables can only be used in where conditions', + sql_variable_limit_1: '1、SQL variables can only be used in where conditions', + sql_variable_limit_2: '2、Example:select * from table_name where column_name=‘${parm_name}', select_year: 'Select Year', select_month: 'Select Month', select_date: 'Select Date', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 7fff4723be..5115518c68 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1122,7 +1122,8 @@ export default { max_more_than_mix: '最大值必須大於最小值' }, dataset: { - sql_variable_limit: 'SQL 變數只能在 WHERE 條件中使用', + sql_variable_limit_1: '1、SQL變數只能在WHERE條件中使用', + sql_variable_limit_2: '2、示例:select * from table_name where column_name=‘${parm_name}', select_year: '選擇年', select_month: '選擇月', select_date: '選擇日期', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index b7a649b7aa..d11c35ac96 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1125,7 +1125,8 @@ export default { }, dataset: { select_year: '选择年', - sql_variable_limit: 'SQL 变量只能在 WHERE 条件中使用', + sql_variable_limit_1: '1、SQL 变量只能在 WHERE 条件中使用', + sql_variable_limit_2: '2、示例:select * from table_name where column_name=‘${parm_name}', select_month: '选择月', select_date: '选择日期', select_time: '选择时间', diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index d0ef9c1e97..9f2196c7f3 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -46,27 +46,8 @@ - - - -
- {{ $t('dataset.sql_variable_limit') }}
-
- -
-
-
- - - - - - {{ $t('sql_variable.variable_mgm') }} - - - @@ -118,6 +99,19 @@ + +
+ {{dialogTitle}} + + +
+ {{ $t('dataset.sql_variable_limit_1') }}
+ {{ $t('dataset.sql_variable_limit_2') }}
+
+ +
+
+
@@ -129,8 +123,8 @@