Files
Yi.Admin/Yi.Vue/src/views/AdmRoleMenu.vue

67 lines
1.4 KiB
Vue
Raw Normal View History

2021-10-14 13:15:00 +08:00
<template>
<v-row>
<v-col cols="12">
<v-card class="mx-auto" width="100%"><v-btn color="primary">确定分配</v-btn></v-card>
</v-col>
<v-col cols="12" md="4" lg="4">
<v-card class="mx-auto" width="100%">
2021-10-14 20:29:07 +08:00
<v-treeview
selectable
:items="RoleItems"
v-model="selectionRole"
return-object
open-all
hoverable
item-text="role_name"
>
</v-treeview>
</v-card>
</v-col>
2021-10-14 13:15:00 +08:00
<v-col cols="12" md="8" lg="8">
<v-card class="mx-auto" width="100%">
2021-10-14 20:29:07 +08:00
<v-treeview
selectable
:items="Menuitems"
selection-type="leaf"
v-model="selectionMenu"
return-object
open-all
hoverable
item-text="menu_name"
>
<template v-slot:append="{ item }">
<v-btn>id:{{ item.id }}</v-btn>
2021-10-14 13:15:00 +08:00
</template>
2021-10-14 20:29:07 +08:00
</v-treeview>
</v-card></v-col
>
</v-row>
2021-10-14 13:15:00 +08:00
</template>
<script>
import roleApi from "../api/roleApi";
import menuApi from "../api/MenuApi";
2021-10-14 20:29:07 +08:00
export default {
created() {
this.init();
},
methods: {
init() {
roleApi.getRole().then((resp) => {
this.RoleItems = resp.data;
});
menuApi.getMenu().then((resp) => {
this.Menuitems = resp.data;
});
},
},
2021-10-14 20:29:07 +08:00
data: () => ({
selectionMenu: [],
selectionRole: [],
RoleItems: [],
Menuitems: [],
2021-10-14 20:29:07 +08:00
}),
};
2021-10-14 13:15:00 +08:00
</script>