|
@@ -169,6 +169,9 @@ export default {
|
|
this.checksBoxTs(data1, data2, 'add')
|
|
this.checksBoxTs(data1, data2, 'add')
|
|
} else {
|
|
} else {
|
|
this.checksBoxTs(data2, data1, 'del')
|
|
this.checksBoxTs(data2, data1, 'del')
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ location.reload()
|
|
|
|
+ }, 1500);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//获取权限规则回调
|
|
//获取权限规则回调
|
|
@@ -228,7 +231,6 @@ export default {
|
|
} else {
|
|
} else {
|
|
this.checksBoxTs(data2, data1, 'del')
|
|
this.checksBoxTs(data2, data1, 'del')
|
|
}
|
|
}
|
|
- // this.editRole();
|
|
|
|
} else {
|
|
} else {
|
|
console.log("error submit!!");
|
|
console.log("error submit!!");
|
|
return false;
|
|
return false;
|
|
@@ -237,6 +239,10 @@ export default {
|
|
},
|
|
},
|
|
async checksBoxTs (datas, arr, type) {
|
|
async checksBoxTs (datas, arr, type) {
|
|
const res = [...datas, ...arr].filter(item => !(datas.some(p => item.auth_id == p.auth_id) && arr.some(c => item.auth_id == c.auth_id)))
|
|
const res = [...datas, ...arr].filter(item => !(datas.some(p => item.auth_id == p.auth_id) && arr.some(c => item.auth_id == c.auth_id)))
|
|
|
|
+ // if (type == 'del') {
|
|
|
|
+ // this.$store.dispatch('auth/changeAuthStatus', res)
|
|
|
|
+ // }
|
|
|
|
+ const [msg1, msg2] = [[], []]
|
|
if (res && res.length) {
|
|
if (res && res.length) {
|
|
for (let i = 0; i < res.length; i++) {
|
|
for (let i = 0; i < res.length; i++) {
|
|
let obj = {
|
|
let obj = {
|
|
@@ -249,7 +255,7 @@ export default {
|
|
authObj.query_row_condition = authObj.QueryRow
|
|
authObj.query_row_condition = authObj.QueryRow
|
|
}
|
|
}
|
|
if (authObj.QueryCol) {
|
|
if (authObj.QueryCol) {
|
|
- authObj.query_col_condition = authObj.QueryCol
|
|
|
|
|
|
+ authObj.query_col_conditon = authObj.QueryCol
|
|
}
|
|
}
|
|
if (authObj.NewCol) {
|
|
if (authObj.NewCol) {
|
|
authObj.new_col_condition = authObj.NewCol
|
|
authObj.new_col_condition = authObj.NewCol
|
|
@@ -265,47 +271,53 @@ export default {
|
|
}
|
|
}
|
|
obj.event = 1
|
|
obj.event = 1
|
|
authObj.event = 1
|
|
authObj.event = 1
|
|
|
|
+ msg1.push(obj)
|
|
|
|
+ msg2.push(authObj)
|
|
} else {
|
|
} else {
|
|
obj.event = 3
|
|
obj.event = 3
|
|
authObj.event = 3
|
|
authObj.event = 3
|
|
|
|
+ msg1.push(obj)
|
|
|
|
+ msg2.push(authObj)
|
|
}
|
|
}
|
|
- GeneralDataReception({
|
|
|
|
- serviceId: SERVICE_ID.roleMsgTreeId,
|
|
|
|
- dataContent: JSON.stringify(obj)
|
|
|
|
- }).then(result => {
|
|
|
|
- if (result.code == 0) {
|
|
|
|
- if (obj.event == 1) {
|
|
|
|
- this.$message.success('添加权限', res.message)
|
|
|
|
- } else {
|
|
|
|
- this.$message.success('取消权限', res.message)
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ GeneralDataReception({
|
|
|
|
+ serviceId: SERVICE_ID.roleMsgTreeId,
|
|
|
|
+ dataContent: JSON.stringify(msg1)
|
|
|
|
+ // dataContent: msg1
|
|
|
|
+ }).then(result => {
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.$message.success('添加权限', res.message)
|
|
} else {
|
|
} else {
|
|
- if (obj.event == 1) {
|
|
|
|
- this.$message.success('添加权限', res.message)
|
|
|
|
- } else {
|
|
|
|
- this.$message.success('取消权限', res.message)
|
|
|
|
- }
|
|
|
|
|
|
+ this.$message.success('取消权限', res.message)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- GeneralDataReception({
|
|
|
|
- serviceId: SERVICE_ID.roleMsgAuthId,
|
|
|
|
- dataContent: JSON.stringify(authObj)
|
|
|
|
- }).then(result => {
|
|
|
|
- if (result.code == 0) {
|
|
|
|
- if (obj.event == 1) {
|
|
|
|
- this.$message.success('添加规则', res.message)
|
|
|
|
- } else {
|
|
|
|
- this.$message.success('取消规则', res.message)
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.$message.error('添加权限', res.message)
|
|
} else {
|
|
} else {
|
|
- if (obj.event == 1) {
|
|
|
|
- this.$message.success('添加规则', res.message)
|
|
|
|
- } else {
|
|
|
|
- this.$message.success('取消规则', res.message)
|
|
|
|
- }
|
|
|
|
|
|
+ this.$message.error('取消权限', res.message)
|
|
}
|
|
}
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ GeneralDataReception({
|
|
|
|
+ serviceId: SERVICE_ID.roleMsgAuthId,
|
|
|
|
+ dataContent: JSON.stringify(msg2)
|
|
|
|
+ // dataContent: msg2
|
|
|
|
+ }).then(result => {
|
|
|
|
+ if (result.code == 0) {
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.$message.success('添加规则', res.message)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.success('取消规则', res.message)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ this.$message.error('添加规则', res.message)
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('取消规则', res.message)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
this.$message.error('未选中数据')
|
|
this.$message.error('未选中数据')
|
|
}
|
|
}
|