Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
SunWuyuan committed Oct 6, 2024
1 parent b21c294 commit d0ca341
Show file tree
Hide file tree
Showing 10 changed files with 673 additions and 454 deletions.
84 changes: 45 additions & 39 deletions src/components/AddTolist.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
<template>
<v-list>
<div v-for="item in lists" :key="item.id">
<v-list-item :append-icon="item.include == true ? 'mdi-minus-circle' : 'mdi-plus-circle'"
:active="item.include == true" color="primary"
@click="item.include == true ? ProjectlistDelete(item.id) : ProjectlistAdd(item.id)">

<v-list>
<div v-for="item in lists" :key="item.id">
<v-list-item
:append-icon="
item.include == true ? 'mdi-minus-circle' : 'mdi-plus-circle'
"
:active="item.include == true"
color="primary"
@click="
item.include == true
? ProjectlistDelete(item.id)
: ProjectlistAdd(item.id)
"
>
<v-list-item-title> {{ item.title }}</v-list-item-title>
<v-list-item-subtitle>{{ item.description }}</v-list-item-subtitle>
</v-list-item></div>
<v-list-item @click="NewProjectListDialog = true">新建列表</v-list-item>
</v-list>


</v-list-item>
</div>
<v-list-item @click="NewProjectListDialog = true">新建列表</v-list-item>
</v-list>

<v-dialog v-model="NewProjectListDialog">
<NewProjectList :listid="editlistid" :close="() => NewProjectListDialog = false" :callback="getProjectList">
<NewProjectList
:listid="editlistid"
:close="() => (NewProjectListDialog = false)"
:callback="getProjectList"
>
</NewProjectList>
</v-dialog>


</template>
<script>
import NewProjectList from '@/components/NewProjectList.vue'
import NewProjectList from "@/components/NewProjectList.vue";
import { localuser } from "@/stores/user";
import request from '../axios/axios'
import request from "../axios/axios";
export default {
components: { NewProjectList },
Expand All @@ -33,63 +42,60 @@ export default {
localuser: localuser,
userinfo: localuser.user,
NewProjectListDialog: false,
lists: [
],
lists: [],
};
},
methods: {
async getProjectList() {
this.lists = (await request({
url: '/projectlist/check?projectid=' + this.$route.params.id,
data: {
userid: this.userinfo.id,
projectid: this.$route.params.id,
},
method: 'get',
})).data
this.lists = (
await request({
url: "/projectlist/check?projectid=" + this.$route.params.id,
data: {
userid: this.userinfo.id,
projectid: this.$route.params.id,
},
method: "get",
})
).data;
},
async ProjectlistAdd(id) {
await request({
url: '/projectlist/add',
url: "/projectlist/add",
data: {
userid: this.userinfo.id,
projectid: this.$route.params.id,
listid: id,
},
method: 'post',
method: "post",
}).then((res) => {
this.$toast.add({
severity: "info",
summary: "info",
detail: res.message,
life: 3000,
});
this.getProjectList()
})
this.getProjectList();
});
},
async ProjectlistDelete(id) {
await request({
url: '/projectlist/delete',
url: "/projectlist/delete",
data: {
userid: this.userinfo.id,
projectid: this.$route.params.id,
listid: id,
},
method: 'post',
method: "post",
}).then((res) => {
this.$toast.add({
severity: "info",
summary: "info",
detail: res.message,
life: 3000,
});
this.getProjectList()
})
}
this.getProjectList();
});
},
},
mounted() {
this.getProjectList();
Expand Down
Loading

0 comments on commit d0ca341

Please sign in to comment.