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 {
width: 250px;
height: 46px;
word-break: normal;
margin: auto;
font-size: 14px;
color: #333333;
letter-spacing: 0;
line-height: 46px;
padding-left: 15px;
padding: 14px;
cursor: pointer;
}
.cn-builtin-left-menu.cn-active {

View File

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

View File

@@ -178,9 +178,17 @@ export default {
this.$refs.dataTable.loadingTableId = u.id // 列表单个下载
}
if (!u && n === 2) { // 批量下载
return this.$refs.dataTable.loading = false
this.$refs.dataTable.loading = false
return
} 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 => {
if (window.navigator.msSaveOrOpenBlob) {
@@ -237,6 +245,10 @@ export default {
}
this.$refs.dataTable.loadingPreviewId = u.id
axios.get(api.reportView, { params: params }).then(res => {
if (!localStorage.getItem(storageKey.token)) {
this.$refs.dataTable.loadingPreviewId = !u.id
return
}
const prevWindow = window.open('', '')
prevWindow.document.write(res.data)
prevWindow.focus()