统计报表导出弹窗bug、专栏控制调整上下顺序修正

dianlixunjian
滕嵩 2024-07-18 11:06:50 +08:00
parent 4dfce8d0dd
commit 03e5aaaf47
3 changed files with 70 additions and 43 deletions

View File

@ -114,16 +114,8 @@
</template>
</BasicTable>
<a-modal v-model:open="open" title="导出表格类型" :footer="null">
<div v-if="showRecordList">
<a-button class="exportbutton" @click="handleExport('chuantou_execl')">
统计明细案件信息execl
</a-button>
<a-button class="exportbutton" @click="handleExport('chuantou_shp')">
统计明细矢量数据shp
</a-button>
</div>
<div v-else>
<a-modal v-model:open="open_mingxi" title="导出表格类型" :footer="null">
<div>
<a-button class="exportbutton" @click="handleExport('mingxi_1')">
无人机发现违法行为情况统计明细表
</a-button>
@ -135,6 +127,16 @@
</a-button>
</div>
</a-modal>
<a-modal v-model:open="open_chuantou" title="导出文件类型" :footer="null">
<div>
<a-button class="exportbutton" @click="handleExport('chuantou_execl')">
统计明细案件信息execl
</a-button>
<a-button class="exportbutton" @click="handleExport('chuantou_shp')">
统计明细矢量数据shp
</a-button>
</div>
</a-modal>
<a-modal
v-model:open="showRecordList"
width="1710px"
@ -327,11 +329,12 @@
}
// 穿
function exportList() {
open.value = true;
open_chuantou.value = true;
}
//
const open = ref<boolean>(false);
const open_mingxi = ref<boolean>(false);
const open_chuantou = ref<boolean>(false);
//
function handleExport(exportType) {
@ -413,7 +416,7 @@
const buttonClick = async (type) => {
switch (type) {
case 'btnExport':
open.value = true;
open_mingxi.value = true;
break;
default:
break;

View File

@ -15,7 +15,7 @@ export const columns: BasicColumn[] = [
{
title: '名称',
dataIndex: 'title',
width: 200,
width: 300,
},
{
title: 'LOGO名称',
@ -25,7 +25,7 @@ export const columns: BasicColumn[] = [
{
title: '类型',
dataIndex: 'isExternal',
width: 200,
width: 100,
},
{
title: '链接',
@ -40,12 +40,12 @@ export const columns: BasicColumn[] = [
{
title: '是否开放',
dataIndex: 'isDevelop',
width: 200,
width: 100,
},
{
title: '排序',
dataIndex: 'sort',
width: 200,
width: 100,
},
{
title: '操作',

View File

@ -4,7 +4,7 @@
<template #toolbar>
<PermissionBtn @btnEvent="buttonClick"></PermissionBtn>
</template>
<template #bodyCell="{ column, record }">
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'isExternal'">
<a-tag color="green" v-if="record.isExternal"></a-tag>
<a-tag color="blue" v-else></a-tag>
@ -22,12 +22,20 @@
<a-tag color="gray" v-else></a-tag>
</template>
<template v-if="column.key === 'action'">
<a-button v-if="record.sort > 1" type="dashed" @click="sortUp(record)">
<a-button
v-if="(nowPage - 1) * nowLimit + index != 0"
type="dashed"
@click="sortUp(index, record)"
>
<template #icon>
<Icon icon="bi:arrow-up-circle" :size="20" />
</template>
</a-button>
<a-button v-if="record.sort < sortNumber" type="dashed" @click="sortdown(record)">
<a-button
v-if="(nowPage - 1) * nowLimit + index + 1 != total"
type="dashed"
@click="sortdown(index, record)"
>
<template #icon>
<Icon icon="bi:arrow-down-circle" :size="20" />
</template>
@ -76,15 +84,17 @@
imgUrl: '' as string,
} as any,
});
//
let sortNumber = 0;
//
let nowPage = 0;
let nowLimit = 0;
let total = 0;
//
const registerTableData = ref([]);
//
const [registerModal, { openModal, closeModal }] = useModal();
//
const [registerTable, { reload, getSelectRows }] = useTable({
const [registerTable, { reload, getSelectRows, getPaginationRef }] = useTable({
api: LoadDataBaseInfo,
columns: columns,
formConfig: {
@ -102,13 +112,13 @@
return info;
},
afterFetch: (res) => {
let pagination: any = getPaginationRef();
//
nowPage = pagination.current;
nowLimit = pagination.pageSize || pagination.defaultPageSize;
total = pagination.total;
//
registerTableData.value = res;
res.forEach((element) => {
if (element.sort > sortNumber) {
sortNumber = element.sort;
}
});
},
});
//
@ -139,7 +149,7 @@
isDevelop: false,
isExternal: false,
linkOrApi: '',
sort: sortNumber + 1,
sort: total + 1,
imgUrl: '',
};
openModal(true, temp_add);
@ -172,15 +182,22 @@
reload();
}
//
async function sortUp(record) {
async function sortUp(index, record) {
let beforeSort = 0;
let record_before_temp: any = {};
registerTableData.value.forEach((item: any, index) => {
if (item.id == record.id) {
record_before_temp = registerTableData.value[index - 1];
beforeSort = record_before_temp.sort;
}
});
if (nowPage != 1 && index == 0) {
let params = { page: nowPage - 1, limit: nowLimit };
record_before_temp = (await LoadDataBaseInfo(params)).items[nowLimit - 1];
beforeSort = record_before_temp.sort;
} else {
registerTableData.value.forEach((item: any, index) => {
if (item.id == record.id) {
record_before_temp = registerTableData.value[index - 1];
beforeSort = record_before_temp.sort;
}
});
}
record_before_temp.sort = record.sort;
record.sort = beforeSort;
await AddOrUpdateForm(record);
@ -188,15 +205,22 @@
reload();
}
//
async function sortdown(record) {
async function sortdown(index, record) {
let afterSort = 0;
let record_after_temp: any = {};
registerTableData.value.forEach((item: any, index) => {
if (item.id == record.id) {
record_after_temp = registerTableData.value[index + 1];
afterSort = record_after_temp.sort;
}
});
if (index == nowLimit - 1) {
let params = { page: nowPage + 1, limit: nowLimit };
record_after_temp = (await LoadDataBaseInfo(params)).items[0];
afterSort = record_after_temp.sort;
} else {
registerTableData.value.forEach((item: any, index) => {
if (item.id == record.id) {
record_after_temp = registerTableData.value[index + 1];
afterSort = record_after_temp.sort;
}
});
}
record_after_temp.sort = record.sort;
record.sort = afterSort;
await AddOrUpdateForm(record);