SVN r940
SVN-Revision: r940
This commit is contained in:
@@ -147,7 +147,7 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 页签名(判断是否有重复的左右结构)
|
||||
/// </summary>
|
||||
public string DetaiName = string.Empty;
|
||||
public string DetaiName = string.Empty;
|
||||
public TabControlEx()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -510,6 +510,465 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:绑定选项卡</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2018-01-09</para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
public void InitTabPagesOld(List<GridDetailModel> gridDetail, bool isGridmerge = true, bool isAddPages = false)
|
||||
{
|
||||
this._gridDetail = gridDetail;
|
||||
if (!isAddPages)
|
||||
{
|
||||
this.xtc_container.TabPages.Clear();
|
||||
}
|
||||
string DetaiName = string.Empty;
|
||||
|
||||
Dictionary<object, Hashtable> dataCaches = Model != null ? Model.DataCaches : null;
|
||||
|
||||
foreach (GridDetailModel model in this._gridDetail)
|
||||
{
|
||||
object control = PageControlsDic.ContainsKey(model) ? PageControlsDic[model] : null;
|
||||
bool hasControl = control != null;
|
||||
if (DetaiName.Equals(model.DetailName) && isGridmerge) continue;
|
||||
GridDetailModel[] isMeage = gridDetail.Cast<GridDetailModel>().Where(x => x.DetailName.Equals(model.DetailName)).ToArray();
|
||||
XtraTabPage page = new XtraTabPage();
|
||||
page.SizeChanged += OnPageSizeChanged;
|
||||
page.Text = model.DetailName;
|
||||
|
||||
if (SystemInfo.Instance.GridRowFontSize > 0)
|
||||
{
|
||||
//页签大小
|
||||
FontFamily fontFamily = page.Appearance.Header.Font.FontFamily;
|
||||
page.Appearance.Header.Font = new System.Drawing.Font(fontFamily, SystemInfo.Instance.GridRowFontSize);
|
||||
}
|
||||
|
||||
if (model.IsChart)
|
||||
{
|
||||
ChartControlEx chartEx = hasControl && control is ChartControlEx ? (ChartControlEx)control : new ChartControlEx();
|
||||
chartEx.Dock = DockStyle.Fill;
|
||||
chartEx.transverseHistogram = model.transverseHistogram;
|
||||
//chartEx.SetCharts(BaseModuleImpl.GetChartParams(model.FormKey));
|
||||
//chartEx.SetChartRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
|
||||
if (!dataCaches.GetValue(chartEx, "ChartParams", out DataTable dtChartParams))
|
||||
{
|
||||
dtChartParams = BaseModuleImpl.GetChartParams(model.FormKey);
|
||||
}
|
||||
if (!dataCaches.GetValue(chartEx, "ChartRightMenus", out DataTable dtBaseGridRightMenus))
|
||||
{
|
||||
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus(model.FormKey);
|
||||
}
|
||||
chartEx.SetCharts(dtChartParams);
|
||||
chartEx.SetChartRightMenus(dtBaseGridRightMenus, this.Model, OnGridViewRightCallBack);
|
||||
chartEx.Tag = model;
|
||||
page.Tag = chartEx;
|
||||
page.Controls.Add(chartEx);
|
||||
}
|
||||
else if (model.IsExcel)
|
||||
{
|
||||
ExcelControlEx excelEx = hasControl && control is ExcelControlEx ? (ExcelControlEx)control : new ExcelControlEx();
|
||||
excelEx.Dock = DockStyle.Fill;
|
||||
excelEx.Tag = model;
|
||||
page.Tag = excelEx;
|
||||
page.Controls.Add(excelEx);
|
||||
}
|
||||
else if (model.IsWebView)
|
||||
{
|
||||
// 加载网页
|
||||
string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
//url= System.Web.HttpUtility.UrlEncode(url);
|
||||
if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
{
|
||||
FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
webView.IsDownVerify = true;
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmWebBrowser webView = hasControl && control is FrmWebBrowser ? (FrmWebBrowser)control : new FrmWebBrowser();
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
}
|
||||
else if (model.IsWebView2)
|
||||
{
|
||||
// 加载网页
|
||||
string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
//url= System.Web.HttpUtility.UrlEncode(url);
|
||||
if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
{
|
||||
FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmWebBrowser2 webView = hasControl && control is FrmWebBrowser2 ? (FrmWebBrowser2)control : new FrmWebBrowser2();
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
}
|
||||
else if (model.IsWebView3)
|
||||
{
|
||||
// 加载网页
|
||||
string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
//url= System.Web.HttpUtility.UrlEncode(url);
|
||||
if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
{
|
||||
FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
webView.AllowDownload = false;
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmWebBrowser2 webView = hasControl && control is FrmWebBrowser2 ? (FrmWebBrowser2)control : new FrmWebBrowser2();
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
webView.AllowDownload = false;
|
||||
page.Tag = webView;
|
||||
page.Controls.Add(webView);
|
||||
webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
}
|
||||
}
|
||||
else if (model.IsAddPanel && isGridmerge)
|
||||
{
|
||||
// 加载添加界面
|
||||
ModulePanelEx modulePanel = hasControl && control is ModulePanelEx ? (ModulePanelEx)control : new ModulePanelEx();
|
||||
modulePanel.Dock = DockStyle.Fill;
|
||||
|
||||
if (!dataCaches.GetValue(modulePanel, "BasePrimaryKey", out string primaryKey))
|
||||
{
|
||||
primaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
|
||||
}
|
||||
modulePanel.PrimaryKey = primaryKey;
|
||||
if (!dataCaches.GetValue(modulePanel, "SystemDllRow", out DataRow systemRow))
|
||||
{
|
||||
systemRow = MainImpl.GetSystemdllTab(this.Model.ModuleCode);
|
||||
}
|
||||
modulePanel.InitializeControl(new ModuleModel(systemRow), this.Model);
|
||||
//modulePanel.OnAddRecordCallBack += new EventHandler(OnAddRecordCallBack);
|
||||
//modulePanel.OnCloseCallback += new EventHandler(OnAddRecordCallBack);
|
||||
modulePanel.OperatePanelControlObj.Visible = false;
|
||||
modulePanel.SpeciesPanelControlObj.Visible = false;
|
||||
modulePanel.Tag = model;
|
||||
page.Tag = modulePanel;
|
||||
page.Controls.Add(modulePanel);
|
||||
}
|
||||
else if (model.IsDetailView)
|
||||
{
|
||||
ModuleGridDetailEx DetailEx = hasControl && control is ModuleGridDetailEx ? (ModuleGridDetailEx)control : new ModuleGridDetailEx();
|
||||
DetailEx.Dock = DockStyle.Fill;
|
||||
if (!dataCaches.GetValue(DetailEx, "DynamicModel", out DynamicModel dyncModel))
|
||||
{
|
||||
dyncModel = new DynamicModuleModel(new string[] { model.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, model.UnionModule, "0" });
|
||||
}
|
||||
if (!dataCaches.GetValue(DetailEx, "SystemDllRow", out DataRow moduleInformation))
|
||||
{
|
||||
moduleInformation = MainImpl.GetSystemdllTab(model.UnionModule);
|
||||
}
|
||||
if (moduleInformation == null)
|
||||
{
|
||||
MessageUtil.Show("没有找到编号为" + model.UnionModule + "的模块信息");
|
||||
return;
|
||||
}
|
||||
if (!dataCaches.GetValue(DetailEx, "SysModel", out model.SystemModel))
|
||||
{
|
||||
model.SystemModel = new ModuleModel(moduleInformation);
|
||||
}
|
||||
if (!dataCaches.GetValue(DetailEx, "Details", out List<GridDetailModel> details))
|
||||
{
|
||||
details = GetDetails(model.SystemModel.ModeCode);//底部多标签表格数据
|
||||
}
|
||||
|
||||
DetailEx.GridDetailList = details;
|
||||
DetailEx.IsDragDetail = IsDragDetail;
|
||||
DetailEx.TcButtom.OnDetailViewDoubleClickCallBack += OnDetailGridViewDoubleClick;
|
||||
DetailEx.TcButtom.OnDragCompleteCallback += OnDragGridCompleted;
|
||||
DetailEx.InitializeControl(model.SystemModel, dyncModel);//初始化控件
|
||||
if (!Model.DataCaches.GetValue(DetailEx, "BaseGridRightMenus", out DataTable rightDt))
|
||||
{
|
||||
rightDt = rightDt = BaseModuleImpl.GetBaseGridRightMenus(model.UnionModule, ModuleType.MrpClickBtn);
|
||||
}
|
||||
if ((rightDt != null && rightDt.Rows.Count > 0) || this.isMrpDetail)
|
||||
{
|
||||
this.isMrpDetail = true;
|
||||
//gridEx.VisibleMrpSearchPanel = true;
|
||||
}
|
||||
if (IsDragDetail && this.ParentGridEx != null && model.IsDrag)
|
||||
{
|
||||
// 拖拽模式,绑定拖拽对象
|
||||
//GridDragGrid dragGrid = new GridDragGrid(DetailEx.ModuleGridObj.GridControlObj.GridView, this.ParentGridEx.GridView);
|
||||
//dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
}
|
||||
if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, DetailEx.ModuleGridObj.GridControlObj.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, DetailEx.ModuleGridObj.GridControlObj.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (this.isMrpDetail && this.OnMrpBtnClickCallback != null)//当前为mrp模块
|
||||
{
|
||||
DetailEx.ModuleGridObj.RightGridCallBack += this.OnMrpBtnClickCallback;
|
||||
}
|
||||
if (model.MrpConditionTab)
|
||||
{
|
||||
this.ReplaceControlEx = DetailEx.ModuleGridObj.GridControlObj;
|
||||
}
|
||||
DetailEx.ModuleGridObj.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
DetailEx.ModuleGridObj.GridControlObj.Tag = model;
|
||||
page.Tag = DetailEx.ModuleGridObj.GridControlObj;
|
||||
page.Controls.Add(DetailEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.IsReadOnly && isMeage.Count() == 1)
|
||||
{
|
||||
PanelControl plBottom = new PanelControl();
|
||||
plBottom.Dock = DockStyle.Bottom;
|
||||
plBottom.Visible = false;
|
||||
PanelControl plMain = new PanelControl();
|
||||
plMain.Dock = DockStyle.Fill;
|
||||
GridControlEx gridEx = null;
|
||||
if (model.AutoMultiHeader == 1)
|
||||
{
|
||||
gridEx = hasControl && control is BandedGridControlEx ? (BandedGridControlEx)control : new BandedGridControlEx();
|
||||
}
|
||||
else
|
||||
{
|
||||
gridEx = hasControl && control is GridControlEx ? (GridControlEx)control : new GridControlEx();
|
||||
}
|
||||
gridEx.Dock = DockStyle.Fill;
|
||||
gridEx.Tag = model;
|
||||
gridEx.Parent = plMain;
|
||||
gridEx.Model = this.Model;
|
||||
if (!dataCaches.GetValue(model, "GridColumns", out DataTable dtGridColumns))
|
||||
{
|
||||
dtGridColumns = model.GridColumns;
|
||||
}
|
||||
gridEx.SetReadOnlyColumns(dtGridColumns, model.GridCustomColumnKey);
|
||||
//gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
|
||||
//gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(model.FormKey));
|
||||
if (!dataCaches.GetValue(gridEx, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
|
||||
{
|
||||
dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus(model.FormKey);
|
||||
}
|
||||
if (!dataCaches.GetValue(gridEx, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
|
||||
{
|
||||
dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors(model.FormKey);
|
||||
}
|
||||
gridEx.SetGridRightMenus(dtBaseGridRightMenus, this.Model, OnGridViewRightCallBack);
|
||||
gridEx.SetGridRowColors(dtBaseGridRowColors);
|
||||
|
||||
if (model.IsCheck == 1)//加载复选框
|
||||
{
|
||||
GridDragGrid.GridAddCheckBox(gridEx.GridView);
|
||||
}
|
||||
if (model.LoadFilter)//加载筛选行
|
||||
{
|
||||
gridEx.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
}
|
||||
if (IsDragDetail && this.ParentGridEx != null && model.IsDrag)
|
||||
{
|
||||
// 拖拽模式,绑定拖拽对象
|
||||
GridDragGrid dragGrid = new GridDragGrid(gridEx.GridView, this.ParentGridEx.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
}
|
||||
if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, gridEx.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, gridEx.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (model.MrpConditionTab)
|
||||
{
|
||||
this.ReplaceControlEx = gridEx;
|
||||
}
|
||||
// 加载配置查询条件
|
||||
if (Model != null && Model.IsDetailSearch)
|
||||
{
|
||||
plBottom.Visible = true;
|
||||
MyControl searchObj = new MyControl(model.DetailSql, gridEx);
|
||||
if (!dataCaches.GetValue(gridEx, "CustomQueryFields", out DataTable dtCustomQueryFields))
|
||||
{
|
||||
dtCustomQueryFields = BaseModuleImpl.GetCustomQueryFields(model.FormKey);
|
||||
}
|
||||
plBottom.Height = searchObj.InitSearchControl(dtCustomQueryFields, plBottom);
|
||||
}
|
||||
page.Tag = gridEx;
|
||||
page.Controls.AddRange(new PanelControl[] { plBottom, plMain });
|
||||
}
|
||||
else if (isMeage.Count() > 1 && isGridmerge)
|
||||
{
|
||||
DetaiName = model.DetailName;
|
||||
TabMultipledetails tabMultipledetails = hasControl && control is TabMultipledetails ? (TabMultipledetails)control : new TabMultipledetails();
|
||||
tabMultipledetails.Model = this.Model;
|
||||
tabMultipledetails.ParentGridEx = this.ParentGridEx;
|
||||
tabMultipledetails.ParentControlEx = this.ParentControlEx;
|
||||
tabMultipledetails.IsDragDetail = this.IsDragDetail;
|
||||
tabMultipledetails.Model = this.Model;
|
||||
tabMultipledetails.DrgaParentPrimaryKey = this.DrgaParentPrimaryKey;
|
||||
tabMultipledetails.InitTabPages(isMeage);
|
||||
tabMultipledetails.Dock = DockStyle.Fill;
|
||||
tabMultipledetails.Tag = model;
|
||||
page.Tag = tabMultipledetails;
|
||||
page.Controls.Add(tabMultipledetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
ModuleGridEx gridEx = hasControl && control is ModuleGridEx ? (ModuleGridEx)control : new ModuleGridEx();
|
||||
if (!dataCaches.GetValue(gridEx, "DynamicModel", out DynamicModel dyncModel))
|
||||
{
|
||||
dyncModel = new DynamicModuleModel(new string[] { model.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, model.UnionModule, "0" });
|
||||
}
|
||||
if (!dataCaches.GetValue(gridEx, "SystemDllRow", out DataRow moduleInformation))
|
||||
{
|
||||
moduleInformation = MainImpl.GetSystemdllTab(model.UnionModule);
|
||||
}
|
||||
if (moduleInformation == null)
|
||||
{
|
||||
MessageUtil.Show("没有找到编号为" + model.UnionModule + "的模块信息");
|
||||
return;
|
||||
}
|
||||
if (!dataCaches.GetValue(gridEx, "SysModel", out model.SystemModel))
|
||||
{
|
||||
model.SystemModel = new ModuleModel(moduleInformation);
|
||||
}
|
||||
|
||||
|
||||
if (Model != null)
|
||||
{
|
||||
if (!dataCaches.GetValue(gridEx, "ParentPrimaryKey", out string primaryKey))
|
||||
{
|
||||
primaryKey = BaseImpl.GetBasePrimaryKey(Model.ModuleCode);
|
||||
}
|
||||
model.SystemModel.ParmaryKey = primaryKey;
|
||||
}
|
||||
gridEx.OnSaveGridCallBack += OnDetailSaveGridCallBack;
|
||||
gridEx.DetailRightGridCallBack += OnDetailRightCallback;
|
||||
|
||||
gridEx.Name = "gridEx";
|
||||
gridEx.IsDetail = true;
|
||||
gridEx.Dock = DockStyle.Fill;
|
||||
gridEx.OperShortMode = Model.IsDetailSearch; // 不显示简短模式
|
||||
gridEx.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
|
||||
if (!dataCaches.GetValue(gridEx, "UnionBaseGridRightMenus", out DataTable rightDt))
|
||||
{
|
||||
rightDt = BaseModuleImpl.GetBaseGridRightMenus(model.UnionModule, ModuleType.MrpClickBtn);
|
||||
}
|
||||
if ((rightDt != null && rightDt.Rows.Count > 0) || this.isMrpDetail)
|
||||
{
|
||||
this.isMrpDetail = true;
|
||||
gridEx.VisibleMrpSearchPanel = true;
|
||||
}
|
||||
gridEx.VisibleOperPanel = !model.IsReadOnly;
|
||||
gridEx.InitializeControl(model.SystemModel, dyncModel);
|
||||
gridEx.GridControlObj.Tag = model;
|
||||
gridEx.ParentControlEx = this.ParentControlEx;
|
||||
gridEx.ParentGridEx = this.ParentGridEx;
|
||||
gridEx.ParentKeyField = string.IsNullOrEmpty(model.UnionParentField) ? model.SystemModel.ParmaryKey : model.UnionParentField;
|
||||
gridEx.DetailKeyField = model.UnionValue;
|
||||
gridEx.GridControlObj.ParentControl = gridEx.SearchObj;
|
||||
if (model.IsCheck == 1)//加载复选框
|
||||
{
|
||||
GridDragGrid.GridAddCheckBox(gridEx.GridControlObj.GridView);
|
||||
|
||||
//判断父表格是否是复选框
|
||||
if (model.RecordDetailsCheckbox && ParentGridEx != null && ParentGridEx.GridView.OptionsSelection.MultiSelect == true)
|
||||
{
|
||||
gridEx.TagName = model.DetailName;
|
||||
gridEx.GridControlObj.GridView.SelectionChanged += GridView_SelectionChanged;
|
||||
}
|
||||
}
|
||||
if (model.LoadFilter)//加载筛选行
|
||||
{
|
||||
gridEx.GridControlObj.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
}
|
||||
if (this.ParentGridEx != null && model.IsDrag)//IsDragDetail &&
|
||||
{
|
||||
gridEx.GridControlObj.GridView.DoubleClick += OnDetailGridViewDoubleClick;
|
||||
// 拖拽模式,绑定拖拽对象
|
||||
if (model.IsDrag)
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(gridEx.GridControlObj.GridView, this.ParentGridEx.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
}
|
||||
}
|
||||
if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, gridEx.GridControlObj.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
{
|
||||
GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, gridEx.GridControlObj.GridView);
|
||||
dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
}
|
||||
if (this.isMrpDetail && this.OnMrpBtnClickCallback != null)//当前为mrp模块
|
||||
{
|
||||
gridEx.RightGridCallBack += this.OnMrpBtnClickCallback;
|
||||
}
|
||||
if (model.MrpConditionTab)
|
||||
{
|
||||
this.ReplaceControlEx = gridEx.GridControlObj;
|
||||
}
|
||||
if (model.AutoRefresh && !_UnRefresh && isGridmerge)
|
||||
gridEx.SearchObj.SearchGrid();
|
||||
page.Tag = gridEx.GridControlObj;
|
||||
page.Controls.Add(gridEx);
|
||||
}
|
||||
}
|
||||
this.xtc_container.TabPages.Add(page);
|
||||
DetailTabPageModel detailTabPageModel = new DetailTabPageModel();
|
||||
detailTabPageModel.TabPageIndex = this._gridDetail.IndexOf(model);
|
||||
detailTabPageModel.DetailTabPage = page;
|
||||
detailTabPageModel.DetailModel = model;
|
||||
if (!string.IsNullOrEmpty(model.ParentModuleCode))
|
||||
{
|
||||
string ParentModuleCode = model.ParentModuleCode.ToLower();
|
||||
if (this.DetailTabPagesDic.ContainsKey(ParentModuleCode))
|
||||
{
|
||||
List<DetailTabPageModel> detailTabPageModels = this.DetailTabPagesDic[ParentModuleCode];
|
||||
detailTabPageModels.Add(detailTabPageModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<DetailTabPageModel> detailTabPageModels = new List<DetailTabPageModel>();
|
||||
detailTabPageModels.Add(detailTabPageModel);
|
||||
this.DetailTabPagesDic.Add(ParentModuleCode, detailTabPageModels);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:并行分割条位置变化事件</para>
|
||||
/// <para>创建人:王一帆</para>
|
||||
/// <para>创建日期:2020-08-24</para>
|
||||
@@ -574,7 +1033,7 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/* ───── 2. Excel ──────────────────────────────────────── */
|
||||
if (model.IsExcel)
|
||||
else if (model.IsExcel)
|
||||
{
|
||||
ExcelControlEx excelEx = hasControl && control is ExcelControlEx
|
||||
? (ExcelControlEx)control
|
||||
@@ -585,7 +1044,7 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/* ───── 3. WebView 系列 ───────────────────────────────── */
|
||||
if (model.IsWebView || model.IsWebView2 || model.IsWebView3)
|
||||
else if (model.IsWebView || model.IsWebView2 || model.IsWebView3)
|
||||
{
|
||||
string url = model.DetailSql.StartsWith("http")
|
||||
? model.DetailSql
|
||||
@@ -634,7 +1093,7 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/* ───── AddPanel ───────────────────────────────────── */
|
||||
if (model.IsSched)
|
||||
else if (model.IsSched)
|
||||
{
|
||||
DynamicFrmProductSchedModel mainModel = new DynamicFrmProductSchedModel(new string[]
|
||||
{
|
||||
@@ -661,7 +1120,7 @@ namespace Lskj.Control
|
||||
|
||||
|
||||
/* ───── 4. AddPanel ───────────────────────────────────── */
|
||||
if (model.IsAddPanel && isGridmerge)
|
||||
else if (model.IsAddPanel && isGridmerge)
|
||||
{
|
||||
ModulePanelEx modulePanel = hasControl && control is ModulePanelEx
|
||||
? (ModulePanelEx)control
|
||||
@@ -683,7 +1142,7 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
/* ───── 5. DetailView ─────────────────────────────────── */
|
||||
if (model.IsDetailView)
|
||||
else if (model.IsDetailView)
|
||||
{
|
||||
ModuleGridDetailEx detailEx = hasControl && control is ModuleGridDetailEx
|
||||
? (ModuleGridDetailEx)control
|
||||
@@ -737,11 +1196,12 @@ namespace Lskj.Control
|
||||
if (model.MrpConditionTab) ReplaceControlEx = detailEx.ModuleGridObj.GridControlObj;
|
||||
detailEx.ModuleGridObj.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
detailEx.ModuleGridObj.GridControlObj.Tag = model;
|
||||
return detailEx;
|
||||
//return detailEx;
|
||||
return detailEx.ModuleGridObj.GridControlObj;
|
||||
}
|
||||
|
||||
/* ───── 6. 只读网格(单明细) ───────────────────────────── */
|
||||
if (model.IsReadOnly && isGridmerge)
|
||||
else if (model.IsReadOnly && isMeage.Count() == 1)
|
||||
{
|
||||
// 外层容器
|
||||
Panel parent = new Panel { Dock = DockStyle.Fill };
|
||||
@@ -811,9 +1271,8 @@ namespace Lskj.Control
|
||||
|
||||
plMain.Controls.Add(gridEx);
|
||||
parent.Controls.Add(plMain);
|
||||
parent.Tag = model;
|
||||
parent.Controls.Add(plBottom);
|
||||
return parent;
|
||||
return gridEx;
|
||||
}
|
||||
else if (isMeage.Count() > 1 && isGridmerge)
|
||||
{
|
||||
@@ -831,6 +1290,7 @@ namespace Lskj.Control
|
||||
return tabMultipledetails;
|
||||
}
|
||||
/* ───── 7. 普通 ModuleGridEx 明细 ──────────────────────── */
|
||||
else
|
||||
{
|
||||
ModuleGridEx gridEx = hasControl && control is ModuleGridEx
|
||||
? (ModuleGridEx)control
|
||||
@@ -891,7 +1351,7 @@ namespace Lskj.Control
|
||||
{
|
||||
gridEx.GridControlObj.CustomGroupBandEx.BandedView.LeftCoordChanged += OnBandedViewLeftCoordChanged;
|
||||
}
|
||||
gridEx.Tag = model;
|
||||
//gridEx.Tag = model;
|
||||
if (model.IsCheck == 1)
|
||||
{
|
||||
GridDragGrid.GridAddCheckBox(gridEx.GridControlObj.GridView);
|
||||
@@ -928,7 +1388,8 @@ namespace Lskj.Control
|
||||
if (model.AutoRefresh && !_UnRefresh && isGridmerge)
|
||||
gridEx.SearchObj.SearchGrid();
|
||||
|
||||
return gridEx;
|
||||
//return gridEx;
|
||||
return gridEx.GridControlObj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user