统计报表导出弹窗bug、专栏控制调整上下顺序修正
parent
4dfce8d0dd
commit
03e5aaaf47
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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: '操作',
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue