export const ROUTE_MAP = (a_id?: string) => {
const isProduction = config.env.VITE_APP_ENV === 'online';
const aUrl = isProduction
? `https://xxx.net/detail?a_id=${a_id}`
: `https://xxx-text.net/detail?a_id=${a_id}`;
return {
lock: "/m/lock",
release: "/m/release",
viewApply: aUrl,
suspend: "/m/suspend",
schedule: "/m/schedule",
recovery: "/m/recovery",
edit: "/m/edit",
};
};
const handleActionClick = (event: string, record: any) => {
const productVersionId = record.product_version_id;
const aId = record.a_id;
const routeMap = ROUTE_MAP(aId);
const route = routeMap[event as keyof typeof routeMap]
if (event === 'viewApply') {
window.open(route, '_blank');
} else {
navigate(`${route}?id=${productVersionId}`);
}
}