From c6a39591d5599ab5f11d29a7af4cd7e4ab2a75d2 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Sat, 7 Nov 2020 18:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=A3=80=E6=B5=8B=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=9B=E5=BA=A6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditSites.vue | 10 ++++++++-- src/components/IPTV.vue | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index cce6137..15f25bb 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -6,7 +6,7 @@ 新增 导出 导入 - 检测 + 检测{{ this.checkAllSitesLoading ? this.checkProgress + '/' + this.sites.length : '' }} 重置
@@ -150,6 +150,7 @@ export default { batchIsActive: 1, multipleSelection: [], checkAllSitesLoading: false, + checkProgress: 0, stopFlag: false, editOldkey: '' } @@ -442,6 +443,7 @@ export default { async checkAllSite () { this.checkAllSitesLoading = true this.stopFlag = false + this.checkProgress = 0 const uncheckedList = this.sites.filter(e => e.status === undefined || e.status === ' ') // 未检测过的优先 const other = this.sites.filter(e => !uncheckedList.includes(e)) await Promise.all(uncheckedList.map(site => this.checkSingleSite(site))) @@ -452,8 +454,12 @@ export default { }, async checkSingleSite (row) { row.status = ' ' - if (this.stopFlag) return row.status + if (this.stopFlag) { + this.checkProgress += 1 + return row.status + } const flag = await zy.check(row.key) + this.checkProgress += 1 if (flag) { row.status = '可用' } else { diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 169d2e6..413e381 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -4,7 +4,7 @@ 导出 导入 - 检测 + 检测{{ this.checkAllChannelsLoading ? this.checkProgress + '/' + this.iptvList.length : '' }} 重置
@@ -121,6 +121,7 @@ export default { batchIsActive: 1, multipleSelection: [], checkAllChannelsLoading: false, + checkProgress: 0, stopFlag: false, show: { search: false @@ -427,6 +428,7 @@ export default { async checkAllChannels () { this.checkAllChannelsLoading = true this.stopFlag = false + this.checkProgress = 0 const uncheckedList = this.iptvList.filter(e => e.status === undefined || e.status === ' ') // 未检测过的优先 const other = this.iptvList.filter(e => !uncheckedList.includes(e)) await this.checkChannelList(uncheckedList) @@ -455,8 +457,12 @@ export default { }, async checkSingleChannel (row) { row.status = ' ' - if (this.stopFlag) return row.status + if (this.stopFlag) { + this.checkProgress += 1 + return row.status + } const flag = await zy.checkChannel(row.url) + this.checkProgress += 1 if (flag) { row.status = '可用' } else {