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 edc4451a
authored
Sep 30, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改新增
1 parent
819f2af5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
119 deletions
html/merchant/add.html
html/merchant/edit.html
html/merchant/add.html
View file @
edc4451
This diff is collapsed.
Click to expand it.
html/merchant/edit.html
View file @
edc4451
...
@@ -1342,14 +1342,11 @@
...
@@ -1342,14 +1342,11 @@
</div>
</div>
</div>
</div>
</div>`
</div>`
// var getTpl = tpl//rolesAuth.innerHTML, // 模板内容
view
=
document
.
getElementById
(
'role'
+
id
)
view
=
document
.
getElementById
(
'role'
+
id
)
templateData
.
id
=
id
// 渲染模版的数据
templateData
.
id
=
id
// 渲染模版的数据
laytpl
(
getTpl
).
render
(
templateData
,
function
(
html
)
{
laytpl
(
getTpl
).
render
(
templateData
,
function
(
html
)
{
view
.
innerHTML
=
html
view
.
innerHTML
=
html
})
})
// var productList = []
// var products = []
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
id
).
products
var
products
=
menuFunTreeData
.
find
(
item
=>
item
.
accounttypeId
==
id
).
products
products
.
forEach
(
i
=>
{
products
.
forEach
(
i
=>
{
var
str
=
$
(
'<input lay-filter="filter" data-id="'
+
id
+
'" type="checkbox" name="check['
+
id
+
']" value="'
+
i
.
productId
+
'" title="'
+
i
.
productName
+
'" lay-skin="primary" />'
)
var
str
=
$
(
'<input lay-filter="filter" data-id="'
+
id
+
'" type="checkbox" name="check['
+
id
+
']" value="'
+
i
.
productId
+
'" title="'
+
i
.
productName
+
'" lay-skin="primary" />'
)
...
@@ -1363,41 +1360,6 @@
...
@@ -1363,41 +1360,6 @@
}
}
form
.
render
()
form
.
render
()
})
})
// $.each(menuFunTreeData, function(index, item) {
// if (item.accounttypeId == id) {
// products = item.products
// $.each(item.products, function(idx, i) {
// productList.push({
// name: i.productName,
// value: i.productId
// })
// })
// }
// })
// selectEl[id] = xmSelect.render({
// el: '#select' + id,
// data: productList,
// on: function(data) {
// //arr: 当前多选已选中的数据
// var arr = data.arr
// //change, 此次选择变化的数据,数组
// var change = data.change
// //isAdd, 此次操作是新增还是删除
// var isAdd = data.isAdd
// var filterName = 'treeTab' + id
// if (isAdd) {
// active.treeTabAdd(change[0], id, products)
// } else {
// var productId = 'tab_' + id + '_' + change[0].value
// delete treeData[id][change[0].value]
// active.tabDelete(filterName, productId)
// }
// if (arr.length != 0) {
// var productId = 'tab_' + id + '_' + arr[0].value
// active.tabChange(filterName, productId)
// }
// }
// })
},
},
// tab删除
// tab删除
tabDelete
:
function
(
name
,
id
)
{
tabDelete
:
function
(
name
,
id
)
{
...
@@ -1434,12 +1396,6 @@
...
@@ -1434,12 +1396,6 @@
laytpl
(
getTreeTpl
).
render
(
treeData
[
id
][
item
.
value
],
function
(
html
)
{
laytpl
(
getTreeTpl
).
render
(
treeData
[
id
][
item
.
value
],
function
(
html
)
{
treeView
.
innerHTML
=
html
treeView
.
innerHTML
=
html
})
})
// var treeListData = []
// $.each(products, function(index, i) {
// if (item.value == i.productId) {
// treeListData = i.merchantProTreeResponses
// }
// })
var
treedom
=
'tree_'
+
productId
var
treedom
=
'tree_'
+
productId
// if (!merchantId) {
// if (!merchantId) {
// if (editLevel == 1 || editLevel == 2) {
// if (editLevel == 1 || editLevel == 2) {
...
@@ -1541,24 +1497,25 @@
...
@@ -1541,24 +1497,25 @@
str
.
attr
(
'checked'
,
true
)
str
.
attr
(
'checked'
,
true
)
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
var
obj
=
{
title
:
item
.
accounttypeName
,
value
:
item
.
accounttypeId
}
active
.
tabAdd
(
obj
,
productData
.
products
)
active
.
tabAdd
(
obj
,
productData
.
products
)
productData
.
products
.
forEach
(
j
=>
{
if
(
productData
.
products
&&
productData
.
products
.
length
!=
0
)
{
console
.
log
(
j
,
item
)
productData
.
products
.
forEach
(
j
=>
{
var
products
=
item
.
products
.
find
(
n
=>
n
.
productId
==
j
.
productId
)
var
products
=
item
.
products
.
find
(
n
=>
n
.
productId
==
j
.
productId
)
console
.
log
(
products
)
console
.
log
(
products
)
active
.
treeTabAdd
(
active
.
treeTabAdd
(
{
{
name
:
j
.
productName
,
name
:
j
.
productName
,
value
:
j
.
productId
value
:
j
.
productId
},
},
item
.
accounttypeId
,
item
.
accounttypeId
,
products
.
merchantProTreeResponses
,
products
.
merchantProTreeResponses
,
j
.
menuIds
j
.
menuIds
)
)
})
})
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
filterName
=
'treeTab'
+
item
.
accounttypeId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
productData
.
products
[
0
].
productId
var
productId
=
'tab_'
+
item
.
accounttypeId
+
'_'
+
productData
.
products
[
0
].
productId
console
.
log
(
filterName
,
productId
)
console
.
log
(
filterName
,
productId
)
active
.
tabChange
(
filterName
,
productId
)
active
.
tabChange
(
filterName
,
productId
)
}
}
}
})
})
}
}
...
@@ -1566,54 +1523,6 @@
...
@@ -1566,54 +1523,6 @@
if
(
check_arr
.
length
!=
0
)
{
if
(
check_arr
.
length
!=
0
)
{
active
.
tabChange
(
'roleAuth'
,
check_arr
[
0
].
accounttypeId
)
active
.
tabChange
(
'roleAuth'
,
check_arr
[
0
].
accounttypeId
)
}
}
// $.each(menuFunTreeData, function(index, item) {
// var str = $('<input lay-filter="switch" type="checkbox" name="accounttypeId" value="' + item.accounttypeId + '" title="' + item.accounttypeName + '" />')
// accountType.append(str)
// if (merchantId) {
// // 角色权限的check
// for (var i = 0; i < check_arr.length; i++) {
// if (check_arr[i].accounttypeId == item.accounttypeId) {
// var productData = check_arr[i]
// str.attr('checked', true)
// var obj = {
// title: item.accounttypeName,
// value: item.accounttypeId
// }
// active.tabAdd(obj)
// var selectArr = []
// var menuData = []
// for (var j = 0; j < productData.products.length; j++) {
// menuData = productData.products[j]
// selectArr.push(menuData.productId)
// var idList = ''
// if (menuData.menuIds) {
// idList = menuData.menuIds.concat(menuData.functionIds)
// } else {
// idList = menuData.functionIds
// }
// active.treeTabAdd(
// {
// name: menuData.productName,
// value: menuData.productId
// },
// item.accounttypeId,
// item.products,
// idList
// )
// }
// // // 产品的回显
// selectEl[item.accounttypeId].setValue(selectArr)
// var filterName = 'treeTab' + item.accounttypeId
// var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId
// active.tabChange(filterName, productId)
// // 树的回显
// }
// }
// if (check_arr.length != 0) {
// active.tabChange('roleAuth', check_arr[0].accounttypeId)
// }
// }
// })
form
.
render
(
'checkbox'
)
form
.
render
(
'checkbox'
)
}
}
})
})
...
@@ -1755,15 +1664,6 @@
...
@@ -1755,15 +1664,6 @@
}
}
})
})
</script>
</script>
<script
type=
"text/html"
id=
"rolesAuth"
>
<
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
>
</script>
<script
type=
"text/html"
id=
"treeAuth"
>
<script
type=
"text/html"
id=
"treeAuth"
>
<
ul
id
=
"tree_{{d.id}}"
class
=
"ztree wrapper-tree"
><
/ul
>
<
ul
id
=
"tree_{{d.id}}"
class
=
"ztree wrapper-tree"
><
/ul
>
</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