mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-16 07:10:34 +08:00
feat: 新增菜单功能
This commit is contained in:
@@ -2,6 +2,7 @@ import { PaginationProps, TableColumn } from "@pureadmin/table";
|
||||
import { Sort } from "element-plus";
|
||||
import { utils, writeFile } from "xlsx";
|
||||
import { message } from "./message";
|
||||
import { pinyin } from "pinyin-pro";
|
||||
|
||||
export class CommonUtils {
|
||||
static getBeginTimeSafely(timeRange: string[]): string {
|
||||
@@ -126,6 +127,15 @@ export class CommonUtils {
|
||||
return paginatedList;
|
||||
}
|
||||
|
||||
static toPinyin(chineseStr: string): string {
|
||||
if (chineseStr == null || chineseStr === undefined || chineseStr === "") {
|
||||
return chineseStr;
|
||||
}
|
||||
|
||||
const pinyinStr = pinyin(chineseStr, { toneType: "none" });
|
||||
return pinyinStr.replace(/\s/g, "");
|
||||
}
|
||||
|
||||
// 私有构造函数,防止类被实例化
|
||||
private constructor() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user