diff --git a/backend/src/main/java/io/dataease/controller/IndexController.java b/backend/src/main/java/io/dataease/controller/IndexController.java index 7236b8d6b4..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; @@ -11,6 +13,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 +48,15 @@ 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) { + LogUtil.error(e.getMessage()); + DEException.throwException(e); + } } 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) }) } 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() {