From 0bfebc821a08ae9bb263448434704b56f914c7f8 Mon Sep 17 00:00:00 2001 From: ting Date: Tue, 24 Dec 2024 15:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=97=A5=E6=9C=9F=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/BackView.vue | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/views/BackView.vue b/src/views/BackView.vue index f6b575b..29c5911 100644 --- a/src/views/BackView.vue +++ b/src/views/BackView.vue @@ -13,38 +13,45 @@ function getToken() { if (parts.length > 1) { token = parts[1].split("&")[0]; // 进一步截取 & 之前的字符串 } - console.log("token字符串:",token); // 输出 token 的值 + console.log("token字符串:", token); // 输出 token 的值 } getToken(); const candidates = ref([]) function loadCandidates() { - CanApi.getCandidates(token).then(result =>{ + CanApi.getCandidates(token).then(result => { candidates.value = result.data; + }) } loadCandidates(); //对话窗 const detailVisible = ref(false); const details = ref([]) -function searchDetail(scope){ +function searchDetail(scope) { console.log(scope); detailVisible.value = true; - CanApi.Detail(scope).then(result =>{ + CanApi.Detail(scope).then(result => { details.value = result.data; + for (let i = 0; i < details.value.length; i++) { + if (details.value[i] && details.value[i].voteTime) { + details.value[i].voteTime = details.value[i].voteTime.replace('T', ' '); + } + + } }) } //序号 -const indexMethod = function(index) { - return index +1; +const indexMethod = function (index) { + return index + 1; }