Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 48f908ee
authored
Aug 06, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改员工、角色
1 parent
4e4076e9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
62 deletions
html/employee/detail.html
html/employee/index.html
html/role/add.html
html/role/detail.html
html/role/index.html
js/gtree.js
html/employee/detail.html
View file @
48f908e
...
@@ -44,25 +44,6 @@
...
@@ -44,25 +44,6 @@
<h3
class=
"content-title"
>
可见下级商户
</h3>
<h3
class=
"content-title"
>
可见下级商户
</h3>
<ul
id=
"tree"
class=
"ztree wrapper-tree"
></ul>
<ul
id=
"tree"
class=
"ztree wrapper-tree"
></ul>
</div>
</div>
<div>
<h3
class=
"content-title"
>
账户权限
</h3>
<div
class=
"layui-tab"
>
<ul
class=
"layui-tab-title"
>
<li
class=
"layui-this"
>
网站设置
</li>
<li>
用户管理
</li>
<li>
权限分配
</li>
<li>
商品管理
</li>
<li>
订单管理
</li>
</ul>
<div
class=
"layui-tab-content"
>
<div
class=
"layui-tab-item layui-show"
>
内容1
</div>
<div
class=
"layui-tab-item"
>
内容2
</div>
<div
class=
"layui-tab-item"
>
内容3
</div>
<div
class=
"layui-tab-item"
>
内容4
</div>
<div
class=
"layui-tab-item"
>
内容5
</div>
</div>
</div>
</div>
</main>
</main>
</div>
</div>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
...
@@ -74,33 +55,43 @@
...
@@ -74,33 +55,43 @@
var
tree
=
layui
.
gtree
var
tree
=
layui
.
gtree
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
id
=
qs
(
'id'
)
var
id
=
qs
(
'id'
)
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
basicArr
=
[
'staffName'
,
'staffPhone'
,
'roleName'
,
'roleIds'
]
var
employeeData
=
{}
var
employeeData
=
{}
getById
()
// 查询员工详情
// 查询员工详情
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
function
getById
()
{
request
(
params
,
function
(
res
)
{
var
params
=
{
id
:
id
,
method
:
'cn.com.glsx.merchants.staff.staffSearchRequest'
}
console
.
log
(
res
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
// var data = res.data
employeeData
=
helper
.
clone
(
true
,
res
.
data
)
employeeData
=
helper
.
clone
(
true
,
res
.
data
)
for
(
var
i
in
basicArr
)
{
for
(
var
i
in
basicArr
)
{
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
employeeData
[
basicArr
[
i
]])
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
employeeData
[
basicArr
[
i
]])
}
getMerchant
()
}
}
}
})
})
}
// 下级商户树
// 下级商户树
var
treeParams
=
{
id
:
31
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
}
function
getMerchant
()
{
var
merchants
=
{}
var
treeParams
=
{
id
:
merchantId
,
method
:
'cn.com.glsx.merchants.merchant.findMerchantTree'
}
request
(
treeParams
,
function
(
res
)
{
var
merchants
=
{}
console
.
log
(
res
)
request
(
treeParams
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
console
.
log
(
res
)
merchants
=
tree
.
create
(
'tree'
,
res
.
data
,
null
,
false
)
if
(
res
.
code
==
'0'
)
{
// var id = employeeData.visibleInferiorMer
var
arr
=
employeeData
.
visibleInferiorMer
.
split
(
','
)
var
id
=
32
$
.
each
(
arr
,
function
(
index
,
item
)
{
var
node
=
merchants
.
getNodeByParam
(
"id"
,
id
)
arr
[
index
]
=
+
item
merchants
.
checkNode
(
node
,
true
,
true
)
})
}
console
.
log
(
arr
)
})
merchants
=
tree
.
create
(
'tree'
,
res
.
data
,
{
checkedList
:
arr
,
chkDisabled
:
true
})
// var id = 32
// var node = merchants.getNodeByParam("id",id)
// merchants.checkNode(node, true, true)
}
})
}
// 账户权限
// 账户权限
})
})
...
...
html/employee/index.html
View file @
48f908e
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</div>
</div>
<div
class=
"layui-inline"
pane
>
<div
class=
"layui-inline"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"employeeSearch"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"employeeSearch"
>
查询
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
>
导出
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"employeeExport"
>
导出
</button>
</div>
</div>
</form>
</form>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
var
layEvent
=
obj
.
event
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
if
(
layEvent
===
'detail'
)
{
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
})
go
(
'employee'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
}
else
if
(
layEvent
===
'edit'
)
{
go
(
'employee'
,
'add'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
go
(
'employee'
,
'add'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'del'
)
{
}
else
if
(
layEvent
===
'del'
)
{
...
@@ -204,8 +204,22 @@
...
@@ -204,8 +204,22 @@
layer
.
msg
(
'请选择商户'
)
layer
.
msg
(
'请选择商户'
)
}
}
})
})
// 导出
$
(
'#employeeExport'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.exportData'
},
searchData
)
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
window
.
open
(
res
.
data
)
}
})
})
// 查询事件
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
)
})
function
getSearch
()
{
var
formVal
=
form
.
val
(
'employeeForm'
)
var
formVal
=
form
.
val
(
'employeeForm'
)
var
searchData
=
helper
.
clone
(
false
,
formVal
)
var
searchData
=
helper
.
clone
(
false
,
formVal
)
console
.
log
(
formVal
)
console
.
log
(
formVal
)
...
@@ -221,9 +235,8 @@
...
@@ -221,9 +235,8 @@
}
}
delete
searchData
.
type
delete
searchData
.
type
delete
searchData
.
keywords
delete
searchData
.
keywords
console
.
log
(
searchData
)
return
searchData
getTabelList
(
employeeTable
,
searchData
)
}
})
})
})
</script>
</script>
<script
type=
"text/html"
id=
"employeeBar"
>
<script
type=
"text/html"
id=
"employeeBar"
>
...
...
html/role/add.html
View file @
48f908e
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
if
(
requestList
.
length
!=
0
)
{
if
(
requestList
.
length
!=
0
)
{
otherParams
.
requestList
=
JSON
.
stringify
(
requestList
)
otherParams
.
requestList
=
JSON
.
stringify
(
requestList
)
}
else
{
}
else
{
otherParams
.
requestList
=
JSON
.
stringify
(
''
)
otherParams
.
requestList
=
JSON
.
stringify
(
[]
)
}
}
if
(
roleid
)
{
if
(
roleid
)
{
otherParams
.
id
=
roleid
otherParams
.
id
=
roleid
...
@@ -308,7 +308,7 @@
...
@@ -308,7 +308,7 @@
menuData
=
productData
.
productList
[
j
]
menuData
=
productData
.
productList
[
j
]
selectArr
.
push
(
menuData
.
productId
)
selectArr
.
push
(
menuData
.
productId
)
active
.
treeTabAdd
({
active
.
treeTabAdd
({
name
:
menuData
.
product
Id
,
name
:
menuData
.
product
Name
,
value
:
menuData
.
productId
value
:
menuData
.
productId
},
item
.
accounttypeId
,
item
.
products
,
menuData
.
idList
)
},
item
.
accounttypeId
,
item
.
products
,
menuData
.
idList
)
}
}
...
@@ -343,7 +343,7 @@
...
@@ -343,7 +343,7 @@
if
(
res
.
code
==
'0'
)
{
if
(
res
.
code
==
'0'
)
{
console
.
log
(
res
.
data
,
'详情'
)
console
.
log
(
res
.
data
,
'详情'
)
var
accounttypeId
=
''
var
accounttypeId
=
''
if
(
res
.
data
.
responseList
.
length
!=
0
)
{
if
(
res
.
data
.
responseList
)
{
check_arr
=
res
.
data
.
responseList
check_arr
=
res
.
data
.
responseList
}
}
console
.
log
(
check_arr
,
'jklj'
)
console
.
log
(
check_arr
,
'jklj'
)
...
@@ -409,7 +409,7 @@
...
@@ -409,7 +409,7 @@
</script>
</script>
<script
type=
"text/html"
id=
"rolesAuth"
>
<script
type=
"text/html"
id=
"rolesAuth"
>
<
div
id
=
"select{{d.id}}"
><
/div
>
<
div
id
=
"select{{d.id}}"
><
/div
>
<
div
class
=
"layui-tab"
lay
-
filter
=
"treeTab{{d.id}}"
>
<
div
class
=
"layui-tab
layui-tab-brief
"
lay
-
filter
=
"treeTab{{d.id}}"
>
<
ul
class
=
"layui-tab-title"
>
<
ul
class
=
"layui-tab-title"
>
<
/ul
>
<
/ul
>
<
div
class
=
"layui-tab-content"
>
<
div
class
=
"layui-tab-content"
>
...
...
html/role/detail.html
View file @
48f908e
...
@@ -33,7 +33,11 @@
...
@@ -33,7 +33,11 @@
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleDescription "
></div>
<div
class=
"layui-form-mid layui-word-aux"
id=
"roleDescription "
></div>
</div>
</div>
</div>
</div>
<h3
class=
"content-title"
>
角色权限
</h3>
<h3
class=
"content-title layui-form"
>
角色权限
<select
id=
"accountType"
name=
"accountType"
lay-filter=
"accountSelect"
>
</select>
</h3>
<div
class=
"layui-tab"
lay-filter=
"roleAuth"
>
<div
class=
"layui-tab"
lay-filter=
"roleAuth"
>
<ul
class=
"layui-tab-title"
></ul>
<ul
class=
"layui-tab-title"
></ul>
<div
class=
"layui-tab-content"
></div>
<div
class=
"layui-tab-content"
></div>
...
@@ -44,26 +48,79 @@
...
@@ -44,26 +48,79 @@
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"https://www.layuicdn.com/layui/layui.js"
></script>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
layui
.
use
([
'request'
,
'gtree'
,
'element'
,
'helper'
],
function
()
{
layui
.
use
([
'request'
,
'gtree'
,
'element'
,
'helper'
,
'form'
],
function
()
{
var
$
=
layui
.
$
var
request
=
layui
.
request
var
request
=
layui
.
request
var
tree
=
layui
.
gtree
var
tree
=
layui
.
gtree
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
form
=
layui
.
form
var
element
=
layui
.
element
var
$
=
layui
.
$
var
id
=
qs
(
'id'
)
var
id
=
qs
(
'id'
)
var
merchantId
=
qs
(
'merchantId'
)
var
basicArr
=
[
'roleName'
,
'id'
,
'roleDescription'
]
var
basicArr
=
[
'roleName'
,
'id'
,
'roleDescription'
]
var
roleData
=
{}
var
roleData
=
{}
var
menuFunTreeData
=
[]
// 查询角色详情
// 查询角色详情
var
params
=
{
id
:
id
,
method
:
'org.ore.api.role.getById'
}
getById
()
request
(
params
,
function
(
res
)
{
findMenuFunTreeByMerId
()
console
.
log
(
res
)
form
.
on
(
'select(accountSelect)'
,
function
(
data
){
if
(
res
.
code
==
'0'
)
{
console
.
log
(
data
.
elem
);
//得到select原始DOM对象
roleData
=
helper
.
clone
(
true
,
res
.
data
)
console
.
log
(
data
.
value
);
//得到被选中的值
for
(
var
i
in
basicArr
)
{
console
.
log
(
data
.
othis
);
//得到美化后的DOM对象
$
(
'#'
+
[
basicArr
[
i
]]).
text
(
roleData
[
basicArr
[
i
]])
var
id
=
data
.
value
})
var
active
=
{
tabAdd
:
function
(
item
)
{
element
.
tabAdd
(
'roleAuth'
,
{
title
:
item
.
title
,
content
:
'<div id="role'
+
id
+
'"></div>'
,
id
:
item
.
value
})
},
tabChange
:
function
(
name
,
id
)
{
element
.
tabChange
(
name
,
id
)
}
}
function
getById
()
{
var
params
=
{
id
:
id
,
method
:
'org.ore.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
]])
}
}
}
})
}
function
findMenuFunTreeByMerId
()
{
var
params
=
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
id
:
merchantId
}
}
})
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
menuFunTreeData
=
res
.
data
console
.
log
(
menuFunTreeData
)
var
select
=
$
(
'#accountType'
)
$
.
each
(
menuFunTreeData
,
function
(
index
,
item
)
{
select
.
append
(
new
Option
(
item
.
accounttypeName
,
item
.
accounttypeId
))
})
form
.
render
(
'select'
)
$
.
each
(
menuFunTreeData
[
0
].
products
,
function
(
index
,
i
)
{
active
.
tabAdd
({
title
:
i
.
productName
,
value
:
i
.
productId
})
})
}
})
}
})
})
</script>
</script>
<script
type=
"text/html"
id=
"treeAuth"
>
<
ul
id
=
"tree_{{d.id}}"
class
=
"ztree wrapper-tree"
><
/ul
>
</script>
</body>
</body>
</html>
</html>
html/role/index.html
View file @
48f908e
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
var
layEvent
=
obj
.
event
var
layEvent
=
obj
.
event
var
tr
=
obj
.
tr
var
tr
=
obj
.
tr
if
(
layEvent
===
'detail'
)
{
if
(
layEvent
===
'detail'
)
{
go
(
'role'
,
'detail'
,
{
id
:
data
.
id
})
go
(
'role'
,
'detail'
,
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
})
}
else
if
(
layEvent
===
'edit'
)
{
}
else
if
(
layEvent
===
'edit'
)
{
var
params
=
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
}
var
params
=
{
id
:
data
.
id
,
merchantId
:
data
.
merchantId
}
go
(
'role'
,
'add'
,
params
)
go
(
'role'
,
'add'
,
params
)
...
...
js/gtree.js
View file @
48f908e
...
@@ -30,6 +30,9 @@ layui.define(['ztree'], function (exports) {
...
@@ -30,6 +30,9 @@ layui.define(['ztree'], function (exports) {
}
}
}
}
}
}
if
(
gtree
.
opt
&&
gtree
.
opt
.
chkDisabled
)
{
treeNode
.
chkDisabled
=
true
}
}
}
var
setting
=
{
var
setting
=
{
view
:
{
view
:
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment