Пример #1
0
        public async Task <HandleResult> FormFields([FromBody] JObject form)
        {
            string parentNum = form["parentNum"].ToStr();
            int    id        = form["id"].ToInt();
            var    data      = id > 0
                ? await _service.GetById(id)
                : new Column
            {
                ParentNum = parentNum,
            };

            if (data == null)
            {
                return(HandleResult.Error("无效数据"));
            }

            return(new HandleResult
            {
                IsSuccess = true,
                Data = new
                {
                    EditData = data,
                    Field = ReactForm.ToFormFields <Column>(data.Id > 0)
                }
            });
        }