Browse Source

计量云版报表管理新增“更新”过滤选项层功能。

Chenshilong 7 years ago
parent
commit
072c3d9c38

+ 6 - 0
DataModules/ReportManagerDM.dfm

@@ -237,4 +237,10 @@ object Reports: TReports
       FieldName = 'NewestVer'
       FieldName = 'NewestVer'
     end
     end
   end
   end
+  object cdsTemp: TClientDataSet
+    Aggregates = <>
+    Params = <>
+    Left = 80
+    Top = 104
+  end
 end
 end

+ 44 - 0
DataModules/ReportManagerDM.pas

@@ -110,6 +110,7 @@ type
     cdsCustomState: TStringField;
     cdsCustomState: TStringField;
     cdsCustomHistory: TStringField;
     cdsCustomHistory: TStringField;
     cdsCustomNewestVer: TStringField;
     cdsCustomNewestVer: TStringField;
+    cdsTemp: TClientDataSet;
     procedure DataModuleCreate(Sender: TObject);
     procedure DataModuleCreate(Sender: TObject);
     procedure DataModuleDestroy(Sender: TObject);
     procedure DataModuleDestroy(Sender: TObject);
   private
   private
@@ -130,6 +131,9 @@ type
     procedure CancelFilterCategory;
     procedure CancelFilterCategory;
     procedure FilterCategory(ACategory: string);
     procedure FilterCategory(ACategory: string);
     function FindReprot(AID: Integer): TReport;
     function FindReprot(AID: Integer): TReport;
+    procedure FilterNeedUpdates(AFilter: Boolean);
+    function HasNeedUpdateReport: Boolean;
+    function HasReport: Boolean;
 
 
     property Path: string read FPath;
     property Path: string read FPath;
   end;
   end;
@@ -207,6 +211,8 @@ begin
   FOnlineCategories := TStringList.Create;
   FOnlineCategories := TStringList.Create;
   
   
   Load;
   Load;
+
+  cdsTemp.CloneCursor(cdsLocal, True);
 end;
 end;
 
 
 procedure TReports.DataModuleDestroy(Sender: TObject);
 procedure TReports.DataModuleDestroy(Sender: TObject);
@@ -766,4 +772,42 @@ begin
   FArea := Value;
   FArea := Value;
 end;
 end;
 
 
+procedure TReports.FilterNeedUpdates(AFilter: Boolean);
+begin
+  if not cdsLocal.Active then Exit;
+
+  if AFilter then
+  begin
+    cdsLocal.Filter := 'State = ''¸üÐÂ''';
+    cdsLocal.Filtered := True;
+  end
+  else
+    cdsLocal.Filtered := False;
+end;
+
+function TReports.HasNeedUpdateReport: Boolean;
+//var cdsTemp: TClientDataSet;
+begin
+//  Result := False;
+//  cdsTemp := TClientDataSet.Create(nil);
+//  try
+//    cdsTemp.CloneCursor(cdsLocal, True);
+//    cdsTemp.Filter := 'State = ''¸üÐÂ''';
+//    cdsTemp.Filtered := True;
+//    Result := cdsTemp.RecordCount > 0;
+//  finally
+//    cdsTemp.Free;
+//  end;
+
+  cdsTemp.Filter := 'State = ''¸üÐÂ''';
+  cdsTemp.Filtered := True;
+  Result := cdsTemp.RecordCount > 0;
+end;
+
+function TReports.HasReport: Boolean;
+begin
+  cdsTemp.Filtered := False;
+  Result := cdsTemp.RecordCount > 0;
+end;
+
 end.
 end.

+ 2 - 2
Dprs/CSL/Measure_Cloud.dof

@@ -115,7 +115,7 @@ AutoIncBuild=1
 MajorVer=3
 MajorVer=3
 MinorVer=1
 MinorVer=1
 Release=3
 Release=3
-Build=1145
+Build=1147
 Debug=0
 Debug=0
 PreRelease=0
 PreRelease=0
 Special=0
 Special=0
@@ -126,7 +126,7 @@ CodePage=936
 [Version Info Keys]
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化云版
 FileDescription=纵横结算决算计量一体化云版
-FileVersion=3.1.3.1145
+FileVersion=3.1.3.1147
 InternalName=
 InternalName=
 LegalCopyright=
 LegalCopyright=
 LegalTrademarks=
 LegalTrademarks=

BIN
Dprs/CSL/Measure_Cloud.res


+ 1 - 1
Forms/LoginFrm.pas

@@ -165,7 +165,7 @@ begin
   if G_IsTest then
   if G_IsTest then
   begin
   begin
     cbUser.Text := '1835082984@qq.com';
     cbUser.Text := '1835082984@qq.com';
-    edtPW.Text := '123456';
+    edtPW.Text := '654321';
   end;
   end;
 end;
 end;
 
 

+ 116 - 33
Forms/ReportManagerFrm.dfm

@@ -3,7 +3,7 @@ object ReportManagerForm: TReportManagerForm
   Top = 222
   Top = 222
   BorderStyle = bsDialog
   BorderStyle = bsDialog
   Caption = #25253#34920#27169#26495
   Caption = #25253#34920#27169#26495
-  ClientHeight = 535
+  ClientHeight = 549
   ClientWidth = 841
   ClientWidth = 841
   Color = clBtnFace
   Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Charset = DEFAULT_CHARSET
@@ -21,7 +21,7 @@ object ReportManagerForm: TReportManagerForm
     Left = 0
     Left = 0
     Top = 0
     Top = 0
     Width = 841
     Width = 841
-    Height = 535
+    Height = 549
     ActivePage = tsLocal
     ActivePage = tsLocal
     Align = alClient
     Align = alClient
     Font.Charset = DEFAULT_CHARSET
     Font.Charset = DEFAULT_CHARSET
@@ -41,40 +41,123 @@ object ReportManagerForm: TReportManagerForm
       Font.Name = #23435#20307
       Font.Name = #23435#20307
       Font.Style = []
       Font.Style = []
       ParentFont = False
       ParentFont = False
-      object zgLoacl: TZJGrid
+      object pnlGrid: TPanel
         Left = 0
         Left = 0
         Top = 0
         Top = 0
         Width = 833
         Width = 833
-        Height = 475
-        Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
-        OptionsEx = []
-        ColCount = 7
-        RowCount = 1
-        ShowGridLine = False
-        DefaultColWidth = 73
-        DefaultFixedColWidth = 30
-        DefaultFixedRowHeight = 29
-        DefaultRowHeight = 30
-        Selection.AlphaBlend = False
-        Selection.TransparentColor = False
-        FrozenCol = 0
-        FrozenRow = 0
-        OnShowHint = zgLoaclShowHint
-        OnCellGetFont = zgLoaclCellGetFont
-        OnMouseDown = zgLoaclMouseDown
-        Font.Charset = DEFAULT_CHARSET
-        Font.Color = clWindowText
-        Font.Height = -12
-        Font.Name = #24494#36719#38597#40657
-        Font.Style = []
-        ParentFont = False
+        Height = 489
         Align = alClient
         Align = alClient
+        BevelOuter = bvNone
+        Caption = 'pnlGrid'
+        TabOrder = 1
+        object pnlFilter: TPanel
+          Left = 0
+          Top = 428
+          Width = 833
+          Height = 61
+          Align = alBottom
+          BevelOuter = bvNone
+          Color = clWhite
+          TabOrder = 0
+          object Label3: TLabel
+            Left = 80
+            Top = 11
+            Width = 104
+            Height = 19
+            Caption = #24744#26377#25253#34920#38656#35201#26356#26032
+            Font.Charset = DEFAULT_CHARSET
+            Font.Color = 21503
+            Font.Height = -13
+            Font.Name = #24494#36719#38597#40657
+            Font.Style = []
+            ParentFont = False
+          end
+          object imgfilter: TImage
+            Left = 24
+            Top = 8
+            Width = 50
+            Height = 50
+            AutoSize = True
+            Picture.Data = {
+              0A54504E474F626A65637489504E470D0A1A0A0000000D494844520000003200
+              00003208060000001E3F88B10000031B4944415478DAED996B72DA3010C76DE0
+              7BE1048513D43D41CDEB73C809426F404F50E704494F90E404A19F793927C039
+              01F40425DF79F42FC6304295E4952D8827E39DC92891ACC76F77B55A29AEF341
+              C47DEF0514200548CEA500C99B142036A4DD6EDFBBAEFB85FAFD76BB7D9A4EA7
+              8F6701C1626E50F4B0A0DA783CF64DFA763A9D10C537CAB7BBDDEE693299F455
+              EDA94162800000F5B8EAE55C204910A9407CDFAF562A9567F6ABD07416100A84
+              3148B7DBF5E0A73358A12A69B60E42853002D14160C23F28069874681364BD5E
+              37C2305C5A03813BD5CBE5F25C846000F8095491040BFDC9FF0D8BDD9A804022
+              C03401B3B2028209678EB02700F0BAD96C7CDD24E8B713405CA13D0984CD3384
+              A5AF338360B2018A3B538834206C4FA0F0C4B3052EFD5D657512088B5070A905
+              EF52CC9D00E151CC6D0272D8D871545CA2EA1337E7126D8DD420AD56AB5F2A95
+              1E4CB5630A224627D4FB2866C2703FD0FF3E15080EBD0577E0EDAD8109EB0E51
+              2820B1B6FB92BE7B48AE2A42FFAFC6202C52C1C40BBECEC41A14106671D57850
+              224B7B9EF93A44B09ACAA5952032B71217921584D09F2DFAB857748A74358304
+              28F87320CDC99D1524744EDDEB166304462030ED234C7BC355FDC620BD0B83B0
+              451F9589FDF40BFB69600462A28D4B81381AAFF8F82012D77A0F1096845E1DFE
+              D665C367DDEC59056B98A3F0B82AF3CD2E865F6863056DD42E0C7262D154E137
+              CE79FEF27580B956DD3974875B1A919D63BAFB49528A1209996808D33625DF3D
+              E0BB864DD7334D8FB420B2141ED2C4824301A2EF48F6507C8F398A4C09324993
+              AC2646112C7489857EE634B3421ACF4CBCE2201C058871D48AAF0E73DE1A9037
+              F4ADEAFA250E2CD30E240250C441580189F725B3A227346953781248BCA09378
+              AE904C201A0852D8A73E3E30738709CF9B3290400009641D258F7D077943A4AA
+              5B7B7C8861FEBB9FA4D19C00C092D03B09C01E02F5FE68348A28639141848D6D
+              0544F58AC2422DF6658F0A41062140D80479813BF528EE64044284C80C92F4D8
+              9709C400220BC80A87DD306B7A9394345221984623D5EDED1252FCEB2D6F5280
+              E44D0A90BC49019237F9077BB75551E49044150000000049454E44AE426082}
+          end
+          object chkFilter: TCheckBox
+            Left = 80
+            Top = 35
+            Width = 150
+            Height = 17
+            Caption = #21482#26174#31034#38656#35201#26356#26032#30340#25253#34920
+            Font.Charset = DEFAULT_CHARSET
+            Font.Color = 21503
+            Font.Height = -13
+            Font.Name = #24494#36719#38597#40657
+            Font.Style = []
+            ParentFont = False
+            TabOrder = 0
+            OnClick = chkFilterClick
+          end
+        end
+        object zgLoacl: TZJGrid
+          Left = 0
+          Top = 0
+          Width = 833
+          Height = 428
+          Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
+          OptionsEx = []
+          ColCount = 7
+          RowCount = 1
+          ShowGridLine = False
+          DefaultColWidth = 73
+          DefaultFixedColWidth = 30
+          DefaultFixedRowHeight = 29
+          DefaultRowHeight = 30
+          Selection.AlphaBlend = False
+          Selection.TransparentColor = False
+          FrozenCol = 0
+          FrozenRow = 0
+          OnShowHint = zgLoaclShowHint
+          OnCellGetFont = zgLoaclCellGetFont
+          OnMouseDown = zgLoaclMouseDown
+          Font.Charset = DEFAULT_CHARSET
+          Font.Color = clWindowText
+          Font.Height = -12
+          Font.Name = #24494#36719#38597#40657
+          Font.Style = []
+          ParentFont = False
+          Align = alClient
+        end
       end
       end
-      object pnlHint: TPanel
+      object pnlNoReport: TPanel
         Left = 0
         Left = 0
         Top = 0
         Top = 0
         Width = 833
         Width = 833
-        Height = 475
+        Height = 489
         Align = alClient
         Align = alClient
         BevelOuter = bvNone
         BevelOuter = bvNone
         Caption = #26412#22320#36824#27809#26377#25253#34920#65292#35831#20351#29992#8220#32447#19978#25253#34920#24211#8221#19979#36733#25253#34920
         Caption = #26412#22320#36824#27809#26377#25253#34920#65292#35831#20351#29992#8220#32447#19978#25253#34920#24211#8221#19979#36733#25253#34920
@@ -84,7 +167,7 @@ object ReportManagerForm: TReportManagerForm
         Font.Name = #24494#36719#38597#40657
         Font.Name = #24494#36719#38597#40657
         Font.Style = [fsBold]
         Font.Style = [fsBold]
         ParentFont = False
         ParentFont = False
-        TabOrder = 1
+        TabOrder = 0
       end
       end
     end
     end
     object tsOnline: TTabSheet
     object tsOnline: TTabSheet
@@ -120,7 +203,7 @@ object ReportManagerForm: TReportManagerForm
         Left = 0
         Left = 0
         Top = 33
         Top = 33
         Width = 833
         Width = 833
-        Height = 442
+        Height = 456
         Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
         Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
         OptionsEx = []
         OptionsEx = []
         ColCount = 7
         ColCount = 7
@@ -153,7 +236,7 @@ object ReportManagerForm: TReportManagerForm
         Left = 0
         Left = 0
         Top = 0
         Top = 0
         Width = 833
         Width = 833
-        Height = 475
+        Height = 489
         Align = alClient
         Align = alClient
         BevelOuter = bvNone
         BevelOuter = bvNone
         Caption = 'pnlCustom'
         Caption = 'pnlCustom'
@@ -162,7 +245,7 @@ object ReportManagerForm: TReportManagerForm
           Left = 0
           Left = 0
           Top = 0
           Top = 0
           Width = 833
           Width = 833
-          Height = 475
+          Height = 489
           Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
           Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
           OptionsEx = []
           OptionsEx = []
           ColCount = 7
           ColCount = 7
@@ -192,7 +275,7 @@ object ReportManagerForm: TReportManagerForm
         Left = 0
         Left = 0
         Top = 0
         Top = 0
         Width = 833
         Width = 833
-        Height = 475
+        Height = 489
         Align = alClient
         Align = alClient
         BevelOuter = bvNone
         BevelOuter = bvNone
         TabOrder = 0
         TabOrder = 0

+ 19 - 5
Forms/ReportManagerFrm.pas

@@ -5,7 +5,7 @@ interface
 uses
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, ComCtrls, DB, DBClient, ZJGrid, StdCtrls, ExtCtrls, ZjGridDBA,
   Dialogs, ComCtrls, DB, DBClient, ZJGrid, StdCtrls, ExtCtrls, ZjGridDBA,
-  cxLookAndFeelPainters, cxButtons;
+  cxLookAndFeelPainters, cxButtons, pngimage;
 
 
 type
 type
   TReportManagerForm = class(TForm)
   TReportManagerForm = class(TForm)
@@ -13,7 +13,6 @@ type
     tsLocal: TTabSheet;
     tsLocal: TTabSheet;
     tsOnline: TTabSheet;
     tsOnline: TTabSheet;
     tsCustom: TTabSheet;
     tsCustom: TTabSheet;
-    zgLoacl: TZJGrid;
     Panel1: TPanel;
     Panel1: TPanel;
     pnlInputCode: TPanel;
     pnlInputCode: TPanel;
     edtCode: TEdit;
     edtCode: TEdit;
@@ -24,10 +23,16 @@ type
     zaOnline: TZjGridDBA;
     zaOnline: TZjGridDBA;
     btnGet: TcxButton;
     btnGet: TcxButton;
     pnlCustom: TPanel;
     pnlCustom: TPanel;
-    pnlHint: TPanel;
+    pnlNoReport: TPanel;
     zgCustom: TZJGrid;
     zgCustom: TZJGrid;
     zaCustom: TZjGridDBA;
     zaCustom: TZjGridDBA;
     cbCategory: TComboBox;
     cbCategory: TComboBox;
+    pnlGrid: TPanel;
+    pnlFilter: TPanel;
+    Label3: TLabel;
+    imgfilter: TImage;
+    chkFilter: TCheckBox;
+    zgLoacl: TZJGrid;
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure zgLoaclCellGetFont(Sender: TObject; ACoord: TPoint;
     procedure zgLoaclCellGetFont(Sender: TObject; ACoord: TPoint;
@@ -51,6 +56,7 @@ type
       var HintInfo: THintInfo; const ACoord: TPoint);
       var HintInfo: THintInfo; const ACoord: TPoint);
     procedure zgCustomShowHint(var HintStr: String; var CanShow: Boolean;
     procedure zgCustomShowHint(var HintStr: String; var CanShow: Boolean;
       var HintInfo: THintInfo; const ACoord: TPoint);
       var HintInfo: THintInfo; const ACoord: TPoint);
+    procedure chkFilterClick(Sender: TObject);
   private
   private
     { Private declarations }
     { Private declarations }
     FReports: TObject;
     FReports: TObject;
@@ -94,7 +100,7 @@ begin
   zaCustom.DataSet := TReports(FReports).cdsCustom;
   zaCustom.DataSet := TReports(FReports).cdsCustom;
   zaCustom.Grid := zgCustom;
   zaCustom.Grid := zgCustom;
 
 
-  pnlHint.Visible := zaLocal.DataSet.RecordCount = 0;
+  pnlNoReport.Visible := zaLocal.DataSet.RecordCount = 0;
   TReports(FReports).CategoryList(cbCategory.Items);
   TReports(FReports).CategoryList(cbCategory.Items);
   cbCategory.ItemIndex := 0;
   cbCategory.ItemIndex := 0;
   pcReport.ActivePage := tsLocal;
   pcReport.ActivePage := tsLocal;
@@ -219,7 +225,10 @@ end;
 procedure TReportManagerForm.pcReportChange(Sender: TObject);
 procedure TReportManagerForm.pcReportChange(Sender: TObject);
 begin
 begin
   if pcReport.ActivePage = tsLocal then
   if pcReport.ActivePage = tsLocal then
-    pnlHint.Visible := zaLocal.DataSet.RecordCount = 0;
+  begin
+    pnlNoReport.Visible := not TReports(FReports).HasReport;
+    pnlFilter.Visible := TReports(FReports).HasNeedUpdateReport or chkFilter.Checked;
+  end;
 end;
 end;
 
 
 procedure TReportManagerForm.GridShowHint(var HintStr: String; var CanShow: Boolean;
 procedure TReportManagerForm.GridShowHint(var HintStr: String; var CanShow: Boolean;
@@ -273,4 +282,9 @@ begin
   FReportsForm := Value;
   FReportsForm := Value;
 end;
 end;
 
 
+procedure TReportManagerForm.chkFilterClick(Sender: TObject);
+begin
+  TReports(FReports).FilterNeedUpdates(chkFilter.Checked);
+end;
+
 end.
 end.