Ejemplo n.º 1
0
        public JsonResult GetGroupList([FromForm]  WXQ.InOutPutEntites.Input.configmanager.Dict.GetDictListInput model)
        {
            ResponseResult result = new ResponseResult();

            GetDictListInputModelValidation validator = new GetDictListInputModelValidation();
            ValidationResult vr = validator.Validate(model);

            if (!vr.IsValid)
            {
                result.Code   = ResponseResultMessageDefine.ParaError;
                result.Errors = vr.Errors.Select(e => e.ErrorMessage).ToList();
            }
            else
            {
                WXQ.BusinessCore.CommonManager.DictOp op = new WXQ.BusinessCore.CommonManager.DictOp();

                SqlSugar.PageModel           pagemodel = TypeAdapter.Adapt <WXQ.InOutPutEntites.Input.PageInput, SqlSugar.PageModel>(model.Page);
                ListResult <WXQ.Enties.Dict> rv        = op.GetDictList("dictgroup", pagemodel);

                if (rv == null)
                {
                    result.Code = ResponseResultMessageDefine.OpLost;
                    result.Errors.Add(ResponseResultMessageDefine.OpLostMessage);
                }
                else
                {
                    result.Data = rv;
                }
            }

            return(Json(result));
        }
Ejemplo n.º 2
0
        public JsonResult DeleteDictByDictId([FromQuery]  int Id)
        {
            ResponseResult result = new ResponseResult();


            if (Id <= 0)
            {
                result.Code = ResponseResultMessageDefine.ParaError;
                result.Errors.Add("字典id错误");
            }
            else
            {
                int userId = WebApi.Common.HelpOp.UserOp.GetUserId(this.User);
                WXQ.BusinessCore.CommonManager.DictOp op = new WXQ.BusinessCore.CommonManager.DictOp(userId);

                bool rv = op.DeleteDictByDictId(Id);

                if (!rv)
                {
                    result.Code = ResponseResultMessageDefine.OpLost;
                    result.Errors.Add(ResponseResultMessageDefine.OpLostMessage);
                }
            }

            return(Json(result));
        }
Ejemplo n.º 3
0
        public JsonResult DeleteDictByGroupName([FromQuery]  string GroupName)
        {
            ResponseResult result = new ResponseResult();


            if (!string.IsNullOrEmpty(GroupName))
            {
                result.Code = ResponseResultMessageDefine.ParaError;
                result.Errors.Add("分组名不可为空");
            }
            else
            {
                int userId = WebApi.Common.HelpOp.UserOp.GetUserId(this.User);
                WXQ.BusinessCore.CommonManager.DictOp op = new WXQ.BusinessCore.CommonManager.DictOp(userId);

                bool rv = op.DeleteDictByGroupName(GroupName);

                if (!rv)
                {
                    result.Code = ResponseResultMessageDefine.OpLost;
                    result.Errors.Add(ResponseResultMessageDefine.OpLostMessage);
                }
            }

            return(Json(result));
        }
Ejemplo n.º 4
0
        public JsonResult UpdateDict([FromForm]  WXQ.InOutPutEntites.Input.configmanager.Dict.UpdateDictInput model)
        {
            ResponseResult result = new ResponseResult();

            UpdateDictInputModelValidation validator = new UpdateDictInputModelValidation();
            ValidationResult vr = validator.Validate(model);

            if (!vr.IsValid)
            {
                result.Code   = ResponseResultMessageDefine.ParaError;
                result.Errors = vr.Errors.Select(e => e.ErrorMessage).ToList();
            }
            else
            {
                int userId = WebApi.Common.HelpOp.UserOp.GetUserId(this.User);
                WXQ.BusinessCore.CommonManager.DictOp op = new WXQ.BusinessCore.CommonManager.DictOp(userId);

                WXQ.Enties.Dict r = new WXQ.Enties.Dict
                {
                    DictId         = model.DictId,
                    Description    = model.Description,
                    DictKey        = model.DictKey,
                    DictValue      = model.DictValue,
                    DictType       = model.DictType,
                    OrderBy        = model.OrderBy,
                    GroupName      = model.GroupName,
                    UpdateDateTime = DateTime.Now,
                    UpdateUser     = this.User.Identity.Name
                };

                bool rv = op.UpdateDict(r);

                if (!rv)
                {
                    result.Code = ResponseResultMessageDefine.OpLost;
                    result.Errors.Add(ResponseResultMessageDefine.OpLostMessage);
                }
            }

            return(Json(result));
        }
Ejemplo n.º 5
0
        public bool CreateFormElementEvent()
        {
            WXQ.BusinessCore.CommonManager.DictOp op = new WXQ.BusinessCore.CommonManager.DictOp(0);
            bool rv = true;

            #region input
            WXQ.Enties.Dict r = new WXQ.Enties.Dict
            {
                Description = "",
                DictKey     = "blur",
                DictValue   = "模糊",
                DictType    = "string",
                OrderBy     = 0,
                GroupName   = "hiddenevent",
                AddDateTime = DateTime.Now,
                AddUser     = "******"
            };

            rv          = rv && op.InsertDict(r);
            r.DictKey   = "focus";
            r.DictKey   = "获取焦点";
            r.GroupName = "hiddenevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "hiddenevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "clear";
            r.DictKey   = "清空";
            r.GroupName = "hiddenevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region InputNumber
            r.DictKey   = "focus";
            r.DictKey   = "获取焦点";
            r.GroupName = "InputNumberevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "blur";
            r.DictKey   = "模糊";
            r.GroupName = "InputNumberevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "InputNumberevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region  autoComplete
            r.DictKey   = "select";
            r.DictKey   = "选择";
            r.GroupName = "autoCompleteevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region radio
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "radioevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region checkbox
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "checkboxevent";
            rv          = rv && op.InsertDict(r);
            #endregion


            #region  select
            r.DictKey   = "change";
            r.DictKey   = "选择";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "visible-change";
            r.DictKey   = "下拉框出现/隐藏时触发";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);


            r.DictKey   = "remove-tag";
            r.DictKey   = "多选模式下移除tag时触发";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);


            r.DictKey   = "clear";
            r.DictKey   = "可清空的单选模式下用户点击清空按钮时触发";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "blur";
            r.DictKey   = "模糊";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "focus";
            r.DictKey   = "焦点";
            r.GroupName = "selectevent";
            rv          = rv && op.InsertDict(r);


            #endregion



            #region switch
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "switchevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region cascader
            r.DictKey   = "change";
            r.DictKey   = "选择";
            r.GroupName = "cascaderevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "active-item-change";
            r.DictKey   = "当父级选项变化时触发的事件,仅在 change-on-select 为 false 时可用";
            r.GroupName = "cascaderevent";
            rv          = rv && op.InsertDict(r);



            r.DictKey   = "visible-change";
            r.DictKey   = "下拉框出现/隐藏时触发";
            r.GroupName = "cascaderevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "blur";
            r.DictKey   = "模糊";
            r.GroupName = "cascaderevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "focus";
            r.DictKey   = "焦点";
            r.GroupName = "cascaderevent";
            rv          = rv && op.InsertDict(r);
            #endregion

            #region DatePicker
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "DatePickerevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "blur";
            r.DictKey   = "模糊";
            r.GroupName = "DatePickerevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "focus";
            r.DictKey   = "焦点";
            r.GroupName = "DatePickerevent";
            rv          = rv && op.InsertDict(r);



            #endregion


            #region TimePicker
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "TimePickerevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "blur";
            r.DictKey   = "模糊";
            r.GroupName = "TimePickerevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "focus";
            r.DictKey   = "焦点";
            r.GroupName = "TimePickerevent";
            rv          = rv && op.InsertDict(r);



            #endregion


            #region ColorPicker
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "ColorPickerevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "active-change";
            r.DictKey   = "面板中当前显示的颜色发生改变时触发";
            r.GroupName = "ColorPickerevent";
            rv          = rv && op.InsertDict(r);

            #endregion


            #region rate
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "rateevent";
            rv          = rv && op.InsertDict(r);
            #endregion
            #region slider
            r.DictKey   = "change";
            r.DictKey   = "值改变";
            r.GroupName = "sliderevent";
            rv          = rv && op.InsertDict(r);
            #endregion



            #region tree
            r.DictKey   = "node-click";
            r.DictKey   = "节点被点击时的回调";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-contextmenu";
            r.DictKey   = "当某一节点被鼠标右键点击时会触发该事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "check-change";
            r.DictKey   = "节点选中状态发生变化时的回调";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);



            r.DictKey   = "check";
            r.DictKey   = "当复选框被点击的时候触发";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "current-change";
            r.DictKey   = "当前选中节点变化时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-expand";
            r.DictKey   = "节点被展开时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);


            r.DictKey   = "node-collapse";
            r.DictKey   = "节点被关闭时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-drag-start";
            r.DictKey   = "节点开始拖拽时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-drag-enter";
            r.DictKey   = "拖拽进入其他节点时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "node-drag-leave";
            r.DictKey   = "拖拽离开某个节点时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-drag-over";
            r.DictKey   = "在拖拽节点时触发的事件(类似浏览器的 mouseover 事件)";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "node-drag-end";
            r.DictKey   = "拖拽结束时(可能未成功)触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);
            r.DictKey   = "node-drop";
            r.DictKey   = "拖拽成功完成时触发的事件";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);

            r.DictKey   = "check-change";
            r.DictKey   = "节点选中状态发生变化时的回调";
            r.GroupName = "treeevent";
            rv          = rv && op.InsertDict(r);


            #endregion



            return(rv);
        }