feat: 新增菜单功能

This commit is contained in:
valarchie
2023-07-22 17:16:51 +08:00
parent 5ae73339c0
commit 6719fd8290
11 changed files with 700 additions and 287 deletions

View File

@@ -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() {}
}