Commit d974552a by 张杰

Merge branch 'dev_zj_1.7.0' into 'v1.7.0'

业务可见度增加校验

See merge request !10
2 parents 3f7b7b46 eb257f77
...@@ -222,6 +222,13 @@ export default { ...@@ -222,6 +222,13 @@ export default {
{ required: true, message: "请选择数据权限" }, { required: true, message: "请选择数据权限" },
{ validator: checkRolePermissionType, trigger: "change" }, { validator: checkRolePermissionType, trigger: "change" },
], ],
bizPermissionType: [
{
required: true,
message: "请选择业务数据可见度",
trigger: "change",
},
],
menuIdList: [{ required: true, validator: checkMenu, trigger: "blur" }], menuIdList: [{ required: true, validator: checkMenu, trigger: "blur" }],
}, },
treedata: [], treedata: [],
...@@ -263,12 +270,12 @@ export default { ...@@ -263,12 +270,12 @@ export default {
// 业务数据可见度 // 业务数据可见度
let row = this.dataVisibilityList; let row = this.dataVisibilityList;
let arr = [] let arr = [];
for(let k in row){ for (let k in row) {
let m = {} let m = {};
m.type = k m.type = k;
m.visibility = row[k] m.visibility = row[k];
arr.push(m) arr.push(m);
} }
params.bizDataPermissions = arr; params.bizDataPermissions = arr;
...@@ -340,19 +347,23 @@ export default { ...@@ -340,19 +347,23 @@ export default {
editEvent(row) { editEvent(row) {
const that = this; const that = this;
roleInfo({ id: row.id }).then((res) => { roleInfo({ id: row.id }).then((res) => {
let obj = res.data || {} let obj = res.data || {};
this.roleForm = JSON.parse(JSON.stringify(res.data)); this.roleForm = JSON.parse(JSON.stringify(res.data));
this.roleForm.enableStatus = res.data.enableStatus == 1 ? true : false; this.roleForm.enableStatus = res.data.enableStatus == 1 ? true : false;
this.roleForm.roleVisibility = res.data.roleVisibility; this.roleForm.roleVisibility = res.data.roleVisibility;
this.roleForm.rolePermissionType = res.data.rolePermissionType; this.roleForm.rolePermissionType = res.data.rolePermissionType;
let list = obj.bizDataPermissions||[] let list = obj.bizDataPermissions || [];
let options = {} let options = {};
if(list && list.length>0){ if (list && list.length > 0) {
list.map(k => { list.map((k) => {
options[k.type] = k.visibility options[k.type] = k.visibility;
}) });
this.$set(this.roleForm,'bizPermissionType',Number(list[0].type)) this.$set(this.roleForm, "bizPermissionType", Number(list[0].type));
} else {
// 针对历史数据,写个默认数据
options[1] = 1;
this.$set(this.roleForm, "bizPermissionType", 2);
} }
this.dataVisibilityList = options; this.dataVisibilityList = options;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!