From 555388b952d59615d605b2b71e96ffbf95c9be7f Mon Sep 17 00:00:00 2001 From: ChenX Date: Mon, 6 Aug 2018 16:59:45 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#ILVIX=20=E6=96=87=E4=BB=B6=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=90=8E=E7=AB=8B=E5=8D=B3=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/Save.ts | 3 +-- src/UI/Components/SourceManage/FilePanel.tsx | 17 +++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Add-on/Save.ts b/src/Add-on/Save.ts index 2d26628bf..a4ea24d05 100644 --- a/src/Add-on/Save.ts +++ b/src/Add-on/Save.ts @@ -29,8 +29,7 @@ export class Save implements Command fileInfo = { fileId, title: `新文件${count}`, - modifyTime: "", - isNew: false + modifyTime: "" } } else diff --git a/src/UI/Components/SourceManage/FilePanel.tsx b/src/UI/Components/SourceManage/FilePanel.tsx index 855fa71c9..37e4b1a64 100644 --- a/src/UI/Components/SourceManage/FilePanel.tsx +++ b/src/UI/Components/SourceManage/FilePanel.tsx @@ -18,13 +18,12 @@ interface FileProps } export interface FileInfo { - fileId: string, - title: string, - pic?: string, - position?: string, - picCount?: number, - modifyTime: string, - isNew: boolean + fileId: string; + title: string; + pic?: string; + position?: string; + picCount?: number; + modifyTime: string; } interface FileData { @@ -63,7 +62,6 @@ export class FilePanel extends React.Component fileId: "f" + fId, title: "文件名" + fId, modifyTime: formateDate(new Date(), "yyyy-MM-dd hh:mm:ss"), - isNew: true } fileStore.SetCurFileId(newFile.fileId);; @@ -124,9 +122,8 @@ export class FilePanel extends React.Component let file = await store.Get(StoreName.Dwg, fid); - if (fileData.isNew || !file) + if (!file) { - fileData.isNew = false; let db = new Database(); app.m_Database.FileRead(db.FileWrite()); }