Commit f8ca01b2 by 胡悦

提交角色修改

1 parent a0778518
......@@ -217,6 +217,7 @@
if (qs('channel')) {
$('#merchantIdText').text(qs('merchantName'))
getList(qs('merchantId'))
merchantId = qs('merchantId')
$('#merchantIdText').removeClass('hide')
$('#merchantIdText').addClass('show')
} else {
......@@ -340,17 +341,19 @@
if (id) {
getById(function(checkedList) {
visibleMerchant = tree.create('visibleInferiorMerTree', res.data, { checkedList: checkedList })
var node = visibleMerchant.getNodesByParam('id', merchantId)
visibleMerchant.checkNode(node, true, true)
// var node = visibleMerchant.getNodesByParam('id', merchantId)
// visibleMerchant.checkNode(node, true, true)
all_nodes = visibleMerchant.getNodes()
bindEvent()
})
} else {
console.log(11)
const arr = []
arr.push(merchantId)
visibleMerchant = tree.create('visibleInferiorMerTree', res.data)
var node = visibleMerchant.getNodesByParam('id', merchantId)
console.log(node, visibleMerchant)
var node = visibleMerchant.getNodesByParam('id', merchantId, {checkedList: arr})
// console.log(node, visibleMerchant)
// node.checked = true
visibleMerchant.checkNode(node, true, true)
// visibleMerchant.updateNode(node)
......
......@@ -347,6 +347,7 @@
var str = $('<input lay-filter="switch" type="checkbox" name="accounttypeId" value="' + item.accounttypeId + '" title="' + item.accounttypeName + '" />')
accountType.append(str)
if (roleid) {
console.log(check_arr)
// 角色权限的check
for (var i = 0; i < check_arr.length; i++) {
if (check_arr[i].accounttypeId == item.accounttypeId) {
......@@ -356,25 +357,21 @@
active.tabAdd(obj)
var selectArr = []
var menuData = []
for (var j = 0; j < productData.productList.length; j++) {
if (productData.productList) {
for (var j = 0; j < productData.productList.length; j++) {
menuData = productData.productList[j]
selectArr.push(menuData.productId)
active.treeTabAdd(
{
active.treeTabAdd({
name: menuData.productName,
value: menuData.productId
},
item.accounttypeId,
item.products,
menuData.idList
)
}, item.accounttypeId, item.products, menuData.idList
)}
selectEl[item.accounttypeId].setValue(selectArr)
var filterName = 'treeTab' + item.accounttypeId
var productId = 'tab_' + item.accounttypeId + '_' + item.products[0].productId
console.log(filterName, productId)
active.tabChange(filterName, productId)
}
// // 产品的回显
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) {
......@@ -396,15 +393,17 @@
request(params, function(res) {
if (res.code == '0') {
console.log(res.data, '详情')
var data = res.data
var accounttypeId = ''
if (res.data.responseList) {
check_arr = res.data.responseList
if (data.responseList) {
check_arr = data.responseList
}
console.log(check_arr, 'jklj')
// findMenuFunTreeByMerId()
findMenuFunTreeByMerId(data.merchantId)
form.val('roleForm', {
roleName: res.data.roleName,
roleDescription: res.data.roleDescription
roleName: data.roleName,
roleDescription: data.roleDescription,
merchantId: data.merchantId
})
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!