非法采矿-新统计报表

dianlixunjian
滕嵩 2024-11-19 10:13:14 +08:00
parent 2354759404
commit 46136a4c75
5 changed files with 364 additions and 14 deletions

View File

@ -132,6 +132,8 @@ enum Api {
GeoStyleBindLayer = '/api/GeoStyle/BindLayer',
// 非法采矿-统计列表
CaseOffenceMinerals = '/api/DroneCaseInfoMinerals/CaseOffenceMinerals',
// 非法采矿-统计列表New
CaseOffenceMineralsNew = '/api/DroneCaseInfoMinerals/CaseOffenceMineralsNew',
}
export const getPositionsTree = (params?: AccountParams) =>
defHttp.get<AccountListGetResultModel>({ url: Api.PositionsTree, params });
@ -495,4 +497,7 @@ export const GeoStylePage = (params) =>
defHttp.get({ url: Api.GeoStylePage, params });
// 非法采矿-统计列表
export const CaseOffenceMinerals = (params: ReportParams) =>
defHttp.get<StatisticalListGetResultModel>({ url: Api.CaseOffenceMinerals, params });
defHttp.get<StatisticalListGetResultModel>({ url: Api.CaseOffenceMinerals, params });
// 非法采矿-统计列表New
export const CaseOffenceMineralsNew = (params: ReportParams) =>
defHttp.get<StatisticalListGetResultModel>({ url: Api.CaseOffenceMineralsNew, params });

View File

@ -80,6 +80,92 @@ export const columns: BasicColumn[] = [
},
];
// 无人机发现违法行为情况统计明细表-table
export const columnsNew: BasicColumn[] = [
{
title: 'countyid',
dataIndex: '县区id',
ifShow: false,
},
{
title: '县区',
dataIndex: 'countyname',
width: 100,
fixed: 'left',
},
{
title: '下发线索总数(个)',
dataIndex: 'xfwtzs',
width: 150,
},
{
title: '总数',
children: [
{
title: '已完成(个)',
dataIndex: 'ywc',
width: 100,
},
{
title: '未完成(个)',
dataIndex: 'wwc',
width: 100,
},
{
title: '完成率(%',
dataIndex: 'wcl',
width: 100,
},
]
},
{
title: '定性',
children: [
{
title: '合法(个)',
dataIndex: 'dxhf',
width: 100,
},
{
title: '违法(个)',
dataIndex: 'dxwf',
width: 100,
},
{
title: '其他(个)',
dataIndex: 'dxqt',
width: 100,
},
{
title: '未定性(个)',
dataIndex: 'dxwdx',
width: 100,
},
]
},
{
title: '分类',
children: [
{
title: '非法开采(个)',
dataIndex: 'flffkc',
width: 100,
},
{
title: '非法加工(个)',
dataIndex: 'flffjg',
width: 100,
},
]
},
{
title: '超期未报(个)',
dataIndex: 'cqwb',
fixed: 'right',
width: 100,
},
];
// 无人机发现违法行为情况统计明细表-搜索
export const searchFormSchema: FormSchema[] = [
{

View File

@ -4,14 +4,6 @@
<template #toolbar>
<PermissionBtn @btnEvent="buttonClick"></PermissionBtn>
</template>
<template #bodyCell="{ column, record }">
<!-- 整改率 -->
<template v-if="column.key === 'zgl'"> {{ record.zgl }}% </template>
<!-- 驳回率 -->
<template v-if="column.key === 'bhl'"> {{ record.bhl }}% </template>
<!-- 上报率 -->
<template v-if="column.key === 'sbl'"> {{ record.sbl }}% </template>
</template>
</BasicTable>
</div>
</template>
@ -23,8 +15,8 @@
import { PermissionBtn } from '@/components/PermissionBtn/index';
import { PageWrapper } from '@/components/Page';
import { cloneDeep } from 'lodash-es';
import { CaseOffenceMinerals } from '@/api/demo/system';
import { columns, searchFormSchema } from './index.data';
import { CaseOffenceMineralsNew } from '@/api/demo/system';
import { columnsNew, searchFormSchema } from './index.data';
import { useMessage } from '@/hooks/web/useMessage';
import { getAppEnvConfig } from '@/utils/env';
import axios from 'axios';
@ -36,8 +28,8 @@
//
const searchParams = ref();
const [registerTable] = useTable({
api: CaseOffenceMinerals,
columns: columns,
api: CaseOffenceMineralsNew,
columns: columnsNew,
// title: '',
// titleHelpMessage: '',
formConfig: {
@ -100,7 +92,7 @@
switch (exportType) {
case '':
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoMinerals/CaseOfMineralsToExcel';
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoMinerals/CaseOfMineralsToExcelNew';
fileName = '汇总表 ' + afterTitle + '.xls';
break;
default:

View File

@ -0,0 +1,96 @@
import { BasicColumn, FormSchema } from '@/components/Table';
import dayjs from 'dayjs';
// 无人机发现违法行为情况统计明细表-table
export const columns: BasicColumn[] = [
{
title: 'countyid',
dataIndex: '县区id',
ifShow: false,
},
{
title: '县区',
dataIndex: 'countyname',
width: 100,
fixed: 'left',
},
{
title: '下发问题总数',
dataIndex: 'xfwtzs',
width: 100,
},
{
title: '合法',
dataIndex: 'hf',
width: 100,
},
{
title: '其他',
dataIndex: 'qt',
width: 100,
},
{
title: '违法',
dataIndex: 'wf',
width: 100,
},
{
title: '已完成归档',
dataIndex: 'ywcgd',
width: 100,
},
{
title: '未完成归档',
dataIndex: 'wwcgd',
width: 100,
},
{
title: '未完成归档',
width: 200,
children: [
{
title: '违法采矿',
dataIndex: 'wfck',
width: 100,
},
{
title: '违法加工',
dataIndex: 'wfjg',
width: 100,
},
],
},
{
title: '整改率',
dataIndex: 'zgl',
fixed: 'right',
width: 100,
},
{
title: '驳回率',
dataIndex: 'bhl',
fixed: 'right',
width: 100,
},
{
title: '上报率',
dataIndex: 'sbl',
fixed: 'right',
width: 100,
},
];
// 无人机发现违法行为情况统计明细表-搜索
export const searchFormSchema: FormSchema[] = [
{
field: '[startTime, endTime]',
label: '日期范围',
component: 'RangePicker',
colProps: { span: 8 },
componentProps: {
format: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'],
defaultValue: [dayjs('2024-08-01', 'YYYY-MM-DD'), dayjs(dayjs().add(-1, 'day'), 'YYYY-MM-DD')]
},
},
];

View File

@ -0,0 +1,171 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<PermissionBtn @btnEvent="buttonClick"></PermissionBtn>
</template>
<template #bodyCell="{ column, record }">
<!-- 整改率 -->
<template v-if="column.key === 'zgl'"> {{ record.zgl }}% </template>
<!-- 驳回率 -->
<template v-if="column.key === 'bhl'"> {{ record.bhl }}% </template>
<!-- 上报率 -->
<template v-if="column.key === 'sbl'"> {{ record.sbl }}% </template>
</template>
</BasicTable>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, reactive, watch, createVNode, unref } from 'vue';
import { useModal } from '@/components/Modal';
import { BasicTable, useTable } from '@/components/Table';
import { PermissionBtn } from '@/components/PermissionBtn/index';
import { PageWrapper } from '@/components/Page';
import { cloneDeep } from 'lodash-es';
import { CaseOffenceMinerals } from '@/api/demo/system';
import { columns, searchFormSchema } from './index.data';
import { useMessage } from '@/hooks/web/useMessage';
import { getAppEnvConfig } from '@/utils/env';
import axios from 'axios';
import dayjs from 'dayjs';
const { createMessage } = useMessage();
const { VITE_GLOB_API_URL } = getAppEnvConfig();
//
const searchParams = ref();
const [registerTable] = useTable({
api: CaseOffenceMinerals,
columns: columns,
// title: '',
// titleHelpMessage: '',
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
showIndexColumn: false,
striped: false,
bordered: true,
canResize: false,
useSearchForm: true,
showTableSetting: true,
pagination: false,
beforeFetch: (data) => {
//
console.log(data);
//
if (Object.keys(data).length == 0) {
var temp = {
startTime: dayjs('2024-08-01').startOf('day').format('YYYY-MM-DD'),
endTime: dayjs().endOf('day').add(-1, 'day').format('YYYY-MM-DD HH:mm:ss'),
};
searchParams.value = temp;
return temp;
}
//
if (data.startTime && data.endTime) {
var temp = {
startTime: dayjs(data.startTime).startOf('day').format('YYYY-MM-DD'),
endTime: dayjs(data.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss'),
};
searchParams.value = temp;
return temp;
}
if (data.startTime === null || data.endTime === undefined) {
searchParams.value = {};
}
},
afterFetch: (res) => {},
});
//
function handleExport(exportType) {
let url = '';
let fileName = '';
let params: any = {};
let afterTitle = '';
if (
dayjs(searchParams.value?.startTime).startOf('day').format('YYYY-MM-DD') ===
dayjs(searchParams.value?.endTime).endOf('day').format('YYYY-MM-DD')
) {
afterTitle = dayjs(searchParams.value?.startTime).startOf('day').format('YYYY-MM-DD');
} else {
afterTitle =
dayjs(searchParams.value?.startTime).startOf('day').format('YYYY-MM-DD') +
'至' +
dayjs(searchParams.value?.endTime).endOf('day').format('YYYY-MM-DD');
}
switch (exportType) {
case '':
url = VITE_GLOB_API_URL + '/api/DroneCaseInfoMinerals/CaseOfMineralsToExcel';
fileName = '汇总表 ' + afterTitle + '.xls';
break;
default:
break;
}
params = {
startTime: dayjs(searchParams.value?.startTime).startOf('day').format('YYYY-MM-DD'),
endTime: dayjs(searchParams.value?.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss'),
};
axios({
method: 'post',
url: url,
params: params,
headers: {
'X-Token': localStorage.getItem('X-Token'),
},
responseType: 'blob',
}).then((res) => {
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(res.data);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
});
}
//
const buttonClick = async (type) => {
switch (type) {
case 'btnExport':
handleExport('');
break;
default:
break;
}
};
</script>
<style lang="less" scoped>
#closeIconButton {
width: 40px;
height: 50px;
line-height: 50px;
float: right;
text-align: center;
cursor: pointer;
}
.exportbutton {
width: 510px;
height: 60px;
margin: 5px;
}
::v-deep .ant-table-container table {
line-height: 1.1 !important;
.ant-table-row {
td {
padding-top: 8px !important;
padding-bottom: 8px !important;
}
}
}
</style>