Merge pull request #6494 from dataease/pr@dev@perf_link_jump

perf: 公共链接跳转返回上一级
This commit is contained in:
fit2cloud-chenyw 2023-11-01 17:38:34 +08:00 committed by GitHub
commit 0bc5b415ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 25 deletions

View File

@ -67,6 +67,10 @@ public class IndexController {
if (StringUtils.isNotEmpty(attachParams)) { if (StringUtils.isNotEmpty(attachParams)) {
url = url + "&attachParams=" + attachParams; url = url + "&attachParams=" + attachParams;
} }
String fromLink = request.getParameter("fromLink");
if (StringUtils.isNotEmpty(fromLink)) {
url = url + "&fromLink=" + fromLink;
}
response.sendRedirect(url); response.sendRedirect(url);
} catch (IOException e) { } catch (IOException e) {
LogUtil.error(e.getMessage()); LogUtil.error(e.getMessage());

View File

@ -33,6 +33,7 @@
const user = getQueryVariable('user') const user = getQueryVariable('user')
const terminal = getQueryVariable('terminal') const terminal = getQueryVariable('terminal')
const attachParams = getQueryVariable('attachParams') const attachParams = getQueryVariable('attachParams')
const fromLink = getQueryVariable('fromLink')
const baseUrl = window.location.pathname.replace('link.html', '') const baseUrl = window.location.pathname.replace('link.html', '')
let url = baseUrl + "#/delink?link=" + encodeURIComponent(link) let url = baseUrl + "#/delink?link=" + encodeURIComponent(link)
if (terminal) { if (terminal) {
@ -44,6 +45,9 @@
if (attachParams) { if (attachParams) {
url += '&attachParams=' + encodeURIComponent(attachParams) url += '&attachParams=' + encodeURIComponent(attachParams)
} }
if (fromLink) {
url += '&fromLink=' + fromLink
}
window.location.href = url window.location.href = url
</script> </script>

View File

@ -12,7 +12,7 @@
> >
<el-button-group size="mini"> <el-button-group size="mini">
<el-button <el-button
v-if="!isNewBlank" v-if="fromLink"
size="mini" size="mini"
type="button" type="button"
@click="back2Last" @click="back2Last"
@ -89,8 +89,8 @@ export default {
isPublicLink() { isPublicLink() {
return this.$router.currentRoute.path === '/delink' return this.$router.currentRoute.path === '/delink'
}, },
isNewBlank() { fromLink() {
return window.history.length === 1 return this.$route.query.fromLink === 'true'
}, },
containerClass() { containerClass() {
return this.isPublicLink ? 'trans-pc' : 'bar-main' return this.isPublicLink ? 'trans-pc' : 'bar-main'

View File

@ -164,10 +164,9 @@ import {queryAll} from '@/api/panel/pdfTemplate'
import PDFPreExport from '@/views/panel/export/PDFPreExport' import PDFPreExport from '@/views/panel/export/PDFPreExport'
import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey' import { listenGlobalKeyDownPreview } from '@/components/canvas/utils/shortcutKey'
import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog' import UserViewDialog from '@/components/canvas/customComponent/UserViewDialog'
import {hexColorToRGBA} from "@/views/chart/chart/util"; import { hexColorToRGBA } from '@/views/chart/chart/util'
import { isMobile } from '@/utils/index' import { isMobile } from '@/utils/index'
const erd = elementResizeDetectorMaker() const erd = elementResizeDetectorMaker()
export default { export default {
components: { UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport }, components: { UserViewDialog, ComponentWrapper, CanvasOptBar, PDFPreExport },
@ -463,7 +462,7 @@ export default {
return this.$refs['viewWrapperChild'] return this.$refs['viewWrapperChild']
}, },
getAllWrapperChildRefs() { getAllWrapperChildRefs() {
let allChildRefs = [] const allChildRefs = []
const currentChildRefs = this.getWrapperChildRefs() const currentChildRefs = this.getWrapperChildRefs()
if (currentChildRefs && currentChildRefs.length > 0) { if (currentChildRefs && currentChildRefs.length > 0) {
allChildRefs.push.apply(allChildRefs, currentChildRefs) allChildRefs.push.apply(allChildRefs, currentChildRefs)

View File

@ -1038,7 +1038,7 @@ export default {
if (this.publicLinkStatus) { if (this.publicLinkStatus) {
// ID // ID
if (jumpInfo.publicJumpId) { if (jumpInfo.publicJumpId) {
const url = '/link/' + jumpInfo.publicJumpId const url = '/link/' + jumpInfo.publicJumpId + '?fromLink=true'
const currentUrl = window.location.href const currentUrl = window.location.href
localStorage.setItem('beforeJumpUrl', currentUrl) localStorage.setItem('beforeJumpUrl', currentUrl)
this.windowsJump(url, jumpInfo.jumpType) this.windowsJump(url, jumpInfo.jumpType)