发版 #1
@ -14,14 +14,9 @@ export default defineConfig({
|
||||
},
|
||||
proxy: {
|
||||
'/api/': {
|
||||
<<<<<<< HEAD
|
||||
// target: 'http://yt:8003',
|
||||
target: 'http://10.39.13.80:8001',
|
||||
// target: 'https://weapp-api.linyikj.com.cn/',
|
||||
=======
|
||||
target: 'http://yt:8001',
|
||||
// target: 'http://10.39.13.80:8001',
|
||||
>>>>>>> 1275c157f58b27d4d2b966e91a73bab4f3360be2
|
||||
// target: 'http://we6f9c65.natappfree.cc',
|
||||
// target: 'https://loanos-test.nchl.net/',
|
||||
changeOrigin: true,
|
||||
|
||||
@ -83,27 +83,44 @@ export function MyUploadImages({
|
||||
Apis.Common.Auth.PreUpload({
|
||||
filename: file.name,
|
||||
alc: 'public-read',
|
||||
}).then(async (res) => {
|
||||
axios
|
||||
.put(res.data.url, file, {
|
||||
headers: res.data.headers,
|
||||
onUploadProgress: ({ total, loaded }) => {
|
||||
if (total)
|
||||
onProgress(
|
||||
{ percent: Math.round((loaded / total) * 100).toFixed(2) },
|
||||
file,
|
||||
);
|
||||
},
|
||||
})
|
||||
.then(({ data: response }) => {
|
||||
console.log('response', response);
|
||||
if (response.errorMessage) {
|
||||
onError(response, file);
|
||||
} else {
|
||||
onSuccess(res.data.url.split('?')[0], file);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(async (res) => {
|
||||
try {
|
||||
axios
|
||||
.put(res.data.url, file, {
|
||||
headers: res.data.headers,
|
||||
onUploadProgress: ({ total, loaded }) => {
|
||||
if (total)
|
||||
onProgress(
|
||||
{ percent: Math.round((loaded / total) * 100).toFixed(2) },
|
||||
file,
|
||||
);
|
||||
},
|
||||
})
|
||||
.then(({ data: response }) => {
|
||||
console.log('response', response);
|
||||
if (response && response.errorMessage) {
|
||||
onError(response, file);
|
||||
} else {
|
||||
// 确保URL正确处理
|
||||
const fileUrl = res.data.url.split('?')[0];
|
||||
console.log('文件上传成功,URL:', fileUrl);
|
||||
onSuccess(fileUrl, file);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('上传文件时出错:', error);
|
||||
onError(error, file);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('处理上传请求时出错:', error);
|
||||
onError(error, file);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取预上传URL时出错:', error);
|
||||
onError(error, file);
|
||||
});
|
||||
|
||||
return {
|
||||
abort() {
|
||||
|
||||
@ -7,6 +7,7 @@ type MyImportModalType = {
|
||||
title?: string;
|
||||
type?: any;
|
||||
params?: Record<string, any>;
|
||||
size?: 'small' | 'middle' | 'large';
|
||||
templateApi?: () => Promise<MyResponseType>;
|
||||
importApi: (data: any) => Promise<MyResponseType>;
|
||||
reload?: () => void;
|
||||
@ -17,17 +18,22 @@ export function MyImportModal(props: MyImportModalType) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [formData, setFormData] = useState<FormData | undefined>(undefined);
|
||||
|
||||
const { title = '批量导入', params = {}, type = 'primary' } = props;
|
||||
const {
|
||||
title = '批量导入',
|
||||
params = {},
|
||||
type = 'primary',
|
||||
size = 'middle',
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<>
|
||||
{type === 'danger' ? (
|
||||
<Button onClick={() => setOpen(true)} type="primary" danger>
|
||||
<Button onClick={() => setOpen(true)} type="primary" danger size={size}>
|
||||
<ImportOutlined />
|
||||
{title}
|
||||
</Button>
|
||||
) : (
|
||||
<Button onClick={() => setOpen(true)} type="primary">
|
||||
<Button onClick={() => setOpen(true)} type="primary" size={size}>
|
||||
<ImportOutlined />
|
||||
{title}
|
||||
</Button>
|
||||
|
||||
@ -364,7 +364,8 @@ export function MyPageContainer({
|
||||
onChange={handleTabChange}
|
||||
onEdit={handleTabEdit}
|
||||
hideAdd
|
||||
size="small"
|
||||
size="middle"
|
||||
// 标签size
|
||||
renderTabBar={renderTabBar}
|
||||
items={tabs.map((tab) => ({
|
||||
key: tab.key,
|
||||
@ -372,6 +373,7 @@ export function MyPageContainer({
|
||||
closable: tab.closable,
|
||||
}))}
|
||||
style={{
|
||||
marginTop: 6,
|
||||
marginBottom: 0,
|
||||
}}
|
||||
className="tabs-header-only"
|
||||
|
||||
@ -1,191 +0,0 @@
|
||||
import { PlusOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
|
||||
import { history } from '@umijs/max';
|
||||
import { Button, Card, Divider, Space } from 'antd';
|
||||
import { MyPageContainer } from './MyPageContainer';
|
||||
import { usePageTabs } from './usePageTabs';
|
||||
|
||||
/**
|
||||
* 标签页使用示例组件
|
||||
* 展示如何使用MyPageContainer的多标签页功能
|
||||
*/
|
||||
export function TabsExample() {
|
||||
const tabsApi = usePageTabs({
|
||||
tabKey: 'tabs-example',
|
||||
tabLabel: '标签页示例',
|
||||
});
|
||||
|
||||
const handleAddTab = (key: string, label: string, path: string) => {
|
||||
tabsApi.addTab({
|
||||
key,
|
||||
label,
|
||||
path,
|
||||
closable: true,
|
||||
});
|
||||
history.push(path);
|
||||
};
|
||||
|
||||
const handleAddTabNext = (key: string, label: string, path: string) => {
|
||||
tabsApi.addTabNext({
|
||||
key,
|
||||
label,
|
||||
path,
|
||||
closable: true,
|
||||
});
|
||||
history.push(path);
|
||||
};
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
enableTabs
|
||||
tabKey="tabs-example"
|
||||
tabLabel="标签页示例"
|
||||
title="多标签页功能演示"
|
||||
>
|
||||
<Card title="标签页操作示例" style={{ marginBottom: 16 }}>
|
||||
<Space wrap>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => handleAddTab('user-list', '用户列表', '/users')}
|
||||
>
|
||||
打开用户列表
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
icon={<UserOutlined />}
|
||||
onClick={() =>
|
||||
handleAddTab('user-profile', '用户详情', '/users/profile')
|
||||
}
|
||||
>
|
||||
打开用户详情
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
icon={<SettingOutlined />}
|
||||
onClick={() => handleAddTab('settings', '系统设置', '/settings')}
|
||||
>
|
||||
打开系统设置
|
||||
</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>
|
||||
<Button onClick={() => tabsApi.closeOtherTabs()}>关闭其他标签</Button>
|
||||
|
||||
<Button onClick={() => tabsApi.closeLeftTabs()}>关闭左侧标签</Button>
|
||||
|
||||
<Button onClick={() => tabsApi.closeRightTabs()}>关闭右侧标签</Button>
|
||||
|
||||
<Button onClick={() => tabsApi.refreshTab()}>刷新当前标签</Button>
|
||||
</Space>
|
||||
</Card>
|
||||
|
||||
<Card title="功能说明">
|
||||
<div style={{ lineHeight: '1.8' }}>
|
||||
<h4>🎯 核心功能</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>多标签页支持</strong>:支持同时打开多个页面标签
|
||||
</li>
|
||||
<li>
|
||||
<strong>智能标签插入</strong>
|
||||
:新标签页默认在当前激活标签页的右边插入
|
||||
</li>
|
||||
<li>
|
||||
<strong>右键菜单</strong>:右键点击标签页显示操作菜单
|
||||
</li>
|
||||
<li>
|
||||
<strong>智能导航</strong>:关闭标签时自动切换到相邻标签
|
||||
</li>
|
||||
<li>
|
||||
<strong>状态持久化</strong>:标签页状态在组件间共享
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>🖱️ 右键菜单操作</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>刷新</strong>:重新加载当前标签页
|
||||
</li>
|
||||
<li>
|
||||
<strong>关闭</strong>:关闭当前标签页
|
||||
</li>
|
||||
<li>
|
||||
<strong>关闭其他</strong>:关闭除当前标签外的所有标签
|
||||
</li>
|
||||
<li>
|
||||
<strong>关闭左侧</strong>:关闭当前标签左侧的所有标签
|
||||
</li>
|
||||
<li>
|
||||
<strong>关闭右侧</strong>:关闭当前标签右侧的所有标签
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>💻 使用方法</h4>
|
||||
<pre
|
||||
style={{
|
||||
background: '#f5f5f5',
|
||||
padding: '12px',
|
||||
borderRadius: '4px',
|
||||
}}
|
||||
>
|
||||
{`// 1. 在页面组件中使用
|
||||
import { MyPageContainer, usePageTabs } from '@/common';
|
||||
|
||||
function YourPage() {
|
||||
usePageTabs({
|
||||
tabKey: 'your-page',
|
||||
tabLabel: '页面标题'
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
enableTabs
|
||||
tabKey="your-page"
|
||||
tabLabel="页面标题"
|
||||
>
|
||||
{/* 页面内容 */}
|
||||
</MyPageContainer>
|
||||
);
|
||||
}`}
|
||||
</pre>
|
||||
</div>
|
||||
</Card>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -46,15 +46,7 @@ export const MyFormItems = {
|
||||
...props,
|
||||
};
|
||||
},
|
||||
// RichText(props: PropsType): ReturnType {
|
||||
// return {
|
||||
// renderFormItem: () => <MyRichText />,
|
||||
// formItemProps: {
|
||||
// ...(props?.required ? rulesHelper.richtext : {}),
|
||||
// },
|
||||
// ...props,
|
||||
// };
|
||||
// },
|
||||
|
||||
UploadImages({
|
||||
max = 1,
|
||||
help,
|
||||
|
||||
@ -10,7 +10,7 @@ export * from './components/layout/MyCommonModal';
|
||||
export * from './components/layout/MyImportModal';
|
||||
export * from './components/layout/MyPageContainer';
|
||||
export * from './components/layout/MyRootContainer';
|
||||
export * from './components/layout/TabsExample';
|
||||
|
||||
export * from './components/layout/usePageTabs';
|
||||
|
||||
export * from './components/props/MyDrawerProps';
|
||||
|
||||
64
src/gen/ApiTypes.d.ts
vendored
64
src/gen/ApiTypes.d.ts
vendored
@ -121,6 +121,7 @@ declare namespace ApiTypes {
|
||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||
"asset_units_id"?: number; // 所属单元id,[ref:asset_units]
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"full_name"?: string; // 模糊搜索:全称
|
||||
};
|
||||
type Store = {
|
||||
"asset_projects_id": number; // 所属项目id,[ref:asset_projects]
|
||||
@ -179,6 +180,15 @@ declare namespace ApiTypes {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件
|
||||
};
|
||||
type Export = {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||
"asset_units_id"?: number; // 所属单元id,[ref:asset_units]
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"full_name"?: string; // 模糊搜索:全称
|
||||
"current"?: number; // 页码
|
||||
"download_type": string; // 下载类型:page 当前页(含查询条件),query 所有页(含查询条件),all所有记录
|
||||
};
|
||||
}
|
||||
namespace AssetProjects {
|
||||
type List = {
|
||||
@ -409,6 +419,9 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Import = {
|
||||
"upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Collcetion {
|
||||
@ -589,6 +602,7 @@ declare namespace ApiTypes {
|
||||
type List = {
|
||||
"companies_id"?: number; // 机构ID
|
||||
"organizations_id"?: number; // 组织机构ID
|
||||
"organization_name"?: string; // 组织机构名称
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"phone"?: string; // 模糊搜索:手机号
|
||||
};
|
||||
@ -729,6 +743,12 @@ declare namespace ApiTypes {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"companies_id"?: number; // 机构ID[ref:companies]
|
||||
"parent_id"?: number; // 父级ID
|
||||
"company_name"?: string; // 机构名称
|
||||
};
|
||||
type TreeList = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"companies_id"?: number; // 机构ID[ref:companies]
|
||||
"parent_id"?: number; // 父级ID
|
||||
};
|
||||
type Store = {
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
@ -852,6 +872,50 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Msg {
|
||||
namespace MsgPropertyAnnouncements {
|
||||
type List = {
|
||||
"title"?: string; // 模糊搜索:标题
|
||||
"asset_projects_id"?: number; // 项目id,[ref:asset_projects]
|
||||
"project_name"?: string; // 模糊搜索:项目名称
|
||||
"is_publish"?: number; // 是否发布
|
||||
};
|
||||
type Store = {
|
||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||
"title": string; // 标题
|
||||
"content": string; // 内容
|
||||
"is_publish"?: number; // 是否发布
|
||||
"publish_at"?: Date; // 发布时间
|
||||
"sort"?: number; // 排序
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||
"companies_id": number; // 公司id,[ref:companies]
|
||||
"title": string; // 标题
|
||||
"content": string; // 内容
|
||||
"is_publish"?: number; // 是否发布
|
||||
"publish_at"?: mixed; // 发布时间
|
||||
"sort"?: number; // 排序
|
||||
"admins_id"?: number; // 创建人id,[ref:admins]
|
||||
"company_employees_id"?: number; // 创建员工id,[ref:company_employees]
|
||||
"last_update_admins_id"?: number; // 最后修改人id,[ref:admins]
|
||||
"last_update_company_employees"?: number; // 最后修改员工id,[ref:company_employees]
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type SoftDelete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Restore = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Permission {
|
||||
namespace SysPermissions {
|
||||
type List = {
|
||||
|
||||
@ -102,6 +102,9 @@ export const Apis = {
|
||||
DownloadTemplate(): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_houses/download_template', {responseType: 'blob',});
|
||||
},
|
||||
Export(data: ApiTypes.Asset.AssetHouses.Export): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_houses/export', { responseType: 'blob',data });
|
||||
},
|
||||
},
|
||||
AssetProjects: {
|
||||
List(data?: ApiTypes.Asset.AssetProjects.List): Promise<MyResponseType> {
|
||||
@ -218,6 +221,12 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Bill.HouseBills.Delete): Promise<MyResponseType> {
|
||||
return request('admin/bill/house_bills/delete', { data });
|
||||
},
|
||||
Import(data?: ApiTypes.Bill.HouseBills.Import): Promise<MyResponseType> {
|
||||
return request('admin/bill/house_bills/import', { data });
|
||||
},
|
||||
DownloadTemplate(): Promise<MyResponseType> {
|
||||
return request('admin/bill/house_bills/download_template', {responseType: 'blob',});
|
||||
},
|
||||
},
|
||||
},
|
||||
Collcetion: {
|
||||
@ -429,6 +438,9 @@ export const Apis = {
|
||||
List(data?: ApiTypes.Company.Organizations.List): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/list', { data });
|
||||
},
|
||||
TreeList(data?: ApiTypes.Company.Organizations.TreeList): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/tree_list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Company.Organizations.Store): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/store', { data });
|
||||
},
|
||||
@ -513,6 +525,31 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Msg: {
|
||||
MsgPropertyAnnouncements: {
|
||||
List(data?: ApiTypes.Msg.MsgPropertyAnnouncements.List): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Msg.MsgPropertyAnnouncements.Store): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Msg.MsgPropertyAnnouncements.Update): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Msg.MsgPropertyAnnouncements.Show): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/show', { data });
|
||||
},
|
||||
SoftDelete(data: ApiTypes.Msg.MsgPropertyAnnouncements.SoftDelete): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/soft_delete', { data });
|
||||
},
|
||||
Restore(data: ApiTypes.Msg.MsgPropertyAnnouncements.Restore): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/restore', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Msg.MsgPropertyAnnouncements.Delete): Promise<MyResponseType> {
|
||||
return request('admin/msg/msg_property_announcements/delete', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Permission: {
|
||||
SysPermissions: {
|
||||
List(data: ApiTypes.Permission.SysPermissions.List): Promise<MyResponseType> {
|
||||
|
||||
@ -126,7 +126,7 @@ export const BannersTypeEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#2f067d","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#f002cf","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
|
||||
146
src/pages/announcement/index.tsx
Normal file
146
src/pages/announcement/index.tsx
Normal file
@ -0,0 +1,146 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import AnnouncementCreate from './modals/AnnouncementCreate';
|
||||
import AnnouncementShow from './modals/AnnouncementShow';
|
||||
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
||||
|
||||
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.Msg.MsgPropertyAnnouncements.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AnnouncementCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'title',
|
||||
width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
||||
render: (text) => (
|
||||
<div
|
||||
style={{
|
||||
width: '100%', // 继承列宽
|
||||
// height: '60px', // 设置固定高度,约显示3行文本
|
||||
overflow: 'hidden', // 超出隐藏
|
||||
textOverflow: 'ellipsis', // 省略号
|
||||
display: '-webkit-box',
|
||||
WebkitBoxOrient: 'vertical',
|
||||
WebkitLineClamp: 1, // 显示3行
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '内容',
|
||||
dataIndex: 'content',
|
||||
valueType: 'textarea', // 仅影响表单编辑时的输入类型,不影响表格展示
|
||||
search: false,
|
||||
width: 200, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
||||
render: (text) => (
|
||||
<div
|
||||
style={{
|
||||
width: '100%', // 继承列宽
|
||||
// height: '60px', // 设置固定高度,约显示3行文本
|
||||
overflow: 'hidden', // 超出隐藏
|
||||
textOverflow: 'ellipsis', // 省略号
|
||||
display: '-webkit-box',
|
||||
WebkitBoxOrient: 'vertical',
|
||||
WebkitLineClamp: 2, // 显示3行
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '发布日期',
|
||||
dataIndex: 'publish_at',
|
||||
valueType: 'date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.asset_project?.name;
|
||||
},
|
||||
},
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
onRestore: Apis.Msg.MsgPropertyAnnouncements.Restore,
|
||||
onSoftDelete: Apis.Msg.MsgPropertyAnnouncements.SoftDelete,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
//创建日期
|
||||
title: '创建日期',
|
||||
dataIndex: 'created_at',
|
||||
valueType: 'date',
|
||||
search: false,
|
||||
// render: (_, record) => {
|
||||
// return record?.created_at?.substring(0, 10);
|
||||
// },
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AnnouncementShow item={item} />
|
||||
<AnnouncementUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Banner.Banners.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
92
src/pages/announcement/modals/AnnouncementCreate.tsx
Normal file
92
src/pages/announcement/modals/AnnouncementCreate.tsx
Normal file
@ -0,0 +1,92 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加公告`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加公告`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Msg.MsgPropertyAnnouncements.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加公告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'title',
|
||||
title: '公告标题',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'content',
|
||||
title: '公告内容',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'publish_at',
|
||||
title: '内容显示的发布日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
Selects?.AssetProjects({
|
||||
title: '请选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
|
||||
// {
|
||||
// key: 'is_publish',
|
||||
// title: '是否立刻发布',
|
||||
// valueType: 'switch',
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 12 },
|
||||
tooltip: '数值越大越靠前',
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
53
src/pages/announcement/modals/AnnouncementShow.tsx
Normal file
53
src/pages/announcement/modals/AnnouncementShow.tsx
Normal file
@ -0,0 +1,53 @@
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Typography } from 'antd';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
// width="40vw"
|
||||
width={600}
|
||||
// style={{ maxWidth: '650px' }}
|
||||
node={
|
||||
<ProCard>
|
||||
<ProDescriptions
|
||||
// bordered
|
||||
// column={{ xs: 1, sm: 2, md: 3 }}
|
||||
column={1}
|
||||
size="small"
|
||||
>
|
||||
<ProDescriptions.Item label="公告标题">
|
||||
{props?.item?.title || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="公告内容">
|
||||
<div
|
||||
style={{
|
||||
whiteSpace: 'pre-wrap',
|
||||
maxHeight: '300px',
|
||||
overflow: 'auto',
|
||||
}}
|
||||
>
|
||||
{props?.item?.content || '-'}
|
||||
</div>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="发布日期">
|
||||
{props?.item?.publish_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label=" 关联项目">
|
||||
{props?.item?.asset_project?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建时间">
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
95
src/pages/announcement/modals/AnnouncementUpdate.tsx
Normal file
95
src/pages/announcement/modals/AnnouncementUpdate.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑公告内容`}
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Msg.MsgPropertyAnnouncements.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('编辑公告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'title',
|
||||
title: '公告标题',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'content',
|
||||
title: '公告内容',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'publish_at',
|
||||
title: '内容显示的发布日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
Selects?.AssetProjects({
|
||||
title: '请选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
// {
|
||||
// key: 'is_publish',
|
||||
// title: '是否立刻发布',
|
||||
// valueType: 'switch',
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 12 },
|
||||
tooltip: '数值越大越靠前',
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -79,9 +79,9 @@ export default function Index({ ...rest }) {
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
// title:
|
||||
// rest?.item?.status === 'Rented' ? '与租客关系' : '与业主关系',
|
||||
title: '关系说明',
|
||||
title:
|
||||
rest?.item?.status === 'Rented' ? '与主租人关系' : '与产权人关系',
|
||||
// title: '关系说明',
|
||||
dataIndex: 'relation_with_owner',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
search: false,
|
||||
|
||||
@ -59,7 +59,6 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
||||
dataIndex: 'customer_info',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
@ -86,27 +85,47 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'residential_relation',
|
||||
title: '居住关系',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsResidentialRelationEnum),
|
||||
// );
|
||||
// delete obj.Tenant;
|
||||
// return obj;
|
||||
// },
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '关系标记',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
colProps: { span: 18 },
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'residential_relation',
|
||||
title: '居住关系',
|
||||
colProps: { span: 8 },
|
||||
valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
// valueEnum: () => {
|
||||
// let obj: any = JSON.parse(
|
||||
// JSON.stringify(HouseOccupantsResidentialRelationEnum),
|
||||
// );
|
||||
// delete obj.Tenant;
|
||||
// return obj;
|
||||
// },
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['residential_relation'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ residential_relation }: any) => {
|
||||
return residential_relation !==
|
||||
HouseOccupantsResidentialRelationEnum.PrimaryTenant
|
||||
.value
|
||||
? [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title:
|
||||
residential_relation === 'Resident'
|
||||
? '与产权人关系'
|
||||
: '与主租人关系',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
colProps: { span: 16 },
|
||||
required: true,
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
@ -122,69 +141,130 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
name: ['residential_relation'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ residential_relation }: any) => {
|
||||
return residential_relation ===
|
||||
HouseOccupantsResidentialRelationEnum.PrimaryTenant.value
|
||||
? [
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 6 },
|
||||
required: true,
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
// uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
// uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
]
|
||||
: [
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
// uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
// uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@ -1,188 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
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';
|
||||
|
||||
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"
|
||||
trigger={
|
||||
<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) =>
|
||||
Apis.Archive.HouseRegisters.Store({
|
||||
...values,
|
||||
asset_houses_id: props?.item?.id,
|
||||
house_status: 'Rented',
|
||||
type: 'AddOccupant',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
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: 0 }}
|
||||
title={`租客${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
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: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
uploadType: 'file',
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 6 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 6 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -2,13 +2,14 @@ import { MyPageContainer, usePageTabs } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { Space, Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import AssetAccounts from './components/AssetAccounts';
|
||||
import MyAssetBuildings from './components/AssetBuildings';
|
||||
import AssetGrid from './components/AssetGrid';
|
||||
import AssetInfo from './components/AssetInfo';
|
||||
import Basic from './components/Basic';
|
||||
import BindCompany from './components/modals/BindCompany';
|
||||
import AssetUpdate from './modals/AssetUpdate';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@ -39,12 +40,12 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '基本信息',
|
||||
key: 'info',
|
||||
closable: false,
|
||||
children: <AssetInfo item={data} reload={() => loadShow()} />,
|
||||
},
|
||||
// {
|
||||
// label: '基本信息',
|
||||
// key: 'info',
|
||||
// closable: false,
|
||||
// children: <AssetInfo item={data} reload={() => loadShow()} />,
|
||||
// },
|
||||
{
|
||||
label: '楼栋管理',
|
||||
key: 'asset_buildings',
|
||||
@ -52,7 +53,7 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
children: <MyAssetBuildings item={data} />,
|
||||
},
|
||||
{
|
||||
label: '网格管理',
|
||||
label: '楼栋划分',
|
||||
key: 'grid',
|
||||
closable: false,
|
||||
children: <AssetGrid item={data} />,
|
||||
@ -72,7 +73,22 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={data?.name || title || '项目详情'}>
|
||||
<Basic item={data} reload={() => loadShow()} />
|
||||
<ProCard
|
||||
title={`${data?.name} (${data?.alias_name})`}
|
||||
extra={
|
||||
<Space>
|
||||
<AssetInfo
|
||||
item={{ ...data, type: 'primary' }}
|
||||
title="查看"
|
||||
reload={loadShow}
|
||||
/>
|
||||
<AssetUpdate item={data} title="项目" reload={loadShow} />
|
||||
<BindCompany item={data} title="机构" reload={loadShow} />
|
||||
</Space>
|
||||
}
|
||||
>
|
||||
<div>* 您可在以下页签中对应管理:楼栋管理、楼栋划分、收款账号;</div>
|
||||
</ProCard>
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
|
||||
@ -2,17 +2,20 @@ import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyImportModal,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetHousesUsageEnum } from '@/gen/Enums';
|
||||
import {
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
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';
|
||||
@ -70,7 +73,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
<ProCard
|
||||
title={
|
||||
<Alert
|
||||
message="操作提示:单元/房屋添加,请先选择已有楼栋/单元"
|
||||
message="操作提示:在楼栋下添加单元,在单元下添加房屋!"
|
||||
type="info"
|
||||
showIcon
|
||||
style={{ margin: 0 }}
|
||||
@ -83,6 +86,16 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||
楼栋信息
|
||||
<MyImportModal
|
||||
key="ImportHouse"
|
||||
params={{ asset_projects_id: props?.item?.id }}
|
||||
title="批量导入"
|
||||
type="danger"
|
||||
size="middle"
|
||||
templateApi={Apis.Asset.AssetHouses.DownloadTemplate}
|
||||
importApi={Apis.Asset.AssetHouses.Import}
|
||||
reload={props?.reload}
|
||||
/>
|
||||
<BuildingsCreate
|
||||
key="BuildingsCreate"
|
||||
item={props?.item}
|
||||
@ -168,7 +181,8 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
}}
|
||||
reload={() => actionUnitsRef?.current?.reload()}
|
||||
title={`${selectedBuilding.name}单元`}
|
||||
title="单元"
|
||||
// title={`添加${selectedBuilding.name}单元`}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
@ -256,7 +270,8 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
asset_units_id: selectedUnit?.id,
|
||||
}}
|
||||
reload={() => actionHousesRef?.current?.reload()}
|
||||
title={`${selectedUnit.name}房屋`}
|
||||
title="房屋"
|
||||
// title={`${selectedUnit.name}房屋`}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
@ -284,11 +299,6 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
@ -297,17 +307,28 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
width: 80,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
width: 100,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋属性',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
width: 100,
|
||||
}),
|
||||
MyColumns.Option({
|
||||
width: 150,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<HousesShow item={item} reload={action?.reload} />
|
||||
{/* <HousesShow item={item} reload={action?.reload} /> */}
|
||||
<HousesUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
|
||||
@ -31,19 +31,19 @@ export default function Index({ ...rest }) {
|
||||
search={false}
|
||||
columns={[
|
||||
{
|
||||
title: '网格ID',
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: '网格名称',
|
||||
title: '板块名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '网格标识',
|
||||
title: '板块标识',
|
||||
dataIndex: 'grid_mark',
|
||||
},
|
||||
{
|
||||
title: '网格员',
|
||||
title: '管理员',
|
||||
dataIndex: ['company_employee', 'name'],
|
||||
render: (_, item: any) =>
|
||||
`${item?.company_employee?.name || ''}-${
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
@ -10,62 +11,82 @@ import { Space } from 'antd';
|
||||
|
||||
export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目别名">
|
||||
{props?.item?.alias_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目地址" span={2}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsPropertyTypeEnum}
|
||||
value={props?.item?.property_type}
|
||||
key="property_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
key="entrust_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费方式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
type={props.item?.type || 'primary'}
|
||||
width="920px"
|
||||
node={
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
<Space size="large">
|
||||
<div>
|
||||
{props?.item?.name}
|
||||
{props?.item?.alias_name
|
||||
? `(${props?.item?.alias_name})`
|
||||
: ''}
|
||||
</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="绑定机构">
|
||||
<Space size="large">
|
||||
<div>{props?.item?.company?.name}</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="接管日期">
|
||||
{props?.item?.takeover_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="封园日期">
|
||||
{props?.item?.closure_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目地址" span={2}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsPropertyTypeEnum}
|
||||
value={props?.item?.property_type}
|
||||
key="property_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
key="entrust_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费方式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="创建日期">
|
||||
<ProDescriptions.Item label="接管日期">
|
||||
{props?.item?.takeover_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="封园日期">
|
||||
{props?.item?.closure_date}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
{/* <ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import AssetUpdate from '../modals/AssetUpdate';
|
||||
@ -11,7 +17,12 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
<Space size="large">
|
||||
<div>{props?.item?.name}</div>
|
||||
<div>
|
||||
{props?.item?.name}
|
||||
{props?.item?.alias_name
|
||||
? `(${props?.item?.alias_name})`
|
||||
: ''}
|
||||
</div>
|
||||
<AssetUpdate
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
@ -19,7 +30,7 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联机构" span={3}>
|
||||
<ProDescriptions.Item label="绑定机构">
|
||||
<Space size="large">
|
||||
<div>{props?.item?.company?.name}</div>
|
||||
<BindCompany
|
||||
@ -29,6 +40,55 @@ export default function info(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="项目地址" span={2}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsPropertyTypeEnum}
|
||||
value={props?.item?.property_type}
|
||||
key="property_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
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="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
|
||||
@ -14,8 +14,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
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={() =>
|
||||
|
||||
@ -15,10 +15,10 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`创建网格`}
|
||||
title={`创建板块`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={<MyButtons.Create title={`创建网格`} />}
|
||||
trigger={<MyButtons.Create title={`创建板块`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -70,7 +70,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 0 }}
|
||||
title={`添加单元${index + 1}`}
|
||||
title={`创建板块${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
|
||||
@ -16,12 +16,12 @@ export default function Create(
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.AddManager>
|
||||
{...MyModalFormProps.props}
|
||||
title={`设置网格员`}
|
||||
title={`设置管理员`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
trigger={<MyButtons.Default title="网格员" type="link" />}
|
||||
trigger={<MyButtons.Default title="管理员" type="link" />}
|
||||
request={() => Promise.resolve(props.item)}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
|
||||
@ -23,7 +23,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
|
||||
@ -59,14 +59,14 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title: '建筑结构',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingStructureEnum,
|
||||
required: true,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'building_type',
|
||||
title: '建筑类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingTypeEnum,
|
||||
required: true,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
key: 'elevator_count',
|
||||
|
||||
@ -69,14 +69,14 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title: '建筑结构',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingStructureEnum,
|
||||
required: true,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'building_type',
|
||||
title: '建筑类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingTypeEnum,
|
||||
required: true,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
key: 'elevator_count',
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyImportModal,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
@ -11,9 +10,11 @@ import { AssetProjectsPropertyTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import AssetInfo from './components/AssetInfo';
|
||||
import AssetCreate from './modals/AssetCreate';
|
||||
import AssetUpdate from './modals/AssetUpdate';
|
||||
|
||||
export default function Index({ title = '项目管理' }) {
|
||||
export default function Index({ title = '项目列表' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
@ -36,7 +37,7 @@ export default function Index({ title = '项目管理' }) {
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '项目类型',
|
||||
title: '类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
search: false,
|
||||
@ -82,6 +83,15 @@ export default function Index({ title = '项目管理' }) {
|
||||
onSoftDelete: Apis.Asset.AssetProjects.SoftDelete,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '绑定机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { company_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '接管日期',
|
||||
// dataIndex: 'takeover_date',
|
||||
@ -96,20 +106,14 @@ export default function Index({ title = '项目管理' }) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetInfo item={item} title="查看" reload={action?.reload} />
|
||||
<AssetUpdate item={item} title="项目" reload={action?.reload} />
|
||||
<MyButtons.View
|
||||
title="详情"
|
||||
title="楼栋管理"
|
||||
onClick={() => {
|
||||
navigate(`/asset/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyImportModal
|
||||
key="ImportHouse"
|
||||
params={{ asset_projects_id: item?.id }}
|
||||
title="批量导入"
|
||||
templateApi={Apis.Asset.AssetHouses.DownloadTemplate}
|
||||
importApi={Apis.Asset.AssetHouses.Import}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
|
||||
@ -35,7 +35,6 @@ export default function Index({ title = '房屋列表' }) {
|
||||
{
|
||||
title: '房屋名称',
|
||||
dataIndex: 'full_name',
|
||||
ellipsis: true,
|
||||
},
|
||||
|
||||
MyColumns.EnumTag({
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyImportModal,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
@ -32,6 +33,15 @@ export default function Index({ title = '账单' }) {
|
||||
MyProTableProps.request(params, sort, Apis.Bill.HouseBills.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<MyImportModal
|
||||
key="ImportHouse"
|
||||
title="批量导入"
|
||||
type="danger"
|
||||
size="middle"
|
||||
templateApi={Apis.Bill.HouseBills.DownloadTemplate}
|
||||
importApi={Apis.Bill.HouseBills.Import}
|
||||
reload={action?.reload}
|
||||
/>,
|
||||
<BillCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
|
||||
@ -36,8 +36,12 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
//to-do 按层级选择
|
||||
{
|
||||
title: '所在组织',
|
||||
dataIndex: ['organization', 'name'],
|
||||
search: false,
|
||||
dataIndex: 'organization_path',
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { organization_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
|
||||
@ -21,7 +21,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
MyProTableProps.request(
|
||||
{ ...params, companies_id: props?.item?.id },
|
||||
sort,
|
||||
Apis.Company.Organizations.List,
|
||||
Apis.Company.Organizations.TreeList,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
@ -35,12 +35,6 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
// search={false}
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.EnumTag({
|
||||
title: '组织类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '组织名称',
|
||||
dataIndex: 'name',
|
||||
@ -50,6 +44,13 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
dataIndex: 'id',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '组织类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '上级组织',
|
||||
dataIndex: ['organization_parent', 'name'],
|
||||
@ -58,12 +59,12 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OrganizationChange
|
||||
<OrganizationUpdate
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
<OrganizationUpdate
|
||||
<OrganizationChange
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
|
||||
@ -11,7 +11,9 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`${props.title}调整`}
|
||||
form={form}
|
||||
trigger={<MyButtons.Edit title="组织调整" type="link" size="middle" />}
|
||||
trigger={
|
||||
<MyButtons.Default title="组织调整" type="primary" size="small" />
|
||||
}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
onOpenChange={(open: any) => {
|
||||
|
||||
@ -41,18 +41,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.OrganizationsTree({
|
||||
title: '上级组织',
|
||||
key: 'parent_id',
|
||||
params: { companies_id: props?.item?.id },
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '组织名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '组织类型',
|
||||
@ -60,24 +48,32 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
// Selects?.Employees({
|
||||
// title: '负责人',
|
||||
// colProps: { span: 8 },
|
||||
// }),
|
||||
// {
|
||||
// key: 'manager_phone',
|
||||
// title: '负责人手机',
|
||||
// colProps: { span: 8 },
|
||||
// valueType: 'number',
|
||||
// fieldProps: {
|
||||
// maxLength: 11,
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// key: 'manager_email',
|
||||
// title: '负责人邮箱',
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
{
|
||||
key: 'name',
|
||||
title: '组织名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
name: ['type'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ type }: any) => {
|
||||
return type !== OrganizationsTypeEnum.Group.value
|
||||
? [
|
||||
Selects?.OrganizationsTree({
|
||||
title: '请设置上级组织',
|
||||
key: 'parent_id',
|
||||
params: { companies_id: props?.item?.id },
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
placeholder: '可搜索或手动选择上级组织',
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -40,12 +40,6 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '组织名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
@ -53,12 +47,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
// Selects?.OrganizationsTree({
|
||||
// title: '上级组织',
|
||||
// key: 'parent_id',
|
||||
// params: { companies_id: props?.item?.companies_id },
|
||||
// colProps: { span: 24 },
|
||||
// }),
|
||||
{
|
||||
key: 'name',
|
||||
title: '组织名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -65,6 +65,23 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
valueEnum: CompanyReceiptAccountsPayChannelEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['pay_channel'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ pay_channel }: any) => {
|
||||
return pay_channel ===
|
||||
CompanyReceiptAccountsPayChannelEnum.TongLian.value
|
||||
? [
|
||||
{
|
||||
key: 'merchant_id',
|
||||
title: '商户ID',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'is_default',
|
||||
// title: '是否设为默认账号',
|
||||
|
||||
@ -65,6 +65,23 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: CompanyReceiptAccountsPayChannelEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['pay_channel'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ pay_channel }: any) => {
|
||||
return pay_channel ===
|
||||
CompanyReceiptAccountsPayChannelEnum.TongLian.value
|
||||
? [
|
||||
{
|
||||
key: 'merchant_id',
|
||||
title: '商户ID',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
// {
|
||||
// key: 'is_default',
|
||||
// title: '是否设为默认账号',
|
||||
|
||||
@ -6,7 +6,6 @@ import {
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
@ -41,19 +40,21 @@ export default function Index({ title = '机构列表' }) {
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '组织简称',
|
||||
title: '机构简称',
|
||||
dataIndex: 'short_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '企业名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'merchant_type',
|
||||
valueEnum: CompaniesMerchantTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
// MyColumns.EnumTag({
|
||||
// title: '类型',
|
||||
// dataIndex: 'merchant_type',
|
||||
// valueEnum: CompaniesMerchantTypeEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
MyColumns.SoftDelete({
|
||||
onRestore: Apis.Company.Companies.Restore,
|
||||
onSoftDelete: Apis.Company.Companies.SoftDelete,
|
||||
@ -81,7 +82,7 @@ export default function Index({ title = '机构列表' }) {
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
Apis.Company.Companies.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
|
||||
@ -47,11 +47,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
key: 'business_license_number',
|
||||
title: '营业执照号',
|
||||
colProps: { span: 24 },
|
||||
tooltip: '限制20位',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'contact_name',
|
||||
title: '联系人姓名',
|
||||
|
||||
@ -50,9 +50,13 @@ export default function Index({ title = '员工管理' }) {
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '组织',
|
||||
dataIndex: ['organization', 'name'],
|
||||
search: false,
|
||||
title: '所在组织',
|
||||
dataIndex: 'organization_path',
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { organization_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
|
||||
@ -12,7 +12,7 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseRegistersStatusEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
@ -31,7 +31,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title={props.title}
|
||||
trigger={<MyButtons.Default title="审核" type="primary" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="1000px"
|
||||
width="800px"
|
||||
modalProps={{
|
||||
bodyStyle: { maxHeight: '70vh', overflowY: 'auto' },
|
||||
}}
|
||||
@ -81,7 +81,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
|
||||
{props?.item?.customer_info &&
|
||||
props?.item?.customer_info?.length > 0 && (
|
||||
<ProCard title="客户信息" size="small">
|
||||
<ProCard size="small">
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
@ -91,36 +91,41 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
rowKey={(record, index) => record?.id_card || index}
|
||||
size="small"
|
||||
columns={[
|
||||
// MyColumns.EnumTag({
|
||||
// title: '房客关系',
|
||||
// dataIndex: 'house_relation',
|
||||
// valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
// width: 100,
|
||||
// }),
|
||||
MyColumns.EnumTag({
|
||||
title: '房客关系',
|
||||
dataIndex: 'house_relation',
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
width: 100,
|
||||
title:
|
||||
props?.item?.status === 'Rented'
|
||||
? '与主租人关系'
|
||||
: '与产权人关系',
|
||||
// title: '关系说明',
|
||||
dataIndex: 'relation_with_owner',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
width: 120,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '证件类型',
|
||||
dataIndex: 'card_type',
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
width: 120,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '证件资料',
|
||||
width: 120,
|
||||
render: (_, item) => {
|
||||
return (
|
||||
<Space>
|
||||
@ -147,7 +152,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
</ProCard>
|
||||
)}
|
||||
|
||||
{props?.item?.type === 'Delivery' &&
|
||||
{props?.item?.type === 'AddOwner' &&
|
||||
props?.item?.ownership_info &&
|
||||
props?.item?.ownership_info?.length > 0 && (
|
||||
<ProCard title="产证信息" size="small">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user