Commit f6366254 by yangming

role

1 parent 2c2d1ff6
...@@ -96,7 +96,8 @@ export default { ...@@ -96,7 +96,8 @@ export default {
const { tabName, tabMenu, productTab } = this const { tabName, tabMenu, productTab } = this
console.log(tabName, data, productTab, '选中') console.log(tabName, data, productTab, '选中')
// 设置全选 // 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses var merchantProTreeResponses = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab)
var arr = merchantProTreeResponses ? merchantProTreeResponses.merchantProTreeResponses : ''
this.$refs[`tree_${tabName}_${productTab}`] ? this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) : '' this.$refs[`tree_${tabName}_${productTab}`] ? this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) : ''
this.$nextTick(() => { this.$nextTick(() => {
this.addStyle() this.addStyle()
...@@ -130,7 +131,7 @@ export default { ...@@ -130,7 +131,7 @@ export default {
}) })
if (status) { if (status) {
this.$set(this.tabMenu, idx, menuSelect[0]) this.$set(this.tabMenu, idx, menuSelect[0])
this.tabName = this.tabMenu[idx].accounttypeId this.tabName = this.tabMenu[idx] ? this.tabMenu[idx].accounttypeId : ''
} else { } else {
this.$set(this.tabMenu, idx, '') this.$set(this.tabMenu, idx, '')
let accounttypeId = this.tabMenu.find(item => item) let accounttypeId = this.tabMenu.find(item => item)
...@@ -191,6 +192,7 @@ export default { ...@@ -191,6 +192,7 @@ export default {
}, },
// 获取已选择的权限 // 获取已选择的权限
findPermissionsByMerId(arr) { findPermissionsByMerId(arr) {
console.log(arr)
let accounttypeId = [] let accounttypeId = []
arr.forEach(item => { arr.forEach(item => {
accounttypeId.push(item.accounttypeId) accounttypeId.push(item.accounttypeId)
...@@ -206,26 +208,27 @@ export default { ...@@ -206,26 +208,27 @@ export default {
if (i.productId == j.productId) { if (i.productId == j.productId) {
itm.productsArr.push(j) itm.productsArr.push(j)
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => {
this.addStyle() this.addStyle()
this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : '' this.$refs[`tree_${itm.accounttypeId}_${j.productId}`] ? this.$refs[`tree_${itm.accounttypeId}_${j.productId}`][0].setCheckedKeys(i.idList) : ''
}, 300)
}) })
} }
}) })
}) })
}else { } else {
this.tabMenu[index] = '' this.tabMenu[index] = ''
} }
}) })
}) })
this.tabMenu.forEach(item => {
if (item && item.accounttypeId) {
console.log(item)
this.tabName = item.accounttypeId
this.productTab = item.productsArr[0]?item.productsArr[0].productId: ''
return false;
}
})
this.tabMenuStatus = this.tabMenu.some(item => item) this.tabMenuStatus = this.tabMenu.some(item => item)
let tabMenu = this.tabMenu.filter((item, index) => {
return item && item.accounttypeId && this.tabMenu[index].productsArr.length>0
})
setTimeout(() => {
this.tabName = tabMenu[0].accounttypeId
this.productTab = tabMenu[0].productsArr[0].productId
}, 100)
}, },
resetView() { resetView() {
this.tabMenu = [] this.tabMenu = []
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!