Я следую тому же формату JSON, который указан в ngx-treeview. Файл JSON:
[
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "JOURNEY",
"value": 1
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "INVENTORY ASSURANCE",
"value": 2
},
{
"internalDisabled": false,
"internalChecked": true,
"internalCollapsed": false,
"text": "SENSOR ASSURANCE",
"value": 3
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "AVAILABILITY ASSURANCE",
"value": 4
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "ACTIONABLE",
"value": 5,
"internalChildren": [
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Invalid Sensor Values",
"value": 11
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Management View",
"value": 12
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Actionable",
"value": 13
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Informational",
"value": 14
}
]
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "COMPLIANCE",
"value": 6
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "EXPENDITURE",
"value": 7
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "PROJECT",
"value": 8
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "REPORT",
"value": 9
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "ADMIN",
"value": 10,
"internalChildren": [
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Access & Authorization",
"value": 15,
"internalChildren": [
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "List Roles",
"value": 20
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "User Role Mapping",
"value": 21
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "List User Role Mapping",
"value": 22
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Menu Authorization to Role-Function ",
"value": 23
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Site Management",
"value": 24
}
]
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Master Data Management",
"value": 16,
"internalChildren": [
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Function Master",
"value": 25
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Feature Master",
"value": 26
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Site to State Mapping",
"value": 27
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Unit Cost (EB & DG)",
"value": 28
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "R4G States",
"value": 29
}
]
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Escalation Matrix",
"value": 17
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Facility Management",
"value": 18,
"internalChildren": [
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Create Facility",
"value": 30
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Create Sub Facility",
"value": 31
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Partial Variance",
"value": 32
}
]
},
{
"internalDisabled": false,
"internalChecked": false,
"internalCollapsed": false,
"text": "Create New Role",
"value": 19
}
]
}
]
Это то, что я сделал. Но ожидаемое дерево отображения:
Согласно моим JSON данным ACTIONABLE флажок должен быть родительским, но он показывает под ОБЕСПЕЧЕНИЕ ДОСТУПНОСТИ .
Это создает путаницу для Пользователя и меня тоже.