mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 16:29:19 +08:00
feat: 工作台跳转店铺和商品页带上日期范围参数
This commit is contained in:
@@ -46,6 +46,17 @@ export function normalizeOverviewRangePickerChange(
|
||||
const START_Q = 'startDate';
|
||||
const END_Q = 'endDate';
|
||||
|
||||
/** 概览页跳转(店铺/商品)时附带的 query,与全店概览一致 */
|
||||
export function buildOverviewRouteQuery(dateRange: [Dayjs, Dayjs]): {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
} {
|
||||
return {
|
||||
startDate: dateRange[0].format('YYYY-MM-DD'),
|
||||
endDate: dateRange[1].format('YYYY-MM-DD'),
|
||||
};
|
||||
}
|
||||
|
||||
/** 从当前地址栏读取概览日期 query(含 replaceState 写入、未反映到 Vue Router 的情况) */
|
||||
export function getOverviewDateQueryFromLocation(): {
|
||||
startDate: string;
|
||||
|
||||
Reference in New Issue
Block a user