feat:房屋导出功能
All checks were successful
Build and Push Docker Image / build (push) Successful in 5m43s
All checks were successful
Build and Push Docker Image / build (push) Successful in 5m43s
This commit is contained in:
parent
bca4eff39b
commit
036c7b4118
45
src/components/MyExport.tsx
Normal file
45
src/components/MyExport.tsx
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { Button, Dropdown, MenuProps } from 'antd';
|
||||||
|
|
||||||
|
export const MyExport = (props: any) => {
|
||||||
|
const items: MenuProps['items'] = [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: '当前页(含查询条件)',
|
||||||
|
onClick: () =>
|
||||||
|
props?.keyParams
|
||||||
|
? props?.download?.({ download_type: 'page', ...props?.item })
|
||||||
|
: props?.download?.Export?.({
|
||||||
|
download_type: 'page',
|
||||||
|
...props?.item,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
label: '所有页(含查询条件)',
|
||||||
|
onClick: () =>
|
||||||
|
props?.keyParams
|
||||||
|
? props?.download?.({ download_type: 'query', ...props?.item })
|
||||||
|
: props?.download?.Export?.({
|
||||||
|
download_type: 'query',
|
||||||
|
...props?.item,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
label: '所有记录',
|
||||||
|
onClick: () =>
|
||||||
|
props?.keyParams
|
||||||
|
? props?.download?.({ download_type: 'all', ...props?.item })
|
||||||
|
: props?.download?.Export?.({
|
||||||
|
download_type: 'all',
|
||||||
|
...props?.item,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dropdown menu={{ items }} placement="bottomLeft">
|
||||||
|
<Button type="primary">{props?.title || '导出'}</Button>
|
||||||
|
</Dropdown>
|
||||||
|
);
|
||||||
|
};
|
||||||
@ -13,12 +13,12 @@ import AnnouncementCreate from './modals/AnnouncementCreate';
|
|||||||
import AnnouncementShow from './modals/AnnouncementShow';
|
import AnnouncementShow from './modals/AnnouncementShow';
|
||||||
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '内容管理' }) {
|
export default function Index({ title = '公告管理' }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'banners',
|
tabKey: 'Msg',
|
||||||
tabLabel: title,
|
tabLabel: title,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -131,9 +131,9 @@ export default function Index({ title = '内容管理' }) {
|
|||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Banner.Banners.Delete({ id: item.id }).then(() =>
|
Apis.Msg.MsgPropertyAnnouncements.Delete({
|
||||||
action?.reload(),
|
id: item.id,
|
||||||
)
|
}).then(() => action?.reload())
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@ -109,7 +109,7 @@ export default function Index({ title = '项目列表' }) {
|
|||||||
<AssetInfo item={item} title="查看" reload={action?.reload} />
|
<AssetInfo item={item} title="查看" reload={action?.reload} />
|
||||||
<AssetUpdate item={item} title="项目" reload={action?.reload} />
|
<AssetUpdate item={item} title="项目" reload={action?.reload} />
|
||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="楼栋"
|
title="配置"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/asset/${item.id}`);
|
navigate(`/asset/${item.id}`);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -1,22 +1,26 @@
|
|||||||
import {
|
import {
|
||||||
|
MyButtons,
|
||||||
MyColumns,
|
MyColumns,
|
||||||
MyPageContainer,
|
MyPageContainer,
|
||||||
MyProTableProps,
|
MyProTableProps,
|
||||||
usePageTabs,
|
usePageTabs,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { MyExport } from '@/components/MyExport';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
AssetHousesOrientationEnum,
|
|
||||||
AssetHousesOwnershipTypeEnum,
|
AssetHousesOwnershipTypeEnum,
|
||||||
AssetHousesUsageEnum,
|
AssetHousesUsageEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { useNavigate } from '@umijs/max';
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
import { useState } from 'react';
|
||||||
import HousesShow from '../asset/components/modals/HousesShow';
|
import HousesShow from '../asset/components/modals/HousesShow';
|
||||||
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '房屋列表' }) {
|
export default function Index({ title = '房屋列表' }) {
|
||||||
|
const [getParams, setParams] = useState({});
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
@ -27,9 +31,21 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
<MyPageContainer title={title}>
|
<MyPageContainer title={title}>
|
||||||
<ProTable
|
<ProTable
|
||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
request={async (params, sort) =>
|
request={async (params, sort) => {
|
||||||
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
|
setParams(params);
|
||||||
}
|
return MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetHouses.List,
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
toolBarRender={() => [
|
||||||
|
<MyExport
|
||||||
|
key="export"
|
||||||
|
item={getParams}
|
||||||
|
download={Apis.Asset.AssetHouses}
|
||||||
|
/>,
|
||||||
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
@ -64,7 +80,9 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
title: '建筑面积',
|
title: '建筑面积',
|
||||||
dataIndex: 'built_area',
|
dataIndex: 'built_area',
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return `${record?.built_area || ''} m²`;
|
return `${
|
||||||
|
record?.built_area ? record?.built_area + ' m²' : '-'
|
||||||
|
} `;
|
||||||
},
|
},
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
@ -72,7 +90,9 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
title: '套内面积',
|
title: '套内面积',
|
||||||
dataIndex: 'inside_area',
|
dataIndex: 'inside_area',
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return `${record?.inside_area || ''} m²`;
|
return `${
|
||||||
|
record?.inside_area ? record?.inside_area + ' m²' : '-'
|
||||||
|
} `;
|
||||||
},
|
},
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
@ -80,25 +100,27 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
title: '计费面积',
|
title: '计费面积',
|
||||||
dataIndex: 'chargeable_area',
|
dataIndex: 'chargeable_area',
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return `${record?.chargeable_area || ''} m²`;
|
return `${
|
||||||
|
record?.chargeable_area ? record?.chargeable_area + ' m²' : '-'
|
||||||
|
} `;
|
||||||
},
|
},
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '户型',
|
title: '户型',
|
||||||
render(_, record) {
|
render(_, record) {
|
||||||
return `${record?.room || ''}室${record?.hall || ''}厅${
|
return `${record?.room || 'x'}室${record?.hall || 'x'}厅${
|
||||||
record?.bathroom || ''
|
record?.bathroom || 'x'
|
||||||
}卫${record?.kitchen || ''}厨${record?.balcony || ''}阳台`;
|
}卫${record?.kitchen || 'x'}厨${record?.balcony || 'x'}阳台`;
|
||||||
},
|
},
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
// MyColumns.EnumTag({
|
||||||
title: '朝向',
|
// title: '朝向',
|
||||||
dataIndex: 'orientation',
|
// dataIndex: 'orientation',
|
||||||
valueEnum: AssetHousesOrientationEnum,
|
// valueEnum: AssetHousesOrientationEnum,
|
||||||
search: false,
|
// search: false,
|
||||||
}),
|
// }),
|
||||||
// MyColumns.EnumTag({
|
// MyColumns.EnumTag({
|
||||||
// title: '房屋状态',
|
// title: '房屋状态',
|
||||||
// dataIndex: 'status',
|
// dataIndex: 'status',
|
||||||
@ -129,6 +151,13 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="编辑"
|
title="编辑"
|
||||||
/>
|
/>
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Asset.AssetHouses.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
Apis.Company.CompanyReceiptAccounts.Store({
|
Apis.Company.CompanyReceiptAccounts.Store({
|
||||||
...values,
|
...values,
|
||||||
companies_id: props?.item?.id,
|
companies_id: props?.item?.id,
|
||||||
is_default: values.is_default ? 1 : 0,
|
is_default: 0,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
|
|||||||
@ -31,6 +31,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
...values,
|
...values,
|
||||||
companies_id: props?.item?.companies_id,
|
companies_id: props?.item?.companies_id,
|
||||||
id: props.item?.id ?? 0,
|
id: props.item?.id ?? 0,
|
||||||
|
is_default: 0,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user