cdk
5 天以前 33583f8a9716e4313163fb9bbde58fea02012a28
DevApp/Gs.DevApp/DevFrm/FrmMain.cs
@@ -4,6 +4,7 @@
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.TextEditController;
using DevExpress.XtraLayout;
using DevExpress.XtraRichEdit.Model;
using DevExpress.XtraTab;
using DevExpress.XtraTab.ViewInfo;
using Gs.DevApp.DevFrm.User;
@@ -100,12 +101,17 @@
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            };
            #region 加上底部提醒
            tab.SelectedPageChanged += (s, e) => {
                string _strForm = e.Page.Tag != null ? e.Page.Tag.ToString() : "未知";
                toolForm.Text = ("窗体:" + _strForm);
            };
            string _webApiUrl = ConfigurationManager.AppSettings["WebApiUrl"];
            string _autoUpdate = (ConfigurationManager.AppSettings["IsAutoUpdater"]);
            string _version = ConfigurationManager.AppSettings["Version"];
            toolVersion.Text = "当前版本:" + _version + ",服务Api:" + _webApiUrl;
            string _strFont = Gs.DevApp.Properties.Settings.Default.fontSizeName;
            toolFont.Text = (",字体:" + _strFont);
            #endregion
        }
        /// <summary>
@@ -225,6 +231,7 @@
                        _grp.Style = ElementStyle.Group;
                        _grp.Text = _dy["name"].ToString();
                        _grp.Tag = _dy["formPath"].ToString(); //存路径,类名
                        _grp.AccessibleDescription = _dy["layoutVersion"].ToString();//版面
                        _grp.Click += _grp_Click;
                        if (gdx == 0)
                            _grp.Expanded = true;
@@ -242,6 +249,7 @@
                            _itm.Text = _dy2["name"].ToString();
                            wdf.SetCaption("加载进度:" + _dy2["name"].ToString());
                            _itm.Tag = _dy2["formPath"].ToString(); //存路径,类名
                            _itm.AccessibleDescription = _dy2["layoutVersion"].ToString();//版面
                            _itm.Click += _grp_Click;
                            _grp.Elements.Add(_itm);
                            if (idx == 0 && tab.TabPages.Count <= 0)
@@ -250,8 +258,11 @@
                                var tabText = _itm.Text; //当前选项卡页Text标题
                                var newFormName = _itm.Tag.ToString(); //存路径,类名
                                var imgIcon = _itm.Image;
                                var layoutVersion = _itm.AccessibleDescription;
                                AddTabpage(tab, tabPageName, tabText,
                                    newFormName, imgIcon);
                                    newFormName, imgIcon,"", layoutVersion);
                                //第0个,不会触发事件,手动设置
                                toolForm.Text = ("窗体:" + newFormName+ ",版面:" + layoutVersion);
                            }
                            idx++;
                        }
@@ -268,7 +279,6 @@
            }
            catch (Exception ex)
            {
                MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
@@ -286,7 +296,8 @@
            var tabText = _acd.Text;
            var newFormName = _acd.Tag.ToString();
            var imgIcon = _acd.Image;
            AddTabpage(tab, tabPageName, tabText, newFormName, imgIcon);
            string _strLayout = _acd.AccessibleDescription;
            AddTabpage(tab, tabPageName, tabText, newFormName, imgIcon, "", _strLayout);
        }
        /// <summary>
@@ -311,7 +322,7 @@
        /// <param name="imgIcon">当前选项卡中的新窗体路径,类名</param>
        /// <param name="InitializeVal">初始值,用于子窗体中调用父窗体的值</param>
        public void AddTabpage(XtraTabControl tabControl, string tabPageName,
            string tabText, string newFormName, Image imgIcon, string InitializeVal = "")
            string tabText, string newFormName, Image imgIcon, string InitializeVal = "", string strLayout = "")
        {
            if (IsTabpageExsit(tabControl, tabPageName)) return;
            var newPage = new XtraTabPage();
@@ -320,6 +331,7 @@
            newPage.Tooltip = newPage.Name;
            newPage.Appearance.Header.Font = tab.Appearance.Font;
            newPage.ImageOptions.Image = imgIcon;
            newPage.Tag = newFormName + ",版面:" + strLayout;
            var fm = AddNewForm(newFormName, InitializeVal);
            if (fm != null)
            {
@@ -405,30 +417,6 @@
                newForm.Dock = DockStyle.Fill;
                newForm.Visible = true;
                shiXian(newForm, formName, InitializeVal);
                #region 加上底部提醒
                string _strFont = Gs.DevApp.Properties.Settings.Default.fontSizeName;
                string _ver = "";
                var _obj = new
                {
                    formPath = formName,
                };
                try
                {
                    string strJson = UtilityHelper.HttpPost("", "Fm/GetModelByVersion", JsonConvert.SerializeObject(_obj));
                    ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        _ver = _rtn.rtnData;
                    }
                    else
                        _ver = _rtn.rtnMsg;
                }
                catch (Exception ex)
                {
                    _ver = ex.Message;
                }
                toolFont.Text = (",字体:" + _strFont + ",窗体:" + formName + ",版面:" + _ver);
                #endregion
                return newForm;
            }
            catch (Exception)