Exemple #1
0
        /// <summary>
        /// 获取报表菜单
        /// </summary>
        /// <param name="data"></param>
        private void GetReportMenu(dynamic data)
        {
            List <KeyValue> dyMenu = _platformAnesQueryService.GetReportConfig();

            foreach (var item in data.menuList)
            {
                string name = item["name"].Value;
                if (name != "质控管理" && name != "日常查询")
                {
                    continue;
                }
                else
                {
                    if (name == "质控管理")
                    {
                        for (int i = 0; i < item.childMenuList.Count - 1; i++)
                        {
                            StringBuilder sbbd = new StringBuilder();
                            foreach (var bsitem in item.childMenuList[i].childMenuList)
                            {
                                sbbd.Append(JsonConvert.SerializeObject(bsitem) + ",");
                            }
                            foreach (KeyValue childItem in dyMenu.Where(x => x.Value == item.childMenuList[i].name.Value))
                            {
                                sbbd.Append("{\"name\": \"" + childItem.Key + "\",\"menuKey\": \"" + childItem.Key + "\",\"path\": \"/quality/" + childItem.Value + "/" + childItem.Key + "\",\"permission\": false},");
                            }
                            if (sbbd.ToString() != "")
                            {
                                item.childMenuList[i].childMenuList = JsonConvert.DeserializeObject("[" + sbbd.ToString().TrimEnd(',') + "]");
                            }
                        }
                    }
                    else if (name == "日常查询")
                    {
                        for (int i = 0; i < item.childMenuList.Count; i++)
                        {
                            StringBuilder sbbd = new StringBuilder();
                            foreach (var bsitem in item.childMenuList[i].childMenuList)
                            {
                                sbbd.Append(JsonConvert.SerializeObject(bsitem) + ",");
                            }
                            foreach (KeyValue childItem in dyMenu.Where(x => x.Value == item.childMenuList[i].name.Value))
                            {
                                sbbd.Append("{\"name\": \"" + childItem.Key + "\",\"menuKey\": \"" + childItem.Key + "\",\"path\": \"/anesreport/" + childItem.Value + "/" + childItem.Key + "\",\"permission\": false},");
                            }
                            if (sbbd.ToString() != "")
                            {
                                item.childMenuList[i].childMenuList = JsonConvert.DeserializeObject("[" + sbbd.ToString().TrimEnd(',') + "]");
                            }
                        }
                    }
                }
            }
        }
Exemple #2
0
 public RequestResult <List <KeyValue> > GetReportConfig()
 {
     return(Success(AnesQuery.GetReportConfig()));
 }