diff --git a/.umirc.ts b/.umirc.ts index 6fdf83b..0beccf1 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -14,12 +14,11 @@ export default defineConfig({ }, proxy: { '/api/': { - // target: 'http://yt:8003', + target: 'http://10.39.13.78:8001', // target: 'http://10.39.13.78:8001/', - target: 'https://test-admin.linyikj.com.cn/', + // target: 'https://test-admin.linyikj.com.cn/', // target: 'https://admin.linyikj.com.cn/', // target: 'http://c789629c.natappfree.cc', - changeOrigin: true, pathRewrite: { '^': '' }, }, diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 38324cf..46ac407 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -660,11 +660,13 @@ declare namespace ApiTypes { type Store = { "name": string; // 岗位名称 "is_use"?: number; // 是否启用,1启用,0禁用 + "remark"?: string; // 备注 }; type Update = { "id": number; // id "name": string; // 岗位名称 "is_use"?: number; // 是否启用,1启用,0禁用 + "remark"?: string; // 备注 }; type Show = { "id": number; // id @@ -748,7 +750,9 @@ declare namespace ApiTypes { } namespace CompanyApps { type List = { + "id"?: number; // id "name"?: string; // 模糊搜索:名称 + "companies_id": number; // 机构id,[ref:companies] }; type Store = { "companies_id": number; // 机构id,[ref:companies] @@ -772,6 +776,33 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace CompanyConfigs { + type List = { + "companies_id"?: number; // 机构IDid,[ref:companies] + "config_key"?: string; // 模糊搜索:名称 + }; + type Store = { + "companies_id": number; // 机构IDid,[ref:companies] + "config_key": string; // 机构配置键,[enum:CompanyConfigsConfigKeyEnum] + "config_value": string[]; // 机构配置值 + }; + type Update = { + "id": number; // id + "companies_id": number; // 机构IDid,[ref:companies] + "config_key": string; // 机构配置键,[enum:CompanyConfigsConfigKeyEnum] + "config_value": string[]; // 机构配置值 + }; + type GetDetail = { + "companies_id": number; // 机构IDid,[ref:companies] + "config_key": string; // 机构配置键,[enum:CompanyConfigsConfigKeyEnum] + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace CompanyEmployees { type List = { "companies_id"?: number; // 机构ID @@ -788,6 +819,7 @@ declare namespace ApiTypes { "positions_id"?: number; // 岗位id,[ref:company_positions] "sex"?: string; // 性别,[enum:SexEnum] "remark"?: string; // 备注 + "is_company_admin"?: boolean; // 是否机构管理员 }; type Update = { "id": number; // id @@ -798,6 +830,7 @@ declare namespace ApiTypes { "positions_id"?: number; // 岗位id,[ref:company_positions] "sex"?: string; // 性别,[enum:SexEnum] "remark"?: string; // 备注 + "is_company_admin"?: boolean; // 是否机构管理员 }; type Show = { "id": number; // id @@ -820,6 +853,15 @@ declare namespace ApiTypes { "upload_file": mimes:xlsx,xls; // 上传文件 }; } + namespace CompanyPermissions { + type GetPermissions = { + "companies_id": number; // 机构ID + }; + type SetPermissions = { + "companies_id": number; // 机构ID + "permissions_ids": string[]; // 菜单权限ID列表 + }; + } namespace CompanyPositions { type List = { "companies_id"?: number; // 机构ID @@ -913,6 +955,33 @@ declare namespace ApiTypes { "company_name"?: string; // 模糊搜索:机构名称 }; } + namespace CompanyQuickActions { + type List = { + "name"?: string; // 模糊搜索:名称 + }; + type Store = { + "companies_id": number; // 机构IDid,[ref:companies] + "name": string; // 名称 + "icon": string[]; // 图标 + "sort"?: number; // 排序:越小越靠前 + }; + type BatchStore = { + "companies_id": number; // 机构IDid,[ref:companies] + }; + type Update = { + "id": number; // id + "companies_id": number; // 机构IDid,[ref:companies] + "name": string; // 名称 + "icon": string[]; // 图标 + "sort"?: number; // 排序:越小越靠前 + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace CompanyReceiptAccounts { type List = { "company_name"?: string; // 模糊搜索:名称 @@ -1134,6 +1203,9 @@ declare namespace ApiTypes { type List = { "name"?: string; // 模糊搜索:名称 "asset_projects_id"?: number; // 所属项目id,[ref:asset_projects] + "project_name"?: string; // 项目名称 + "companies_id"?: number; // 所属机构id,[ref:companies] + "company_name"?: string; // 机构名称 }; type Store = { "asset_projects_id": number; // 所属项目id,[ref:asset_projects] @@ -1322,6 +1394,44 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace HouseOrderRefunds { + type List = { + "house_orders_id"?: number; // 订单id + "refund_status"?: string; // 退款状态 + "payment_method"?: string; // 支付方式 + "refund_no"?: string; // 退款编号 + "apply_employees_id"?: number; // 申请员工id + "date_range"?: string[]; // 日期范围 [start_date, end_date] + }; + type Store = { + "house_orders_id": number; // 房屋物业费账单id,[ref:house_orders] + "refund_amount": number; // 退款金额(元,前端提交) + "refund_reason"?: string; // 退款原因 + }; + type Update = { + "id": number; // id + "house_orders_id": number; // 房屋物业费账单id,[ref:house_orders] + "refund_amount": number; // 退款金额(元,前端提交) + "refund_reason"?: string; // 退款原因 + }; + type Show = { + "id": number; // id + }; + type Audit = { + "id": number; // 退款记录id + "approved": boolean; // 是否通过审核 + "audit_remark"?: string; // 审核备注 + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace HouseOrders { type List = { "id"?: number; // id @@ -1343,6 +1453,31 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace HousePrepaymentLogs { + type List = { + "house_prepayments_id"?: number; // 房屋预付缴费id,[ref:house_prepayments] + "asset_houses_id"?: number; // 房屋id,[ref:asset_houses] + "house_prepayment_payments_id"?: number; // 房屋预付缴费支付记录id,[ref:house_prepayment_payments] + "full_name"?: string; // 房屋名称 + }; + type Deduct = { + "asset_houses_id": number; // 房屋id,[ref:asset_houses] + "bills_id": string[]; // 账单id,[ref:house_bills] + "amount": number; // 扣款金额 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace HousePrepaymentPayments { type List = { "house_prepayments_id"?: number; // 房屋预付id,[ref:house_prepayments] @@ -1356,6 +1491,45 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace HousePrepaymentRefunds { + type List = { + "house_prepayments_id"?: number; // 预缴id + "house_prepayment_payments_id"?: number; // 预缴支付id + "refund_status"?: string; // 退款状态 + "payment_method"?: string; // 支付方式 + "refund_no"?: string; // 退款编号 + "apply_employees_id"?: number; // 申请员工id + "date_range"?: string[]; // 日期范围 [start_date, end_date] + }; + type Store = { + "house_prepayment_payments_id": number; // 房屋预缴支付记录id,[ref:house_prepayment_payments] + "refund_amount": number; // 退款金额(元,前端提交) + "refund_reason"?: string; // 退款原因 + }; + type Update = { + "id": number; // id + "house_prepayments_id": number; // 房屋预缴id,[ref:house_prepayments] + "refund_amount": number; // 退款金额(元,前端提交) + "refund_reason"?: string; // 退款原因 + }; + type Show = { + "id": number; // id + }; + type Audit = { + "id": number; // 退款记录id + "approved": boolean; // 是否通过审核 + "audit_remark"?: string; // 审核备注 + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace HousePrepayments { type List = { "full_name"?: string; // 模糊搜索:房屋名称 @@ -1656,9 +1830,70 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace HouseWorkOrderPayments { + type List = { + "name"?: string; // 模糊搜索:名称 + }; + type Store = { + "house_work_orders_id": number; // 工单id,[ref:house_work_orders] + "amount": number; // 金额(单位分) + "actual_amount"?: number; // 实际支付金额(单位分) + "payment_method": string; // 支付方式,[enum:HouseOrdersPaymentMethodEnum] + "payment_status"?: string; // 支付状态,[enum:HouseOrdersOrderStatusEnum] + "paid_time"?: Date; // 支付时间 + "payment_no"?: string; // 支付发起单号 + "transaction_id"?: string; // 交易号(微信、支付宝的单号) + "third_trade_no"?: string; // 第三方交易号(如通联、乐刷) + "bank_type"?: string; // 银行类型 + "notify_json"?: string[]; // 回调通知参数 + "receipt_account": string[]; // 收款账号信息 + "asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses] + "asset_units_id"?: number; // 资产单元id,[ref:asset_units] + "asset_buildings_id"?: number; // 资产楼栋id,[ref:asset_buildings] + "asset_projects_id": number; // 资产项目id,[ref:asset_projects] + "companies_id": number; // 公司id,[ref:companies] + "customers_id"?: number; // 客户[ref:customers] + "phone"?: string; // 手机号 + "openid"?: string; // 付款人的openid + }; + type Update = { + "id": number; // id + "house_work_orders_id": number; // 工单id,[ref:house_work_orders] + "amount": number; // 金额(单位分) + "actual_amount"?: number; // 实际支付金额(单位分) + "payment_method": string; // 支付方式,[enum:HouseOrdersPaymentMethodEnum] + "payment_status"?: string; // 支付状态,[enum:HouseOrdersOrderStatusEnum] + "paid_time"?: Date; // 支付时间 + "payment_no"?: string; // 支付发起单号 + "transaction_id"?: string; // 交易号(微信、支付宝的单号) + "third_trade_no"?: string; // 第三方交易号(如通联、乐刷) + "bank_type"?: string; // 银行类型 + "notify_json"?: string[]; // 回调通知参数 + "receipt_account": string[]; // 收款账号信息 + "asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses] + "asset_units_id"?: number; // 资产单元id,[ref:asset_units] + "asset_buildings_id"?: number; // 资产楼栋id,[ref:asset_buildings] + "asset_projects_id": number; // 资产项目id,[ref:asset_projects] + "companies_id": number; // 公司id,[ref:companies] + "customers_id"?: number; // 客户[ref:customers] + "phone"?: string; // 手机号 + "openid"?: string; // 付款人的openid + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace HouseWorkOrders { type List = { - "title"?: string; // 模糊搜索:名称 "house_name"?: string; // 模糊搜索:房屋名称 "type"?: string[]; // 工单类型,[enum:HouseWorkOrdersTypeEnum] "level"?: string; // 工单优先级,[enum:HouseWorkOrdersLevelEnum] @@ -1701,6 +1936,11 @@ declare namespace ApiTypes { "predict_complete_at"?: Date; // 预计完成时间 "level"?: string; // 优先级,[enum:HouseWorkOrdersLevelEnum] }; + type Visited = { + "id": number; // id + "visited_remark"?: string; // 访问说明 + "visited_attachment"?: string[]; // 访问附件 + }; type SoftDelete = { "id": number; // id }; diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 754e829..5ac9495 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -435,7 +435,7 @@ export const Apis = { }, }, CompanyApps: { - List(data?: ApiTypes.Company.CompanyApps.List): Promise { + List(data: ApiTypes.Company.CompanyApps.List): Promise { return request('admin/company/company_apps/list', { data }); }, Store(data: ApiTypes.Company.CompanyApps.Store): Promise { @@ -451,6 +451,26 @@ export const Apis = { return request('admin/company/company_apps/delete', { data }); }, }, + CompanyConfigs: { + List(data?: ApiTypes.Company.CompanyConfigs.List): Promise { + return request('admin/company/company_configs/list', { data }); + }, + Store(data: ApiTypes.Company.CompanyConfigs.Store): Promise { + return request('admin/company/company_configs/store', { data }); + }, + Update(data: ApiTypes.Company.CompanyConfigs.Update): Promise { + return request('admin/company/company_configs/update', { data }); + }, + GetDetail(data: ApiTypes.Company.CompanyConfigs.GetDetail): Promise { + return request('admin/company/company_configs/get_detail', { data }); + }, + Show(data: ApiTypes.Company.CompanyConfigs.Show): Promise { + return request('admin/company/company_configs/show', { data }); + }, + Delete(data: ApiTypes.Company.CompanyConfigs.Delete): Promise { + return request('admin/company/company_configs/delete', { data }); + }, + }, CompanyEmployees: { List(data?: ApiTypes.Company.CompanyEmployees.List): Promise { return request('admin/company/company_employees/list', { data }); @@ -483,6 +503,17 @@ export const Apis = { return request('admin/company/company_employees/download_template', {responseType: 'blob',}); }, }, + CompanyPermissions: { + GetPermissions(data: ApiTypes.Company.CompanyPermissions.GetPermissions): Promise { + return request('admin/company/company_permissions/get_permissions', { data }); + }, + SetPermissions(data: ApiTypes.Company.CompanyPermissions.SetPermissions): Promise { + return request('admin/company/company_permissions/set_permissions', { data }); + }, + PermissionTree(): Promise { + return request('admin/company/company_permissions/permission_tree', {}); + }, + }, CompanyPositions: { List(data?: ApiTypes.Company.CompanyPositions.List): Promise { return request('admin/company/company_positions/list', { data }); @@ -546,6 +577,26 @@ export const Apis = { return request('admin/company/company_property_brands/select', { data }); }, }, + CompanyQuickActions: { + List(data?: ApiTypes.Company.CompanyQuickActions.List): Promise { + return request('admin/company/company_quick_actions/list', { data }); + }, + Store(data: ApiTypes.Company.CompanyQuickActions.Store): Promise { + return request('admin/company/company_quick_actions/store', { data }); + }, + BatchStore(data: ApiTypes.Company.CompanyQuickActions.BatchStore): Promise { + return request('admin/company/company_quick_actions/batch_store', { data }); + }, + Update(data: ApiTypes.Company.CompanyQuickActions.Update): Promise { + return request('admin/company/company_quick_actions/update', { data }); + }, + Show(data: ApiTypes.Company.CompanyQuickActions.Show): Promise { + return request('admin/company/company_quick_actions/show', { data }); + }, + Delete(data: ApiTypes.Company.CompanyQuickActions.Delete): Promise { + return request('admin/company/company_quick_actions/delete', { data }); + }, + }, CompanyReceiptAccounts: { List(data?: ApiTypes.Company.CompanyReceiptAccounts.List): Promise { return request('admin/company/company_receipt_accounts/list', { data }); @@ -783,6 +834,32 @@ export const Apis = { return request('admin/house_order/house_order_payments/delete', { data }); }, }, + HouseOrderRefunds: { + List(data?: ApiTypes.HouseOrder.HouseOrderRefunds.List): Promise { + return request('admin/house_order/house_order_refunds/list', { data }); + }, + Store(data: ApiTypes.HouseOrder.HouseOrderRefunds.Store): Promise { + return request('admin/house_order/house_order_refunds/store', { data }); + }, + Update(data: ApiTypes.HouseOrder.HouseOrderRefunds.Update): Promise { + return request('admin/house_order/house_order_refunds/update', { data }); + }, + Show(data: ApiTypes.HouseOrder.HouseOrderRefunds.Show): Promise { + return request('admin/house_order/house_order_refunds/show', { data }); + }, + Audit(data: ApiTypes.HouseOrder.HouseOrderRefunds.Audit): Promise { + return request('admin/house_order/house_order_refunds/audit', { data }); + }, + SoftDelete(data: ApiTypes.HouseOrder.HouseOrderRefunds.SoftDelete): Promise { + return request('admin/house_order/house_order_refunds/soft_delete', { data }); + }, + Restore(data: ApiTypes.HouseOrder.HouseOrderRefunds.Restore): Promise { + return request('admin/house_order/house_order_refunds/restore', { data }); + }, + Delete(data: ApiTypes.HouseOrder.HouseOrderRefunds.Delete): Promise { + return request('admin/house_order/house_order_refunds/delete', { data }); + }, + }, HouseOrders: { List(data?: ApiTypes.HouseOrder.HouseOrders.List): Promise { return request('admin/house_order/house_orders/list', { data }); @@ -800,6 +877,26 @@ export const Apis = { return request('admin/house_order/house_orders/delete', { data }); }, }, + HousePrepaymentLogs: { + List(data?: ApiTypes.HouseOrder.HousePrepaymentLogs.List): Promise { + return request('admin/house_order/house_prepayment_logs/list', { data }); + }, + Deduct(data: ApiTypes.HouseOrder.HousePrepaymentLogs.Deduct): Promise { + return request('admin/house_order/house_prepayment_logs/deduct', { data }); + }, + Show(data: ApiTypes.HouseOrder.HousePrepaymentLogs.Show): Promise { + return request('admin/house_order/house_prepayment_logs/show', { data }); + }, + SoftDelete(data: ApiTypes.HouseOrder.HousePrepaymentLogs.SoftDelete): Promise { + return request('admin/house_order/house_prepayment_logs/soft_delete', { data }); + }, + Restore(data: ApiTypes.HouseOrder.HousePrepaymentLogs.Restore): Promise { + return request('admin/house_order/house_prepayment_logs/restore', { data }); + }, + Delete(data: ApiTypes.HouseOrder.HousePrepaymentLogs.Delete): Promise { + return request('admin/house_order/house_prepayment_logs/delete', { data }); + }, + }, HousePrepaymentPayments: { List(data?: ApiTypes.HouseOrder.HousePrepaymentPayments.List): Promise { return request('admin/house_order/house_prepayment_payments/list', { data }); @@ -811,6 +908,32 @@ export const Apis = { return request('admin/house_order/house_prepayment_payments/delete', { data }); }, }, + HousePrepaymentRefunds: { + List(data?: ApiTypes.HouseOrder.HousePrepaymentRefunds.List): Promise { + return request('admin/house_order/house_prepayment_refunds/list', { data }); + }, + Store(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Store): Promise { + return request('admin/house_order/house_prepayment_refunds/store', { data }); + }, + Update(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Update): Promise { + return request('admin/house_order/house_prepayment_refunds/update', { data }); + }, + Show(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Show): Promise { + return request('admin/house_order/house_prepayment_refunds/show', { data }); + }, + Audit(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Audit): Promise { + return request('admin/house_order/house_prepayment_refunds/audit', { data }); + }, + SoftDelete(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.SoftDelete): Promise { + return request('admin/house_order/house_prepayment_refunds/soft_delete', { data }); + }, + Restore(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Restore): Promise { + return request('admin/house_order/house_prepayment_refunds/restore', { data }); + }, + Delete(data: ApiTypes.HouseOrder.HousePrepaymentRefunds.Delete): Promise { + return request('admin/house_order/house_prepayment_refunds/delete', { data }); + }, + }, HousePrepayments: { List(data?: ApiTypes.HouseOrder.HousePrepayments.List): Promise { return request('admin/house_order/house_prepayments/list', { data }); @@ -1025,6 +1148,29 @@ export const Apis = { return request('admin/work_order/house_work_logs/delete', { data }); }, }, + HouseWorkOrderPayments: { + List(data?: ApiTypes.WorkOrder.HouseWorkOrderPayments.List): Promise { + return request('admin/work_order/house_work_order_payments/list', { data }); + }, + Store(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.Store): Promise { + return request('admin/work_order/house_work_order_payments/store', { data }); + }, + Update(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.Update): Promise { + return request('admin/work_order/house_work_order_payments/update', { data }); + }, + Show(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.Show): Promise { + return request('admin/work_order/house_work_order_payments/show', { data }); + }, + SoftDelete(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.SoftDelete): Promise { + return request('admin/work_order/house_work_order_payments/soft_delete', { data }); + }, + Restore(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.Restore): Promise { + return request('admin/work_order/house_work_order_payments/restore', { data }); + }, + Delete(data: ApiTypes.WorkOrder.HouseWorkOrderPayments.Delete): Promise { + return request('admin/work_order/house_work_order_payments/delete', { data }); + }, + }, HouseWorkOrders: { List(data?: ApiTypes.WorkOrder.HouseWorkOrders.List): Promise { return request('admin/work_order/house_work_orders/list', { data }); @@ -1041,6 +1187,9 @@ export const Apis = { Assign(data: ApiTypes.WorkOrder.HouseWorkOrders.Assign): Promise { return request('admin/work_order/house_work_orders/assign', { data }); }, + Visited(data: ApiTypes.WorkOrder.HouseWorkOrders.Visited): Promise { + return request('admin/work_order/house_work_orders/visited', { data }); + }, SoftDelete(data: ApiTypes.WorkOrder.HouseWorkOrders.SoftDelete): Promise { return request('admin/work_order/house_work_orders/soft_delete', { data }); }, diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index a8a8ab1..dca5f92 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -154,7 +154,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#ad9561","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#c639cc","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum @@ -182,6 +182,11 @@ export const CompanyAppsWorkTypeEnum= { 'WorkWechat': {"text":"企微","color":"#0091ea","value":"WorkWechat"}, }; +// CompanyConfigsConfigKeyEnum +export const CompanyConfigsConfigKeyEnum= { + 'Theme': {"text":"主题色","color":"#3b82f6","value":"Theme"}, +}; + // CompanyEmployeeBacklogsStatusEnum export const CompanyEmployeeBacklogsStatusEnum= { 'Pending': {"text":"待办","color":"#FF6600","value":"Pending"}, @@ -471,6 +476,16 @@ export const HouseOccupantsStatusEnum= { 'Unbound': {"text":"解绑","color":"#f5222d","value":"Unbound"}, }; +// HouseOrderRefundsRefundStatusEnum +export const HouseOrderRefundsRefundStatusEnum= { + 'Requested': {"text":"已申请","color":"#2196f3","value":"Requested"}, + 'Reviewing': {"text":"审核中","color":"#ff9800","value":"Reviewing"}, + 'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"}, + 'Processing': {"text":"退款中","color":"#9c27b0","value":"Processing"}, + 'Refunded': {"text":"已退款","color":"#4caf50","value":"Refunded"}, + 'Failed': {"text":"退款失败","color":"#e91e63","value":"Failed"}, +}; + // 订单状态枚举 export const HouseOrdersOrderStatusEnum= { 'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, @@ -487,6 +502,8 @@ export const HouseOrdersPaymentMethodEnum= { 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, 'Prepayment': {"text":"预缴支付","color":"#f59e0b","value":"Prepayment"}, + 'POS': {"text":"POS机","color":"#8b5cf6","value":"POS"}, + 'Cash': {"text":"现金","color":"#dc2626","value":"Cash"}, }; // HousePrepaymentLogsTypeEnum @@ -544,6 +561,12 @@ export const HouseRegistersUsagePlanEnum= { 'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"}, }; +// HouseWorkOrdersAcceptResultEnum +export const HouseWorkOrdersAcceptResultEnum= { + 'Satisfied': {"text":"满意","color":"#28A745","value":"Satisfied"}, + 'Unsatisfied': {"text":"不满意","color":"#DC3545","value":"Unsatisfied"}, +}; + // HouseWorkOrdersAssignStatusEnum export const HouseWorkOrdersAssignStatusEnum= { 'Unassigned': {"text":"未指派","color":"#ff0000","value":"Unassigned"}, @@ -572,13 +595,22 @@ export const HouseWorkOrdersLevelEnum= { // HouseWorkOrdersLocationEnum export const HouseWorkOrdersLocationEnum= { 'CommonArea': {"text":"公共区域","color":"#ff0000","value":"CommonArea"}, - 'MyHome': {"text":"我家","color":"#00ff00","value":"MyHome"}, + 'MyHome': {"text":"房屋","color":"#00ff00","value":"MyHome"}, +}; + +// HouseWorkOrdersRefundStatusEnum +export const HouseWorkOrdersRefundStatusEnum= { + 'Refunding': {"text":"退款中","color":"#FFA500","value":"Refunding"}, + 'Refunded': {"text":"已退款","color":"#28A745","value":"Refunded"}, + 'PartialRefund': {"text":"部分退款","color":"#17A2B8","value":"PartialRefund"}, }; // HouseWorkOrdersStatusEnum export const HouseWorkOrdersStatusEnum= { 'Pending': {"text":"待处理","color":"#FFA500","value":"Pending"}, 'Processing': {"text":"处理中","color":"#1E90FF","value":"Processing"}, + 'PendingPayment': {"text":"待支付","color":"#FF8C00","value":"PendingPayment"}, + 'PendingAcceptance': {"text":"待验收","color":"#17A2B8","value":"PendingAcceptance"}, 'Completed': {"text":"已完成","color":"#28A745","value":"Completed"}, 'Closed': {"text":"已关闭","color":"#6C757D","value":"Closed"}, }; @@ -614,6 +646,7 @@ export const SexEnum= { export const SysModuleEnum= { 'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, 'Customer': {"text":"客户","color":"#d4b106","value":"Customer"}, + 'Company': {"text":"机构","color":"#1890ff","value":"Company"}, }; // SysPermissionsTypeEnum diff --git a/src/pages/banner/index.tsx b/src/pages/banner/index.tsx index 6d61d9e..578206c 100644 --- a/src/pages/banner/index.tsx +++ b/src/pages/banner/index.tsx @@ -8,15 +8,12 @@ import { import { Apis } from '@/gen/Apis'; import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import BannerCreate from './modals/BannerCreate'; import BannerShow from './modals/BannerShow'; import BannerUpdate from './modals/BannerUpdate'; export default function Index({ title = '内容管理' }) { - const navigate = useNavigate(); - // 注册当前页面为标签页 usePageTabs({ tabKey: 'banners', diff --git a/src/pages/company/employees/index.tsx b/src/pages/company/employees/index.tsx index e36788d..da8eeaa 100644 --- a/src/pages/company/employees/index.tsx +++ b/src/pages/company/employees/index.tsx @@ -79,6 +79,13 @@ export default function Index({ title = '员工管理' }) { dataIndex: ['position', 'name'], search: false, }, + { + title: '是否管理员', + dataIndex: 'is_company_admin', + render: (_, item: any) => { + return item?.is_company_admin ? '是' : '否'; + }, + }, MyColumns.UpdatedAt(), // MyColumns.CreatedAt(), MyColumns.Option({ diff --git a/src/pages/company/employees/modals/EmployeeCreate.tsx b/src/pages/company/employees/modals/EmployeeCreate.tsx index a904def..809cea0 100644 --- a/src/pages/company/employees/modals/EmployeeCreate.tsx +++ b/src/pages/company/employees/modals/EmployeeCreate.tsx @@ -35,7 +35,7 @@ export default function Create(props: MyBetaModalFormProps) { }) .then(() => { props.reload?.(); - message.success(props.title + '成功'); + message.success('编辑成功'); return true; }) .catch(() => false) @@ -50,7 +50,7 @@ export default function Create(props: MyBetaModalFormProps) { colProps: { span: 24 }, required: true, fieldProps: { - onChange: (val: any) => { + onChange: () => { form.setFieldsValue({ organizations_id: undefined, positions_id: undefined, @@ -59,7 +59,6 @@ export default function Create(props: MyBetaModalFormProps) { }, }), ]), - { valueType: 'dependency', name: ['companies_id'], @@ -77,7 +76,6 @@ export default function Create(props: MyBetaModalFormProps) { ]; }, }, - { key: 'name', title: '姓名', @@ -101,6 +99,14 @@ export default function Create(props: MyBetaModalFormProps) { valueEnum: SexEnum, required: true, }), + { + title: '密码', + key: 'password', + formItemProps: { ...rulesHelper.text }, + tooltip: '请设置机构端登录密码', + colProps: { span: 24 }, + }, + { valueType: 'dependency', name: ['companies_id'], @@ -117,13 +123,12 @@ export default function Create(props: MyBetaModalFormProps) { ]; }, }, - - // { - // key: 'password', - // title: '密码', - // colProps: { span: 24 }, - // valueType: 'password', - // }, + { + title: '是否管理员', + key: 'is_company_admin', + valueType: 'switch', + colProps: { span: 6 }, + }, { key: 'remark', title: '备注', diff --git a/src/pages/company/employees/modals/EmployeeUpdate.tsx b/src/pages/company/employees/modals/EmployeeUpdate.tsx index 19cd914..716070d 100644 --- a/src/pages/company/employees/modals/EmployeeUpdate.tsx +++ b/src/pages/company/employees/modals/EmployeeUpdate.tsx @@ -69,6 +69,11 @@ export default function Update(props: MyBetaModalFormProps) { valueEnum: SexEnum, required: true, }), + { + title: '密码', + key: 'password', + colProps: { span: 24 }, + }, Selects?.Positions({ title: '岗位', params: { companies_id: props?.item?.companies_id }, @@ -76,14 +81,21 @@ export default function Update(props: MyBetaModalFormProps) { formItemProps: { ...rulesHelper.text }, fieldProps: { showSearch: true, + labelRender: (res: any) => { + if (res?.label) { + return res?.label; + } else { + return props?.item?.position?.name; + } + }, }, }), - // { - // key: 'password', - // title: '密码', - // colProps: { span: 24 }, - // valueType: 'password', - // }, + { + title: '是否管理员', + key: 'is_company_admin', + valueType: 'switch', + colProps: { span: 6 }, + }, { key: 'remark', title: '备注', diff --git a/src/pages/company/list/index.tsx b/src/pages/company/list/index.tsx index 32b9812..efeba7f 100644 --- a/src/pages/company/list/index.tsx +++ b/src/pages/company/list/index.tsx @@ -3,7 +3,6 @@ import { MyColumns, MyPageContainer, MyProTableProps, - usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; @@ -16,12 +15,6 @@ import CompanyUpdate from './modals/CompanyUpdate'; export default function Index({ title = '机构列表' }) { const navigate = useNavigate(); - // 注册当前页面为标签页 - usePageTabs({ - tabKey: 'company-companies', - tabLabel: title, - }); - return ( (); + const [getShowData, setShowData] = useState({}); + const [searchParams] = useSearchParams(); + const [formValues, setFormValues] = useState({ + logo: [], + color: '#1890ff', + pageColor: `linear-gradient(180deg,rgba(208, 229, 255, 0.44) 0%,rgba(255, 255, 255, 0) 100%),linear-gradient(146deg,#d3d7ff 0%,rgba(255, 255, 255, 0) 37%),linear-gradient(194deg,#dffff3 0%,#f8f8f8 30%)`, + }); + const [GET_DEFAULT_COLOR, SET_DEFAULT_COLOR] = useState([ + { + color: '#d3d7ff', + percent: 0, + }, + { + color: '#dffff3', + percent: 100, + }, + ]); + // 处理表单值变化,用于实时预览 + const handleValuesChange = (row: FormData) => { + console.log('row', row); + let data: ApiTypes.Company.CompanyConfigs.Store = { + companies_id: Number(searchParams.get('id')) || 0, + config_key: 'Theme', + config_value: { + color: formValues?.color, + pageColor: formValues?.pageColor, + logo: row?.logo || formValues?.logo, + pageColorValue: formValues?.pageColorValue, + }, + }; + + console.log(data); + if (getShowData?.id) { + Apis.Company.CompanyConfigs.Update({ + ...data, + id: getShowData?.id || 0, + }).then(() => { + message.success('保存成功'); + }); + } else { + Apis.Company.CompanyConfigs.Store(data).then(() => { + message.success('保存成功'); + }); + } + }; + + useEffect(() => { + if (searchParams.get('id')) { + Apis.Company.CompanyConfigs.GetDetail({ + companies_id: searchParams.get('id'), + config_key: 'Theme', + }).then((res: any) => { + console.log('res', res); + let cssStrColor = + res?.data?.config_value?.pageColorValue?.[0] || '#d3d7ff'; + let cssEndColor = + res?.data?.config_value?.pageColorValue?.[1] || '#dffff3'; + setShowData(res?.data); + let newCss = `linear-gradient(180deg,rgba(208, 229, 255, 0.44) 0%,rgba(255, 255, 255, 0) 100%),linear-gradient(146deg, ${cssStrColor} 0%, rgba(255, 255, 255, 0) 37%),linear-gradient(194deg, ${cssEndColor} 0%, #f8f8f8 30%)`; + setFormValues({ + ...res?.data?.config_value, + pageColor: newCss, + }); + console.log('newCss', newCss); + form.setFieldsValue({ + ...res?.data?.config_value, + pageColorOtherValue: [ + { + color: cssStrColor || '', + percent: 0, + }, + { + color: cssEndColor || '', + percent: 100, + }, + ], + }); + console.log('res', res); + }); + } + }, [searchParams.get('id')]); + + return ( + +
+ + {/* 左侧表单区域 */} + + + + {...MyModalFormProps.props} + title={title} + // 基础表单 + layoutType="Form" + width="800px" + wrapperCol={{ span: 24 }} + labelAlign="left" + form={form} + submitter={{ + render: () => { + return [ +
+ { + handleValuesChange(form.getFieldsValue()); + }} + title="保存" + /> +
, + ]; + }, + }} + onFinish={async (values: any) => { + // onSave(values); + }} + columns={[ + MyFormItems.UploadImages({ + key: 'logo', + title: ( +
+ 机构Logo + + (请上传480*480,png格式的Logo) + +
+ ), + max: 1, + colProps: { span: 24 }, + fieldProps: { + onChange: (val: { url: string }[]) => { + setFormValues({ ...formValues, logo: val }); + }, + }, + }), + { + title: ( +
+ 品牌主色配置 + + (设置主品牌色,将应用于按钮、链接等交互组件) + +
+ ), + colProps: { span: 24 }, + valueType: 'color', + key: 'color', + fieldProps: { + showText: true, + defaultValue: formValues?.color || '#1890ff', + format: 'rgb', + onChange: (value: any, css: string) => { + console.log('value', value, css); + setFormValues({ ...formValues, color: css }); + }, + }, + }, + { + title: ( +
+ 全局渐变色配置 + + (设置全局渐变色,将应用于页面背景等元素) + +
+ ), + key: 'pageColorOtherValue', + colProps: { span: 24 }, + valueType: 'color', + fieldProps: { + defaultValue: GET_DEFAULT_COLOR, + mode: 'gradient', + arrow: true, + color: 'toRgb', + format: 'rgb', + showText: true, + onChange: (value: any, css: any) => { + console.log('value', value, css); + let cssStrColor = value?.colors + ? value?.colors?.[0]?.color?.metaColor + : value; + let cssEndColor = value?.colors + ? value?.colors?.[1]?.color?.metaColor + : value; + let newCss = `linear-gradient(180deg,rgba(208, 229, 255, 0.44) 0%,rgba(255, 255, 255, 0) 100%),linear-gradient(146deg, rgba(${cssStrColor?.r}, ${cssStrColor?.g}, ${cssStrColor?.b},${cssStrColor?.a}) 0%, rgba(255, 255, 255, 0) 37%),linear-gradient(194deg, rgba(${cssEndColor?.r}, ${cssEndColor?.g}, ${cssEndColor?.b},${cssEndColor?.a}) 0%, #f8f8f8 30%)`; + setFormValues({ + ...formValues, + pageColor: newCss, + pageColorValue: [ + `rgba(${cssStrColor?.r}, ${cssStrColor?.g}, ${cssStrColor?.b},${cssStrColor?.a})`, + `rgba(${cssEndColor?.r}, ${cssEndColor?.g}, ${cssEndColor?.b},${cssEndColor?.a})`, + ], + }); + }, + }, + }, + ]} + /> +
+ + {/* 右侧手机预览区域 */} + + +
+
+ {/* 手机顶部状态栏 */} +
+
9:41
+
信号 电池
+
+ {/* 页面内容 */} +
+
+ {formValues?.logo?.[0] && ( + + )} + 某小区1栋1单元2102 +
+ +
+ + +
+ 按钮 +
+
+ 按钮 +
+
+ 按钮 +
+
+ + 标签 + 标签 + 标签 + +
+
+ tab 1 +
+
tab 2
+
tab 3
+
+
+
+ tab 1 +
+
tab 2
+
tab 3
+
+
+
+
+
+
+
+ +
+
+
+ ); +} diff --git a/src/pages/company/list/pages/style.scss b/src/pages/company/list/pages/style.scss new file mode 100644 index 0000000..561a2ae --- /dev/null +++ b/src/pages/company/list/pages/style.scss @@ -0,0 +1,198 @@ +.page-config-container { + padding: 20px; + min-height: calc(100vh - 160px); +} + +.form-card { + height: 100%; + overflow-y: auto; + + .page-config-form { + .ant-form-item { + margin-bottom: 16px; + } + } +} + +.preview-card { + height: 100%; + display: flex; + flex-direction: column; + + .ant-card-body { + flex: 1; + display: flex; + justify-content: center; + align-items: center; + padding: 20px; + } +} + +.phone-frame { + width: 375px; + height: 812px; + border: 10px solid #333; + border-radius: 40px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); + overflow: hidden; + position: relative; + background-color: #000; + + // 手机顶部听筒 + &::before { + content: ''; + position: absolute; + top: 20px; + left: 50%; + transform: translateX(-50%); + width: 60px; + height: 5px; + background-color: #222; + border-radius: 3px; + z-index: 1; + } + + // 手机底部home键 + &::after { + content: ''; + position: absolute; + bottom: 10px; + left: 50%; + transform: translateX(-50%); + width: 50px; + height: 50px; + border: 2px solid #333; + border-radius: 50%; + z-index: 1; + } +} + +.phone-screen { + width: 100%; + height: 100%; + background-color: #f8f8f8; + background-size: cover; + background-position: center; + background-repeat: no-repeat; + position: relative; + overflow-y: auto; + font-size: 14px; + color: #333; + + // 滚动条样式 + &::-webkit-scrollbar { + width: 4px; + } + + &::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0.1); + } + + &::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.3); + border-radius: 2px; + } +} + +.phone-status-bar { + height: 44px; + background-color: rgba(0, 0, 0, 0.8); + color: #fff; + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 16px; + font-size: 12px; + position: sticky; + top: 0; + z-index: 100; +} + +.phone-header { + background-color: #1890ff; + color: #fff; + padding: 16px; + text-align: center; +} + +.phone-content { + padding: 20px; + height: 300px; + // min-height: calc(100% - 120px); + background: linear-gradient( + 180deg, + rgba(208, 229, 255, 0.44) 0%, + rgba(255, 255, 255, 0) 100% + ), + linear-gradient(146deg, #d3d7ff 0%, rgba(255, 255, 255, 0) 37%), + linear-gradient(194deg, #dffff3 0%, #ffffff 30%); + p { + margin: 0 0 16px 0; + line-height: 1.6; + } + + .page-type-indicator { + background-color: #f0f0f0; + padding: 8px; + border-radius: 4px; + font-size: 12px; + color: #666; + margin-top: 20px; + } + .page-title { + margin: 0; + font-size: 14px; + font-weight: bold; + display: flex; + align-items: center; + img { + width: 24px; + height: 24px; + margin-right: 8px; + } + } + + .tab-content { + padding: 15px 0 0 0; + } + .phone-button { + padding: 4px 12px; + border-radius: 4px; + color: #fff; + } + .tabs-content { + display: flex; + align-items: center; + .tab-item { + padding: 5px 15px; + border-radius: 4px; + margin-right: 10px; + color: #333; + cursor: pointer; + } + } +} + +.phone-footer { + background-color: #f5f5f5; + color: #666; + padding: 12px; + text-align: center; + font-size: 12px; + border-top: 1px solid #e8e8e8; + position: sticky; + bottom: 0; +} + +@media (max-width: 1200px) { + .page-config-container { + .ant-row { + .ant-col { + &[span='12'] { + width: 100%; + margin-bottom: 20px; + } + } + } + } +} diff --git a/src/pages/company/list/show/$id.tsx b/src/pages/company/list/show/$id.tsx index 281dd8b..48cc6ab 100644 --- a/src/pages/company/list/show/$id.tsx +++ b/src/pages/company/list/show/$id.tsx @@ -10,10 +10,12 @@ import CompanyUpdate from '../modals/CompanyUpdate'; import CompanyApps from '../table/Apps'; import Assets from '../table/Assets'; import Brands from '../table/Brands'; +import CustomerEnd from '../table/CustomerEnd'; import Employees from '../table/Employees'; import Organizations from '../table/Organizations'; import Positions from '../table/Positions'; import ReceiptAccounts from '../table/ReceiptAccounts'; +import Roles from '../table/Roles'; export default function Show({ title }: { title?: string } = {}) { const { id } = useParams<{ id: string }>(); @@ -44,48 +46,60 @@ export default function Show({ title }: { title?: string } = {}) { let items = [ { - label: '1-项目配置', + label: '项目配置', key: '1', closable: false, children: , }, { - label: '2-组织配置', + label: '组织配置', key: '2', closable: false, children: , }, { - label: '3-岗位配置', + label: '岗位配置', key: '3', closable: false, children: , }, { - label: '4-员工配置', + label: '员工配置', key: '4', closable: false, children: , }, { - label: '5-账号配置', + label: '账号配置', key: '5', closable: false, children: , }, { - label: '6-应用配置', + label: '应用配置', key: '6', closable: false, children: , }, { - label: '7-品牌配置', + label: '品牌配置', key: '7', closable: false, children: , }, + { + label: '权限配置', + key: '8', + closable: false, + children: , + }, + { + label: '客户端配置', + key: '9', + closable: false, + children: , + }, ]; return ( diff --git a/src/pages/company/list/table/CustomerEnd.tsx b/src/pages/company/list/table/CustomerEnd.tsx new file mode 100644 index 0000000..447524c --- /dev/null +++ b/src/pages/company/list/table/CustomerEnd.tsx @@ -0,0 +1,46 @@ +import { MyBetaModalFormProps, MyButtons } from '@/common'; +import { ProCard } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; + +export default function CustomerEnd(props: MyBetaModalFormProps) { + const navigate = useNavigate(); + return ( +
+ + { + navigate( + `/company/list/pages/set_page_info?id=${props?.item?.id}`, + ); + }} + /> + } + > +
+ 替换系统默认的金刚区图标,将图标颜色统一调整为机构主色,保持视觉格一致 +
+
+ + } + > +
+ 品牌主色是机构在小程序中最核心的视觉代表色。通过配置品牌主色,你可以让整个小程序的交互组件自动统一为机构专属风格,提升品牌识别度。 +
+
+
+
+ ); +} diff --git a/src/pages/company/list/table/Roles.tsx b/src/pages/company/list/table/Roles.tsx new file mode 100644 index 0000000..0c0fece --- /dev/null +++ b/src/pages/company/list/table/Roles.tsx @@ -0,0 +1,90 @@ +import { MyBetaModalFormProps, MyButtons } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProCard } from '@ant-design/pro-components'; +import { message, Space, Tree, TreeProps } from 'antd'; +import { DataNode } from 'antd/es/tree'; +import { useEffect, useState } from 'react'; + +export default function Index(props: MyBetaModalFormProps) { + const [treeData, setTreeData] = useState([]); + const [checkedKeys, setCheckedKeys] = useState([]); + + const processTree = (item: any): DataNode => { + return { + ...item, + key: item.id, + title: item.id + '_' + item.name, + children: item.children?.map(processTree), + }; + }; + + const getPermissions = () => { + //获取已经配置的,菜单 + Apis.Company.CompanyPermissions.GetPermissions({ + companies_id: props?.item?.id || 0, + }).then((res: any) => { + console.log('res', res); + setCheckedKeys(res?.data?.permissions_ids); + }); + }; + + const getPermissionTree = () => { + //获取机构可配置菜单 + Apis.Company.CompanyPermissions.PermissionTree().then((res: any) => { + const data = res.data?.map(processTree); + setTreeData(data); + getPermissions(); + }); + }; + + useEffect(() => { + getPermissionTree(); + }, []); + + const onCheck: TreeProps['onCheck'] = (checkedKeys, info) => { + console.log('onCheck', checkedKeys, info); + const ids: string[] = []; + info.checkedNodes?.forEach((item: DataNode) => { + if (item.children?.length === 0) { + ids.push(item.key as string); + } + }); + console.log('ids', ids); + setCheckedKeys(ids); + // props.onChange?.(ids); + }; + + return (treeData?.length ?? 0) > 0 ? ( + { + Apis.Company.CompanyPermissions.SetPermissions({ + companies_id: props?.item?.id || 0, + permissions_ids: checkedKeys || [], + }).then(() => { + message.success('保存成功'); + }); + }} + />, + ]} + > + + + + + ) : ( + <> + ); +} diff --git a/src/pages/system/sys_permissions/index.tsx b/src/pages/system/sys_permissions/index.tsx index cc8375c..a63e181 100644 --- a/src/pages/system/sys_permissions/index.tsx +++ b/src/pages/system/sys_permissions/index.tsx @@ -3,7 +3,6 @@ import { MyColumns, MyPageContainer, MyProTableProps, - usePageTabs, } from '@/common'; import MyEnumRadioGroup from '@/common/components/formFields/MyEnumRadioGroup'; import { Apis } from '@/gen/Apis'; @@ -20,12 +19,6 @@ export default function Index({ title = '功能' }) { const actionRef = useRef(); const [guardName, setGuardName] = useState('Admin'); - // 注册当前页面为标签页 - usePageTabs({ - tabKey: 'system-permissions', - tabLabel: title, - }); - const getData = async () => { let data = await Apis.Permission.SysPermissions.List({ guard_name: guardName,