数据权限增加动态显隐、表单数据自动代入

dev
smallchill 6 years ago
parent 7f46b2470d
commit 4cfafd538f
  1. 60
      src/views/authority/datascope.vue

@ -399,6 +399,36 @@
},
watch: {
'formScope.scopeType'() {
this.initScope();
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.menu_add, false),
viewBtn: this.vaildData(this.permission.menu_view, false),
delBtn: this.vaildData(this.permission.menu_delete, false),
editBtn: this.vaildData(this.permission.menu_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
},
scopeIds() {
let ids = [];
this.selectionListScope.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
initScope() {
const scopeType = this.formScope.scopeType;
let column = "-", name = "暂无";
if (scopeType === "1") {
@ -431,34 +461,7 @@
item.display = scopeType === '5';
}
});
}
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.menu_add, false),
viewBtn: this.vaildData(this.permission.menu_view, false),
delBtn: this.vaildData(this.permission.menu_delete, false),
editBtn: this.vaildData(this.permission.menu_edit, false)
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
},
scopeIds() {
let ids = [];
this.selectionListScope.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
//
rowSave(row, loading, done) {
add(row).then(() => {
@ -651,6 +654,9 @@
});
},
beforeOpenScope(done, type) {
if (["add"].includes(type)) {
this.initScope();
}
if (["edit", "view"].includes(type)) {
getMenuDataScope(this.formScope.id).then(res => {
this.formScope = res.data.data;

Loading…
Cancel
Save