From 0b1f5fe3b436d4aa6d3ff438b90b0992c880382e Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 6 Dec 2021 11:04:55 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E7=AC=AC=E4=B8=89=E6=96=B9iframe?= =?UTF-8?q?=E5=B5=8C=E5=85=A5=E5=85=AC=E5=85=B1=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/controller/IndexController.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/IndexController.java b/backend/src/main/java/io/dataease/controller/IndexController.java index 7236b8d6b4..f4672af13c 100644 --- a/backend/src/main/java/io/dataease/controller/IndexController.java +++ b/backend/src/main/java/io/dataease/controller/IndexController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import javax.annotation.Resource; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; +import java.io.IOException; @Controller @RequestMapping @@ -45,13 +46,14 @@ public class IndexController { } @GetMapping("/link/{index}") - public String link(@PathVariable(value = "index", required = true) Long index) { + public void link(@PathVariable(value = "index", required = true) Long index) { String url = panelLinkService.getUrlByIndex(index); HttpServletResponse response = ServletUtils.response(); - String param = url.substring(url.indexOf("?") + 1); - Cookie cookie = new Cookie("link", param.split("=")[1]); - response.addCookie(cookie); - return url; + try { + response.sendRedirect(url); + } catch (IOException e) { + e.printStackTrace(); + } } From 5f46845bc250b20a4dd502b410d28c7774854195 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 6 Dec 2021 11:54:34 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=B9=E6=A0=91?= =?UTF-8?q?=E5=BD=A2=E7=BB=93=E6=9E=84=E6=93=8D=E4=BD=9C=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=9C=89=E5=85=B6=E4=BB=96=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/group/Group.vue | 10 ++-------- frontend/src/views/dataset/group/Group.vue | 10 ++-------- frontend/src/views/panel/list/PanelList.vue | 17 ++++++++++------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 998c0eb391..93c056e8db 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -44,6 +44,8 @@ :expand-on-click-node="true" :filter-node-method="filterNode" @node-click="nodeClick" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" > @@ -673,14 +675,6 @@ export default { if (data.modelInnerType !== 'group') { this.$emit('switchComponent', { name: 'ChartEdit', param: data }) } - if (node.expanded) { - this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } - } }, back() { diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 3e382cc1d7..30538abc30 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -45,6 +45,8 @@ highlight-current :expand-on-click-node="true" :filter-node-method="filterNode" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" @node-click="nodeClick" > @@ -524,14 +526,6 @@ export default { if (data.modelInnerType !== 'group') { this.$emit('switchComponent', { name: 'ViewTable', param: data }) } - if (node.expanded) { - this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } - } }, back() { diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 77ee470ee2..918ea08dd8 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -29,7 +29,6 @@
@@ -677,13 +678,15 @@ export default { bus.$emit('set-panel-show-type', 0) }) } - if (node.expanded) { + }, + nodeExpand(data) { + if (data.id) { this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } + } + }, + nodeCollapse(data) { + if (data.id) { + this.expandedArray.splice(this.expandedArray.indexOf(data.id), 1) } }, back() { From 334c4bd8aad934de404d9ac5c630611526d821fd Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 6 Dec 2021 15:37:04 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=97=B6=EF=BC=8C=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=92=8C=E7=BC=96=E8=BE=91=E8=A7=86=E5=9B=BE=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=84=E4=BB=B6=E4=BD=8D=E7=BD=AE=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/components/Editor/index.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index f54f5ef3eb..1b6aee1c66 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -327,7 +327,7 @@ function init() { const vm = this recalcCellWidth.call(this) resetPositionBox.call(this) - // initPosition(this) + initPosition(this) let i = 0 const timeid = setInterval(function() { if (i >= vm.yourList.length) { @@ -471,13 +471,11 @@ function removeItem(index) { this.yourList.splice(index, 1, {}) } -// eslint-disable-next-line no-unused-vars +// 矩阵设计初始化的时候 预占位,防止编辑仪表板页面,初始化和视图编辑返回时出现组件位置变化问题 function initPosition(_this) { _this.yourList.forEach(item => { - checkItemPosition.call(_this, item, { - x: item.x, - y: item.y - }) + fillPositionBox.call(_this, item.y + item.sizey) + addItemToPositionBox.call(_this, item) }) } From 98ed70ae974e566e0132aeb5500bdbe301056e51 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 7 Dec 2021 11:26:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor:=20=E8=A7=84=E8=8C=83=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/controller/IndexController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/io/dataease/controller/IndexController.java b/backend/src/main/java/io/dataease/controller/IndexController.java index f4672af13c..8313e3c491 100644 --- a/backend/src/main/java/io/dataease/controller/IndexController.java +++ b/backend/src/main/java/io/dataease/controller/IndexController.java @@ -1,7 +1,9 @@ package io.dataease.controller; +import io.dataease.commons.exception.DEException; import io.dataease.commons.license.DefaultLicenseService; import io.dataease.commons.license.F2CLicenseResponse; +import io.dataease.commons.utils.LogUtil; import io.dataease.commons.utils.ServletUtils; import io.dataease.service.panel.PanelLinkService; import org.springframework.stereotype.Controller; @@ -52,7 +54,8 @@ public class IndexController { try { response.sendRedirect(url); } catch (IOException e) { - e.printStackTrace(); + LogUtil.error(e.getMessage()); + DEException.throwException(e); } } From 0bb789db33c9b3bffa5f46295e54fb314d425648 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 6 Dec 2021 16:59:54 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20sql=20=E6=8B=BC=E6=8E=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/query/es/EsQueryProvider.java | 2 +- .../provider/query/es/EsSqlLConstants.java | 6 +-- .../sqlserver/SqlserverQueryProvider.java | 38 ++++++++++++------- .../src/main/resources/sql/sqlTemplate.stg | 5 ++- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java index d376cd3863..4c83334771 100644 --- a/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/es/EsQueryProvider.java @@ -898,7 +898,7 @@ public class EsQueryProvider extends QueryProvider { if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) { String cast = String.format(EsSqlLConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? "bigint" : "double"); String agg = String.format(EsSqlLConstants.AGG_FIELD, y.getSummary(), cast); - fieldName = String.format(EsSqlLConstants.CAST, agg, EsSqlLConstants.DEFAULT_FLOAT_FORMAT); + fieldName = String.format(EsSqlLConstants.ROUND, agg, "2"); } else { String cast = String.format(EsSqlLConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? "bigint" : "double"); fieldName = String.format(EsSqlLConstants.AGG_FIELD, y.getSummary(), cast); diff --git a/backend/src/main/java/io/dataease/provider/query/es/EsSqlLConstants.java b/backend/src/main/java/io/dataease/provider/query/es/EsSqlLConstants.java index 2498dc39cb..3dab2d8e56 100644 --- a/backend/src/main/java/io/dataease/provider/query/es/EsSqlLConstants.java +++ b/backend/src/main/java/io/dataease/provider/query/es/EsSqlLConstants.java @@ -19,12 +19,10 @@ public class EsSqlLConstants extends SQLConstants { public static final String CAST = "CAST(%s AS %s)"; + public static final String ROUND = "ROUND(%s, %s)"; + public static final String DEFAULT_DATE_FORMAT = "YYYY-MM-dd HH:mm:ss"; - public static final String DEFAULT_INT_FORMAT = "DECIMAL(20,0)"; - - public static final String DEFAULT_FLOAT_FORMAT = "DECIMAL(20,2)"; - public static final String WHERE_VALUE_NULL = "(NULL,'')"; public static final String WHERE_VALUE_VALUE = "'%s'"; diff --git a/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java b/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java index 908d6ec5be..d68029c77b 100644 --- a/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java +++ b/backend/src/main/java/io/dataease/provider/query/sqlserver/SqlserverQueryProvider.java @@ -282,7 +282,11 @@ public class SqlserverQueryProvider extends QueryProvider { if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - return sqlLimit(st.render(), view); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); + st.add("limitFiled", limitFiled); + } + return st.render(); } @Override @@ -353,7 +357,11 @@ public class SqlserverQueryProvider extends QueryProvider { .build(); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - return sqlLimit(st.render(), view); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); + st.add("limitFiled", limitFiled); + } + return st.render(); } @Override @@ -491,7 +499,11 @@ public class SqlserverQueryProvider extends QueryProvider { if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - return sqlLimit(st.render(), view); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); + st.add("limitFiled", limitFiled); + } + return st.render(); } @Override @@ -604,7 +616,11 @@ public class SqlserverQueryProvider extends QueryProvider { if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - return sqlLimit(st.render(), view); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); + st.add("limitFiled", limitFiled); + } + return st.render(); } @Override @@ -686,7 +702,11 @@ public class SqlserverQueryProvider extends QueryProvider { if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres); if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders); if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL); - return sqlLimit(st.render(), view); + if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { + SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build(); + st.add("limitFiled", limitFiled); + } + return st.render(); } @Override @@ -1057,12 +1077,4 @@ public class SqlserverQueryProvider extends QueryProvider { } return originField; } - - private String sqlLimit(String sql, ChartViewWithBLOBs view) { - if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) { - return String.format("SELECT top %s * from ( %s ) as DE_SQLSERVER_TMP ", view.getResultCount(), sqlFix(sql)); - } else { - return sql; - } - } } diff --git a/backend/src/main/resources/sql/sqlTemplate.stg b/backend/src/main/resources/sql/sqlTemplate.stg index 197e44359a..066ab4f350 100644 --- a/backend/src/main/resources/sql/sqlTemplate.stg +++ b/backend/src/main/resources/sql/sqlTemplate.stg @@ -1,6 +1,9 @@ -querySql(groups, aggregators, filters, orders, table) +querySql(limitFiled, groups, aggregators, filters, orders, table) ::=<< SELECT + + + * From 11515a5aeb40aad805b84fd28a22317e9c86db82 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 8 Dec 2021 15:28:54 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=97=B6=E5=8F=B3=E4=BE=A7=E8=BE=B9=E6=A1=86=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E8=BF=87=E5=A4=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/Preview.vue | 10 +++------- frontend/src/views/panel/edit/index.vue | 4 +++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index ccdf7bcd8e..19a7ea3f1e 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -213,8 +213,8 @@ export default { restore() { const canvasHeight = document.getElementById('canvasInfoMain').offsetHeight const canvasWidth = document.getElementById('canvasInfoMain').offsetWidth - this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)// 获取宽度比 - this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)// 获取高度比 + this.scaleWidth = (canvasWidth) * 100 / this.canvasStyleData.width // 获取宽度比 + this.scaleHeight = canvasHeight * 100 / this.canvasStyleData.height// 获取高度比 this.handleScaleChange() }, resetID(data) { @@ -226,7 +226,7 @@ export default { return data }, format(value, scale) { - return value * parseInt(scale) / 100 + return value * scale / 100 }, handleScaleChange() { if (this.componentData) { @@ -296,10 +296,6 @@ export default { color: #9ea6b2; } - .gap_class { - padding: 5px; - } - .dialog-css > > > .el-dialog__title { font-size: 14px; } diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 7064aee29b..6b52cd3818 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -321,7 +321,9 @@ export default { return !this.linkageSettingStatus && !this.mobileLayoutStatus }, showAttr() { - if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) { + if (this.mobileLayoutStatus) { + return false + } else if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) { // 过滤组件有标题才显示 if (this.curComponent.type === 'custom' && !this.curComponent.options.attrs.title) { return false