模型类

This commit is contained in:
橙子
2021-10-11 21:50:50 +08:00
parent 543800d0e7
commit 2093d1c78d
38 changed files with 652 additions and 185 deletions

View File

@@ -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();
},

View File

@@ -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
})
},

View File

@@ -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",

View File

@@ -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) => {

View 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>

View 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>

View File

@@ -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>

View File

@@ -0,0 +1,3 @@
<template>
<div>还有谁</div>
</template>

View File

@@ -1,4 +0,0 @@
<template>
<div>666</div>
</template>