!179 fix: 删除china2相关的地图json

Merge pull request !179 from 痴货/master
This commit is contained in:
芋道源码
2025-07-23 05:08:38 +00:00
committed by Gitee
97 changed files with 4922 additions and 1138 deletions

View File

@@ -26,6 +26,15 @@ export function formatDateTime(time: Date | number | string | undefined) {
return formatDate(time, 'YYYY-MM-DD HH:mm:ss');
}
export function formatDate2(date: Date, format?: string): string {
// 日期不存在,则返回空
if (!date) {
return '';
}
// 日期存在,则进行格式化
return date ? dayjs(date).format(format ?? 'YYYY-MM-DD HH:mm:ss') : '';
}
export function isDate(value: any): value is Date {
return value instanceof Date;
}

View File

@@ -22,3 +22,18 @@ export { default as cloneDeep } from 'lodash.clonedeep';
export { default as get } from 'lodash.get';
export { default as isEqual } from 'lodash.isequal';
export { default as set } from 'lodash.set';
/**
* 构建排序字段
* @param prop 字段名称
* @param order 顺序
*/
export const buildSortingField = ({
prop,
order,
}: {
order: 'ascending' | 'descending';
prop: string;
}) => {
return { field: prop, order: order === 'ascending' ? 'asc' : 'desc' };
};