开发:清理代码

pull/1939/head
ChenX 2 years ago
parent 3a9976b942
commit 1da6dbb588

@ -183,6 +183,7 @@ export class FileServer extends Singleton
return status;
}
//读取文件列表
async ReadFileList(): Promise<IFileInfo[]>
{
@ -195,6 +196,13 @@ export class FileServer extends Singleton
}
return [];
}
/**
* ,md5,,
* @param fid id
* @param [code] md5
* @returns
*/
async GetFileInfo(fid: string, code?: string): Promise<IFileInfo>
{
if (!code)
@ -226,17 +234,19 @@ export class FileServer extends Singleton
}
return null;
}
//缓存文件到db
async CacheFileInfo(fid: string, info: IFileInfo)
{
let dbStore = await IndexedDbStore.CADStore();
let key = GetIndexDBID(fid);
let fileInfo = await dbStore.Get(StoreName.Dwg, key);
if (!fileInfo)
fileInfo = {};
let fileInfo = await dbStore.Get(StoreName.Dwg, key) ?? {};
dbStore.Put(StoreName.Dwg, GetIndexDBID(fid), Object.assign(fileInfo, info));
dbStore.Put(StoreName.Dwg, key, Object.assign(fileInfo, info));
}
//上传文件(新建)
async UploadFile(fileInfo: IFileInfo, rawFile?: string)
{
let info: IFileInfo = {
@ -261,6 +271,7 @@ export class FileServer extends Singleton
return data;
}
//更新文件(修改)
async UpdateFile(fileInfo: IFileInfo, rawFile?: string)
{
this.SaveCurrentFileInfo(fileInfo);

Loading…
Cancel
Save