You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
5.5 KiB
Plaintext

11 months ago
unit u_rp_fen_airi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, RxMemDS, DB, ADODB, Menus, XPMenu, TeEngine, Series, TeeProcs,
Chart, DbChart, bsSkinCtrls, ExtCtrls,teeprevi, Mask, wwdbedit, Wwdotdot,
Wwdbcomb, StdCtrls, dxExEdtr, dxTL, dxDBCtrl, dxDBGrid, dxCntner;
type
Tfrm_rp_fen_airi = class(TForm)
Panel1: TPanel;
bsSkinPanel2: TbsSkinPanel;
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox4: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox5: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox6: TbsSkinCheckRadioBox;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinPanel3: TbsSkinPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
wwDBComboBox1: TwwDBComboBox;
p_client: TADOStoredProc;
DBChart1: TDBChart;
LineSeries2: TBarSeries;
p_client1: TDataSource;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
bsSkinCheckRadioBox9: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox10: TbsSkinCheckRadioBox;
SaveDialog1: TSaveDialog;
bsSkinButton1: TbsSkinButton;
bsSkinCheckRadioBox7: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox8: TbsSkinCheckRadioBox;
bsSkinCheckRadioBox11: TbsSkinCheckRadioBox;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure bsSkinCheckRadioBox1Click(Sender: TObject);
procedure bsSkinPanel1Resize(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_fen_airi: Tfrm_rp_fen_airi;
fen_airi_str:widestring;
implementation
uses u_main, u_sys_progress, my_sys_function;
{$R *.dfm}
procedure Tfrm_rp_fen_airi.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_fen_airi.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_rp_fen_airi.Hide;
frm_rp_fen_airi.ManualFloat(frm_rp_fen_airi.BoundsRect );
frm_main.freeTabs('frm_rp_fen_airi');
action:=cafree;
frm_rp_fen_airi:=nil;
end;
procedure Tfrm_rp_fen_airi.bsSkinButton9Click(Sender: TObject);
begin
chartpreview(frm_rp_fen_airi,dbchart1);
end;
procedure Tfrm_rp_fen_airi.bsSkinButton10Click(Sender: TObject);
begin
query_airi(8,'0037');
frm_rp_fen_airi.bsSkinCheckRadioBox1Click(Sender)
end;
procedure Tfrm_rp_fen_airi.Panel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round(bsSkinPanel2.Width/7);
bsSkinCheckRadioBox1.Width:=i;
bsSkinCheckRadioBox2.Width:=i;
bsSkinCheckRadioBox3.Width:=i;
bsSkinCheckRadioBox4.Width:=i;
bsSkinCheckRadioBox5.Width:=i;
bsSkinCheckRadioBox6.Width:=i;
bsSkinCheckRadioBox7.Width:=i;
bsSkinCheckRadioBox8.Width:=i;
bsSkinCheckRadioBox11.Width:=i;
end;
procedure Tfrm_rp_fen_airi.bsSkinCheckRadioBox1Click(Sender: TObject);
var
str,tongji,paixu:string;
i:integer;
begin
try
i:=strtoint(Edit1.text);
if i<1 then
begin
showmessage('<27><><EFBFBD>α<EFBFBD><CEB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>');
exit;
end;
except
showmessage('<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Σ<EFBFBD><CEA3><EFBFBD>');
exit;
end;
if wwDBComboBox1.ItemIndex=-1 then
begin
showmessage('<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>');
exit;
end;
if wwDBComboBox1.ItemIndex=0 then
paixu:='desc'
else
paixu:='';
if fen_airi_str='' then
exit;
if bsSkinCheckRadioBox1.Checked then
str:=bsSkinCheckRadioBox1.Caption;
if bsSkinCheckRadioBox2.Checked then
str:=bsSkinCheckRadioBox2.Caption;
if bsSkinCheckRadioBox3.Checked then
str:=bsSkinCheckRadioBox3.Caption;
if bsSkinCheckRadioBox4.Checked then
str:=bsSkinCheckRadioBox4.Caption;
if bsSkinCheckRadioBox5.Checked then
str:=bsSkinCheckRadioBox5.Caption;
if bsSkinCheckRadioBox6.Checked then
str:=bsSkinCheckRadioBox6.Caption;
if bsSkinCheckRadioBox7.Checked then
str:=bsSkinCheckRadioBox7.Caption;
if bsSkinCheckRadioBox8.Checked then
str:=bsSkinCheckRadioBox8.Caption;
if bsSkinCheckRadioBox11.Checked then
str:=bsSkinCheckRadioBox11.Caption;
if bsSkinCheckRadioBox9.checked then
begin
tongji:='t_op_gain.ë<><C3AB><EFBFBD><EFBFBD>';
DBChart1.Title.Text.Clear;
DBChart1.Title.Text.add('<27><><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5>Ӧ<EFBFBD><D3A6>ë<EFBFBD><C3AB><EFBFBD><EFBFBD>ǰ'+edit1.text+'<27><>');
end
else
begin
tongji:='t_op_airi.<2E>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD>';
DBChart1.Title.Text.Clear;
DBChart1.Title.Text.add('<27><><EFBFBD>ڼƼ<DABC><C6BC><EFBFBD><EFBFBD><EFBFBD>ǰ'+edit1.text+'<27><>');
end;
p_client.close;
p_client.Parameters.ParamByName('SQLStr').value:=
'SELECT top '
+Edit1.text+' sum('+tongji+') as <20><><EFBFBD><EFBFBD>'
+',t_op_airi.'+str+' as <20><>׼'
+' FROM t_op_airi left JOIN t_op_gain ON '
+'t_op_airi.<2E><><EFBFBD><EFBFBD> =t_op_gain.<2E><><EFBFBD><EFBFBD> '
+fen_airi_str
+' group by t_op_airi.'+str
+' order by sum('+tongji+') '+paixu;
p_client.Open;
end;
procedure Tfrm_rp_fen_airi.bsSkinPanel1Resize(Sender: TObject);
var
i:integer;
begin
i:=round((bsSkinPanel1.Width-bsSkinPanel3.Width)/6);
bsSkinCheckRadioBox10.Width:=i;
bsSkinCheckRadioBox9.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton9.Width:=i;
bsSkinButton1.Width:=i;
wwDBComboBox1.ItemIndex:=0;
end;
procedure Tfrm_rp_fen_airi.bsSkinButton1Click(Sender: TObject);
begin
if SaveDialog1.Execute then
frm_rp_fen_airi.GetFormImage.SaveToFile(SaveDialog1.FileName+'.bmp');
end;
end.