feat: 完善个人设置及表格功能
This commit is contained in:
@@ -184,8 +184,8 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 外部设置的右键菜单数据,用于创建每行操作列。
|
||||
/// </summary>
|
||||
private DataTable rightMenuButtonTable;
|
||||
private bool gridColumnsInitialized;
|
||||
protected DataTable rightMenuButtonTable;
|
||||
protected bool gridColumnsInitialized;
|
||||
|
||||
/// <summary>
|
||||
/// 新版模块选择框缓存。同一关联模块的单选和多选界面分别复用。
|
||||
@@ -5649,8 +5649,8 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
internal void SetRightMenuButtonTable(DataTable table)
|
||||
{
|
||||
// 树表格和多表头表格原来不在此处创建操作列,维持原有行为。
|
||||
if (this is TreeGridControlEx || this is BandedGridControlEx)
|
||||
// 树表格仍由原有逻辑处理,不创建操作列。
|
||||
if (this is TreeGridControlEx)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -5659,7 +5659,7 @@ namespace Lskj.Control
|
||||
this.TryInitRightMenuBtnEdit(true);
|
||||
}
|
||||
|
||||
private void TryInitRightMenuBtnEdit(bool rebuild)
|
||||
protected virtual void TryInitRightMenuBtnEdit(bool rebuild)
|
||||
{
|
||||
if (!this.gridColumnsInitialized || this.Model == null ||
|
||||
this.CustomColumKey.Contains("BaseLeftGridView_"))
|
||||
@@ -5689,7 +5689,7 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
|
||||
private void InitRightMenuBtnEdit(DataTable rightMenuTab)
|
||||
protected virtual void InitRightMenuBtnEdit(DataTable rightMenuTab)
|
||||
{
|
||||
GridColumn gridColumn = new GridColumn();
|
||||
gridColumn.FieldName = "RightMenuBtnEdit";
|
||||
@@ -9771,7 +9771,7 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnItemButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
|
||||
protected void OnItemButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
|
||||
{
|
||||
EditorButton editorButton = e.Button as EditorButton;
|
||||
GridRightMenuModel menuModel = editorButton.Tag as GridRightMenuModel;
|
||||
@@ -9779,8 +9779,8 @@ namespace Lskj.Control
|
||||
if (toolStripMenuItem != null)
|
||||
{
|
||||
bool allowClick = true;
|
||||
int[] mSelectRows = this.gridView.GetSelectedRows();
|
||||
DataRow mSelectRow = this.gridView.GetDataRow(mSelectRows[0]);
|
||||
int[] mSelectRows = this.GridView.GetSelectedRows();
|
||||
DataRow mSelectRow = this.GridView.GetDataRow(mSelectRows[0]);
|
||||
if (menuModel != null)
|
||||
{
|
||||
if (menuModel.PrivilegeOper.Length > 1 && !menuModel.PrivilegeOper.Contains(ERPInfo.Instance.UserName + ","))
|
||||
@@ -9797,13 +9797,13 @@ namespace Lskj.Control
|
||||
if (this.gridViewRightMenu.ControlObj != null)
|
||||
cond = this.gridViewRightMenu.ControlObj.ReplaceParentControlValue(menuModel.MenuCond);
|
||||
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, menuModel.MenuCond);
|
||||
if (this.gridView != null)
|
||||
if (this.GridView != null)
|
||||
{
|
||||
GridCell[] cells = this.gridView.GetSelectedCells();
|
||||
GridCell[] cells = this.GridView.GetSelectedCells();
|
||||
if (cells != null && cells.Length > 0 && cond.Contains("{COLUMN_"))
|
||||
{
|
||||
GridCell cell = cells[0];
|
||||
DataRow focusedRow = this.gridView.GetFocusedDataRow();
|
||||
DataRow focusedRow = this.GridView.GetFocusedDataRow();
|
||||
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
|
||||
cond = cond.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
|
||||
}
|
||||
@@ -11113,7 +11113,7 @@ namespace Lskj.Control
|
||||
return Math.Max(textWidth + padding, 40);
|
||||
}
|
||||
|
||||
private Image GetRightMenuButtonImage(string imageName)
|
||||
protected Image GetRightMenuButtonImage(string imageName)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(imageName))
|
||||
{
|
||||
@@ -11177,7 +11177,7 @@ namespace Lskj.Control
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void GridView_MouseDown(object sender, MouseEventArgs e)
|
||||
protected void GridView_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button != MouseButtons.Left) return;
|
||||
|
||||
@@ -11190,7 +11190,7 @@ namespace Lskj.Control
|
||||
RepositoryItemButtonEdit repo = hitInfo.Column.ColumnEdit as RepositoryItemButtonEdit;
|
||||
if (!hitInfo.Column.FieldName.Equals("RightMenuBtnEdit")) return;
|
||||
int rowHandle = hitInfo.RowHandle;
|
||||
this.gridView.SelectRowHandler(rowHandle);
|
||||
view.SelectRowHandler(rowHandle);
|
||||
int buttonIndex = this.GetClickedButtonIndex(repo, view, rowHandle, hitInfo.Column, e.Location, hitInfo.Column.Width);
|
||||
|
||||
if (buttonIndex != -1)
|
||||
@@ -11207,7 +11207,7 @@ namespace Lskj.Control
|
||||
/// 执行点击的右键按钮
|
||||
/// </summary>
|
||||
/// <param name="editorButton"></param>
|
||||
private void RightButtonClick(EditorButton editorButton)
|
||||
protected void RightButtonClick(EditorButton editorButton)
|
||||
{
|
||||
|
||||
GridRightMenuModel menuModel = editorButton.Tag as GridRightMenuModel;
|
||||
@@ -11215,8 +11215,8 @@ namespace Lskj.Control
|
||||
if (toolStripMenuItem != null)
|
||||
{
|
||||
bool allowClick = true;
|
||||
int[] mSelectRows = this.gridView.GetSelectedRows();
|
||||
DataRow mSelectRow = this.gridView.GetDataRow(mSelectRows[0]);
|
||||
int[] mSelectRows = this.GridView.GetSelectedRows();
|
||||
DataRow mSelectRow = this.GridView.GetDataRow(mSelectRows[0]);
|
||||
if (menuModel != null)
|
||||
{
|
||||
if (menuModel.PrivilegeOper.Length > 1 && !menuModel.PrivilegeOper.Contains(ERPInfo.Instance.UserName + ","))
|
||||
@@ -11233,13 +11233,13 @@ namespace Lskj.Control
|
||||
if (this.gridViewRightMenu.ControlObj != null)
|
||||
cond = this.gridViewRightMenu.ControlObj.ReplaceParentControlValue(menuModel.MenuCond);
|
||||
cond = ReplaceHelper.ReplaceRowParam(mSelectRow, menuModel.MenuCond);
|
||||
if (this.gridView != null)
|
||||
if (this.GridView != null)
|
||||
{
|
||||
GridCell[] cells = this.gridView.GetSelectedCells();
|
||||
GridCell[] cells = this.GridView.GetSelectedCells();
|
||||
if (cells != null && cells.Length > 0 && cond.Contains("{COLUMN_"))
|
||||
{
|
||||
GridCell cell = cells[0];
|
||||
DataRow focusedRow = this.gridView.GetFocusedDataRow();
|
||||
DataRow focusedRow = this.GridView.GetFocusedDataRow();
|
||||
string colValue = focusedRow == null || !focusedRow.Table.Columns.Contains(cell.Column.Name) ? "" : focusedRow[cell.Column.Name] + "";
|
||||
cond = cond.ReplaceColumnParam(cell.Column.Name, cell.Column.Caption, colValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user