视频加入收藏以及标签功能。去除moment.js,改为原生格式化。加入任务的分类(收藏,下载,全部)。(同步更新)

This commit is contained in:
chuzhongzai
2023-02-24 17:24:45 +08:00
parent ddcdc671fd
commit 8e7e70d543
2 changed files with 140 additions and 20 deletions
+35 -9
View File
@@ -19,7 +19,7 @@
</span>
<el-button @click="deleteGallery(props.row.gid)" :disabled="props.row.download === undefined">删除</el-button>
<el-button @click="editTag(props.row.gid, props.row.tag)">编辑标签</el-button>
<el-button @click="editGalleryTag(props.row.gid, props.row.tag)">编辑标签</el-button>
<el-button @click="updateGallery(props.row.link)" :disabled="props.row.download === undefined">更新</el-button>
<el-button @click="shareGallery({gid:props.row.gid, shortName:props.row.shortName + '.zip'})" v-show="isLion">分享</el-button>
</template>
@@ -37,7 +37,7 @@
<template #default="scoped">
<span>
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
<el-button @click="changeCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
<el-button @click="changeGalleryCollect(scoped.row.gid, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
<el-button @click="onlineGalleryReader(scoped.row.gid)" :disabled="scoped.row.download === undefined">在线看</el-button>
</span>
</template>
@@ -59,20 +59,27 @@
视频长度:{{props.row.duration}} <br>
分辨率:{{props.row.resolution}} <br>
任务创建时间:{{props.row.createTimeDisplay}}<br>
标签:{{props.row.tag === '' ? '无': props.row.tag}} <br>
<span v-show="isLion">
downloader:{{props.row.downloader}}
</span>
<el-button @click="deleteVideo(props.row.gid)" :disabled="props.row.download === undefined">删除</el-button>
<el-button @click="editVideoTag(props.row.id, props.row.tag)">编辑标签</el-button>
</template>
</el-table-column>
<el-table-column label="名字" width="300">
<el-table-column label="名字" width="300vw">
<template #default="scoped">
{{scoped.row.name}}
</template>
</el-table-column>
<el-table-column label="操作" width="250">
<el-table-column label="操作" width="300vw">
<template #default="scoped">
<span>
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
<el-button @click="deleteVideo(scoped.row.id)" :disabled="scoped.row.download === undefined">删除</el-button>
<el-button @click="changeVideoCollect(scoped.row.id, scoped.row.isCollect)">{{scoped.row.isCollect ? '取消收藏' : '收藏'}}</el-button>
<el-button @click="openVideoPanel(scoped.row.download)" :disabled="scoped.row.download === undefined">在线播放</el-button>
</span>
</template>
@@ -130,7 +137,7 @@
</el-form-item>
</el-form>
<el-footer>
<el-button @click="submitTag">提交修改</el-button>
<el-button @click="tempGid === '' ? submitVideoTag(): submitGalleryTag()">提交修改</el-button>
</el-footer>
</el-dialog>
@@ -170,6 +177,7 @@ let player = ref()
//临时变量
let tempTag = ref("")
let tempGid = ref("")
let tempId = ref("")
let showNameType = ref("shortName") // shortName name
let showType = ref("gallery") // gallery video collect
@@ -216,6 +224,7 @@ let isLion = computed(() => {
return store.state.userId === 3
})
//在线预览相关
let currentLinks = computed(() => {
return store.state.currentLinks
})
@@ -281,23 +290,40 @@ function changeSortType(){
}
//收藏,编辑标签,提交编辑
function changeCollect(gid, isCollect){
function changeGalleryCollect(gid, isCollect){
if(isCollect)
store.dispatch("disCollectGallery", gid)
else
store.dispatch("collectGallery", gid)
}
function editTag(gid, tag){
function changeVideoCollect(id, isCollect){
if(isCollect)
store.dispatch("disCollectVideo", id)
else
store.dispatch("collectVideo", id)
}
function editGalleryTag(gid, tag){
tempTag.value = tag
tempGid.value = gid
isEditingTag.value = true
}
function submitTag(){
function editVideoTag(id, tag){
tempTag.value = tag
tempId.value = id
isEditingTag.value = true
}
function submitGalleryTag(){
store.dispatch("updateTag", {gid:tempGid.value, tag:tempTag.value})
tempTag.value = ''
tempGid.value = ''
isEditingTag.value = false
}
function submitVideoTag(){
store.dispatch("updateVideoTag", {id:tempId.value, tag:tempTag.value})
tempTag.value = ''
tempId.value = ''
isEditingTag.value = false
}
//下载,删除,在线看
function downloadTask(link){