优化缓存页面 修复缓存页面导致数据不一致的问题

2024年9月9日shanao
shanao 2024-10-23 14:31:03 +08:00
parent 999fbe52e5
commit 4dcae30533
5 changed files with 29 additions and 12 deletions

View File

@ -41,7 +41,9 @@
border
fit
@current-change="handleCurrentChange"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40"/>
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="CORP_NAME" label="公司名称" show-overflow-tooltip />
<!-- <el-table-column prop="STARTTIME" label="属地" show-overflow-tooltip>
@ -95,7 +97,6 @@ import Pagination from '@/components/Pagination' // 通过 el-pagination二次
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves'
import axios from 'axios'
import dayjs from 'dayjs' // waves directive
export default {
name: 'IndexVue',
components: { Pagination },
@ -122,7 +123,9 @@ export default {
OUTSOURCED_NAME: '',
CORP_NAME: '',
varList: [],
row: null
row: null,
/** 当前选中行 */
multipleSelection: []
}
},
created() {
@ -168,12 +171,22 @@ export default {
this.row = row
},
/**
* 表格行选择器处理
*/
handleSelectionChange(val) {
console.log('表格行选择器处理')
this.multipleSelection = val
},
exportExcel() {
if (this.row == null || this.row.CORPINFO_ID == null || this.row.CORPINFO_ID === '') {
this.$message.error('请选择公司')
const selectedRows = this.multipleSelection
//
if (selectedRows === [] || selectedRows.length === 0) {
this.$message.warning('请选择要导出的公司')
return
}
this.$confirm('确定要下载' + this.row.CORP_NAME + '的检查数据吗?', {
this.$confirm('确定要下载' + selectedRows[0].CORP_NAME + '的检查数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -185,16 +198,20 @@ export default {
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
axios.get(config.httpurl + '/keyprojectcheck/export/excel/' + this.row.CORPINFO_ID, {
let ids = ''
selectedRows.forEach(row => {
ids += row.CORPINFO_ID + ','
})
axios.get(config.httpurl + '/keyprojectcheck/export/excel/' + ids, {
responseType: 'blob'
}).then(res => {
setTimeout(() => {
const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
const blob = new Blob([res.data], { type: res.headers['content-type'] })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
downloadElement.style.display = 'none'
downloadElement.href = href
downloadElement.download = this.row.CORP_NAME
downloadElement.download = '导出数据'
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement)

View File

@ -1,6 +1,6 @@
<template>
<div>
<keep-alive>
<keep-alive exclude="meteorologicalList,meteorologicalHistory">
<component :is="activeName"/>
</keep-alive>
</div>

View File

@ -1,6 +1,6 @@
<template>
<div>
<keep-alive>
<keep-alive exclude="meteorologicalinfoList">
<component :is="activeName"/>
</keep-alive>
</div>

View File

@ -1,5 +1,5 @@
<template>
<keep-alive>
<keep-alive exclude="CorpUserList,CorpUserDetail">
<component :is="activeName" />
</keep-alive>
</template>

View File

@ -1,5 +1,5 @@
<template>
<keep-alive>
<keep-alive exclude="CorpUserList">
<component :is="activeName" />
</keep-alive>
</template>