feat: There is no way the, buss tree auth

This commit is contained in:
super_liu
2022-02-21 17:45:33 +08:00
parent 1c63566ad0
commit 51d2c8c0e0
2 changed files with 80 additions and 11 deletions
@@ -2380,6 +2380,36 @@ export default {
}
},
methods: {
async getTreeAsync(){
let tsResource = await this.selectMenuList()
let sarMenuStandard = await this.selectMenu2()
let list1 = []
let list2 = []
if(tsResource && tsResource.ok && tsResource.data){
list1 = tsResource.data
}
if(sarMenuStandard && sarMenuStandard.ok && sarMenuStandard.data){
list2 = sarMenuStandard.data
}
if(list2.length > 0){
list1 = list1.concat(list2)
}
if(list1.length > 0){
this.treeList = this.sortByKey(list1,"displaySeq")
}
},
sortByKey(ary, key) {
return ary.sort(function (a, b) {
let x = a[key]
let y = b[key]
return ((x < y) ? -1 : (x > y) ? 1 : 0)
})
},
formatIssueDate(str) {
if(str && str.length > 10){
str = str.substring(0,10)
@@ -2729,13 +2759,26 @@ export default {
},
// 查询二级菜单
selectMenuList() {
this.$http.get('sarResource/ts-resource/getList', {
sorDivide: 'BUSINESS_STAND',
userId: this.$store.getters.userInfo.userId
}, {}, res => {
if (res.ok) {
this.treeList = res.data
}
return new Promise((resolve, reject) => {
this.$http.get('sarResource/ts-resource/getListStand', {
sorDivide: 'BUSINESS_STAND',
userId: this.$store.getters.userInfo.userId
}, {
_this: this
}, res => {
const history = res;
resolve(history)
})
})
},
selectMenu2(res,json) {
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarMenuStandard/getListStand', {dicId:'9m4qqqaansxmox5e82zm'}, {
_this: this
}, res => {
const history = res;
resolve(history)
})
})
},
// 查询二级菜单
@@ -3132,6 +3175,7 @@ export default {
saveConfigStand() {
let search = {}
search.menuId = this.selectSarMenu.id
search.treeType = this.selectSarMenu.treeType
if (this.selectConfigStand.length === 0) {
this.$message({
showClose: true,
@@ -3840,7 +3884,21 @@ export default {
this.$message.error('请选择二级及以下目录')
} else {
this.configStandFlag = true
this.sarConfigStandSearch.menuId = 'nomenu'
if(this.selectSarMenu.treeType === 'sarMs'){
this.sarConfigStandSearch.menuId = 'nomenu'
this.sarConfigStandSearch.sarMsMenuId = menuId
this.sarConfigStandSearch.sarMsType = 'filterSarMsMenu'
let sarMenu = this.selectSarMenu.parentIds.split(",");
this.sarConfigStandSearch.menuTopId = sarMenu[0]
// if(this.selectSarMenu.parentId === sarMenu[0]){
// this.sarConfigStandSearch.menuTopId = this.selectSarMenu.id
// }else {
// this.sarConfigStandSearch.menuTopId = sarMenu[1]
// }
}else {
this.sarConfigStandSearch.menuId = 'nomenu'
this.sarConfigStandSearch.sarMsType = ''
}
this.sarConfigStandSearch.page = 1
this.selectConfiguraStand()
}
@@ -3873,6 +3931,7 @@ export default {
let search = {}
// 取最外层目录id
search.menuId = this.selectSarMenu.id
search.treeType = this.selectSarMenu.treeType
// search.menuId = this.removeOneId
search.idlist = []
// search.menuId = this.removeOneId
@@ -4028,9 +4087,12 @@ export default {
return data.menuName.indexOf(value) !== -1;
},
treeClick(treeNode) {
console.log(treeNode)
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.sarBussionessSearch.menuId = treeNode.id
this.sarBussionessSearch.menuId = treeNode.id // 将当前二级菜单的id传回后台做标准的条件查询
this.standCommonlySearch.treeType = treeNode.treeType
this.sarBussionessSearch.treeType = treeNode.treeType
this.sarBussionessSearch.page = 1
this.sarBussionessSearch.page = 1
this.getBussionStandTable(this.tableFlag) // 根据选中的二级菜单查询对应的标准列表
@@ -4191,12 +4253,16 @@ export default {
this.sarBussionessSearch.pageSize = this.$store.getters.userInfo.configContent
const data = item || this.sarBussionessSearch
const formData = {...data}
console.log(item)
debugger
if (!item) {
formData.menuId = this.sarBussionessSearch.menuId
formData.treeType = this.sarBussionessSearch.treeType
} else {
formData.menuId = this.selectSarMenu.id
formData.treeType = this.selectSarMenu.treeType
}
if (nodeId !== undefined) {
if (nodeId !== undefined && nodeId !== '') {
formData.menuId = nodeId
}
if (this.sarBussionessSearch.menuId == null || this.sarBussionessSearch.menuId === '') {
@@ -4897,7 +4963,7 @@ export default {
mounted() {
this.treeReload = true
// 进入页面后查询树形结构目录
this.selectMenuList()
this.getTreeAsync()
this.dragControllerLR()
// 查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {