Compare commits
2 Commits
1275c157f5
...
1a1a9be825
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a1a9be825 | ||
|
|
f1e03910b9 |
@ -14,8 +14,14 @@ export default defineConfig({
|
||||
},
|
||||
proxy: {
|
||||
'/api/': {
|
||||
<<<<<<< HEAD
|
||||
// target: 'http://yt:8003',
|
||||
target: 'http://10.39.13.80:8001',
|
||||
// target: 'https://weapp-api.linyikj.com.cn/',
|
||||
=======
|
||||
target: 'http://yt:8001',
|
||||
// target: 'http://10.39.13.80:8001',
|
||||
>>>>>>> 1275c157f58b27d4d2b966e91a73bab4f3360be2
|
||||
// target: 'http://we6f9c65.natappfree.cc',
|
||||
// target: 'https://loanos-test.nchl.net/',
|
||||
changeOrigin: true,
|
||||
|
||||
@ -49,14 +49,14 @@ export const MyButtons = {
|
||||
},
|
||||
View({ title, ...rest }: MyButtonsType): JSX.Element {
|
||||
return (
|
||||
<Button type="link" size="small" {...rest}>
|
||||
<Button type="primary" size="small" {...rest}>
|
||||
{title ?? '查看'}
|
||||
</Button>
|
||||
);
|
||||
},
|
||||
Edit({ title = '编辑', ...rest }: MyButtonsType): JSX.Element {
|
||||
return (
|
||||
<Button type="link" size="small" icon={<EditOutlined />} {...rest}>
|
||||
<Button type="primary" size="small" icon={<EditOutlined />} {...rest}>
|
||||
{title}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@ -54,7 +54,10 @@ export function MyImportModal(props: MyImportModalType) {
|
||||
});
|
||||
}}
|
||||
confirmLoading={loading}
|
||||
destroyOnClose={true}
|
||||
// 使用 destroyOnClose 已弃用,建议使用 afterClose 处理清理逻辑
|
||||
afterClose={() => {
|
||||
setFormData(undefined);
|
||||
}}
|
||||
maskClosable={false}
|
||||
footer={(dom) => {
|
||||
return (
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import { MyButtons } from '@/common';
|
||||
import { Modal } from 'antd';
|
||||
import { useImperativeHandle, useState } from 'react';
|
||||
import { useImperativeHandle, useState } from 'react';
|
||||
|
||||
export function MyModal(props?: any) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const close = () => {
|
||||
setOpen(false)
|
||||
}
|
||||
setOpen(false);
|
||||
};
|
||||
useImperativeHandle(props.myRef, () => ({
|
||||
close
|
||||
}));
|
||||
close,
|
||||
}));
|
||||
return (
|
||||
<>
|
||||
{props?.trigger ? (
|
||||
@ -17,6 +17,7 @@ export function MyModal(props?: any) {
|
||||
) : (
|
||||
<MyButtons.View
|
||||
title={props.title || '详情'}
|
||||
type={props.type || 'primary'}
|
||||
onClick={() => setOpen(true)}
|
||||
/>
|
||||
)}
|
||||
|
||||
13
src/gen/ApiTypes.d.ts
vendored
13
src/gen/ApiTypes.d.ts
vendored
@ -46,18 +46,12 @@ declare namespace ApiTypes {
|
||||
"asset_houses_id": number; // 房屋ID
|
||||
"type": string; // 类型,[enum:HouseRegistersTypeEnum]
|
||||
"status"?: string; // 状态,[enum:HouseRegistersStatusEnum]
|
||||
"house_status"?: string; // 房屋状态,[enum:HouseRegistersHouseStatusEnum]
|
||||
"usage_plan"?: string; // 使用计划,[enum:HouseRegistersUsagePlanEnum]
|
||||
"customer_type"?: string; // 客户类型,[enum:HouseRegistersCustomerTypeEnum]
|
||||
"customer_info"?: string[]; // 客户信息
|
||||
"ownership_info"?: string[]; // 产权信息
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"type": string; // 类型,[enum:HouseRegistersTypeEnum]
|
||||
"house_status"?: string; // 房屋状态,[enum:HouseRegistersHouseStatusEnum]
|
||||
"usage_plan"?: string; // 使用计划,[enum:HouseRegistersUsagePlanEnum]
|
||||
"customer_type"?: string; // 客户类型,[enum:HouseRegistersCustomerTypeEnum]
|
||||
"customer_info"?: string[]; // 客户信息
|
||||
"ownership_info"?: string[]; // 产权信息
|
||||
};
|
||||
@ -181,6 +175,10 @@ declare namespace ApiTypes {
|
||||
"asset_units_id"?: number; // 所属单元id,[ref:asset_units]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
type Import = {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件
|
||||
};
|
||||
}
|
||||
namespace AssetProjects {
|
||||
type List = {
|
||||
@ -420,6 +418,7 @@ declare namespace ApiTypes {
|
||||
"asset_houses_id"?: number; // 房屋id,[ref:asset_houses]
|
||||
"channel"?: string; // 通知渠道,[enum:HouseCollectionTasksChannelEnum]
|
||||
"status"?: string; // 通知状态,[enum:HouseCollectionRecordsStatusEnum]
|
||||
"full_name"?: string; // 房屋名称
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
@ -960,10 +959,10 @@ declare namespace ApiTypes {
|
||||
"id": number; // id
|
||||
"type": string; // 工单类型,[enum:HouseWorkOrdersTypeEnum]
|
||||
"level": string; // 优先级,[enum:HouseWorkOrdersLevelEnum]
|
||||
"title": string; // 工单标题
|
||||
"content": string; // 工单内容
|
||||
"reporter_name"?: string; // 上报人名称
|
||||
"reporter_phone"?: string; // 上报人手机
|
||||
"contact_phone"?: string; // 联系人电话
|
||||
"attachments"?: string[]; // 工单附件
|
||||
"asset_houses_id": number; // 资产房屋id,[ref:asset_houses]
|
||||
};
|
||||
|
||||
@ -96,6 +96,12 @@ export const Apis = {
|
||||
Select(data?: ApiTypes.Asset.AssetHouses.Select): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_houses/select', { data });
|
||||
},
|
||||
Import(data?: ApiTypes.Asset.AssetHouses.Import): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_houses/import', { data });
|
||||
},
|
||||
DownloadTemplate(): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_houses/download_template', {responseType: 'blob',});
|
||||
},
|
||||
},
|
||||
AssetProjects: {
|
||||
List(data?: ApiTypes.Asset.AssetProjects.List): Promise<MyResponseType> {
|
||||
|
||||
@ -126,7 +126,7 @@ export const BannersTypeEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#f8c2db","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#2f067d","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
@ -148,6 +148,18 @@ export const CompanyAppsModuleEnum= {
|
||||
'Customer': {"text":"客户端","color":"#10b981","value":"Customer"},
|
||||
};
|
||||
|
||||
// CompanyEmployeeBacklogsStatusEnum
|
||||
export const CompanyEmployeeBacklogsStatusEnum= {
|
||||
'Pending': {"text":"待办","color":"#FF6600","value":"Pending"},
|
||||
'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"},
|
||||
};
|
||||
|
||||
// CompanyEmployeeBacklogsTypeEnum
|
||||
export const CompanyEmployeeBacklogsTypeEnum= {
|
||||
'WorkOrder': {"text":"工单","color":"#FF6600","value":"WorkOrder"},
|
||||
'Contract': {"text":"合同","color":"#2A82E4","value":"Contract"},
|
||||
};
|
||||
|
||||
// CompanyReceiptAccountsPayChannelEnum
|
||||
export const CompanyReceiptAccountsPayChannelEnum= {
|
||||
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
|
||||
@ -159,7 +171,7 @@ export const CompanyReceiptAccountsPayChannelEnum= {
|
||||
// CustomerBacklogsStatusEnum
|
||||
export const CustomerBacklogsStatusEnum= {
|
||||
'Pending': {"text":"待办","color":"#faad14","value":"Pending"},
|
||||
'Done': {"text":"已办","color":"#52c41a","value":"Done"},
|
||||
'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"},
|
||||
};
|
||||
|
||||
// CustomerBacklogsTypeEnum
|
||||
@ -234,18 +246,23 @@ export const HouseOccupantsCardTypeEnum= {
|
||||
// HouseOccupantsHouseRelationEnum
|
||||
export const HouseOccupantsHouseRelationEnum= {
|
||||
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"},
|
||||
'Resident': {"text":"住户","color":"#87d068","value":"Resident"},
|
||||
'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"},
|
||||
'NonOwner': {"text":"非产权人","color":"#fa8c16","value":"NonOwner"},
|
||||
};
|
||||
|
||||
// HouseOccupantsRelationWithOwnerEnum
|
||||
export const HouseOccupantsRelationWithOwnerEnum= {
|
||||
'Self': {"text":"本人","color":"#52c41a","value":"Self"},
|
||||
'Spouse': {"text":"夫妻","color":"#2db7f5","value":"Spouse"},
|
||||
'FatherSon': {"text":"父子","color":"#faad14","value":"FatherSon"},
|
||||
'MotherSon': {"text":"母子","color":"#fa8c16","value":"MotherSon"},
|
||||
'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"},
|
||||
'Children': {"text":"子女","color":"#87d068","value":"Children"},
|
||||
'ContactPerson': {"text":"指定联系人","color":"#f5222d","value":"ContactPerson"},
|
||||
'Parents': {"text":"父母","color":"#faad14","value":"Parents"},
|
||||
'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"},
|
||||
'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"},
|
||||
};
|
||||
|
||||
// HouseOccupantsResidentialRelationEnum
|
||||
export const HouseOccupantsResidentialRelationEnum= {
|
||||
'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"},
|
||||
'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"},
|
||||
'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"},
|
||||
};
|
||||
|
||||
// HouseOccupantsStatusEnum
|
||||
@ -302,12 +319,12 @@ export const HouseRegistersStatusEnum= {
|
||||
|
||||
// HouseRegistersTypeEnum
|
||||
export const HouseRegistersTypeEnum= {
|
||||
'Delivery': {"text":"入户登记","color":"#2db7f5","value":"Delivery"},
|
||||
'Transfer': {"text":"过户登记","color":"#87d068","value":"Transfer"},
|
||||
'AddOwner': {"text":"添加产权人","color":"#52c41a","value":"AddOwner"},
|
||||
'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"},
|
||||
'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"},
|
||||
'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"},
|
||||
'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"},
|
||||
'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"},
|
||||
'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"},
|
||||
};
|
||||
|
||||
// HouseRegistersUsagePlanEnum
|
||||
|
||||
@ -8,8 +8,8 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Popconfirm, Space, Tag } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import Delivery from '../modals/Delivery';
|
||||
import AddOccupant from './modals/AddOccupant';
|
||||
import AddRent from './modals/AddRent';
|
||||
import MoveIn from './modals/MoveIn';
|
||||
import MoveOut from './modals/MoveOut';
|
||||
import OccupantShow from './modals/OccupantShow';
|
||||
@ -45,24 +45,30 @@ export default function Index({ ...rest }) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AddOccupant
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
<Delivery
|
||||
key="Delivery"
|
||||
item={{ ...rest.item, size: 'middle' }}
|
||||
reload={action?.reload}
|
||||
title="添加住户"
|
||||
/>,
|
||||
<AddRent
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加租客"
|
||||
/>,
|
||||
<Transfer
|
||||
key="Transfer"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title=" 过户登记"
|
||||
title="添加产权人"
|
||||
/>,
|
||||
!rest.item?.house_occupants?.length ? (
|
||||
''
|
||||
) : (
|
||||
<>
|
||||
<AddOccupant
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加客户"
|
||||
/>
|
||||
<Transfer
|
||||
key="Transfer"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title=" 过户登记"
|
||||
/>
|
||||
</>
|
||||
),
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
|
||||
@ -10,11 +10,13 @@ import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseOccupantsResidentialRelationEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
export default function AddOccupant(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
@ -36,7 +38,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'AddOccupant',
|
||||
type: HouseRegistersTypeEnum.AddOccupant.value,
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: HouseOccupantsHouseRelationEnum.NonOwner.value,
|
||||
};
|
||||
}),
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -50,10 +58,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加住户',
|
||||
creatorButtonText: '添加客户',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
@ -63,7 +73,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`住户${index + 1}`}
|
||||
title={`客户${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
@ -77,16 +87,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '房客关系',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsHouseRelationEnum),
|
||||
);
|
||||
delete obj.Tenant;
|
||||
return obj;
|
||||
},
|
||||
key: 'residential_relation',
|
||||
title: '居住关系',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsResidentialRelationEnum),
|
||||
// );
|
||||
// delete obj.Tenant;
|
||||
// return obj;
|
||||
// },
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
@ -94,16 +105,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title: '关系标记',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
colProps: { span: 18 },
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsRelationWithOwnerEnum),
|
||||
// );
|
||||
// delete obj.Self;
|
||||
// return obj;
|
||||
// },
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
|
||||
@ -111,7 +111,7 @@ export default function Index({ title = '房屋档案' }) {
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/archive/${item.id}`);
|
||||
}}
|
||||
@ -120,17 +120,10 @@ export default function Index({ title = '房屋档案' }) {
|
||||
<Delivery
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="入户登记"
|
||||
title="添加产权人"
|
||||
/>
|
||||
) : (
|
||||
<MyButtons.Default
|
||||
title="客户管理"
|
||||
size="small"
|
||||
type="link"
|
||||
onClick={() => {
|
||||
navigate(`/archive/asset_house/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
''
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
|
||||
@ -9,7 +9,7 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -19,12 +19,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
<MyButtons.View
|
||||
title={props.title}
|
||||
size={props.item?.size || 'small'}
|
||||
type="primary"
|
||||
/>
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
@ -35,13 +40,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'Delivery',
|
||||
type: HouseRegistersTypeEnum.AddOwner.value,
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
house_status: 'SelfOccupied',
|
||||
relation_with_owner: 'Self',
|
||||
house_relation: HouseOccupantsHouseRelationEnum.Owner.value,
|
||||
};
|
||||
}),
|
||||
})
|
||||
@ -54,38 +57,25 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
}
|
||||
columns={[
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '房屋状态',
|
||||
// key: 'customer_type',
|
||||
// title: '产权归属类型',
|
||||
// colProps: { span: 12 },
|
||||
// valueEnum: HouseRegistersHouseStatusEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
// }),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '使用计划',
|
||||
// colProps: { span: 8 },
|
||||
// valueEnum: HouseRegistersUsagePlanEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'customer_type',
|
||||
title: '产权归属',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
tooltip: '上限3张',
|
||||
tooltip: '上限9张',
|
||||
uploadType: 'file',
|
||||
max: 3,
|
||||
colProps: { span: 18 },
|
||||
max: 9,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
@ -159,19 +149,21 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否办理入住',
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
|
||||
@ -17,7 +17,7 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
// 注册当前页面为标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `asset-show-${id}`,
|
||||
tabLabel: data?.name || title || '资产详情',
|
||||
tabLabel: data?.name || title || '项目详情',
|
||||
});
|
||||
|
||||
const loadShow = () => {
|
||||
@ -71,7 +71,7 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
// },
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={data?.name || title || '资产详情'}>
|
||||
<MyPageContainer title={data?.name || title || '项目详情'}>
|
||||
<Basic item={data} reload={() => loadShow()} />
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
|
||||
@ -9,7 +9,6 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -53,14 +52,20 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'ownership_type',
|
||||
title: '房屋属性',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '用途',
|
||||
colProps: { span: 18 },
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
@ -162,35 +167,29 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// required: true,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
delete obj.SelfOccupied;
|
||||
delete obj.Rented;
|
||||
delete obj.Vacant;
|
||||
return obj;
|
||||
},
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
key: 'ownership_term',
|
||||
title: '产权年限',
|
||||
fieldProps: {
|
||||
addonAfter: '年',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 6 },
|
||||
// // valueEnum: AssetHousesStatusEnum,
|
||||
// // required: true,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
// delete obj.SelfOccupied;
|
||||
// delete obj.Rented;
|
||||
// delete obj.Vacant;
|
||||
// return obj;
|
||||
// },
|
||||
// }),
|
||||
|
||||
// {
|
||||
// key: 'ownership_term',
|
||||
// title: '产权年限',
|
||||
// fieldProps: {
|
||||
// addonAfter: '年',
|
||||
// },
|
||||
// colProps: { span: 6 },
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -10,7 +10,6 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -25,7 +24,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
<MyButtons.Default title={props.title} size="small" type="primary" />
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
@ -87,25 +86,31 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'ownership_type',
|
||||
title: '房屋属性',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '用途',
|
||||
colProps: { span: 18 },
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
@ -207,35 +212,20 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// required: true,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
delete obj.SelfOccupied;
|
||||
delete obj.Rented;
|
||||
delete obj.Vacant;
|
||||
return obj;
|
||||
},
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
key: 'ownership_term',
|
||||
title: '产权年限',
|
||||
fieldProps: {
|
||||
addonAfter: '年',
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 6 },
|
||||
// // valueEnum: AssetHousesStatusEnum,
|
||||
// // required: true,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
// delete obj.SelfOccupied;
|
||||
// delete obj.Rented;
|
||||
// delete obj.Vacant;
|
||||
// return obj;
|
||||
// },
|
||||
// }),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyImportModal,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
@ -10,7 +11,7 @@ import { AssetProjectsPropertyTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import Create from './modals/AssetCreate';
|
||||
import AssetCreate from './modals/AssetCreate';
|
||||
|
||||
export default function Index({ title = '项目管理' }) {
|
||||
const navigate = useNavigate();
|
||||
@ -30,7 +31,7 @@ export default function Index({ title = '项目管理' }) {
|
||||
}
|
||||
// headerTitle="项目列表"
|
||||
toolBarRender={(action) => [
|
||||
<Create key="Create" reload={action?.reload} title={'项目'} />,
|
||||
<AssetCreate key="Create" reload={action?.reload} title={'项目'} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
@ -101,6 +102,14 @@ export default function Index({ title = '项目管理' }) {
|
||||
navigate(`/asset/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyImportModal
|
||||
key="ImportHouse"
|
||||
params={{ asset_projects_id: item?.id }}
|
||||
title="批量导入"
|
||||
templateApi={Apis.Asset.AssetHouses.DownloadTemplate}
|
||||
importApi={Apis.Asset.AssetHouses.Import}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
|
||||
@ -27,10 +27,14 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
form.setFieldsValue({
|
||||
companies_id: props?.item?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
|
||||
@ -6,7 +6,6 @@ import {
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Address } from '@/components/Address';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
@ -66,12 +65,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title: '项目别名',
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
// Selects?.Companies({
|
||||
// key: 'companies_id',
|
||||
// title: '所属机构',
|
||||
// colProps: { span: 24 },
|
||||
// formItemProps: { ...rulesHelper.number },
|
||||
// }),
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
|
||||
@ -8,7 +8,6 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
@ -92,12 +91,12 @@ export default function Index({ title = '房屋列表' }) {
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetHousesStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '房屋状态',
|
||||
// dataIndex: 'status',
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
dataIndex: 'ownership_type',
|
||||
@ -105,14 +104,14 @@ export default function Index({ title = '房屋列表' }) {
|
||||
search: false,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '产权年限',
|
||||
dataIndex: 'ownership_term',
|
||||
render(_, record) {
|
||||
return `${record?.ownership_term || '-'} 年`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
// {
|
||||
// title: '产权年限',
|
||||
// dataIndex: 'ownership_term',
|
||||
// render(_, record) {
|
||||
// return `${record?.ownership_term || '-'} 年`;
|
||||
// },
|
||||
// search: false,
|
||||
// },
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
|
||||
@ -14,7 +14,7 @@ import BannerCreate from './modals/BannerCreate';
|
||||
import BannerShow from './modals/BannerShow';
|
||||
import BannerUpdate from './modals/BannerUpdate';
|
||||
|
||||
export default function Index({ title = '投放内容' }) {
|
||||
export default function Index({ title = '内容管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
|
||||
@ -13,7 +13,7 @@ import { Space } from 'antd';
|
||||
import BannerSpaceCreate from './modals/BannerSpaceCreate';
|
||||
import BannerSpaceUpdate from './modals/BannerSpaceUpdate';
|
||||
|
||||
export default function Index({ title = '投放位置' }) {
|
||||
export default function Index({ title = '点位管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
|
||||
@ -2,15 +2,17 @@ import { MyPageContainer, usePageTabs } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { Space, Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import Assets from './components/Assets';
|
||||
import CompanyApps from './components/CompanyApps';
|
||||
import ComponentsInfo from './components/ComponentsInfo';
|
||||
import Employees from './components/Employees';
|
||||
import Organizations from './components/Organizations';
|
||||
import Positions from './components/Positions';
|
||||
import Projects from './components/Projects';
|
||||
import ReceiptAccounts from './components/ReceiptAccounts';
|
||||
import CompanyUpdate from './modals/CompanyUpdate';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@ -19,7 +21,7 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
// 注册当前页面为标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `company-show-${id}`,
|
||||
tabLabel: data?.short_name || title || '资产详情',
|
||||
tabLabel: '配置:' + (data?.short_name || title || '资产详情'),
|
||||
});
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
@ -41,37 +43,37 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '项目管理',
|
||||
label: '1-项目配置',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: <Projects item={data} />,
|
||||
children: <Assets item={data} />,
|
||||
},
|
||||
{
|
||||
label: '组织管理',
|
||||
label: '2-组织配置',
|
||||
key: '2',
|
||||
closable: false,
|
||||
children: <Organizations item={data} />,
|
||||
},
|
||||
{
|
||||
label: '岗位管理',
|
||||
label: '3-岗位配置',
|
||||
key: '3',
|
||||
closable: false,
|
||||
children: <Positions item={data} />,
|
||||
},
|
||||
{
|
||||
label: '员工管理',
|
||||
label: '4-员工配置',
|
||||
key: '4',
|
||||
closable: false,
|
||||
children: <Employees item={data} />,
|
||||
},
|
||||
{
|
||||
label: '收款账号',
|
||||
label: '5-账号配置',
|
||||
key: '5',
|
||||
closable: false,
|
||||
children: <ReceiptAccounts item={data} />,
|
||||
},
|
||||
{
|
||||
label: '应用管理',
|
||||
label: '6-应用配置',
|
||||
key: '6',
|
||||
closable: false,
|
||||
children: <CompanyApps item={data} />,
|
||||
@ -79,7 +81,24 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ComponentsInfo item={data} />
|
||||
{/* <ComponentsInfo item={data} /> */}
|
||||
<ProCard
|
||||
title={`${data?.name} (${data?.short_name})`}
|
||||
extra={
|
||||
<Space>
|
||||
<ComponentsInfo
|
||||
item={{ ...data, type: 'primary' }}
|
||||
title="查看"
|
||||
reload={loadShow}
|
||||
/>
|
||||
<CompanyUpdate item={data} title="机构" reload={loadShow} />
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<div>
|
||||
* 您可在以下页签中对应配置:项目、组织、岗位、员工、账号、应用;
|
||||
</div>
|
||||
</ProCard>
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
|
||||
@ -9,6 +9,7 @@ import {
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import AssetCreate from '@/pages/asset/modals/AssetCreate';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@ -27,16 +28,16 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
Apis.Asset.AssetProjects.List,
|
||||
)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <OrganizationsCreate
|
||||
// key="Create"
|
||||
// reload={action?.reload}
|
||||
// item={props?.item}
|
||||
// title="组织"
|
||||
// />,
|
||||
// ]}
|
||||
toolBarRender={(action) => [
|
||||
<AssetCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
/>,
|
||||
]}
|
||||
// search={false}
|
||||
options={false}
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
@ -1,62 +1,69 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import CompanyUpdate from '../modals/CompanyUpdate';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="机构简称">
|
||||
{props?.item?.short_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构名称" span={2}>
|
||||
<Space>
|
||||
{props?.item?.name}
|
||||
<CompanyUpdate
|
||||
item={props?.item}
|
||||
title="机构"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="商户类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={CompaniesMerchantTypeEnum}
|
||||
value={props?.item?.merchant_type}
|
||||
key="merchant_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
type={props.item?.type || 'primary'}
|
||||
width="1000px"
|
||||
node={
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="机构简称">
|
||||
{props?.item?.short_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构名称" span={2}>
|
||||
<Space>
|
||||
{props?.item?.name}
|
||||
{/* <CompanyUpdate
|
||||
item={props?.item}
|
||||
title="机构"
|
||||
reload={props?.reload}
|
||||
/> */}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="商户类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={CompaniesMerchantTypeEnum}
|
||||
value={props?.item?.merchant_type}
|
||||
key="merchant_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="营业执照号" span={2}>
|
||||
{props?.item?.business_license_number}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="营业执照号" span={2}>
|
||||
{props?.item?.business_license_number}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="联系人姓名">
|
||||
{props?.item?.contact_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="联系人手机">
|
||||
{props?.item?.contact_phone}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="联系人邮箱">
|
||||
{props?.item?.contact_email}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构地址">
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
<ProDescriptions.Item label="联系人姓名">
|
||||
{props?.item?.contact_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="联系人手机">
|
||||
{props?.item?.contact_phone}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="联系人邮箱">
|
||||
{props?.item?.contact_email}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构地址">
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
/>,
|
||||
]}
|
||||
// search={false}
|
||||
options={false}
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.EnumTag({
|
||||
title: '组织类型',
|
||||
|
||||
@ -10,7 +10,9 @@ import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ComponentsInfo from './components/ComponentsInfo';
|
||||
import CompanyCreate from './modals/CompanyCreate';
|
||||
import CompanyUpdate from './modals/CompanyUpdate';
|
||||
|
||||
export default function Index({ title = '机构列表' }) {
|
||||
const navigate = useNavigate();
|
||||
@ -61,8 +63,18 @@ export default function Index({ title = '机构列表' }) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<ComponentsInfo
|
||||
item={item}
|
||||
title="查看"
|
||||
reload={action?.reload}
|
||||
/>
|
||||
<CompanyUpdate
|
||||
item={{ ...item, type: 'link' }}
|
||||
title="机构"
|
||||
reload={action?.reload}
|
||||
/>
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
title="配置"
|
||||
onClick={() => {
|
||||
navigate(`/company/${item.id}`);
|
||||
}}
|
||||
|
||||
@ -13,7 +13,6 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
HouseRegistersStatusEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
@ -57,17 +56,17 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueType: 'text',
|
||||
renderFormItem: () => (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard title="基本信息" size="small">
|
||||
<ProDescriptions bordered size="small" column={2}>
|
||||
<ProCard size="small">
|
||||
<ProDescriptions bordered size="small" column={1}>
|
||||
<ProDescriptions.Item label="房屋信息">
|
||||
{props?.item?.asset_house?.full_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
{/* <ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseRegistersHouseStatusEnum}
|
||||
value={props?.item?.house_status}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="登记类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseRegistersTypeEnum}
|
||||
|
||||
@ -1,243 +0,0 @@
|
||||
import React from 'react';
|
||||
import { Button, Card, Space, Divider, Row, Col, Statistic, Alert } from 'antd';
|
||||
import {
|
||||
PlusOutlined,
|
||||
UserOutlined,
|
||||
SettingOutlined,
|
||||
HomeOutlined,
|
||||
FileTextOutlined,
|
||||
TeamOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { MyPageContainer, usePageTabs } from '@/common';
|
||||
import { history } from '@umijs/max';
|
||||
|
||||
/**
|
||||
* 多标签页功能演示页面
|
||||
* 展示完整的标签页管理功能
|
||||
*/
|
||||
export default function TabsDemo() {
|
||||
const tabsApi = usePageTabs({
|
||||
tabKey: 'tabs-demo',
|
||||
tabLabel: '标签页演示',
|
||||
closable: false // 演示页面不可关闭
|
||||
});
|
||||
|
||||
// 模拟打开不同的页面标签
|
||||
const openTab = (key: string, label: string, path: string) => {
|
||||
tabsApi.addTab({
|
||||
key,
|
||||
label,
|
||||
path,
|
||||
closable: true
|
||||
});
|
||||
// 注意:在实际项目中,这里应该使用 history.push(path)
|
||||
// 由于这是演示,我们只是添加标签而不实际跳转
|
||||
console.log(`模拟跳转到: ${path}`);
|
||||
};
|
||||
|
||||
const demoTabs = [
|
||||
{
|
||||
key: 'employees',
|
||||
label: '员工管理',
|
||||
path: '/employees',
|
||||
icon: <TeamOutlined />,
|
||||
description: '管理公司员工信息'
|
||||
},
|
||||
{
|
||||
key: 'companies',
|
||||
label: '公司管理',
|
||||
path: '/company/companies',
|
||||
icon: <HomeOutlined />,
|
||||
description: '管理公司基本信息'
|
||||
},
|
||||
{
|
||||
key: 'house-bills',
|
||||
label: '房屋账单',
|
||||
path: '/house_bills',
|
||||
icon: <FileTextOutlined />,
|
||||
description: '查看和管理房屋账单'
|
||||
},
|
||||
{
|
||||
key: 'system-admins',
|
||||
label: '系统管理员',
|
||||
path: '/system/admins',
|
||||
icon: <UserOutlined />,
|
||||
description: '管理系统管理员账户'
|
||||
},
|
||||
{
|
||||
key: 'system-roles',
|
||||
label: '角色管理',
|
||||
path: '/system/sys_roles',
|
||||
icon: <SettingOutlined />,
|
||||
description: '管理系统角色权限'
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
enableTabs
|
||||
tabKey="tabs-demo"
|
||||
tabLabel="标签页演示"
|
||||
title="多标签页功能演示"
|
||||
>
|
||||
<Alert
|
||||
message="多标签页功能演示"
|
||||
description="这个页面展示了 MyPageContainer 的多标签页功能。您可以点击下方按钮打开新的标签页,然后右键点击标签体验各种操作。"
|
||||
type="info"
|
||||
showIcon
|
||||
style={{ marginBottom: 24 }}
|
||||
/>
|
||||
|
||||
{/* 统计信息 */}
|
||||
<Row gutter={16} style={{ marginBottom: 24 }}>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="当前标签数量"
|
||||
value={tabsApi.getTabs().length}
|
||||
prefix={<FileTextOutlined />}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="激活标签"
|
||||
value={tabsApi.getActiveKey()}
|
||||
valueStyle={{ fontSize: '16px' }}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="可用操作"
|
||||
value={6}
|
||||
suffix="种"
|
||||
prefix={<SettingOutlined />}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="演示页面"
|
||||
value={demoTabs.length}
|
||||
suffix="个"
|
||||
prefix={<PlusOutlined />}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{/* 快速打开标签页 */}
|
||||
<Card title="🚀 快速打开页面" style={{ marginBottom: 24 }}>
|
||||
<Row gutter={[16, 16]}>
|
||||
{demoTabs.map(tab => (
|
||||
<Col span={8} key={tab.key}>
|
||||
<Card
|
||||
size="small"
|
||||
hoverable
|
||||
onClick={() => openTab(tab.key, tab.label, tab.path)}
|
||||
style={{ cursor: 'pointer', textAlign: 'center' }}
|
||||
>
|
||||
<div style={{ fontSize: '24px', marginBottom: '8px' }}>
|
||||
{tab.icon}
|
||||
</div>
|
||||
<div style={{ fontWeight: 'bold', marginBottom: '4px' }}>
|
||||
{tab.label}
|
||||
</div>
|
||||
<div style={{ fontSize: '12px', color: '#666' }}>
|
||||
{tab.description}
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
{/* 标签页操作 */}
|
||||
<Card title="🎛️ 标签页操作" style={{ marginBottom: 24 }}>
|
||||
<Space wrap size="middle">
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => tabsApi.closeOtherTabs()}
|
||||
disabled={tabsApi.getTabs().length <= 1}
|
||||
>
|
||||
关闭其他标签
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={() => tabsApi.closeLeftTabs()}
|
||||
disabled={tabsApi.getTabs().length <= 1}
|
||||
>
|
||||
关闭左侧标签
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={() => tabsApi.closeRightTabs()}
|
||||
disabled={tabsApi.getTabs().length <= 1}
|
||||
>
|
||||
关闭右侧标签
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={() => tabsApi.refreshTab()}
|
||||
>
|
||||
刷新当前标签
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
danger
|
||||
onClick={() => {
|
||||
const tabs = tabsApi.getTabs();
|
||||
const closableTabs = tabs.filter(tab => tab.closable);
|
||||
closableTabs.forEach(tab => tabsApi.removeTab(tab.key));
|
||||
}}
|
||||
disabled={tabsApi.getTabs().filter(tab => tab.closable).length === 0}
|
||||
>
|
||||
关闭所有可关闭标签
|
||||
</Button>
|
||||
</Space>
|
||||
</Card>
|
||||
|
||||
{/* 功能说明 */}
|
||||
<Card title="📖 功能说明">
|
||||
<Row gutter={24}>
|
||||
<Col span={12}>
|
||||
<h4>🎯 核心功能</h4>
|
||||
<ul style={{ lineHeight: '1.8' }}>
|
||||
<li><strong>多标签页支持</strong>:支持同时打开多个页面标签</li>
|
||||
<li><strong>右键菜单</strong>:右键点击标签页显示操作菜单</li>
|
||||
<li><strong>智能导航</strong>:关闭标签时自动切换到相邻标签</li>
|
||||
<li><strong>状态持久化</strong>:标签页状态在组件间共享</li>
|
||||
<li><strong>自定义样式</strong>:支持主题定制和样式覆盖</li>
|
||||
</ul>
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<h4>🖱️ 右键菜单操作</h4>
|
||||
<ul style={{ lineHeight: '1.8' }}>
|
||||
<li><strong>刷新</strong>:重新加载当前标签页</li>
|
||||
<li><strong>关闭</strong>:关闭当前标签页</li>
|
||||
<li><strong>关闭其他</strong>:关闭除当前标签外的所有标签</li>
|
||||
<li><strong>关闭左侧</strong>:关闭当前标签左侧的所有标签</li>
|
||||
<li><strong>关闭右侧</strong>:关闭当前标签右侧的所有标签</li>
|
||||
</ul>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Divider />
|
||||
|
||||
<h4>💡 使用提示</h4>
|
||||
<ul style={{ lineHeight: '1.8' }}>
|
||||
<li>点击上方的页面卡片可以快速打开对应的标签页</li>
|
||||
<li>右键点击任意标签页可以看到完整的操作菜单</li>
|
||||
<li>使用工具栏按钮可以批量操作标签页</li>
|
||||
<li>演示页面(当前页面)被设置为不可关闭</li>
|
||||
<li>在实际项目中,标签页会自动与路由系统集成</li>
|
||||
</ul>
|
||||
</Card>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user