fix: 数据权限
This commit is contained in:
@@ -640,6 +640,7 @@ export default {
|
||||
// return row.id !== this.user.id
|
||||
return true
|
||||
},
|
||||
// 重置密码
|
||||
resetPassword(row) {
|
||||
this.$confirm(i18n.t('User.msg.m1'), i18n.t('common.Tips'), {
|
||||
confirmButtonText: i18n.t('common.Confirm'),
|
||||
@@ -693,6 +694,7 @@ export default {
|
||||
this.flag = false
|
||||
this.giveValue(row)
|
||||
},
|
||||
// 打开数据权限
|
||||
openDataDialog(row) {
|
||||
// 清空数据 应该需要初始化赋值
|
||||
this.dataDialog = {}
|
||||
@@ -713,7 +715,7 @@ export default {
|
||||
this.$nextTick(function() {
|
||||
for (var index = 0; index < res.length; index++) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].value == res[index].permissionScopeType) {
|
||||
if (this.dataDialog.dataScopeType[i].value === res[index].permission_scope_type) {
|
||||
this.dataDialog.dataScopeType[i].permission_id = res[index].permission_id
|
||||
if (res[index].users) this.dataDialog.dataScopeType[i].users = res[index].users
|
||||
if (res[index].depts) this.dataDialog.dataScopeType[i].depts = res[index].depts
|
||||
@@ -731,6 +733,7 @@ export default {
|
||||
getRows(val) { // 获取行数据
|
||||
this.multipleSelection = val
|
||||
},
|
||||
// 选择权限
|
||||
openRelevance(row, index) {
|
||||
for (var i = 0; i < this.permissions.length; i++) {
|
||||
if (this.permissions[i].permission_id != undefined && this.permissions[i].permission_id && this.permissions[i].permission_id != row.permission_id) {
|
||||
@@ -739,41 +742,46 @@ export default {
|
||||
}
|
||||
this.$set(this.dataDialog.dataScopeType[index], this.dataDialog.dataScopeType[index].permission_id, row.permission_id)
|
||||
this.rowData = {}
|
||||
// 提供给另一个dialog的数据
|
||||
this.deptIds = []
|
||||
this.userIds = []
|
||||
if (row.permission_id == '1605129738328870912') { // 选择用户
|
||||
this.userIds = this.dataDialog.dataScopeType[index].users
|
||||
this.rowData = row
|
||||
// 打开用户关系对话框
|
||||
this.relevanceUser = true
|
||||
} else if (row.permission_id == '1605129882164137984') { // 选择部门
|
||||
this.deptIds = this.dataDialog.dataScopeType[index].depts
|
||||
this.rowData = row
|
||||
// 打开部门关系对话框
|
||||
this.relevanceDept = true
|
||||
} else if (row.permission_id == '1605128919449735168') { // 自身
|
||||
const param = {
|
||||
userId: this.dataDialog.userId
|
||||
}
|
||||
this.dataDialog.dataScopeType[index].users = []
|
||||
this.dataDialog.dataScopeType[index].users.push(param)
|
||||
this.dataDialog.dataScopeType[index].users = this.dataDialog.user_id
|
||||
} else { // 其他应该清空
|
||||
this.dataDialog.dataScopeType[index].depts = []
|
||||
this.dataDialog.dataScopeType[index].users = []
|
||||
}
|
||||
},
|
||||
selectUsers(row) { // row对话框传来的数据
|
||||
// row 用户关系对话框传来的数据
|
||||
selectUsers(row) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dict_id) {
|
||||
if (this.dataDialog.dataScopeType[i].depts != undefined && this.dataDialog.dataScopeType[i].depts.length > 0) this.dataDialog.dataScopeType[i].depts = []
|
||||
this.dataDialog.dataScopeType[i].users = row
|
||||
if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dict_id) {
|
||||
if (this.dataDialog.dataScopeType[i].depts !== undefined && this.dataDialog.dataScopeType[i].depts.length > 0) {
|
||||
this.dataDialog.dataScopeType[i].depts = []
|
||||
}
|
||||
this.dataDialog.dataScopeType[i].users = row.map(item => item.user_id)
|
||||
break
|
||||
}
|
||||
}
|
||||
this.rowData = {}
|
||||
},
|
||||
// row 部门关系对话框传来的数据
|
||||
selectDepts(row) {
|
||||
for (var i = 0; i < this.dataDialog.dataScopeType.length; i++) {
|
||||
if (this.dataDialog.dataScopeType[i].dict_id == this.rowData.dictId) {
|
||||
if (this.dataDialog.dataScopeType[i].users != undefined && this.dataDialog.dataScopeType[i].users.length > 0) this.dataDialog.dataScopeType[i].users = []
|
||||
if (this.dataDialog.dataScopeType[i].dict_id === this.rowData.dict_id) {
|
||||
if (this.dataDialog.dataScopeType[i].users !== undefined && this.dataDialog.dataScopeType[i].users.length > 0) {
|
||||
this.dataDialog.dataScopeType[i].users = []
|
||||
}
|
||||
this.dataDialog.dataScopeType[i].depts = row
|
||||
break
|
||||
}
|
||||
@@ -877,7 +885,7 @@ export default {
|
||||
},
|
||||
showDatas(row) {
|
||||
const param = {
|
||||
userId: this.dataDialog.userId,
|
||||
userId: this.dataDialog.user_id,
|
||||
permissionScopeType: row.value
|
||||
}
|
||||
crudDataPermission.getDataDetail(param).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user