role-access.component.ts
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-role-access',
templateUrl: './role-access.component.html',
styleUrls: ['./role-access.component.scss']
})
export class RoleAccessComponent implements OnInit {
roleAccessDataSource = ROLE_ACCESS_DATA;
current_item = 0;
constructor() { }
ngOnInit() { }
triggerCheckBoxEventrow(event, n: number) {
let data = this.roleAccessDataSource.find(i => i.id === this.current_item)
if (event.checked) {
data.isDisabled = n + 1;
} else {
data.isDisabled = n;
}
return;
}
}
export interface RoleAccessDataElement {
id: number;
menu: string;
childMenu: string;
status: number;
operation: string;
action: string;
isDisabled: number;
}
const ROLE_ACCESS_DATA: RoleAccessDataElement[] = [
{
id: 1,
menu: "Search",
childMenu: "Operation Log",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 2,
menu: "Search",
childMenu: "Transfer History",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 3,
menu: "Manage Player",
childMenu: "View Player",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 4,
menu: "Manage Payment",
childMenu: "Deposits",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 5,
menu: "Manage Payment",
childMenu: "Withdrawals",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 6,
menu: "Manage Operator",
childMenu: "View Operator",
status: 0,
operation: "Add",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 7,
menu: "Manage Affiliate",
childMenu: "View Affiliates",
status: 0,
operation: "Add",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 8,
menu: "Manage Role",
childMenu: "View Roles",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}, {
id: 9,
menu: "Manage Role",
childMenu: "Role Access",
status: 0,
operation: "",
action: "Edit | Delete",
isDisabled: 1
}
];