feat default permission

This commit is contained in:
smallwei 2019-02-15 16:23:13 +08:00
parent f9ea716287
commit 6d5bbcaf9c
7 changed files with 77 additions and 0 deletions

View File

@ -4,6 +4,7 @@
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
:before-open="beforeOpen"
:page="page"
@search-change="searchChange"
@ -23,6 +24,7 @@
<script>
import { getApiList, getApiLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -103,6 +105,15 @@ export default {
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_api_view
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);

View File

@ -5,6 +5,7 @@
ref="crud"
:before-open="beforeOpen"
v-model="form"
:permission="permissionList"
:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@ -23,6 +24,7 @@
<script>
import { getErrorList, getErrorLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -103,6 +105,14 @@ export default {
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_error_view
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);

View File

@ -4,6 +4,7 @@
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
:page="page"
:before-open="beforeOpen"
@search-change="searchChange"
@ -23,6 +24,7 @@
<script>
import { getUsualList, getUsualLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -103,6 +105,14 @@ export default {
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_usual_view
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);

View File

@ -5,6 +5,7 @@
ref="crud"
v-model="form"
:page="page"
:permission="permissionList"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@ -33,6 +34,7 @@
<script>
import { getList, remove, update, add } from "@/api/system/param";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -69,6 +71,15 @@ export default {
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.param_add,
viewBtn: this.permission.param_view,
delBtn: this.permission.param_delete,
editBtn: this.permission.param_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {

View File

@ -4,6 +4,7 @@
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@ -63,6 +64,7 @@ import {
getTree,
getRole
} from "@/api/system/role";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -107,6 +109,15 @@ export default {
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.role_add,
viewBtn: this.permission.role_view,
delBtn: this.permission.role_delete,
editBtn: this.permission.role_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {

View File

@ -4,6 +4,7 @@
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@ -18,10 +19,12 @@
size="small"
icon="el-icon-delete"
plain
v-if="permission.user_delete"
@click="handleDelete"> </el-button>
<el-button type="primary"
size="small"
plain
v-if="permission. user_reset"
icon="el-icon-refresh"
@click="handleReset">密码重置</el-button>
</template>
@ -46,6 +49,7 @@ import {
add,
resetPassword
} from "@/api/system/user";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -119,6 +123,15 @@ export default {
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.user_add,
viewBtn: this.permission.user_view,
delBtn: this.permission.user_delete,
editBtn: this.permission.user_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {

View File

@ -4,6 +4,7 @@
:data="data"
ref="crud"
v-model="form"
:permission="permissionList"
:page="page"
@row-del="rowDel"
@row-update="rowUpdate"
@ -39,6 +40,7 @@
<script>
import { getList, getCode, build, remove, add, update } from "@/api/tool/code";
import { mapGetters } from "vuex";
export default {
data() {
return {
@ -101,6 +103,15 @@ export default {
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.code_add,
viewBtn: this.permission.code_view,
delBtn: this.permission.code_delete,
editBtn: this.permission.code_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {