develop #6
@ -15,9 +15,9 @@ export default defineConfig({
|
|||||||
proxy: {
|
proxy: {
|
||||||
'/api/': {
|
'/api/': {
|
||||||
// target: 'http://yt:8003',
|
// target: 'http://yt:8003',
|
||||||
target: 'http://10.39.13.80:8001',
|
// target: 'http://10.39.13.80:8001',
|
||||||
// target: 'http://10.39.67.86:8001/',
|
// target: 'http://10.39.13.78:8001/',
|
||||||
// target: 'https://test-admin.linyikj.com.cn/',
|
target: 'https://test-admin.linyikj.com.cn/',
|
||||||
// target: 'http://we6f9c65.natappfree.cc',
|
// target: 'http://we6f9c65.natappfree.cc',
|
||||||
// target: 'https://loanos-test.nchl.net/',
|
// target: 'https://loanos-test.nchl.net/',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"url": "http://10.39.13.80:8001/api/docs/openapi",
|
"url": "http://10.39.13.78:8001/api/docs/openapi",
|
||||||
"module": "Admin"
|
"module": "Admin"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { MyResponseType, renderTextHelper } from '@/common';
|
import { MyResponseType, renderTextHelper } from '@/common';
|
||||||
import { ProColumns } from '@ant-design/pro-components';
|
import { ProColumns } from '@ant-design/pro-components';
|
||||||
import { Image, Popconfirm, Tag } from 'antd';
|
import { Image, Popconfirm, Switch, Tag } from 'antd';
|
||||||
|
|
||||||
type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
||||||
|
|
||||||
@ -50,34 +50,21 @@ export const MyColumns = {
|
|||||||
} & ReturnType): ReturnType {
|
} & ReturnType): ReturnType {
|
||||||
return {
|
return {
|
||||||
title: '启/禁用',
|
title: '启/禁用',
|
||||||
render: (_, item, index, action) =>
|
render: (_, item, index, action) => (
|
||||||
item?.deleted_at ? (
|
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="启用"
|
title={item?.deleted_at ? '启用' : '禁用'}
|
||||||
description="您确认启用吗?"
|
description={item?.deleted_at ? '您确认启用吗?' : '您确认禁用吗?'}
|
||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
|
if (item?.deleted_at) {
|
||||||
onRestore?.({ id: item.id }).then(() => action?.reload());
|
onRestore?.({ id: item.id }).then(() => action?.reload());
|
||||||
}}
|
} else {
|
||||||
okText="是"
|
|
||||||
cancelText="否"
|
|
||||||
>
|
|
||||||
<Tag color="gray" style={{ cursor: 'pointer' }}>
|
|
||||||
已禁用
|
|
||||||
</Tag>
|
|
||||||
</Popconfirm>
|
|
||||||
) : (
|
|
||||||
<Popconfirm
|
|
||||||
title="禁用"
|
|
||||||
description="您确认禁用吗?"
|
|
||||||
onConfirm={() => {
|
|
||||||
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
okText="是"
|
okText="是"
|
||||||
cancelText="否"
|
cancelText="否"
|
||||||
>
|
>
|
||||||
<Tag color="green" style={{ cursor: 'pointer' }}>
|
<Switch checked={!item?.deleted_at} size="default" />
|
||||||
已启用
|
|
||||||
</Tag>
|
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
),
|
),
|
||||||
search: false,
|
search: false,
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export const Selects = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// 单元下拉框
|
// 网格单元下拉框
|
||||||
GridUnits(props?: PropsType): ReturnType {
|
GridUnits(props?: PropsType): ReturnType {
|
||||||
const {
|
const {
|
||||||
title = '单元',
|
title = '单元',
|
||||||
@ -126,18 +126,21 @@ export const Selects = {
|
|||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInTable: hideInTable,
|
hideInTable: hideInTable,
|
||||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||||
request: async (params) =>
|
request: async (params) => {
|
||||||
(
|
let res = await Apis.Asset.AssetUnits.GridSelect({
|
||||||
await Apis.Asset.AssetUnits.GridSelect({
|
|
||||||
keywords: params?.KeyWords,
|
keywords: params?.KeyWords,
|
||||||
asset_projects_id: params?.asset_projects_id,
|
asset_projects_id: params?.asset_projects_id,
|
||||||
asset_buildings_id: params?.asset_buildings_id,
|
|
||||||
...params,
|
...params,
|
||||||
})
|
});
|
||||||
).data,
|
res?.data?.map((l: any) => {
|
||||||
|
l.label = l.asset_building.name + l.label;
|
||||||
|
});
|
||||||
|
return res?.data;
|
||||||
|
},
|
||||||
...rest,
|
...rest,
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
// mode: 'multiple',
|
||||||
fieldNames: {
|
fieldNames: {
|
||||||
label: 'label',
|
label: 'label',
|
||||||
value: 'value',
|
value: 'value',
|
||||||
@ -355,6 +358,41 @@ export const Selects = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
//机构收款账户
|
||||||
|
CompanyAccounts(props?: PropsType): ReturnType {
|
||||||
|
const {
|
||||||
|
title = '收款账户',
|
||||||
|
key = 'receipt_accounts_id',
|
||||||
|
required = false,
|
||||||
|
hideInTable = true,
|
||||||
|
...rest
|
||||||
|
} = props ?? {};
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
key: key,
|
||||||
|
valueType: 'select',
|
||||||
|
hideInTable: hideInTable,
|
||||||
|
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||||
|
request: async (params) =>
|
||||||
|
(
|
||||||
|
await Apis.Company.CompanyReceiptAccounts.Select({
|
||||||
|
keywords: params?.KeyWords,
|
||||||
|
...params,
|
||||||
|
})
|
||||||
|
).data,
|
||||||
|
...rest,
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
fieldNames: {
|
||||||
|
label: 'label',
|
||||||
|
value: 'value',
|
||||||
|
},
|
||||||
|
...rest?.fieldProps,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//项目收款账户
|
||||||
ProjectAccounts(props?: PropsType): ReturnType {
|
ProjectAccounts(props?: PropsType): ReturnType {
|
||||||
const {
|
const {
|
||||||
title = '收款账户',
|
title = '收款账户',
|
||||||
|
|||||||
13
src/gen/ApiTypes.d.ts
vendored
13
src/gen/ApiTypes.d.ts
vendored
@ -75,7 +75,8 @@ declare namespace ApiTypes {
|
|||||||
"house_occupants_id": number; // 房客id
|
"house_occupants_id": number; // 房客id
|
||||||
"type": string; // 类型,[enum:HouseRegistersTypeEnum
|
"type": string; // 类型,[enum:HouseRegistersTypeEnum
|
||||||
"update_info": string[]; // 要修改的信息
|
"update_info": string[]; // 要修改的信息
|
||||||
"update_info.phone"?: phone|required_if:type,UpdatePhone; // 客户手机号
|
"update_info.name"?: string; // 客户姓名
|
||||||
|
"update_info.phone"?: string; // 客户手机号
|
||||||
"update_info.reserve_phone"?: phone; // 客户备用电话
|
"update_info.reserve_phone"?: phone; // 客户备用电话
|
||||||
"update_info.card_type"?: string; // 证件类型,[enum:HouseOccupantsCardTypeEnum]
|
"update_info.card_type"?: string; // 证件类型,[enum:HouseOccupantsCardTypeEnum]
|
||||||
"update_info.id_card"?: string; // 客户身份证号
|
"update_info.id_card"?: string; // 客户身份证号
|
||||||
@ -733,8 +734,8 @@ declare namespace ApiTypes {
|
|||||||
}
|
}
|
||||||
namespace CompanyProjectReceiptAccounts {
|
namespace CompanyProjectReceiptAccounts {
|
||||||
type List = {
|
type List = {
|
||||||
"companies_id": number; // 所属机构id,[ref:companies]
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
"projects_id": number; // 所属项目id,[ref:asset_projects]
|
"projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
"companies_id": number; // 所属机构id,[ref:companies]
|
"companies_id": number; // 所属机构id,[ref:companies]
|
||||||
@ -789,7 +790,7 @@ declare namespace ApiTypes {
|
|||||||
}
|
}
|
||||||
namespace CompanyReceiptAccounts {
|
namespace CompanyReceiptAccounts {
|
||||||
type List = {
|
type List = {
|
||||||
"name"?: string; // 模糊搜索:名称
|
"company_name"?: string; // 模糊搜索:名称
|
||||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
@ -823,6 +824,10 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
|
type Select = {
|
||||||
|
"company_name"?: string; // 模糊搜索:名称
|
||||||
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
namespace Organizations {
|
namespace Organizations {
|
||||||
type List = {
|
type List = {
|
||||||
|
|||||||
@ -421,7 +421,7 @@ export const Apis = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
CompanyProjectReceiptAccounts: {
|
CompanyProjectReceiptAccounts: {
|
||||||
List(data: ApiTypes.Company.CompanyProjectReceiptAccounts.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Company.CompanyProjectReceiptAccounts.List): Promise<MyResponseType> {
|
||||||
return request('admin/company/company_project_receipt_accounts/list', { data });
|
return request('admin/company/company_project_receipt_accounts/list', { data });
|
||||||
},
|
},
|
||||||
Store(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Store): Promise<MyResponseType> {
|
Store(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Store): Promise<MyResponseType> {
|
||||||
@ -482,6 +482,9 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.Company.CompanyReceiptAccounts.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.Company.CompanyReceiptAccounts.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/company/company_receipt_accounts/delete', { data });
|
return request('admin/company/company_receipt_accounts/delete', { data });
|
||||||
},
|
},
|
||||||
|
Select(data?: ApiTypes.Company.CompanyReceiptAccounts.Select): Promise<MyResponseType> {
|
||||||
|
return request('admin/company/company_receipt_accounts/select', { data });
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Organizations: {
|
Organizations: {
|
||||||
List(data?: ApiTypes.Company.Organizations.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Company.Organizations.List): Promise<MyResponseType> {
|
||||||
|
|||||||
@ -126,7 +126,7 @@ export const BannersTypeEnum= {
|
|||||||
|
|
||||||
// 缓存类型
|
// 缓存类型
|
||||||
export const CacheTypeEnum= {
|
export const CacheTypeEnum= {
|
||||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#81d182","value":"MobilePhoneVerificationCode"},
|
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#1f86c5","value":"MobilePhoneVerificationCode"},
|
||||||
};
|
};
|
||||||
|
|
||||||
// CompaniesMerchantTypeEnum
|
// CompaniesMerchantTypeEnum
|
||||||
|
|||||||
@ -1,85 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`添加公告`}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
width="600px"
|
|
||||||
trigger={<MyButtons.Create title={`添加公告`} />}
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Msg.MsgPropertyAnnouncements.Store(values)
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('添加公告内容成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'title',
|
|
||||||
title: '公告标题',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'content',
|
|
||||||
title: '公告内容',
|
|
||||||
valueType: 'textarea',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
fieldProps: {
|
|
||||||
autoSize: { minRows: 4, maxRows: 6 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'publish_at',
|
|
||||||
title: '内容显示的发布日期',
|
|
||||||
valueType: 'date',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
fieldProps: {
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
Selects?.AssetProjects({
|
|
||||||
title: '请选择项目',
|
|
||||||
key: 'asset_projects_id',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
key: 'sort',
|
|
||||||
title: '排序',
|
|
||||||
valueType: 'digit',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
tooltip: '数值越大越靠前',
|
|
||||||
fieldProps: {
|
|
||||||
placeholder: '数值越大越靠前',
|
|
||||||
min: 0,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
initialValue: 0,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
import { MyBetaModalFormProps } from '@/common';
|
|
||||||
import { MyModal } from '@/components/MyModal';
|
|
||||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
|
||||||
import { Typography } from 'antd';
|
|
||||||
|
|
||||||
const { Text } = Typography;
|
|
||||||
|
|
||||||
export default function info(props: MyBetaModalFormProps) {
|
|
||||||
return (
|
|
||||||
<MyModal
|
|
||||||
title={props.title || '查看'}
|
|
||||||
// width="40vw"
|
|
||||||
width={600}
|
|
||||||
// style={{ maxWidth: '650px' }}
|
|
||||||
node={
|
|
||||||
<ProCard>
|
|
||||||
<ProDescriptions
|
|
||||||
// bordered
|
|
||||||
// column={{ xs: 1, sm: 2, md: 3 }}
|
|
||||||
column={1}
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<ProDescriptions.Item label="公告标题">
|
|
||||||
{props?.item?.title || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="公告内容">
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
whiteSpace: 'pre-wrap',
|
|
||||||
maxHeight: '300px',
|
|
||||||
overflow: 'auto',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{props?.item?.content || '-'}
|
|
||||||
</div>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="发布日期">
|
|
||||||
{props?.item?.publish_at || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label=" 关联项目">
|
|
||||||
{props?.item?.asset_project?.name || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="创建时间">
|
|
||||||
{props?.item?.created_at || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
</ProDescriptions>
|
|
||||||
</ProCard>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Update>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`编辑公告内容`}
|
|
||||||
trigger={<MyButtons.Edit />}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
width="600px"
|
|
||||||
key={new Date().getTime()}
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open && props.item) {
|
|
||||||
form.setFieldsValue(props.item);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Msg.MsgPropertyAnnouncements.Update({
|
|
||||||
...values,
|
|
||||||
id: props.item?.id ?? 0,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('编辑公告内容成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'title',
|
|
||||||
title: '公告标题',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'content',
|
|
||||||
title: '公告内容',
|
|
||||||
valueType: 'textarea',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
fieldProps: {
|
|
||||||
autoSize: { minRows: 4, maxRows: 6 },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'publish_at',
|
|
||||||
title: '内容显示的发布日期',
|
|
||||||
valueType: 'date',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
fieldProps: {
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
Selects?.AssetProjects({
|
|
||||||
title: '请选择项目',
|
|
||||||
key: 'asset_projects_id',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
// {
|
|
||||||
// key: 'is_publish',
|
|
||||||
// title: '是否立刻发布',
|
|
||||||
// valueType: 'switch',
|
|
||||||
// colProps: { span: 8 },
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
key: 'sort',
|
|
||||||
title: '排序',
|
|
||||||
valueType: 'digit',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
tooltip: '数值越大越靠前',
|
|
||||||
fieldProps: {
|
|
||||||
placeholder: '数值越大越靠前',
|
|
||||||
min: 0,
|
|
||||||
style: { width: '100%' },
|
|
||||||
},
|
|
||||||
initialValue: 0,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
88
src/pages/asset/accounts/index.tsx
Normal file
88
src/pages/asset/accounts/index.tsx
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import AccountsGet from './modals/AccountsGet';
|
||||||
|
|
||||||
|
export default function Index({ title = '项目账户' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'company-project-receipt-accounts',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="company-apps"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.Company.CompanyProjectReceiptAccounts.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<AccountsGet key="Select" reload={action?.reload} title={title} />,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
// width: 360,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收款账号名称',
|
||||||
|
dataIndex: ['receipt_account', 'company_name'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '开户行',
|
||||||
|
dataIndex: ['receipt_account', 'company_bank'],
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收款账号',
|
||||||
|
dataIndex: ['receipt_account', 'company_account'],
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '是否默认',
|
||||||
|
// dataIndex: 'is_default',
|
||||||
|
// search: false,
|
||||||
|
// render(_, record) {
|
||||||
|
// return `${record?.is_default ? '是' : '否'} `;
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
MyColumns.UpdatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Company.CompanyProjectReceiptAccounts.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
67
src/pages/asset/accounts/modals/AccountsGet.tsx
Normal file
67
src/pages/asset/accounts/modals/AccountsGet.tsx
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Company.CompanyProjectReceiptAccounts.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
form={form}
|
||||||
|
title={`${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
||||||
|
...values,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
Selects?.Companies({
|
||||||
|
key: 'companies_id',
|
||||||
|
title: '选择机构',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
}),
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
}),
|
||||||
|
Selects?.CompanyAccounts({
|
||||||
|
key: 'receipt_accounts_id',
|
||||||
|
title: '选择收款账户',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -68,7 +68,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
|||||||
<MyButtons.Create
|
<MyButtons.Create
|
||||||
title="确定添加"
|
title="确定添加"
|
||||||
type="primary"
|
type="primary"
|
||||||
key="create2"
|
key="create"
|
||||||
onClick={() => onShowContactPhone()}
|
onClick={() => onShowContactPhone()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@ -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: 'Msg',
|
tabKey: 'msg-property-announcements',
|
||||||
tabLabel: title,
|
tabLabel: title,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
<MyPageContainer
|
<MyPageContainer
|
||||||
title={title}
|
title={title}
|
||||||
enableTabs={true}
|
enableTabs={true}
|
||||||
tabKey="banners"
|
tabKey="msg-property-announcements"
|
||||||
tabLabel={title}
|
tabLabel={title}
|
||||||
>
|
>
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -40,16 +40,23 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<AnnouncementCreate
|
<AnnouncementCreate
|
||||||
key="Create"
|
key="Select"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title={title}
|
title={title}
|
||||||
/>,
|
/>,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '标题',
|
title: '关联项目',
|
||||||
|
dataIndex: ['asset_project', 'name'],
|
||||||
|
search: false,
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.asset_project?.name;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '公告标题',
|
||||||
dataIndex: 'title',
|
dataIndex: 'title',
|
||||||
width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
||||||
render: (text) => (
|
render: (text) => (
|
||||||
@ -69,7 +76,7 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '内容',
|
title: '公告内容',
|
||||||
dataIndex: 'content',
|
dataIndex: 'content',
|
||||||
valueType: 'textarea', // 仅影响表单编辑时的输入类型,不影响表格展示
|
valueType: 'textarea', // 仅影响表单编辑时的输入类型,不影响表格展示
|
||||||
search: false,
|
search: false,
|
||||||
@ -97,12 +104,10 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '项目',
|
title: '是否发布小程序',
|
||||||
dataIndex: ['asset_project', 'name'],
|
dataIndex: 'is_publish',
|
||||||
|
render: (text) => (text ? '是' : '否'),
|
||||||
search: false,
|
search: false,
|
||||||
render: (_, record) => {
|
|
||||||
return record?.asset_project?.name;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
MyColumns.SoftDelete({
|
MyColumns.SoftDelete({
|
||||||
title: '启/禁用',
|
title: '启/禁用',
|
||||||
@ -116,9 +121,6 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
dataIndex: 'created_at',
|
dataIndex: 'created_at',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
search: false,
|
search: false,
|
||||||
// render: (_, record) => {
|
|
||||||
// return record?.created_at?.substring(0, 10);
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
@ -127,7 +129,7 @@ export default function Index({ title = '公告管理' }) {
|
|||||||
<AnnouncementUpdate
|
<AnnouncementUpdate
|
||||||
item={item}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title={title}
|
// title={title}
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
@ -4,6 +4,7 @@ import {
|
|||||||
MyModalFormProps,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Form, message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
@ -27,7 +28,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Msg.MsgPropertyAnnouncements.Store({
|
Apis.Msg.MsgPropertyAnnouncements.Store({
|
||||||
...values,
|
...values,
|
||||||
asset_projects_id: props.item?.id,
|
asset_projects_id: values?.asset_projects_id || props.item?.id,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -37,6 +38,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '关联项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
{
|
{
|
||||||
key: 'title',
|
key: 'title',
|
||||||
title: '公告标题',
|
title: '公告标题',
|
||||||
@ -1,154 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
console.log(props?.item, 'item');
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`划分范围`}
|
|
||||||
// 基本表单
|
|
||||||
width="700px"
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
labelAlign="right"
|
|
||||||
trigger={<MyButtons.Create title={`划分范围`} />}
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) => {
|
|
||||||
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
|
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.Grid.Grids.Store({
|
|
||||||
...values,
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('范围划分成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
}}
|
|
||||||
columns={[
|
|
||||||
Selects?.GetGridMark({
|
|
||||||
key: 'grid_mark',
|
|
||||||
title: '范围标识',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
valueType: 'formList',
|
|
||||||
dataIndex: 'grid_ranges',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
initialValue: [''],
|
|
||||||
formItemProps: { ...rulesHelper.array },
|
|
||||||
fieldProps: {
|
|
||||||
copyIconProps: false,
|
|
||||||
creatorButtonProps: {
|
|
||||||
creatorButtonText: '添加楼栋单元',
|
|
||||||
},
|
|
||||||
itemRender: (
|
|
||||||
{ listDom, action }: any,
|
|
||||||
{ index }: { index: number },
|
|
||||||
) => {
|
|
||||||
return (
|
|
||||||
<ProCard
|
|
||||||
bordered
|
|
||||||
style={{ marginBlockEnd: 5 }}
|
|
||||||
title={`选择范围${index + 1}`}
|
|
||||||
extra={action}
|
|
||||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
|
||||||
>
|
|
||||||
{listDom}
|
|
||||||
</ProCard>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
valueType: 'dependency',
|
|
||||||
name: ['asset_buildings_id', 'asset_units_id'],
|
|
||||||
columns: ({ asset_buildings_id }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
Selects?.AssetBuildings({
|
|
||||||
key: 'asset_buildings_id',
|
|
||||||
title: '选择楼栋',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
onChange: (value: any) => {
|
|
||||||
// 获取当前表单的所有值
|
|
||||||
const formValues = form.getFieldsValue();
|
|
||||||
const gridRanges = formValues.grid_ranges || [];
|
|
||||||
|
|
||||||
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
|
||||||
const updatedGridRanges = gridRanges.map(
|
|
||||||
(item: any, index: number) => {
|
|
||||||
if (item.asset_buildings_id === value) {
|
|
||||||
return { ...item, asset_units_id: undefined };
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// 更新表单值
|
|
||||||
form.setFieldsValue({
|
|
||||||
grid_ranges: updatedGridRanges,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
...(asset_buildings_id
|
|
||||||
? [
|
|
||||||
Selects?.GridUnits({
|
|
||||||
key: 'asset_units_id',
|
|
||||||
title: '选择单元',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
asset_buildings_id: asset_buildings_id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
111
src/pages/asset/convenience_services/index.tsx
Normal file
111
src/pages/asset/convenience_services/index.tsx
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import ServiceCreate from './modals/ServiceCreate';
|
||||||
|
import ServiceUpdate from './modals/ServiceUpdate';
|
||||||
|
|
||||||
|
export default function Index({ title = '便民服务' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'convenience-services',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="convenience-services"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.Common.ConvenienceServices.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<ServiceCreate key="Select" reload={action?.reload} title={title} />,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '关联项目',
|
||||||
|
dataIndex: ['asset_project', 'name'],
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
return { project_name: value };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
valueEnum: ConvenienceServicesTypeEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '服务名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '联系方式',
|
||||||
|
render(_, record) {
|
||||||
|
const content = record?.content || [];
|
||||||
|
|
||||||
|
// 过滤有效数据
|
||||||
|
const validItems = content.filter(
|
||||||
|
(item: any) => item?.name && item?.phone,
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ lineHeight: '1.6' }}>
|
||||||
|
{validItems.length > 0 ? (
|
||||||
|
validItems.map((item: any, index: number) => (
|
||||||
|
// 每个客户信息单独一行
|
||||||
|
<div key={index}>
|
||||||
|
{item.name}: {item.phone}
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<span>暂无客户信息</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<ServiceUpdate item={item} reload={action?.reload} />
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Common.ConvenienceServices.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import {
|
|||||||
MyModalFormProps,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
@ -37,7 +38,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
type: values.type,
|
type: values.type,
|
||||||
name: service.name,
|
name: service.name,
|
||||||
content: service.content,
|
content: service.content,
|
||||||
asset_projects_id: props.item?.id,
|
asset_projects_id: values.asset_projects_id || props.item?.id,
|
||||||
} as any);
|
} as any);
|
||||||
}
|
}
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -49,6 +50,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
columns={[
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '关联项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'type',
|
key: 'type',
|
||||||
title: '类型',
|
title: '类型',
|
||||||
91
src/pages/asset/grids/index.tsx
Normal file
91
src/pages/asset/grids/index.tsx
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import GridCreate from './modals/GridCreate';
|
||||||
|
import GridMannger from './modals/GridMannger';
|
||||||
|
import GridUpdate from './modals/GridUpdate';
|
||||||
|
|
||||||
|
export default function Index({ title = '楼栋范围' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'grids',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="grids"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(params, sort, Apis.Grid.Grids.List)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<GridCreate key="Select" reload={action?.reload} title="楼栋划分" />,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: '关联项目',
|
||||||
|
dataIndex: ['asset_project', 'name'],
|
||||||
|
search: {
|
||||||
|
transform: (value) => {
|
||||||
|
return { project_name: value };
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '板块名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '标识',
|
||||||
|
dataIndex: 'grid_mark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '楼栋管家',
|
||||||
|
dataIndex: ['company_employee', 'name'],
|
||||||
|
render: (_, item: any) =>
|
||||||
|
`${item?.company_employee?.name || ''}-${
|
||||||
|
item?.company_employee?.phone || ''
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
// MyColumns.CreatedAt(),
|
||||||
|
MyColumns.UpdatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<GridUpdate item={item} reload={action?.reload} />
|
||||||
|
<GridMannger item={item} reload={action?.reload} />
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Grid.Grids.Delete({ id: item.id }).then(() =>
|
||||||
|
action?.reload(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
216
src/pages/asset/grids/modals/GridCreate copy 2.tsx
Normal file
216
src/pages/asset/grids/modals/GridCreate copy 2.tsx
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [transferData, setTransferData] = useState<any[]>([]);
|
||||||
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||||
|
|
||||||
|
// 获取Transfer数据源
|
||||||
|
// useEffect(() => {
|
||||||
|
// const asset_projects_id = props?.item?.id || 0;
|
||||||
|
// if (asset_projects_id) {
|
||||||
|
// Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||||
|
// .then((res) => {
|
||||||
|
// const data =
|
||||||
|
// res.data?.map((item: any) => ({
|
||||||
|
// key: item.value?.toString(),
|
||||||
|
// title: item.label,
|
||||||
|
// description: item.label,
|
||||||
|
// })) || [];
|
||||||
|
// setTransferData(data);
|
||||||
|
// })
|
||||||
|
// .catch(() => {
|
||||||
|
// setTransferData([]);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }, [props?.item?.id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`范围添加`}
|
||||||
|
width="700px"
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
labelAlign="right"
|
||||||
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
form={form}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
form.setFieldsValue({
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values: any) => {
|
||||||
|
(values.asset_projects_id =
|
||||||
|
values?.asset_projects_id || props?.item?.id),
|
||||||
|
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||||
|
res.asset_projects_id = props?.item?.id;
|
||||||
|
});
|
||||||
|
return Apis.Grid.Grids.Store({
|
||||||
|
...values,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success('网格添加成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false);
|
||||||
|
}}
|
||||||
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
Selects?.GetGridMark({
|
||||||
|
key: 'grid_mark',
|
||||||
|
title: '范围标识',
|
||||||
|
params: {
|
||||||
|
asset_projects_id:
|
||||||
|
asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
valueType: 'formList',
|
||||||
|
dataIndex: 'grid_ranges',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
initialValue: [''],
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
fieldProps: {
|
||||||
|
copyIconProps: false,
|
||||||
|
creatorButtonProps: {
|
||||||
|
creatorButtonText: '添加楼栋单元',
|
||||||
|
},
|
||||||
|
itemRender: (
|
||||||
|
{ listDom, action }: any,
|
||||||
|
{ index }: { index: number },
|
||||||
|
) => {
|
||||||
|
return (
|
||||||
|
<ProCard
|
||||||
|
bordered
|
||||||
|
style={{ marginBlockEnd: 5 }}
|
||||||
|
title={`选择范围${index + 1}`}
|
||||||
|
extra={action}
|
||||||
|
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||||
|
>
|
||||||
|
{listDom}
|
||||||
|
</ProCard>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_buildings_id', 'asset_units_id'],
|
||||||
|
columns: ({ asset_buildings_id }) => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
Selects?.AssetBuildings({
|
||||||
|
key: 'asset_buildings_id',
|
||||||
|
title: '选择楼栋',
|
||||||
|
params: {
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
},
|
||||||
|
colProps: { span: 12 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
onChange: (value: any) => {
|
||||||
|
// 获取当前表单的所有值
|
||||||
|
const formValues = form.getFieldsValue();
|
||||||
|
const gridRanges =
|
||||||
|
formValues.grid_ranges || [];
|
||||||
|
|
||||||
|
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
||||||
|
const updatedGridRanges = gridRanges.map(
|
||||||
|
(item: any, index: number) => {
|
||||||
|
if (
|
||||||
|
item.asset_buildings_id === value
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
asset_units_id: undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// 更新表单值
|
||||||
|
form.setFieldsValue({
|
||||||
|
grid_ranges: updatedGridRanges,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
...(asset_buildings_id
|
||||||
|
? [
|
||||||
|
Selects?.GridUnits({
|
||||||
|
key: 'asset_units_id',
|
||||||
|
title: '选择单元',
|
||||||
|
params: {
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
asset_buildings_id:
|
||||||
|
asset_buildings_id,
|
||||||
|
},
|
||||||
|
colProps: { span: 12 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
157
src/pages/asset/grids/modals/GridCreate copy.tsx
Normal file
157
src/pages/asset/grids/modals/GridCreate copy.tsx
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [transferData, setTransferData] = useState<any[]>([]);
|
||||||
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||||
|
|
||||||
|
// 获取Transfer数据源
|
||||||
|
useEffect(() => {
|
||||||
|
const asset_projects_id = props?.item?.id || 0;
|
||||||
|
if (asset_projects_id) {
|
||||||
|
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||||
|
.then((res) => {
|
||||||
|
const data =
|
||||||
|
res.data?.map((item: any) => ({
|
||||||
|
key: item.value?.toString(),
|
||||||
|
title: item.label,
|
||||||
|
description: item.label,
|
||||||
|
})) || [];
|
||||||
|
setTransferData(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setTransferData([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [props?.item?.id]);
|
||||||
|
|
||||||
|
console.log(props.item, 'pppp');
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`范围添加`}
|
||||||
|
width="700px"
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
labelAlign="right"
|
||||||
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
form={form}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
form.setFieldsValue({
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values: any) => {
|
||||||
|
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||||
|
res.asset_projects_id = props?.item?.id;
|
||||||
|
});
|
||||||
|
return Apis.Grid.Grids.Store({
|
||||||
|
...values,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success('网格添加成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false);
|
||||||
|
}}
|
||||||
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
Selects?.GetGridMark({
|
||||||
|
key: 'grid_mark',
|
||||||
|
title: '范围标识',
|
||||||
|
params: {
|
||||||
|
asset_projects_id:
|
||||||
|
asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
Selects?.GridUnits({
|
||||||
|
key: 'grid_units_id',
|
||||||
|
title: '选择单元',
|
||||||
|
params: {
|
||||||
|
asset_projects_id:
|
||||||
|
asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
// {
|
||||||
|
// valueType: 'formItem',
|
||||||
|
// dataIndex: 'grid_units_id',
|
||||||
|
// title: '选择单元',
|
||||||
|
// colProps: { span: 24 },
|
||||||
|
// formItemProps: { ...rulesHelper.text },
|
||||||
|
// renderFormItem: () => (
|
||||||
|
// <Transfer
|
||||||
|
// dataSource={transferData}
|
||||||
|
// targetKeys={targetKeys}
|
||||||
|
// onChange={(nextTargetKeys) => {
|
||||||
|
// setTargetKeys(nextTargetKeys as string[]);
|
||||||
|
// form.setFieldValue('grid_units_id', nextTargetKeys);
|
||||||
|
// }}
|
||||||
|
// render={(item) => item.title}
|
||||||
|
// titles={['可选单元', '已选单元']}
|
||||||
|
// showSearch
|
||||||
|
// listStyle={{
|
||||||
|
// width: 250,
|
||||||
|
// height: 300,
|
||||||
|
// }}
|
||||||
|
// operations={['选择', '移除']}
|
||||||
|
// locale={{
|
||||||
|
// itemUnit: '项',
|
||||||
|
// itemsUnit: '项',
|
||||||
|
// searchPlaceholder: '请输入搜索内容',
|
||||||
|
// notFoundContent: '列表为空',
|
||||||
|
// }}
|
||||||
|
// />
|
||||||
|
// ),
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
159
src/pages/asset/grids/modals/GridCreate.tsx
Normal file
159
src/pages/asset/grids/modals/GridCreate.tsx
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message, Transfer } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [transferData, setTransferData] = useState<any[]>([]);
|
||||||
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||||
|
|
||||||
|
// 获取Transfer数据源
|
||||||
|
useEffect(() => {
|
||||||
|
const asset_projects_id = props?.item?.id || 0;
|
||||||
|
if (asset_projects_id) {
|
||||||
|
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||||
|
.then((res) => {
|
||||||
|
const data =
|
||||||
|
res.data?.map((item: any) => ({
|
||||||
|
key: item.value?.toString(),
|
||||||
|
title: item?.asset_building?.name + item.label,
|
||||||
|
})) || [];
|
||||||
|
setTransferData(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setTransferData([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [props?.item?.id]);
|
||||||
|
|
||||||
|
console.log(props.item, 'pppp');
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`范围添加`}
|
||||||
|
width="700px"
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
labelAlign="right"
|
||||||
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
form={form}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
form.setFieldsValue({
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values: any) => {
|
||||||
|
(values.asset_projects_id =
|
||||||
|
values?.asset_projects_id || props?.item?.id),
|
||||||
|
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||||
|
res.asset_projects_id = props?.item?.id;
|
||||||
|
});
|
||||||
|
return Apis.Grid.Grids.Store({
|
||||||
|
...values,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success('网格添加成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false);
|
||||||
|
}}
|
||||||
|
submitter={false}
|
||||||
|
footer={[<MyButtons.Default key="submit" title="添加" />]}
|
||||||
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
columns: [
|
||||||
|
Selects?.GetGridMark({
|
||||||
|
key: 'grid_mark',
|
||||||
|
title: '范围标识',
|
||||||
|
params: {
|
||||||
|
asset_projects_id:
|
||||||
|
asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
valueType: 'formItem',
|
||||||
|
dataIndex: 'grid_units_id',
|
||||||
|
title: '选择单元',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
renderFormItem: () => (
|
||||||
|
<div onClick={(e) => e.stopPropagation()}>
|
||||||
|
<Transfer
|
||||||
|
dataSource={transferData}
|
||||||
|
targetKeys={targetKeys}
|
||||||
|
onChange={(nextTargetKeys) => {
|
||||||
|
setTargetKeys(nextTargetKeys as string[]);
|
||||||
|
form.setFieldValue('grid_units_id', nextTargetKeys);
|
||||||
|
}}
|
||||||
|
render={(item) => item.title}
|
||||||
|
titles={['可选单元', '已选单元']}
|
||||||
|
showSearch
|
||||||
|
listStyle={{
|
||||||
|
width: 250,
|
||||||
|
height: 300,
|
||||||
|
}}
|
||||||
|
operations={['选择', '移除']}
|
||||||
|
operationStyle={{ marginTop: 20 }}
|
||||||
|
locale={{
|
||||||
|
itemUnit: '项',
|
||||||
|
itemsUnit: '项',
|
||||||
|
searchPlaceholder: '请输入搜索内容',
|
||||||
|
notFoundContent: '列表为空',
|
||||||
|
}}
|
||||||
|
onSelectChange={(
|
||||||
|
sourceSelectedKeys,
|
||||||
|
targetSelectedKeys,
|
||||||
|
) => {
|
||||||
|
// 处理选择变化,但不触发表单提交
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
539
src/pages/asset/houses/index.tsx
Normal file
539
src/pages/asset/houses/index.tsx
Normal file
@ -0,0 +1,539 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
AssetHousesOwnershipTypeEnum,
|
||||||
|
AssetHousesUsageEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
|
import { message, Space, Typography } from 'antd';
|
||||||
|
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||||
|
import BuildingsCreate from './modals/BuildingsCreate';
|
||||||
|
import AssetBuildingsUpdate from './modals/BuildingsUpdate';
|
||||||
|
import HousesCreate from './modals/HousesCreate';
|
||||||
|
import HousesUpdate from './modals/HousesUpdate';
|
||||||
|
import UnitsCreate from './modals/UnitsCreate';
|
||||||
|
import AssetUnitsUpdate from './modals/UnitsUpdate';
|
||||||
|
|
||||||
|
const { Title } = Typography;
|
||||||
|
interface SelectedAsset {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SelectedBuilding {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SelectedUnit {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Index({ title = '项目列表' }) {
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'asset-buildings',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
const actionAssetRef: any = useRef();
|
||||||
|
const actionBuildingsRef: any = useRef();
|
||||||
|
const actionUnitsRef: any = useRef();
|
||||||
|
const actionHousesRef: any = useRef();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const [selectedAsset, setSelectedAsset] = useState<SelectedAsset | null>(
|
||||||
|
null,
|
||||||
|
);
|
||||||
|
const [selectedBuilding, setSelectedBuilding] =
|
||||||
|
useState<SelectedBuilding | null>(null);
|
||||||
|
const [selectedUnit, setSelectedUnit] = useState<SelectedUnit | null>(null);
|
||||||
|
const [loading, setLoading] = useState({
|
||||||
|
buildings: false,
|
||||||
|
units: false,
|
||||||
|
houses: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 选择项目的回调函数
|
||||||
|
const handleAssetSelect = useCallback(
|
||||||
|
(asset: SelectedAsset) => {
|
||||||
|
if (selectedAsset?.id === asset.id) return; // 避免重复选择
|
||||||
|
|
||||||
|
setSelectedAsset(asset);
|
||||||
|
setSelectedBuilding(null); // 重置楼栋选择
|
||||||
|
setSelectedUnit(null); // 重置单元选择
|
||||||
|
|
||||||
|
// 刷新楼栋和单元列表
|
||||||
|
actionBuildingsRef?.current?.reload();
|
||||||
|
actionUnitsRef?.current?.reload();
|
||||||
|
actionHousesRef?.current?.reload();
|
||||||
|
},
|
||||||
|
[selectedAsset?.id],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 选择楼栋的回调函数
|
||||||
|
const handleBuildingSelect = useCallback(
|
||||||
|
(building: SelectedBuilding) => {
|
||||||
|
if (selectedBuilding?.id === building.id) return; // 避免重复选择
|
||||||
|
|
||||||
|
setSelectedBuilding(building);
|
||||||
|
setSelectedUnit(null); // 重置单元选择
|
||||||
|
|
||||||
|
// 刷新单元和房屋列表
|
||||||
|
actionUnitsRef?.current?.reload();
|
||||||
|
actionHousesRef?.current?.reload();
|
||||||
|
},
|
||||||
|
[selectedBuilding?.id],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 选择单元的回调函数
|
||||||
|
const handleUnitSelect = useCallback(
|
||||||
|
(unit: SelectedUnit) => {
|
||||||
|
if (selectedUnit?.id === unit.id) return; // 避免重复选择
|
||||||
|
|
||||||
|
setSelectedUnit(unit);
|
||||||
|
// 刷新房屋列表
|
||||||
|
actionHousesRef?.current?.reload();
|
||||||
|
},
|
||||||
|
[selectedUnit?.id],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 删除操作的通用处理
|
||||||
|
const handleDelete = useCallback(
|
||||||
|
async (deleteApi: any, id: number, reloadAction: any, itemName: string) => {
|
||||||
|
try {
|
||||||
|
await deleteApi({ id });
|
||||||
|
message.success(`${itemName}删除成功`);
|
||||||
|
reloadAction();
|
||||||
|
|
||||||
|
// 如果删除的是当前选中项,清空选择
|
||||||
|
if (itemName === '项目' && selectedAsset?.id === id) {
|
||||||
|
setSelectedAsset(null);
|
||||||
|
setSelectedBuilding(null);
|
||||||
|
setSelectedUnit(null);
|
||||||
|
} else if (itemName === '楼栋' && selectedBuilding?.id === id) {
|
||||||
|
setSelectedBuilding(null);
|
||||||
|
setSelectedUnit(null);
|
||||||
|
} else if (itemName === '单元' && selectedUnit?.id === id) {
|
||||||
|
setSelectedUnit(null);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
message.error(`${itemName}删除失败`);
|
||||||
|
console.error(`删除${itemName}失败:`, error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[selectedAsset?.id, selectedBuilding?.id, selectedUnit?.id],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 通用表格配置
|
||||||
|
const getTableConfig = useMemo(
|
||||||
|
() => ({
|
||||||
|
...MyProTableProps.props,
|
||||||
|
search: false as const,
|
||||||
|
size: 'middle' as const,
|
||||||
|
options: false as const,
|
||||||
|
pagination: {
|
||||||
|
pageSize: 10,
|
||||||
|
showSizeChanger: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 项目表格列配置
|
||||||
|
const projectColumns = useMemo(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
title: '项目',
|
||||||
|
dataIndex: 'name',
|
||||||
|
ellipsis: true,
|
||||||
|
search: {
|
||||||
|
transform: (value: string) => ({ name: value }),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
width: 120,
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index} size="small">
|
||||||
|
<MyButtons.View
|
||||||
|
title="配置"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/asset/id/${item.id}`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[handleDelete],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 楼栋表格列配置
|
||||||
|
const buildingColumns = useMemo(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
title: '楼栋',
|
||||||
|
dataIndex: 'name',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
width: 120,
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index} size="small">
|
||||||
|
<AssetBuildingsUpdate item={item} reload={action?.reload} />
|
||||||
|
{/* <MyButtons.Delete
|
||||||
|
size="small"
|
||||||
|
onConfirm={() =>
|
||||||
|
handleDelete(
|
||||||
|
Apis.Asset.AssetBuildings.Delete,
|
||||||
|
item.id,
|
||||||
|
action?.reload,
|
||||||
|
'楼栋',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/> */}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[handleDelete],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 单元表格列配置
|
||||||
|
const unitColumns = useMemo(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
title: '单元',
|
||||||
|
dataIndex: 'name',
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
width: 120,
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index} size="small">
|
||||||
|
<AssetUnitsUpdate item={item} reload={action?.reload} />
|
||||||
|
{/* <MyButtons.Delete
|
||||||
|
size="small"
|
||||||
|
onConfirm={() =>
|
||||||
|
handleDelete(
|
||||||
|
Apis.Asset.AssetUnits.Delete,
|
||||||
|
item.id,
|
||||||
|
action?.reload,
|
||||||
|
'单元',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/> */}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[handleDelete],
|
||||||
|
);
|
||||||
|
|
||||||
|
// 房屋表格列配置
|
||||||
|
const houseColumns = useMemo(
|
||||||
|
() => [
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '用途',
|
||||||
|
dataIndex: 'usage',
|
||||||
|
valueEnum: AssetHousesUsageEnum,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '房屋名称',
|
||||||
|
dataIndex: 'full_name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '楼层',
|
||||||
|
dataIndex: 'floor',
|
||||||
|
render(_, record) {
|
||||||
|
return `${record?.floor}层`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '房号',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费面积',
|
||||||
|
dataIndex: 'chargeable_area',
|
||||||
|
render(_, record) {
|
||||||
|
return `${
|
||||||
|
record?.chargeable_area ? record?.chargeable_area + ' m²' : '-'
|
||||||
|
} `;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '房屋属性',
|
||||||
|
dataIndex: 'ownership_type',
|
||||||
|
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.Option({
|
||||||
|
width: 120,
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index} size="small">
|
||||||
|
<HousesUpdate item={item} reload={action?.reload} title="编辑" />
|
||||||
|
{/* <MyButtons.Delete
|
||||||
|
size="small"
|
||||||
|
onConfirm={() =>
|
||||||
|
handleDelete(
|
||||||
|
Apis.Asset.AssetHouses.Delete,
|
||||||
|
item.id,
|
||||||
|
action?.reload,
|
||||||
|
'房屋',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/> */}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
[handleDelete],
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer title={title}>
|
||||||
|
<ProCard
|
||||||
|
// title={
|
||||||
|
// <Alert
|
||||||
|
// message="操作提示:在楼栋下添加单元,在单元下添加房屋!"
|
||||||
|
// type="info"
|
||||||
|
// showIcon
|
||||||
|
// style={{ margin: 0 }}
|
||||||
|
// />
|
||||||
|
// }
|
||||||
|
>
|
||||||
|
<Space align="start" size="large" style={{ width: '100%' }}>
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<Title level={5} style={{ marginBottom: 16 }}>
|
||||||
|
<Space
|
||||||
|
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||||
|
>
|
||||||
|
项目信息
|
||||||
|
</Space>
|
||||||
|
</Title>
|
||||||
|
<ProTable
|
||||||
|
{...getTableConfig}
|
||||||
|
// search={{
|
||||||
|
// labelWidth: 'auto',
|
||||||
|
// collapsed: false,
|
||||||
|
// collapseRender: false,
|
||||||
|
// }}
|
||||||
|
actionRef={actionBuildingsRef}
|
||||||
|
rowClassName={(record: any) => {
|
||||||
|
return selectedBuilding?.id === record?.id
|
||||||
|
? 'ant-table-row-selected'
|
||||||
|
: '';
|
||||||
|
}}
|
||||||
|
onRow={(record: any) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
handleAssetSelect(record);
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{ ...params },
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetProjects.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
columns={projectColumns}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 楼栋列表 */}
|
||||||
|
{selectedAsset ? (
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<Title level={5} style={{ marginBottom: 16 }}>
|
||||||
|
<Space
|
||||||
|
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||||
|
>
|
||||||
|
<span>{selectedAsset?.name}</span>
|
||||||
|
<BuildingsCreate
|
||||||
|
key="BuildingsCreate"
|
||||||
|
item={{ ...selectedAsset, size: 'small' }}
|
||||||
|
reload={() => actionBuildingsRef?.current?.reload()}
|
||||||
|
title="楼栋"
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</Title>
|
||||||
|
<ProTable
|
||||||
|
{...getTableConfig}
|
||||||
|
actionRef={actionBuildingsRef}
|
||||||
|
rowClassName={(record: any) => {
|
||||||
|
return selectedBuilding?.id === record?.id
|
||||||
|
? 'ant-table-row-selected'
|
||||||
|
: '';
|
||||||
|
}}
|
||||||
|
onRow={(record: any) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
handleBuildingSelect(record);
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{ ...params, asset_projects_id: selectedAsset?.id },
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetBuildings.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
columns={buildingColumns}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
// minWidth: 300,
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
color: '#999',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
请先选择项目
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* 单元列表 */}
|
||||||
|
{selectedBuilding ? (
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<Title level={5} style={{ marginBottom: 16 }}>
|
||||||
|
<Space
|
||||||
|
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||||
|
>
|
||||||
|
<span>{selectedBuilding.name}</span>
|
||||||
|
<UnitsCreate
|
||||||
|
key="UnitsCreate"
|
||||||
|
item={{
|
||||||
|
...selectedBuilding,
|
||||||
|
asset_buildings_id: selectedBuilding?.id,
|
||||||
|
size: 'small',
|
||||||
|
}}
|
||||||
|
reload={() => actionUnitsRef?.current?.reload()}
|
||||||
|
title="单元"
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</Title>
|
||||||
|
<ProTable
|
||||||
|
{...getTableConfig}
|
||||||
|
actionRef={actionUnitsRef}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_projects_id: selectedAsset?.id,
|
||||||
|
asset_buildings_id: selectedBuilding?.id,
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetUnits.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
rowClassName={(record: any) => {
|
||||||
|
return selectedUnit?.id === record?.id
|
||||||
|
? 'ant-table-row-selected'
|
||||||
|
: '';
|
||||||
|
}}
|
||||||
|
onRow={(record: any) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
handleUnitSelect(record);
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
columns={unitColumns}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
// minWidth: 300,
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
color: '#999',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
请先选择楼栋
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* 房屋列表 */}
|
||||||
|
{selectedUnit ? (
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<Title level={5} style={{ marginBottom: 16 }}>
|
||||||
|
<Space
|
||||||
|
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||||
|
>
|
||||||
|
<span>{selectedUnit.name}</span>
|
||||||
|
<HousesCreate
|
||||||
|
key="HousesCreate"
|
||||||
|
item={{
|
||||||
|
...selectedUnit,
|
||||||
|
asset_projects_id: selectedAsset?.id,
|
||||||
|
asset_buildings_id: selectedBuilding?.id,
|
||||||
|
asset_units_id: selectedUnit?.id,
|
||||||
|
size: 'small',
|
||||||
|
}}
|
||||||
|
reload={() => actionHousesRef?.current?.reload()}
|
||||||
|
title="房屋"
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</Title>
|
||||||
|
<ProTable
|
||||||
|
{...getTableConfig}
|
||||||
|
actionRef={actionHousesRef}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_projects_id: selectedAsset?.id,
|
||||||
|
asset_buildings_id: selectedBuilding?.id,
|
||||||
|
asset_units_id: selectedUnit?.id,
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetHouses.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
columns={houseColumns}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
// minWidth: 400,
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
color: '#999',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{selectedBuilding ? '请先选择单元' : '请先选择楼栋'}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
</ProCard>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -18,7 +18,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`${props.title}`}
|
title={`${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="500px"
|
width="500px"
|
||||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
form.resetFields(); // 清空表单数据
|
form.resetFields(); // 清空表单数据
|
||||||
@ -23,7 +23,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`添加${props.title}`}
|
title={`添加${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="800px"
|
||||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'mindde'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
form={form}
|
form={form}
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
@ -24,7 +24,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="800px"
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Default title={props.title} size="small" type="primary" />
|
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||||
}
|
}
|
||||||
form={form}
|
form={form}
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
@ -21,7 +21,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`添加${props.title}`}
|
title={`添加${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="700px"
|
width="700px"
|
||||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
trigger={
|
||||||
|
<MyButtons.Create
|
||||||
|
title={`${props.title}`}
|
||||||
|
size={props?.item?.size || 'middle'}
|
||||||
|
/>
|
||||||
|
}
|
||||||
form={form}
|
form={form}
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
@ -3,9 +3,9 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import AnnouncementCreate from './modals/AnnouncementCreate';
|
import AnnouncementCreate from '../../announcement/modals/AnnouncementCreate';
|
||||||
import AnnouncementShow from './modals/AnnouncementShow';
|
import AnnouncementShow from '../../announcement/modals/AnnouncementShow';
|
||||||
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
import AnnouncementUpdate from '../../announcement/modals/AnnouncementUpdate';
|
||||||
|
|
||||||
export default function Index({ ...rest }) {
|
export default function Index({ ...rest }) {
|
||||||
const actionLooks = useRef<any>();
|
const actionLooks = useRef<any>();
|
||||||
@ -35,7 +35,6 @@ export default function Index({ ...rest }) {
|
|||||||
search={false}
|
search={false}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '公告标题',
|
title: '公告标题',
|
||||||
dataIndex: 'title',
|
dataIndex: 'title',
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import AssetAccountsSelect from './modals/AssetAccountsSelect';
|
import AccountsSelect from '../../accounts/modals/AccountsSelect';
|
||||||
|
|
||||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||||
return (
|
return (
|
||||||
@ -27,7 +27,7 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<AssetAccountsSelect
|
<AccountsSelect
|
||||||
key="Select"
|
key="Select"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
item={props?.item}
|
item={props?.item}
|
||||||
@ -13,12 +13,12 @@ import {
|
|||||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||||
import { Alert, message, Space, Typography } from 'antd';
|
import { Alert, message, Space, Typography } from 'antd';
|
||||||
import { useCallback, useRef, useState } from 'react';
|
import { useCallback, useRef, useState } from 'react';
|
||||||
import BuildingsCreate from './modals/BuildingsCreate';
|
import BuildingsCreate from '../../houses/modals/BuildingsCreate';
|
||||||
import AssetBuildingsUpdate from './modals/BuildingsUpdate';
|
import AssetBuildingsUpdate from '../../houses/modals/BuildingsUpdate';
|
||||||
import HousesCreate from './modals/HousesCreate';
|
import HousesCreate from '../../houses/modals/HousesCreate';
|
||||||
import HousesUpdate from './modals/HousesUpdate';
|
import HousesUpdate from '../../houses/modals/HousesUpdate';
|
||||||
import AssetUnitsCreate from './modals/UnitsCreate';
|
import AssetUnitsCreate from '../../houses/modals/UnitsCreate';
|
||||||
import AssetUnitsUpdate from './modals/UnitsUpdate';
|
import AssetUnitsUpdate from '../../houses/modals/UnitsUpdate';
|
||||||
|
|
||||||
const { Title } = Typography;
|
const { Title } = Typography;
|
||||||
|
|
||||||
@ -3,9 +3,9 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import GridCreate from './modals/GridCreate';
|
import GridCreate from '../../grids/modals/GridCreate';
|
||||||
import GridMannger from './modals/GridMannger';
|
import GridMannger from '../../grids/modals/GridMannger';
|
||||||
import GridCreateUpdate from './modals/GridUpdate';
|
import GridCreateUpdate from '../../grids/modals/GridUpdate';
|
||||||
|
|
||||||
export default function Index({ ...rest }) {
|
export default function Index({ ...rest }) {
|
||||||
const actionLooks = useRef<any>();
|
const actionLooks = useRef<any>();
|
||||||
@ -26,7 +26,12 @@ export default function Index({ ...rest }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<GridCreate key="Create" item={rest.item} reload={action?.reload} />,
|
<GridCreate
|
||||||
|
key="Create"
|
||||||
|
item={rest.item}
|
||||||
|
reload={action?.reload}
|
||||||
|
title="楼栋划分"
|
||||||
|
/>,
|
||||||
]}
|
]}
|
||||||
search={false}
|
search={false}
|
||||||
columns={[
|
columns={[
|
||||||
@ -29,7 +29,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="绑定机构">
|
<ProDescriptions.Item label="关联机构">
|
||||||
<Space size="large">
|
<Space size="large">
|
||||||
<div>{props?.item?.company?.name}</div>
|
<div>{props?.item?.company?.name}</div>
|
||||||
</Space>
|
</Space>
|
||||||
@ -4,8 +4,8 @@ import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
|||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import ServiceCreate from './modals/ServiceCreate';
|
import ServiceCreate from '../../convenience_services/modals/ServiceCreate';
|
||||||
import ServiceUpdate from './modals/ServiceUpdate';
|
import ServiceUpdate from '../../convenience_services/modals/ServiceUpdate';
|
||||||
|
|
||||||
export default function Index({ ...rest }) {
|
export default function Index({ ...rest }) {
|
||||||
const actionLooks = useRef<any>();
|
const actionLooks = useRef<any>();
|
||||||
@ -89,7 +89,7 @@ export default function Index({ title = '项目列表' }) {
|
|||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '绑定机构',
|
title: '关联机构',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: ['company', 'name'],
|
||||||
search: {
|
search: {
|
||||||
transform: (value) => {
|
transform: (value) => {
|
||||||
@ -116,7 +116,7 @@ export default function Index({ title = '项目列表' }) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="配置"
|
title="配置"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/asset/${item.id}`);
|
navigate(`/asset/list/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
@ -4,15 +4,15 @@ import { ProCard } from '@ant-design/pro-components';
|
|||||||
import { useParams } from '@umijs/max';
|
import { useParams } from '@umijs/max';
|
||||||
import { Space, Tabs } from 'antd';
|
import { Space, Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import Announcement from './components/Announcement';
|
import Announcement from '../components/Announcement';
|
||||||
import AssetAccounts from './components/AssetAccounts';
|
import AssetAccounts from '../components/AssetAccounts';
|
||||||
import MyAssetBuildings from './components/AssetBuildings';
|
import MyAssetBuildings from '../components/AssetBuildings';
|
||||||
import AssetGrid from './components/AssetGrid';
|
import AssetGrid from '../components/AssetGrid';
|
||||||
import AssetInfo from './components/AssetInfo';
|
import AssetInfo from '../components/AssetInfo';
|
||||||
import ChargeStandard from './components/ChargeStandard';
|
import ChargeStandard from '../components/ChargeStandard';
|
||||||
import ConvenienceServices from './components/ConvenienceServices';
|
import ConvenienceServices from '../components/ConvenienceServices';
|
||||||
import BindCompany from './components/modals/BindCompany';
|
import BindCompany from '../components/modals/BindCompany';
|
||||||
import AssetUpdate from './modals/AssetUpdate';
|
import AssetUpdate from '../modals/AssetUpdate';
|
||||||
|
|
||||||
export default function Show({ title }: { title?: string } = {}) {
|
export default function Show({ title }: { title?: string } = {}) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
@ -15,8 +15,8 @@ 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 { useState } from 'react';
|
||||||
import HousesShow from '../asset/components/modals/HousesShow';
|
import HousesShow from '../asset/houses/modals/HousesShow';
|
||||||
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
import HousesUpdate from '../asset/houses/modals/HousesUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '房屋列表' }) {
|
export default function Index({ title = '房屋列表' }) {
|
||||||
const [getParams, setParams] = useState({});
|
const [getParams, setParams] = useState({});
|
||||||
@ -128,7 +128,7 @@ export default function Index({ title = '房屋列表' }) {
|
|||||||
// search: false,
|
// search: false,
|
||||||
// }),
|
// }),
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '产权性质',
|
title: '房屋属性',
|
||||||
dataIndex: 'ownership_type',
|
dataIndex: 'ownership_type',
|
||||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||||
search: false,
|
search: false,
|
||||||
|
|||||||
@ -12,8 +12,8 @@ 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 { useState } from 'react';
|
||||||
import HousesShow from '../asset/components/modals/HousesShow';
|
import HousesShow from '../asset/houses/modals/HousesShow';
|
||||||
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
import HousesUpdate from '../asset/houses/modals/HousesUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '房屋列表' }) {
|
export default function Index({ title = '房屋列表' }) {
|
||||||
const [getParams, setParams] = useState({});
|
const [getParams, setParams] = useState({});
|
||||||
|
|||||||
@ -6,18 +6,19 @@ import {
|
|||||||
usePageTabs,
|
usePageTabs,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } 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 { Image, Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import AppCreate from './modals/AppCreate';
|
import AppCreate from './modals/AppCreate';
|
||||||
import AppUpdate from './modals/AppUpdate';
|
import AppUpdate from './modals/AppUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '品牌管理' }) {
|
export default function Index({ title = '应用管理' }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'company-brands',
|
tabKey: 'company-apps',
|
||||||
tabLabel: title,
|
tabLabel: title,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -25,17 +26,13 @@ export default function Index({ title = '品牌管理' }) {
|
|||||||
<MyPageContainer
|
<MyPageContainer
|
||||||
title={title}
|
title={title}
|
||||||
enableTabs={true}
|
enableTabs={true}
|
||||||
tabKey="company-brands"
|
tabKey="company-apps"
|
||||||
tabLabel={title}
|
tabLabel={title}
|
||||||
>
|
>
|
||||||
<ProTable
|
<ProTable
|
||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
request={async (params, sort) =>
|
request={async (params, sort) =>
|
||||||
MyProTableProps.request(
|
MyProTableProps.request(params, sort, Apis.Company.CompanyApps.List)
|
||||||
params,
|
|
||||||
sort,
|
|
||||||
Apis.Company.CompanyPropertyBrands.List,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<AppCreate key="Create" reload={action?.reload} title={title} />,
|
<AppCreate key="Create" reload={action?.reload} title={title} />,
|
||||||
@ -45,39 +42,45 @@ export default function Index({ title = '品牌管理' }) {
|
|||||||
{
|
{
|
||||||
title: '机构',
|
title: '机构',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: ['company', 'name'],
|
||||||
|
},
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '应用类型',
|
||||||
|
dataIndex: 'app_type',
|
||||||
|
valueEnum: CompanyAppsAppTypeEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '模块',
|
||||||
|
dataIndex: 'module',
|
||||||
|
valueEnum: CompanyAppsModuleEnum,
|
||||||
search: false,
|
search: false,
|
||||||
},
|
}),
|
||||||
{
|
{
|
||||||
title: '物业名称',
|
title: '应用ID',
|
||||||
dataIndex: 'name',
|
dataIndex: 'app_id',
|
||||||
},
|
search: false,
|
||||||
{
|
ellipsis: true,
|
||||||
title: 'logo',
|
|
||||||
render: (_, item) => {
|
|
||||||
return (
|
|
||||||
<Space>
|
|
||||||
{item?.logo?.[0] && (
|
|
||||||
<Image
|
|
||||||
height={30}
|
|
||||||
src={item?.logo[0]?.url}
|
|
||||||
placeholder="正面"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '应用密钥',
|
||||||
|
// dataIndex: 'app_secret',
|
||||||
|
// search: false,
|
||||||
|
// ellipsis: true,
|
||||||
|
// render: (text) => '***' + String(text).slice(-4),
|
||||||
|
// },
|
||||||
|
|
||||||
|
MyColumns.UpdatedAt(),
|
||||||
|
// MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<AppUpdate
|
<AppUpdate
|
||||||
item={{ ...item, companies_id: item?.id }}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="品牌"
|
title="应用配置"
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Company.CompanyPropertyBrands.Delete({
|
Apis.Company.CompanyApps.Delete({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
}).then(() => action?.reload())
|
}).then(() => action?.reload())
|
||||||
}
|
}
|
||||||
@ -45,14 +45,14 @@ export default function Index({ title = '品牌管理' }) {
|
|||||||
{
|
{
|
||||||
title: '机构',
|
title: '机构',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: ['company', 'name'],
|
||||||
search: false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物业名称',
|
title: '品牌名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'logo',
|
title: 'logo',
|
||||||
|
search: false,
|
||||||
render: (_, item) => {
|
render: (_, item) => {
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
title={`编辑${props.title}`}
|
title={`编辑${props.title}`}
|
||||||
trigger={<MyButtons.Edit />}
|
trigger={<MyButtons.Edit />}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="300px"
|
width="360px"
|
||||||
form={form}
|
form={form}
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`添加品牌`}
|
title={`添加品牌`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="300px"
|
width="360px"
|
||||||
trigger={<MyButtons.Create title={`添加品牌`} />}
|
trigger={<MyButtons.Create title={`添加品牌`} />}
|
||||||
form={form}
|
form={form}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export default function Index({ title = '机构列表' }) {
|
|||||||
title="配置"
|
title="配置"
|
||||||
data-tooltip-position="top"
|
data-tooltip-position="top"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/company/auto/${item.id}`);
|
navigate(`/company/list/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
@ -8,9 +8,11 @@ import {
|
|||||||
import { Address } from '@/components/Address';
|
import { Address } from '@/components/Address';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Company.Companies.Store>
|
<BetaSchemaForm<ApiTypes.Company.Companies.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
@ -18,6 +20,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="600px"
|
width="600px"
|
||||||
trigger={<MyButtons.Create title={`添加机构`} />}
|
trigger={<MyButtons.Create title={`添加机构`} />}
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Company.Companies.Store({
|
Apis.Company.Companies.Store({
|
||||||
...values,
|
...values,
|
||||||
@ -5,15 +5,15 @@ import { useParams } from '@umijs/max';
|
|||||||
import { Space, Tabs } from 'antd';
|
import { Space, Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import CompanyUpdate from './modals/CompanyUpdate';
|
import CompanyUpdate from '../modals/CompanyUpdate';
|
||||||
import CompanyApps from './table/Apps';
|
import CompanyApps from '../table/Apps';
|
||||||
import Assets from './table/Assets';
|
import Assets from '../table/Assets';
|
||||||
import Brands from './table/Brands';
|
import Brands from '../table/Brands';
|
||||||
import ComponentsInfo from './table/ComponentsInfo';
|
import ComponentsInfo from '../table/ComponentsInfo';
|
||||||
import Employees from './table/Employees';
|
import Employees from '../table/Employees';
|
||||||
import Organizations from './table/Organizations';
|
import Organizations from '../table/Organizations';
|
||||||
import Positions from './table/Positions';
|
import Positions from '../table/Positions';
|
||||||
import ReceiptAccounts from './table/ReceiptAccounts';
|
import ReceiptAccounts from '../table/ReceiptAccounts';
|
||||||
|
|
||||||
export default function Show({ title }: { title?: string } = {}) {
|
export default function Show({ title }: { title?: string } = {}) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
@ -8,8 +8,8 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } from '@/gen/Enums';
|
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import AppCreate from '../../company_apps/modals/AppCreate';
|
import AppCreate from '../../apps/modals/AppCreate';
|
||||||
import AppUpdate from '../../company_apps/modals/AppUpdate';
|
import AppUpdate from '../../apps/modals/AppUpdate';
|
||||||
|
|
||||||
export default function CompanyApps(props: MyBetaModalFormProps) {
|
export default function CompanyApps(props: MyBetaModalFormProps) {
|
||||||
return (
|
return (
|
||||||
@ -35,7 +35,10 @@ export default function CompanyApps(props: MyBetaModalFormProps) {
|
|||||||
// options={false}
|
// options={false}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '机构',
|
||||||
|
dataIndex: ['company', 'name'],
|
||||||
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '应用类型',
|
title: '应用类型',
|
||||||
dataIndex: 'app_type',
|
dataIndex: 'app_type',
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
AssetProjectsPropertyTypeEnum,
|
AssetProjectsPropertyTypeEnum,
|
||||||
AssetProjectsStatusEnum,
|
AssetProjectsStatusEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import AssetCreate from '@/pages/asset/modals/AssetCreate';
|
import AssetCreate from '@/pages/asset/list/modals/AssetCreate';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Image, Space } from 'antd';
|
import { Image, Space } from 'antd';
|
||||||
import PropertyBrandsCreate from '../../brand/modals/BrandsCreate';
|
import BrandsCreate from '../../brand/modals/BrandsCreate';
|
||||||
import PropertyBrandUpdate from '../../brand/modals/BrandUpdate';
|
import PropertyBrandUpdate from '../../brand/modals/BrandUpdate';
|
||||||
|
|
||||||
export default function PropertyBrands(props: MyBetaModalFormProps) {
|
export default function PropertyBrands(props: MyBetaModalFormProps) {
|
||||||
@ -23,7 +23,7 @@ export default function PropertyBrands(props: MyBetaModalFormProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<PropertyBrandsCreate
|
<BrandsCreate
|
||||||
key="Create"
|
key="Create"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
item={props?.item}
|
item={props?.item}
|
||||||
@ -29,7 +29,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="绑定机构">
|
<ProDescriptions.Item label="关联机构">
|
||||||
<Space size="large">
|
<Space size="large">
|
||||||
<div>{props?.item?.company?.name}</div>
|
<div>{props?.item?.company?.name}</div>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import ChargeStandardHasHouse from '@/pages/asset/components/modals/ChargeStandardHasHouse';
|
import ChargeStandardHasHouse from '@/pages/asset/list/components/modals/ChargeStandardHasHouse';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|||||||
@ -15,8 +15,8 @@ import {
|
|||||||
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 ChargeStandardHasHouse from '../asset/components/modals/ChargeStandardHasHouse';
|
import ChargeStandardHasHouse from '../asset/list/components/modals/ChargeStandardHasHouse';
|
||||||
import ChargeStandardUpdate from '../asset/components/modals/ChargeStandardUpdate';
|
import ChargeStandardUpdate from '../asset/list/components/modals/ChargeStandardUpdate';
|
||||||
import ChargeCreate from './modals/ChargeCreate';
|
import ChargeCreate from './modals/ChargeCreate';
|
||||||
|
|
||||||
export default function Index({ title = '收费标准' }) {
|
export default function Index({ title = '收费标准' }) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user