更新
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog title="行为详情次数详情(1)" v-model="dialogVisible" width="60%">
|
||||
<el-dialog :title="`行为详情次数详情(${pageData.tableData.length})`" v-model="dialogVisible" width="60%">
|
||||
<MyTable
|
||||
:tableData="pageData.tableData"
|
||||
:tableColumn="pageData.tableColumn"
|
||||
@ -12,6 +12,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { qcckGet } from "@/api/qcckApi.js";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import { ref , reactive , defineExpose} from 'vue'
|
||||
const dialogVisible = ref(false)
|
||||
@ -30,16 +31,24 @@ const pageData = reactive({
|
||||
pageCurrent: 1
|
||||
}, //分页
|
||||
tableColumn: [
|
||||
{ label: "警情编号", prop: "jqbh"},
|
||||
{ label: "报警人", prop: "bjr" },
|
||||
{ label: "报警人电话", prop: "bjrdh" },
|
||||
{ label: "报警人身份证", prop: "bjrsfzh"},
|
||||
{ label: "预警内容", prop: "yjnr", showOverflowTooltip: true },
|
||||
{ label: "报警时间", prop: "jsj", showOverflowTooltip: true },
|
||||
{ label: "警情编号", prop: "jjdbh"},
|
||||
{ label: "报警人", prop: "bjrmc" },
|
||||
{ label: "报警人电话", prop: "bjdh" },
|
||||
{ label: "报警人身份证", prop: "bjrzjhm"},
|
||||
{ label: "预警内容", prop: "bjnr", showOverflowTooltip: true },
|
||||
{ label: "报警时间", prop: "yjsj", showOverflowTooltip: true },
|
||||
]
|
||||
});
|
||||
const init = (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogVisible.value = true;
|
||||
pageData.tableConfiger.loading = true;
|
||||
pageData.tableData = []
|
||||
qcckGet({yjid:row.id},'/mosty-gsxt/yjzxXwyjxq/selectList').then((res)=>{
|
||||
pageData.tableData = res || [];
|
||||
pageData.tableConfiger.loading = false;
|
||||
}).catch(()=>{
|
||||
pageData.tableConfiger.loading = false;
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="行为预警">
|
||||
<el-button type="primary">
|
||||
<el-button type="primary" @click="exportExcel">
|
||||
<span style="vertical-align: middle">导出</span>
|
||||
</el-button>
|
||||
</PageTitle>
|
||||
@ -41,6 +41,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as XLSX from "xlsx";
|
||||
import Detail from './components/detail.vue'
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
@ -58,13 +59,11 @@ const searchConfiger = ref(
|
||||
const detailRef = ref()
|
||||
const queryFrom = ref({});
|
||||
const pageData = reactive({
|
||||
tableData: [
|
||||
{ xwcs:12 ,xm:'张三' ,sfzh:'510156565656525565',dh:'15665255545',xwfz:'20',xwms:'xxxxxxxxx',xwdl:'xxxxxxx',xwzl:'xxxxxxx'}
|
||||
], //表格数据
|
||||
tableData: [], //表格数据
|
||||
keyCount: 0,
|
||||
tableConfiger: {
|
||||
rowHieght: 61,
|
||||
showSelectType: "checkBox",
|
||||
showSelectType: "null",
|
||||
loading: false,
|
||||
haveControls: false,
|
||||
},
|
||||
@ -77,8 +76,8 @@ const pageData = reactive({
|
||||
{ label: "姓名", prop: "xm"},
|
||||
{ label: "身份证号", prop: "sfzh" },
|
||||
{ label: "电话", prop: "dh" },
|
||||
{ label: "行为大类", prop: "xwdl"},
|
||||
{ label: "行为子类", prop: "xwzl", showOverflowTooltip: true },
|
||||
{ label: "行为大类", prop: "xldlmc"},
|
||||
{ label: "行为子类", prop: "xwzlmc", showOverflowTooltip: true },
|
||||
{ label: "行为描述", prop: "xwms", showOverflowTooltip: true },
|
||||
{ label: "行为次数", prop: "xwcs",showSolt: true },
|
||||
{ label: "行为分值", prop: "xwfz",},
|
||||
@ -103,19 +102,32 @@ const changeSize = (val) =>{
|
||||
getList()
|
||||
}
|
||||
const getList = () =>{
|
||||
// pageData.tableConfiger.loading = true;
|
||||
// qcckGet(queryFrom.value,'/mosty-gsxt/behaviorWarning/selectPage').then((res)=>{
|
||||
// pageData.total = res.total || 0;
|
||||
// pageData.tableConfiger.loading = false;
|
||||
// }).catch(()=>{
|
||||
// pageData.tableConfiger.loading = false;
|
||||
// })
|
||||
pageData.tableConfiger.loading = true;
|
||||
qcckGet(queryFrom.value,'/mosty-gsxt/yjzxXwyj/getPageList').then((res)=>{
|
||||
pageData.total = res.total || 0;
|
||||
pageData.tableConfiger.loading = false;
|
||||
pageData.tableData = res.records || [];
|
||||
}).catch(()=>{
|
||||
pageData.tableConfiger.loading = false;
|
||||
})
|
||||
}
|
||||
|
||||
const handleClick = (row) => {
|
||||
detailRef.value.init(row)
|
||||
}
|
||||
|
||||
const exportExcel = () => {
|
||||
if (pageData.tableData.length === 0) return ElMessage({ message: "暂无数据", type: "warning" });
|
||||
const headers = pageData.tableColumn.map(item => item.label);
|
||||
const data = pageData.tableData.map(item => {
|
||||
return [item.xm, item.sfzh, item.dh, item.xldlmc, item.xwzlmc, item.xwms, item.xwcs, item.xwfz];
|
||||
});
|
||||
const worksheet = XLSX.utils.aoa_to_sheet([headers, ...data]);
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, "sheet1");
|
||||
XLSX.writeFile(workbook, "行为预警.xlsx");
|
||||
}
|
||||
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
|
||||
|
||||
Reference in New Issue
Block a user