fix(产品管理、项目管理、登录密码校验、工作报告): 修复用户们提出的一系列问题。
This commit is contained in:
@@ -18,6 +18,10 @@ type ProductResponse = Omit<Api.Product.Product, 'id' | 'managerUserId' | 'curre
|
||||
currentUserRoles?: Api.Common.CurrentUserRole[] | null;
|
||||
};
|
||||
|
||||
type ProductOptionResponse = Omit<Api.Product.ProductOption, 'id'> & {
|
||||
id: string | number;
|
||||
};
|
||||
|
||||
type ProductPageResponse = Api.Product.PageResult<ProductResponse>;
|
||||
|
||||
type ProductActivityTimelineItemResponse = Omit<
|
||||
@@ -46,6 +50,13 @@ function normalizeProduct(product: ProductResponse): Api.Product.Product {
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeProductOption(option: ProductOptionResponse): Api.Product.ProductOption {
|
||||
return {
|
||||
...option,
|
||||
id: normalizeStringId(option.id)
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeOccurredAt(occurredAt: number | string) {
|
||||
const value = Number(occurredAt);
|
||||
|
||||
@@ -109,6 +120,19 @@ export async function fetchGetProductPage(params?: Api.Product.ProductSearchPara
|
||||
}));
|
||||
}
|
||||
|
||||
/** 获取可绑定产品下拉选项 */
|
||||
export async function fetchGetProductOptions() {
|
||||
const result = await request<ProductOptionResponse[]>({
|
||||
...safeJsonRequestConfig,
|
||||
url: `${PRODUCT_PREFIX}/options`,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
return mapServiceResult(result as ServiceRequestResult<ProductOptionResponse[]>, data =>
|
||||
(data ?? []).map(normalizeProductOption)
|
||||
);
|
||||
}
|
||||
|
||||
type ProductOverviewSummaryResponse = Omit<Api.Product.ProductOverviewSummary, 'total' | 'items'> & {
|
||||
/** 后端 overview-summary 升级(total/items)灰度期间可能缺省,适配层兜底 */
|
||||
total?: number | null;
|
||||
|
||||
Reference in New Issue
Block a user