Browse Source

导出接口

wangqin
zhoule 8 months ago
parent
commit
3e14b85a8a
  1. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue

8
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue

@ -225,12 +225,18 @@ export default {
this.isShowAddNew = true; this.isShowAddNew = true;
}, },
onExport() { onExport() {
let url = '';
if (this.activeName == '-1') {
url = '/business/warning/export'
} else {
url = '/dc/system/event/export';
}
let loadingInstance = Loading.service({ let loadingInstance = Loading.service({
fullscreen: true, fullscreen: true,
background: "#00000052", background: "#00000052",
text: "文件正在下载...", text: "文件正在下载...",
}); });
request.post('/dc/system/event/export', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' }) request.post(url, {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
const url = window.URL.createObjectURL(new Blob([res])); const url = window.URL.createObjectURL(new Blob([res]));

Loading…
Cancel
Save