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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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