Browse Source

feat:预警信息导出

main
buaixuexideshitongxue 1 month ago
parent
commit
ee35158c34
  1. 14
      src/api/warning/index.ts
  2. 15
      src/views/warning/index.vue

14
src/api/warning/index.ts

@ -3,7 +3,7 @@ import request from "@/api/request";
//分页查询 //分页查询
export function warningPage(body) { export function warningPage(body) {
return request.post({ return request.post({
url: '/warning/getPage', url: '/warning/business/page',
body body
}); });
} }
@ -52,4 +52,16 @@ export function auditEndWarningApi(body){
url:'/reportFlow/auditEndWarning', url:'/reportFlow/auditEndWarning',
body body
}) })
}
//导出预警列表
export function excelWarningList(body) {
return request.post({
url: '/warning/business/excelWarningList',
body,
config: {
excelName: '预警监督项目列表.xlsx'
},
showErrorMsg: true
})
} }

15
src/views/warning/index.vue

@ -1,11 +1,12 @@
<!--审计预警监督--> <!--审计预警监督-->
<script setup> <script setup>
import {warningPage} from "@/api/warning/index"; import {warningPage, excelWarningList} from "@/api/warning/index";
import {timeFormat} from "@/utils/util"; import {timeFormat} from "@/utils/util";
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
const route = useRoute() const route = useRoute()
const loading =ref(false) const loading =ref(false)
const exportLoading = ref(false)
const total =ref(10) const total =ref(10)
const tableData =ref([]) const tableData =ref([])
const activeTab = ref(route.query.specialArea === 'cwlnt' ? 'cwlnt' : route.query.warningState === '1' ? '1' : '0') const activeTab = ref(route.query.specialArea === 'cwlnt' ? 'cwlnt' : route.query.warningState === '1' ? '1' : '0')
@ -64,6 +65,17 @@ const editFun = (row) =>{
query: routeQuery query: routeQuery
}); });
} }
const handleExcel = async ()=>{
if (exportLoading.value) return;
try {
exportLoading.value = true;
await excelWarningList(query.value);
} catch (e) {
console.error('导出失败', e);
} finally {
exportLoading.value = false;
}
}
getList() getList()
watch(()=>route.query.load,(val)=>{ watch(()=>route.query.load,(val)=>{
@ -133,6 +145,7 @@ watch(()=>route.query.load,(val)=>{
</el-form> </el-form>
<div class="flex end"> <div class="flex end">
<div> <div>
<el-button type="primary" :loading="exportLoading" @click="handleExcel">导出</el-button>
<el-button type="primary" @click="getList"> <el-button type="primary" @click="getList">
<template #icon> <template #icon>
<icon name="el-icon-Search"/> <icon name="el-icon-Search"/>

Loading…
Cancel
Save