diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue
index 58734a2..c9770fa 100644
--- a/src/components/IPTV.vue
+++ b/src/components/IPTV.vue
@@ -12,7 +12,7 @@
清空
@@ -40,6 +40,7 @@
{{i.name}}
+ 置顶
播放
删除
@@ -196,11 +197,12 @@ export default {
}
})
},
- resetSites () {
- iptv.clear()
- iptv.bulkAdd(defaultSites).then(e => {
- this.getAllSites()
- })
+ resetSitesEvent () {
+ this.resetSites(defaultSites)
+ },
+ resetSites (newSites) {
+ this.resetId(newSites)
+ iptv.clear().then(iptv.bulkAdd(newSites).then(this.getAllSites()))
},
removeAllSites () {
iptv.clear().then(res => {
@@ -233,6 +235,17 @@ export default {
this.getAllSearch()
})
}
+ },
+ moveToTopEvent (i) {
+ this.iptvList.sort(function (x, y) { return (x.name === i.name && x.url === i.url) ? -1 : (y.name === i.name && y.url === i.url) ? 1 : 0 })
+ this.resetSites(this.iptvList)
+ },
+ resetId (inArray) {
+ var id = 1
+ inArray.forEach(ele => {
+ ele.id = id
+ id += 1
+ })
}
},
created () {