前端限制审计日志的最大数据量

This commit is contained in:
lanrenwo 2022-07-27 09:22:04 +08:00
parent b9bd74ed1f
commit d5f88affcd
1 changed files with 9 additions and 1 deletions

View File

@ -61,7 +61,7 @@
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="tableData"
v-loading="loading" v-loading="loading"
element-loading-text="玩命搜索中" element-loading-text="玩命加载中"
element-loading-spinner="el-icon-loading" element-loading-spinner="el-icon-loading"
border> border>
@ -179,6 +179,7 @@ export default {
{ text: 'HTTPS', value: '3' }, { text: 'HTTPS', value: '3' },
{ text: 'HTTP', value: '4' }, { text: 'HTTP', value: '4' },
], ],
maxExportNum: 1000000,
loading: false, loading: false,
rules: { rules: {
username: [ username: [
@ -253,6 +254,13 @@ export default {
}); });
}, },
handleExport() { handleExport() {
if (this.count > this.maxExportNum) {
var formatNum = (this.maxExportNum + "").replace(/\d{1,3}(?=(\d{3})+$)/g,function(s){
return s+','
})
this.$message.error("你导出的数据量超过" + formatNum + "条,请调整搜索条件,再导出");
return ;
}
if (! this.searchForm.date) { if (! this.searchForm.date) {
this.searchForm.date = ["", ""]; this.searchForm.date = ["", ""];
} }