From bd06bb837fa0c7edeeae56cb0fe4fb844f53fb2f Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 23 十月 2024 16:42:34 +0800
Subject: [PATCH] 修改了报表设计器
---
DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs | 126 +++++++++++++++++++++++------------------
1 files changed, 71 insertions(+), 55 deletions(-)
diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
index d8bdca8..e998fca 100644
--- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -96,22 +96,22 @@
public List<string> actions { get; }
/// <summary>
- /// 鎶ヨ〃绫诲瀷锛屽湪鏁版嵁搴撲腑瑕佸敮涓�锛屽惁鍒欎細淇濆瓨涓嶄簡鎶ヨ〃璁捐
+ /// 鎶ヨ〃锛屽湪鏁版嵁搴撲腑瑕佸敮涓�,濡傦細瀛樺偍杩囩▼鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏
/// </summary>
- public string rptService { get; set; }
+ public string rptParameter { get; set; }
/// <summary>
- /// 瀵煎嚭鏈嶅姟鍚�
+ /// 瀵煎嚭锛岃鍥惧悕,濡傦細瑙嗗浘鍚峽鍏ュ弬1鍚峾鍏ュ弬鍊�,鍏ュ弬2鍚峾鍏ュ弬鍊紏
/// </summary>
- public string xlsOutView { get; set; }
+ public string xlsOutParameter { get; set; }
/// <summary>
- /// 瀵煎叆鏈嶅姟鍚�
+ /// 瀵煎叆
/// </summary>
public string xlsInService { get; set; }
/// <summary>
- /// 瀹℃牳鍙傛暟,褰㈠锛歁ES_HOLIDAY,check_date,check_status,check_by
+ /// 瀹℃牳鍙傛暟,琛ㄥ悕,瀛楁鍚嶏紝濡傦細MES_HOLIDAY,check_date,check_status,check_by
/// </summary>
public string chkParameter { get; set; }
#endregion
@@ -271,81 +271,82 @@
private void BtnOut_ItemClick(object sender, ItemClickEventArgs e)
{
- if (string.IsNullOrEmpty(this.xlsOutView))
- {
- ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾瀵煎嚭鏈嶅姟锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒");
- return;
- }
- using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
- {
- folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
- DialogResult dialogResult = folderBrowserDialog.ShowDialog();
- if (dialogResult == DialogResult.OK)
- {
- string _folder = folderBrowserDialog.SelectedPath;
- var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutView);
- try
- {
- string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- string _file = _rtn.rtnData.fileUrl.ToString();
- string _folderName = _folder + "\\" + _file.Replace("down/", "");
- string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
- using (WebClient client = new WebClient())
- {
- client.DownloadFile(_url, _folderName);
- }
- ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
- }
- else
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- }
- }
- catch (Exception ex)
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
- }
- }
+ //if (string.IsNullOrEmpty(this.xlsOutView))
+ //{
+ // ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾瀵煎嚭鏈嶅姟锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒");
+ // return;
+ //}
+ //using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+ //{
+ // folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+ // DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+ // if (dialogResult == DialogResult.OK)
+ // {
+ // string _folder = folderBrowserDialog.SelectedPath;
+ // var _obj = new Gs.DevApp.Entity.XlsOutModel(this.xlsOutView);
+ // try
+ // {
+ // string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView", JsonConvert.SerializeObject(_obj));
+ // ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+ // if (_rtn.rtnCode > 0)
+ // {
+ // string _file = _rtn.rtnData.fileUrl.ToString();
+ // string _folderName = _folder + "\\" + _file.Replace("down/", "");
+ // string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
+ // using (WebClient client = new WebClient())
+ // {
+ // client.DownloadFile(_url, _folderName);
+ // }
+ // ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+ // }
+ // else
+ // {
+ // ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ // }
+ // }
+ // catch (Exception ex)
+ // {
+ // ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ // }
+ // }
+ //}
}
private void BtnReport_ItemClick(object sender, ItemClickEventArgs e)
{
- if (string.IsNullOrEmpty(this.rptService))
+ if (string.IsNullOrEmpty(this.rptParameter))
{
- ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃绫诲瀷锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒");
+ ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒");
return;
}
bool _bl = false;
_bl = _ckRptService();
if (_bl)
{
- Gs.DevApp.DevFrm.Rpt.RptPreview frm = new Gs.DevApp.DevFrm.Rpt.RptPreview(this.rptService);
+ Gs.DevApp.DevFrm.Rpt.RptPreview frm = new Gs.DevApp.DevFrm.Rpt.RptPreview(this.rptParameter);
frm.Show();
return;
}
- ToolBox.MsgHelper.ShowError("杩樻病鏈夎璁℃ā鏉匡紝璇峰厛璁捐妯℃澘锛�");
+ ToolBox.MsgHelper.ShowError("娌℃湁璁捐妯℃澘锛岃鍏堣璁℃ā鏉匡紒");
+ return;
}
private void BtnDesign_ItemClick(object sender, ItemClickEventArgs e)
{
- if (string.IsNullOrEmpty(this.rptService))
+ if (string.IsNullOrEmpty(this.rptParameter))
{
- ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃绫诲瀷锛岃鑱旂郴寮�鍙戜汉鍛樿幏鍙栨敮鎸侊紒");
+ ToolBox.MsgHelper.ShowError("娌℃湁鎸囧畾鎶ヨ〃鍙傛暟锛岃鑱旂郴鎶�鏈紑鍙戜汉鍛橈紒");
return;
}
bool _bl = false;
_bl = _ckRptService();
- //濡傛灉宸茬粡鏈夋ā鏉夸簡锛岀洿鎺ユ墦寮�
+ //濡傛灉宸茬粡鏈夋ā鏉夸簡锛岀洿鎺ユ墦寮�璁剧疆妯℃澘
if (_bl)
{
- Gs.DevApp.DevFrm.Sys.EasyRptDesign frm = new Gs.DevApp.DevFrm.Sys.EasyRptDesign(this.rptService);
+ Gs.DevApp.DevFrm.Sys.EasyRptDesign frm = new Gs.DevApp.DevFrm.Sys.EasyRptDesign(this.rptParameter);
frm.Show();
return;
}
//鍚﹀垯鍚戝璁捐妯℃澘
- UserControl.ShowRptWizard rptWizard = new ShowRptWizard(this.rptService);
+ UserControl.ShowRptWizard rptWizard = new ShowRptWizard(this.rptParameter);
rptWizard.ShowDialog();
}
@@ -519,6 +520,7 @@
);
if (ld1 == true)
{
+
btnEsc.Visibility = btnSave.Visibility = btnLoad.Visibility = BarItemVisibility.Always;
btnAdd.Visibility = BarItemVisibility.Always;
_enabledList.Add(item.Name);
@@ -547,6 +549,19 @@
{
item.Visibility = BarItemVisibility.Always;
//鍑嗗鍚敤
+ _enabledList.Add(item.Name);
+ continue;
+ }
+ }
+ ///鍏锋湁鑱斿姩鍏崇郴鐨勬寜閽�(鎻愪氦妫�楠�)锛�
+ if (item.Caption == "鎻愪氦妫�楠�")
+ {
+ bool ld1 = dt.AsEnumerable().Any(row => row.Field<string>("name") == "鎻愪氦妫�楠�"
+ );
+ if (ld1 == true)
+ {
+ btnJianYan.Visibility = btnFjianYan.Visibility = btnLoad.Visibility = BarItemVisibility.Always;
+ btnJianYan.Visibility = BarItemVisibility.Always;
_enabledList.Add(item.Name);
continue;
}
@@ -596,7 +611,7 @@
{
var _obj = new
{
- reportType = this.rptService,
+ rptParameter = this.rptParameter,
};
string strJson = UtilityHelper.HttpPost("", "Report/GetTemplate", JsonConvert.SerializeObject(_obj));
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
@@ -611,6 +626,7 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
return true;
}
+ return false;
}
}
}
--
Gitblit v1.9.3