|
|
@ -38,13 +38,13 @@ |
|
|
|
</div> |
|
|
|
<div class="date-range"> |
|
|
|
<div class="date-picker"> |
|
|
|
<img src="C:\Users\Administrator\Desktop\VoteManage_VUE\src\assets\images\日历.png" alt="Calendar" |
|
|
|
<img src="../assets/images/日历.png" alt="Calendar" |
|
|
|
class="calendar-icon"> |
|
|
|
<input type="date" class="date-input" placeholder="开始日期" v-model="startDate"> |
|
|
|
</div> |
|
|
|
<span class="date-separator">至</span> |
|
|
|
<div class="date-picker"> |
|
|
|
<img src="C:\Users\Administrator\Desktop\VoteManage_VUE\src\assets\images\日历.png" alt="Calendar" |
|
|
|
<img src="../assets/images/日历.png" alt="Calendar" |
|
|
|
class="calendar-icon"> |
|
|
|
<input type="date" class="date-input" placeholder="结束日期" v-model="endDate"> |
|
|
|
</div> |
|
|
@ -118,13 +118,15 @@ import { ref } from 'vue'; |
|
|
|
import axiosInstance from '@/api/axiosConfig'; |
|
|
|
import axiosexport from '@/api/axiosConfig'; |
|
|
|
import { ElTable } from 'element-plus'; |
|
|
|
import { useRoute } from 'vue-router'; |
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
|
|
// 组件数据 |
|
|
|
data() { |
|
|
|
return { |
|
|
|
detailId: window.location.pathname.split('/').pop() || '24', |
|
|
|
// detailId: window.location.pathname.split('/').pop() || '24', |
|
|
|
detailId: ref(0), |
|
|
|
//detailId: 24, |
|
|
|
searchId: '', |
|
|
|
selectedRegion: '', |
|
|
@ -137,6 +139,7 @@ export default { |
|
|
|
totalRecords: 0, |
|
|
|
currentPage: ref(1), |
|
|
|
pageSize: ref(10), |
|
|
|
route: useRoute(), |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -152,7 +155,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取投票记录 |
|
|
|
async fetchVoteRecords() { |
|
|
|
async fetchVoteRecords(detailId) { |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
PageNo: this.currentPage, |
|
|
@ -162,6 +165,7 @@ export default { |
|
|
|
const response = await axiosInstance.post('', params); |
|
|
|
this.voteRecords = response.data.data.list; |
|
|
|
this.totalPages = response.data.data.total; |
|
|
|
console.log(response.data.data.list); |
|
|
|
// this.totalRecords = response.data.data.total; |
|
|
|
} catch (error) { |
|
|
|
console.error('获取投票记录失败:', error); |
|
|
@ -244,7 +248,10 @@ export default { |
|
|
|
|
|
|
|
//组件挂载后获取投票记录 |
|
|
|
mounted() { |
|
|
|
this.fetchVoteRecords(); |
|
|
|
this.detailId = this.route.params.id; |
|
|
|
console.log(this.route.params.id); |
|
|
|
console.log(this.detailId); |
|
|
|
this.fetchVoteRecords(this.detailId); |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|