diff --git a/src/apis/voteRecord.js b/src/apis/voteRecord.js index 114407b..ffe58f7 100644 --- a/src/apis/voteRecord.js +++ b/src/apis/voteRecord.js @@ -1,5 +1,7 @@ import { request } from "@/utils/request"; -export const apiGetAllVotes = async (userId)=>request.get(`/user/getAllVote?userId=${userId}`); +export const apiGetAllVotes = async (condition)=>request.get(`/user/getAllVote`,{ + params:condition +}); export const apiGetSelectVotes = async(condition) => request.get(`/user/selectVote`,condition); \ No newline at end of file diff --git a/src/components/home/AsideMenu.vue b/src/components/home/AsideMenu.vue index 2d55b29..96b664f 100644 --- a/src/components/home/AsideMenu.vue +++ b/src/components/home/AsideMenu.vue @@ -31,6 +31,10 @@ 文章投票管理 + + + test + diff --git a/src/router/index.js b/src/router/index.js index c529ef4..530611a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,6 +32,11 @@ const router = createRouter({ name: 'voteDetail', component: () => import('@/views/VoteDetail/VoteDetail.vue'), }, + { + path: 'test', + name: 'test', + component: () => import('@/views/test/test.vue'), + }, ] }, diff --git a/src/stores/voteRecord.js b/src/stores/voteRecord.js new file mode 100644 index 0000000..f13aae9 --- /dev/null +++ b/src/stores/voteRecord.js @@ -0,0 +1,12 @@ +import { apiGetAllVotes } from "@/apis/voteRecord"; +import { defineStore } from "pinia"; + +export const useVoteRecordStore = defineStore("VoteRecord", () => { + const getAllVotes = async (condition) => { + return await apiGetAllVotes(condition) + }; + + return { + getAllVotes, + }; +}); diff --git a/src/views/VoteDetail/VoteDetail.vue b/src/views/VoteDetail/VoteDetail.vue index 5f2fc5a..8854b03 100644 --- a/src/views/VoteDetail/VoteDetail.vue +++ b/src/views/VoteDetail/VoteDetail.vue @@ -66,7 +66,7 @@ const condition = reactive({ const fetchVoteData = async () => { try { let params = reactive({ - voteId: 1, + voteId: voteInfo.voteId, page: pageInfo.pageNum, size: pageInfo.pageSize, username: condition.username, @@ -107,7 +107,7 @@ const handleCurrentChange = async (newPage) => { const exportDataFrontend = async () => { let exportData = ref([]) let params = reactive({ - voteId: 1, + voteId: voteInfo.voteId, username: condition.username, account: condition.account, area: condition.area, diff --git a/src/views/VoteRecord/VoteRecord.vue b/src/views/VoteRecord/VoteRecord.vue index 4f2ab5b..b844a4e 100644 --- a/src/views/VoteRecord/VoteRecord.vue +++ b/src/views/VoteRecord/VoteRecord.vue @@ -1,5 +1,135 @@ \ No newline at end of file + + + + + + + + + + + + + +
+ +
+ + + diff --git a/src/views/test/test.vue b/src/views/test/test.vue new file mode 100644 index 0000000..7e3d32e --- /dev/null +++ b/src/views/test/test.vue @@ -0,0 +1,113 @@ + + + + +