Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
120 lines
2.9 KiB
Vue
120 lines
2.9 KiB
Vue
<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 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';
|
|
import {
|
|
taskDetailExport,
|
|
taskDetailList
|
|
} from "#/api/property/inspectionManagement/inspectionDetail";
|
|
import detailModal from './detail.vue'
|
|
|
|
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 taskDetailList({
|
|
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,
|
|
// });
|
|
|
|
const [DetailModal, detailApi] = useVbenModal({
|
|
connectedComponent: detailModal,
|
|
});
|
|
|
|
async function handInfo(row: Required<InspectionTaskForm>) {
|
|
detailApi.setData({id: row.id});
|
|
detailApi.open();
|
|
}
|
|
|
|
function handleDownloadExcel() {
|
|
commonDownloadExcel(taskDetailExport, '巡检明细数据', 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>
|
|
<DetailModal></DetailModal>
|
|
<!-- <InspectionDetailsModal @reload="tableApi.query()"/>-->
|
|
</Page>
|
|
</template>
|