feat: 调整页面,增加广告相关内容
This commit is contained in:
parent
63f0756678
commit
9ff7f84432
@ -15,7 +15,7 @@ export default defineConfig({
|
||||
proxy: {
|
||||
'/api/': {
|
||||
// target: 'http://yt:8003',
|
||||
target: 'http://10.39.13.80:8006',
|
||||
target: 'http://10.39.13.80:8001',
|
||||
// target: 'http://we6f9c65.natappfree.cc',
|
||||
// target: 'https://loanos-test.nchl.net/',
|
||||
changeOrigin: true,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"url": "http://10.39.13.80:8006/api/docs/openapi",
|
||||
"url": "http://10.39.13.80:8001/api/docs/openapi",
|
||||
"module": "Admin"
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import {
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
EyeOutlined,
|
||||
PlusOutlined,
|
||||
RollbackOutlined,
|
||||
SaveFilled,
|
||||
@ -23,7 +22,7 @@ export const MyButtons = {
|
||||
onConfirm,
|
||||
isConfirm,
|
||||
title,
|
||||
description = '确定要取消?',
|
||||
description = '是否确定取消?',
|
||||
...rest
|
||||
}: {
|
||||
onConfirm?: () => void;
|
||||
@ -50,7 +49,7 @@ export const MyButtons = {
|
||||
},
|
||||
View({ title, ...rest }: MyButtonsType): JSX.Element {
|
||||
return (
|
||||
<Button type="link" size="small" icon={<EyeOutlined />} {...rest}>
|
||||
<Button type="link" size="small" {...rest}>
|
||||
{title ?? '查看'}
|
||||
</Button>
|
||||
);
|
||||
@ -77,7 +76,7 @@ export const MyButtons = {
|
||||
return (
|
||||
<Popconfirm
|
||||
title="删除提示"
|
||||
description="是否确定要删除,将不可恢复?"
|
||||
description="是否确定永久删除?"
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={onConfirm}
|
||||
|
||||
@ -1,42 +1,132 @@
|
||||
import {
|
||||
AliwangwangFilled,
|
||||
AndroidFilled,
|
||||
AppleFilled,
|
||||
AppstoreFilled,
|
||||
ApiOutlined,
|
||||
AreaChartOutlined,
|
||||
AudioOutlined,
|
||||
AuditOutlined,
|
||||
BankFilled,
|
||||
BankOutlined,
|
||||
BarChartOutlined,
|
||||
BarcodeOutlined,
|
||||
BellFilled,
|
||||
ChromeFilled,
|
||||
BellOutlined,
|
||||
BookOutlined,
|
||||
BugOutlined,
|
||||
BuildOutlined,
|
||||
BulbOutlined,
|
||||
// 时间图标
|
||||
CalendarOutlined,
|
||||
CameraOutlined,
|
||||
CarOutlined,
|
||||
CheckOutlined,
|
||||
ClockCircleOutlined,
|
||||
CloseOutlined,
|
||||
CloudOutlined,
|
||||
ClusterOutlined,
|
||||
CodeOutlined,
|
||||
CompassOutlined,
|
||||
ControlOutlined,
|
||||
CopyOutlined,
|
||||
CreditCardOutlined,
|
||||
CustomerServiceFilled,
|
||||
FolderOpenFilled,
|
||||
HeartFilled,
|
||||
HomeFilled,
|
||||
HourglassFilled,
|
||||
IeSquareFilled,
|
||||
NotificationFilled,
|
||||
OpenAIFilled,
|
||||
ReadFilled,
|
||||
RocketFilled,
|
||||
SafetyCertificateFilled,
|
||||
ScheduleFilled,
|
||||
SettingFilled,
|
||||
CrownOutlined,
|
||||
DashboardOutlined,
|
||||
DatabaseOutlined,
|
||||
DeleteOutlined,
|
||||
DesktopOutlined,
|
||||
DisconnectOutlined,
|
||||
// 财务图标
|
||||
DollarOutlined,
|
||||
// PrintOutlined, // 不存在,使用 PrinterOutlined 替代
|
||||
DownloadOutlined,
|
||||
DownOutlined,
|
||||
EditOutlined,
|
||||
// 地图图标
|
||||
EnvironmentOutlined,
|
||||
EuroOutlined,
|
||||
ExclamationCircleOutlined,
|
||||
ExperimentOutlined,
|
||||
EyeInvisibleOutlined,
|
||||
EyeOutlined,
|
||||
FileExcelOutlined,
|
||||
FileImageOutlined,
|
||||
FileOutlined,
|
||||
FilePdfOutlined,
|
||||
FileTextOutlined,
|
||||
FileWordOutlined,
|
||||
// 其他常用图标
|
||||
FireOutlined,
|
||||
FlagOutlined,
|
||||
// 文档图标
|
||||
FolderOutlined,
|
||||
FundOutlined,
|
||||
GiftOutlined,
|
||||
GlobalOutlined,
|
||||
HeartOutlined,
|
||||
HistoryOutlined,
|
||||
// 常用系统图标
|
||||
HomeOutlined,
|
||||
IdcardOutlined,
|
||||
InfoCircleOutlined,
|
||||
KeyOutlined,
|
||||
LaptopOutlined,
|
||||
LeftOutlined,
|
||||
LikeOutlined,
|
||||
LineChartOutlined,
|
||||
LinkOutlined,
|
||||
// 状态图标
|
||||
LoadingOutlined,
|
||||
LockOutlined,
|
||||
// 通信图标
|
||||
MailOutlined,
|
||||
// 导航图标
|
||||
MenuOutlined,
|
||||
MessageOutlined,
|
||||
// 设备图标
|
||||
MobileOutlined,
|
||||
NotificationOutlined,
|
||||
PauseCircleOutlined,
|
||||
PayCircleOutlined,
|
||||
PhoneOutlined,
|
||||
// 媒体图标
|
||||
PictureOutlined,
|
||||
// 图表图标
|
||||
PieChartOutlined,
|
||||
PlayCircleOutlined,
|
||||
PlusOutlined,
|
||||
PoundOutlined,
|
||||
PrinterOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReadOutlined,
|
||||
ReloadOutlined,
|
||||
RightOutlined,
|
||||
RocketOutlined,
|
||||
// 安全图标
|
||||
SafetyOutlined,
|
||||
// 操作图标
|
||||
SaveOutlined,
|
||||
SearchOutlined,
|
||||
SecurityScanOutlined,
|
||||
SettingOutlined,
|
||||
ShopFilled,
|
||||
ShareAltOutlined,
|
||||
ShopOutlined,
|
||||
StarFilled,
|
||||
TruckFilled,
|
||||
TwitchFilled,
|
||||
UnlockFilled,
|
||||
// 商业图标
|
||||
ShoppingCartOutlined,
|
||||
StarOutlined,
|
||||
StockOutlined,
|
||||
SyncOutlined,
|
||||
TabletOutlined,
|
||||
TagOutlined,
|
||||
TagsOutlined,
|
||||
TeamOutlined,
|
||||
ThunderboltOutlined,
|
||||
// 工具图标
|
||||
ToolOutlined,
|
||||
TrophyOutlined,
|
||||
UnlockOutlined,
|
||||
UploadOutlined,
|
||||
UpOutlined,
|
||||
UserOutlined,
|
||||
WalletFilled,
|
||||
WindowsFilled,
|
||||
YoutubeFilled,
|
||||
VideoCameraOutlined,
|
||||
WalletOutlined,
|
||||
// 网络图标
|
||||
WifiOutlined,
|
||||
} from '@ant-design/icons';
|
||||
|
||||
export type MyIconsType =
|
||||
@ -49,7 +139,125 @@ export type MyIconsType =
|
||||
| 'ClusterOutlined'
|
||||
| 'BankOutlined'
|
||||
| 'UserOutlined'
|
||||
| 'CreditCardOutlined';
|
||||
| 'CreditCardOutlined'
|
||||
// 常用系统图标
|
||||
| 'HomeOutlined'
|
||||
| 'DashboardOutlined'
|
||||
| 'FileOutlined'
|
||||
| 'EditOutlined'
|
||||
| 'DeleteOutlined'
|
||||
| 'SearchOutlined'
|
||||
| 'PlusOutlined'
|
||||
| 'CloseOutlined'
|
||||
| 'CheckOutlined'
|
||||
| 'ExclamationCircleOutlined'
|
||||
| 'InfoCircleOutlined'
|
||||
| 'QuestionCircleOutlined'
|
||||
// 导航图标
|
||||
| 'MenuOutlined'
|
||||
| 'LeftOutlined'
|
||||
| 'RightOutlined'
|
||||
| 'UpOutlined'
|
||||
| 'DownOutlined'
|
||||
// 操作图标
|
||||
| 'SaveOutlined'
|
||||
| 'CopyOutlined'
|
||||
// | 'PrintOutlined' // 不存在,使用 PrinterOutlined 替代
|
||||
| 'DownloadOutlined'
|
||||
| 'UploadOutlined'
|
||||
| 'ShareAltOutlined'
|
||||
// 状态图标
|
||||
| 'LoadingOutlined'
|
||||
| 'SyncOutlined'
|
||||
| 'ReloadOutlined'
|
||||
| 'LockOutlined'
|
||||
| 'UnlockOutlined'
|
||||
| 'EyeOutlined'
|
||||
| 'EyeInvisibleOutlined'
|
||||
// 通信图标
|
||||
| 'MailOutlined'
|
||||
| 'PhoneOutlined'
|
||||
| 'MessageOutlined'
|
||||
| 'NotificationOutlined'
|
||||
| 'BellOutlined'
|
||||
// 文档图标
|
||||
| 'FolderOutlined'
|
||||
| 'FileTextOutlined'
|
||||
| 'FilePdfOutlined'
|
||||
| 'FileExcelOutlined'
|
||||
| 'FileWordOutlined'
|
||||
| 'FileImageOutlined'
|
||||
// 媒体图标
|
||||
| 'PictureOutlined'
|
||||
| 'VideoCameraOutlined'
|
||||
| 'AudioOutlined'
|
||||
| 'PlayCircleOutlined'
|
||||
| 'PauseCircleOutlined'
|
||||
// 工具图标
|
||||
| 'ToolOutlined'
|
||||
| 'BugOutlined'
|
||||
| 'CodeOutlined'
|
||||
| 'ApiOutlined'
|
||||
| 'DatabaseOutlined'
|
||||
| 'CloudOutlined'
|
||||
// 商业图标
|
||||
| 'ShoppingCartOutlined'
|
||||
| 'GiftOutlined'
|
||||
| 'TrophyOutlined'
|
||||
| 'StarOutlined'
|
||||
| 'HeartOutlined'
|
||||
| 'LikeOutlined'
|
||||
// 时间图标
|
||||
| 'CalendarOutlined'
|
||||
| 'ClockCircleOutlined'
|
||||
| 'HistoryOutlined'
|
||||
// 地图图标
|
||||
| 'EnvironmentOutlined'
|
||||
| 'GlobalOutlined'
|
||||
| 'CompassOutlined'
|
||||
// 设备图标
|
||||
| 'MobileOutlined'
|
||||
| 'TabletOutlined'
|
||||
| 'LaptopOutlined'
|
||||
| 'DesktopOutlined'
|
||||
| 'PrinterOutlined'
|
||||
| 'CameraOutlined'
|
||||
// 安全图标
|
||||
| 'SafetyOutlined'
|
||||
| 'SecurityScanOutlined'
|
||||
| 'KeyOutlined'
|
||||
| 'TeamOutlined'
|
||||
| 'IdcardOutlined'
|
||||
// 财务图标
|
||||
| 'DollarOutlined'
|
||||
| 'EuroOutlined'
|
||||
| 'PoundOutlined'
|
||||
| 'PayCircleOutlined'
|
||||
| 'WalletOutlined'
|
||||
// 图表图标
|
||||
| 'PieChartOutlined'
|
||||
| 'LineChartOutlined'
|
||||
| 'AreaChartOutlined'
|
||||
| 'FundOutlined'
|
||||
| 'StockOutlined'
|
||||
// 网络图标
|
||||
| 'WifiOutlined'
|
||||
| 'DisconnectOutlined'
|
||||
| 'LinkOutlined'
|
||||
// 其他常用图标
|
||||
| 'FireOutlined'
|
||||
| 'ThunderboltOutlined'
|
||||
| 'BulbOutlined'
|
||||
| 'RocketOutlined'
|
||||
| 'CrownOutlined'
|
||||
| 'FlagOutlined'
|
||||
| 'TagOutlined'
|
||||
| 'TagsOutlined'
|
||||
| 'BookOutlined'
|
||||
| 'ReadOutlined'
|
||||
| 'ExperimentOutlined'
|
||||
| 'BuildOutlined'
|
||||
| 'CarOutlined';
|
||||
|
||||
export const MyIcons = {
|
||||
BarcodeOutlined: <BarcodeOutlined />,
|
||||
@ -62,32 +270,122 @@ export const MyIcons = {
|
||||
BankOutlined: <BankOutlined />,
|
||||
UserOutlined: <UserOutlined />,
|
||||
CreditCardOutlined: <CreditCardOutlined />,
|
||||
AndroidFilled: <AndroidFilled />,
|
||||
AppleFilled: <AppleFilled />,
|
||||
WindowsFilled: <WindowsFilled />,
|
||||
ChromeFilled: <ChromeFilled />,
|
||||
AliwangwangFilled: <AliwangwangFilled />,
|
||||
OpenAIFilled: <OpenAIFilled />,
|
||||
TwitchFilled: <TwitchFilled />,
|
||||
YoutubeFilled: <YoutubeFilled />,
|
||||
HeartFilled: <HeartFilled />,
|
||||
IeSquareFilled: <IeSquareFilled />,
|
||||
TruckFilled: <TruckFilled />,
|
||||
UnlockFilled: <UnlockFilled />,
|
||||
AppstoreFilled: <AppstoreFilled />,
|
||||
BellFilled: <BellFilled />,
|
||||
CustomerServiceFilled: <CustomerServiceFilled />,
|
||||
WalletFilled: <WalletFilled />,
|
||||
StarFilled: <StarFilled />,
|
||||
SafetyCertificateFilled: <SafetyCertificateFilled />,
|
||||
FolderOpenFilled: <FolderOpenFilled />,
|
||||
ScheduleFilled: <ScheduleFilled />,
|
||||
HourglassFilled: <HourglassFilled />,
|
||||
BankFilled: <BankFilled />,
|
||||
ShopFilled: <ShopFilled />,
|
||||
HomeFilled: <HomeFilled />,
|
||||
SettingFilled: <SettingFilled />,
|
||||
ReadFilled: <ReadFilled />,
|
||||
RocketFilled: <RocketFilled />,
|
||||
NotificationFilled: <NotificationFilled />,
|
||||
// 常用系统图标
|
||||
HomeOutlined: <HomeOutlined />,
|
||||
DashboardOutlined: <DashboardOutlined />,
|
||||
FileOutlined: <FileOutlined />,
|
||||
EditOutlined: <EditOutlined />,
|
||||
DeleteOutlined: <DeleteOutlined />,
|
||||
SearchOutlined: <SearchOutlined />,
|
||||
PlusOutlined: <PlusOutlined />,
|
||||
CloseOutlined: <CloseOutlined />,
|
||||
CheckOutlined: <CheckOutlined />,
|
||||
ExclamationCircleOutlined: <ExclamationCircleOutlined />,
|
||||
InfoCircleOutlined: <InfoCircleOutlined />,
|
||||
QuestionCircleOutlined: <QuestionCircleOutlined />,
|
||||
// 导航图标
|
||||
MenuOutlined: <MenuOutlined />,
|
||||
LeftOutlined: <LeftOutlined />,
|
||||
RightOutlined: <RightOutlined />,
|
||||
UpOutlined: <UpOutlined />,
|
||||
DownOutlined: <DownOutlined />,
|
||||
// 操作图标
|
||||
SaveOutlined: <SaveOutlined />,
|
||||
CopyOutlined: <CopyOutlined />,
|
||||
// PrintOutlined: <PrintOutlined />, // 不存在,使用 PrinterOutlined 替代
|
||||
DownloadOutlined: <DownloadOutlined />,
|
||||
UploadOutlined: <UploadOutlined />,
|
||||
ShareAltOutlined: <ShareAltOutlined />,
|
||||
// 状态图标
|
||||
LoadingOutlined: <LoadingOutlined />,
|
||||
SyncOutlined: <SyncOutlined />,
|
||||
ReloadOutlined: <ReloadOutlined />,
|
||||
LockOutlined: <LockOutlined />,
|
||||
UnlockOutlined: <UnlockOutlined />,
|
||||
EyeOutlined: <EyeOutlined />,
|
||||
EyeInvisibleOutlined: <EyeInvisibleOutlined />,
|
||||
// 通信图标
|
||||
MailOutlined: <MailOutlined />,
|
||||
PhoneOutlined: <PhoneOutlined />,
|
||||
MessageOutlined: <MessageOutlined />,
|
||||
NotificationOutlined: <NotificationOutlined />,
|
||||
BellOutlined: <BellOutlined />,
|
||||
// 文档图标
|
||||
FolderOutlined: <FolderOutlined />,
|
||||
FileTextOutlined: <FileTextOutlined />,
|
||||
FilePdfOutlined: <FilePdfOutlined />,
|
||||
FileExcelOutlined: <FileExcelOutlined />,
|
||||
FileWordOutlined: <FileWordOutlined />,
|
||||
FileImageOutlined: <FileImageOutlined />,
|
||||
// 媒体图标
|
||||
PictureOutlined: <PictureOutlined />,
|
||||
VideoCameraOutlined: <VideoCameraOutlined />,
|
||||
AudioOutlined: <AudioOutlined />,
|
||||
PlayCircleOutlined: <PlayCircleOutlined />,
|
||||
PauseCircleOutlined: <PauseCircleOutlined />,
|
||||
// 工具图标
|
||||
ToolOutlined: <ToolOutlined />,
|
||||
BugOutlined: <BugOutlined />,
|
||||
CodeOutlined: <CodeOutlined />,
|
||||
ApiOutlined: <ApiOutlined />,
|
||||
DatabaseOutlined: <DatabaseOutlined />,
|
||||
CloudOutlined: <CloudOutlined />,
|
||||
// 商业图标
|
||||
ShoppingCartOutlined: <ShoppingCartOutlined />,
|
||||
GiftOutlined: <GiftOutlined />,
|
||||
TrophyOutlined: <TrophyOutlined />,
|
||||
StarOutlined: <StarOutlined />,
|
||||
HeartOutlined: <HeartOutlined />,
|
||||
LikeOutlined: <LikeOutlined />,
|
||||
// 时间图标
|
||||
CalendarOutlined: <CalendarOutlined />,
|
||||
ClockCircleOutlined: <ClockCircleOutlined />,
|
||||
HistoryOutlined: <HistoryOutlined />,
|
||||
// 地图图标
|
||||
EnvironmentOutlined: <EnvironmentOutlined />,
|
||||
GlobalOutlined: <GlobalOutlined />,
|
||||
CompassOutlined: <CompassOutlined />,
|
||||
// 设备图标
|
||||
MobileOutlined: <MobileOutlined />,
|
||||
TabletOutlined: <TabletOutlined />,
|
||||
LaptopOutlined: <LaptopOutlined />,
|
||||
DesktopOutlined: <DesktopOutlined />,
|
||||
PrinterOutlined: <PrinterOutlined />,
|
||||
CameraOutlined: <CameraOutlined />,
|
||||
// 安全图标
|
||||
SafetyOutlined: <SafetyOutlined />,
|
||||
SecurityScanOutlined: <SecurityScanOutlined />,
|
||||
KeyOutlined: <KeyOutlined />,
|
||||
TeamOutlined: <TeamOutlined />,
|
||||
IdcardOutlined: <IdcardOutlined />,
|
||||
// 财务图标
|
||||
DollarOutlined: <DollarOutlined />,
|
||||
EuroOutlined: <EuroOutlined />,
|
||||
PoundOutlined: <PoundOutlined />,
|
||||
PayCircleOutlined: <PayCircleOutlined />,
|
||||
WalletOutlined: <WalletOutlined />,
|
||||
// 图表图标
|
||||
PieChartOutlined: <PieChartOutlined />,
|
||||
LineChartOutlined: <LineChartOutlined />,
|
||||
AreaChartOutlined: <AreaChartOutlined />,
|
||||
FundOutlined: <FundOutlined />,
|
||||
StockOutlined: <StockOutlined />,
|
||||
// 网络图标
|
||||
WifiOutlined: <WifiOutlined />,
|
||||
DisconnectOutlined: <DisconnectOutlined />,
|
||||
LinkOutlined: <LinkOutlined />,
|
||||
// 其他常用图标
|
||||
FireOutlined: <FireOutlined />,
|
||||
ThunderboltOutlined: <ThunderboltOutlined />,
|
||||
BulbOutlined: <BulbOutlined />,
|
||||
RocketOutlined: <RocketOutlined />,
|
||||
CrownOutlined: <CrownOutlined />,
|
||||
FlagOutlined: <FlagOutlined />,
|
||||
TagOutlined: <TagOutlined />,
|
||||
TagsOutlined: <TagsOutlined />,
|
||||
BookOutlined: <BookOutlined />,
|
||||
ReadOutlined: <ReadOutlined />,
|
||||
ExperimentOutlined: <ExperimentOutlined />,
|
||||
BuildOutlined: <BuildOutlined />,
|
||||
CarOutlined: <CarOutlined />,
|
||||
};
|
||||
|
||||
37
src/common/components/formFields/MyUploadImages.scss
Normal file
37
src/common/components/formFields/MyUploadImages.scss
Normal file
@ -0,0 +1,37 @@
|
||||
.my-upload-images {
|
||||
.ant-upload-list {
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
flex-wrap: wrap !important;
|
||||
gap: 8px !important;
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.ant-upload-list-item {
|
||||
margin: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.ant-upload-select {
|
||||
margin: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
// 针对文件类型的特殊样式
|
||||
&.ant-upload-list-text {
|
||||
.ant-upload-list-item {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
// 针对图片类型的特殊样式
|
||||
&.ant-upload-list-picture-card {
|
||||
.ant-upload-list-item {
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import { Button, Modal, Upload, UploadFile, UploadProps } from 'antd';
|
||||
import { RcFile } from 'antd/es/upload';
|
||||
import axios from 'axios';
|
||||
import { useSetState } from 'react-use';
|
||||
import './MyUploadImages.scss';
|
||||
|
||||
type MyType = {
|
||||
uploadType?: 'image' | 'video' | 'audio' | 'file';
|
||||
@ -120,6 +121,7 @@ export function MyUploadImages({
|
||||
onPreview={handlePreview}
|
||||
onChange={handleChange}
|
||||
customRequest={customRequest}
|
||||
className="my-upload-images"
|
||||
{...rest}
|
||||
>
|
||||
{!value?.length || (value && value.length < max) ? uploadButton : null}
|
||||
|
||||
@ -46,14 +46,54 @@ class TabsManager {
|
||||
addTab(tab: TabItem) {
|
||||
const existingIndex = this.tabs.findIndex((t) => t.key === tab.key);
|
||||
if (existingIndex === -1) {
|
||||
this.tabs.push(tab);
|
||||
// 如果是新标签页,插入到当前激活标签页的右边
|
||||
const currentActiveIndex = this.tabs.findIndex(
|
||||
(t) => t.key === this.activeKey,
|
||||
);
|
||||
if (currentActiveIndex !== -1) {
|
||||
// 在当前激活标签页的右边插入新标签页
|
||||
this.tabs.splice(currentActiveIndex + 1, 0, tab);
|
||||
} else {
|
||||
// 如果没有当前激活标签页,添加到末尾
|
||||
this.tabs.push(tab);
|
||||
}
|
||||
} else {
|
||||
// 如果标签页已存在,更新其信息
|
||||
this.tabs[existingIndex] = { ...this.tabs[existingIndex], ...tab };
|
||||
}
|
||||
this.activeKey = tab.key;
|
||||
this.notify();
|
||||
}
|
||||
|
||||
addTabNext(tab: TabItem) {
|
||||
const existingIndex = this.tabs.findIndex((t) => t.key === tab.key);
|
||||
if (existingIndex === -1) {
|
||||
// 强制在当前激活标签页的右边插入新标签页
|
||||
const currentActiveIndex = this.tabs.findIndex(
|
||||
(t) => t.key === this.activeKey,
|
||||
);
|
||||
if (currentActiveIndex !== -1) {
|
||||
this.tabs.splice(currentActiveIndex + 1, 0, tab);
|
||||
} else {
|
||||
this.tabs.push(tab);
|
||||
}
|
||||
} else {
|
||||
// 如果标签页已存在,移动到当前激活标签页的右边
|
||||
const existingTab = this.tabs[existingIndex];
|
||||
this.tabs.splice(existingIndex, 1); // 先移除原位置的标签页
|
||||
const currentActiveIndex = this.tabs.findIndex(
|
||||
(t) => t.key === this.activeKey,
|
||||
);
|
||||
if (currentActiveIndex !== -1) {
|
||||
this.tabs.splice(currentActiveIndex + 1, 0, { ...existingTab, ...tab });
|
||||
} else {
|
||||
this.tabs.push({ ...existingTab, ...tab });
|
||||
}
|
||||
}
|
||||
this.activeKey = tab.key;
|
||||
this.notify();
|
||||
}
|
||||
|
||||
removeTab(targetKey: string) {
|
||||
const targetIndex = this.tabs.findIndex((tab) => tab.key === targetKey);
|
||||
if (targetIndex === -1) return;
|
||||
|
||||
@ -24,6 +24,16 @@ export function TabsExample() {
|
||||
history.push(path);
|
||||
};
|
||||
|
||||
const handleAddTabNext = (key: string, label: string, path: string) => {
|
||||
tabsApi.addTabNext({
|
||||
key,
|
||||
label,
|
||||
path,
|
||||
closable: true,
|
||||
});
|
||||
history.push(path);
|
||||
};
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
enableTabs
|
||||
@ -58,6 +68,40 @@ export function TabsExample() {
|
||||
</Button>
|
||||
</Space>
|
||||
|
||||
<Divider orientation="left">在当前标签右侧打开新标签</Divider>
|
||||
|
||||
<Space wrap>
|
||||
<Button
|
||||
type="dashed"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() =>
|
||||
handleAddTabNext('company-1', '机构详情-1', '/company/1')
|
||||
}
|
||||
>
|
||||
打开机构详情-1(右侧)
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="dashed"
|
||||
icon={<UserOutlined />}
|
||||
onClick={() =>
|
||||
handleAddTabNext('employee-1', '员工详情-1', '/employee/1')
|
||||
}
|
||||
>
|
||||
打开员工详情-1(右侧)
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="dashed"
|
||||
icon={<SettingOutlined />}
|
||||
onClick={() =>
|
||||
handleAddTabNext('project-1', '项目详情-1', '/project/1')
|
||||
}
|
||||
>
|
||||
打开项目详情-1(右侧)
|
||||
</Button>
|
||||
</Space>
|
||||
|
||||
<Divider />
|
||||
|
||||
<Space wrap>
|
||||
@ -78,6 +122,10 @@ export function TabsExample() {
|
||||
<li>
|
||||
<strong>多标签页支持</strong>:支持同时打开多个页面标签
|
||||
</li>
|
||||
<li>
|
||||
<strong>智能标签插入</strong>
|
||||
:新标签页默认在当前激活标签页的右边插入
|
||||
</li>
|
||||
<li>
|
||||
<strong>右键菜单</strong>:右键点击标签页显示操作菜单
|
||||
</li>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useLocation } from '@umijs/max';
|
||||
import { useEffect } from 'react';
|
||||
import { tabsManager } from './MyPageContainer';
|
||||
|
||||
export interface UsePageTabsOptions {
|
||||
@ -16,6 +16,12 @@ export interface UsePageTabsOptions {
|
||||
/**
|
||||
* 页面标签页Hook
|
||||
* 用于简化页面标签页的管理
|
||||
*
|
||||
* 功能特性:
|
||||
* - 自动添加当前页面为标签页
|
||||
* - 新标签页默认在当前激活标签页的右边插入
|
||||
* - 支持标签页的增删改查操作
|
||||
* - 支持标签页位置管理(关闭左侧/右侧/其他标签页)
|
||||
*/
|
||||
export function usePageTabs(options: UsePageTabsOptions) {
|
||||
const location = useLocation();
|
||||
@ -27,56 +33,75 @@ export function usePageTabs(options: UsePageTabsOptions) {
|
||||
key: tabKey,
|
||||
label: tabLabel,
|
||||
path: location.pathname + location.search,
|
||||
closable
|
||||
closable,
|
||||
});
|
||||
}
|
||||
}, [tabKey, tabLabel, closable, autoAdd, location.pathname, location.search]);
|
||||
|
||||
return {
|
||||
/** 添加新标签页 */
|
||||
addTab: (tab: { key: string; label: string; path?: string; closable?: boolean }) => {
|
||||
addTab: (tab: {
|
||||
key: string;
|
||||
label: string;
|
||||
path?: string;
|
||||
closable?: boolean;
|
||||
}) => {
|
||||
tabsManager.addTab({
|
||||
...tab,
|
||||
path: tab.path || location.pathname + location.search,
|
||||
closable: tab.closable ?? true
|
||||
closable: tab.closable ?? true,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/** 在当前标签页右边添加新标签页 */
|
||||
addTabNext: (tab: {
|
||||
key: string;
|
||||
label: string;
|
||||
path?: string;
|
||||
closable?: boolean;
|
||||
}) => {
|
||||
tabsManager.addTabNext({
|
||||
...tab,
|
||||
path: tab.path || location.pathname + location.search,
|
||||
closable: tab.closable ?? true,
|
||||
});
|
||||
},
|
||||
|
||||
/** 关闭指定标签页 */
|
||||
removeTab: (key: string) => {
|
||||
tabsManager.removeTab(key);
|
||||
},
|
||||
|
||||
|
||||
/** 切换到指定标签页 */
|
||||
switchTab: (key: string) => {
|
||||
tabsManager.setActiveKey(key);
|
||||
},
|
||||
|
||||
|
||||
/** 关闭其他标签页 */
|
||||
closeOtherTabs: (currentKey?: string) => {
|
||||
tabsManager.closeOtherTabs(currentKey || tabKey);
|
||||
},
|
||||
|
||||
|
||||
/** 关闭左侧标签页 */
|
||||
closeLeftTabs: (currentKey?: string) => {
|
||||
tabsManager.closeLeftTabs(currentKey || tabKey);
|
||||
},
|
||||
|
||||
|
||||
/** 关闭右侧标签页 */
|
||||
closeRightTabs: (currentKey?: string) => {
|
||||
tabsManager.closeRightTabs(currentKey || tabKey);
|
||||
},
|
||||
|
||||
|
||||
/** 刷新标签页 */
|
||||
refreshTab: (key?: string) => {
|
||||
tabsManager.refreshTab(key || tabKey);
|
||||
},
|
||||
|
||||
|
||||
/** 获取当前所有标签页 */
|
||||
getTabs: () => tabsManager.getTabs(),
|
||||
|
||||
|
||||
/** 获取当前激活的标签页key */
|
||||
getActiveKey: () => tabsManager.getActiveKey()
|
||||
getActiveKey: () => tabsManager.getActiveKey(),
|
||||
};
|
||||
}
|
||||
|
||||
@ -88,6 +113,7 @@ export function useTabsManager() {
|
||||
return {
|
||||
tabsManager,
|
||||
addTab: tabsManager.addTab.bind(tabsManager),
|
||||
addTabNext: tabsManager.addTabNext.bind(tabsManager),
|
||||
removeTab: tabsManager.removeTab.bind(tabsManager),
|
||||
setActiveKey: tabsManager.setActiveKey.bind(tabsManager),
|
||||
closeOtherTabs: tabsManager.closeOtherTabs.bind(tabsManager),
|
||||
@ -95,6 +121,6 @@ export function useTabsManager() {
|
||||
closeRightTabs: tabsManager.closeRightTabs.bind(tabsManager),
|
||||
refreshTab: tabsManager.refreshTab.bind(tabsManager),
|
||||
getTabs: tabsManager.getTabs.bind(tabsManager),
|
||||
getActiveKey: tabsManager.getActiveKey.bind(tabsManager)
|
||||
getActiveKey: tabsManager.getActiveKey.bind(tabsManager),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { MyResponseType, renderTextHelper } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProColumns } from '@ant-design/pro-components';
|
||||
import { Image, Popconfirm, Tag } from 'antd';
|
||||
|
||||
@ -175,17 +174,7 @@ export const MyColumns = {
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
Companies(props?: ReturnType): ReturnType {
|
||||
return {
|
||||
title: '选择机构',
|
||||
valueType: 'select',
|
||||
hideInTable: true,
|
||||
key: 'companies_id',
|
||||
dataIndex: 'companies_id',
|
||||
request: async () => (await Apis.Company.Companies.Select()).data,
|
||||
...props,
|
||||
};
|
||||
},
|
||||
|
||||
Token({ ...rest }) {
|
||||
return {
|
||||
title: 'Token',
|
||||
@ -204,4 +193,39 @@ export const MyColumns = {
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
Ffdefault({
|
||||
Ffdefault,
|
||||
dataIndex,
|
||||
...rest
|
||||
}: {
|
||||
Ffdefault: (data: any) => Promise<MyResponseType>;
|
||||
dataIndex: any;
|
||||
} & ReturnType): ReturnType {
|
||||
return {
|
||||
title: '是否默认',
|
||||
renderText(text: boolean, record: any, index, action: any) {
|
||||
let form: any = { id: record.id };
|
||||
form[dataIndex] = record[dataIndex] ? 0 : 1;
|
||||
return (
|
||||
<Popconfirm
|
||||
title="提示"
|
||||
description="您确认要修改默认吗?"
|
||||
onConfirm={() => {
|
||||
Ffdefault?.(form).then(() => action?.reload());
|
||||
}}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Tag
|
||||
color={record[dataIndex] ? 'green' : 'gray'}
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
{record[dataIndex] ? '是' : '否'}
|
||||
</Tag>
|
||||
</Popconfirm>
|
||||
);
|
||||
},
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@ -58,11 +58,16 @@ export const MyFormItems = {
|
||||
UploadImages({
|
||||
max = 1,
|
||||
help,
|
||||
uploadType = 'image',
|
||||
...rest
|
||||
}: { max?: number; help?: string } & PropsType): ReturnType {
|
||||
}: {
|
||||
max?: number;
|
||||
help?: string;
|
||||
uploadType?: 'image' | 'file' | 'video' | 'audio' | undefined;
|
||||
} & PropsType): ReturnType {
|
||||
return {
|
||||
renderFormItem() {
|
||||
return <MyUploadImages max={max} />;
|
||||
return <MyUploadImages max={max} uploadType={uploadType} />;
|
||||
},
|
||||
formItemProps: {
|
||||
help,
|
||||
|
||||
@ -422,4 +422,39 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
//获取广告位
|
||||
GetBannerSpace(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '广告位',
|
||||
key = 'banner_spaces_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.Banner.BannerSpaces.Select({
|
||||
keywords: params?.KeyWords,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
...rest?.fieldProps,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
71
src/gen/ApiTypes.d.ts
vendored
71
src/gen/ApiTypes.d.ts
vendored
@ -61,6 +61,11 @@ declare namespace ApiTypes {
|
||||
"move_out_date"?: Date; // 搬离时间
|
||||
"apply_reason"?: string; // 搬离原因
|
||||
};
|
||||
type MoveIn = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
"move_in_date"?: Date; // 搬入时间
|
||||
"apply_reason"?: string; // 搬入原因
|
||||
};
|
||||
type RemoveOwner = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
};
|
||||
@ -291,6 +296,70 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Banner {
|
||||
namespace BannerSpaces {
|
||||
type List = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
};
|
||||
type Store = {
|
||||
"name": string; // 名称
|
||||
"remark"?: string; // 备注
|
||||
"type": string; // 类型,[enum:BannerSpacesTypeEnum]
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"name": string; // 名称
|
||||
"remark"?: string; // 备注
|
||||
"type": string; // 类型,[enum:BannerSpacesTypeEnum]
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
}
|
||||
namespace Banners {
|
||||
type List = {
|
||||
"banner_spaces_id"?: number; // 广告位id,[ref:banner_spaces]
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
};
|
||||
type Store = {
|
||||
"banner_spaces_id": number; // 广告位id,[ref:banner_spaces]
|
||||
"name": string; // 名称
|
||||
"sort"?: number; // 排序:越大越靠前
|
||||
"type": string; // 类型,[enum:BannersTypeEnum]
|
||||
"source": string[]; // 广告资源
|
||||
"start_time"?: Date; // 开始时间
|
||||
"end_time"?: Date; // 结束时间
|
||||
"redirect_type"?: string; // 跳转类型,[enum:BannersRedirectTypeEnum]
|
||||
"redirect_path"?: string; // 跳转链接
|
||||
"app_id"?: string; // 小程序app_id
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"banner_spaces_id": number; // 广告位id,[ref:banner_spaces]
|
||||
"name": string; // 名称
|
||||
"sort"?: number; // 排序:越大越靠前
|
||||
"type": string; // 类型,[enum:BannersTypeEnum]
|
||||
"source": string[]; // 广告资源
|
||||
"start_time"?: Date; // 开始时间
|
||||
"end_time"?: Date; // 结束时间
|
||||
"redirect_type"?: string; // 跳转类型,[enum:BannersRedirectTypeEnum]
|
||||
"redirect_path"?: string; // 跳转链接
|
||||
"app_id"?: string; // 小程序app_id
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Bill {
|
||||
namespace HouseBills {
|
||||
type List = {
|
||||
@ -366,6 +435,8 @@ declare namespace ApiTypes {
|
||||
type Login = {
|
||||
"username": string; // 用户名
|
||||
"password": string; // 密码
|
||||
"captcha": string; // 验证码
|
||||
"captcha_key": string; // 验证码key
|
||||
};
|
||||
type ChangePassword = {
|
||||
"old_password": string; // 老密码
|
||||
|
||||
@ -30,6 +30,9 @@ export const Apis = {
|
||||
MoveOut(data: ApiTypes.Archive.HouseRegisters.MoveOut): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/move_out', { data });
|
||||
},
|
||||
MoveIn(data: ApiTypes.Archive.HouseRegisters.MoveIn): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/move_in', { data });
|
||||
},
|
||||
RemoveOwner(data: ApiTypes.Archive.HouseRegisters.RemoveOwner): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/remove_owner', { data });
|
||||
},
|
||||
@ -144,6 +147,45 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Banner: {
|
||||
BannerSpaces: {
|
||||
List(data?: ApiTypes.Banner.BannerSpaces.List): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Banner.BannerSpaces.Store): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Banner.BannerSpaces.Update): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Banner.BannerSpaces.Show): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/show', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Banner.BannerSpaces.Delete): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Banner.BannerSpaces.Select): Promise<MyResponseType> {
|
||||
return request('admin/banner/banner_spaces/select', { data });
|
||||
},
|
||||
},
|
||||
Banners: {
|
||||
List(data?: ApiTypes.Banner.Banners.List): Promise<MyResponseType> {
|
||||
return request('admin/banner/banners/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Banner.Banners.Store): Promise<MyResponseType> {
|
||||
return request('admin/banner/banners/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Banner.Banners.Update): Promise<MyResponseType> {
|
||||
return request('admin/banner/banners/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Banner.Banners.Show): Promise<MyResponseType> {
|
||||
return request('admin/banner/banners/show', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Banner.Banners.Delete): Promise<MyResponseType> {
|
||||
return request('admin/banner/banners/delete', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Bill: {
|
||||
HouseBills: {
|
||||
List(data?: ApiTypes.Bill.HouseBills.List): Promise<MyResponseType> {
|
||||
|
||||
505
src/gen/Enums.ts
505
src/gen/Enums.ts
@ -1,398 +1,321 @@
|
||||
// AssetHousesOrientationEnum
|
||||
export const AssetHousesOrientationEnum = {
|
||||
East: { text: '东', color: '#007bff', value: 'East' },
|
||||
South: { text: '南', color: '#28a745', value: 'South' },
|
||||
West: { text: '西', color: '#ffc107', value: 'West' },
|
||||
North: { text: '北', color: '#dc3545', value: 'North' },
|
||||
Southeast: { text: '东南', color: '#20c997', value: 'Southeast' },
|
||||
Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' },
|
||||
Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' },
|
||||
Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' },
|
||||
EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' },
|
||||
SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' },
|
||||
export const AssetHousesOrientationEnum= {
|
||||
'East': {"text":"东","color":"#007bff","value":"East"},
|
||||
'South': {"text":"南","color":"#28a745","value":"South"},
|
||||
'West': {"text":"西","color":"#ffc107","value":"West"},
|
||||
'North': {"text":"北","color":"#dc3545","value":"North"},
|
||||
'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"},
|
||||
'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"},
|
||||
'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"},
|
||||
'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"},
|
||||
'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"},
|
||||
'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"},
|
||||
};
|
||||
|
||||
// AssetHousesOwnershipTypeEnum
|
||||
export const AssetHousesOwnershipTypeEnum = {
|
||||
CommodityHousing: {
|
||||
text: '商品房',
|
||||
color: '#007bff',
|
||||
value: 'CommodityHousing',
|
||||
},
|
||||
FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' },
|
||||
MilitaryHousing: {
|
||||
text: '军产房',
|
||||
color: '#17a2b8',
|
||||
value: 'MilitaryHousing',
|
||||
},
|
||||
AffordableHousing: {
|
||||
text: '保障房',
|
||||
color: '#ffc107',
|
||||
value: 'AffordableHousing',
|
||||
},
|
||||
RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' },
|
||||
CommercialOffice: {
|
||||
text: '商业写字楼',
|
||||
color: '#fd7e14',
|
||||
value: 'CommercialOffice',
|
||||
},
|
||||
CommercialComplex: {
|
||||
text: '商业综合体',
|
||||
color: '#dc3545',
|
||||
value: 'CommercialComplex',
|
||||
},
|
||||
ResettlementHousing: {
|
||||
text: '回迁房',
|
||||
color: '#20c997',
|
||||
value: 'ResettlementHousing',
|
||||
},
|
||||
export const AssetHousesOwnershipTypeEnum= {
|
||||
'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"},
|
||||
'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"},
|
||||
'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"},
|
||||
'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"},
|
||||
'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"},
|
||||
'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"},
|
||||
'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"},
|
||||
'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"},
|
||||
};
|
||||
|
||||
// AssetHousesPropertyOwnershipEnum
|
||||
export const AssetHousesPropertyOwnershipEnum= {
|
||||
'Individual': {"text":"个人","color":"#2db7f5","value":"Individual"},
|
||||
'Enterprise': {"text":"企业","color":"#87d068","value":"Enterprise"},
|
||||
'Developer': {"text":"开发商","color":"#fa8c16","value":"Developer"},
|
||||
'Government': {"text":"政府","color":"#f5222d","value":"Government"},
|
||||
};
|
||||
|
||||
// AssetHousesStatusEnum
|
||||
export const AssetHousesStatusEnum = {
|
||||
Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' },
|
||||
SoldNotDelivered: {
|
||||
text: '已售未交房',
|
||||
color: '#ffc107',
|
||||
value: 'SoldNotDelivered',
|
||||
},
|
||||
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
|
||||
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
|
||||
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
|
||||
export const AssetHousesStatusEnum= {
|
||||
'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"},
|
||||
'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"},
|
||||
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"},
|
||||
'Rented': {"text":"出租","color":"#007bff","value":"Rented"},
|
||||
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
|
||||
};
|
||||
|
||||
// AssetHousesUsageEnum
|
||||
export const AssetHousesUsageEnum = {
|
||||
Residence: { text: '住宅', color: '#007bff', value: 'Residence' },
|
||||
Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' },
|
||||
Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' },
|
||||
Shop: { text: '商铺', color: '#ffc107', value: 'Shop' },
|
||||
ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' },
|
||||
Office: { text: '写字楼', color: '#6610f2', value: 'Office' },
|
||||
Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' },
|
||||
PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' },
|
||||
export const AssetHousesUsageEnum= {
|
||||
'Residence': {"text":"住宅","color":"#007bff","value":"Residence"},
|
||||
'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"},
|
||||
'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"},
|
||||
'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"},
|
||||
'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"},
|
||||
'Office': {"text":"写字楼","color":"#6610f2","value":"Office"},
|
||||
'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"},
|
||||
'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"},
|
||||
};
|
||||
|
||||
// AssetProjectsChargeEnum
|
||||
export const AssetProjectsChargeEnum = {
|
||||
Contract: { text: '包干制', color: '#007bff', value: 'Contract' },
|
||||
Commission: { text: '酬金制', color: '#28a745', value: 'Commission' },
|
||||
export const AssetProjectsChargeEnum= {
|
||||
'Contract': {"text":"包干制","color":"#007bff","value":"Contract"},
|
||||
'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"},
|
||||
};
|
||||
|
||||
// AssetProjectsEntrustTypeEnum
|
||||
export const AssetProjectsEntrustTypeEnum = {
|
||||
DeveloperJointEntrust: {
|
||||
text: '开发商全委',
|
||||
color: '#007bff',
|
||||
value: 'DeveloperJointEntrust',
|
||||
},
|
||||
OwnersFullEntrust: {
|
||||
text: '业委会全委',
|
||||
color: '#28a745',
|
||||
value: 'OwnersFullEntrust',
|
||||
},
|
||||
GovernmentFullEntrust: {
|
||||
text: '政府类全委',
|
||||
color: '#ffc107',
|
||||
value: 'GovernmentFullEntrust',
|
||||
},
|
||||
export const AssetProjectsEntrustTypeEnum= {
|
||||
'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"},
|
||||
'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"},
|
||||
'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"},
|
||||
};
|
||||
|
||||
// AssetProjectsPropertyTypeEnum
|
||||
export const AssetProjectsPropertyTypeEnum = {
|
||||
Residence: { text: '住宅', color: '#ff0000', value: 'Residence' },
|
||||
Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' },
|
||||
Office: { text: '办公', color: '#ffcc00', value: 'Office' },
|
||||
IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' },
|
||||
Complex: { text: '综合体', color: '#0099ff', value: 'Complex' },
|
||||
Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' },
|
||||
Venue: { text: '场馆', color: '#9966ff', value: 'Venue' },
|
||||
Education: { text: '教育', color: '#339999', value: 'Education' },
|
||||
Medical: { text: '医疗', color: '#cc3366', value: 'Medical' },
|
||||
export const AssetProjectsPropertyTypeEnum= {
|
||||
'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"},
|
||||
'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"},
|
||||
'Office': {"text":"办公","color":"#ffcc00","value":"Office"},
|
||||
'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"},
|
||||
'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"},
|
||||
'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"},
|
||||
'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"},
|
||||
'Education': {"text":"教育","color":"#339999","value":"Education"},
|
||||
'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"},
|
||||
};
|
||||
|
||||
// AssetProjectsStatusEnum
|
||||
export const AssetProjectsStatusEnum = {
|
||||
SignedNotDelivered: {
|
||||
text: '签约未交付',
|
||||
color: '#6c757d',
|
||||
value: 'SignedNotDelivered',
|
||||
},
|
||||
RollingDevelopment: {
|
||||
text: '滚动开发',
|
||||
color: '#007bff',
|
||||
value: 'RollingDevelopment',
|
||||
},
|
||||
ManagedAndClosed: {
|
||||
text: '在管封园',
|
||||
color: '#ffc107',
|
||||
value: 'ManagedAndClosed',
|
||||
},
|
||||
Exited: { text: '退出', color: '#dc3545', value: 'Exited' },
|
||||
export const AssetProjectsStatusEnum= {
|
||||
'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"},
|
||||
'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"},
|
||||
'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"},
|
||||
'Exited': {"text":"退出","color":"#dc3545","value":"Exited"},
|
||||
};
|
||||
|
||||
// AssetUnitsBuildingStructureEnum
|
||||
export const AssetUnitsBuildingStructureEnum = {
|
||||
SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' },
|
||||
SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' },
|
||||
BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' },
|
||||
BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' },
|
||||
export const AssetUnitsBuildingStructureEnum= {
|
||||
'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"},
|
||||
'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"},
|
||||
'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"},
|
||||
'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"},
|
||||
};
|
||||
|
||||
// AssetUnitsBuildingTypeEnum
|
||||
export const AssetUnitsBuildingTypeEnum = {
|
||||
SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' },
|
||||
Slab: { text: '板楼', color: '#28a745', value: 'Slab' },
|
||||
Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' },
|
||||
export const AssetUnitsBuildingTypeEnum= {
|
||||
'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"},
|
||||
'Slab': {"text":"板楼","color":"#28a745","value":"Slab"},
|
||||
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"},
|
||||
};
|
||||
|
||||
// BannerSpacesTypeEnum
|
||||
export const BannerSpacesTypeEnum= {
|
||||
'Popup': {"text":"弹窗","color":"#ff0000","value":"Popup"},
|
||||
'Banner': {"text":"横幅广告","color":"#00ff00","value":"Banner"},
|
||||
'FloatingButton': {"text":"悬浮按钮","color":"#0000ff","value":"FloatingButton"},
|
||||
};
|
||||
|
||||
// BannersRedirectTypeEnum
|
||||
export const BannersRedirectTypeEnum= {
|
||||
'InnerPage': {"text":"跳内页","color":"#ff0000","value":"InnerPage"},
|
||||
'H5': {"text":"跳H5","color":"#00ff00","value":"H5"},
|
||||
'MiniProgramHome': {"text":"跳小程序首屏","color":"#0000ff","value":"MiniProgramHome"},
|
||||
'AnotherMiniProgram': {"text":"跳另一个小程序","color":"#ffa500","value":"AnotherMiniProgram"},
|
||||
};
|
||||
|
||||
// BannersTypeEnum
|
||||
export const BannersTypeEnum= {
|
||||
'Image': {"text":"图片","color":"#ff0000","value":"Image"},
|
||||
'Video': {"text":"视频","color":"#00ff00","value":"Video"},
|
||||
'Text': {"text":"文本","color":"#0000ff","value":"Text"},
|
||||
};
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum = {
|
||||
MobilePhoneVerificationCode: {
|
||||
text: '手机验证码',
|
||||
color: '#012ab0',
|
||||
value: 'MobilePhoneVerificationCode',
|
||||
},
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#581810","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
export const CompaniesMerchantTypeEnum = {
|
||||
PropertyManagement: {
|
||||
text: '物业公司',
|
||||
color: '#007bff',
|
||||
value: 'PropertyManagement',
|
||||
},
|
||||
ServiceProvider: {
|
||||
text: '服务商',
|
||||
color: '#28a745',
|
||||
value: 'ServiceProvider',
|
||||
},
|
||||
export const CompaniesMerchantTypeEnum= {
|
||||
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"},
|
||||
'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"},
|
||||
};
|
||||
|
||||
// CompanyAppsAppTypeEnum
|
||||
export const CompanyAppsAppTypeEnum = {
|
||||
MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
|
||||
MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
|
||||
WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
|
||||
export const CompanyAppsAppTypeEnum= {
|
||||
'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"},
|
||||
'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"},
|
||||
'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"},
|
||||
};
|
||||
|
||||
// CompanyAppsModuleEnum
|
||||
export const CompanyAppsModuleEnum = {
|
||||
Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' },
|
||||
Customer: { text: '客户端', color: '#10b981', value: 'Customer' },
|
||||
export const CompanyAppsModuleEnum= {
|
||||
'Employee': {"text":"员工端","color":"#3b82f6","value":"Employee"},
|
||||
'Customer': {"text":"客户端","color":"#10b981","value":"Customer"},
|
||||
};
|
||||
|
||||
// CompanyReceiptAccountsPayChannelEnum
|
||||
export const CompanyReceiptAccountsPayChannelEnum = {
|
||||
WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
|
||||
Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
|
||||
BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
|
||||
TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
|
||||
export const CompanyReceiptAccountsPayChannelEnum= {
|
||||
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
|
||||
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"},
|
||||
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"},
|
||||
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"},
|
||||
};
|
||||
|
||||
// CustomerBacklogsStatusEnum
|
||||
export const CustomerBacklogsStatusEnum = {
|
||||
Pending: { text: '待办', color: '#faad14', value: 'Pending' },
|
||||
Done: { text: '已办', color: '#52c41a', value: 'Done' },
|
||||
export const CustomerBacklogsStatusEnum= {
|
||||
'Pending': {"text":"待办","color":"#faad14","value":"Pending"},
|
||||
'Done': {"text":"已办","color":"#52c41a","value":"Done"},
|
||||
};
|
||||
|
||||
// CustomerBacklogsTypeEnum
|
||||
export const CustomerBacklogsTypeEnum = {
|
||||
RegisterApply: { text: '登记申请', color: '#2db7f5', value: 'RegisterApply' },
|
||||
PaymentPending: {
|
||||
text: '费用待缴',
|
||||
color: '#faad14',
|
||||
value: 'PaymentPending',
|
||||
},
|
||||
ContractTodo: { text: '合同待办', color: '#722ed1', value: 'ContractTodo' },
|
||||
export const CustomerBacklogsTypeEnum= {
|
||||
'RegisterApply': {"text":"登记申请","color":"#2db7f5","value":"RegisterApply"},
|
||||
'PaymentPending': {"text":"费用待缴","color":"#faad14","value":"PaymentPending"},
|
||||
'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"},
|
||||
};
|
||||
|
||||
// 账单状态枚举
|
||||
export const HouseBillsBillStatusEnum = {
|
||||
PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' },
|
||||
PartiallyPaid: { text: '部分支付', color: '#60a5fa', value: 'PartiallyPaid' },
|
||||
Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
|
||||
Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' },
|
||||
Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
|
||||
export const HouseBillsBillStatusEnum= {
|
||||
'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"},
|
||||
'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"},
|
||||
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"},
|
||||
'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"},
|
||||
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"},
|
||||
};
|
||||
|
||||
// 房屋账单类型枚举
|
||||
export const HouseBillsTypeEnum = {
|
||||
PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' },
|
||||
MaintenanceFund: {
|
||||
text: '维修基金',
|
||||
color: '#10b981',
|
||||
value: 'MaintenanceFund',
|
||||
},
|
||||
WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' },
|
||||
ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' },
|
||||
SharedWaterFee: {
|
||||
text: '公摊水费',
|
||||
color: '#8b5cf6',
|
||||
value: 'SharedWaterFee',
|
||||
},
|
||||
SharedElectricityFee: {
|
||||
text: '公摊电费',
|
||||
color: '#ec4899',
|
||||
value: 'SharedElectricityFee',
|
||||
},
|
||||
export const HouseBillsTypeEnum= {
|
||||
'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"},
|
||||
'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"},
|
||||
'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"},
|
||||
'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"},
|
||||
'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"},
|
||||
'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"},
|
||||
};
|
||||
|
||||
// HouseOccupantsCardTypeEnum
|
||||
export const HouseOccupantsCardTypeEnum = {
|
||||
MainlandID: {
|
||||
text: '中国大陆居民身份证',
|
||||
color: '#2db7f5',
|
||||
value: 'MainlandID',
|
||||
},
|
||||
HKPermit: {
|
||||
text: '香港来往大陆通行证(回乡证)',
|
||||
color: '#fa8c16',
|
||||
value: 'HKPermit',
|
||||
},
|
||||
MOPermit: {
|
||||
text: '澳门来往大陆通行证(回乡证)',
|
||||
color: '#faad14',
|
||||
value: 'MOPermit',
|
||||
},
|
||||
TWPermit: {
|
||||
text: '台湾来往大陆通行证(台胞证)',
|
||||
color: '#87d068',
|
||||
value: 'TWPermit',
|
||||
},
|
||||
Passport: { text: '护照', color: '#108ee9', value: 'Passport' },
|
||||
BusinessLicense: {
|
||||
text: '营业执照',
|
||||
color: '#f5222d',
|
||||
value: 'BusinessLicense',
|
||||
},
|
||||
export const HouseOccupantsCardTypeEnum= {
|
||||
'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"},
|
||||
'HKPermit': {"text":"香港来往大陆通行证(回乡证)","color":"#fa8c16","value":"HKPermit"},
|
||||
'MOPermit': {"text":"澳门来往大陆通行证(回乡证)","color":"#faad14","value":"MOPermit"},
|
||||
'TWPermit': {"text":"台湾来往大陆通行证(台胞证)","color":"#87d068","value":"TWPermit"},
|
||||
'Passport': {"text":"护照","color":"#108ee9","value":"Passport"},
|
||||
'BusinessLicense': {"text":"营业执照","color":"#f5222d","value":"BusinessLicense"},
|
||||
};
|
||||
|
||||
// HouseOccupantsHouseRelationEnum
|
||||
export const HouseOccupantsHouseRelationEnum = {
|
||||
Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' },
|
||||
Resident: { text: '住户', color: '#87d068', value: 'Resident' },
|
||||
Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' },
|
||||
export const HouseOccupantsHouseRelationEnum= {
|
||||
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"},
|
||||
'Resident': {"text":"住户","color":"#87d068","value":"Resident"},
|
||||
'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"},
|
||||
};
|
||||
|
||||
// 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' },
|
||||
Children: { text: '子女', color: '#87d068', value: 'Children' },
|
||||
ContactPerson: {
|
||||
text: '指定联系人',
|
||||
color: '#f5222d',
|
||||
value: 'ContactPerson',
|
||||
},
|
||||
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"},
|
||||
'Children': {"text":"子女","color":"#87d068","value":"Children"},
|
||||
'ContactPerson': {"text":"指定联系人","color":"#f5222d","value":"ContactPerson"},
|
||||
};
|
||||
|
||||
// HouseOccupantsStatusEnum
|
||||
export const HouseOccupantsStatusEnum = {
|
||||
Normal: { text: '正常', color: '#52c41a', value: 'Normal' },
|
||||
Unbound: { text: '已解除', color: '#f5222d', value: 'Unbound' },
|
||||
export const HouseOccupantsStatusEnum= {
|
||||
'Normal': {"text":"正常","color":"#52c41a","value":"Normal"},
|
||||
'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"},
|
||||
};
|
||||
|
||||
// 订单状态枚举
|
||||
export const HouseOrdersOrderStatusEnum = {
|
||||
Pending: { text: '待支付', color: '#facc15', value: 'Pending' },
|
||||
Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
|
||||
Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' },
|
||||
Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
|
||||
Failed: { text: '支付失败', color: '#ef4444', value: 'Failed' },
|
||||
export const HouseOrdersOrderStatusEnum= {
|
||||
'Pending': {"text":"待支付","color":"#facc15","value":"Pending"},
|
||||
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"},
|
||||
'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"},
|
||||
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"},
|
||||
'Failed': {"text":"支付失败","color":"#ef4444","value":"Failed"},
|
||||
};
|
||||
|
||||
// HouseOrdersPaymentMethodEnum
|
||||
export const HouseOrdersPaymentMethodEnum = {
|
||||
WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
|
||||
Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
|
||||
BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
|
||||
TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
|
||||
export const HouseOrdersPaymentMethodEnum= {
|
||||
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
|
||||
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"},
|
||||
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"},
|
||||
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"},
|
||||
};
|
||||
|
||||
// HouseRegistersCustomerTypeEnum
|
||||
export const HouseRegistersCustomerTypeEnum = {
|
||||
Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' },
|
||||
Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' },
|
||||
Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' },
|
||||
Government: { text: '政府组织', color: '#f5222d', value: 'Government' },
|
||||
export const HouseRegistersCustomerTypeEnum= {
|
||||
'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"},
|
||||
'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"},
|
||||
'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"},
|
||||
'Government': {"text":"政府组织","color":"#f5222d","value":"Government"},
|
||||
};
|
||||
|
||||
// HouseRegistersHouseStatusEnum
|
||||
export const HouseRegistersHouseStatusEnum = {
|
||||
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
|
||||
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
|
||||
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
|
||||
export const HouseRegistersHouseStatusEnum= {
|
||||
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"},
|
||||
'Rented': {"text":"出租","color":"#007bff","value":"Rented"},
|
||||
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
|
||||
};
|
||||
|
||||
// 房屋登记身份类型
|
||||
export const HouseRegistersIdentityTypeEnum = {
|
||||
Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' },
|
||||
Tenant: { text: '租客', color: '#87d068', value: 'Tenant' },
|
||||
CoResident: { text: '同住人(亲属)', color: '#108ee9', value: 'CoResident' },
|
||||
export const HouseRegistersIdentityTypeEnum= {
|
||||
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"},
|
||||
'Tenant': {"text":"租客","color":"#87d068","value":"Tenant"},
|
||||
'CoResident': {"text":"同住人(亲属)","color":"#108ee9","value":"CoResident"},
|
||||
};
|
||||
|
||||
// HouseRegistersStatusEnum
|
||||
export const HouseRegistersStatusEnum = {
|
||||
Pending: { text: '待审', color: '#faad14', value: 'Pending' },
|
||||
Approved: { text: '已审', color: '#52c41a', value: 'Approved' },
|
||||
Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' },
|
||||
export const HouseRegistersStatusEnum= {
|
||||
'Pending': {"text":"待审","color":"#faad14","value":"Pending"},
|
||||
'Approved': {"text":"已审","color":"#52c41a","value":"Approved"},
|
||||
'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"},
|
||||
};
|
||||
|
||||
// HouseRegistersTypeEnum
|
||||
export const HouseRegistersTypeEnum = {
|
||||
Delivery: { text: '入户登记', color: '#2db7f5', value: 'Delivery' },
|
||||
Transfer: { text: '过户登记', color: '#87d068', value: 'Transfer' },
|
||||
AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' },
|
||||
MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' },
|
||||
MoveIn: { text: '搬入登记', color: '#ffc53d', value: 'MoveIn' },
|
||||
RemoveOwner: { text: '减少产权人', color: '#d9363e', value: 'RemoveOwner' },
|
||||
export const HouseRegistersTypeEnum= {
|
||||
'Delivery': {"text":"入户登记","color":"#2db7f5","value":"Delivery"},
|
||||
'Transfer': {"text":"过户登记","color":"#87d068","value":"Transfer"},
|
||||
'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"},
|
||||
'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"},
|
||||
'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"},
|
||||
'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"},
|
||||
};
|
||||
|
||||
// HouseRegistersUsagePlanEnum
|
||||
export const HouseRegistersUsagePlanEnum = {
|
||||
Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' },
|
||||
Vacation: { text: '度假', color: '#faad14', value: 'Vacation' },
|
||||
Rental: { text: '出租', color: '#2db7f5', value: 'Rental' },
|
||||
Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' },
|
||||
export const HouseRegistersUsagePlanEnum= {
|
||||
'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"},
|
||||
'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"},
|
||||
'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"},
|
||||
'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"},
|
||||
};
|
||||
|
||||
// OrganizationsTypeEnum
|
||||
export const OrganizationsTypeEnum = {
|
||||
Group: { text: '集团', color: '#007bff', value: 'Group' },
|
||||
Company: { text: '公司', color: '#28a745', value: 'Company' },
|
||||
ManagementOffice: {
|
||||
text: '管理处',
|
||||
color: '#ffc107',
|
||||
value: 'ManagementOffice',
|
||||
},
|
||||
Department: { text: '部门', color: '#dc3545', value: 'Department' },
|
||||
export const OrganizationsTypeEnum= {
|
||||
'Group': {"text":"集团","color":"#007bff","value":"Group"},
|
||||
'Company': {"text":"公司","color":"#28a745","value":"Company"},
|
||||
'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"},
|
||||
'Department': {"text":"部门","color":"#dc3545","value":"Department"},
|
||||
};
|
||||
|
||||
// 性别
|
||||
export const SexEnum = {
|
||||
Male: { text: '男', color: '#0000ff', value: 'Male' },
|
||||
FeMale: { text: '女', color: '#ff0000', value: 'FeMale' },
|
||||
export const SexEnum= {
|
||||
'Male': {"text":"男","color":"#0000ff","value":"Male"},
|
||||
'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"},
|
||||
};
|
||||
|
||||
// SysModuleEnum
|
||||
export const SysModuleEnum = {
|
||||
Admin: { text: '管理员', color: '#cf1322', value: 'Admin' },
|
||||
Customer: { text: '客户', color: '#d4b106', value: 'Customer' },
|
||||
export const SysModuleEnum= {
|
||||
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"},
|
||||
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"},
|
||||
};
|
||||
|
||||
// SysPermissionsTypeEnum
|
||||
export const SysPermissionsTypeEnum = {
|
||||
Directory: { text: '目录', color: '#6d7e14', value: 'Directory' },
|
||||
Page: { text: '页面', color: '#4d9a13', value: 'Page' },
|
||||
Button: { text: '按钮', color: '#97224f', value: 'Button' },
|
||||
export const SysPermissionsTypeEnum= {
|
||||
'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"},
|
||||
'Page': {"text":"页面","color":"#4d9a13","value":"Page"},
|
||||
'Button': {"text":"按钮","color":"#97224f","value":"Button"},
|
||||
};
|
||||
|
||||
// WechatAuthsPlatformEnum
|
||||
export const WechatAuthsPlatformEnum = {
|
||||
MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
|
||||
MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
|
||||
WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
|
||||
export const WechatAuthsPlatformEnum= {
|
||||
'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"},
|
||||
'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"},
|
||||
'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"},
|
||||
};
|
||||
|
||||
|
||||
@ -1,23 +1,39 @@
|
||||
import { MyPageContainer } from '@/common';
|
||||
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 { useEffect, useState } from 'react';
|
||||
import HouseInfo from './components/HouseInfo';
|
||||
import OccupantsHistory from './table/OccupantsHistory';
|
||||
import OccupantsNow from './table/OccupantsNow';
|
||||
import RegistersList from './table/RegistersList';
|
||||
import OccupantsHistory from './components/OccupantsHistory';
|
||||
import OccupantsNow from './components/OccupantsNow';
|
||||
import RegistersList from './components/RegistersList';
|
||||
|
||||
export default function Show({ title = '房屋详情' }) {
|
||||
export default function Show({ title = '房屋档案' }) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
// 注册标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `asset-house-detail-${id}`,
|
||||
tabLabel: `${data?.name}档案` || title,
|
||||
});
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
Apis.Asset.AssetHouses.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
// 更新标签页标题
|
||||
if (res?.data?.full_name) {
|
||||
addTab({
|
||||
key: `asset-house-detail-${id}`,
|
||||
label: title,
|
||||
path: `/archive/${id}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadShow();
|
||||
}, [id]);
|
||||
@ -27,13 +43,11 @@ export default function Show({ title = '房屋详情' }) {
|
||||
label: '当前客户',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: data?.id ? (
|
||||
children: (
|
||||
<OccupantsNow
|
||||
item={{ ...data, asset_houses_id: id }}
|
||||
reload={() => loadShow()}
|
||||
/>
|
||||
) : (
|
||||
''
|
||||
),
|
||||
},
|
||||
{
|
||||
@ -52,9 +66,9 @@ export default function Show({ title = '房屋详情' }) {
|
||||
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<HouseInfo item={data} />
|
||||
<ProCard>
|
||||
<Tabs type="card" items={items} />
|
||||
<HouseInfo item={data} reload={loadShow} />
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
</ProCard>
|
||||
</MyPageContainer>
|
||||
);
|
||||
@ -1,179 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
HouseRegistersUsagePlanEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'Transfer',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'customer_type',
|
||||
title: '客户类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseRegistersHouseStatusEnum,
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'usage_plan',
|
||||
title: '使用计划',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseRegistersUsagePlanEnum,
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '增加产权人',
|
||||
style: { color: 'red' },
|
||||
danger: true,
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`产权人${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '备用手机号',
|
||||
dataIndex: 'reserve_phone',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '是否在居住中',
|
||||
// dataIndex: 'is_live_in',
|
||||
// colProps: { span: 8 },
|
||||
// valueType: 'switch',
|
||||
// },
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
max: 100,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -7,60 +7,77 @@ import {
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import ChangeStatus from './modals/ChangeStatus';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
const { item } = props;
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard>
|
||||
<ProCard title="基本信息">
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||
{props?.item?.full_name}
|
||||
<div style={{ fontWeight: 'bold' }}>{item?.full_name}</div>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房号">
|
||||
{props?.item?.name}
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
<Space size="large">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesStatusEnum}
|
||||
value={item?.status}
|
||||
key="status"
|
||||
/>
|
||||
<ChangeStatus
|
||||
item={props?.item}
|
||||
title="修改"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="楼层">
|
||||
{props?.item?.floor}层
|
||||
{item?.floor}层
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="房屋用途">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesUsageEnum}
|
||||
value={props?.item?.usage}
|
||||
value={item?.usage}
|
||||
key="usage"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="产权性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOwnershipTypeEnum}
|
||||
value={props?.item?.ownership_type}
|
||||
value={item?.ownership_type}
|
||||
key="ownership_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="建筑面积">
|
||||
{props?.item?.built_area}m²
|
||||
<span style={{ fontWeight: 'bold', color: '#fa8c16' }}>
|
||||
{item?.built_area}m²
|
||||
</span>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="套内面积">
|
||||
{props?.item?.inside_area}m²
|
||||
<span style={{ fontWeight: 'bold', color: '#fa8c16' }}>
|
||||
{item?.inside_area}m²
|
||||
</span>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计费面积">
|
||||
{props?.item?.chargeable_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
<span style={{ fontWeight: 'bold', color: '#52c41a' }}>
|
||||
{item?.chargeable_area}m²
|
||||
</span>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="户型">
|
||||
{props?.item?.room || ''}房{props?.item?.hall || ''}厅
|
||||
{props?.item?.bathroom || ''}卫{props?.item?.kitchen || ''}厨
|
||||
{props?.item?.balcony || ''}阳台
|
||||
<div style={{ fontSize: '14px' }}>
|
||||
{item?.room || 0}房{item?.hall || 0}厅{item?.bathroom || 0}卫
|
||||
{item?.kitchen || 0}厨{item?.balcony ? `${item.balcony}阳台` : ''}
|
||||
</div>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="朝向">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOrientationEnum}
|
||||
value={props?.item?.orientation}
|
||||
value={item?.orientation}
|
||||
key="orientation"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
@ -8,7 +8,7 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import OccupantsUpdate from '../modals/OccupantsUpdate';
|
||||
import OccupantsUpdate from './modals/OccupantsUpdate';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -8,13 +8,14 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import AddOccupant from '../modals/AddOccupant';
|
||||
import AddOwner from '../modals/AddOwner';
|
||||
import MoveIn from '../modals/MoveIn00';
|
||||
import MoveOut from '../modals/MoveOut';
|
||||
import OccupantShow from '../modals/OccupantShow';
|
||||
import OccupantsUpdate from '../modals/OccupantsUpdate';
|
||||
import Transfer from '../modals/Transfer';
|
||||
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';
|
||||
import OccupantsUpdate from './modals/OccupantsUpdate';
|
||||
import RemoveOwner from './modals/RemoveOwner';
|
||||
import Transfer from './modals/Transfer';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -39,11 +40,17 @@ export default function Index({ ...rest }) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AddOwner
|
||||
key="add"
|
||||
<AddOccupant
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加产权人"
|
||||
title="添加住户"
|
||||
/>,
|
||||
<AddRent
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加租客"
|
||||
/>,
|
||||
<Transfer
|
||||
key="Transfer"
|
||||
@ -51,12 +58,6 @@ export default function Index({ ...rest }) {
|
||||
reload={action?.reload}
|
||||
title=" 过户登记"
|
||||
/>,
|
||||
<AddOccupant
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加住户"
|
||||
/>,
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
@ -81,19 +82,18 @@ export default function Index({ ...rest }) {
|
||||
title: '电话',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
render(_, record) {
|
||||
return `${record?.is_live_in ? '是' : '-'} `;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '是否入住',
|
||||
// dataIndex: 'is_live_in',
|
||||
// render(_, record) {
|
||||
// return `${record?.is_live_in ? '是' : '-'} `;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'is_live_in',
|
||||
render(_, record) {
|
||||
return `${record?.move_in_date || '-'}`;
|
||||
return `${record?.move_in_date || '未入住'}`;
|
||||
},
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
@ -107,22 +107,14 @@ export default function Index({ ...rest }) {
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OccupantShow item={item} reload={action?.reload} />
|
||||
{item?.house_relation !== 'Owner' && (
|
||||
<OccupantsUpdate item={item} reload={action?.reload} />
|
||||
)}
|
||||
<OccupantsUpdate item={item} reload={action?.reload} />
|
||||
{!item?.is_live_in && (
|
||||
<MoveIn item={item} reload={action?.reload} title="入住" />
|
||||
)}
|
||||
{item?.move_in_date && (
|
||||
<MoveOut item={item} reload={action?.reload} title="搬离" />
|
||||
)}
|
||||
{/* <MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Archive.HouseOccupants.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/> */}
|
||||
<RemoveOwner item={item} reload={action?.reload} title="移除" />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
@ -4,7 +4,7 @@ import { HouseRegistersStatusEnum, HouseRegistersTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import RegistersShow from '../modals/RegistersShow';
|
||||
import RegistersShow from './modals/RegistersShow';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -22,38 +22,19 @@ export default function Index({ ...rest }) {
|
||||
{
|
||||
...params,
|
||||
asset_houses_id: rest.item?.asset_houses_id,
|
||||
// status: 'Approved',
|
||||
},
|
||||
sort,
|
||||
Apis.Archive.HouseRegisters.List,
|
||||
)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <AddOwner
|
||||
// key="add"
|
||||
// item={rest.item}
|
||||
// reload={action?.reload}
|
||||
// title="添加产权人"
|
||||
// />,
|
||||
// ]}
|
||||
search={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
// {
|
||||
// title: '房屋',
|
||||
// dataIndex: ['asset_house', 'full_name'],
|
||||
// },
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: HouseRegistersTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '客户信息',
|
||||
render(_, record) {
|
||||
return (
|
||||
record?.customer_info.map((res: any) => res?.name).join(';') ||
|
||||
record?.customer_info?.map((res: any) => res?.name).join(';') ||
|
||||
'-'
|
||||
); // 无数据时显示 -
|
||||
},
|
||||
@ -61,15 +42,36 @@ export default function Index({ ...rest }) {
|
||||
width: 200,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '登记状态',
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: HouseRegistersTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseRegistersStatusEnum,
|
||||
}),
|
||||
MyColumns.UpdatedAt(),
|
||||
|
||||
{
|
||||
title: '登记时间',
|
||||
dataIndex: 'created_at',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updated_at',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<RegistersShow item={item} reload={action?.reload} />
|
||||
<RegistersShow
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="查看详情"
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
@ -21,11 +21,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -53,8 +54,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加住户',
|
||||
style: { color: 'red' },
|
||||
danger: true,
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
@ -63,7 +62,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`住户${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
@ -85,54 +84,25 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsHouseRelationEnum),
|
||||
);
|
||||
delete obj.Owner;
|
||||
delete obj.Tenant;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['house_relation'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ house_relation }: any) => {
|
||||
return house_relation === 'Resident'
|
||||
? [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '关系标记',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
),
|
||||
);
|
||||
delete obj.Self;
|
||||
delete obj.ContactPerson;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
]
|
||||
: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '关系标记',
|
||||
colProps: { span: 18 },
|
||||
// valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
),
|
||||
);
|
||||
delete obj.ContactPerson;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '关系标记',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
colProps: { span: 18 },
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsRelationWithOwnerEnum),
|
||||
// );
|
||||
// delete obj.Self;
|
||||
// return obj;
|
||||
// },
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
@ -147,7 +117,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
@ -172,15 +142,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
@ -9,6 +9,7 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -21,28 +22,22 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} type="primary" size="middle" />
|
||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.asset_houses_id,
|
||||
type: 'Delivery',
|
||||
house_status: props?.item?.status,
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
relation_with_owner: 'Self',
|
||||
};
|
||||
}),
|
||||
asset_houses_id: props?.item?.id,
|
||||
house_status: 'Rented',
|
||||
type: 'AddOccupant',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -59,9 +54,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '增加产权人',
|
||||
style: { color: 'red' },
|
||||
danger: true,
|
||||
creatorButtonText: '添加租客',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
@ -70,8 +63,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`产权人${index + 1}`}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`租客${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
@ -84,20 +77,42 @@ 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.Owner;
|
||||
delete obj.Resident;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '关系标记',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 5 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 5 },
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
@ -109,37 +124,30 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
fieldProps: {
|
||||
defaultValue: 'Owner',
|
||||
},
|
||||
hideInForm: true,
|
||||
}),
|
||||
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
76
src/pages/archive/components/modals/ChangeStatus.tsx
Normal file
76
src/pages/archive/components/modals/ChangeStatus.tsx
Normal file
@ -0,0 +1,76 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetHousesStatusEnum } from '@/gen/Enums';
|
||||
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.Asset.AssetHouses.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="380px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetHouses.Update({
|
||||
...values,
|
||||
id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
||||
asset_units_id: props?.item?.asset_units_id,
|
||||
name: props?.item?.name,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('房屋编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
// 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.EnumRadio({
|
||||
key: 'status',
|
||||
title: '请选择新的房屋状态',
|
||||
colProps: { span: 24 },
|
||||
// 删除当前状态
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
delete obj[props.item?.status];
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -8,30 +8,23 @@ import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function MoveIn(props: MyBetaModalFormProps) {
|
||||
export default function MoveOut(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseOccupants.Update>
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.MoveOut>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
title={`设置${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseOccupants.Update({
|
||||
Apis.Archive.HouseRegisters.MoveIn({
|
||||
...values,
|
||||
id: props?.item?.id ?? 0,
|
||||
is_live_in: 1,
|
||||
name: props?.item?.name,
|
||||
phone: props?.item?.phone,
|
||||
house_occupants_id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -47,13 +40,19 @@ export default function MoveIn(props: MyBetaModalFormProps) {
|
||||
dataIndex: 'move_in_date',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '入住原因',
|
||||
valueType: 'textarea',
|
||||
dataIndex: 'unbound_reason',
|
||||
colProps: { span: 24 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -13,7 +13,7 @@ export default function OccupantShow(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
width="900px"
|
||||
width="800px"
|
||||
node={
|
||||
<>
|
||||
<ProCard extra={props.extra}>
|
||||
@ -65,8 +65,8 @@ export default function OccupantShow(props: MyBetaModalFormProps) {
|
||||
(res: any, index: number) => {
|
||||
return (
|
||||
<Image
|
||||
width={160}
|
||||
height={120}
|
||||
width={40}
|
||||
height={30}
|
||||
src={res?.url || ''}
|
||||
key={`${res?.name}_${index}`}
|
||||
/>
|
||||
@ -79,8 +79,8 @@ export default function OccupantShow(props: MyBetaModalFormProps) {
|
||||
(res: any, index: number) => {
|
||||
return (
|
||||
<Image
|
||||
width={160}
|
||||
height={120}
|
||||
width={40}
|
||||
height={30}
|
||||
src={res?.url || ''}
|
||||
key={`${res?.name}_${index}`}
|
||||
/>
|
||||
@ -19,11 +19,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseOccupants.Update>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
36
src/pages/archive/components/modals/RemoveOwner.tsx
Normal file
36
src/pages/archive/components/modals/RemoveOwner.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import { MyBetaModalFormProps, MyButtons } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { message, Modal } from 'antd';
|
||||
|
||||
export default function MoveOut(props: MyBetaModalFormProps) {
|
||||
const handleRemoveClick = () => {
|
||||
Modal.confirm({
|
||||
title: '确认移除',
|
||||
content: '确定要提交移除申请吗?',
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
// centered: true,
|
||||
onOk: async () => {
|
||||
try {
|
||||
await Apis.Archive.HouseRegisters.RemoveOwner({
|
||||
house_occupants_id: props?.item?.id,
|
||||
});
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
} catch (error) {
|
||||
message.error('操作失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<MyButtons.Default
|
||||
title={props.title}
|
||||
size="small"
|
||||
type="link"
|
||||
onClick={handleRemoveClick}
|
||||
danger
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -9,6 +9,7 @@ import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -21,28 +22,21 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} type="primary" size="middle" />
|
||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.asset_houses_id,
|
||||
type: 'Delivery',
|
||||
house_status: props?.item?.status,
|
||||
customer_info: values.customer_info?.map((res: any) => {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
relation_with_owner: 'Self',
|
||||
};
|
||||
}),
|
||||
asset_houses_id: props?.item?.id,
|
||||
type: 'Transfer',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -52,6 +46,35 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 12 },
|
||||
// valueEnum: HouseRegistersHouseStatusEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// 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张',
|
||||
uploadType: 'file',
|
||||
max: 3,
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
@ -59,9 +82,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '增加产权人',
|
||||
style: { color: 'red' },
|
||||
danger: true,
|
||||
creatorButtonText: '添加产权人',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
@ -70,8 +91,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`产权人${index + 1}`}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`产权人 ${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
@ -85,7 +106,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 5 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
@ -131,19 +152,19 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
title: '是否办理入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
@ -1,37 +0,0 @@
|
||||
import { MyPageContainer } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import HouseOccupants from './components/HouseOccupants';
|
||||
export default function Show({ title = '机构详情' }) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
Apis.Archive.HouseRegisters.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
loadShow();
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '入住人',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: <HouseOccupants item={data} />,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseOccupantsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
// search={false}
|
||||
options={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, asset_houses_id: props.item?.asset_house?.id },
|
||||
sort,
|
||||
Apis.Archive.HouseOccupants.List,
|
||||
)
|
||||
}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseOccupantsStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '与产权人关系',
|
||||
dataIndex: 'relation_with_owner',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房客关系',
|
||||
dataIndex: 'house_relation',
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '证件类型',
|
||||
dataIndex: 'card_type',
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns?.Image({
|
||||
title: '身份证正面',
|
||||
dataIndex: 'card_front_image',
|
||||
}),
|
||||
MyColumns?.Image({
|
||||
title: '身份证正面',
|
||||
dataIndex: 'card_back_image',
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,107 +0,0 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
HouseRegistersStatusEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
HouseRegistersUsagePlanEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import OccupantsCreate from './modals/OccupantsCreate';
|
||||
|
||||
export default function Index({ title = '房屋登记' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'archive-house-registers',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
// search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Archive.HouseRegisters.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<OccupantsCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '房屋',
|
||||
dataIndex: ['asset_house', 'full_name'],
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: HouseRegistersTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseRegistersStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋状态',
|
||||
dataIndex: 'house_status',
|
||||
valueEnum: HouseRegistersHouseStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '使用计划',
|
||||
dataIndex: 'usage_plan',
|
||||
valueEnum: HouseRegistersUsagePlanEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '客户类型',
|
||||
dataIndex: 'customer_type',
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/archive/house_registers/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Archive.HouseRegisters.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -1,229 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
HouseRegistersUsagePlanEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => [
|
||||
Selects?.AssetHouses({
|
||||
title: '选择房屋',
|
||||
key: 'asset_houses_id',
|
||||
params: { asset_projects_id: asset_projects_id },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 8 },
|
||||
}),
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseRegistersTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加客户',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`客户${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'house_relation',
|
||||
title: '房客关系',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '客户地址',
|
||||
dataIndex: 'address',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '解除时间',
|
||||
dataIndex: 'unbound_time',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'date',
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'relation_with_owner',
|
||||
title: '与产权人关系',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '是否在居住中',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '身份证正面',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '身份证反面',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
],
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权信息',
|
||||
max: 100,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'customer_type',
|
||||
title: '客户类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage_plan',
|
||||
title: '使用计划',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersUsagePlanEnum,
|
||||
}),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'status',
|
||||
// title: '状态',
|
||||
// colProps: { span: 24 },
|
||||
// valueEnum: HouseRegistersStatusEnum,
|
||||
// }),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersHouseStatusEnum,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,236 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
HouseRegistersUsagePlanEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue({
|
||||
...props.item,
|
||||
asset_houses_id: props.item?.asset_house?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => [
|
||||
Selects?.AssetHouses({
|
||||
title: '选择房屋',
|
||||
key: 'asset_houses_id',
|
||||
params: { asset_projects_id: asset_projects_id },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 8 },
|
||||
}),
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseRegistersTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加客户',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`客户${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'house_relation',
|
||||
title: '房客关系',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '客户地址',
|
||||
dataIndex: 'address',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '解除时间',
|
||||
dataIndex: 'unbound_time',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'date',
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'relation_with_owner',
|
||||
title: '与产权人关系',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '是否在居住中',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '身份证正面',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '身份证反面',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
],
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权信息',
|
||||
max: 100,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'customer_type',
|
||||
title: '客户类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage_plan',
|
||||
title: '使用计划',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersUsagePlanEnum,
|
||||
}),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'status',
|
||||
// title: '状态',
|
||||
// colProps: { span: 24 },
|
||||
// valueEnum: HouseRegistersStatusEnum,
|
||||
// }),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseRegistersHouseStatusEnum,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -13,7 +13,7 @@ import {
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { Space, Tag } from 'antd';
|
||||
import Delivery from './modals/Delivery';
|
||||
|
||||
export default function Index({ title = '房屋档案' }) {
|
||||
@ -27,76 +27,15 @@ export default function Index({ title = '房屋档案' }) {
|
||||
<MyPageContainer title={title}>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
// search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
|
||||
}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '房屋名称',
|
||||
dataIndex: 'full_name',
|
||||
},
|
||||
// {
|
||||
// title: '楼层',
|
||||
// dataIndex: 'floor',
|
||||
// render(_, record) {
|
||||
// return `${record?.floor}层`;
|
||||
// },
|
||||
// search: false,
|
||||
// width: 60,
|
||||
// },
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
render(_, record) {
|
||||
return `${record?.built_area} m²`;
|
||||
},
|
||||
search: false,
|
||||
width: 80,
|
||||
},
|
||||
// {
|
||||
// title: '套内面积',
|
||||
// dataIndex: 'inside_area',
|
||||
// render(_, record) {
|
||||
// return `${record?.inside_area} m²`;
|
||||
// },
|
||||
// search: false,
|
||||
// width: 80,
|
||||
// },
|
||||
{
|
||||
title: '计费面积',
|
||||
dataIndex: 'chargeable_area',
|
||||
render(_, record) {
|
||||
return `${record?.chargeable_area} m²`;
|
||||
},
|
||||
search: false,
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '产权人',
|
||||
render(_, record) {
|
||||
return (
|
||||
record?.house_occupants
|
||||
?.filter((res: any) => res?.house_relation !== 'Resident') // 过滤掉 Resident
|
||||
.map((res: any) => res?.name)
|
||||
.join(';') || '-'
|
||||
); // 无数据时显示 -
|
||||
},
|
||||
search: false,
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋状态',
|
||||
@ -104,23 +43,94 @@ export default function Index({ title = '房屋档案' }) {
|
||||
valueEnum: AssetHousesStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
}),
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
render(_, record) {
|
||||
return `${record?.built_area || ''} m²`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '产权人/住户',
|
||||
render(_, record) {
|
||||
const owners =
|
||||
record?.house_occupants?.filter(
|
||||
(res: any) => res?.house_relation === 'Owner',
|
||||
) || [];
|
||||
const residents =
|
||||
record?.house_occupants?.filter(
|
||||
(res: any) => res?.house_relation === 'Resident',
|
||||
) || [];
|
||||
|
||||
return (
|
||||
<div>
|
||||
{owners.length > 0 && (
|
||||
<div>
|
||||
<Tag color="blue">产权人</Tag>
|
||||
{owners.map((owner: any) => owner?.name).join('、')}
|
||||
</div>
|
||||
)}
|
||||
{residents.length > 0 && (
|
||||
<div style={{ marginTop: 4 }}>
|
||||
<Tag color="green">住户</Tag>
|
||||
{residents
|
||||
.map((resident: any) => resident?.name)
|
||||
.join('、')}
|
||||
</div>
|
||||
)}
|
||||
{owners.length === 0 && residents.length === 0 && (
|
||||
<Tag color="default">暂无</Tag>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
{item?.house_occupants?.length !== 0 && (
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/archive/asset_house/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{!item?.house_occupants?.length && (
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/archive/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
{!item?.house_occupants?.length ? (
|
||||
<Delivery
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="入户登记"
|
||||
/>
|
||||
) : (
|
||||
<MyButtons.Default
|
||||
title="客户管理"
|
||||
size="small"
|
||||
type="link"
|
||||
onClick={() => {
|
||||
navigate(`/archive/asset_house/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
@ -10,7 +10,6 @@ import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
HouseRegistersHouseStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -22,11 +21,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
form={form}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -41,6 +40,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return {
|
||||
...res,
|
||||
house_relation: 'Owner',
|
||||
house_status: 'SelfOccupied',
|
||||
relation_with_owner: 'Self',
|
||||
};
|
||||
}),
|
||||
@ -53,18 +53,34 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
MyFormItems.EnumRadio({
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '房屋状态',
|
||||
// colProps: { span: 12 },
|
||||
// valueEnum: HouseRegistersHouseStatusEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'house_status',
|
||||
// title: '使用计划',
|
||||
// colProps: { span: 8 },
|
||||
// valueEnum: HouseRegistersUsagePlanEnum,
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'customer_type',
|
||||
title: '客户类型',
|
||||
colProps: { span: 12 },
|
||||
title: '产权归属',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseRegistersCustomerTypeEnum,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseRegistersHouseStatusEnum,
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
tooltip: '上限3张',
|
||||
uploadType: 'file',
|
||||
max: 3,
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
@ -73,9 +89,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '增加产权人',
|
||||
style: { color: 'red' },
|
||||
danger: true,
|
||||
creatorButtonText: '添加产权人',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
@ -84,8 +98,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
title={`产权人${index + 1}`}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`产权人 ${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
@ -99,7 +113,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 5 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
@ -145,19 +159,19 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 4 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
title: '是否办理入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
@ -188,13 +202,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'ownership_info',
|
||||
title: '产权文件',
|
||||
max: 100,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -1,4 +1,4 @@
|
||||
import { MyPageContainer } from '@/common';
|
||||
import { MyPageContainer, usePageTabs } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
@ -8,15 +8,30 @@ import AssetAccounts from './components/AssetAccounts';
|
||||
import MyAssetBuildings from './components/AssetBuildings';
|
||||
import AssetGrid from './components/AssetGrid';
|
||||
import AssetInfo from './components/AssetInfo';
|
||||
import Basic from './components/Basic';
|
||||
|
||||
export default function Show({ title = '项目详情' }) {
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
// 注册当前页面为标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `asset-show-${id}`,
|
||||
tabLabel: data?.name || title || '资产详情',
|
||||
});
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
Apis.Asset.AssetProjects.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
// 更新标签页名称为API返回的name
|
||||
if (res?.data?.name) {
|
||||
addTab({
|
||||
key: `asset-show-${id}`,
|
||||
label: res.data.name,
|
||||
path: `/asset/${id}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
@ -56,11 +71,8 @@ export default function Show({ title = '项目详情' }) {
|
||||
// },
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
{/* <Info
|
||||
item={data}
|
||||
extra={<Update item={data} reload={() => loadShow()} title="项目" />}
|
||||
/> */}
|
||||
<MyPageContainer title={data?.name || title || '资产详情'}>
|
||||
<Basic item={data} reload={() => loadShow()} />
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
@ -1,242 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetHousesUsageEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
import BuildingsCreate from '../modals/BuildingsCreate';
|
||||
import AssetBuildingsUpdate from '../modals/BuildingsUpdate';
|
||||
import AssetHousesCreate from '../modals/HousesCreate';
|
||||
import HousesShow from '../modals/HousesShow';
|
||||
import HousesUpdate from '../modals/HousesUpdate';
|
||||
import AssetUnitsCreate from '../modals/UnitsCreate';
|
||||
import AssetUnitsUpdate from '../modals/UnitsUpdate';
|
||||
|
||||
export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
const actionBuildingsRef: any = useRef();
|
||||
const actionUnitsRef: any = useRef();
|
||||
const actionHousesRef: any = useRef();
|
||||
const [selectKey, setSelectkey] = useState<any>({});
|
||||
const [selectKeyUnits, setSelectKeyUnits] = useState<any>({});
|
||||
return (
|
||||
<ProCard
|
||||
title={
|
||||
<Space>
|
||||
<BuildingsCreate
|
||||
key="BuildingsCreate"
|
||||
item={props?.item}
|
||||
reload={() => actionBuildingsRef?.current?.reload()}
|
||||
title="楼栋"
|
||||
/>
|
||||
<AssetUnitsCreate
|
||||
key="UnitsCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
// asset_buildings_id: selectKey?.id || undefined,
|
||||
}}
|
||||
reload={() => actionUnitsRef?.current?.reload()}
|
||||
title="单元"
|
||||
/>
|
||||
<AssetHousesCreate
|
||||
key="HousesCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
// asset_buildings_id: selectKey?.id || undefined,
|
||||
// asset_units_id: selectKeyUnits?.id || undefined,
|
||||
}}
|
||||
reload={() => actionHousesRef?.current?.reload()}
|
||||
title="房屋"
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<Space align="start" size="large">
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionBuildingsRef}
|
||||
rowClassName={(record: any) => {
|
||||
console.log(selectKey?.id, 'key', record?.id);
|
||||
return selectKey?.id === record?.id ? 'ant-table-row-selected' : '';
|
||||
}}
|
||||
onRow={(record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
setSelectkey(record);
|
||||
setSelectKeyUnits({});
|
||||
actionUnitsRef?.current?.reload();
|
||||
actionHousesRef?.current?.reload();
|
||||
},
|
||||
style: {
|
||||
cursor: 'pointer',
|
||||
},
|
||||
};
|
||||
}}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, asset_projects_id: props?.item?.id },
|
||||
sort,
|
||||
Apis.Asset.AssetBuildings.List,
|
||||
)
|
||||
}
|
||||
options={false}
|
||||
columns={[
|
||||
// MyColumns.ID(),
|
||||
{
|
||||
title: '楼栋名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetBuildingsUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
|
||||
{selectKey?.id && (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionUnitsRef}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: selectKey?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetUnits.List,
|
||||
)
|
||||
}
|
||||
rowClassName={(record: any) => {
|
||||
return selectKeyUnits?.id === record?.id
|
||||
? 'ant-table-row-selected'
|
||||
: '';
|
||||
}}
|
||||
onRow={(record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
setSelectKeyUnits(record);
|
||||
actionHousesRef?.current?.reload();
|
||||
},
|
||||
style: {
|
||||
cursor: 'pointer',
|
||||
},
|
||||
};
|
||||
}}
|
||||
options={false}
|
||||
columns={[
|
||||
// MyColumns.ID(),
|
||||
{
|
||||
title: '单元名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetUnitsUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetUnits.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
|
||||
{selectKeyUnits?.id && (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionHousesRef}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: selectKey?.id,
|
||||
asset_units_id: selectKeyUnits?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetHouses.List,
|
||||
)
|
||||
}
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
}),
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
},
|
||||
// MyColumns.EnumTag({
|
||||
// title: '产权性质',
|
||||
// dataIndex: 'ownership_type',
|
||||
// valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// }),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '房屋状态',
|
||||
// dataIndex: 'status',
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// }),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<HousesShow item={item} reload={action?.reload} />
|
||||
<HousesUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="编辑"
|
||||
/>
|
||||
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
</ProCard>
|
||||
);
|
||||
}
|
||||
@ -7,7 +7,7 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import AssetAccountsSelect from '../modals/AssetAccountsSelect';
|
||||
import AssetAccountsSelect from './modals/AssetAccountsSelect';
|
||||
|
||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
337
src/pages/asset/components/AssetBuildings.tsx
Normal file
337
src/pages/asset/components/AssetBuildings.tsx
Normal file
@ -0,0 +1,337 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetHousesUsageEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { Alert, message, Space, Typography } from 'antd';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import BuildingsCreate from './modals/BuildingsCreate';
|
||||
import AssetBuildingsUpdate from './modals/BuildingsUpdate';
|
||||
import HousesCreate from './modals/HousesCreate';
|
||||
import HousesShow from './modals/HousesShow';
|
||||
import HousesUpdate from './modals/HousesUpdate';
|
||||
import AssetUnitsCreate from './modals/UnitsCreate';
|
||||
import AssetUnitsUpdate from './modals/UnitsUpdate';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
interface SelectedBuilding {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface SelectedUnit {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
const actionBuildingsRef: any = useRef();
|
||||
const actionUnitsRef: any = useRef();
|
||||
const actionHousesRef: any = useRef();
|
||||
const [selectedBuilding, setSelectedBuilding] =
|
||||
useState<SelectedBuilding | null>(null);
|
||||
const [selectedUnit, setSelectedUnit] = useState<SelectedUnit | null>(null);
|
||||
|
||||
// 选择楼栋的回调函数
|
||||
const handleBuildingSelect = useCallback((building: SelectedBuilding) => {
|
||||
setSelectedBuilding(building);
|
||||
setSelectedUnit(null); // 重置单元选择
|
||||
// 刷新单元和房屋列表
|
||||
actionUnitsRef?.current?.reload();
|
||||
actionHousesRef?.current?.reload();
|
||||
}, []);
|
||||
|
||||
// 选择单元的回调函数
|
||||
const handleUnitSelect = useCallback((unit: SelectedUnit) => {
|
||||
setSelectedUnit(unit);
|
||||
// 刷新房屋列表
|
||||
actionHousesRef?.current?.reload();
|
||||
}, []);
|
||||
|
||||
// 删除操作的通用处理
|
||||
const handleDelete = useCallback(
|
||||
async (deleteApi: any, id: number, reloadAction: any, itemName: string) => {
|
||||
try {
|
||||
await deleteApi({ id });
|
||||
message.success(`${itemName}删除成功`);
|
||||
reloadAction();
|
||||
} catch (error) {
|
||||
message.error(`${itemName}删除失败`);
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
return (
|
||||
<ProCard
|
||||
title={
|
||||
<Alert
|
||||
message="操作提示:单元/房屋添加,请先选择已有楼栋/单元"
|
||||
type="info"
|
||||
showIcon
|
||||
style={{ margin: 0 }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Space align="start" size="large" style={{ width: '100%' }}>
|
||||
{/* 楼栋列表 */}
|
||||
<div style={{ flex: 1, minWidth: 300 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
楼栋信息
|
||||
<BuildingsCreate
|
||||
key="BuildingsCreate"
|
||||
item={props?.item}
|
||||
reload={() => actionBuildingsRef?.current?.reload()}
|
||||
title="楼栋"
|
||||
/>
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionBuildingsRef}
|
||||
size="small"
|
||||
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: props?.item?.id },
|
||||
sort,
|
||||
Apis.Asset.AssetBuildings.List,
|
||||
)
|
||||
}
|
||||
options={false}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
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>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 单元列表 */}
|
||||
{selectedBuilding && (
|
||||
<div style={{ flex: 1, minWidth: 300 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
{selectedBuilding.name}
|
||||
{selectedBuilding && (
|
||||
<AssetUnitsCreate
|
||||
key="UnitsCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
}}
|
||||
reload={() => actionUnitsRef?.current?.reload()}
|
||||
title={`${selectedBuilding.name}单元`}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionUnitsRef}
|
||||
size="small"
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: props?.item?.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',
|
||||
},
|
||||
};
|
||||
}}
|
||||
options={false}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
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>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 房屋列表 */}
|
||||
{selectedUnit && (
|
||||
<div style={{ flex: 1, minWidth: 400 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
{selectedUnit.name}
|
||||
{selectedUnit && (
|
||||
<HousesCreate
|
||||
key="HousesCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
asset_units_id: selectedUnit?.id,
|
||||
}}
|
||||
reload={() => actionHousesRef?.current?.reload()}
|
||||
title={`${selectedUnit.name}房屋`}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
actionRef={actionHousesRef}
|
||||
size="small"
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
asset_units_id: selectedUnit?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetHouses.List,
|
||||
)
|
||||
}
|
||||
options={false}
|
||||
pagination={{
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
width: 80,
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
width: 100,
|
||||
}),
|
||||
MyColumns.Option({
|
||||
width: 150,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<HousesShow item={item} reload={action?.reload} />
|
||||
<HousesUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="编辑"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
handleDelete(
|
||||
Apis.Asset.AssetHouses.Delete,
|
||||
item.id,
|
||||
action?.reload,
|
||||
'房屋',
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Space>
|
||||
</ProCard>
|
||||
);
|
||||
}
|
||||
@ -3,9 +3,9 @@ import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import GridCreate from '../modals/GridCreate';
|
||||
import GridMannger from '../modals/GridMannger';
|
||||
import GridCreateUpdate from '../modals/GridUpdate';
|
||||
import GridCreate from './modals/GridCreate';
|
||||
import GridMannger from './modals/GridMannger';
|
||||
import GridCreateUpdate from './modals/GridUpdate';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -7,38 +7,20 @@ import {
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import AssetUpdate from '../modals/AssetUpdate';
|
||||
import BindCompany from '../modals/BindCompany';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
<Space>
|
||||
<div>
|
||||
【{props?.item?.id}】{props?.item?.name}
|
||||
</div>
|
||||
<AssetUpdate
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目别名">
|
||||
{props?.item?.alias_name}
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="项目编码">
|
||||
{props?.item?.code}
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
<ProDescriptions.Item label="项目地址" span={2}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目类型">
|
||||
<renderTextHelper.Tag
|
||||
@ -47,11 +29,11 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
key="property_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费方式">
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
@ -61,42 +43,29 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
key="entrust_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费方式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="接管日期">
|
||||
{props?.item?.takeover_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="封园日期">
|
||||
{props?.item?.closure_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目地址" span={3}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建日期" span={3}>
|
||||
|
||||
<ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改" span={3}>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="关联机构" span={3}>
|
||||
<Space>
|
||||
<div>
|
||||
【{props?.item?.company?.id}】{props?.item?.company?.name}
|
||||
</div>
|
||||
<BindCompany
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
36
src/pages/asset/components/Basic.tsx
Normal file
36
src/pages/asset/components/Basic.tsx
Normal file
@ -0,0 +1,36 @@
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import AssetUpdate from '../modals/AssetUpdate';
|
||||
import BindCompany from './modals/BindCompany';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
<Space size="large">
|
||||
<div>{props?.item?.name}</div>
|
||||
<AssetUpdate
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联机构" span={3}>
|
||||
<Space size="large">
|
||||
<div>{props?.item?.company?.name}</div>
|
||||
<BindCompany
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
@ -11,10 +11,10 @@ import { message } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
const modalRef:any = useRef(null);
|
||||
const modalRef: any = useRef(null);
|
||||
const [selectedProjectsIds, setSelectedProjectsIds] = useState<any>([]);
|
||||
const onShowContactPhone = () => {
|
||||
console.log(selectedProjectsIds,'selectedProjectsIds')
|
||||
console.log(selectedProjectsIds, 'selectedProjectsIds');
|
||||
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
||||
companies_id: props?.item?.companies_id ?? 0,
|
||||
projects_id: props?.item?.id,
|
||||
@ -23,7 +23,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('收款账号添加成功!');
|
||||
console.log(modalRef,'modalRef.current')
|
||||
console.log(modalRef, 'modalRef.current');
|
||||
modalRef.current?.close();
|
||||
// todo 关闭页面
|
||||
})
|
||||
@ -59,7 +59,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
rowSelection={{
|
||||
type: 'radio',
|
||||
onChange: (selectedRowKeys) => {
|
||||
console.log(selectedRowKeys,'selectedRowKeys')
|
||||
console.log(selectedRowKeys, 'selectedRowKeys');
|
||||
setSelectedProjectsIds(selectedRowKeys);
|
||||
},
|
||||
}}
|
||||
@ -7,20 +7,15 @@ import {
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.BindCompany>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title="编辑"
|
||||
type="primary"
|
||||
size="small"
|
||||
/>
|
||||
}
|
||||
title={`调整${props.title}`}
|
||||
trigger={<MyButtons.Default title="调整" type="primary" size="small" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
request={() =>
|
||||
@ -28,8 +23,18 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
...props.item,
|
||||
})
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetProjects.BindCompany({ ...values, projects_id: props.item?.id ?? 0 })
|
||||
Apis.Asset.AssetProjects.BindCompany({
|
||||
...values,
|
||||
projects_id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '关联机构修改成功');
|
||||
@ -38,7 +43,6 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
@ -8,7 +8,6 @@ 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();
|
||||
|
||||
@ -16,15 +15,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetBuildings.Store>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`添加${props.title}`}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
key={new Date().getTime()}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetBuildings.Store({
|
||||
...values,
|
||||
@ -8,7 +8,6 @@ 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();
|
||||
|
||||
@ -19,11 +18,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title={`编辑` } size='small' type='link'
|
||||
/>
|
||||
}
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
@ -20,6 +20,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
width="700px"
|
||||
trigger={<MyButtons.Create title={`创建网格`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -68,7 +69,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`添加单元${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
@ -20,6 +20,7 @@ export default function Create(
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
trigger={<MyButtons.Default title="网格员" type="link" />}
|
||||
request={() => Promise.resolve(props.item)}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -20,6 +20,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
width="700px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
Apis.Grid.Grids.Show({ id: props?.item?.id }).then((res) => {
|
||||
@ -70,7 +71,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 8 }}
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`添加单元${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
@ -5,7 +5,6 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
@ -27,6 +26,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
width="800px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -36,6 +36,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
Apis.Asset.AssetHouses.Store({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
||||
asset_units_id: props?.item?.asset_units_id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -46,64 +48,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
}
|
||||
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: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: () => {
|
||||
form.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_floors_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '用途',
|
||||
@ -111,22 +60,18 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
// {
|
||||
// key: 'ownership_term',
|
||||
// title: '产权年限',
|
||||
// fieldProps: {
|
||||
// addonAfter: '年',
|
||||
// },
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'built_area',
|
||||
title: '建筑面积',
|
||||
@ -136,6 +81,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'inside_area',
|
||||
@ -146,6 +92,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'chargeable_area',
|
||||
@ -156,33 +103,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
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: 'full_name',
|
||||
// title: '房屋全称',
|
||||
// colProps: { span: 12 },
|
||||
// },
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '房屋朝向',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
@ -193,7 +115,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '房',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'hall',
|
||||
@ -202,7 +124,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '厅',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'bathroom',
|
||||
@ -211,7 +133,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '卫',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'kitchen',
|
||||
@ -229,10 +151,46 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '阳台',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '房屋朝向',
|
||||
colProps: { span: 24 },
|
||||
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 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -23,11 +23,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="900px"
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
@ -62,7 +63,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
@ -80,58 +81,42 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '房屋用途',
|
||||
title: '用途',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
// {
|
||||
// key: 'ownership_term',
|
||||
// title: '产权年限',
|
||||
// fieldProps: {
|
||||
// addonAfter: '年',
|
||||
// },
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'built_area',
|
||||
title: '建筑面积',
|
||||
@ -141,6 +126,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'inside_area',
|
||||
@ -151,6 +137,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
{
|
||||
key: 'chargeable_area',
|
||||
@ -161,27 +148,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
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: 'full_name',
|
||||
// title: '房屋全称',
|
||||
// colProps: { span: 12 },
|
||||
// },
|
||||
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
@ -192,7 +160,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '房',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'hall',
|
||||
@ -201,7 +169,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '厅',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'bathroom',
|
||||
@ -210,7 +178,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '卫',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
{
|
||||
key: 'kitchen',
|
||||
@ -228,17 +196,46 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
addonAfter: '阳台',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
colProps: { span: 5 },
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '朝向',
|
||||
title: '房屋朝向',
|
||||
colProps: { span: 24 },
|
||||
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 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -5,7 +5,6 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetUnitsBuildingStructureEnum,
|
||||
@ -22,13 +21,9 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`添加${props.title}`}
|
||||
// disabled={!props?.item?.asset_buildings_id}
|
||||
/>
|
||||
}
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -38,6 +33,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
Apis.Asset.AssetUnits.Store({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -47,15 +43,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params:{
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span:24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '单元名称',
|
||||
@ -23,6 +23,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
@ -47,7 +48,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
@ -98,7 +98,7 @@ export default function Index({ title = '项目管理' }) {
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/asset/asset_projects/${item.id}`);
|
||||
navigate(`/asset/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
@ -15,16 +15,24 @@ import {
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetProjects.Store(values)
|
||||
.then(() => {
|
||||
@ -44,68 +52,53 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '项目别名',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 6 },
|
||||
// formItemProps: { ...rulesHelper.number },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
// {
|
||||
// key: 'code',
|
||||
// title: '项目编码',
|
||||
// colProps: { span: 8 },
|
||||
// // formItemProps: { ...rulesHelper.text },
|
||||
// },
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 16 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'longitude',
|
||||
title: '经度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
title: '纬度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'property_type',
|
||||
title: '项目类型',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'status',
|
||||
title: '项目状态',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'entrust_type',
|
||||
title: '委托类型',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'charge',
|
||||
title: '收费方式',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
@ -118,7 +111,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'closure_date',
|
||||
@ -129,7 +122,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
@ -15,16 +15,25 @@ import {
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
request={() =>
|
||||
Promise.resolve({
|
||||
...props.item,
|
||||
@ -55,68 +64,53 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '项目别名',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
// {
|
||||
// key: 'code',
|
||||
// title: '项目编码',
|
||||
// colProps: { span: 8 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// },
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 16 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'longitude',
|
||||
title: '经度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
title: '纬度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'property_type',
|
||||
title: '项目类型',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'status',
|
||||
title: '项目状态',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'entrust_type',
|
||||
title: '委托类型',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'charge',
|
||||
title: '收费方式',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
@ -129,7 +123,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'closure_date',
|
||||
@ -140,7 +134,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
132
src/pages/asset_houses/index.tsx
Normal file
132
src/pages/asset_houses/index.tsx
Normal file
@ -0,0 +1,132 @@
|
||||
import {
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import HousesShow from '../asset/components/modals/HousesShow';
|
||||
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
||||
|
||||
export default function Index({ title = '房屋列表' }) {
|
||||
const navigate = useNavigate();
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'asset-houses',
|
||||
tabLabel: title,
|
||||
});
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
|
||||
}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '房屋名称',
|
||||
dataIndex: 'full_name',
|
||||
ellipsis: true,
|
||||
},
|
||||
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
}),
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
render(_, record) {
|
||||
return `${record?.built_area || ''} m²`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '套内面积',
|
||||
dataIndex: 'inside_area',
|
||||
render(_, record) {
|
||||
return `${record?.inside_area || ''} m²`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '计费面积',
|
||||
dataIndex: 'chargeable_area',
|
||||
render(_, record) {
|
||||
return `${record?.chargeable_area || ''} m²`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '户型',
|
||||
render(_, record) {
|
||||
return `${record?.room || ''}室${record?.hall || ''}厅${
|
||||
record?.bathroom || ''
|
||||
}卫${record?.kitchen || ''}厨${record?.balcony || ''}阳台`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '朝向',
|
||||
dataIndex: 'orientation',
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetHousesStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '产权年限',
|
||||
dataIndex: 'ownership_term',
|
||||
render(_, record) {
|
||||
return `${record?.ownership_term || '-'} 年`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<HousesShow item={item} reload={action?.reload} />
|
||||
<HousesUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="编辑"
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
113
src/pages/banner/index.tsx
Normal file
113
src/pages/banner/index.tsx
Normal file
@ -0,0 +1,113 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import BannerCreate from './modals/BannerCreate';
|
||||
import BannerShow from './modals/BannerShow';
|
||||
import BannerUpdate from './modals/BannerUpdate';
|
||||
|
||||
export default function Index({ title = '广告内容' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'banners',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="banners"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Banner.Banners.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<BannerCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '广告名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: BannersTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '跳转类型',
|
||||
dataIndex: 'redirect_type',
|
||||
valueEnum: BannersRedirectTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '开始时间',
|
||||
dataIndex: 'start_time',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
dataIndex: 'end_time',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '广告位',
|
||||
dataIndex: ['banner_space', 'name'],
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.banner_space?.name;
|
||||
},
|
||||
},
|
||||
{
|
||||
//创建日期
|
||||
title: '创建日期',
|
||||
dataIndex: 'created_at',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.created_at?.substring(0, 10);
|
||||
},
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<BannerShow item={item} />
|
||||
<BannerUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Banner.Banners.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
160
src/pages/banner/modals/BannerCreate.tsx
Normal file
160
src/pages/banner/modals/BannerCreate.tsx
Normal file
@ -0,0 +1,160 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
|
||||
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.Banner.Banners.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.Banner.Banners.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加广告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.GetBannerSpace({
|
||||
key: 'banner_spaces_id',
|
||||
title: '选择广告位',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '内容名称',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '展示类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: BannersTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['type'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ type }: any) => {
|
||||
return type === 'Text'
|
||||
? [
|
||||
{
|
||||
title: '文本内容',
|
||||
key: ['source', 0, 'text'],
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: type === 'Image'
|
||||
? [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'source',
|
||||
title: '广告图片',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
]
|
||||
: type === 'Video'
|
||||
? [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'source',
|
||||
title: '广告视频',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'redirect_type',
|
||||
title: '跳转类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: BannersRedirectTypeEnum,
|
||||
required: false,
|
||||
}),
|
||||
{
|
||||
key: 'redirect_path',
|
||||
title: '跳转链接',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
placeholder: '请输入跳转链接',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ['redirect_type'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ redirect_type }: any) => {
|
||||
return redirect_type === 'AnotherMiniProgram'
|
||||
? [
|
||||
{
|
||||
title: '小程序AppID',
|
||||
dataIndex: 'app_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'start_time',
|
||||
title: '开始时间',
|
||||
valueType: 'dateTime',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'end_time',
|
||||
title: '结束时间',
|
||||
valueType: 'dateTime',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
150
src/pages/banner/modals/BannerShow.tsx
Normal file
150
src/pages/banner/modals/BannerShow.tsx
Normal file
@ -0,0 +1,150 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Image, Space, Typography } from 'antd';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
// 根据类型渲染内容
|
||||
const renderContent = () => {
|
||||
const { type, source } = props?.item || {};
|
||||
if (!source || !Array.isArray(source) || source.length === 0) {
|
||||
return <Text type="secondary">暂无内容</Text>;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'Text':
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: '12px',
|
||||
backgroundColor: '#f5f5f5',
|
||||
borderRadius: '6px',
|
||||
maxWidth: '100%',
|
||||
wordBreak: 'break-word',
|
||||
}}
|
||||
>
|
||||
<Text>{source?.[0]?.text}</Text>
|
||||
</div>
|
||||
);
|
||||
|
||||
case 'Image':
|
||||
return (
|
||||
<Image.PreviewGroup>
|
||||
{source.map((res: any, index: number) => (
|
||||
<Space key={index} style={{ paddingRight: 10 }}>
|
||||
<Image height={80} src={res?.url || ''} />
|
||||
</Space>
|
||||
))}
|
||||
</Image.PreviewGroup>
|
||||
);
|
||||
|
||||
case 'Video':
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
gap: '8px',
|
||||
maxWidth: '100%',
|
||||
}}
|
||||
>
|
||||
{source.map((res: any, index: number) => (
|
||||
<video
|
||||
key={index}
|
||||
width={240}
|
||||
height={180}
|
||||
controls
|
||||
style={{
|
||||
objectFit: 'cover',
|
||||
borderRadius: '6px',
|
||||
maxWidth: '100%',
|
||||
}}
|
||||
>
|
||||
<source src={res?.url || ''} />
|
||||
您的浏览器不支持视频播放
|
||||
</video>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
default:
|
||||
return <Text type="secondary">未知内容类型</Text>;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
width="90vw"
|
||||
style={{ maxWidth: '1000px' }}
|
||||
node={
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard bordered>
|
||||
<ProDescriptions
|
||||
bordered
|
||||
column={{ xs: 1, sm: 2, md: 3 }}
|
||||
size="small"
|
||||
>
|
||||
<ProDescriptions.Item label="内容名称" span={3}>
|
||||
{props?.item?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="展示类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={BannersTypeEnum}
|
||||
value={props?.item?.type}
|
||||
key="type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="开始时间">
|
||||
{props?.item?.start_time || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="结束时间">
|
||||
{props?.item?.end_time || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="排序">
|
||||
{props?.item?.sort || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建时间">
|
||||
{props?.item?.create_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="更新时间">
|
||||
{props?.item?.updated_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
|
||||
<ProCard title="跳转设置" bordered>
|
||||
<ProDescriptions
|
||||
bordered
|
||||
column={{ xs: 1, sm: 2, md: 3 }}
|
||||
size="small"
|
||||
>
|
||||
<ProDescriptions.Item label="跳转类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={BannersRedirectTypeEnum}
|
||||
value={props?.item?.redirect_type}
|
||||
key="redirect_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
{props?.item?.redirect_type === 'AnotherMiniProgram' && (
|
||||
<ProDescriptions.Item label="小程序AppID" span={2}>
|
||||
{props?.item?.app_id || '-'}
|
||||
</ProDescriptions.Item>
|
||||
)}
|
||||
<ProDescriptions.Item label="跳转链接" span={2}>
|
||||
{props?.item?.redirect_path || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
|
||||
<ProCard title="广告内容" bordered>
|
||||
<div style={{ padding: '16px 0' }}>{renderContent()}</div>
|
||||
</ProCard>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
161
src/pages/banner/modals/BannerUpdate.tsx
Normal file
161
src/pages/banner/modals/BannerUpdate.tsx
Normal file
@ -0,0 +1,161 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
|
||||
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.Banner.Banners.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.Banner.Banners.Update({ ...values, id: props.item?.id ?? 0 })
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('编辑广告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.GetBannerSpace({
|
||||
key: 'banner_spaces_id',
|
||||
title: '选择广告位',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '内容名称',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '展示类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: BannersTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['type'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ type }: any) => {
|
||||
return type === 'Text'
|
||||
? [
|
||||
{
|
||||
key: ['source', 0, 'text'],
|
||||
title: '文本内容',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: type === 'Image'
|
||||
? [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'source',
|
||||
title: '广告图片',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
]
|
||||
: type === 'Video'
|
||||
? [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'source',
|
||||
title: '广告视频',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'redirect_type',
|
||||
title: '跳转类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: BannersRedirectTypeEnum,
|
||||
required: false,
|
||||
}),
|
||||
{
|
||||
key: 'redirect_path',
|
||||
title: '跳转链接',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
placeholder: '请输入跳转链接',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ['redirect_type'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ redirect_type }: any) => {
|
||||
return redirect_type === 'AnotherMiniProgram'
|
||||
? [
|
||||
{
|
||||
title: '小程序AppID',
|
||||
dataIndex: 'app_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'start_time',
|
||||
title: '开始时间',
|
||||
valueType: 'dateTime',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'end_time',
|
||||
title: '结束时间',
|
||||
valueType: 'dateTime',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
52
src/pages/banner_space/$id.tsx
Normal file
52
src/pages/banner_space/$id.tsx
Normal file
@ -0,0 +1,52 @@
|
||||
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 { useEffect, useState } from 'react';
|
||||
import BannerList from './components/BannerList';
|
||||
import BannerSpaceInfo from './components/BannerSpaceInfo';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
// 注册当前页面为标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `banner-space-${id}`,
|
||||
tabLabel: data?.name || title || '广告位详情',
|
||||
});
|
||||
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
Apis.Banner.BannerSpaces.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadShow();
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '广告投放',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: (
|
||||
<BannerList
|
||||
item={{ ...data, banner_spaces_id: id }}
|
||||
reload={() => loadShow()}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<BannerSpaceInfo item={data} reload={loadShow} />
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
</ProCard>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
83
src/pages/banner_space/components/BannerList.tsx
Normal file
83
src/pages/banner_space/components/BannerList.tsx
Normal file
@ -0,0 +1,83 @@
|
||||
import { MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
|
||||
import BannerCreate from '@/pages/banner/modals/BannerCreate';
|
||||
import BannerShow from '@/pages/banner/modals/BannerShow';
|
||||
import BannerUpdate from '@/pages/banner/modals/BannerUpdate';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
useEffect(() => {
|
||||
actionLooks?.current.reloadAndRest();
|
||||
}, [rest.loadmore]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ProTable<Record<any, any>>
|
||||
{...MyProTableProps.props}
|
||||
actionRef={actionLooks}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
banner_spaces_id: rest.item?.banner_spaces_id,
|
||||
},
|
||||
sort,
|
||||
Apis.Banner.Banners.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<BannerCreate
|
||||
key="AddOccupant"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="添加住户"
|
||||
/>,
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '广告名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: BannersTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '跳转类型',
|
||||
dataIndex: 'redirect_type',
|
||||
valueEnum: BannersRedirectTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '开始时间',
|
||||
dataIndex: 'start_time',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
dataIndex: 'end_time',
|
||||
valueType: 'dateTime',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<BannerShow item={item} reload={action?.reload} />
|
||||
<BannerUpdate item={item} reload={action?.reload} />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
31
src/pages/banner_space/components/BannerSpaceInfo.tsx
Normal file
31
src/pages/banner_space/components/BannerSpaceInfo.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { BannerSpacesTypeEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
const { item } = props;
|
||||
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard title="基本信息">
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="名称" span={2}>
|
||||
{item?.name}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={BannerSpacesTypeEnum}
|
||||
value={item?.type}
|
||||
key="type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="备注">
|
||||
{item?.remark}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
91
src/pages/banner_space/index.tsx
Normal file
91
src/pages/banner_space/index.tsx
Normal file
@ -0,0 +1,91 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannerSpacesTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import BannerSpaceCreate from './modals/BannerSpaceCreate';
|
||||
import BannerSpaceUpdate from './modals/BannerSpaceUpdate';
|
||||
|
||||
export default function Index({ title = '广告位' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'banner-spaces',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="banner-spaces"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Banner.BannerSpaces.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<BannerSpaceCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '广告位名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: BannerSpacesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remark',
|
||||
search: false,
|
||||
ellipsis: true,
|
||||
},
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
onClick={() => {
|
||||
navigate(`/banner_space/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<BannerSpaceUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Banner.BannerSpaces.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
58
src/pages/banner_space/modals/BannerSpaceCreate.tsx
Normal file
58
src/pages/banner_space/modals/BannerSpaceCreate.tsx
Normal file
@ -0,0 +1,58 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannerSpacesTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Banner.BannerSpaces.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加广告位`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加广告位`} />}
|
||||
onFinish={async (values) =>
|
||||
Apis.Banner.BannerSpaces.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加广告位成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '广告位名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: BannerSpacesTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
rows: 4,
|
||||
maxLength: 500,
|
||||
showCount: true,
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
66
src/pages/banner_space/modals/BannerSpaceUpdate.tsx
Normal file
66
src/pages/banner_space/modals/BannerSpaceUpdate.tsx
Normal file
@ -0,0 +1,66 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BannerSpacesTypeEnum } from '@/gen/Enums';
|
||||
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.Banner.BannerSpaces.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.Banner.BannerSpaces.Update({ ...values, id: props.item?.id ?? 0 })
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('编辑广告位成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '广告位名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: BannerSpacesTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'remark',
|
||||
title: '备注',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
rows: 4,
|
||||
maxLength: 500,
|
||||
showCount: true,
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -9,21 +9,21 @@ import { Apis } from '@/gen/Apis';
|
||||
import { HouseBillsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import Create from './modals/Create';
|
||||
import Update from './modals/Update';
|
||||
import BillCreate from './modals/BillCreate';
|
||||
import BillUpdate from './modals/BillUpdate';
|
||||
|
||||
export default function Index({ title = '账单' }) {
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'house-bills',
|
||||
tabKey: 'bills',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="house-bills"
|
||||
tabKey="bills"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
@ -32,7 +32,7 @@ export default function Index({ title = '账单' }) {
|
||||
MyProTableProps.request(params, sort, Apis.Bill.HouseBills.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<Create key="Create" reload={action?.reload} title={title} />,
|
||||
<BillCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
@ -52,61 +52,46 @@ export default function Index({ title = '账单' }) {
|
||||
},
|
||||
{
|
||||
title: '账单月份',
|
||||
dataIndex: 'month',
|
||||
width: 100,
|
||||
render: (_, record) => {
|
||||
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '账单金额',
|
||||
dataIndex: 'amount',
|
||||
search: false,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '优惠金额',
|
||||
dataIndex: 'discount_amount',
|
||||
search: false,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '滞纳金',
|
||||
dataIndex: 'late_fee',
|
||||
search: false,
|
||||
width: 100,
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '计费开始日期',
|
||||
// dataIndex: 'start_date',
|
||||
// search: false,
|
||||
// width: 120,
|
||||
// },
|
||||
// {
|
||||
// title: '计费结束日期',
|
||||
// dataIndex: 'end_date',
|
||||
// search: false,
|
||||
// width: 120,
|
||||
// },
|
||||
// {
|
||||
// title: '滞纳金起算日期',
|
||||
// dataIndex: 'late_start_date',
|
||||
// search: false,
|
||||
// },
|
||||
// {
|
||||
// title: '已收滞纳金天数',
|
||||
// dataIndex: 'collected_late_fee_days',
|
||||
// search: false,
|
||||
// // },
|
||||
// {
|
||||
{
|
||||
title: '计费开始日期',
|
||||
dataIndex: 'start_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '计费结束日期',
|
||||
dataIndex: 'end_date',
|
||||
search: false,
|
||||
},
|
||||
|
||||
// title: '备注',
|
||||
// dataIndex: 'remark',
|
||||
// search: false,
|
||||
// },
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Update item={item} reload={action?.reload} title={title} />
|
||||
<BillUpdate item={item} reload={action?.reload} title={title} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
@ -20,6 +20,8 @@ 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(); // 清空表单数据
|
||||
@ -97,6 +99,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
];
|
||||
},
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '收费项目',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseBillsTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'amount',
|
||||
title: '账单金额',
|
||||
@ -134,28 +143,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '收费项目',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseBillsTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'month',
|
||||
title: '账单月份',
|
||||
valueType: 'date',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM-01',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
|
||||
{
|
||||
key: 'start_date',
|
||||
title: '计费开始日期',
|
||||
@ -180,6 +168,21 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'month',
|
||||
title: '账单月份',
|
||||
valueType: 'date',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
@ -211,30 +214,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'late_start_date',
|
||||
title: '滞纳金起算日期',
|
||||
valueType: 'date',
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'collected_late_fee_days',
|
||||
title: '已收滞纳金天数',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '天',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'remark',
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseBillsTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -19,10 +20,21 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
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);
|
||||
const formValues = {
|
||||
...props.item,
|
||||
month:
|
||||
props.item.year && props.item.month
|
||||
? `${props.item.year}-${String(props.item.month).padStart(
|
||||
2,
|
||||
'0',
|
||||
)}`
|
||||
: props.item.month,
|
||||
};
|
||||
form.setFieldsValue(formValues);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
@ -78,21 +90,6 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
|
||||
{
|
||||
key: 'month',
|
||||
title: '账单月份',
|
||||
valueType: 'date',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'start_date',
|
||||
title: '计费开始日期',
|
||||
@ -118,27 +115,50 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'late_start_date',
|
||||
title: '滞纳金起算日期',
|
||||
key: 'month',
|
||||
title: '账单月份',
|
||||
valueType: 'date',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'collected_late_fee_days',
|
||||
title: '已收滞纳金天数',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '天',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.ProjectAccounts({
|
||||
key: 'company_receipt_accounts_id',
|
||||
title: '选择收款账户',
|
||||
params: {
|
||||
projects_id: asset_projects_id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: () => {
|
||||
form.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_floors_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
@ -1,4 +1,4 @@
|
||||
import { MyPageContainer } from '@/common';
|
||||
import { MyPageContainer, usePageTabs } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
@ -10,14 +10,28 @@ import Organizations from './components/Organizations';
|
||||
import Positions from './components/Positions';
|
||||
import Projects from './components/Projects';
|
||||
import ReceiptAccounts from './components/ReceiptAccounts';
|
||||
export default function Show({ title = '机构详情' }) {
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
|
||||
// 注册当前页面为标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `company-show-${id}`,
|
||||
tabLabel: data?.short_name || title || '资产详情',
|
||||
});
|
||||
const loadShow = () => {
|
||||
let paramsId: any = { id: id ?? 0 };
|
||||
Apis.Company.Companies.Show(paramsId).then((res) => {
|
||||
setShow(res?.data);
|
||||
// 更新标签页名称为API返回的name
|
||||
if (res?.data?.short_name) {
|
||||
addTab({
|
||||
key: `company-show-${id}`,
|
||||
label: res.data.short_name,
|
||||
path: `/company/${id}`,
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
@ -25,45 +39,40 @@ export default function Show({ title = '机构详情' }) {
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '基本信息',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: <ComponentsInfo item={data} reload={() => loadShow()} />,
|
||||
},
|
||||
{
|
||||
label: '项目管理',
|
||||
key: '2',
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: <Projects item={data} />,
|
||||
},
|
||||
{
|
||||
label: '组织管理',
|
||||
key: '3',
|
||||
key: '2',
|
||||
closable: false,
|
||||
children: <Organizations item={data} />,
|
||||
},
|
||||
{
|
||||
label: '岗位管理',
|
||||
key: '3',
|
||||
closable: false,
|
||||
children: <Positions item={data} />,
|
||||
},
|
||||
{
|
||||
label: '员工管理',
|
||||
key: '4',
|
||||
closable: false,
|
||||
children: <Employees item={data} />,
|
||||
},
|
||||
{
|
||||
label: '岗位管理',
|
||||
key: '5',
|
||||
closable: false,
|
||||
children: <Positions item={data} />,
|
||||
},
|
||||
{
|
||||
label: '收款账号',
|
||||
key: '6',
|
||||
key: '5',
|
||||
closable: false,
|
||||
children: <ReceiptAccounts item={data} />,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ComponentsInfo item={data} />
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
@ -2,17 +2,24 @@ import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import Update from '../modals/Update';
|
||||
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="机构名称" span={3}>
|
||||
<ProDescriptions.Item label="机构简称">
|
||||
{props?.item?.short_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构名称" span={2}>
|
||||
<Space>
|
||||
{props?.item?.name}
|
||||
<Update item={props?.item} title="机构" reload={props?.reload} />
|
||||
<CompanyUpdate
|
||||
item={props?.item}
|
||||
title="机构"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="商户类型">
|
||||
@ -22,13 +29,11 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
key="merchant_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构简称">
|
||||
{props?.item?.short_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="营业执照号">
|
||||
|
||||
<ProDescriptions.Item label="营业执照号" span={2}>
|
||||
{props?.item?.business_license_number}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
|
||||
<ProDescriptions.Item label="联系人姓名">
|
||||
{props?.item?.contact_name}
|
||||
</ProDescriptions.Item>
|
||||
@ -38,16 +43,16 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions.Item label="联系人邮箱">
|
||||
{props?.item?.contact_email}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="机构地址" span={3}>
|
||||
<ProDescriptions.Item label="机构地址">
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建日期" span={3}>
|
||||
<ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改" span={3}>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import EmployeesCreate from '../modals/EmployeesCreate';
|
||||
import EmployeesUpdate from '../modals/EmployeesUpdate';
|
||||
import EmployeeCreate from './modals/EmployeeCreate';
|
||||
import EmployeeUpdate from './modals/EmployeeUpdate';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -23,7 +23,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<EmployeesCreate
|
||||
<EmployeeCreate
|
||||
key="Create"
|
||||
item={{ companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
@ -35,7 +35,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
MyColumns.ID(),
|
||||
//to-do 按层级选择
|
||||
{
|
||||
title: '组织',
|
||||
title: '所在组织',
|
||||
dataIndex: ['organization', 'name'],
|
||||
search: false,
|
||||
},
|
||||
@ -57,7 +57,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<EmployeesUpdate
|
||||
<EmployeeUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="员工"
|
||||
@ -8,16 +8,15 @@ import { Apis } from '@/gen/Apis';
|
||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import OrganizationsChange from '../modals/OrganizationsChange';
|
||||
import OrganizationsCreate from '../modals/OrganizationsCreate';
|
||||
import OrganizationsUpdate from '../modals/OrganizationsUpdate';
|
||||
import OrganizationChange from './modals/OrganizationChange';
|
||||
import OrganizationCreate from './modals/OrganizationCreate';
|
||||
import OrganizationUpdate from './modals/OrganizationUpdate';
|
||||
|
||||
export default function Organizations(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
// search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, companies_id: props?.item?.id },
|
||||
@ -26,13 +25,14 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<OrganizationsCreate
|
||||
<OrganizationCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
title="组织"
|
||||
/>,
|
||||
]}
|
||||
// search={false}
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.EnumTag({
|
||||
@ -55,30 +55,15 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
dataIndex: ['organization_parent', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '上级组织ID',
|
||||
dataIndex: ['organization_parent', 'id'],
|
||||
search: false,
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '负责人',
|
||||
// dataIndex: ['manager', 'name'],
|
||||
// },
|
||||
// {
|
||||
// title: '联系电话',
|
||||
// dataIndex: 'manager_phone',
|
||||
// },
|
||||
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OrganizationsChange
|
||||
<OrganizationChange
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
<OrganizationsUpdate
|
||||
<OrganizationUpdate
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import PositionsCreate from '../modals/PositionsCreate';
|
||||
import PositionsUpdate from '../modals/PositionsUpdate';
|
||||
import PositionCreate from './modals/PositionCreate';
|
||||
import PositionUpdate from './modals/PositionUpdate';
|
||||
|
||||
export default function Organizations(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -24,7 +24,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<PositionsCreate
|
||||
<PositionCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
@ -62,7 +62,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<PositionsUpdate
|
||||
<PositionUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="岗位"
|
||||
@ -5,7 +5,10 @@ import {
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetProjectsPropertyTypeEnum } from '@/gen/Enums';
|
||||
import {
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@ -17,7 +20,6 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
<>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, companies_id: props?.item?.id },
|
||||
@ -33,25 +35,26 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
// title="组织"
|
||||
// />,
|
||||
// ]}
|
||||
// options={false}
|
||||
// search={false}
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '项目类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '项目编码',
|
||||
// dataIndex: 'code',
|
||||
// search: false,
|
||||
// },
|
||||
MyColumns.EnumTag({
|
||||
title: '项目状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '地址',
|
||||
render: (_, i: any) => {
|
||||
@ -61,39 +64,19 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
// MyColumns.EnumTag({
|
||||
// title: '项目状态',
|
||||
// dataIndex: 'status',
|
||||
// valueEnum: AssetProjectsStatusEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
|
||||
// MyColumns.EnumTag({
|
||||
// title: '委托类型',
|
||||
// dataIndex: 'entrust_type',
|
||||
// valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '收费方式',
|
||||
// dataIndex: 'charge',
|
||||
// valueEnum: AssetProjectsChargeEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
onRestore: Apis.Asset.AssetProjects.Restore,
|
||||
onSoftDelete: Apis.Asset.AssetProjects.SoftDelete,
|
||||
search: false,
|
||||
}),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/asset/asset_projects/${item.id}`);
|
||||
navigate(`/asset/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import ReceiptAccountsCreate from '../modals/ReceiptAccountsCreate';
|
||||
import ReceiptAccountsUpdate from '../modals/ReceiptAccountsUpdate';
|
||||
import ReceiptAccountCreate from './modals/ReceiptAccountCreate';
|
||||
import ReceiptAccountUpdate from './modals/ReceiptAccountUpdate';
|
||||
|
||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -24,7 +24,7 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ReceiptAccountsCreate
|
||||
<ReceiptAccountCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
@ -52,20 +52,20 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
search: false,
|
||||
// width: 200,
|
||||
},
|
||||
{
|
||||
title: '是否默认',
|
||||
dataIndex: 'is_default',
|
||||
search: false,
|
||||
render(_, record) {
|
||||
return `${record?.is_default ? '是' : '否'} `;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '是否默认',
|
||||
// dataIndex: 'is_default',
|
||||
// search: false,
|
||||
// render(_, record) {
|
||||
// return `${record?.is_default ? '是' : '否'} `;
|
||||
// },
|
||||
// },
|
||||
MyColumns.UpdatedAt(),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<ReceiptAccountsUpdate
|
||||
<ReceiptAccountUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="收款账号"
|
||||
@ -47,7 +47,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
Selects?.OrganizationsTree({
|
||||
title: '选择新的上级组织',
|
||||
title: '选择组织',
|
||||
key: 'organizations_id',
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
colProps: { span: 24 },
|
||||
@ -55,7 +55,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'name',
|
||||
title: '姓名',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
@ -65,7 +65,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 10 },
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
@ -20,6 +20,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
@ -52,7 +53,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
Selects?.OrganizationsTree({
|
||||
title: '选择新的上级组织',
|
||||
title: '选择组织',
|
||||
key: 'organizations_id',
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
colProps: { span: 24 },
|
||||
@ -63,7 +64,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'name',
|
||||
title: '姓名',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
@ -73,7 +74,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 10 },
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
@ -9,7 +9,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.Organizations.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`选择新的上级${props.title}`}
|
||||
title={`${props.title}调整`}
|
||||
form={form}
|
||||
trigger={<MyButtons.Edit title="组织调整" type="link" size="middle" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
@ -38,7 +38,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
}
|
||||
columns={[
|
||||
Selects?.OrganizationsTree({
|
||||
title: '选择新的上级组织',
|
||||
title: '请选择新的上级组织',
|
||||
key: 'parent_id',
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
colProps: { span: 24 },
|
||||
@ -16,10 +16,11 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
<BetaSchemaForm<ApiTypes.Company.Organizations.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
form={form}
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
@ -16,8 +16,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加岗位`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
trigger={<MyButtons.Create title={`添加岗位`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -18,6 +18,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
@ -65,12 +65,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: CompanyReceiptAccountsPayChannelEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'is_default',
|
||||
title: '是否设为默认账号',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
// {
|
||||
// key: 'is_default',
|
||||
// title: '是否设为默认账号',
|
||||
// valueType: 'switch',
|
||||
// colProps: { span: 24 },
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -20,6 +20,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
@ -64,12 +65,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: CompanyReceiptAccountsPayChannelEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'is_default',
|
||||
title: '是否设为默认账号',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
// {
|
||||
// key: 'is_default',
|
||||
// title: '是否设为默认账号',
|
||||
// valueType: 'switch',
|
||||
// colProps: { span: 24 },
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -10,19 +10,19 @@ import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import Create from './modals/Create';
|
||||
import CompanyCreate from './modals/CompanyCreate';
|
||||
|
||||
export default function Index({ title = '机构管理' }) {
|
||||
export default function Index({ title = '机构列表' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-companies',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-companies"
|
||||
@ -34,40 +34,37 @@ export default function Index({ title = '机构管理' }) {
|
||||
MyProTableProps.request(params, sort, Apis.Company.Companies.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<Create key="Create" reload={action?.reload} title={title} />,
|
||||
<CompanyCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '组织简称',
|
||||
dataIndex: 'short_name',
|
||||
},
|
||||
{
|
||||
title: '企业名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'merchant_type',
|
||||
valueEnum: CompaniesMerchantTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '机构名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '组织简称',
|
||||
dataIndex: 'short_name',
|
||||
MyColumns.SoftDelete({
|
||||
onRestore: Apis.Company.Companies.Restore,
|
||||
onSoftDelete: Apis.Company.Companies.SoftDelete,
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '营业执照号',
|
||||
dataIndex: 'business_license_number',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
// MyColumns.CreatedAt(),
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
{/* <Update item={item} reload={action?.reload} title={title} /> */}
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
onClick={() => {
|
||||
navigate(`/company/companies/${item.id}`);
|
||||
navigate(`/company/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
@ -15,7 +16,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加机构`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加机构`} />}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.Companies.Store({
|
||||
@ -31,37 +32,31 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '机构名称',
|
||||
colProps: { span: 8 },
|
||||
key: 'short_name',
|
||||
title: '机构简称',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'short_name',
|
||||
title: '机构简称',
|
||||
colProps: { span: 8 },
|
||||
key: 'name',
|
||||
title: '企业名称',
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'business_license_number',
|
||||
title: '营业执照号',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
},
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'merchant_type',
|
||||
// title: '商户类型',
|
||||
// colProps: { span: 8 },
|
||||
// valueEnum: CompaniesMerchantTypeEnum,
|
||||
// required: true,
|
||||
// }),
|
||||
{
|
||||
key: 'contact_name',
|
||||
title: '联系人姓名',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'contact_phone',
|
||||
@ -71,37 +66,43 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
// formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
{
|
||||
key: 'contact_email',
|
||||
title: '联系人邮箱',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'text',
|
||||
colProps: { span: 10 },
|
||||
fieldProps: {
|
||||
placeholder: '139@mail.com',
|
||||
type: 'email',
|
||||
},
|
||||
formItemProps: {
|
||||
rules: [
|
||||
{
|
||||
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
||||
message: '请输入正确的邮箱,如 139@email.com 格式输入',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'contact_address',
|
||||
// title: '联系人地址',
|
||||
// colProps: { span: 24 },
|
||||
// },
|
||||
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '联系地址',
|
||||
colProps: { span: 16 },
|
||||
colProps: { span: 14 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 10 },
|
||||
},
|
||||
// MyFormItems.UploadImages({
|
||||
// key: 'business_license_image',
|
||||
// title: '营业执照',
|
||||
// max: 1,
|
||||
// colProps: { span: 6 },
|
||||
// }),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'business_license_image',
|
||||
title: '营业执照',
|
||||
max: 1,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
@ -15,10 +16,11 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
<BetaSchemaForm<ApiTypes.Company.Companies.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
form={form}
|
||||
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue({
|
||||
@ -43,28 +45,31 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '机构名称',
|
||||
colProps: { span: 8 },
|
||||
key: 'short_name',
|
||||
title: '机构简称',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'short_name',
|
||||
title: '机构简称',
|
||||
colProps: { span: 8 },
|
||||
key: 'name',
|
||||
title: '企业名称',
|
||||
colProps: { span: 18 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'business_license_number',
|
||||
title: '营业执照号',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'contact_name',
|
||||
title: '联系人姓名',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 6 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'contact_phone',
|
||||
@ -74,37 +79,43 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
// formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
{
|
||||
key: 'contact_email',
|
||||
title: '联系人邮箱',
|
||||
colProps: { span: 8 },
|
||||
valueType: 'text',
|
||||
colProps: { span: 10 },
|
||||
fieldProps: {
|
||||
placeholder: '139@mail.com',
|
||||
type: 'email',
|
||||
},
|
||||
formItemProps: {
|
||||
rules: [
|
||||
{
|
||||
pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
||||
message: '请输入正确的邮箱,如 139@email.com 格式输入',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'contact_address',
|
||||
// title: '联系人地址',
|
||||
// colProps: { span: 16 },
|
||||
// },
|
||||
// MyFormItems.EnumRadio({
|
||||
// key: 'merchant_type',
|
||||
// title: '商户类型',
|
||||
// colProps: { span: 24 },
|
||||
// valueEnum: CompaniesMerchantTypeEnum,
|
||||
// required: true,
|
||||
// }),
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 16 },
|
||||
title: '联系地址',
|
||||
colProps: { span: 14 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 10 },
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'business_license_image',
|
||||
title: '营业执照',
|
||||
max: 1,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
@ -8,19 +8,18 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import EmployeesCreate from '../company/companies/modals/EmployeesCreate';
|
||||
import EmployeesUpdate from '../company/companies/modals/EmployeesUpdate';
|
||||
import EmployeeUpdate from '../company/components/modals/EmployeeUpdate';
|
||||
|
||||
export default function Index({ title = '员工管理' }) {
|
||||
// 使用多标签页功能
|
||||
usePageTabs({
|
||||
tabKey: 'employees-list',
|
||||
tabLabel: title,
|
||||
closable: true
|
||||
closable: true,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
<MyPageContainer
|
||||
enableTabs
|
||||
tabKey="employees-list"
|
||||
tabLabel={title}
|
||||
@ -36,18 +35,15 @@ export default function Index({ title = '员工管理' }) {
|
||||
Apis.Company.CompanyEmployees.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<EmployeesCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
// toolBarRender={(action) => [
|
||||
// <EmployeesCreate
|
||||
// key="Create"
|
||||
// reload={action?.reload}
|
||||
// title={title}
|
||||
// />,
|
||||
// ]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.Companies({
|
||||
title: '选择机构',
|
||||
}),
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
@ -69,13 +65,14 @@ export default function Index({ title = '员工管理' }) {
|
||||
{
|
||||
title: '岗位',
|
||||
dataIndex: ['position', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<EmployeesUpdate
|
||||
<EmployeeUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
|
||||
@ -80,7 +80,7 @@ export default function Index({ title = '功能' }) {
|
||||
valueEnum: SysPermissionsTypeEnum,
|
||||
}),
|
||||
{ title: '链接', dataIndex: 'path' },
|
||||
{ title: '前端表示', dataIndex: 'key' },
|
||||
// { title: '前端表示', dataIndex: 'key' },
|
||||
{
|
||||
title: '后端API',
|
||||
dataIndex: 'backend_apis',
|
||||
@ -123,7 +123,7 @@ export default function Index({ title = '功能' }) {
|
||||
});
|
||||
}}
|
||||
></Button>
|
||||
<Create
|
||||
{/* <Create
|
||||
key="Create"
|
||||
reload={getData}
|
||||
title={title}
|
||||
@ -134,7 +134,7 @@ export default function Index({ title = '功能' }) {
|
||||
title: '添加下级菜单',
|
||||
type: 'link',
|
||||
}}
|
||||
/>
|
||||
/> */}
|
||||
<Update
|
||||
item={item}
|
||||
reload={getData}
|
||||
|
||||
@ -22,12 +22,19 @@ export default function Create(
|
||||
<BetaSchemaForm<ApiTypes.Permission.SysPermissions.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
form={form}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={
|
||||
<MyButtons.Create title={`添加${props.title}`} {...props.buttonProps} />
|
||||
}
|
||||
// 确保正确弹窗,使用动态的时间参数
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
return Apis.Permission.SysPermissions.Store({
|
||||
...values,
|
||||
@ -40,14 +47,6 @@ export default function Create(
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
onOpenChange={(open: boolean) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue({
|
||||
parent_id: props.item.id || undefined,
|
||||
icon: undefined,
|
||||
});
|
||||
}
|
||||
}}
|
||||
columns={[
|
||||
SysSelects.SysPermissionsTree({ guard_name: props.guardName }),
|
||||
{
|
||||
|
||||
@ -20,9 +20,16 @@ export default function Update(
|
||||
<BetaSchemaForm<ApiTypes.Permission.SysPermissions.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
form={form}
|
||||
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) => {
|
||||
return Apis.Permission.SysPermissions.Update({
|
||||
...values,
|
||||
@ -36,11 +43,6 @@ export default function Update(
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
trigger={<MyButtons.Edit />}
|
||||
columns={[
|
||||
SysSelects.SysPermissionsTree({ guard_name: props.guardName }),
|
||||
|
||||
@ -18,9 +18,9 @@ export default function Index({ title = '角色' }) {
|
||||
tabKey: 'system-roles',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="system-roles"
|
||||
|
||||
@ -7,16 +7,24 @@ import {
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Permission.SysRoles.Store>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Permission.SysRoles.Store(values)
|
||||
.then(() => {
|
||||
|
||||
@ -7,17 +7,24 @@ import {
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Permission.SysRoles.Update>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`编辑${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Edit />}
|
||||
request={async () => props.item}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) => {
|
||||
return Apis.Permission.SysRoles.Update({
|
||||
...values,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user