提交 6c86858a authored 作者: lidongxu's avatar lidongxu

refactor(jimu): 修改:积木新建编辑预览的跳转地址

上级 6846f3fe
......@@ -17,7 +17,7 @@ VITE_APP_REDIRECT_URL = 'http://localhost:8085'
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
# 积木报表预览地址
VITE_APP_REPORT_PREVIEW_URL = '#/report/jmreport/view'
# 积木报表分享预览地址
# 积木报表分享预览地址(后台给的地址会包含后续的/jmreport/shareview)
VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
# 积木报表编辑地址
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
......
......@@ -16,7 +16,7 @@ VITE_APP_REDIRECT_URL = 'https://sfa.wxl66.cn/link/'
VITE_APP_REPORT_URL = 'https://sfa.wxl66.cn'
# 积木报表预览地址
VITE_APP_REPORT_PREVIEW_URL = '#/report/jmreport/view'
# 积木报表分享预览地址
# 积木报表分享预览地址(后台给的地址会包含后续的/jmreport/shareview)
VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
# 积木报表编辑地址
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
......
......@@ -15,7 +15,7 @@ VITE_APP_REDIRECT_URL = 'https://sfa-qa.wxl66.cn/'
VITE_APP_REPORT_URL = 'https://sfa-qa.wxl66.cn'
# 积木报表预览地址
VITE_APP_REPORT_PREVIEW_URL = '#/report/jmreport/view'
# 积木报表分享预览地址
# 积木报表分享预览地址(后台给的地址会包含后续的/jmreport/shareview)
VITE_APP_REPORT_SHARE_PREVIEW_URL = '#/report'
# 积木报表编辑地址
VITE_APP_REPORT_EDIT_URL = '#/report/jmreport/index'
......
......@@ -61,7 +61,6 @@ router.beforeEach((to, from, next) => {
if (isWhiteList(to.path)) {
next()
} else {
console.log('登录未遂地址', to.fullPath)
next(`/login?redirect=${to.fullPath}`)
NProgress.done()
}
......
......@@ -263,7 +263,7 @@ const getReportEditUrl = (row) => {
// 新建报表
const handleAdd = async () => {
const res = await addReportAPI()
window.open(`${reportBaseDomain}${reportEditURL}/${res.result.id}?&token=${getToken()}&tenantId=${userStore.$state.userInfo.deptId}&menuType=${queryParams.reportType}`)
window.open(`${reportBaseDomain}${reportEditURL}/${res.result.id}?&tenantId=${userStore.$state.userInfo.deptId}&menuType=${queryParams.reportType}`)
}
// 导入报表
const handleImport = () => {
......@@ -283,7 +283,7 @@ const handleImport = () => {
}
// 浏览报表
const handleView = (row) => {
window.open(`${reportBaseDomain}${reportViewURL}/${row.id}?token=${getToken()}&tenantId=${userStore.$state.userInfo.deptId}`)
window.open(`${reportBaseDomain}${reportViewURL}/${row.id}?tenantId=${userStore.$state.userInfo.deptId}`)
}
// 分享报表
......@@ -338,10 +338,9 @@ function copyTextSuccess() {
proxy.$modal.msgSuccess('链接已复制到剪切板')
}
// 修改报表
const handleEdit = (row) => {
window.open(`${reportBaseDomain}${reportEditURL}/${row.id}?token=${getToken()}&tenantId=${userStore.$state.userInfo.deptId}`)
window.open(`${reportBaseDomain}${reportEditURL}/${row.id}?tenantId=${userStore.$state.userInfo.deptId}`)
}
// 删除报表
const handleDelete = (row) => {
......
<template>
<iframe
:src="openUrl"
<iframe :src="openUrl"
frameborder="0"></iframe>
</template>
<script setup>
const reportBaseDomain = import.meta.env.VITE_APP_REPORT_URL // 基础域名
const reportViewURL = import.meta.env.VITE_APP_REPORT_PREVIEW_URL // 预览
const reportEditURL = import.meta.env.VITE_APP_REPORT_EDIT_URL // 新增/编辑
const route = useRoute()
console.log(route, route.fullPath)
const openUrl = reportBaseDomain + route.fullPath
console.log(route.fullPath, 'rop')
// 判断路由上是否包含新建/编辑/预览积木的地址,需要携带 token
if (route.fullPath.includes(reportViewURL.substring(1)) || route.fullPath.includes(reportEditURL.substring(1))) {
// 包含预览/编辑地址,需要携带 token
// 包含 token
const token = getToken()
if (token) {
openUrl += `&token=${token}`
}
}
</script>
<style scoped
......
......@@ -160,7 +160,6 @@ async function loginByType(type, data) {
type,
data
}).then(() => {
console.log('未遂地址跳转', redirect.value)
// 把 redirect.value 上的查询参数拿下来,单独跳转发送如果有的话
const redirectQuery = redirect.value.split('?')[1]
// 字符串转对象结构
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论