综合模块完成
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
15683799673
2025-06-28 22:49:40 +08:00
parent acd63bc96e
commit 54cea19b78
22 changed files with 523 additions and 571 deletions

View File

@@ -21,7 +21,7 @@ const title = computed(() => {
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
formItemClass: 'col-span-1',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
@@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
class: 'w-[60%]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,

View File

@@ -1,22 +1,44 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { FormSchemaGetter, VbenFormSchema } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { communityList } from '#/api/property/community';
import type {
CommunityQuery,
CommunityVO,
} from '#/api/property/community/model';
import { getPopupContainer } from '@vben/utils';
import { getDictOptions } from '#/utils/dict';
import { DictEnum } from '@vben/constants';
let arr: CommunityVO[] = [];
const communitySelect: VbenFormSchema = {
component: 'ApiSelect',
fieldName: 'communityId',
label: '社区',
componentProps: {
resultField: 'list', // 根据API返回结构调整
labelField: 'communityName',
valueField: 'id',
api: async () => {
if (!arr || arr.length == 0) {
const params: CommunityQuery = {
pageNum: 1,
pageSize: 500,
};
const res = await communityList(params);
arr = res.rows;
}
return arr;
},
},
};
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'communityName',
label: '社区',
},
communitySelect,
{
component: 'Input',
fieldName: 'buildingName',
label: '建筑名称',
},
{
component: 'Input',
fieldName: 'unitCount',
label: '单元数',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
@@ -27,18 +49,6 @@ export const columns: VxeGridProps['columns'] = [
title: '建筑名称',
field: 'buildingName',
},
{
title: '省',
field: 'province',
},
{
title: '市',
field: 'city',
},
{
title: '区',
field: 'district',
},
{
title: '总层数',
field: 'floorCount',
@@ -49,7 +59,7 @@ export const columns: VxeGridProps['columns'] = [
},
{
title: '建筑类型',
field: 'buildType',
field: 'buildTypeName',
},
{
title: '电梯数量',
@@ -91,9 +101,7 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '园区编码',
fieldName: 'communityId',
component: 'Input',
...communitySelect,
rules: 'required',
},
{
@@ -102,24 +110,6 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '省',
fieldName: 'province',
component: 'Input',
rules: 'required',
},
{
label: '市',
fieldName: 'city',
component: 'Input',
rules: 'required',
},
{
label: '区',
fieldName: 'district',
component: 'Input',
rules: 'required',
},
{
label: '总层数',
fieldName: 'floorCount',
@@ -134,7 +124,10 @@ export const modalSchema: FormSchemaGetter = () => [
label: '建筑类型',
fieldName: 'buildType',
component: 'Select',
componentProps: {},
componentProps: {
getPopupContainer,
options: getDictOptions(DictEnum.sys_build_use_type),
},
},
{
label: '电梯数量',
@@ -147,8 +140,8 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
},
},
{
@@ -161,17 +154,10 @@ export const modalSchema: FormSchemaGetter = () => [
label: '经度',
fieldName: 'lon',
component: 'Input',
rules: 'required',
},
{
label: '维度',
fieldName: 'lat',
component: 'Input',
rules: 'required',
},
{
label: '排序字段',
fieldName: 'sort',
component: 'Input',
},
];

View File

@@ -1,18 +1,13 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps,
} from '#/adapter/vxe-table';
import {
@@ -76,7 +71,7 @@ const gridOptions: VxeGridProps = {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-building-index'
id: 'property-building-index',
};
const [BasicTable, tableApi] = useVbenVxeGrid({
@@ -118,9 +113,14 @@ function handleMultiDelete() {
}
function handleDownloadExcel() {
commonDownloadExcel(buildingExport, '建筑数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
commonDownloadExcel(
buildingExport,
'建筑数据',
tableApi.formApi.form.values,
{
fieldMappingTime: formOptions.fieldMappingTime,
},
);
}
</script>
@@ -138,9 +138,10 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:building:remove']"
@click="handleMultiDelete">
type="primary"
v-access:code="['property:building:remove']"
@click="handleMultiDelete"
>
{{ $t('pages.common.delete') }}
</a-button>
<a-button