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 4ee7bae4
authored
Aug 09, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/h5/account
into master
2 parents
90c7b867
d33e3b5b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
276 additions
and
177 deletions
css/employee.css
css/layui.css
css/main.css
html/employee/index.html
html/merchant/detail.html
html/merchant/edit.html
html/merchant/index.html
html/role/index.html
css/employee.css
View file @
4ee7bae
...
@@ -60,4 +60,7 @@
...
@@ -60,4 +60,7 @@
left
:
50%
;
left
:
50%
;
top
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
}
.align-center
{
text-align
:
center
;
}
}
\ No newline at end of file
\ No newline at end of file
css/layui.css
View file @
4ee7bae
...
@@ -78,4 +78,19 @@
...
@@ -78,4 +78,19 @@
.layui-tab-brief
>
.layui-tab-more
li
.layui-this
:after
,
.layui-tab-brief
>
.layui-tab-more
li
.layui-this
:after
,
.layui-tab-brief
>
.layui-tab-title
.layui-this
:after
{
.layui-tab-brief
>
.layui-tab-title
.layui-this
:after
{
border-bottom
:
2px
solid
#1989FA
;
border-bottom
:
2px
solid
#1989FA
;
}
\ No newline at end of file
\ No newline at end of file
}
.layui-tab-content
xm-select
{
border-color
:
#E6E6E6
!important
;
}
.xm-label-block
{
background-color
:
#1989FA
!important
;
}
.selected
i
.xm-icon-duox
{
color
:
#1989FA
!important
;
}
.xm-option-icon
,
.xm-iconfont
,
.xm-icon-duox
{
border-color
:
#1989FA
!important
;
}
\ No newline at end of file
\ No newline at end of file
css/main.css
View file @
4ee7bae
...
@@ -16,7 +16,9 @@ header {
...
@@ -16,7 +16,9 @@ header {
height
:
48px
;
height
:
48px
;
flex-shrink
:
0
;
flex-shrink
:
0
;
}
}
main
::-webkit-scrollbar
{
display
:
none
;
}
.header
{
.header
{
height
:
100%
;
height
:
100%
;
background
:
#fff
;
background
:
#fff
;
...
...
html/employee/index.html
View file @
4ee7bae
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
>
<div
id=
"app"
>
<main>
<main
class=
"bg-white"
>
<div
class=
"bg-white"
>
<div>
<form
action=
""
class=
"layui-form layui-form-pane"
lay-filter=
"employeeForm"
>
<form
action=
""
class=
"layui-form layui-form-pane"
lay-filter=
"employeeForm"
>
<div
class=
"layui-form-item"
pane
>
<div
class=
"layui-form-item"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addEmployee"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addEmployee"
>
...
@@ -64,17 +64,19 @@
...
@@ -64,17 +64,19 @@
</div>
</div>
</form>
</form>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
<table
id=
"employeeTable"
lay-filter=
"employeeTool"
></table>
<div
id=
"employeePage"
class=
"align-center"
></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>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
layui
.
use
([
'table'
,
'request'
,
'form'
,
'helper'
],
function
()
{
layui
.
use
([
'table'
,
'request'
,
'form'
,
'helper'
,
'laypage'
],
function
()
{
var
request
=
layui
.
request
var
request
=
layui
.
request
var
table
=
layui
.
table
var
table
=
layui
.
table
var
form
=
layui
.
form
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
$
=
layui
.
$
var
$
=
layui
.
$
// 商户名称列表
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
merchantName
=
$
(
"#merchantName"
)
...
@@ -84,7 +86,6 @@
...
@@ -84,7 +86,6 @@
//创建table实例
//创建table实例
var
employeeTable
=
table
.
render
({
var
employeeTable
=
table
.
render
({
elem
:
'#employeeTable'
,
elem
:
'#employeeTable'
,
page
:
true
,
cols
:
[
cols
:
[
[
[
//表头
//表头
...
@@ -102,15 +103,34 @@
...
@@ -102,15 +103,34 @@
]
]
]
]
})
})
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'employeePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
limit
);
//得到每页显示的条数
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
//首次不执行
if
(
!
first
)
{
getTabelList
(
employeeTable
)
}
}
}
getTabelList
(
employeeTable
)
getTabelList
(
employeeTable
)
// 获取table列表接口
// 获取table列表接口
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
function
getTabelList
(
table
,
search
,
isResetPageNum
)
{
var
pageNum
=
isResetPageNum
?
1
:
employeeTable
.
config
.
index
var
pageSize
=
employeeTable
.
config
.
limit
search
=
search
||
{}
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
pageNum
,
pageNum
:
page
.
page
Num
,
pageSize
:
pageSize
,
pageSize
:
page
.
page
Size
,
method
:
'cn.com.glsx.merchants.staff.findStaffByPage'
method
:
'cn.com.glsx.merchants.staff.findStaffByPage'
},
search
)
},
search
)
request
(
params
,
request
(
params
,
...
@@ -123,12 +143,12 @@
...
@@ -123,12 +143,12 @@
var
options
=
{
var
options
=
{
data
:
data
.
data
data
:
data
.
data
}
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
if
(
isResetPageNum
)
{
options
.
page
=
{
pageOptions
.
curr
=
1
curr
:
1
}
}
}
table
.
reload
(
options
)
laypage
.
render
(
pageOptions
)
employeeTable
.
reload
(
options
)
}
}
)
)
}
}
...
@@ -187,7 +207,7 @@
...
@@ -187,7 +207,7 @@
// 查询事件
// 查询事件
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
$
(
'#employeeSearch'
).
on
(
'click'
,
function
()
{
var
searchData
=
getSearch
()
var
searchData
=
getSearch
()
getTabelList
(
employeeTable
,
searchData
)
getTabelList
(
employeeTable
,
searchData
,
true
)
})
})
// 新增点击事件
// 新增点击事件
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
$
(
'#addEmployee'
).
on
(
'click'
,
function
()
{
...
...
html/merchant/detail.html
View file @
4ee7bae
...
@@ -130,17 +130,17 @@
...
@@ -130,17 +130,17 @@
<div
class=
"merchant-right"
>
<div
class=
"merchant-right"
>
<div>
<div>
<span
id=
"merchantNameTable"
></span>
员工列表
<span
id=
"merchantNameTable"
></span>
员工列表
<div
class=
"layui-input-inline"
>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
<input
class=
"layui-input"
placeholder=
"请输入员工姓名/手机号"
id=
"tableSearchForm"
/>
</div>
</div>
<button
class=
"layui-btn"
id=
"tableSearch"
>
查询
</button>
<button
class=
"layui-btn"
id=
"tableSearch"
>
查询
</button>
</div>
</div>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
<table
id=
"subMerchantTable"
lay-filter=
"subMerchantTool"
></table>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"layui-tab-item"
>
<ul
class=
"layui-timeline"
>
<
!-- <
ul class="layui-timeline">
<li class="layui-timeline-item">
<li class="layui-timeline-item">
<i class="layui-icon layui-timeline-axis"></i>
<i class="layui-icon layui-timeline-axis"></i>
<div class="layui-timeline-content layui-text">
<div class="layui-timeline-content layui-text">
...
@@ -193,11 +193,12 @@
...
@@ -193,11 +193,12 @@
<div class="layui-timeline-title">过去</div>
<div class="layui-timeline-title">过去</div>
</div>
</div>
</li>
</li>
</ul>
</ul>
-->
</div>
</div>
</div>
</div>
<div
class=
"footer-close"
>
<button
class=
"layui-btn"
id=
"closeEl"
>
关闭
</button></div>
</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>
...
@@ -213,7 +214,8 @@
...
@@ -213,7 +214,8 @@
var
laytpl
=
layui
.
laytpl
var
laytpl
=
layui
.
laytpl
var
element
=
layui
.
element
var
element
=
layui
.
element
var
merchantId
=
qs
(
'merchantId'
)
var
merchantId
=
qs
(
'merchantId'
)
var
merchantInfo
=
{}
var
parentId
=
''
var
merchantForm
=
{}
var
templateData
=
{}
var
templateData
=
{}
var
treeData
=
{}
var
treeData
=
{}
var
menuFunTreeData
=
[]
var
menuFunTreeData
=
[]
...
@@ -243,8 +245,6 @@
...
@@ -243,8 +245,6 @@
getSecondTable
(
subMerchantTable
)
getSecondTable
(
subMerchantTable
)
}
}
// 查询角色详情
// 查询角色详情
function
getFirstInfo
(
callback
)
{
function
getFirstInfo
(
callback
)
{
var
params
=
{
var
params
=
{
...
@@ -262,20 +262,38 @@
...
@@ -262,20 +262,38 @@
}
}
})
})
}
}
// 获取功能权限基础数据
// 获取功能权限基础数据
function
findMenuFunTreeByMerId
()
{
function
findMenuFunTreeByMerId
()
{
var
params
=
{
request
(
{
method
:
'cn.com.glsx.merchants.merchant.findMe
nuFunTreeByMerId
'
,
method
:
'cn.com.glsx.merchants.merchant.findMe
rchantDetail
'
,
id
:
merchantId
id
:
merchantId
}
},
function
(
res
)
{
request
(
params
,
function
(
res
)
{
merchantForm
=
res
.
data
if
(
res
.
code
==
'0'
)
{
parentId
=
merchantForm
.
parentId
menuFunTreeData
=
res
.
data
var
params
=
{}
getFirstInfo
(
function
(
responseList
)
{
if
(
parentId
)
{
console
.
log
(
'responseList:'
,
responseList
)
params
=
{
if
(
responseList
&&
responseList
.
length
!=
0
)
{
method
:
'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
,
$
.
each
(
menuFunTreeData
,
function
(
index
,
item
)
{
id
:
merchantId
,
parentId
:
parentId
,
accountLevel
:
merchantForm
.
merchantAccountLevel
}
}
else
{
params
=
{
method
:
'cn.com.glsx.merchants.merchant.accountTypeSearchRequest'
,
ids
:
merchantForm
.
accountType
,
merchantId
:
merchantId
,
accountLevel
:
merchantForm
.
merchantAccountLevel
}
}
request
(
params
,
function
(
res
)
{
if
(
res
.
code
==
'0'
)
{
menuFunTreeData
=
res
.
data
getFirstInfo
(
function
(
responseList
)
{
console
.
log
(
'responseList:'
,
responseList
)
if
(
responseList
&&
responseList
.
length
!=
0
)
{
$
.
each
(
menuFunTreeData
,
function
(
index
,
item
)
{
for
(
var
i
=
0
;
i
<
responseList
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
responseList
.
length
;
i
++
)
{
var
productData
=
responseList
[
i
]
var
productData
=
responseList
[
i
]
if
(
item
.
accounttypeId
==
productData
.
accounttypeId
)
{
if
(
item
.
accounttypeId
==
productData
.
accounttypeId
)
{
...
@@ -284,7 +302,7 @@
...
@@ -284,7 +302,7 @@
value
:
item
.
accounttypeId
value
:
item
.
accounttypeId
})
})
var
menuData
=
[]
var
menuData
=
[]
for
(
var
j
=
0
;
j
<
productData
.
products
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
productData
.
products
.
length
;
j
++
)
{
menuData
=
productData
.
products
[
j
]
menuData
=
productData
.
products
[
j
]
var
idList
=
menuData
.
menuIds
.
concat
(
menuData
.
functionIds
)
var
idList
=
menuData
.
menuIds
.
concat
(
menuData
.
functionIds
)
active
.
treeTabAdd
({
active
.
treeTabAdd
({
...
@@ -293,15 +311,17 @@
...
@@ -293,15 +311,17 @@
},
item
.
accounttypeId
,
item
.
products
,
idList
)
},
item
.
accounttypeId
,
item
.
products
,
idList
)
}
}
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
].
productId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
item
.
products
[
0
]
.
productId
active
.
tabChange
(
filterName
,
productId
)
active
.
tabChange
(
filterName
,
productId
)
}
}
}
}
})
})
active
.
tabChange
(
'roleAuth'
,
responseList
[
0
].
accounttypeId
)
active
.
tabChange
(
'roleAuth'
,
responseList
[
0
].
accounttypeId
)
}
}
})
})
}
}
})
})
})
}
}
...
@@ -382,110 +402,119 @@
...
@@ -382,110 +402,119 @@
})
})
// table搜索
// table搜索
$
(
'#tableSearch'
).
on
(
'click'
,
function
()
{
$
(
'#tableSearch'
).
on
(
'click'
,
function
()
{
var
search
=
$
(
'#tableSearchForm'
).
val
()
var
search
=
$
(
'#tableSearchForm'
).
val
()
console
.
log
(
search
)
console
.
log
(
search
)
getSecondTable
(
subMerchantTable
,
{
keyword
:
search
})
getSecondTable
(
subMerchantTable
,
{
keyword
:
search
})
})
$
(
'#closeEl'
).
on
(
'click'
,
function
()
{
go
(
'merchant'
,
'index'
)
})
})
// 获取table列表接口
// 获取table列表接口
function
getSecondTable
(
table
,
search
,
isResetPageNum
=
false
)
{
function
getSecondTable
(
table
,
search
,
isResetPageNum
=
false
)
{
var
search
=
search
||
{}
var
search
=
search
||
{}
var
params
=
helper
.
clone
(
false
,
{
var
params
=
helper
.
clone
(
false
,
{
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
method
:
'cn.com.glsx.merchants.staff.findMerchantStaffList'
,
merchantId
:
merchantId
merchantId
:
merchantId
},
search
)
},
search
)
request
(
params
,
function
(
res
)
{
request
(
params
,
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
)
var
data
=
res
.
data
var
data
=
res
.
data
var
options
=
{
var
options
=
{
data
:
data
data
:
data
}
subMerchantTable
.
reload
(
options
)
}
}
)
subMerchantTable
.
reload
(
options
)
})
}
}
var
active
=
{
var
active
=
{
/**
/**
* 第一级tab添加
* 第一级tab添加
* item: {name: 选项卡名称, value: 选项卡值}
* item: {name: 选项卡名称, value: 选项卡值}
* roleAuth: 选项卡过滤器的名称 lay-filter绑定的名字
* roleAuth: 选项卡过滤器的名称 lay-filter绑定的名字
* content: 一个放置模板的视图容器,用于呈现渲染结果 带有id的div
* content: 一个放置模板的视图容器,用于呈现渲染结果 带有id的div
* id:选项卡标题的lay-id属性值
* id:选项卡标题的lay-id属性值
* 需要引入laytpl 模块
* 需要引入laytpl 模块
* rolesAuth:模板的id
* rolesAuth:模板的id
* view 放置模板的视图容器的dom
* view 放置模板的视图容器的dom
* templateData:用于渲染模板的数据
* templateData:用于渲染模板的数据
* productList:复选下拉框的list,修改过的数据{name: '', value: ''}
* productList:复选下拉框的list,修改过的数据{name: '', value: ''}
* products:对应的菜单下的产品list,包含了对应的权限树,原始数据,需作为参数传入treeTabAdd中,在实例化tree时传入的数据使用
* products:对应的菜单下的产品list,包含了对应的权限树,原始数据,需作为参数传入treeTabAdd中,在实例化tree时传入的数据使用
*/
*/
tabAdd
:
function
(
item
)
{
tabAdd
:
function
(
item
)
{
// 渠道的id,一层选项卡的id
// 渠道的id,一层选项卡的id
var
id
=
item
.
value
var
id
=
item
.
value
// roleAuth 一层选项卡过滤器的名称
// roleAuth 一层选项卡过滤器的名称
element
.
tabAdd
(
'roleAuth'
,
{
element
.
tabAdd
(
'roleAuth'
,
{
title
:
item
.
title
,
title
:
item
.
title
,
// 放置模板视图的上一级div
// 放置模板视图的上一级div
content
:
'<div id="role'
+
id
+
'"></div>'
,
content
:
'<div id="role'
+
id
+
'"></div>'
,
// 选项卡标题的lay-id属性值
// 选项卡标题的lay-id属性值
id
:
id
id
:
id
})
})
var
getTpl
=
'<div id="select{{d.id}}"></div> <div class="layui-tab layui-tab-brief" lay-filter="treeTab{{d.id}}"><ul class="layui-tab-title"></ul> <div class="layui-tab-content"></div></div>'
var
getTpl
=
// var getTpl = tpl//rolesAuth.innerHTML, // 模板内容
'<div id="select{{d.id}}"></div> <div class="layui-tab layui-tab-brief" lay-filter="treeTab{{d.id}}"><ul class="layui-tab-title"></ul> <div class="layui-tab-content"></div></div>'
view
=
document
.
getElementById
(
'role'
+
id
)
// var getTpl = tpl//rolesAuth.innerHTML, // 模板内容
templateData
.
id
=
id
// 渲染模版的数据
view
=
document
.
getElementById
(
'role'
+
id
)
laytpl
(
getTpl
).
render
(
templateData
,
function
(
html
)
{
templateData
.
id
=
id
// 渲染模版的数据
view
.
innerHTML
=
html
laytpl
(
getTpl
).
render
(
templateData
,
function
(
html
)
{
})
view
.
innerHTML
=
html
},
})
// tab删除
},
tabDelete
:
function
(
name
,
id
)
{
// tab删除
element
.
tabDelete
(
name
,
id
)
tabDelete
:
function
(
name
,
id
)
{
},
element
.
tabDelete
(
name
,
id
)
// tab Change
},
tabChange
:
function
(
name
,
id
)
{
// tab Change
element
.
tabChange
(
name
,
id
)
tabChange
:
function
(
name
,
id
)
{
},
element
.
tabChange
(
name
,
id
)
/**
},
* 第二级选项卡
/**
* treeTabAdd 产品的权限添加
* 第二级选项卡
* item: {name: 选项卡名称, value: 选项卡值}
* treeTabAdd 产品的权限添加
* id 第一级选项卡的item.value
* item: {name: 选项卡名称, value: 选项卡值}
* filterName: 过滤器的名称 lay-filter绑定的值
* id 第一级选项卡的item.value
* treeData:渲染模板的数据,和用来存放对应树实例的对象,
* filterName: 过滤器的名称 lay-filter绑定的值
* products:产品list数组
* treeData:渲染模板的数据,和用来存放对应树实例的对象,
* defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3])
* products:产品list数组
*/
* defaultList:编辑时传入,默认勾选中的数组。(举例:[1,2,3])
treeTabAdd
:
function
(
item
,
id
,
products
,
defaultList
)
{
*/
console
.
log
(
defaultList
)
treeTabAdd
:
function
(
item
,
id
,
products
,
defaultList
)
{
var
productId
=
'tab_'
+
id
+
'_'
+
item
.
value
console
.
log
(
defaultList
)
var
filterName
=
'treeTab'
+
id
// 过滤器的名称 lay-filter
var
productId
=
'tab_'
+
id
+
'_'
+
item
.
value
element
.
tabAdd
(
filterName
,
{
var
filterName
=
'treeTab'
+
id
// 过滤器的名称 lay-filter
title
:
item
.
name
,
element
.
tabAdd
(
filterName
,
{
content
:
'<div id="treeTab'
+
productId
+
'"></div>'
,
// 放置模板视图的div
title
:
item
.
name
,
id
:
productId
content
:
'<div id="treeTab'
+
productId
+
'"></div>'
,
// 放置模板视图的div
})
id
:
productId
// var getTreeTpl = treeAuth.innerHTML, // 获取的模板的id的内容
})
var
getTreeTpl
=
'<ul id="tree_{{d.id}}" class="ztree wrapper-tree"></ul>'
// var getTreeTpl = treeAuth.innerHTML, // 获取的模板的id的内容
treeView
=
document
.
getElementById
(
'treeTab'
+
productId
)
// 放置模板视图的div
var
getTreeTpl
=
'<ul id="tree_{{d.id}}" class="ztree wrapper-tree"></ul>'
treeData
[
id
]
=
treeData
[
id
]
||
{}
treeView
=
document
.
getElementById
(
'treeTab'
+
productId
)
// 放置模板视图的div
treeData
[
id
][
item
.
value
]
=
treeData
[
id
][
item
.
value
]
||
{}
treeData
[
id
]
=
treeData
[
id
]
||
{}
treeData
[
id
][
item
.
value
].
id
=
productId
// 渲染模版的数据
treeData
[
id
][
item
.
value
]
=
treeData
[
id
][
item
.
value
]
||
{}
treeData
[
id
][
item
.
value
].
productId
=
item
.
value
treeData
[
id
][
item
.
value
].
id
=
productId
// 渲染模版的数据
laytpl
(
getTreeTpl
).
render
(
treeData
[
id
][
item
.
value
],
function
(
html
)
{
treeData
[
id
][
item
.
value
].
productId
=
item
.
value
treeView
.
innerHTML
=
html
laytpl
(
getTreeTpl
).
render
(
treeData
[
id
][
item
.
value
],
function
(
html
)
{
})
treeView
.
innerHTML
=
html
var
treeListData
=
[]
})
$
.
each
(
products
,
function
(
index
,
i
)
{
var
treeListData
=
[]
if
(
item
.
value
==
i
.
productId
)
{
$
.
each
(
products
,
function
(
index
,
i
)
{
treeListData
=
i
.
merchantProTreeResponses
if
(
item
.
value
==
i
.
productId
)
{
}
treeListData
=
i
.
merchantProTreeResponses
})
}
var
treedom
=
'tree_'
+
productId
})
treeData
[
id
][
item
.
value
].
treeObj
=
tree
.
create
(
treedom
,
treeListData
,
{
checkedList
:
defaultList
,
chkDisabled
:
true
})
var
treedom
=
'tree_'
+
productId
}
treeData
[
id
][
item
.
value
].
treeObj
=
tree
.
create
(
treedom
,
treeListData
,
{
checkedList
:
defaultList
,
chkDisabled
:
true
})
}
}
}
})
})
</script>
</script>
</body>
</body>
...
...
html/merchant/edit.html
View file @
4ee7bae
...
@@ -523,9 +523,9 @@
...
@@ -523,9 +523,9 @@
}
else
{
}
else
{
merchantId
=
res
.
data
merchantId
=
res
.
data
merchantForm
.
merchantAccountLevel
=
parseInt
(
merchantForm
.
merchantAccountLevel
)
merchantForm
.
merchantAccountLevel
=
parseInt
(
merchantForm
.
merchantAccountLevel
)
getMerchantApi
(
merchantId
,
function
(
res
)
{
getMerchantApi
(
merchantId
,
function
(
res
pone
)
{
form
.
val
(
'merchantForm'
,
res
.
data
)
form
.
val
(
'merchantForm'
,
res
pone
.
data
)
merchantForm
=
res
.
data
merchantForm
=
res
pone
.
data
baseIsShow
(
false
)
baseIsShow
(
false
)
treeIsShow
(
true
)
treeIsShow
(
true
)
getById
()
getById
()
...
@@ -621,7 +621,6 @@
...
@@ -621,7 +621,6 @@
parent
.
append
(
subParent
)
parent
.
append
(
subParent
)
},
},
handleFirstCancel
()
{
handleFirstCancel
()
{
console
.
log
(
'??????????'
)
go
(
'merchant'
,
'index'
)
go
(
'merchant'
,
'index'
)
return
false
return
false
},
},
...
...
html/merchant/index.html
View file @
4ee7bae
...
@@ -20,14 +20,14 @@
...
@@ -20,14 +20,14 @@
}
}
.merchant
.layui-table-cell
{
.merchant
.layui-table-cell
{
/*
height: auto;
height
:
auto
;
overflow
:
visible
;
overflow
:
visible
;
text-overflow
:
inherit
;
text-overflow
:
inherit
;
white-space: normal;
*/
white-space
:
normal
;
height
:
auto
;
/*
height: auto;
overflow: hidden;
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
white-space
:
nowrap
;
white-space: nowrap;
*/
}
}
.merchant
#searchForm
.layui-inline
{
.merchant
#searchForm
.layui-inline
{
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<body>
<body>
<div
class=
"merchant"
id=
"app"
>
<div
class=
"merchant"
id=
"app"
>
<main>
<main
class=
"bg-white"
>
<!-- <div id="tree"></div> -->
<!-- <div id="tree"></div> -->
<div
class=
"context-block"
>
<div
class=
"context-block"
>
<div
class=
"search-block"
>
<div
class=
"search-block"
>
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
</form>
</form>
</div>
</div>
<table
class=
"layui-table"
id=
"merchantTable"
lay-filter=
"merchant-table-filter"
></table>
<table
class=
"layui-table"
id=
"merchantTable"
lay-filter=
"merchant-table-filter"
></table>
<div
id=
"merchantPage"
></div>
<div
id=
"merchantPage"
class=
"align-center"
></div>
</div>
</div>
</main>
</main>
</div>
</div>
...
@@ -114,22 +114,28 @@
...
@@ -114,22 +114,28 @@
<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
type=
"text/html"
id=
"merchantBtns"
>
<script
type=
"text/html"
id=
"merchantBtns"
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleDetail"
>
查看
<
/a
>
<
div
>
{{
#
if
((
d
.
btn
.
edit
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleDetail"
>
查看
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleEdit"
>
修改基本信息
<
/a
>
{{
#
if
((
d
.
btn
.
edit
)){
}}
{{
#
}
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleEdit"
>
修改基本信息
<
/a
>
{{
#
if
((
d
.
btn
.
edit
)){
}}
{{
#
}
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAuthority"
>
修改权限
<
/a
>
<
/div
>
{{
#
}
}}
<
div
>
{{
#
if
((
d
.
btn
.
createSubMerchant
)){
}}
{{
#
if
((
d
.
btn
.
edit
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddMerchant"
>
创建子商户
/
门店
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAuthority"
>
修改权限
<
/a
>
{{
#
}
}}
{{
#
}
}}
{{
#
if
((
d
.
btn
.
createStaff
)){
}}
{{
#
if
((
d
.
btn
.
editPeriod
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddStaff"
>
创建员工
<
/a
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleVaildPeriod"
>
修改账户有效期
<
/a
>
{{
#
}
}}
{{
#
}
}}
{{
#
if
((
d
.
btn
.
editPeriod
)){
}}
<
/div
>
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleVaildPeriod"
>
修改账户有效期
<
/a
>
<
div
>
{{
#
}
}}
{{
#
if
((
d
.
btn
.
createStaff
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddStaff"
>
创建员工
<
/a
>
{{
#
}
}}
{{
#
if
((
d
.
btn
.
createSubMerchant
)){
}}
<
a
class
=
"layui-btn-xs"
lay
-
event
=
"handleAddMerchant"
>
创建子商户
/
门店
<
/a
>
{{
#
}
}}
<
/div
>
</script>
</script>
<script>
<script>
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'laypage'
,
'layer'
],
function
()
{
layui
.
use
([
'gtree'
,
'request'
,
'helper'
,
'table'
,
'laypage'
,
'layer'
],
function
()
{
...
@@ -154,11 +160,10 @@
...
@@ -154,11 +160,10 @@
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
pageSize
:
10
}
}
var
pageOptions
=
{
var
pageOptions
=
{
elem
:
'merchantPage'
,
elem
:
'merchantPage'
,
groups
:
5
,
groups
:
5
,
layout
:
[
'
limit'
,
'
count'
,
'page'
,
'skip'
],
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
...
@@ -231,11 +236,11 @@
...
@@ -231,11 +236,11 @@
title
:
'更新时间'
,
title
:
'更新时间'
,
align
:
'center'
align
:
'center'
},
{
},
{
align
:
'
center
'
,
align
:
'
left
'
,
title
:
'操作'
,
title
:
'操作'
,
toolbar
:
'#merchantBtns'
,
toolbar
:
'#merchantBtns'
,
width
:
485
width
:
220
,
//
fixed: 'right'
fixed
:
'right'
}]
}]
]
]
})
})
...
@@ -423,7 +428,7 @@
...
@@ -423,7 +428,7 @@
}
}
})
})
var
options
=
{
var
options
=
{
data
:
data
.
data
data
:
data
.
data
,
}
}
pageOptions
.
count
=
data
.
count
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
if
(
isResetPageNum
)
{
...
...
html/role/index.html
View file @
4ee7bae
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
>
<div
id=
"app"
>
<main>
<main
class=
"bg-white"
>
<div
class=
"bg-white"
>
<div>
<form
action=
""
class=
"layui-form layui-form-pane"
lay-filter=
"roleForm"
>
<form
action=
""
class=
"layui-form layui-form-pane"
lay-filter=
"roleForm"
>
<div
class=
"layui-form-item"
pane
>
<div
class=
"layui-form-item"
pane
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addRole"
style=
"padding: 0 15px;"
>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addRole"
style=
"padding: 0 15px;"
>
...
@@ -39,17 +39,19 @@
...
@@ -39,17 +39,19 @@
</div>
</div>
</form>
</form>
<table
id=
"roleTable"
lay-filter=
"roleTool"
></table>
<table
id=
"roleTable"
lay-filter=
"roleTool"
></table>
<div
id=
"rolePage"
class=
"align-center"
></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>
<script
src=
"/js/load.js"
></script>
<script
src=
"/js/load.js"
></script>
<script>
<script>
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
],
function
()
{
layui
.
use
([
'table'
,
'form'
,
'request'
,
'helper'
,
'laypage'
],
function
()
{
var
request
=
layui
.
request
var
request
=
layui
.
request
var
table
=
layui
.
table
var
table
=
layui
.
table
var
form
=
layui
.
form
var
form
=
layui
.
form
var
helper
=
layui
.
helper
var
helper
=
layui
.
helper
var
laypage
=
layui
.
laypage
var
$
=
layui
.
$
var
$
=
layui
.
$
// 商户名称列表
// 商户名称列表
var
merchantName
=
$
(
"#merchantName"
)
var
merchantName
=
$
(
"#merchantName"
)
...
@@ -57,7 +59,6 @@
...
@@ -57,7 +59,6 @@
//创建table实例
//创建table实例
var
roleTable
=
table
.
render
({
var
roleTable
=
table
.
render
({
elem
:
'#roleTable'
,
elem
:
'#roleTable'
,
page
:
true
,
cols
:
[
cols
:
[
[
[
//表头
//表头
...
@@ -71,12 +72,37 @@
...
@@ -71,12 +72,37 @@
]
]
]
]
})
})
// 分页配置
var
page
=
{
pageNum
:
1
,
pageSize
:
10
}
var
pageOptions
=
{
elem
:
'rolePage'
,
groups
:
5
,
layout
:
[
'count'
,
'page'
,
'skip'
],
jump
:
function
(
obj
,
first
)
{
//obj包含了当前分页的所有参数,比如:
console
.
log
(
obj
.
curr
);
//得到当前页,以便向服务端请求对应页的数据。
console
.
log
(
obj
.
limit
);
//得到每页显示的条数
page
.
pageNum
=
obj
.
curr
page
.
pageSize
=
obj
.
limit
// getTabelList()
//首次不执行
if
(
!
first
)
{
//do something
getTabelList
()
}
}
}
getTabelList
(
roleTable
)
getTabelList
(
roleTable
)
// 获取table列表接口
// 获取table列表接口
function
getTabelList
(
table
,
search
=
{},
isResetPageNum
=
false
)
{
function
getTabelList
(
table
,
search
=
{},
isResetPageNum
)
{
var
params
=
helper
.
clone
(
false
,
{
var
params
=
helper
.
clone
(
false
,
{
pageNum
:
table
.
config
.
index
,
pageNum
:
page
.
pageNum
,
pageSize
:
table
.
config
.
limit
,
pageSize
:
page
.
pageSize
,
method
:
'org.ore.api.role.page'
method
:
'org.ore.api.role.page'
},
search
)
},
search
)
request
(
params
,
request
(
params
,
...
@@ -86,12 +112,12 @@
...
@@ -86,12 +112,12 @@
var
options
=
{
var
options
=
{
data
:
data
.
data
data
:
data
.
data
}
}
pageOptions
.
count
=
data
.
count
if
(
isResetPageNum
)
{
if
(
isResetPageNum
)
{
options
.
page
=
{
pageOptions
.
curr
=
1
curr
:
1
}
}
}
table
.
reload
(
options
)
laypage
.
render
(
pageOptions
)
roleTable
.
reload
(
options
)
}
}
)
)
}
}
...
@@ -151,7 +177,7 @@
...
@@ -151,7 +177,7 @@
$
(
document
).
on
(
'click'
,
'#roleSearch'
,
function
()
{
$
(
document
).
on
(
'click'
,
'#roleSearch'
,
function
()
{
var
searchData
=
form
.
val
(
'roleForm'
)
var
searchData
=
form
.
val
(
'roleForm'
)
console
.
log
(
searchData
)
console
.
log
(
searchData
)
getTabelList
(
roleTable
,
searchData
)
getTabelList
(
roleTable
,
searchData
,
true
)
})
})
})
})
</script>
</script>
...
...
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