refactor(仪表板): 增加仪表板跳转外部链接URL非法提示

This commit is contained in:
wangjiahao 2022-12-30 13:48:18 +08:00
parent b60f78fd56
commit 0cea8a41ae
4 changed files with 17 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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