---告警帮助文档中英文

This commit is contained in:
lai
2023-11-24 19:36:40 +08:00
parent 44ee479b32
commit 9f5f35c79d
38 changed files with 58 additions and 34 deletions

View File

@@ -19,8 +19,8 @@ export const xlsxUrl = `${
* console.log(res)
* });
*/
export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
let result = await fetch(`${xlsxUrl}/${id}.xlsx`);
export async function readLoalXlsx(lang:string,id: string): Promise<Record<string, any>[]> {
let result = await fetch(`${xlsxUrl}/${lang}/${id}.xlsx`);
let fileBuffer = await result.arrayBuffer();
// 判断是否xlsx文件
const data = new Uint8Array(fileBuffer);
@@ -30,7 +30,7 @@ export async function readLoalXlsx(id: string): Promise<Record<string, any>[]> {
data[2] === 0x03 &&
data[3] === 0x04;
if (!isXlsxFile) {
result = await fetch(`${xlsxUrl}/all.xlsx`);
result = await fetch(`${xlsxUrl}/${lang}/all.xlsx`);
fileBuffer = await result.arrayBuffer();
}
return readSheet(fileBuffer, 0);