/// <summary>
        /// 创建标准导出按钮
        /// </summary>
        /// <typeparam name="T">继承自TopBasePoco的类</typeparam>
        /// <typeparam name="V">继承自ISearcher的类</typeparam>
        /// <param name="self">self</param>
        /// <param name="gridid">vmGuid</param>
        /// <param name="MustSelect"></param>
        /// <param name="exportType">导出类型  默认null,支持所有导出</param>
        /// <param name="param">参数</param>
        /// <returns></returns>
        public static GridAction MakeStandardExportAction <T, V>(this IBasePagedListVM <T, V> self
                                                                 , string gridid         = null
                                                                 , bool MustSelect       = false
                                                                 , ExportEnum?exportType = null
                                                                 , params KeyValuePair <string, string>[] param)
            where T : TopBasePoco
            where V : ISearcher
        {
            exportType = ExportEnum.Excel;

            var action = new GridAction
            {
                Name           = "导出Excel",
                DialogTitle    = "导出Excel",
                Area           = string.Empty,
                ControllerName = "_Framework",
                ActionName     = "GetExportExcel",
                ParameterType  = GridActionParameterTypesEnum.MultiIdWithNull,

                IconCls       = "layui-icon-download-circle",
                ShowInRow     = false,
                ShowDialog    = false,
                HideOnToolBar = false
            };

            return(action);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 如果设定了SubActions,则代表需要用SplitButton的形式展示,主GridAction将不起作用
 /// </summary>
 /// <param name="self"></param>
 /// <param name="gridActions"></param>
 /// <returns></returns>
 public static GridAction SetSubAction(this GridAction self, params GridAction[] gridActions)
 {
     if (self.SubActions == null)
     {
         self.SubActions = new List <GridAction>();
     }
     self.SubActions.AddRange(gridActions);
     return(self);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 动作的Controller
 /// </summary>
 /// <param name="self"></param>
 /// <param name="controllerName"></param>
 /// <returns></returns>
 public static GridAction SetControllerName(this GridAction self, string controllerName)
 {
     self.ControllerName = controllerName;
     return(self);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 动作的Area
 /// </summary>
 /// <param name="self"></param>
 /// <param name="area"></param>
 /// <returns></returns>
 public static GridAction SetArea(this GridAction self, string area)
 {
     self.Area = area;
     return(self);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 动作图标css
 /// </summary>
 /// <param name="self"></param>
 /// <param name="iconCls"></param>
 /// <returns></returns>
 public static GridAction SetIconCls(this GridAction self, string iconCls)
 {
     self.IconCls = iconCls;
     return(self);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Set prompt message
 /// </summary>
 /// <param name="self"></param>
 /// <param name="msg"></param>
 /// <returns></returns>
 public static GridAction SetPromptMessage(this GridAction self, string msg)
 {
     self.PromptMessage = msg;
     return(self);
 }
 /// <summary>
 /// 是否在工具栏上隐藏按钮
 /// </summary>
 /// <param name="self"></param>
 /// <param name="hideOnToolBar"></param>
 /// <returns></returns>
 public static GridAction SetHideOnToolBar(this GridAction self, bool hideOnToolBar = true)
 {
     self.HideOnToolBar = hideOnToolBar;
     return(self);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Set the dialog to be maximized
 /// </summary>
 /// <param name="self"></param>
 /// <param name="Max"></param>
 /// <returns></returns>
 public static GridAction SetMax(this GridAction self, bool Max = true)
 {
     self.Max = Max;
     return(self);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 如果不为null,则只运行这个变量设定的script,其他的属性都不起作用
 /// </summary>
 /// <param name="self"></param>
 /// <param name="onClickScript"></param>
 /// <remarks>
 /// 如设置SetOnClickScript("test"),点击按钮时框架会调用页面上的javascript方法: function test(ids,datas){}
 /// ids是勾选的id数组,datas是勾选的所有字段数组
 /// </remarks>
 /// <returns></returns>
 public static GridAction SetOnClickScript(this GridAction self, string onClickScript)
 {
     self.OnClickFunc = onClickScript;
     return(self);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 动作类型
 /// </summary>
 /// <param name="self"></param>
 /// <param name="parameterType"></param>
 /// <returns></returns>
 public static GridAction SetParameterType(this GridAction self, GridActionParameterTypesEnum parameterType)
 {
     self.ParameterType = parameterType;
     return(self);
 }
Exemplo n.º 11
0
 /// <summary>
 /// 按钮Id,一般不需要设定,系统会自动生成唯一Id。如果设定请确保 Id 的唯一性
 /// </summary>
 /// <param name="self"></param>
 /// <param name="buttonId"></param>
 /// <returns></returns>
 public static GridAction SetButtonId(this GridAction self, string buttonId)
 {
     self.ButtonId = buttonId;
     return(self);
 }
Exemplo n.º 12
0
 /// <summary>
 /// 是否跳转到新页面
 /// </summary>
 /// <param name="self"></param>
 /// <param name="isRedirect"></param>
 /// <returns></returns>
 public static GridAction SetIsRedirect(this GridAction self, bool isRedirect = true)
 {
     self.IsRedirect = isRedirect;
     return(self);
 }
Exemplo n.º 13
0
 /// <summary>
 /// 是否需要弹出窗口
 /// </summary>
 /// <param name="self"></param>
 /// <param name="showDialog"></param>
 /// <returns></returns>
 public static GridAction SetShowDialog(this GridAction self, bool showDialog = true)
 {
     self.ShowDialog = showDialog;
     return(self);
 }
Exemplo n.º 14
0
 /// <summary>
 /// 弹出窗口的宽度、高度
 /// </summary>
 /// <param name="self"></param>
 /// <param name="dialogWidth"></param>
 /// <param name="dialogHeight"></param>
 /// <returns></returns>
 public static GridAction SetSize(this GridAction self, int?dialogWidth, int?dialogHeight)
 {
     self.DialogWidth  = dialogWidth;
     self.DialogHeight = dialogHeight;
     return(self);
 }
Exemplo n.º 15
0
 /// <summary>
 /// 动作的Action
 /// </summary>
 /// <param name="self"></param>
 /// <param name="actionName"></param>
 /// <returns></returns>
 public static GridAction SetActionName(this GridAction self, string actionName)
 {
     self.ActionName = actionName;
     return(self);
 }
Exemplo n.º 16
0
 /// <summary>
 /// 是否可以拖动改变弹出窗体大小
 /// </summary>
 /// <param name="self"></param>
 /// <param name="resizable"></param>
 /// <returns></returns>
 public static GridAction SetNotResizable(this GridAction self, bool resizable = false)
 {
     self.Resizable = resizable;
     return(self);
 }
Exemplo n.º 17
0
 /// <summary>
 /// 动作的QueryString
 /// </summary>
 /// <param name="self"></param>
 /// <param name="queryString"></param>
 /// <returns></returns>
 public static GridAction SetQueryString(this GridAction self, string queryString)
 {
     self.QueryString = queryString;
     return(self);
 }
Exemplo n.º 18
0
 /// <summary>
 /// 设置一个布尔值的列名,当改列值为true的时候才显示本行的这个动作按钮
 /// </summary>
 /// <param name="self"></param>
 /// <param name="colName"></param>
 /// <returns></returns>
 public static GridAction SetBindVisiableColName(this GridAction self, string colName)
 {
     self.BindVisiableColName = colName;
     return(self);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Set the dialog to be maximized
 /// </summary>
 /// <param name="self"></param>
 /// <param name="isDownload"></param>
 /// <returns></returns>
 public static GridAction SetIsDownload(this GridAction self, bool isDownload = true)
 {
     self.IsDownload = isDownload;
     return(self);
 }
Exemplo n.º 20
0
 /// <summary>
 /// 按钮名称
 /// </summary>
 /// <param name="self"></param>
 /// <param name="name"></param>
 /// <returns></returns>
 public static GridAction SetName(this GridAction self, string name)
 {
     self.Name = name;
     return(self);
 }
 /// <summary>
 /// 是否在每行都显示
 /// </summary>
 /// <param name="self"></param>
 /// <param name="showInRow"></param>
 /// <returns></returns>
 public static GridAction SetShowInRow(this GridAction self, bool showInRow = true)
 {
     self.ShowInRow = showInRow;
     return(self);
 }
Exemplo n.º 22
0
 /// <summary>
 /// 弹出窗口的标题
 /// </summary>
 /// <param name="self"></param>
 /// <param name="dialogTitle"></param>
 /// <returns></returns>
 public static GridAction SetDialogTitle(this GridAction self, string dialogTitle)
 {
     self.DialogTitle = dialogTitle;
     return(self);
 }
 /// <summary>
 /// 把按钮当作容器,添加按钮的子按钮
 /// </summary>
 /// <param name="self"></param>
 /// <param name="subActions">子按钮</param>
 /// <returns></returns>
 public static GridAction SetSubActions(this GridAction self, List <GridAction> subActions)
 {
     self.SubActions = subActions;
     return(self);
 }
Exemplo n.º 24
0
 /// <summary>
 /// Set the dialog to be maximized
 /// </summary>
 /// <param name="self"></param>
 /// <param name="buttonclass">button class.
 /// Some of the layui defined class to control color:
 /// layui-btn-primary
 /// layui-btn-normal
 /// layui-btn-warm
 /// layui-btn-danger
 /// </param>
 /// <returns></returns>
 public static GridAction SetButtonClass(this GridAction self, string buttonclass)
 {
     self.ButtonClass = buttonclass;
     return(self);
 }