feat: add venue information management and detail view
- Added routes for venue information maintenance and detail views. - Implemented venue information detail page with data fetching and display. - Created edit modal for adding and editing venue information with form validation. - Integrated venue type and line options for selection in the edit modal. - Enhanced outdoor fair management to include venue binding and details. - Updated services to handle venue information CRUD operations.
This commit is contained in:
@@ -11,6 +11,10 @@ export interface OutdoorFairItem {
|
||||
fairType: string;
|
||||
/** 举办区域 */
|
||||
region: string;
|
||||
/** 绑定场地ID */
|
||||
venueId?: number;
|
||||
/** 绑定场地 */
|
||||
venueName?: string;
|
||||
/** 举办地址 */
|
||||
address: string;
|
||||
/** 展位数量 */
|
||||
@@ -37,6 +41,7 @@ export interface OutdoorFairListParams {
|
||||
hostUnit?: string;
|
||||
fairType?: string;
|
||||
region?: string;
|
||||
venueId?: number;
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
@@ -56,6 +61,8 @@ export interface OutdoorFairForm {
|
||||
hostUnit: string;
|
||||
fairType: string;
|
||||
region: string;
|
||||
venueId?: number;
|
||||
venueName?: string;
|
||||
address: string;
|
||||
boothCount: number;
|
||||
holdTime: string;
|
||||
|
||||
158
src/services/jobportal/venueInfo.ts
Normal file
158
src/services/jobportal/venueInfo.ts
Normal file
@@ -0,0 +1,158 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
/** 场地信息列表项 */
|
||||
export interface VenueInfoItem {
|
||||
id: number;
|
||||
/** 场地类型 */
|
||||
venueType: string;
|
||||
/** 场地名称 */
|
||||
venueName: string;
|
||||
/** 场地面积 */
|
||||
venueArea?: number;
|
||||
/** 展位数量 */
|
||||
floorCount?: number;
|
||||
/** 场地地址 */
|
||||
venueAddress: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** 乘坐线路ID,英文逗号分隔 */
|
||||
routeLineIds?: string;
|
||||
/** 乘坐线路名称,英文逗号分隔 */
|
||||
routeLineNames?: string;
|
||||
/** 经办日期 */
|
||||
handleDate?: string;
|
||||
/** 经办机构 */
|
||||
handleOrg?: string;
|
||||
/** 经办人 */
|
||||
handler?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/** 场地信息查询参数 */
|
||||
export interface VenueInfoListParams {
|
||||
venueType?: string;
|
||||
venueName?: string;
|
||||
venueAddress?: string;
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/** 场地信息列表响应 */
|
||||
export interface VenueInfoListResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
total: number;
|
||||
rows: VenueInfoItem[];
|
||||
}
|
||||
|
||||
/** 场地信息新增/编辑表单 */
|
||||
export interface VenueInfoForm {
|
||||
id?: number;
|
||||
venueType: string;
|
||||
venueName: string;
|
||||
venueArea?: number;
|
||||
floorCount?: number;
|
||||
venueAddress: string;
|
||||
contactPhone?: string;
|
||||
routeLineIds?: string | string[];
|
||||
routeLineNames?: string;
|
||||
handleDate?: string;
|
||||
handleOrg?: string;
|
||||
handler?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 通用响应 */
|
||||
export interface VenueInfoCommonResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
data?: VenueInfoItem;
|
||||
}
|
||||
|
||||
/** 场地类型字典新增表单 */
|
||||
export interface VenueInfoDictForm {
|
||||
dictType: 'venue_info_type';
|
||||
dictLabel: string;
|
||||
}
|
||||
|
||||
const CMS_VENUE_INFO_BASE = '/api/cms/venue-info';
|
||||
|
||||
const formatDate = (value: any) => {
|
||||
if (value && typeof value.format === 'function') {
|
||||
return value.format('YYYY-MM-DD');
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
const toApiPayload = (data: VenueInfoForm) => ({
|
||||
...data,
|
||||
routeLineIds: Array.isArray(data.routeLineIds) ? data.routeLineIds.join(',') : data.routeLineIds,
|
||||
handleDate: formatDate(data.handleDate),
|
||||
});
|
||||
|
||||
/**
|
||||
* 获取场地信息列表
|
||||
* GET /api/cms/venue-info/list
|
||||
*/
|
||||
export async function getVenueInfoList(params?: VenueInfoListParams) {
|
||||
return request<VenueInfoListResult>(`${CMS_VENUE_INFO_BASE}/list`, {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取场地信息详情
|
||||
* GET /api/cms/venue-info/{id}
|
||||
*/
|
||||
export async function getVenueInfo(id: number) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场地信息
|
||||
* POST /api/cms/venue-info
|
||||
*/
|
||||
export async function addVenueInfo(data: VenueInfoForm) {
|
||||
return request<VenueInfoCommonResult>(CMS_VENUE_INFO_BASE, {
|
||||
method: 'POST',
|
||||
data: toApiPayload(data),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改场地信息
|
||||
* PUT /api/cms/venue-info
|
||||
*/
|
||||
export async function updateVenueInfo(data: VenueInfoForm) {
|
||||
return request<VenueInfoCommonResult>(CMS_VENUE_INFO_BASE, {
|
||||
method: 'PUT',
|
||||
data: toApiPayload(data),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除场地信息
|
||||
* DELETE /api/cms/venue-info/{id}
|
||||
*/
|
||||
export async function deleteVenueInfo(id: number) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增场地信息维护页面使用的字典项
|
||||
* POST /api/cms/venue-info/dict-data
|
||||
*/
|
||||
export async function addVenueInfoDictOption(data: VenueInfoDictForm) {
|
||||
return request<VenueInfoCommonResult>(`${CMS_VENUE_INFO_BASE}/dict-data`, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user