Merge pull request #4248 from dataease/pr@dev@refactor_url-check

refactor(仪表板): 增加仪表板跳转外部链接URL非法提示
This commit is contained in:
王嘉豪 2022-12-30 13:49:40 +08:00 committed by GitHub
commit 78e1299ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 3 deletions

View File

@ -966,7 +966,7 @@ export default {
// ID
if (jumpInfo.publicJumpId) {
const url = '/link/' + jumpInfo.publicJumpId
window.open(url, jumpInfo.jumpType)
this.windowsJump(url, jumpInfo.jumpType)
} else {
this.$message({
type: 'warn',
@ -976,7 +976,7 @@ export default {
}
} else {
const url = '#/preview/' + jumpInfo.targetPanelId
window.open(url, jumpInfo.jumpType)
this.windowsJump(url, jumpInfo.jumpType)
}
} else {
this.$message({
@ -989,7 +989,7 @@ export default {
const colList = [...param.dimensionList, ...param.quotaList]
let url = this.setIdValueTrans('id', 'value', jumpInfo.content, colList)
url = checkAddHttp(url)
window.open(url, jumpInfo.jumpType)
this.windowsJump(url, jumpInfo.jumpType)
}
} else {
if (this.chart.type.indexOf('table') === -1) {
@ -1019,6 +1019,17 @@ export default {
}
return name2Id
},
windowsJump(url, jumpType) {
try {
window.open(url, jumpType)
} catch (e) {
this.$message({
message: this.$t('panel.url_check_error') + ':' + url,
type: 'error',
showClose: true
})
}
},
resetDrill() {
const length = this.drillClickDimensionList.length

View File

@ -1955,6 +1955,7 @@ export default {
back_parent: 'Back to previous'
},
panel: {
url_check_error: 'Jump error, Illegal URL',
view_style: 'View Style',
view_color_setting: 'View Color Setting',
border_color_setting: 'Border Color',

View File

@ -1949,6 +1949,7 @@ export default {
back_parent: '返回上一級'
},
panel: {
url_check_error: '跳轉錯誤URL不合法',
view_style: '視圖樣式',
view_color_setting: '視圖配色',
border_color_setting: '邊框配色',

View File

@ -1949,6 +1949,7 @@ export default {
back_parent: '返回上一级'
},
panel: {
url_check_error: '跳转错误URL不合法',
view_style: '视图样式',
view_color_setting: '视图配色',
border_color_setting: '边框配色',