增加pageBaseList

This commit is contained in:
sgwp 2024-10-28 16:51:34 +08:00
parent 81d5c8477f
commit bf01b29590
8 changed files with 1175 additions and 40 deletions

View File

@ -361,6 +361,24 @@ object frmDetailBaseList: TfrmDetailBaseList
end
end
end
object cxProgressBar1: TMovePanel
Left = 240
Top = 224
Width = 233
Height = 49
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
ParentFont = False
TabOrder = 7
Visible = False
end
object DataSource1: TDataSource
DataSet = CDS_Main
Left = 768

View File

@ -14,7 +14,8 @@ uses
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
cxGeometry, dxFramedControl, dxPanel, cxSplitter, cxButtonEdit, FrameDateSel10;
cxGeometry, dxFramedControl, dxPanel, cxSplitter, cxButtonEdit, FrameDateSel10,
MovePanel;
type
TfrmDetailBaseList = class(TForm)
@ -51,6 +52,7 @@ type
CDS_Sub: TClientDataSet;
TgridLiSet: TToolButton;
frmFrameDateSel1: TfrmFrameDateSel10;
cxProgressBar1: TMovePanel;
procedure TrefreshClick(Sender: TObject);
procedure TprintClick(Sender: TObject);
procedure TprintGridClick(Sender: TObject);
@ -367,6 +369,9 @@ end;
procedure TfrmDetailBaseList.initGrid();
begin
if fProcedureName='' then exit;
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
if fQueryType='criteria' then
begin
@ -377,6 +382,11 @@ begin
frmFrameDateSel1.jqModel.Checked:=true;
doQuery() ;
end;
finally
cxProgressBar1.Visible:=false;
end;
end;
/////////////////////////

View File

@ -148,10 +148,6 @@ object frmMainBaseList: TfrmMainBaseList
Height = 351
Align = alClient
TabOrder = 1
ExplicitLeft = 8
ExplicitTop = 209
ExplicitWidth = 1033
ExplicitHeight = 321
object tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -273,8 +269,6 @@ object frmMainBaseList: TfrmMainBaseList
OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True
OnDblClick = dxLayoutControl_queryDblClick
ExplicitTop = 75
ExplicitWidth = 1077
object custName: TcxTextEdit
Tag = 2
Left = 262
@ -355,8 +349,6 @@ object frmMainBaseList: TfrmMainBaseList
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 3
ExplicitTop = 120
ExplicitWidth = 1077
DesignSize = (
1112
37)
@ -430,11 +422,11 @@ object frmMainBaseList: TfrmMainBaseList
ParentBackground = False
ParentColor = False
TabOrder = 4
ExplicitTop = 30
ExplicitWidth = 1077
ExplicitTop = 60
ExplicitWidth = 1112
inherited dxLayoutControl1: TdxLayoutControl
Width = 1112
ExplicitWidth = 1077
ExplicitWidth = 1112
inherited BegDate: TcxDateEdit
Left = 116
Top = 11
@ -518,6 +510,24 @@ object frmMainBaseList: TfrmMainBaseList
end
end
end
object cxProgressBar1: TMovePanel
Left = 292
Top = 256
Width = 233
Height = 49
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
ParentFont = False
TabOrder = 5
Visible = False
end
object DataSource1: TDataSource
DataSet = CDS_List
Left = 768

View File

@ -14,7 +14,7 @@ uses
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10;
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, MovePanel;
type
TfrmMainBaseList = class(TForm)
@ -69,6 +69,7 @@ type
Tzdy1: TToolButton;
Tzdy2: TToolButton;
Tzdy3: TToolButton;
cxProgressBar1: TMovePanel;
procedure TrefreshClick(Sender: TObject);
procedure TprintClick(Sender: TObject);
procedure TprintGridClick(Sender: TObject);
@ -366,6 +367,10 @@ end;
procedure TfrmMainBaseList.initGrid();
begin
if fProcedureName='' then exit;
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
if fQueryType='criteria' then
begin
doQueryByCriteria() ;
@ -375,5 +380,10 @@ begin
frmFrameDateSel1.jqModel.Checked:=true;
doQuery() ;
end;
finally
cxProgressBar1.Visible:=false;
end;
end;
end.

View File

@ -0,0 +1,531 @@
object frmPageBaseList: TfrmPageBaseList
Left = 0
Top = 0
Caption = 'frmPageBaseList'
ClientHeight = 538
ClientWidth = 1112
Color = clBtnFace
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
OldCreateOrder = False
WindowState = wsMaximized
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 21
object ToolBar3: TToolBar
Tag = 1
Left = 0
Top = 0
Width = 1112
Height = 60
AutoSize = True
ButtonHeight = 30
ButtonWidth = 115
Caption = 'ToolBar1'
GradientEndColor = clWindow
Images = DataLink_schedule.cxImageList_bar
List = True
GradientDrawingOptions = [gdoHotTrack]
ShowCaptions = True
TabOrder = 0
object Trefresh: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #21047#26032
ImageIndex = 1
OnClick = TrefreshClick
end
object Tadd: TToolButton
Left = 71
Top = 0
AutoSize = True
Caption = #26032#22686
ImageIndex = 9
Visible = False
end
object ToolButton2: TToolButton
Left = 142
Top = 0
AutoSize = True
Caption = #20462#25913
ImageIndex = 3
Visible = False
end
object ToolButton3: TToolButton
Left = 213
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 5
Visible = False
end
object Tzdy1: TToolButton
Left = 284
Top = 0
AutoSize = True
Caption = #33258#23450#20041'1'
Visible = False
end
object Tzdy2: TToolButton
Left = 352
Top = 0
AutoSize = True
Caption = #33258#23450#20041'2'
Visible = False
end
object Tzdy3: TToolButton
Left = 420
Top = 0
AutoSize = True
Caption = #33258#23450#20041'3'
Visible = False
end
object Tzdy4: TToolButton
Left = 488
Top = 0
AutoSize = True
Caption = #33258#23450#20041'4'
Visible = False
end
object Tzdy5: TToolButton
Left = 556
Top = 0
AutoSize = True
Caption = #33258#23450#20041'5'
Wrap = True
Visible = False
end
object Tzdy6: TToolButton
Left = 0
Top = 30
AutoSize = True
Caption = #33258#23450#20041'6'
ImageIndex = 8
end
object Tprint: TToolButton
Left = 96
Top = 30
AutoSize = True
Caption = #23548#20986'Excel'
ImageIndex = 28
OnClick = TprintClick
end
object TprintGrid: TToolButton
Left = 205
Top = 30
AutoSize = True
Caption = #25171#21360
ImageIndex = 21
OnClick = TprintGridClick
end
object TsaveGrid: TToolButton
Left = 276
Top = 30
AutoSize = True
Caption = #20445#23384#26684#24335
ImageIndex = 30
OnClick = TsaveGridClick
end
object TgridSet: TToolButton
Left = 379
Top = 30
AutoSize = True
Caption = #34920#26684#21015#35774#32622
ImageIndex = 16
Visible = False
OnClick = TgridSetClick
end
object Tclose: TToolButton
Left = 498
Top = 30
AutoSize = True
Caption = #20851#38381
ImageIndex = 7
OnClick = TcloseClick
end
end
object Panel_page: TPanel
Left = 0
Top = 105
Width = 1112
Height = 37
Align = alTop
AutoSize = True
BevelInner = bvRaised
BevelOuter = bvLowered
TabOrder = 1
ExplicitTop = 150
DesignSize = (
1112
37)
object LBCPAP: TLabel
Left = 425
Top = 8
Width = 100
Height = 20
Alignment = taCenter
Anchors = [akLeft]
AutoSize = False
Caption = #24403#21069#39029'/'#24635#39029#25968
Layout = tlCenter
ExplicitTop = 7
end
object Label31: TLabel
Left = 14
Top = 8
Width = 96
Height = 21
Alignment = taCenter
Anchors = [akLeft]
Caption = #27599#39029#35760#24405#26465#25968
Layout = tlCenter
ExplicitTop = 7
end
object BTNP: TButton
Left = 532
Top = 5
Width = 78
Height = 30
Anchors = [akLeft]
Caption = #19979#19968#39029
TabOrder = 0
OnClick = BTNPClick
end
object BTLP: TButton
Left = 338
Top = 4
Width = 78
Height = 31
Anchors = [akLeft]
Caption = #19978#19968#39029
TabOrder = 1
OnClick = BTLPClick
end
object TCBNOR: TcxComboBox
Tag = 2
Left = 122
Top = 2
Properties.DropDownListStyle = lsEditFixedList
Properties.Items.Strings = (
'500'
'1000'
'5000'
'10000')
Properties.OnChange = TCBNORPropertiesChange
TabOrder = 2
Text = '500'
Width = 94
end
end
inline frmFrameDateSel1: TfrmFrameDateSel10
Left = 0
Top = 60
Width = 1112
Height = 45
Align = alTop
AutoSize = True
Color = clBtnFace
ParentBackground = False
ParentColor = False
TabOrder = 2
ExplicitTop = 60
ExplicitWidth = 1112
inherited dxLayoutControl1: TdxLayoutControl
Width = 1112
ExplicitWidth = 1112
inherited BegDate: TcxDateEdit
Left = 116
Top = 11
ExplicitLeft = 116
ExplicitTop = 11
end
inherited EndDate: TcxDateEdit
Left = 265
Top = 11
ExplicitLeft = 265
ExplicitTop = 11
end
inherited cxButton1: TcxButton
Left = 465
Top = 11
ExplicitLeft = 465
ExplicitTop = 11
end
inherited cxButton2: TcxButton
Left = 625
Top = 11
ExplicitLeft = 625
ExplicitTop = 11
end
inherited cxButton3: TcxButton
Left = 756
Top = 11
ExplicitLeft = 756
ExplicitTop = 11
end
inherited cbbType: TcxComboBox
Left = 705
Top = 11
ExplicitLeft = 705
ExplicitTop = 11
end
inherited cxButton4: TcxButton
Left = 385
Top = 11
ExplicitLeft = 385
ExplicitTop = 11
end
inherited cxButton5: TcxButton
Left = 545
Top = 11
ExplicitLeft = 545
ExplicitTop = 11
end
inherited TimeType: TcxComboBox
Left = 16
Top = 11
ExplicitLeft = 16
ExplicitTop = 11
end
inherited jqModel: TcxCheckBox
Left = 859
Top = 11
ExplicitLeft = 859
ExplicitTop = 11
ExplicitWidth = 82
ExplicitHeight = 25
end
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
ItemIndex = 1
end
inherited dxLayoutItem1: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem2: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem8: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem9: TdxLayoutItem
CaptionOptions.Text = 'New Item'
end
inherited dxLayoutItem10: TdxLayoutItem
ControlOptions.OriginalHeight = 25
ControlOptions.OriginalWidth = 82
end
end
end
object cxPageControl1: TcxPageControl
Left = 56
Top = 148
Width = 569
Height = 353
TabOrder = 3
Properties.ActivePage = cxTabSheet1
Properties.CustomButtons.Buttons = <>
ClientRectBottom = 351
ClientRectLeft = 2
ClientRectRight = 567
ClientRectTop = 36
object cxTabSheet1: TcxTabSheet
Caption = 'cxTabSheet1'
ImageIndex = 0
object dxLayoutControl1: TdxLayoutControl
Left = 0
Top = 0
Width = 565
Height = 57
Align = alTop
TabOrder = 0
AutoSize = True
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True
OnDblClick = dxLayoutControl2DblClick
object dxLayoutGroup1: TdxLayoutGroup
AlignHorz = ahParentManaged
AlignVert = avParentManaged
CaptionOptions.AlignVert = tavCenter
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
SizeOptions.SizableHorz = True
SizeOptions.SizableVert = True
Hidden = True
LayoutDirection = ldHorizontal
Padding.Bottom = -5
Padding.Top = -5
Padding.AssignedValues = [lpavBottom, lpavTop]
ShowBorder = False
Index = -1
end
end
object cxGrid1: TcxGrid
Left = 0
Top = 57
Width = 565
Height = 258
Align = alClient
TabOrder = 1
ExplicitLeft = -547
ExplicitTop = 77
ExplicitWidth = 1112
ExplicitHeight = 238
object tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsData.Inserting = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
end
object cxGrid1Level1: TcxGridLevel
GridView = tv1
end
end
end
object cxTabSheet2: TcxTabSheet
Caption = 'cxTabSheet2'
ImageIndex = 1
object dxLayoutControl2: TdxLayoutControl
Left = 0
Top = 0
Width = 565
Height = 57
Align = alTop
TabOrder = 0
AutoSize = True
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
OptionsItem.SizableHorz = True
OptionsItem.SizableVert = True
OnDblClick = dxLayoutControl2DblClick
object dxLayoutControl2Group_Root: TdxLayoutGroup
AlignHorz = ahParentManaged
AlignVert = avParentManaged
CaptionOptions.AlignVert = tavCenter
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
SizeOptions.SizableHorz = True
SizeOptions.SizableVert = True
Hidden = True
LayoutDirection = ldHorizontal
Padding.Bottom = -5
Padding.Top = -5
Padding.AssignedValues = [lpavBottom, lpavTop]
ShowBorder = False
Index = -1
end
end
object cxGrid2: TcxGrid
Left = 0
Top = 57
Width = 565
Height = 258
Align = alClient
TabOrder = 1
ExplicitLeft = -547
ExplicitTop = 77
ExplicitWidth = 1112
ExplicitHeight = 238
object tv2: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
DataController.DataSource = DataSource1
DataController.Filter.AutoDataSetFilter = True
DataController.Summary.DefaultGroupSummaryItems = <>
DataController.Summary.FooterSummaryItems = <>
DataController.Summary.SummaryGroups = <>
OptionsData.Deleting = False
OptionsData.DeletingConfirmation = False
OptionsData.Inserting = False
OptionsView.Footer = True
OptionsView.GroupByBox = False
end
object cxGridLevel1: TcxGridLevel
GridView = tv2
end
end
end
end
object cxProgressBar1: TMovePanel
Left = 408
Top = 256
Width = 233
Height = 49
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
ParentFont = False
TabOrder = 4
Visible = False
end
object DataSource1: TDataSource
DataSet = CDS_List1
Left = 768
Top = 296
end
object ADOQueryList1: TADOQuery
Connection = DataLink_schedule.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 704
Top = 368
end
object cxGridPopupMenu1: TcxGridPopupMenu
PopupMenus = <>
Left = 992
Top = 39
end
object ADOQueryBaseCmd: TADOQuery
Parameters = <>
Left = 281
Top = 248
end
object ADOQueryBaseTemp: TADOQuery
LockType = ltReadOnly
Parameters = <>
Left = 673
Top = 161
end
object CDS_List1: TClientDataSet
Aggregates = <>
Params = <>
Left = 395
Top = 280
end
object DataSource2: TDataSource
DataSet = CDS_List1
Left = 832
Top = 304
end
object ADOQueryList2: TADOQuery
Connection = DataLink_schedule.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 816
Top = 400
end
object CDS_List2: TClientDataSet
Aggregates = <>
Params = <>
Left = 467
Top = 320
end
end

View File

@ -0,0 +1,529 @@
unit U_PageBaseList;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,U_WindowFormdesign,
dxSkinsDefaultPainters, dxSkinWXI, cxStyles, cxCustomData, cxFilter, cxData,
cxDataStorage, cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
Data.DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, Data.Win.ADODB,math,
dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, cxPC, MovePanel;
type
TfrmPageBaseList = class(TForm)
ToolBar3: TToolBar;
Trefresh: TToolButton;
Tprint: TToolButton;
TprintGrid: TToolButton;
TsaveGrid: TToolButton;
Tclose: TToolButton;
DataSource1: TDataSource;
ADOQueryList1: TADOQuery;
cxGridPopupMenu1: TcxGridPopupMenu;
ADOQueryBaseCmd: TADOQuery;
ADOQueryBaseTemp: TADOQuery;
CDS_List1: TClientDataSet;
Panel_page: TPanel;
BTNP: TButton;
LBCPAP: TLabel;
BTLP: TButton;
TCBNOR: TcxComboBox;
Label31: TLabel;
frmFrameDateSel1: TfrmFrameDateSel10;
TgridSet: TToolButton;
Tadd: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
Tzdy4: TToolButton;
Tzdy5: TToolButton;
Tzdy1: TToolButton;
Tzdy2: TToolButton;
Tzdy3: TToolButton;
cxPageControl1: TcxPageControl;
cxTabSheet1: TcxTabSheet;
cxTabSheet2: TcxTabSheet;
dxLayoutControl2: TdxLayoutControl;
dxLayoutControl2Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
dxLayoutGroup1: TdxLayoutGroup;
cxGrid1: TcxGrid;
tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid2: TcxGrid;
tv2: TcxGridDBTableView;
cxGridLevel1: TcxGridLevel;
DataSource2: TDataSource;
ADOQueryList2: TADOQuery;
CDS_List2: TClientDataSet;
cxProgressBar1: TMovePanel;
Tzdy6: TToolButton;
procedure TrefreshClick(Sender: TObject);
procedure TprintClick(Sender: TObject);
procedure TprintGridClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TcloseClick(Sender: TObject);
procedure TsaveGridClick(Sender: TObject);
procedure BTLPClick(Sender: TObject);
procedure BTNPClick(Sender: TObject);
procedure TCBNORPropertiesChange(Sender: TObject);
procedure TgridSetClick(Sender: TObject);
procedure dxLayoutControl2DblClick(Sender: TObject);
private
fWindowDesign: TWindowFormdesign;
CurrentPage, RecordsNumber: Integer;
fDesignCode:string;
procedure doQuery1();
procedure doQuery1ByCriteria();
procedure doQuery2();
procedure doQuery2ByCriteria();
procedure initGrid();
protected
fParameters1: string;
fParameters2: string;
fParameters3: string;
fParameters4: string;
fParameters5: string;
fParameters10: string;
public
fFormId: integer;
fProcedureName1:string; //存储过程名称1
fProcedureName2:string; //存储过程名称2
FLMType:string; //报表文件类型标志
ftimeType:string; //日期类型
fQueryType:String; //查询类型
FFiltration1:string; //打印参数条件
fCriteria:string; //条件参数
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
end;
var
frmPageBaseList: TfrmPageBaseList;
implementation
uses
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
{$R *.dfm}
procedure TfrmPageBaseList.BTLPClick(Sender: TObject);
begin
if CurrentPage > 1 then
CurrentPage := CurrentPage - 1;
if cxPageControl1.ActivePageIndex=0 then
doQuery1()
else
doQuery2() ;
end;
procedure TfrmPageBaseList.BTNPClick(Sender: TObject);
begin
if cxPageControl1.ActivePageIndex=0 then
begin
if CurrentPage < cds_List1.FieldByName('TotalCount').AsInteger / RecordsNumber then
CurrentPage := CurrentPage + 1;
doQuery1();
end
else
begin
if CurrentPage < cds_List2.FieldByName('TotalCount').AsInteger / RecordsNumber then
CurrentPage := CurrentPage + 1;
doQuery2();
end;
end;
constructor TfrmPageBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
begin
inherited Create(AOwner);
if ACaption <> '' then
Caption := ACaption;
fParameters1 := Parameters1;
fParameters2 := Parameters2;
fParameters3 := Parameters3;
fParameters4 := Parameters4;
fParameters5 := Parameters5;
fParameters10 := Parameters10;
fFormId:= FormID ;
end;
procedure TfrmPageBaseList.TCBNORPropertiesChange(Sender: TObject);
begin
RecordsNumber := StrToInt(TCBNOR.Text);
CurrentPage := 1;
initGrid();
end;
procedure TfrmPageBaseList.TcloseClick(Sender: TObject);
begin
close;
end;
procedure TfrmPageBaseList.TgridSetClick(Sender: TObject);
begin
fWindowDesign.OpenGridDesignWin10(fDesignCode,'cxgrid1',tv1);
end;
procedure TfrmPageBaseList.TprintClick(Sender: TObject);
begin
if cds_List1.IsEmpty then
Exit;
TcxGridToExcel(self.Caption, cxgrid1);
end;
procedure TfrmPageBaseList.TprintGridClick(Sender: TObject);
begin
if cds_List1.IsEmpty then
Exit;
if trim(self.FLMType)='' then
begin
application.MessageBox('未设置打印报表类型,请先设置!','提示信息',0);
exit;
end;
try
frmLabelPrint := TfrmLabelPrint.Create(Application);
with frmLabelPrint do
begin
FLMType := self.FLMType;
FFiltration1 := self.FFiltration1;
if ShowModal = 1 then
begin
// Self.InitGrid();
end;
end;
finally
frmLabelPrint.Free;
end;
end;
procedure TfrmPageBaseList.TrefreshClick(Sender: TObject);
begin
if frmFrameDateSel1.BegDate.Visible then
begin
frmFrameDateSel1.BegDate.SetFocus;
end;
CurrentPage := 1;
initGrid();
end;
procedure TfrmPageBaseList.TsaveGridClick(Sender: TObject);
begin
if cxPageControl1.ActivePageIndex=0 then
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption)
else
WriteCxGrid(trim(self.Caption) + 'Tv2', Tv2, gDllFileCaption) ;
if gIsCanDesign then
begin
if cxPageControl1.ActivePageIndex=0 then
saveLayOut(application, dxLayoutControl1, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl1.Name + '.ini'))
else
saveLayOut(application, dxLayoutControl2, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl2.Name + '.ini'));
end;
end;
////////////////////////////////////
procedure TfrmPageBaseList.doQuery1();
var
strwhere: string;
begin
if fProcedureName1='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
strwhere := GetProcedureParam(dxLayoutControl1);
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
Tv1.BeginUpdate();
CDS_List1.DisableControls;
with ADOQueryList1 do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName1);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if frmFrameDateSel1.jqModel.Checked then
sql.Add(',@jqModel=1')
else
sql.Add(',@jqModel=0');
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(fcriteria));
if strwhere<>'' then
sql.Add(','+strwhere);
// showMessage(sql.Text);
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList1, CDS_List1);
SInitCDSData(ADOQueryList1, CDS_List1);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list1.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List1.EnableControls;
Tv1.EndUpdate;
cxProgressBar1.Visible:=false;
end;
end;
////////////////////////////////////
procedure TfrmPageBaseList.doQuery2();
var
strwhere: string;
begin
if fProcedureName2='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
strwhere := GetProcedureParam(dxLayoutControl2);
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
Tv2.BeginUpdate();
CDS_List2.DisableControls;
with ADOQueryList2 do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName1);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if frmFrameDateSel1.jqModel.Checked then
sql.Add(',@jqModel=1')
else
sql.Add(',@jqModel=0');
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(fcriteria));
if strwhere<>'' then
sql.Add(','+strwhere);
// showMessage(sql.Text);
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList2, CDS_List2);
SInitCDSData(ADOQueryList2, CDS_List2);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list2.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List2.EnableControls;
Tv2.EndUpdate;
cxProgressBar1.Visible:=false;
end;
end;
////////////////////////////////////
procedure TfrmPageBaseList.doQuery1ByCriteria();
var
mSqlWhere: string;
begin
if fProcedureName1='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
mSqlWhere := SLGetFilters(dxLayoutControl1, 1, 2);
if trim(mSqlWhere) <> '' then
begin
mSqlWhere := ' and ' + trim(mSqlWhere);
end;
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
Tv1.BeginUpdate();
CDS_List1.DisableControls;
with ADOQueryList1 do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName1);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList1, CDS_List1);
SInitCDSData(ADOQueryList1, CDS_List1);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list1.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List1.EnableControls;
Tv1.EndUpdate;
cxProgressBar1.Visible:=false;
end;
end;
////////////////////////////////////
procedure TfrmPageBaseList.doQuery2ByCriteria();
var
mSqlWhere: string;
begin
if fProcedureName2='' then
begin
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
exit;
end;
mSqlWhere := SLGetFilters(dxLayoutControl2, 1, 2);
if trim(mSqlWhere) <> '' then
begin
mSqlWhere := ' and ' + trim(mSqlWhere);
end;
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
Tv2.BeginUpdate();
CDS_List2.DisableControls;
with ADOQueryList2 do
begin
close;
Filtered := false;
sql.Clear;
sql.Add('exec '+fProcedureName1);
sql.Add('@timeType='+quotedstr(fTimeType));
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
if Panel_page.Visible then
begin
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
end;
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
//cxMemo1.Text:= sql.Text ;
open;
end;
SCreateCDS(ADOQueryList2, CDS_List2);
SInitCDSData(ADOQueryList2, CDS_List2);
if Panel_page.Visible then
begin
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list2.FieldByName('TotalCount').AsInteger / RecordsNumber));
end;
finally
CDS_List2.EnableControls;
Tv2.EndUpdate;
cxProgressBar1.Visible:=false;
end;
end;
procedure TfrmPageBaseList.dxLayoutControl2DblClick(Sender: TObject);
begin
layoutDesign(TdxLayoutControl(Sender),ADOQueryBaseCmd,PWideChar(dcode));
end;
///
procedure TfrmPageBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
Action:=cafree;
end;
procedure TfrmPageBaseList.FormCreate(Sender: TObject);
begin
cxPageControl1.Align:=alClient;
CurrentPage := 1;
RecordsNumber := 500;
fWindowDesign := TWindowFormdesign.Create();
frmFrameDateSel1.begdate.Date:=SGetServerDate(ADOQueryBaseTemp);
frmFrameDateSel1.enddate.Date:=frmFrameDateSel1.begdate.Date;
end;
procedure TfrmPageBaseList.FormDestroy(Sender: TObject);
begin
fWindowDesign.free;
end;
procedure TfrmPageBaseList.FormShow(Sender: TObject);
begin
fDesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId);
if DParameters8<>'1' then
begin
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
end;
TgridSet.Visible:=gIsCanDesign;
//增加动态条件
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl1,7);
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid2',dxLayoutControl2,7);
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
ReadCxGrid(trim(self.Caption) + 'Tv2', Tv2, gDllFileCaption);
initGrid();
end;
///////////////////////////////
///
procedure TfrmPageBaseList.initGrid();
begin
if fProcedureName1='' then exit;
if fProcedureName2='' then exit;
if cxPageControl1.ActivePageIndex=0 then
begin
if fQueryType='criteria' then
begin
doQuery1ByCriteria() ;
end
else
begin
frmFrameDateSel1.jqModel.Checked:=true;
doQuery1() ;
end;
end
else
begin
if fQueryType='criteria' then
begin
doQuery2ByCriteria() ;
end
else
begin
frmFrameDateSel1.jqModel.Checked:=true;
doQuery2() ;
end;
end;
end;
end.

View File

@ -316,6 +316,24 @@ object frmQryBaseList: TfrmQryBaseList
Width = 94
end
end
object cxProgressBar1: TMovePanel
Left = 408
Top = 256
Width = 233
Height = 49
BevelInner = bvRaised
BevelOuter = bvLowered
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
Color = clSkyBlue
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -16
Font.Name = #24494#36719#38597#40657
Font.Style = []
ParentFont = False
TabOrder = 5
Visible = False
end
object DataSource1: TDataSource
DataSet = CDS_List
Left = 768

View File

@ -30,7 +30,7 @@ uses
dxSkinSpringtime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinTheBezier, dxSkinValentine, dxSkinVisualStudio2013Blue,
dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
dxSkinWhiteprint, dxSkinXmas2008Blue;
dxSkinWhiteprint, dxSkinXmas2008Blue, MovePanel;
type
TfrmQryBaseList = class(TForm)
@ -60,6 +60,7 @@ type
TCBNOR: TcxComboBox;
Label31: TLabel;
TgridSet: TToolButton;
cxProgressBar1: TMovePanel;
procedure TrefreshClick(Sender: TObject);
procedure TprintClick(Sender: TObject);
procedure TprintGridClick(Sender: TObject);
@ -358,6 +359,9 @@ end;
procedure TfrmQryBaseList.initGrid();
begin
if fProcedureName='' then exit;
try
cxProgressBar1.Visible:=true;
cxProgressBar1.Refresh ;
if fQueryType='criteria' then
begin
@ -369,5 +373,10 @@ begin
doQuery() ;
end;
finally
cxProgressBar1.Visible:=false;
end;
end;
end.