diff --git a/.umirc.ts b/.umirc.ts index 4edb548..9539141 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -16,6 +16,7 @@ export default defineConfig({ '/api/': { // target: 'http://yt:8003', target: 'http://10.39.13.80:8001', + // target: 'https://weapp-api.linyikj.com.cn/', // target: 'http://we6f9c65.natappfree.cc', // target: 'https://loanos-test.nchl.net/', changeOrigin: true, diff --git a/src/common/components/MyButtons.tsx b/src/common/components/MyButtons.tsx index 951028a..86a4e81 100644 --- a/src/common/components/MyButtons.tsx +++ b/src/common/components/MyButtons.tsx @@ -49,14 +49,14 @@ export const MyButtons = { }, View({ title, ...rest }: MyButtonsType): JSX.Element { return ( - ); }, Edit({ title = '编辑', ...rest }: MyButtonsType): JSX.Element { return ( - ); diff --git a/src/common/components/layout/MyImportModal.tsx b/src/common/components/layout/MyImportModal.tsx index 07ee28e..9685dc6 100644 --- a/src/common/components/layout/MyImportModal.tsx +++ b/src/common/components/layout/MyImportModal.tsx @@ -54,7 +54,10 @@ export function MyImportModal(props: MyImportModalType) { }); }} confirmLoading={loading} - destroyOnClose={true} + // 使用 destroyOnClose 已弃用,建议使用 afterClose 处理清理逻辑 + afterClose={() => { + setFormData(undefined); + }} maskClosable={false} footer={(dom) => { return ( diff --git a/src/components/MyModal.tsx b/src/components/MyModal.tsx index 671d149..3daae85 100644 --- a/src/components/MyModal.tsx +++ b/src/components/MyModal.tsx @@ -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) { ) : ( setOpen(true)} /> )} diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 969daac..2b3f86c 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -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] }; diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 3b32f20..acf3f0d 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -96,6 +96,12 @@ export const Apis = { Select(data?: ApiTypes.Asset.AssetHouses.Select): Promise { return request('admin/asset/asset_houses/select', { data }); }, + Import(data?: ApiTypes.Asset.AssetHouses.Import): Promise { + return request('admin/asset/asset_houses/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/asset/asset_houses/download_template', {responseType: 'blob',}); + }, }, AssetProjects: { List(data?: ApiTypes.Asset.AssetProjects.List): Promise { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index ccd2165..bca742a 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -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 diff --git a/src/pages/archive/components/OccupantsNow.tsx b/src/pages/archive/components/OccupantsNow.tsx index 2f93e0e..a77e6b1 100644 --- a/src/pages/archive/components/OccupantsNow.tsx +++ b/src/pages/archive/components/OccupantsNow.tsx @@ -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) => [ - , - , - , + !rest.item?.house_occupants?.length ? ( + '' + ) : ( + <> + + + + ), ]} search={false} columns={[ diff --git a/src/pages/archive/components/modals/AddOccupant.tsx b/src/pages/archive/components/modals/AddOccupant.tsx index 8f5c430..3e20db9 100644 --- a/src/pages/archive/components/modals/AddOccupant.tsx +++ b/src/pages/archive/components/modals/AddOccupant.tsx @@ -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 ( @@ -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) { @@ -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', diff --git a/src/pages/archive/index.tsx b/src/pages/archive/index.tsx index b98a51d..aa4734a 100644 --- a/src/pages/archive/index.tsx +++ b/src/pages/archive/index.tsx @@ -111,7 +111,7 @@ export default function Index({ title = '房屋档案' }) { render: (_, item: any, index, action) => ( { navigate(`/archive/${item.id}`); }} @@ -120,17 +120,10 @@ export default function Index({ title = '房屋档案' }) { ) : ( - { - navigate(`/archive/asset_house/${item.id}`); - }} - /> + '' )} ), diff --git a/src/pages/archive/modals/Delivery.tsx b/src/pages/archive/modals/Delivery.tsx index edcaecc..ecf078f 100644 --- a/src/pages/archive/modals/Delivery.tsx +++ b/src/pages/archive/modals/Delivery.tsx @@ -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 ( {...MyModalFormProps.props} - title={`添加${props.title}`} + title={`${props.title}`} wrapperCol={{ span: 24 }} width="800px" trigger={ - + } + 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', diff --git a/src/pages/asset/$id.tsx b/src/pages/asset/$id.tsx index 3b5dc9b..b73f1b1 100644 --- a/src/pages/asset/$id.tsx +++ b/src/pages/asset/$id.tsx @@ -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 ( - + loadShow()} /> diff --git a/src/pages/asset/components/AssetInfo.tsx b/src/pages/asset/components/AssetInfo.tsx index 0609bf5..cd38f5e 100644 --- a/src/pages/asset/components/AssetInfo.tsx +++ b/src/pages/asset/components/AssetInfo.tsx @@ -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 ( diff --git a/src/pages/asset/components/modals/HousesCreate.tsx b/src/pages/asset/components/modals/HousesCreate.tsx index 6e52104..fd2db6b 100644 --- a/src/pages/asset/components/modals/HousesCreate.tsx +++ b/src/pages/asset/components/modals/HousesCreate.tsx @@ -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 }, + // }, ]} /> ); diff --git a/src/pages/asset/components/modals/HousesUpdate.tsx b/src/pages/asset/components/modals/HousesUpdate.tsx index d78e434..8584567 100644 --- a/src/pages/asset/components/modals/HousesUpdate.tsx +++ b/src/pages/asset/components/modals/HousesUpdate.tsx @@ -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={ - + } 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; + // }, + // }), ]} /> ); diff --git a/src/pages/asset/index.tsx b/src/pages/asset/index.tsx index 915de63..790b414 100644 --- a/src/pages/asset/index.tsx +++ b/src/pages/asset/index.tsx @@ -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) => [ - , + , ]} columns={[ MyColumns.ID(), @@ -101,6 +102,14 @@ export default function Index({ title = '项目管理' }) { navigate(`/asset/${item.id}`); }} /> + Apis.Common.Admins.Delete({ id: item.id }).then(() => diff --git a/src/pages/asset/modals/AssetCreate.tsx b/src/pages/asset/modals/AssetCreate.tsx index eac36f7..f510b83 100644 --- a/src/pages/asset/modals/AssetCreate.tsx +++ b/src/pages/asset/modals/AssetCreate.tsx @@ -27,10 +27,14 @@ export default function Create(props: MyBetaModalFormProps) { wrapperCol={{ span: 24 }} width="600px" trigger={} + key={new Date().getTime()} form={form} onOpenChange={(open: any) => { if (open) { form.resetFields(); // 清空表单数据 + form.setFieldsValue({ + companies_id: props?.item?.id, + }); } }} onFinish={async (values) => diff --git a/src/pages/asset/modals/AssetUpdate.tsx b/src/pages/asset/modals/AssetUpdate.tsx index 542ad78..3f7faba 100644 --- a/src/pages/asset/modals/AssetUpdate.tsx +++ b/src/pages/asset/modals/AssetUpdate.tsx @@ -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: '选择地址', diff --git a/src/pages/asset_houses/index.tsx b/src/pages/asset_houses/index.tsx index a61ccd2..8d985b3 100644 --- a/src/pages/asset_houses/index.tsx +++ b/src/pages/asset_houses/index.tsx @@ -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) => ( diff --git a/src/pages/banner/index.tsx b/src/pages/banner/index.tsx index b63c5c8..6d61d9e 100644 --- a/src/pages/banner/index.tsx +++ b/src/pages/banner/index.tsx @@ -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(); // 注册当前页面为标签页 diff --git a/src/pages/banner_space/index.tsx b/src/pages/banner_space/index.tsx index f921bd1..8671939 100644 --- a/src/pages/banner_space/index.tsx +++ b/src/pages/banner_space/index.tsx @@ -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(); // 注册当前页面为标签页 diff --git a/src/pages/company/$id.tsx b/src/pages/company/$id.tsx index 01f9851..52d8e52 100644 --- a/src/pages/company/$id.tsx +++ b/src/pages/company/$id.tsx @@ -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: , + children: , }, { - label: '组织管理', + label: '2-组织配置', key: '2', closable: false, children: , }, { - label: '岗位管理', + label: '3-岗位配置', key: '3', closable: false, children: , }, { - label: '员工管理', + label: '4-员工配置', key: '4', closable: false, children: , }, { - label: '收款账号', + label: '5-账号配置', key: '5', closable: false, children: , }, { - label: '应用管理', + label: '6-应用配置', key: '6', closable: false, children: , @@ -79,7 +81,24 @@ export default function Show({ title }: { title?: string } = {}) { ]; return ( - + {/* */} + + + + + } + > +
+ * 您可在以下页签中对应配置:项目、组织、岗位、员工、账号、应用; +
+
diff --git a/src/pages/company/components/Projects.tsx b/src/pages/company/components/Assets.tsx similarity index 88% rename from src/pages/company/components/Projects.tsx rename to src/pages/company/components/Assets.tsx index cf2e441..e20111a 100644 --- a/src/pages/company/components/Projects.tsx +++ b/src/pages/company/components/Assets.tsx @@ -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) => [ - // , - // ]} + toolBarRender={(action) => [ + , + ]} // search={false} - options={false} + // options={false} columns={[ MyColumns.ID(), { diff --git a/src/pages/company/components/ComponentsInfo.tsx b/src/pages/company/components/ComponentsInfo.tsx index 109270c..ced50f0 100644 --- a/src/pages/company/components/ComponentsInfo.tsx +++ b/src/pages/company/components/ComponentsInfo.tsx @@ -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 ( - - - - - {props?.item?.short_name} - - - - {props?.item?.name} - - - - - - + + + + + {props?.item?.short_name} + + + + {props?.item?.name} + {/* */} + + + + + - - {props?.item?.business_license_number} - + + {props?.item?.business_license_number} + - - {props?.item?.contact_name} - - - {props?.item?.contact_phone} - - - {props?.item?.contact_email} - - - {props?.item?.province || ''} - {props?.item?.city || ''} - {props?.item?.district || ''} - {props?.item?.address || ''} - - - {props?.item?.created_at} - - - {props?.item?.updated_at} - - - - + + {props?.item?.contact_name} + + + {props?.item?.contact_phone} + + + {props?.item?.contact_email} + + + {props?.item?.province || ''} + {props?.item?.city || ''} + {props?.item?.district || ''} + {props?.item?.address || ''} + + + {props?.item?.created_at} + + + {props?.item?.updated_at} + + +
+ + } + /> ); } diff --git a/src/pages/company/components/Organizations.tsx b/src/pages/company/components/Organizations.tsx index bbfe981..83c3b43 100644 --- a/src/pages/company/components/Organizations.tsx +++ b/src/pages/company/components/Organizations.tsx @@ -33,7 +33,7 @@ export default function Organizations(props: MyBetaModalFormProps) { />, ]} // search={false} - options={false} + // options={false} columns={[ MyColumns.EnumTag({ title: '组织类型', diff --git a/src/pages/company/index.tsx b/src/pages/company/index.tsx index 47d2690..2238d82 100644 --- a/src/pages/company/index.tsx +++ b/src/pages/company/index.tsx @@ -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) => ( + + { navigate(`/company/${item.id}`); }} diff --git a/src/pages/examine/house_registers_audit/modals/Audit.tsx b/src/pages/examine/house_registers_audit/modals/Audit.tsx index 43bf235..af1d819 100644 --- a/src/pages/examine/house_registers_audit/modals/Audit.tsx +++ b/src/pages/examine/house_registers_audit/modals/Audit.tsx @@ -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: () => ( - - + + {props?.item?.asset_house?.full_name || '-'} - + {/* - + */} { - tabsApi.addTab({ - key, - label, - path, - closable: true - }); - // 注意:在实际项目中,这里应该使用 history.push(path) - // 由于这是演示,我们只是添加标签而不实际跳转 - console.log(`模拟跳转到: ${path}`); - }; - - const demoTabs = [ - { - key: 'employees', - label: '员工管理', - path: '/employees', - icon: , - description: '管理公司员工信息' - }, - { - key: 'companies', - label: '公司管理', - path: '/company/companies', - icon: , - description: '管理公司基本信息' - }, - { - key: 'house-bills', - label: '房屋账单', - path: '/house_bills', - icon: , - description: '查看和管理房屋账单' - }, - { - key: 'system-admins', - label: '系统管理员', - path: '/system/admins', - icon: , - description: '管理系统管理员账户' - }, - { - key: 'system-roles', - label: '角色管理', - path: '/system/sys_roles', - icon: , - description: '管理系统角色权限' - } - ]; - - return ( - - - - {/* 统计信息 */} - - - - } - /> - - - - - - - - - - } - /> - - - - - } - /> - - - - - {/* 快速打开标签页 */} - - - {demoTabs.map(tab => ( - - openTab(tab.key, tab.label, tab.path)} - style={{ cursor: 'pointer', textAlign: 'center' }} - > -
- {tab.icon} -
-
- {tab.label} -
-
- {tab.description} -
-
- - ))} -
-
- - {/* 标签页操作 */} - - - - - - - - - - - - - - - {/* 功能说明 */} - - - -

🎯 核心功能

-
    -
  • 多标签页支持:支持同时打开多个页面标签
  • -
  • 右键菜单:右键点击标签页显示操作菜单
  • -
  • 智能导航:关闭标签时自动切换到相邻标签
  • -
  • 状态持久化:标签页状态在组件间共享
  • -
  • 自定义样式:支持主题定制和样式覆盖
  • -
- - - -

🖱️ 右键菜单操作

-
    -
  • 刷新:重新加载当前标签页
  • -
  • 关闭:关闭当前标签页
  • -
  • 关闭其他:关闭除当前标签外的所有标签
  • -
  • 关闭左侧:关闭当前标签左侧的所有标签
  • -
  • 关闭右侧:关闭当前标签右侧的所有标签
  • -
- -
- - - -

💡 使用提示

-
    -
  • 点击上方的页面卡片可以快速打开对应的标签页
  • -
  • 右键点击任意标签页可以看到完整的操作菜单
  • -
  • 使用工具栏按钮可以批量操作标签页
  • -
  • 演示页面(当前页面)被设置为不可关闭
  • -
  • 在实际项目中,标签页会自动与路由系统集成
  • -
-
-
- ); -} \ No newline at end of file