|
|
@@ -25,19 +25,19 @@ namespace MySystem
|
|
|
List<RightDic> Level1 = list.Where(m => m.RightLevel == 1).ToList();
|
|
|
foreach (RightDic sub1 in Level1)
|
|
|
{
|
|
|
- result += "{title: '" + sub1.Title + "',name: '" + sub1.Name + "', id: '" + sub1.Id + "', spread: false, children: [";
|
|
|
+ result += "{\"title\": \"" + sub1.Title + "\",\"name\": \"" + sub1.Name + "\",\"id\": \"" + sub1.Id + "\", \"spread\": false, \"children\": [";
|
|
|
List<RightDic> Level2 = list.Where(m => m.RightLevel == 2 && m.Id.StartsWith(sub1.Id)).ToList();
|
|
|
if (Level2.Count > 0)
|
|
|
{
|
|
|
foreach (RightDic sub2 in Level2)
|
|
|
{
|
|
|
- result += "{title: '" + sub2.Title + "',name: '" + sub2.Name + "', id: '" + sub2.Id + "', spread: false, children: [";
|
|
|
+ result += "{\"title\": \"" + sub2.Title + "\",\"name\": \"" + sub2.Name + "\",\"id\": \"" + sub2.Id + "\", \"spread\": false, \"children\": [";
|
|
|
List<RightDic> Level3 = list.Where(m => m.RightLevel == 3 && m.Id.StartsWith(sub2.Id)).ToList();
|
|
|
if (Level3.Count > 0)
|
|
|
{
|
|
|
foreach (RightDic sub3 in Level3)
|
|
|
{
|
|
|
- result += "{title: '" + sub3.Title + "',name: '" + sub3.Name + "', id: '" + sub3.Id + "', spread: false, children: [";
|
|
|
+ result += "{\"title\": \"" + sub3.Title + "\",\"name\": \"" + sub3.Name + "\",\"id\": \"" + sub3.Id + "\", \"spread\": false, \"children\": [";
|
|
|
string rightString = ForOperateRight(sub3.Id);
|
|
|
if (!string.IsNullOrEmpty(rightString))
|
|
|
{
|
|
|
@@ -93,7 +93,7 @@ namespace MySystem
|
|
|
List<MenuRight> rights = bsdb.MenuRight.Where(m => m.MenuId.StartsWith(Id)).OrderBy(m => m.MenuId).ToList();
|
|
|
foreach (MenuRight right in rights)
|
|
|
{
|
|
|
- result += "{title: '" + right.Name + "', id: '" + right.MenuId + "'},";
|
|
|
+ result += "{\"title\": \"" + right.Name + "\",\"id\": \"" + right.MenuId + "\"},";
|
|
|
}
|
|
|
RightDic rightDic = bsdb.RightDic.FirstOrDefault(m => m.Id == Id) ?? new RightDic();
|
|
|
if (!string.IsNullOrEmpty(rightDic.OtherRight))
|
|
|
@@ -102,7 +102,7 @@ namespace MySystem
|
|
|
foreach (string SubOtherRight in OtherRightList)
|
|
|
{
|
|
|
string[] SubOtherRightData = SubOtherRight.Split('_');
|
|
|
- result += "{title: '" + SubOtherRightData[1] + "', id: '" + Id + "_" + SubOtherRightData[0] + "'},";
|
|
|
+ result += "{\"title\": \"" + SubOtherRightData[1] + "\",\"id\": \"" + Id + "_" + SubOtherRightData[0] + "\"},";
|
|
|
}
|
|
|
}
|
|
|
result = result.TrimEnd(',');
|