模型类
This commit is contained in:
@@ -179,8 +179,7 @@ export default {
|
||||
Ids.push(item.id);
|
||||
});
|
||||
}
|
||||
alert("多行删除");
|
||||
ItemApi.delItemList(this.axiosUrls.del,Ids).then(() => this.initialize());
|
||||
itemApi.delItemList(this.axiosUrls.del,Ids).then(() => this.initialize());
|
||||
this.closeDelete();
|
||||
},
|
||||
close() {
|
||||
@@ -201,11 +200,9 @@ export default {
|
||||
|
||||
save() {
|
||||
if (this.editedIndex > -1) {
|
||||
alert("多行更新");
|
||||
ItemApi.updateItem(this.axiosUrls.update,this.editedItem).then(() => this.initialize());
|
||||
itemApi.updateItem(this.axiosUrls.update,this.editedItem).then(() => this.initialize());
|
||||
} else {
|
||||
alert("添加");
|
||||
ItemApi.addItem(this.axiosUrls.add,this.editedItem).then(() => this.initialize());
|
||||
itemApi.addItem(this.axiosUrls.add,this.editedItem).then(() => this.initialize());
|
||||
}
|
||||
this.close();
|
||||
},
|
||||
|
||||
@@ -16,14 +16,14 @@ export default {
|
||||
updateItem(url, data) {
|
||||
return myaxios({
|
||||
url: url,
|
||||
method: 'cut',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
},
|
||||
delItemList(url, Ids) {
|
||||
return myaxios({
|
||||
url: url,
|
||||
method: 'del',
|
||||
method: 'delete',
|
||||
data: Ids
|
||||
})
|
||||
},
|
||||
|
||||
@@ -81,19 +81,19 @@
|
||||
mini: false,
|
||||
items: [
|
||||
{
|
||||
title: "Dashboard",
|
||||
title: "首页",
|
||||
icon: "mdi-view-dashboard",
|
||||
to: "/"
|
||||
},
|
||||
{
|
||||
title: "User Profile",
|
||||
title: "用户管理",
|
||||
icon: "mdi-account",
|
||||
to: "/components/profile/",
|
||||
to: "/admuser/",
|
||||
},
|
||||
{
|
||||
title: "Regular Tables",
|
||||
title: "角色管理",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "/tables/regular/",
|
||||
to: "/admrole/",
|
||||
},
|
||||
{
|
||||
title: "Typography",
|
||||
|
||||
@@ -19,8 +19,9 @@ const router = new VueRouter({
|
||||
return { x: 0, y: 0 }
|
||||
},
|
||||
routes: [layout('Default', [
|
||||
route('Dashboard'),
|
||||
route('UserProfile', null, 'components/profile'),
|
||||
route('Index'),
|
||||
route('AdmUser', null, 'AdmUser'),
|
||||
route('AdmRole', null, 'AdmRole'),
|
||||
])]
|
||||
})
|
||||
router.beforeEach((to, from, next) => {
|
||||
|
||||
32
Yi.Vue/src/views/AdmRole.vue
Normal file
32
Yi.Vue/src/views/AdmRole.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<v-card class="mx-auto" width="100%">
|
||||
<ccTable :defaultItem="defaultItem" :headers="headers" :axiosUrls="axiosUrls" ></ccTable>
|
||||
</v-card>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import ccTable from "@/components/Table.vue"
|
||||
export default {
|
||||
components: {
|
||||
ccTable
|
||||
},
|
||||
data: () => ({
|
||||
axiosUrls:{
|
||||
get:"role/getrole",
|
||||
update:"role/updaterole",
|
||||
del:"role/delListrole",
|
||||
add:"role/addrole"
|
||||
},
|
||||
headers: [
|
||||
{text: "编号",align: "start",value: "id"},
|
||||
{ text: "角色名", value: "role_name", sortable: false },
|
||||
{ text: "简介", value: "introduce", sortable: false },
|
||||
{ text: "操作", value: "actions", sortable: false }
|
||||
],
|
||||
defaultItem: {
|
||||
role_name: "test",
|
||||
introduce: "用于测试",
|
||||
},
|
||||
}),
|
||||
};
|
||||
</script>
|
||||
42
Yi.Vue/src/views/AdmUser.vue
Normal file
42
Yi.Vue/src/views/AdmUser.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
|
||||
|
||||
<v-card class="mx-auto" width="100%">
|
||||
<ccTable :defaultItem="defaultItem" :headers="headers" :axiosUrls="axiosUrls" ></ccTable>
|
||||
</v-card>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import ccTable from "@/components/Table.vue"
|
||||
export default {
|
||||
components: {
|
||||
ccTable
|
||||
},
|
||||
data: () => ({
|
||||
axiosUrls:{
|
||||
get:"user/getuser",
|
||||
update:"user/updateuser",
|
||||
del:"user/delListuser",
|
||||
add:"user/adduser"
|
||||
},
|
||||
headers: [
|
||||
{text: "编号",align: "start",value: "id"},
|
||||
{ text: "用户名", value: "username", sortable: false },
|
||||
{ text: "密码", value: "password", sortable: false },
|
||||
{ text: "图标", value: "icon", sortable: false },
|
||||
{ text: "昵称", value: "nick", sortable: true },
|
||||
{ text: "邮箱", value: "email", sortable: true },
|
||||
{ text: "IP", value: "ip", sortable: false },
|
||||
{ text: "年龄", value: "age", sortable: false },
|
||||
{ text: "操作", value: "actions", sortable: false },
|
||||
],
|
||||
defaultItem: {
|
||||
username: "test",
|
||||
password: "123",
|
||||
icon: "mdi-lock",
|
||||
nick:"橙子",
|
||||
age:18
|
||||
}
|
||||
}),
|
||||
};
|
||||
</script>
|
||||
@@ -1,90 +0,0 @@
|
||||
<template>
|
||||
|
||||
|
||||
<v-card class="mx-auto" width="100%">
|
||||
<ccTable :defaultItem="defaultItem" :headers="headers" :axiosUrls="axiosUrls" ></ccTable>
|
||||
</v-card>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import ccTable from "../components/Table.vue"
|
||||
export default {
|
||||
components: {
|
||||
ccTable
|
||||
},
|
||||
data: () => ({
|
||||
axiosUrls:{
|
||||
get:"action/getactions",
|
||||
update:"action/updateaction",
|
||||
del:"action/delAllaction",
|
||||
add:"action/addaction"
|
||||
},
|
||||
headers: [
|
||||
{text: "编号",align: "start",value: "id"},
|
||||
{ text: "权限名", value: "action_name", sortable: false },
|
||||
{ text: "路由", value: "router", sortable: false },
|
||||
{ text: "图标", value: "icon", sortable: false },
|
||||
{ text: "排序", value: "sort", sortable: true },
|
||||
{ text: "操作", value: "actions", sortable: false },
|
||||
],
|
||||
defaultItem: {
|
||||
action_name: "test",
|
||||
router: "/my/",
|
||||
icon: "mdi-lock",
|
||||
sort:"1"
|
||||
},
|
||||
|
||||
items: [
|
||||
{
|
||||
title: "Dashboard",
|
||||
icon: "mdi-view-dashboard",
|
||||
to: "/",
|
||||
items: [
|
||||
{
|
||||
title: "Dashboard",
|
||||
icon: "mdi-view-dashboard",
|
||||
to: "/",
|
||||
items: [
|
||||
{
|
||||
title: "User Profile",
|
||||
icon: "mdi-account",
|
||||
to: "/components/profile/",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "User Profile",
|
||||
icon: "mdi-account",
|
||||
to: "/components/profile/",
|
||||
},
|
||||
{
|
||||
title: "Regular Tables",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "/tables/regular/",
|
||||
},
|
||||
{
|
||||
title: "Typography",
|
||||
icon: "mdi-format-font",
|
||||
to: "/components/typography/",
|
||||
},
|
||||
{
|
||||
title: "Icons",
|
||||
icon: "mdi-chart-bubble",
|
||||
to: "/components/icons/",
|
||||
},
|
||||
{
|
||||
title: "Google Maps",
|
||||
icon: "mdi-map-marker",
|
||||
to: "/maps/google/",
|
||||
},
|
||||
{
|
||||
title: "Notifications",
|
||||
icon: "mdi-bell",
|
||||
to: "/components/notifications/",
|
||||
},
|
||||
],
|
||||
}),
|
||||
};
|
||||
</script>
|
||||
3
Yi.Vue/src/views/Index.vue
Normal file
3
Yi.Vue/src/views/Index.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<div>还有谁</div>
|
||||
</template>
|
||||
@@ -1,4 +0,0 @@
|
||||
<template>
|
||||
<div>666</div>
|
||||
|
||||
</template>
|
||||
Reference in New Issue
Block a user