From 92d1a3bfedc123076bf0ec8c334f0397229176f4 Mon Sep 17 00:00:00 2001 From: cyf Date: Fri, 30 Jan 2026 07:56:32 +0000 Subject: [PATCH] SVN r1111 SVN-Revision: r1111 --- 插件库/Lskj.PubBillInfo/FrmMain.cs | 86 +++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/插件库/Lskj.PubBillInfo/FrmMain.cs b/插件库/Lskj.PubBillInfo/FrmMain.cs index 0e9b9df..3e75b09 100644 --- a/插件库/Lskj.PubBillInfo/FrmMain.cs +++ b/插件库/Lskj.PubBillInfo/FrmMain.cs @@ -161,8 +161,14 @@ namespace Lskj.PubBillInfo this.BillModelObj = new BillAuditModel(BillImpl.GetBillInfo(this.SysModel.ModuleCode)); this.BillModelObj.MasterPreFix = BaseImpl.GetColumnPrefix(this.BillModelObj.MasterTable); this.AuditModelObj = new AccraditationModel(BillAuditImpl.GetBillFlowData(this.SysModel.ModuleCode, this.SysModel.StepCode)); + string text = ResourceKeys.BillInfoTitle; + if (Business.Impl.LanguageTranslation.Translatable) + { + text = "【{0}】" + Business.Impl.LanguageTranslation.GetTranslatedText("单据号") + "【{1}】"; - this.Text = !string.IsNullOrEmpty(this.SysModel.FormTitle) ? string.Format(ResourceKeys.BillInfoTitle, this.SysModel.FormText, this.SysModel.BillDocumentId) : this.SysModel.FormText; + } + + this.Text = !string.IsNullOrEmpty(this.SysModel.FormTitle) ? string.Format(text, this.SysModel.FormText, this.SysModel.BillDocumentId) : this.SysModel.FormText; this.txt_billDocumentId.EditText = this.SysModel.BillDocumentId; } /// @@ -286,7 +292,8 @@ namespace Lskj.PubBillInfo private void InitializeCommonMenus() { DataTable tableCommon = BaseModuleImpl.GetBaseGridRightMenus(this.SysModel.ModuleCode, ModuleType.BillDetail); - this.btnAtt.Text = "附件" + "(" + AttachImpl.GetFileCount(this.BillModelObj.DirId + "", this.SysModel.BillDocumentId) + ")"; + string text = Business.Impl.LanguageTranslation.Translatable ? Business.Impl.LanguageTranslation.GetTranslatedText("附件") : "附件"; + this.btnAtt.Text = text + "(" + AttachImpl.GetFileCount(this.BillModelObj.DirId + "", this.SysModel.BillDocumentId) + ")"; if (tableCommon.Rows.Count == 0) { this.dpb_Tools.Visible = false; @@ -506,7 +513,38 @@ namespace Lskj.PubBillInfo //string sqlValue = ReplaceHelper.ReplaceRowParam(this.gridBillInfo.GridView.GetFocusedDataRow(), model.DetailSql); //this.baseTab.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue)); - if (tabPage.Tag is GridControlEx) + + if (tabPage.Tag is ModuleWebView) + { + // 加载网页 + string url = ReplaceHelper.ReplaceRowParam(dataRow, ReplaceHelper.ReplaceUserInfo(model.DetailSql)); + url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url; + ModuleWebView webView = tabPage.Tag as ModuleWebView; + webView.Dock = DockStyle.Fill; + webView.Tag = model; + webView.Navigate(url); + } + else if (tabPage.Tag is FrmWebBrowser) + { + // 加载网页 + string url = ReplaceHelper.ReplaceRowParam(dataRow, ReplaceHelper.ReplaceUserInfo(model.DetailSql)); + url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url; + FrmWebBrowser webView = tabPage.Tag as FrmWebBrowser; + webView.Dock = DockStyle.Fill; + webView.Tag = model; + webView.LoadUrl(url); + } + else if (tabPage.Tag is FrmMiniBlink) + { + // 加载网页 + string url = ReplaceHelper.ReplaceRowParam(dataRow, ReplaceHelper.ReplaceUserInfo(model.DetailSql)); + url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url; + FrmMiniBlink webView = tabPage.Tag as FrmMiniBlink; + webView.Dock = DockStyle.Fill; + webView.Tag = model; + webView.LoadUrl(url); + } + else if(tabPage.Tag is GridControlEx) { string sqlValue = isDetailAttach ? ReplaceHelper.ReplaceRowParam(dataRow, model.DetailSql) : GetSearchSql(model); GridControlEx grdExMain = (tabPage.Tag as GridControlEx); @@ -588,7 +626,20 @@ namespace Lskj.PubBillInfo graphicsText.DrawString(this._waterMark.Text, new Font("宋体", 20, FontStyle.Bold), brush, new PointF(x, y), format, -20f); e.Graphics.TranslateTransform(x, y); e.Graphics.RotateTransform(-20f); - e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + + if (Business.Impl.LanguageTranslation.Translatable) + { + // 1. 测量文本尺寸 + SizeF textSize = e.Graphics.MeasureString(this._waterMark.Text, new Font("宋体", 20, FontStyle.Bold), new SizeF(float.MaxValue, float.MaxValue), format); + // 2. 计算边框矩形的尺寸和位置 + int rectWidth = (int)textSize.Width + 10; + e.Graphics.DrawRectangle(pen, new Rectangle(-rectWidth / 2, -19, rectWidth, 32)); + } + else + { + e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + } + } e.Graphics.ResetTransform(); if (!string.IsNullOrEmpty(this._waterMark.Print)) @@ -598,7 +649,19 @@ namespace Lskj.PubBillInfo graphicsText.DrawString(this._waterMark.Print, new Font("宋体", 18, FontStyle.Bold), brush, new PointF(x, y), format, -20f); e.Graphics.TranslateTransform(x, y); e.Graphics.RotateTransform(-20f); - e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + + if (Business.Impl.LanguageTranslation.Translatable) + { + // 1. 测量文本尺寸 + SizeF textSize = e.Graphics.MeasureString(this._waterMark.Print, new Font("宋体", 18, FontStyle.Bold), new SizeF(float.MaxValue, float.MaxValue), format); + // 2. 计算边框矩形的尺寸和位置 + int rectWidth = (int)textSize.Width + 10; + e.Graphics.DrawRectangle(pen, new Rectangle(-rectWidth / 2, -19, rectWidth, 32)); + } + else + { + e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + } } e.Graphics.ResetTransform(); if (!string.IsNullOrEmpty(this._waterMark.Collect)) @@ -609,7 +672,18 @@ namespace Lskj.PubBillInfo graphicsText.DrawString(this._waterMark.Collect, new Font("宋体", 20, FontStyle.Bold), brush, new PointF(x, y), format, -20f); e.Graphics.TranslateTransform(x, y); e.Graphics.RotateTransform(-20f); - e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + if (Business.Impl.LanguageTranslation.Translatable) + { + // 1. 测量文本尺寸 + SizeF textSize = e.Graphics.MeasureString(this._waterMark.Collect, new Font("宋体", 20, FontStyle.Bold), new SizeF(float.MaxValue, float.MaxValue), format); + // 2. 计算边框矩形的尺寸和位置 + int rectWidth = (int)textSize.Width + 10; + e.Graphics.DrawRectangle(pen, new Rectangle(-rectWidth / 2, -19, rectWidth, 32)); + } + else + { + e.Graphics.DrawRectangle(pen, new Rectangle(-60, -19, 120, 32)); + } } } }