mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-11 14:35:43 +08:00
添加删除功能
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="deleteEvent(i)">删除</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -35,30 +36,6 @@ export default {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
return this.$store.getters.getVideo
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIDEO(val)
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
get () {
|
||||
return this.$store.getters.getDetail
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DETAIL(val)
|
||||
}
|
||||
},
|
||||
share: {
|
||||
get () {
|
||||
return this.$store.getters.getShare
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
setting () {
|
||||
return this.$store.getters.getSetting
|
||||
}
|
||||
@@ -81,11 +58,17 @@ export default {
|
||||
const open = require('open')
|
||||
open(link)
|
||||
} else {
|
||||
this.$message.error(m3u8Link)
|
||||
var exec = require('child_process').execFile
|
||||
exec(externalPlayer, [m3u8Link])
|
||||
}
|
||||
},
|
||||
deleteEvent (e) {
|
||||
iptv.remove(e.id).then(res => {
|
||||
this.getAllIptv()
|
||||
}).catch(err => {
|
||||
this.$message.warning('删除频道失败, 错误信息: ' + err)
|
||||
})
|
||||
},
|
||||
getAllIptv () {
|
||||
iptv.all().then(res => {
|
||||
this.iptv = res
|
||||
|
||||
@@ -11,7 +11,7 @@ db.version(3).stores({
|
||||
sites: '++id, key, name, json, xml, down, level',
|
||||
history: '++id, site, ids, name, type, year, index, time',
|
||||
mini: 'id, site, ids, name, index, time',
|
||||
iptv: 'name, site'
|
||||
iptv: '++id, name, site'
|
||||
})
|
||||
|
||||
db.on('populate', () => {
|
||||
|
||||
@@ -12,5 +12,11 @@ export default {
|
||||
},
|
||||
async find (doc) {
|
||||
return await iptv.get(doc)
|
||||
},
|
||||
async update (id, docs) {
|
||||
return await iptv.update(id, docs)
|
||||
},
|
||||
async remove (id) {
|
||||
return await iptv.delete(id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user