Merge branch 'v1.5' of github.com:dataease/dataease into v1.5

This commit is contained in:
taojinlong 2021-12-07 17:13:52 +08:00
commit 917e6fe5e7
5 changed files with 28 additions and 34 deletions

View File

@ -1,7 +1,9 @@
package io.dataease.controller; package io.dataease.controller;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.license.DefaultLicenseService; import io.dataease.commons.license.DefaultLicenseService;
import io.dataease.commons.license.F2CLicenseResponse; import io.dataease.commons.license.F2CLicenseResponse;
import io.dataease.commons.utils.LogUtil;
import io.dataease.commons.utils.ServletUtils; import io.dataease.commons.utils.ServletUtils;
import io.dataease.service.panel.PanelLinkService; import io.dataease.service.panel.PanelLinkService;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Controller @Controller
@RequestMapping @RequestMapping
@ -45,13 +48,15 @@ public class IndexController {
} }
@GetMapping("/link/{index}") @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); String url = panelLinkService.getUrlByIndex(index);
HttpServletResponse response = ServletUtils.response(); HttpServletResponse response = ServletUtils.response();
String param = url.substring(url.indexOf("?") + 1); try {
Cookie cookie = new Cookie("link", param.split("=")[1]); response.sendRedirect(url);
response.addCookie(cookie); } catch (IOException e) {
return url; LogUtil.error(e.getMessage());
DEException.throwException(e);
}
} }

View File

@ -327,7 +327,7 @@ function init() {
const vm = this const vm = this
recalcCellWidth.call(this) recalcCellWidth.call(this)
resetPositionBox.call(this) resetPositionBox.call(this)
// initPosition(this) initPosition(this)
let i = 0 let i = 0
const timeid = setInterval(function() { const timeid = setInterval(function() {
if (i >= vm.yourList.length) { if (i >= vm.yourList.length) {
@ -471,13 +471,11 @@ function removeItem(index) {
this.yourList.splice(index, 1, {}) this.yourList.splice(index, 1, {})
} }
// eslint-disable-next-line no-unused-vars //
function initPosition(_this) { function initPosition(_this) {
_this.yourList.forEach(item => { _this.yourList.forEach(item => {
checkItemPosition.call(_this, item, { fillPositionBox.call(_this, item.y + item.sizey)
x: item.x, addItemToPositionBox.call(_this, item)
y: item.y
})
}) })
} }

View File

@ -44,6 +44,8 @@
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-click="nodeClick" @node-click="nodeClick"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
> >
<span v-if="data.modelInnerType ==='group'" slot-scope="{ node, data }" class="custom-tree-node father"> <span v-if="data.modelInnerType ==='group'" slot-scope="{ node, data }" class="custom-tree-node father">
<span style="display: flex;flex: 1;width: 0;"> <span style="display: flex;flex: 1;width: 0;">
@ -673,14 +675,6 @@ export default {
if (data.modelInnerType !== 'group') { if (data.modelInnerType !== 'group') {
this.$emit('switchComponent', { name: 'ChartEdit', param: data }) 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() { back() {

View File

@ -45,6 +45,8 @@
highlight-current highlight-current
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
@node-click="nodeClick" @node-click="nodeClick"
> >
<span v-if="data.modelInnerType === 'group'" slot-scope="{ node, data }" class="custom-tree-node father"> <span v-if="data.modelInnerType === 'group'" slot-scope="{ node, data }" class="custom-tree-node father">
@ -524,14 +526,6 @@ export default {
if (data.modelInnerType !== 'group') { if (data.modelInnerType !== 'group') {
this.$emit('switchComponent', { name: 'ViewTable', param: data }) 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() { back() {

View File

@ -29,7 +29,6 @@
<div class="block"> <div class="block">
<el-tree <el-tree
ref="default_panel_tree" ref="default_panel_tree"
:default-expanded-keys="expandedArray"
:data="defaultData" :data="defaultData"
node-key="id" node-key="id"
:highlight-current="activeTree==='system'" :highlight-current="activeTree==='system'"
@ -84,6 +83,8 @@
:highlight-current="activeTree==='self'" :highlight-current="activeTree==='self'"
:expand-on-click-node="true" :expand-on-click-node="true"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@node-expand="nodeExpand"
@node-collapse="nodeCollapse"
@node-click="nodeClick" @node-click="nodeClick"
> >
<span slot-scope="{ node, data }" class="custom-tree-node-list father"> <span slot-scope="{ node, data }" class="custom-tree-node-list father">
@ -677,13 +678,15 @@ export default {
bus.$emit('set-panel-show-type', 0) bus.$emit('set-panel-show-type', 0)
}) })
} }
if (node.expanded) { },
nodeExpand(data) {
if (data.id) {
this.expandedArray.push(data.id) this.expandedArray.push(data.id)
} else { }
const index = this.expandedArray.indexOf(data.id) },
if (index > -1) { nodeCollapse(data) {
this.expandedArray.splice(index, 1) if (data.id) {
} this.expandedArray.splice(this.expandedArray.indexOf(data.id), 1)
} }
}, },
back() { back() {