From 4e83e365a67ee5a3b70cb1a4b71bbed323bd7385 Mon Sep 17 00:00:00 2001
From: buvta <12312540+buvta@users.noreply.github.com>
Date: Wed, 18 Nov 2020 11:20:22 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AF=B9iptvList.length?=
=?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/IPTV.vue | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue
index 7f409d1..ccda5c5 100644
--- a/src/components/IPTV.vue
+++ b/src/components/IPTV.vue
@@ -94,7 +94,7 @@
总频道数:{{ iptvList.length }}
- 置顶
+ 置顶
检测
删除
@@ -187,6 +187,7 @@ export default {
if (this.checkAllChannelsLoading) {
this.$message.info('正在检测, 请勿操作.')
this.enableBatchEdit = false
+ return
}
if (this.enableBatchEdit) {
this.$nextTick(() => {
@@ -232,7 +233,7 @@ export default {
handleSortChange (column, prop, order) {
if (this.checkAllChannelsLoading) {
this.$message.info('正在检测, 请勿操作.')
- this.enableBatchEdit = false
+ return
}
this.updateDatabase()
},
@@ -261,7 +262,7 @@ export default {
}
},
playEvent (e) { // 下一步与Play联动prefer
- if (e.id <= this.iptvList.length) {
+ if (e.url) {
this.video = { iptv: e }
} else {
const prefer = e.channels.filter(c => c.isActive)[0]
@@ -284,10 +285,10 @@ export default {
}
try {
if (row.url) {
- debugger
+ // 无法删除 bug在哪?
iptv.remove(row.id)
const parent = this.channelList.find(e => e.id === row.channelID)
- parent.channels = parent.channels.filter(e => e.id !== row.id)
+ parent.channels.splice(parent.channels.findIndex(e => e.id === row.id), 1)
channelList.remove(row.channelID)
channelList.add(parent)
} else {
@@ -493,8 +494,8 @@ export default {
return false
}
// this.channelList.sort(function (x, y) { return (x.name === i.name && x.url === i.url) ? -1 : (y.name === i.name && y.url === i.url) ? 1 : 0 })
- if (row.id > this.iptvList.length) {
- this.channelList.splice(row.id - this.iptvList.length - 1, 1)
+ if (row.channels) {
+ this.channelList.splice(this.channelList.findIndex(e => e.id === row.id), 1)
this.channelList.unshift(row)
this.updateDatabase()
}
@@ -503,7 +504,6 @@ export default {
if (this.$refs.iptvTable.tableData && this.$refs.iptvTable.tableData.length === this.channelList.length) {
this.channelList = this.$refs.iptvTable.tableData
}
- this.getIptvList()
},
updateDatabase () {
this.syncTableData()
@@ -540,7 +540,7 @@ export default {
})
},
isActiveChangeEvent (row) {
- if (row.id <= this.iptvList.length) {
+ if (row.url) {
iptv.remove(row.id)
iptv.add(row)
const parent = this.channelList.find(e => e.id === row.channelID)
@@ -615,7 +615,7 @@ export default {
return channel.status
},
async checkChannel (row) {
- if (row.id > this.iptvList.length) {
+ if (row.channels) {
row.status = ' '
row.hasCheckedNum = 0
row.channels.forEach(e => this.checkSingleChannel(e))