1、巡检明细
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
2025-07-15 15:39:58 +08:00
parent 1ed923c969
commit 8e361c6b59
5 changed files with 414 additions and 38 deletions

View File

@@ -0,0 +1,113 @@
<script setup lang="ts">
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
import {Space} from 'ant-design-vue';
import {
useVbenVxeGrid,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
inspectionTaskExport,
inspectionTaskList,
} from '#/api/property/inspectionManagement/inspectionTask';
import type {InspectionTaskForm} from '#/api/property/inspectionManagement/inspectionTask/model';
import {commonDownloadExcel} from '#/utils/file/download';
import inspectionDetailsModal from './inspectionDetails-modal.vue';
import {columns, querySchema} from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({page}, formValues = {}) => {
return await inspectionTaskList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-inspectionDetails-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [InspectionDetailsModal, modalApi] = useVbenModal({
connectedComponent: inspectionDetailsModal,
});
async function handInfo(row: Required<InspectionTaskForm>) {
detailApi.setData({id: row.id});
detailApi.open();
}
function handleDownloadExcel() {
commonDownloadExcel(inspectionTaskExport, '巡检任务数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="巡检明细列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:inspectionTask:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<!-- <Space>-->
<!-- <ghost-button-->
<!-- v-access:code="['property:inspectionTask:info']"-->
<!-- @click.stop="handInfo(row)"-->
<!-- >-->
<!-- {{ $t('pages.common.info') }}-->
<!-- </ghost-button>-->
<!-- </Space>-->
</template>
</BasicTable>
<InspectionDetailsModal @reload="tableApi.query()"/>
</Page>
</template>