登录控制器

This commit is contained in:
橙子
2021-10-16 14:48:55 +08:00
parent 6a492168ed
commit b2e8441194
10 changed files with 275 additions and 51 deletions

View File

@@ -1,29 +1,18 @@
<template>
<v-card class="mx-auto" width="100%">
<v-btn color="primary" dark class="mb-2 mx-2" @click="dialog = true">
添加新项
</v-btn>
<v-btn color="primary" dark class="mb-2 mx-2" @click="dialog = true">
删除所选
</v-btn>
<ccTreeview :items="Menuitems"></ccTreeview>
<ccTreeview></ccTreeview>
</v-card>
</template>
<script>
import menuApi from "../api/MenuApi";
export default {
created() {
this.init();
},
data: () => ({
Menuitems: [],
}),
methods: {
init() {
menuApi.getMenu().then((resp) => {
this.Menuitems = resp.data;
});
},
},
};
</script>

View File

@@ -1,7 +1,7 @@
<template>
<v-row>
<v-col cols="12">
<v-card class="mx-auto" width="100%"><v-btn color="primary">确定分配</v-btn></v-card>
<v-card class="mx-auto" width="100%"><app-btn @click="setMenu">确定分配</app-btn></v-card>
</v-col>
<v-col cols="12" md="4" lg="4">
<v-card class="mx-auto" width="100%">
@@ -41,12 +41,28 @@
</template>
<script>
import roleApi from "../api/roleApi";
import menuApi from "../api/MenuApi";
import menuApi from "../api/menuApi";
export default {
created() {
this.init();
},
methods: {
setMenu(){
var roleIds=[];
var menuIds=[];
this.selectionRole.forEach((ele)=>{
roleIds.push(ele.id)
})
this.selectionMenu.forEach((ele)=>{
menuIds.push(ele.id)
})
roleApi.setMenuByRole(roleIds,menuIds).then(resp=>{
this.$dialog.notify.info(resp.msg, {
position: "top-right",
timeout: 5000,
});
})
},
init() {
roleApi.getRole().then((resp) => {
this.RoleItems = resp.data;