修改CommonFiltersByTv 函数,增加变量控制

This commit is contained in:
sgwp 2025-03-08 16:47:21 +08:00
parent cba09a0003
commit 634f9a5dfb
3 changed files with 20 additions and 11 deletions

View File

@ -3699,16 +3699,22 @@ var
i: integer; i: integer;
JSONObject: TJSONObject; JSONObject: TJSONObject;
MFields: TStringList; MFields: TStringList;
RemovalNull: Boolean;
begin begin
Result := ''; Result := '';
JSONObject := TJSONObject.ParseJSONValue(JsonArgs) as TJSONObject; JSONObject := TJSONObject.ParseJSONValue(JsonArgs) as TJSONObject;
MFields := TStringList.Create(); MFields := TStringList.Create();
ExtractStrings(['|'], [' '], PChar(JSONObject.S['Fields']), MFields); ExtractStrings(['|'], [' '], PChar(JSONObject.S['Fields']), MFields);
RemovalNull := JSONObject.B['RemovalNull'];
for i := 0 to Tv1.ColumnCount - 1 do for i := 0 to Tv1.ColumnCount - 1 do
begin begin
if MFields.IndexOf(Tv1.Columns[i].DataBinding.FieldName) >= 0 then if MFields.IndexOf(Tv1.Columns[i].DataBinding.FieldName) >= 0 then
begin begin
Result := Result + 'and isnull(' + Tv1.Columns[i].DataBinding.FieldName + ','''')=' + quotedStr(Trim(Tv1.DataController.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).AsString)) + ' '; if RemovalNull then
Result := Result + ' and isnull(' + Tv1.Columns[i].DataBinding.FieldName + ','''') = ' + quotedStr(Trim(Tv1.DataController.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).AsString)) + ' '
else
Result := Result + ' and ' + Tv1.Columns[i].DataBinding.FieldName + ' = ' + quotedStr(Trim(Tv1.DataController.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).AsString)) + ' ';
end; end;
end; end;
MFields.Free; MFields.Free;
@ -3903,8 +3909,7 @@ begin
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add('select item_value,data_type from sy_module_param_set where dll_name=''' + sql.Add('select item_value,data_type from sy_module_param_set where dll_name=''' +Trim(DllName) + ''' and config_name=''' + Trim(ConfigName) + '''');
Trim(DllName) + ''' and config_name=''' + Trim(ConfigName) + '''');
Open; Open;
if RecordCount > 0 then if RecordCount > 0 then
begin begin
@ -3920,15 +3925,17 @@ begin
Result:=True; Result:=True;
end; end;
end end
else if Trim(FieldByName('data_type').AsString)='ÕûÊý' then
begin
Result:=StrToIntDef(Trim(FieldByName('item_value').AsString),0);
end
else else
begin begin
Result:=Trim(FieldByName('item_value').AsString); Result:=Trim(FieldByName('item_value').AsString);
end; end;
end; end;
end; end;
end; end;
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
/// 粘贴剪贴板中的数据到表格 /// 粘贴剪贴板中的数据到表格

View File

@ -8,7 +8,7 @@ uses
Data.Win.ADODB, cxGraphics, U_WindowFormdesign, cxEdit, Vcl.ExtCtrls, Data.Win.ADODB, cxGraphics, U_WindowFormdesign, cxEdit, Vcl.ExtCtrls,
cxControls, cxProgressBar, cxLookAndFeels, cxLookAndFeelPainters, cxContainer, cxControls, cxProgressBar, cxLookAndFeels, cxLookAndFeelPainters, cxContainer,
dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI, dxSkinSharpPlus, dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI, dxSkinSharpPlus,
System.JSON; System.JSON, dxSkinMySkin_WXI, dxSkinOffice2013White;
type type
TfrmBaseList = class(TForm) TfrmBaseList = class(TForm)
@ -73,8 +73,8 @@ begin
fModuleId:=StringReplace(Trim(jsonObject.GetValue('moduleId').ToString),'"','',[rfReplaceAll]); fModuleId:=StringReplace(Trim(jsonObject.GetValue('moduleId').ToString),'"','',[rfReplaceAll]);
fModuleSubId:=StringReplace(trim(jsonObject.GetValue('moduleSubId').ToString),'"','',[rfReplaceAll]); fModuleSubId:=StringReplace(trim(jsonObject.GetValue('moduleSubId').ToString),'"','',[rfReplaceAll]);
gTeamWorker:=StringReplace(trim(jsonObject.GetValue('teamWorkerId').ToString),'"','',[rfReplaceAll]); gTeamWorker:=StringReplace(trim(jsonObject.GetValue('teamWorkerId').ToString),'"','',[rfReplaceAll]);
if Parameters1=' ѯ' then if Parameters1='²éѯ' then
fParameters10:=' ѯ' fParameters10:='²éѯ'
else else
fParameters10:=''; fParameters10:='';
finally finally
@ -82,7 +82,7 @@ begin
end; end;
end; end;
// //ÖØÃüÃû´°¿Ú
if trim(formName)<>'' then if trim(formName)<>'' then
self.Name:=self.Name+trim(formName); self.Name:=self.Name+trim(formName);
fFormId:= FormID ; fFormId:= FormID ;
@ -106,7 +106,8 @@ var
begin begin
self.Color:=clBtnFace; self.Color:=clBtnFace;
//getSystemIni(); //getSystemIni();
self.DoubleBuffered:=gIsUseSkin; if gIsUseSkin and not gIsNoUseBuffer then
self.DoubleBuffered:=true;
if gFontSize<9 then if gFontSize<9 then
begin begin
mFontSize := 9; mFontSize := 9;
@ -119,7 +120,7 @@ begin
self.Font.Size := gFontSize; self.Font.Size := gFontSize;
if trim(gFontName)<>'' then if trim(gFontName)<>'' then
self.Font.Name:=gFontName; self.Font.Name:=gFontName;
// ڱ ɫ // ´°¿Ú±³¾°É«
fWindowDesign := TWindowFormdesign.Create(); fWindowDesign := TWindowFormdesign.Create();
end; end;

View File

@ -14,6 +14,7 @@ var
gFontSize:integer; gFontSize:integer;
gFontName:string; gFontName:string;
gIsUseSkin:boolean; gIsUseSkin:boolean;
gIsNoUseBuffer:boolean;
gStructVer:string; gStructVer:string;
gSystemId:string; gSystemId:string;
gIsYsUse:boolean; gIsYsUse:boolean;