Example #1
0
        public async Task <IActionResult> GetTreeSelectJson(int id)
        {
            IEnumerable <SelectColumnEntity> list = await columnService.GetSelectCanUseListAsync(id);

            var treeList = new List <TreeSelectModel>();

            foreach (SelectColumnEntity item in list)
            {
                TreeSelectModel treeModel = new TreeSelectModel();
                treeModel.id       = item.C_ID;
                treeModel.text     = item.C_NAME;
                treeModel.parentId = item.C_PARENTID;
                treeList.Add(treeModel);
            }
            return(Content(treeList.TreeSelectJson()));
        }