Compare commits

..

No commits in common. "d81d2409173e6d093623f0a0e01de97941ca73de" and "077117de4b53031fc80f0bb6df3291fbf2d7c8ef" have entirely different histories.

16 changed files with 522 additions and 2432 deletions

View File

@ -1,78 +0,0 @@
import { rulesHelper } from '@/common';
import { ProColumns, ProFormColumnsType } from '@ant-design/pro-components';
type ReturnType = ProColumns<any, 'text'> & ProFormColumnsType<any, 'text'>;
type PropsType = { required?: boolean } & ReturnType;
export const JinGangAreaOptions = [
{
label: '房屋缴费',
value: '0',
},
{
label: '新增工单',
value: '1',
},
{
label: '任务中心',
value: '2',
},
{
label: '打卡考勤',
value: '3',
},
{
label: '水印相机',
value: '4',
},
{
label: '客户管理',
value: '5',
},
{
label: '住户登记',
value: '6',
},
{
label: '仪表抄表',
value: '7',
},
{
label: '催缴记录',
value: '8',
},
{
label: '项目公告',
value: '9',
},
];
export const JinGangArea = {
JinGangAreaSelect(props?: PropsType): ReturnType {
const {
title = '选择按钮',
key = 'path',
required = false,
hideInTable = true,
...rest
} = props ?? {};
return {
title: title,
key: key,
valueType: 'select',
hideInTable: hideInTable,
formItemProps: { ...(required ? rulesHelper.text : {}) },
...rest,
fieldProps: {
options: JinGangAreaOptions,
showSearch: true,
fieldNames: {
label: 'label',
value: 'value',
},
...rest?.fieldProps,
},
};
},
};

255
src/gen/ApiTypes.d.ts vendored
View File

@ -9,7 +9,6 @@ declare namespace ApiTypes {
"project_name"?: string; // 项目名称
};
type Store = {
"companies_id": number; // 公司ID,[ref:companies]
"title": string; // 活动标题
"start_time": Date; // 活动开始时间
"end_time": Date; // 活动结束时间
@ -22,7 +21,6 @@ declare namespace ApiTypes {
};
type Update = {
"id": number; // id
"companies_id": number; // 公司ID,[ref:companies]
"title": string; // 活动标题
"start_time": Date; // 活动开始时间
"end_time": Date; // 活动结束时间
@ -160,13 +158,7 @@ declare namespace ApiTypes {
namespace HouseOccupants {
type List = {
"asset_houses_id"?: number; // 资产房屋ID
"asset_projects_id"?: number; // 资产项目ID
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
"name"?: string; // 客户姓名
"phone"?: string; // 客户手机号
"id_card"?: string; // 客户身份证号
"house_name"?: string; // 房屋名称
"project_name"?: string; // 项目名称
};
type CustomerList = {
"name"?: string; // 客户姓名
@ -214,11 +206,9 @@ declare namespace ApiTypes {
namespace HouseRegisters {
type List = {
"house_name"?: string; // 模糊搜索:房屋名称
"type"?: string[]; // 类型,[enum:HouseRegistersTypeEnum]
"type"?: string; // 类型,[enum:HouseRegistersTypeEnum]
"status"?: string; // 状态,[enum:HouseRegistersStatusEnum]
"asset_houses_id"?: number; // 房屋ID
"customer_name"?: string; // 客户名称
"project_name"?: string; // 模糊搜索:项目名称
};
type Store = {
"asset_houses_id": number; // 房屋ID
@ -379,19 +369,6 @@ declare namespace ApiTypes {
"asset_parking_places_id"?: number; // 所属车场id,[ref:asset_parking_places]
"keywords"?: string; // 关键词
};
type Import = {
"companies_id": number; // 机构id,[ref:companies]
"asset_projects_id": number; // 所属项目id,[ref:asset_projects]
"upload_file": mimes:xlsx,xls; // 上传的Excel文件
};
type Export = {
"companies_id"?: number; // 机构id,[ref:companies]
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
"asset_parking_places_id"?: number; // 所属车场id,[ref:asset_parking_places]
"full_name"?: string; // 模糊搜索:名称
"current"?: number; // 页码
"download_type": string; // 下载类型page 当前页(含查询条件)query 所有页(含查询条件)all所有记录
};
}
namespace AssetHouses {
type List = {
@ -729,151 +706,6 @@ declare namespace ApiTypes {
};
}
}
namespace Attendance {
namespace AttendanceConfigs {
type List = {
"companies_id"?: number; // 机构ID
};
type Store = {
"companies_id": number; // 机构ID
"asset_projects_id": number; // 项目ID
"check_in_range": number; // 打卡范围(米)
"require_photo": boolean; // 是否要求拍照打卡
"allow_out_range_checkin"?: boolean; // 是否允许范围外打卡
};
type UpdateConfig = {
"id": number; // id
"check_in_range": number; // 打卡范围(米)
"require_photo": boolean; // 是否要求拍照打卡
"allow_out_range_checkin"?: boolean; // 是否允许范围外打卡
};
type Enable = {
"id": number; // id
"is_enabled": boolean; // 是否启用: 1:启用 0:禁用
};
}
namespace AttendanceEmployeeTracks {
type List = {
"companies_id"?: number; // 机构ID
"company_employees_id"?: number; // 员工ID
"asset_projects_id"?: number; // 项目ID
"start_date"?: Date; // 开始日期
"end_date"?: Date; // 结束日期
};
type Detail = {
"company_employees_id": number; // 员工ID
"start_date": Date; // 开始日期
"end_date": Date; // 结束日期
"asset_projects_id"?: number; // 项目ID
};
}
namespace AttendanceRecords {
type List = {
"companies_id"?: number; // 机构ID
"company_employees_id"?: number; // 员工ID
"asset_projects_id"?: number; // 项目ID
"status"?: string; // 状态
"checkin_type"?: string; // 打卡类型
"checkin_time"?: string[]; // 打卡时间
};
type Show = {
"id": number; // 记录ID
};
type Export = {
"companies_id"?: number; // 机构ID
"company_employees_id"?: number; // 员工ID
"asset_projects_id"?: number; // 项目ID
"status"?: string; // 状态
"checkin_type"?: string; // 打卡类型
"checkin_time"?: string[]; // 打卡时间
};
}
namespace AttendanceSchedules {
type List = {
"companies_id"?: number; // 机构ID
"company_employees_id"?: number; // 员工ID
"asset_projects_id"?: number; // 项目ID
"schedule_date"?: Date; // 排班日期
"status"?: string; // 状态,[enum:AttendanceSchedulesStatusEnum]
"project_name"?: string; // 项目名称
"employee_name"?: string; // -
};
type Store = {
"companies_id": number; // 机构ID
"company_employees_id": number; // 员工ID
"attendance_shifts_id": number; // 班次ID
"asset_projects_id": number; // 项目ID
"schedule_date": Date; // 排班日期
"remark"?: string; // 备注
};
type BatchStore = {
"companies_id": number; // 机构ID
"schedules": string[]; // 排班列表
};
type Update = {
"id": number; // id
"company_employees_id"?: number; // 员工ID
"attendance_shifts_id"?: number; // 班次ID
"asset_projects_id"?: number; // 项目ID
"schedule_date"?: Date; // 排班日期
"remark"?: string; // 备注
};
type ChangeStatus = {
"id": number; // id
"status": string; // 状态,[enum:AttendanceSchedulesStatusEnum]
};
type Cancel = {
"id": number; // id
};
type Show = {
"id": number; // id
};
type SoftDelete = {
"id": number; // id
};
type Restore = {
"id": number; // id
};
type Delete = {
"id": number; // id
};
}
namespace AttendanceShifts {
type List = {
"name"?: string; // 班次名称
"companies_id"?: number; // 机构ID
"is_enabled"?: boolean; // 状态
"asset_projects_id"?: number; // 项目ID
"project_name"?: string; // 项目名称
};
type Store = {
"name": string; // 班次名称
"companies_id": number; // 机构ID
"asset_projects_id": number; // 关联项目IDs
"allow_checkin_start": date_format:H:i:s; // 可打卡开始时间
"allow_checkin_end": date_format:H:i:s; // 可打卡结束时间
"is_enabled"?: boolean; // 状态
"remark"?: string; // 备注
"periods": string[]; // 时段列表
};
type Update = {
"id": number; // id
"name"?: string; // 班次名称
"asset_projects_id"?: number; // 关联项目IDs
"allow_checkin_start"?: date_format:H:i:s; // 可打卡开始时间
"allow_checkin_end"?: date_format:H:i:s; // 可打卡结束时间
"is_enabled"?: boolean; // 状态
"remark"?: string; // 备注
"periods"?: string[]; // 时段列表
};
type Show = {
"id": number; // id
};
type Delete = {
"id": number; // id
};
}
}
namespace Banner {
namespace BannerSpaces {
type List = {
@ -1412,9 +1244,6 @@ declare namespace ApiTypes {
"companies_id"?: number; // 所属机构id,[ref:companies]
"projects_id"?: number; // 所属项目id,[ref:asset_projects]
};
type ProjectReceiptAccountsSelect = {
"projects_id"?: number; // 所属项目id,[ref:asset_projects]
};
}
namespace CompanyPropertyBrands {
type List = {
@ -1454,9 +1283,6 @@ declare namespace ApiTypes {
"name": string; // 名称
"icon": string[]; // 图标
"sort"?: number; // 排序:越小越靠前
"skip_url"?: string; // 跳转链接
"is_show"?: boolean; // 是否显示
"is_bind_house"?: boolean; // 是否绑定房屋
};
type BatchStore = {
"companies_id": number; // 机构IDid,[ref:companies]
@ -1467,9 +1293,6 @@ declare namespace ApiTypes {
"name": string; // 名称
"icon": string[]; // 图标
"sort"?: number; // 排序:越小越靠前
"skip_url"?: string; // 跳转链接
"is_show"?: boolean; // 是否显示
"is_bind_house"?: boolean; // 是否绑定房屋
};
type Show = {
"id": number; // id
@ -1613,30 +1436,6 @@ declare namespace ApiTypes {
"parent_id"?: number; // -
};
}
namespace EmployeeRoles {
type List = {
"name"?: string; // 模糊搜索:名称
"companies_id"?: number; // 机构ID
};
type Store = {
"name": string; // 名称
"companies_id": number; // 所属机构
};
type Update = {
"id": number; // ID
"name": string; // 名称
};
type Delete = {
"id": number; // ID
};
type GetPermissions = {
"id": number; // ID
};
type SetPermissions = {
"id": number; // ID
"permissions_ids": string[]; // 权限ID
};
}
}
namespace Customer {
namespace CustomerMomentCategories {
@ -1747,32 +1546,6 @@ declare namespace ApiTypes {
};
}
}
namespace Employee {
namespace EmployeeRoles {
type List = {
"name"?: string; // 模糊搜索:名称
"companies_id"?: number; // 机构ID
};
type Store = {
"name": string; // 名称
"companies_id": number; // 所属机构
};
type Update = {
"id": number; // ID
"name": string; // 名称
};
type Delete = {
"id": number; // ID
};
type GetPermissions = {
"id": number; // ID
};
type SetPermissions = {
"id": number; // ID
"permissions_ids": string[]; // 权限ID
};
}
}
namespace GoodsReleases {
namespace GoodsReleases {
type List = {
@ -1924,7 +1697,7 @@ declare namespace ApiTypes {
"tiered_rates"?: string[]; // 阶梯收费标准
"is_apportionment"?: number; // 是否分摊
"apportionment_method"?: string; // 分摊方式,[enum:HouseChargeStandardsApportionmentMethodEnum]
"has_late_fee"?: boolean; // 是否滞纳金
"has_late_fee"?: number; // 是否滞纳金
"late_fee_start_days"?: number; // 生成几天后开始收取滞纳金
"late_fee_rate"?: number; // 滞纳金费率(百分比)
"late_fee_cap_days"?: number; // 滞纳金封顶天数
@ -1949,7 +1722,7 @@ declare namespace ApiTypes {
"tiered_rates"?: string[]; // 阶梯收费标准
"is_apportionment"?: number; // 是否分摊
"apportionment_method"?: string; // 分摊方式,[enum:HouseChargeStandardsApportionmentMethodEnum]
"has_late_fee"?: boolean; // 是否滞纳金
"has_late_fee"?: number; // 是否滞纳金
"late_fee_start_days"?: number; // 生成几天后开始收取滞纳金
"late_fee_rate"?: number; // 滞纳金费率(百分比)
"late_fee_cap_days"?: number; // 滞纳金封顶天数
@ -1996,15 +1769,13 @@ declare namespace ApiTypes {
}
namespace HouseChargeTasks {
type List = {
"id"?: number; // id 任务id
"charge_standard_name"?: string; // 模糊搜索:收费标准名称
"asset_projects_id"?: number; // 资产项目id,[ref:asset_projects]
"companies_id"?: number; // 公司id,[ref:companies]
"status"?: string; // 任务状态,[enum:HouseChargeTasksStatusEnum]
"type"?: string; // 类型,[enum:HouseChargeTasksTypeEnum]
"project_name"?: string; // 资产项目名称
"company_name"?: string; // 公司名称
"bill_year"?: string; // 月份
"bill_month"?: string; // 月份
};
type Store = {
"house_charge_standards_id": number; // 房屋收费标准id,[ref:house_charge_standards]
@ -2336,9 +2107,6 @@ declare namespace ApiTypes {
type Delete = {
"id": number; // id
};
type Import = {
"upload_file": mimes:xlsx,xls; // 上传文件
};
}
namespace HouseMeterTaskDetails {
type List = {
@ -2360,10 +2128,6 @@ declare namespace ApiTypes {
namespace HouseMeterTasks {
type List = {
"name"?: string; // 模糊搜索:名称
"status"?: string; // 任务状态,[enum:HouseChargeTasksStatusEnum]
"generation_method"?: string; // 生成方式,[enum:HouseMeterTasksGenerationMethodEnum]
"bill_year"?: number; // 年份
"bill_month"?: number; // 月份
};
type Store = {
"asset_projects_id": number; // 资产项目id,[ref:asset_projects]
@ -2396,9 +2160,6 @@ declare namespace ApiTypes {
"project_name"?: string; // 模糊搜索:项目名称
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
"meter_type"?: string; // 仪表类型,[enum:HouseMetersMeterTypeEnum]
"usage_type"?: string; // 使用类型,[enum:HouseMetersUsageTypeEnum]
"charge_standard_name"?: string; // 模糊搜索:收费标准名称
"asset_houses_id"?: number; // 房屋id,[ref:asset_houses]
};
type Store = {
"asset_projects_id": number; // 项目id,[ref:asset_projects]
@ -2660,6 +2421,7 @@ declare namespace ApiTypes {
"is_fee"?: boolean; // 是否产生费用
"amount"?: number; // 金额(单位元)
"company_project_receipt_accounts_id"?: number; // 收款账户id,[ref:company_project_receipt_accounts]
"is_passed"?: boolean; // 装修验收0-不合格1-合格
};
type Show = {
"id": number; // id
@ -2739,13 +2501,6 @@ declare namespace ApiTypes {
"assign_status"?: string; // 工单分配状态,[enum:HouseWorkOrdersAssignStatusEnum]
"reporter_name"?: string; // 模糊搜索:上报人姓名
"reporter_phone"?: string; // 模糊搜索:上报人手机
"is_completed"?: boolean; // 是否完工:0否,1是
"is_evaluated"?: boolean; // 是否评价: 0否,1是
"is_visited"?: boolean; // 是否已访问: 0否,1是
"location"?: string; // 报修位置[enum:HouseWorkOrdersLocationEnum]
"asset_projects_id"?: number; // 资产项目id,[ref:asset_projects]
"project_name"?: string; // 模糊搜索:项目名称
"asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses]
};
type Store = {
"type": string; // 工单类型,[enum:HouseWorkOrdersTypeEnum]

File diff suppressed because it is too large Load Diff

View File

@ -227,37 +227,6 @@ export const AssetUnitsBuildingTypeEnum= {
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"},
};
// AttendanceRecordsCheckinTypeEnum
export const AttendanceRecordsCheckinTypeEnum= {
'CheckIn': {"text":"上班","color":"#1890ff","value":"CheckIn"},
'CheckOut': {"text":"下班","color":"#52c41a","value":"CheckOut"},
};
// AttendanceRecordsStatusEnum
export const AttendanceRecordsStatusEnum= {
'Normal': {"text":"正常","color":"#52c41a","value":"Normal"},
'Late': {"text":"迟到","color":"#faad14","value":"Late"},
'EarlyLeave': {"text":"早退","color":"#fa8c16","value":"EarlyLeave"},
'OutOfRange': {"text":"范围外","color":"#ff4d4f","value":"OutOfRange"},
'Reissue': {"text":"补卡","color":"#1890ff","value":"Reissue"},
};
// AttendanceSchedulesStatusEnum
export const AttendanceSchedulesStatusEnum= {
'Pending': {"text":"待生效","color":"#faad14","value":"Pending"},
'Active': {"text":"生效中","color":"#52c41a","value":"Active"},
'Cancelled': {"text":"已取消","color":"#ff4d4f","value":"Cancelled"},
};
// 打卡状态枚举
export const AttendanceStatusEnum= {
'Normal': {"text":"正常","color":"#52c41a","value":"Normal"},
'Late': {"text":"迟到","color":"#faad14","value":"Late"},
'Early': {"text":"早退","color":"#faad14","value":"Early"},
'OutOfRange': {"text":"范围外","color":"#ff4d4f","value":"OutOfRange"},
'MakeUp': {"text":"补卡","color":"#722ed1","value":"MakeUp"},
};
// BannerSpacesTypeEnum
export const BannerSpacesTypeEnum= {
'Popup': {"text":"弹窗","color":"#ff0000","value":"Popup"},
@ -282,7 +251,7 @@ export const BannersTypeEnum= {
// 缓存类型
export const CacheTypeEnum= {
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#026663","value":"MobilePhoneVerificationCode"},
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#3f0fe5","value":"MobilePhoneVerificationCode"},
};
// CompaniesMerchantTypeEnum
@ -328,13 +297,6 @@ export const CompanyEmployeeBacklogsTypeEnum= {
'MomentTask': {"text":"朋友圈任务","color":"#FF6600","value":"MomentTask"},
};
// CompanyEmployeesTypeEnum
export const CompanyEmployeesTypeEnum= {
'Staff': {"text":"员工","color":"#1890ff","value":"Staff"},
'WeCom': {"text":"企微","color":"#2196f3","value":"WeCom"},
'External': {"text":"外部","color":"#4caf50","value":"External"},
};
// CompanyReceiptAccountsPayChannelEnum
export const CompanyReceiptAccountsPayChannelEnum= {
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
@ -444,10 +406,9 @@ export const GoodsReleasesStatusEnum= {
// 账单状态枚举
export const HouseBillsBillStatusEnum= {
'PendingPayment': {"text":"待收款","color":"#facc15","value":"PendingPayment"},
'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"},
'PartiallyPaid': {"text":"部分收款","color":"#60a5fa","value":"PartiallyPaid"},
'Paid': {"text":"已收款","color":"#10b981","value":"Paid"},
'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"},
};
@ -461,7 +422,6 @@ export const HouseBillsTypeEnum= {
'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"},
'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"},
'CarPortFee': {"text":"车位费","color":"#f59e0b","value":"CarPortFee"},
'WorkOrderRepairFee': {"text":"工单维修费","color":"#f97316","value":"WorkOrderRepairFee"},
};
// HouseChargeStandardsApportionmentMethodEnum
@ -633,7 +593,6 @@ export const HouseOccupantsRelationWithOwnerEnum= {
// HouseOccupantsResidentialRelationEnum
export const HouseOccupantsResidentialRelationEnum= {
'PropertyOwner': {"text":"产权人","color":"#722ed1","value":"PropertyOwner"},
'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"},
'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"},
'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"},
@ -665,7 +624,6 @@ export const HouseOrdersAuditStatusEnum= {
// 订单状态枚举
export const HouseOrdersOrderStatusEnum= {
'Pending': {"text":"待支付","color":"#facc15","value":"Pending"},
'ToBeConfirmed': {"text":"待确认","color":"#fb923c","value":"ToBeConfirmed"},
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"},
'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"},
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"},
@ -729,7 +687,6 @@ export const HouseRegistersTypeEnum= {
'UpdateInfo': {"text":"修改信息","color":"#722ed1","value":"UpdateInfo"},
'UpdatePhone': {"text":"修改电话","color":"#13c2c2","value":"UpdatePhone"},
'GoodsRelease': {"text":"物品放行","color":"#a0d911","value":"GoodsRelease"},
'VisitorApplies': {"text":"来访申请","color":"#a0d911","value":"VisitorApplies"},
};
// HouseRegistersUsagePlanEnum
@ -801,12 +758,6 @@ export const HouseWorkOrdersTypeEnum= {
'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"},
};
// 公告阅读者类型
export const MsgPropertyAnnouncementReadsReaderTypeEnum= {
'Customer': {"text":"客户","color":"#3b82f6","value":"Customer"},
'Employee': {"text":"员工","color":"#10b981","value":"Employee"},
};
// 公告接收对象
export const MsgPropertyAnnouncementsObjectEnum= {
'Customer': {"text":"客户","color":"#3b82f6","value":"Customer"},
@ -860,8 +811,8 @@ export const SexEnum= {
// SysModuleEnum
export const SysModuleEnum= {
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"},
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"},
'Company': {"text":"机构","color":"#1890ff","value":"Company"},
'Employee': {"text":"员工","color":"#1890ff","value":"Employee"},
};
// SysPermissionsTypeEnum
@ -869,8 +820,6 @@ export const SysPermissionsTypeEnum= {
'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"},
'Page': {"text":"页面","color":"#4d9a13","value":"Page"},
'Button': {"text":"按钮","color":"#97224f","value":"Button"},
'QuickAction': {"text":"金刚区","color":"#2563eb","value":"QuickAction"},
'Module': {"text":"模块","color":"#0d9488","value":"Module"},
};
// 来访事由

View File

@ -1,91 +0,0 @@
import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { LeftOutlined } from '@ant-design/icons';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate, useSearchParams } from '@umijs/max';
import { Space } from 'antd';
import Create from './modals/Create';
import EditPermissions from './modals/EditPermissions';
import Update from './modals/Update';
export default function Index({ title = '员工角色' }) {
const [searchParams] = useSearchParams();
const navigate = useNavigate();
return (
<MyPageContainer
title={title}
enableTabs={true}
tabKey="company-employee-roles"
tabLabel={title}
>
<ProTable
{...MyProTableProps.props}
search={false}
bordered
headerTitle={
<Space>
<MyButtons.Default
title=""
icon={<LeftOutlined />}
onClick={() => navigate(-1)}
/>
{title}
</Space>
}
request={async (params, sort) =>
MyProTableProps.request(
{
...params,
companies_id: Number(searchParams.get('id')),
},
sort,
Apis.Company.EmployeeRoles.List,
)
}
toolBarRender={(action) => [
<Create
key="Create"
reload={action?.reload}
item={{ companies_id: Number(searchParams.get('id')) }}
title={title}
/>,
]}
columns={[
MyColumns.ID(),
{ dataIndex: 'name', title: '名称' },
{
title: '配置角色权限',
hideInSearch: true,
render: (_, item, index, action) => (
<EditPermissions
item={item}
title="配置角色权限"
reload={action?.reload}
/>
),
},
MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<Update item={item} reload={action?.reload} title={title} />
<MyButtons.Delete
onConfirm={() =>
Apis.Company.EmployeeRoles.Delete({ id: item.id }).then(
() => action?.reload(),
)
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}

View File

@ -1,43 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Company.EmployeeRoles.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.Company.EmployeeRoles.Store({
...values,
companies_id: props?.item?.companies_id ?? 0,
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
{ key: 'name', title: '名称', formItemProps: { ...rulesHelper.text } },
]}
/>
);
}

View File

@ -1,54 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyModalFormProps,
MyTreeCheckable,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
export default function EditPermissions(props: MyBetaModalFormProps) {
return (
<BetaSchemaForm<ApiTypes.Company.EmployeeRoles.SetPermissions>
{...MyModalFormProps.props}
title={props.title}
wrapperCol={{ span: 24 }}
width="600px"
trigger={<MyButtons.Edit title={props.title} />}
request={() =>
Apis.Company.EmployeeRoles.GetPermissions({
id: props?.item?.id ?? 0,
}).then((res) => {
return {
id: props?.item?.id,
permissions_ids: res.data?.permissions_ids,
};
})
}
onFinish={async (values) => {
return Apis.Company.EmployeeRoles.SetPermissions({
...values,
id: props.item?.id ?? 0,
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false);
}}
columns={[
{
key: 'permissions_ids',
title: '选择权限',
...rulesHelper.array,
renderFormItem: () => (
<MyTreeCheckable api={Apis.Company.EmployeeRoles.PermissionTree} />
),
},
]}
/>
);
}

View File

@ -1,44 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyModalFormProps,
rulesHelper,
} from '@/common';
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.Company.EmployeeRoles.Update>
{...MyModalFormProps.props}
form={form}
title={`编辑${props.title}`}
wrapperCol={{ span: 24 }}
width="500px"
trigger={<MyButtons.Edit />}
onOpenChange={(open: any) => {
if (open && props.item) {
form.setFieldsValue(props.item);
}
}}
onFinish={async (values) => {
return Apis.Company.EmployeeRoles.Update({
...values,
id: props.item?.id ?? 0,
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false);
}}
columns={[
{ key: 'name', title: '名称', formItemProps: { ...rulesHelper.text } },
]}
/>
);
}

View File

@ -5,7 +5,6 @@ import {
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { LeftOutlined } from '@ant-design/icons';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate, useSearchParams } from '@umijs/max';
import { Space } from 'antd';
@ -21,6 +20,19 @@ export default function Index({ title = '金刚区配置' }) {
enableTabs={true}
tabKey={`company-set-gan-info-${searchParams.get('id')}`}
tabLabel={title}
extra={[
<Space
key="back"
align="center"
style={{ marginRight: 20, padding: '10px 0 0 0' }}
>
<MyButtons.Default
title="返回上一页"
size="middle"
onClick={() => navigate(-1)}
/>
</Space>,
]}
>
<ProTable
{...MyProTableProps.props}
@ -32,16 +44,6 @@ export default function Index({ title = '金刚区配置' }) {
)
}
bordered
headerTitle={
<Space>
<MyButtons.Default
title=""
icon={<LeftOutlined />}
onClick={() => navigate(-1)}
/>
{title}
</Space>
}
toolBarRender={(action) => [
<Create
key="Create"

View File

@ -6,7 +6,7 @@ import {
} from '@/common';
import { defaultMenu } from '@/common/utils/wxCustomerConfig';
import { Apis } from '@/gen/Apis';
import { CaretDownOutlined, LeftOutlined } from '@ant-design/icons';
import { CaretDownOutlined } from '@ant-design/icons';
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
import { useNavigate, useSearchParams } from '@umijs/max';
import { Card, Col, Flex, Form, message, Row, Space, Tag } from 'antd';
@ -121,24 +121,25 @@ export default function Index({ title = '小程序页面配置' }) {
enableTabs={true}
tabKey="company-set-page-info"
tabLabel={title}
extra={[
<Space
key="back"
align="center"
style={{ marginRight: 20, padding: '10px 0 0 0' }}
>
<MyButtons.Default
title="返回上一页"
size="middle"
onClick={() => navigate(-1)}
/>
</Space>,
]}
>
<div className="page-config-container">
<Row gutter={[24, 0]}>
{/* 左侧表单区域 */}
<Col span={12}>
<Card
title={
<Space>
<MyButtons.Default
title=""
icon={<LeftOutlined />}
onClick={() => navigate(-1)}
/>
</Space>
}
className="form-card"
>
<Card title="页面配置" className="form-card">
<BetaSchemaForm<ApiTypes.Company.CompanyConfigs.Store>
{...MyModalFormProps.props}
title={title}

View File

@ -11,7 +11,6 @@ import CompanyApps from '../table/Apps';
import Assets from '../table/Assets';
import Brands from '../table/Brands';
import CustomerEnd from '../table/CustomerEnd';
import EmployeeEnd from '../table/EmployeeEnd';
import Employees from '../table/Employees';
import Organizations from '../table/Organizations';
import Positions from '../table/Positions';
@ -21,11 +20,7 @@ import Roles from '../table/Roles';
export default function Show({ title }: { title?: string } = {}) {
const { id } = useParams<{ id: string }>();
const [data, setShow] = useState<any>({});
// 从sessionStorage读取上次的activeKey确保页面刷新或导航后保持状态
const [activeKey, setActiveKey] = useState(() => {
const storedKey = sessionStorage.getItem(`company-show-${id}-activeKey`);
return storedKey || '1';
});
const [activeKey, setActiveKey] = useState('1');
// 注册当前页面为标签页
const { addTab } = usePageTabs({
tabKey: `company-show-${id}`,
@ -105,18 +100,12 @@ export default function Show({ title }: { title?: string } = {}) {
closable: false,
children: <CustomerEnd item={data} />,
},
{
label: '员工端配置',
key: '10',
closable: false,
children: <EmployeeEnd item={data} />,
},
];
return (
<MyPageContainer title={title}>
{/* <ComponentsInfo item={data} /> */}
<ProCard
title={`${data?.name || ''} (${data?.short_name || ''})`}
title={`${data?.name} (${data?.short_name})`}
extra={
<Space>
<ComponentsInfo
@ -179,11 +168,6 @@ export default function Show({ title }: { title?: string } = {}) {
status: 'finish',
icon: <></>,
},
{
title: '员工端配置',
status: 'finish',
icon: <></>,
},
]}
/>
</div>
@ -192,11 +176,7 @@ export default function Show({ title }: { title?: string } = {}) {
<Tabs
type="card"
activeKey={activeKey}
onChange={(key) => {
setActiveKey(key);
// 将当前选择的标签页存储到sessionStorage
sessionStorage.setItem(`company-show-${id}-activeKey`, key);
}}
onChange={setActiveKey}
items={data?.id ? items : []}
/>
</ProCard>

View File

@ -16,7 +16,6 @@ export default function CompanyApps(props: MyBetaModalFormProps) {
<>
<ProTable
{...MyProTableProps.props}
bordered
request={async (params, sort) =>
MyProTableProps.request(
{ ...params, companies_id: props?.item?.id },

View File

@ -1,34 +0,0 @@
import { MyBetaModalFormProps, MyButtons } from '@/common';
import { ProCard } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
export default function EmployeeEnd(props: MyBetaModalFormProps) {
const navigate = useNavigate();
return (
<div>
<ProCard title="员工端配置" bordered headerBordered gutter={16}>
<ProCard
title="员工角色配置"
type="inner"
bordered
extra={
<MyButtons.Default
title="去配置"
type="primary"
size="small"
onClick={() => {
navigate(
`/company/list/pages/employee_role?id=${props?.item?.id}`,
);
}}
/>
}
>
<div style={{ height: '80px' }}>
</div>
</ProCard>
</ProCard>
</div>
);
}

View File

@ -1,7 +1,5 @@
import { MyBetaModalFormProps, MyButtons } from '@/common';
import MyEnumRadioGroup from '@/common/components/formFields/MyEnumRadioGroup';
import { Apis } from '@/gen/Apis';
import { SysModuleEnum } from '@/gen/Enums';
import { ProCard } from '@ant-design/pro-components';
import { message, Space, Tree, TreeProps } from 'antd';
import { DataNode } from 'antd/es/tree';
@ -10,8 +8,7 @@ import { useEffect, useState } from 'react';
export default function Index(props: MyBetaModalFormProps) {
const [treeData, setTreeData] = useState<DataNode[]>([]);
const [checkedKeys, setCheckedKeys] = useState<string[]>([]);
const [guardName, setGuardName] = useState<string>('Company');
const [getSysModuleEnum, setSysModuleEnum] = useState<any>({});
const processTree = (item: any): DataNode => {
return {
...item,
@ -41,9 +38,6 @@ export default function Index(props: MyBetaModalFormProps) {
};
useEffect(() => {
let obj = JSON.parse(JSON.stringify(SysModuleEnum));
delete obj.Admin;
setSysModuleEnum(obj);
getPermissionTree();
}, []);
@ -62,15 +56,6 @@ export default function Index(props: MyBetaModalFormProps) {
return (treeData?.length ?? 0) > 0 ? (
<ProCard
title={
<MyEnumRadioGroup
enums={getSysModuleEnum}
onChange={(e) => {
setGuardName(e as string);
}}
value={guardName}
/>
}
extra={[
<MyButtons.Default
title="保存"

View File

@ -5,7 +5,6 @@ import {
MyModalFormProps,
rulesHelper,
} from '@/common';
import { JinGangArea } from '@/components/EmployeeJinGangBtnSelect';
import { SysSelects } from '@/components/SysSelects';
import { Apis } from '@/gen/Apis';
import { SysPermissionsTypeEnum } from '@/gen/Enums';
@ -74,21 +73,7 @@ export default function Create(
valueEnum: SysPermissionsTypeEnum,
required: true,
}),
{
valueType: 'dependency',
name: ['type'],
columns: ({ type }) => {
return type === 'QuickAction'
? [
JinGangArea?.JinGangAreaSelect({
key: 'path',
title: '选择金刚区按钮',
required: true,
}),
]
: [{ key: 'path', title: '路由' }];
},
},
{ key: 'path', title: '路由' },
SysSelects.Api(),
]}
/>

View File

@ -5,7 +5,6 @@ import {
MyModalFormProps,
rulesHelper,
} from '@/common';
import { JinGangArea } from '@/components/EmployeeJinGangBtnSelect';
import { SysSelects } from '@/components/SysSelects';
import { Apis } from '@/gen/Apis';
import { SysPermissionsTypeEnum } from '@/gen/Enums';
@ -64,21 +63,7 @@ export default function Update(
valueEnum: SysPermissionsTypeEnum,
required: true,
}),
{
valueType: 'dependency',
name: ['type'],
columns: ({ type }) => {
return type === 'QuickAction'
? [
JinGangArea?.JinGangAreaSelect({
key: 'path',
title: '选择金刚区按钮',
required: true,
}),
]
: [{ key: 'path', title: '路由' }];
},
},
{ key: 'path', title: '路由' },
SysSelects.Api(),
]}
/>