浏览代码

查看附件时,频繁切换清单,报错

MaiXinRong 6 年之前
父节点
当前提交
626b2621b7
共有 1 个文件被更改,包括 11 次插入7 次删除
  1. 11 7
      Forms/UpFileManageFrame.pas

+ 11 - 7
Forms/UpFileManageFrame.pas

@@ -60,6 +60,7 @@ type
     procedure FrameMouseWheel(Sender: TObject; Shift: TShiftState;
       WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
   private
+    FBeginRefresh: Boolean;
     FDetailIsEdit: Boolean;
     FSelected: TUpFileView;
     FDatas: TUpFiles;
@@ -103,11 +104,8 @@ implementation
 uses PHPWebDm, ProjectData, IdGlobal, ProjectFme, ConstUnit, MainFrm,
   BillsMeasureDm, UtilMethods, UpFileSelectOnLineFrm, ShellAPI;
 
-
 {$R *.dfm}
 
-
-
 { TUpFileManageView }
 
 
@@ -399,6 +397,7 @@ end;
 constructor TUpFileManageView.Create(AOwner: TComponent);
 begin
   inherited;
+  FBeginRefresh := False;
   FRec := nil;
   lblBillName.Caption := '';
   lblBillName.Update;
@@ -411,16 +410,21 @@ end;
 
 procedure TUpFileManageView.DoOnBillChange(ARec: TsdDataRecord);
 begin
-  FRec := ARec;
-
   with TProjectFrame(Owner) do
   begin
     if not (jpsAssistant.Visible and (jpsAssistant.ActivePage = jpsAssistantUpFile)) then
       Exit;
   end;
+  if FBeginRefresh then Exit;
 
-  RefreshBill;
-  RefreshViews;
+  FBeginRefresh := True;
+  try
+    FRec := ARec;
+    RefreshBill;
+    RefreshViews;
+  finally
+    FBeginRefresh := False;
+  end;
 end;
 
 procedure TUpFileManageView.SetRec(const Value: TsdDataRecord);