提交 eb88e0ae 编写于 作者: chengxiang.li's avatar chengxiang.li

两个数据查看页面接口调试

上级 4cc19694
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<template v-if="searchTableVisible"> <template v-if="searchTableVisible">
<el-row class="button-wrap"> <el-row class="button-wrap">
<el-button class="each-button" type="primary" @click="hadnleSearch">查询</el-button> <el-button class="each-button" type="primary" @click="hadnleSearch">查询</el-button>
<el-button type="primary" @click="showExportModal" v-if="showExportBtn">导出</el-button> <el-button class="each-button" type="primary" @click="showExportModal" v-if="showExportBtn">导出</el-button>
<el-button class="each-button" type="primary" @click="showAddConditionModal(true)">添加筛选条件</el-button> <el-button class="each-button" type="primary" @click="showAddConditionModal(true)">添加筛选条件</el-button>
</el-row> </el-row>
...@@ -431,7 +431,9 @@ ...@@ -431,7 +431,9 @@
vm.smsCode = ''; vm.smsCode = '';
vm.tableDataList = res.data; vm.tableDataList = res.data;
if(typeof res.data.dataExportCount != 'undefined' && res.data.dataExportCount > 0) {
vm.showExportBtn = true;
}
vm.$nextTick(() => { vm.$nextTick(() => {
if(vm.afterParam){ if(vm.afterParam){
...@@ -519,19 +521,19 @@ ...@@ -519,19 +521,19 @@
if(res.code == '000000'){ if(res.code == '000000'){
console.log('正式导出》》》》 ', res) console.log('正式导出》》》》 ', res)
// 执行下载excel // 执行下载excel
// vm.downloadFile(res.data) vm.downloadFile(res.data.path, res.data.fileName)
// vm.exportModalVisible = false; vm.exportModalVisible = false;
}else{ }else{
vm.$message.error(res.message); vm.$message.error(res.message);
} }
}; };
vm.sendRequest( 'post', `/sensitive/dataSearch/exportWeb`, data, callback ); vm.sendRequest( 'post', `/sensitive/dataSearch/exportWeb`, data, callback );
}, },
downloadFile(base64) { downloadFile(base64, fileName) {
let a = document.createElement('a'); let a = document.createElement('a');
let uploadHref = 'data:application/xls;base64,' + base64; let uploadHref = 'data:application/xls;base64,' + base64;
a.setAttribute('href', uploadHref); a.setAttribute('href', uploadHref);
let exportFileName = '待定xxx' + '.xlsx'; let exportFileName = fileName;
a.setAttribute('download', exportFileName); a.setAttribute('download', exportFileName);
a.click(); a.click();
}, },
......
...@@ -453,20 +453,20 @@ export default { ...@@ -453,20 +453,20 @@ export default {
let callback = (res) => { let callback = (res) => {
if(res.code == '000000'){ if(res.code == '000000'){
console.log('正式导出》》》》 ', res) console.log('正式导出》》》》 ', res)
// vm.checkExportData.dataExportTotal = res.data.dataExportTotal; // 执行下载excel
// vm.checkExportData.dataExportCount = res.data.dataExportCount; vm.downloadFile(res.data.path, res.data.fileName)
// vm.exportModalVisible = true; vm.exportModalVisible = false;
}else{ }else{
vm.$message.error(res.message); vm.$message.error(res.message);
} }
}; };
vm.sendRequest( 'post', `/sensitive/dataSearch/export`, data, callback ); vm.sendRequest( 'post', `/sensitive/dataSearch/export`, data, callback );
}, },
downloadFile(base64) { downloadFile(base64, fileName) {
let a = document.createElement('a'); let a = document.createElement('a');
let uploadHref = 'data:application/xls;base64,' + base64; let uploadHref = 'data:application/xls;base64,' + base64;
a.setAttribute('href', uploadHref); a.setAttribute('href', uploadHref);
let exportFileName = '待定xxx' + '.xlsx'; let exportFileName = fileName;
a.setAttribute('download', exportFileName); a.setAttribute('download', exportFileName);
a.click(); a.click();
}, },
...@@ -515,7 +515,7 @@ export default { ...@@ -515,7 +515,7 @@ export default {
if(typeof res.data.dataRole != 'undefined' && res.data.dataRole == 1){ if(typeof res.data.dataRole != 'undefined' && res.data.dataRole == 1){
vm.showSendBtn = true; vm.showSendBtn = true;
}; };
if(typeof res.data.dataRole != 'undefined' && res.data.dataExportCount > 0) { if(typeof res.data.dataExportCount != 'undefined' && res.data.dataExportCount > 0) {
vm.showExportBtn = true; vm.showExportBtn = true;
} }
}else{ }else{
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册