From 0d84e203264a0c22a7de7c07492cfdfa7c92a28e Mon Sep 17 00:00:00 2001
From: buvta <12312540+buvta@users.noreply.github.com>
Date: Tue, 17 Nov 2020 16:50:31 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=89=8B=E5=8A=A8=E5=90=88?=
=?UTF-8?q?=E5=B9=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/IPTV.vue | 30 +++++++++++++++++++++++-------
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue
index c4d5ee5..4447d70 100644
--- a/src/components/IPTV.vue
+++ b/src/components/IPTV.vue
@@ -9,9 +9,10 @@
@@ -121,7 +122,7 @@ export default {
searchTxt: '',
searchRecordList: [],
enableBatchEdit: false,
- batchGroupName: '',
+ inputContent: '',
batchIsActive: true,
shiftDown: false,
selectionBegin: '',
@@ -237,13 +238,28 @@ export default {
},
saveBatchEdit () {
this.multipleSelection.forEach(ele => {
- if (this.batchGroupName) {
- ele.group = this.batchGroupName
+ if (this.inputContent) {
+ ele.group = this.inputContent
}
ele.isActive = this.batchIsActive
})
this.updateDatabase()
},
+ mergeChannel () {
+ if (this.inputContent && this.multipleSelection.length) {
+ var channels = []
+ const id = this.multipleSelection[0].id
+ this.multipleSelection.forEach(ele => {
+ channels = channels.concat(ele.channels)
+ channels.forEach(e => { e.channelID = id })
+ channelList.remove(ele.id)
+ })
+ const mergeChannel = { id: id, name: this.inputContent, isActive: channels.some(c => c.isActive), group: this.determineGroup(this.inputContent), hasChildren: channels.length > 1, channels: channels }
+ channelList.add(mergeChannel)
+ this.getChannelList()
+ this.updateDatabase()
+ }
+ },
playEvent (e) { // 下一步与Play联动prefer
if (e.id <= this.iptvList.length) {
this.video = { iptv: e }
@@ -484,10 +500,10 @@ export default {
}
},
syncTableData () {
- if (this.$refs.iptvTable.tableData) {
+ if (this.$refs.iptvTable.tableData && this.$refs.iptvTable.tableData.length === this.channelList.length) {
this.channelList = this.$refs.iptvTable.tableData
- this.getIptvList()
}
+ this.getIptvList()
},
updateDatabase () {
this.syncTableData()