diff --git a/src/api/setting.ts b/src/api/setting.ts index 4c1df78..ee48058 100644 --- a/src/api/setting.ts +++ b/src/api/setting.ts @@ -143,6 +143,10 @@ export interface UpdateUserRoleParam { export type SafeDefaultPage = 1 | 2 | 3; // 默认登录页:1工作台 2项目管理 3房源剖视 export type SafeLoginTimeType = 1 | 2 | 3 | 4; // 登录状态保存时间:1:7天, 2:1天, 3:12小时, 4:1小时 export type SafeMoreLogin = 1 | 2; // 多点登录支持:1支持 2不支持 +export type DefaultPriceType = 1 | 2; // 默认单价:1 元/㎡*月 , 2 元/㎡*天 +export type AreaAccuracyType = 1 | 2 | 3; // 面积精度:1:两位数,2:1位数,3:整数 +export type ExpireSoonType = 1 | 2 | 3; // 房源即将到期设置:1:30天,2:60天,3:90天 +export type CumulativeDayType = 1 | 2 | 3 | 4; // 累计出租率天数类型:1:按本年累计天数计算(从1月1日至今),2:按 本年整年天数 计算(本年:365天),3:按 本月累计天数 计算(从本月1日至今),4:按 本月整月天数 计算(本月:31天) export interface SafeParams { default_url_typee: SafeDefaultPage; @@ -158,6 +162,32 @@ export interface SafeInfo { createdAt?: string; updatedAt?: string; } + +export interface SettingProjectParam { + default_price_type: DefaultPriceType; + area_accuracy_type: AreaAccuracyType; + expire_soon_type: ExpireSoonType; + rent_rate_type: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率 + rent_area_type: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开) + rentable_area_type: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开) + cumulative_rent_rate_type: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率 + cumulative_day_type: CumulativeDayType; +} +export interface projectSettingInfo { + id: number; + systemTenantId: number; // 租户id + defaultPriceType: DefaultPriceType; + areaAccuracyType: AreaAccuracyType; + expireSoonType: ExpireSoonType; + rentRateType: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率 + rentAreaType: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开) + rentableAreaType: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开) + cumulativeRentRateType: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率 + cumulativeDayType: CumulativeDayType; + createdAt?: string; + updatedAt?: string; +} + // ==================== 响应类型别名 ==================== export type DepartmentFormRes = HttpResponse; export type DepartmentList = DepartmentItem[]; @@ -173,6 +203,9 @@ export type RoleListRes = HttpResponse; export type PermissionRes = HttpResponse; export type RolePermissionRes = HttpResponse; export type SafeInfoRes = HttpResponse<{ safeSetting: SafeInfo }>; +export type SettingProjectRes = HttpResponse<{ + projectSetting: projectSettingInfo; +}>; // ==================== 部门相关 API ==================== export function createDepartment( @@ -291,3 +324,13 @@ export function getSafeSettingInfo(): Promise { export function saveSafeSetting(params: SafeParams): Promise { return axios.post('setting/saveSafeSetting', params); } +// 项目设置信息 +export function getProjectSetting(): Promise { + return axios.get('setting/getProjectSetting'); +} +// 项目设置信息保存 +export function saveProjectSetting( + params: SettingProjectParam +): Promise { + return axios.post('setting/saveProjectSetting', params); +} diff --git a/src/views/setting/system/project-settings/contrant.ts b/src/views/setting/system/project-settings/contrant.ts new file mode 100644 index 0000000..5a81d75 --- /dev/null +++ b/src/views/setting/system/project-settings/contrant.ts @@ -0,0 +1,59 @@ +const projectSetting = [ + { id: 1, text: '项目与房源' }, + { id: 2, text: '出租率' }, + { id: 3, text: '累计出租率' }, +]; +const projectHouse = [ + { + title: '默认单价', + options: [ + { type: 1, label: '元/㎡*月' }, + { type: 2, label: '元/㎡*天' }, + ], + }, + { + title: '面积精度', + options: [ + { type: 1, label: '2位数' }, + { type: 2, label: '1位数' }, + { type: 3, label: '整数' }, + ], + }, + { + title: '房源即将到期设置', + options: [ + { type: 1, label: '30' }, + { type: 2, label: '60' }, + { type: 3, label: '90' }, + ], + }, +]; +// 在租面积 +const inRentedAreaOptions = [ + { value: '1', label: '合同起始日期' }, + { value: '2', label: '合同免租期' }, + { value: '3', label: '合同装修期' }, + { value: '4', label: '房源保留' }, +]; +// 可租面积 +const availableAreaOptions = [ + { value: '1', label: '房源招商' }, + { value: '2', label: '房源保留' }, + { value: '3', label: '房源保留' }, + { value: '4', label: '房源下架' }, +]; +// 天数定义 +const dayeDfinition = [ + { value: 1, label: '按本年累计天数计算(从1月1日至今)' }, + { value: 2, label: '按本年整年天数 计算(本年:365天)' }, + { value: 3, label: '按本月累计天数 计算(从本月1日至今)' }, + { value: 4, label: '按本月整月天数 计算(本月:31天)' }, +]; + +export { + projectSetting, + projectHouse, + inRentedAreaOptions, + availableAreaOptions, + dayeDfinition, +}; diff --git a/src/views/setting/system/project-settings/index.vue b/src/views/setting/system/project-settings/index.vue index c8cb69c..c5ecb12 100644 --- a/src/views/setting/system/project-settings/index.vue +++ b/src/views/setting/system/project-settings/index.vue @@ -1,3 +1,287 @@ + + + +