CN-516 fix: 修复报告相关bug

This commit is contained in:
@changcode
2022-04-24 18:16:41 +08:00
parent bccea4cf5c
commit 4883c5c6d9
3 changed files with 16 additions and 6 deletions

View File

@@ -16,13 +16,12 @@
} }
.cn-builtin-left-menu { .cn-builtin-left-menu {
width: 250px; width: 250px;
height: 46px; word-break: normal;
margin: auto; margin: auto;
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
letter-spacing: 0; letter-spacing: 0;
line-height: 46px; padding: 14px;
padding-left: 15px;
cursor: pointer; cursor: pointer;
} }
.cn-builtin-left-menu.cn-active { .cn-builtin-left-menu.cn-active {

View File

@@ -1,6 +1,5 @@
import { hasButton } from '@/permission' import { hasButton } from '@/permission'
import { dateFormatByAppearance } from '@/utils/date-util' import { dateFormatByAppearance } from '@/utils/date-util'
import { storageKey } from '@/utils/constants'
export default { export default {
data () { data () {
return { return {

View File

@@ -178,9 +178,17 @@ export default {
this.$refs.dataTable.loadingTableId = u.id // 列表单个下载 this.$refs.dataTable.loadingTableId = u.id // 列表单个下载
} }
if (!u && n === 2) { // 批量下载 if (!u && n === 2) { // 批量下载
return this.$refs.dataTable.loading = false this.$refs.dataTable.loading = false
return
} else if (!u && n === 1) { // 列表单个下载 } else if (!u && n === 1) { // 列表单个下载
return this.$refs.dataTable.loadingTableId = u.id this.$refs.dataTable.loadingTableId = u.id
return
}
// 判断是否成功登陆成功
if (!localStorage.getItem(storageKey.token) && n === 2) {
return window.location.replace('/')
} else if (!localStorage.getItem(storageKey.token) && n === 1) {
return window.location.replace('/')
} }
axios.get(url, { responseType: 'blob', params: params }).then(res => { axios.get(url, { responseType: 'blob', params: params }).then(res => {
if (window.navigator.msSaveOrOpenBlob) { if (window.navigator.msSaveOrOpenBlob) {
@@ -237,6 +245,10 @@ export default {
} }
this.$refs.dataTable.loadingPreviewId = u.id this.$refs.dataTable.loadingPreviewId = u.id
axios.get(api.reportView, { params: params }).then(res => { axios.get(api.reportView, { params: params }).then(res => {
if (!localStorage.getItem(storageKey.token)) {
this.$refs.dataTable.loadingPreviewId = !u.id
return
}
const prevWindow = window.open('', '') const prevWindow = window.open('', '')
prevWindow.document.write(res.data) prevWindow.document.write(res.data)
prevWindow.focus() prevWindow.focus()