This commit is contained in:
2026-02-02 10:33:58 +08:00
parent 2ea24d36f2
commit a129e6d3f4
11 changed files with 250 additions and 65 deletions

View File

@ -1,6 +1,13 @@
<template>
<el-dialog :model-value="modelValue" :title="title" width="70%" @close="closeDialog" destroy-on-close append-to-body>
<div style="height: 60vh; overflow: auto;">
<el-dialog :model-value="modelValue" width="70%" @close="closeDialog" destroy-on-close append-to-body>
<template #title>
<div class="flex just-between align-center">
<span class="f18">{{ title }}</span>
<span @click="exportFile" class="f14 pointer" style="color: #0072ff;">下载</span>
</div>
</template>
<div>
<Search :searchArr="searchConfiger" @submit="onSearch" :key="pageData.keyCount"></Search>
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth">
@ -54,6 +61,8 @@
</template>
<script setup>
import { exportExlByObj } from "@/utils/exportExcel.js"
import { getMultiDictVal } from "@/utils/dict.js"
import MyTable from "@/components/aboutTable/MyTable.vue";
import Search from "@/components/aboutTable/Search.vue";
import Pages from "@/components/aboutTable/Pages.vue";
@ -196,6 +205,30 @@ const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
changePage()
}
// 导出
const exportFile = () =>{
const titleObj = {
ryxm: "姓名",
rysfzh: "身份证号",
yjbq: "预警标签",
yjdz: "预警地址",
yjjb_name: "预警级别",
yjlb_name: "预警类别",
yjlx_name: "预警类型",
yjsj: "预警时间",
ssbm: "所属部门",
cph: "车牌号",
}
let list = pageData.tableData.map(item => ({
...item,
yjjb_name: getMultiDictVal(item.yjjb, D_BZ_YJJB),
yjlb_name: getMultiDictVal(item.yjlb, D_BZ_YJLX),
yjlx_name: getMultiDictVal(item.yjlx, D_GS_ZDQT_YJLB),
}))
exportExlByObj(titleObj, list, title.value)
}
</script>
<style scoped></style>