detail.html
6.33 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="广联帐户管理中心-员工管理" />
<meta name="author" content="GLSX Web Team" />
<meta name="keywords" itemprop="keywords" content="广联,帐户管理,员工管理" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<title>角色管理</title>
</head>
<style>
.sub-bg-white {
background-color: #f4f5fa;
padding-top: 8px;
/* height: 100%; */
padding-bottom: 100px;
}
.tabmutiple-content-wrap {
background-color: #f4f6fc;
padding: 0 0 1px;
margin: 0 20px;
}
.tabmutiple-content {
margin: 0 10px;
background-color: #f4f6fc;
}
.layui-tab-content {
background-color: #fff;
}
.layui-tab-title {
background-color: #f4f6fc;
}
.outtitle {
margin-left: -10px;
}
.layui-this {
background-color: #fff;
border: 2px solid #fff;
}
.layui-tab-title .layui-this {
transform: none;
}
.layui-tab-card>.layui-tab-title li {
margin-left: 0;
}
.topwrap {
margin: 0 20px 0;
background-color: #fff;
position: relative;
}
.topwrap .grayLine {
position: absolute;
left: 0;
top: 48px;
background-color: #d8d8d8;
width: 100%;
height: 1px;
}
.bottomwrap {
margin: 20px 20px 0;
background-color: #fff;
/* height: 100%; */
padding-bottom: 30px;
}
.show {
display: inline-block;
}
.hide {
display: none;
}
</style>
<body>
<div id="app">
<main class="bg-white wrapper detail">
<div class="sub-bg-white">
<div class="topwrap">
<div class="grayLine"></div>
<div class="content-title">
<span>角色基本信息</span>
<div class="title-right" id="merchantName"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">角色名称:</label>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="roleName"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">角色号:</label>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="roleCode"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">角色说明:</label>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux" id="roleDescription"></div>
</div>
</div>
</div>
<div class="bottomwrap">
<h3 class="content-title layui-form">
角色权限
<!-- <select id="accountType" name="accountType" lay-filter="accountSelect">
</select> -->
</h3>
<div class="tabmutiple-content-wrap">
<div class="layui-tab tabmutiple-content" lay-filter="roleAuth">
<ul class="layui-tab-title outtitle"></ul>
<div class="layui-tab-content"></div>
</div>
</div>
</div>
<div class="footer-close">
<button type="button" class="layui-btn layui-btn-normal btn-one" id="return">关闭</button>
</div>
</div>
</main>
</div>
<script src="https://img02.glsx.com.cn/layui/layui.js"></script>
<script src="/js/load.js"></script>
<script>
layui.use(['request', 'helper', 'form', 'treeTab'], function () {
var request = layui.request
var helper = layui.helper
var form = layui.form
var xmSelect = layui.xmSelect
var $ = layui.$
var treeTab = layui.treeTab
var roleid = qs('id')
var merchantId = qs('merchantId')
var basicArr = ['roleName', 'roleCode', 'roleDescription', 'merchantName']
var roleData = {}
var menuFunTreeData = []
var templateData = {}
var treeData = {}
// 查询角色详情
getById()
findMenuFunTreeByRoleId()
$('#return').on('click', function () {
window.history.back()
})
function getById() {
var params = { id: roleid, method: 'merchants.api.role.getById' }
request(params, function (res) {
if (res.code == '0') {
roleData = helper.clone(true, res.data)
for (var i in basicArr) {
$('#' + [basicArr[i]]).text(roleData[basicArr[i]] || '无')
}
// callback(roleData.responseList)
}
})
}
function findMenuFunTreeByRoleId() {
var params = {
method: 'merchants.api.merchant.findMenuFunTreeByRoleId',
id: roleid
}
request(params, function (res) {
if (res.code == '0' && res.data && res.data.length != 0) {
var authList = res.data
$.each(authList, function (index, item) {
treeTab.tabAdd(
{
title: item.accounttypeName,
value: item.accounttypeId
},
true
)
var menuData = []
if (item.products && item.products.length != 0) {
$.each(item.products, function (idx, m) {
treeTab.treeTabDetail(
{
name: m.productName,
value: m.productId
},
item.accounttypeId,
m.merchantProTreeResponses
)
})
var filterName = 'treeTab' + item.accounttypeId
var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId
treeTab.tabChange(filterName, productId)
}
})
treeTab.tabChange('roleAuth', authList[0].accounttypeId)
$(window).resize();
}
})
}
})
</script>
<!-- <script type="text/html" id="treeAuth">
<ul id="tree_{{d.id}}" class="ztree wrapper-tree"></ul>
<div class="layui-no-data show" id="nomenu{{d.id}}">
<div class="no-data">
<img src="../../css/img/no-data.png" />
<div>暂无菜单数据</div>
</div>
</div>
</div>
</script> -->
</body>
</html>