|
@@ -377,11 +377,12 @@ import { Search, Delete, UserFilled, Clock, UploadFilled, CaretBottom, CaretRigh
|
|
|
import { ElMessageBox, ElMessage, FormRules, ElLoading } from 'element-plus'
|
|
|
import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
|
import { useStore } from "@/pinia/common"
|
|
|
-import { useRouter, onBeforeRouteLeave } from 'vue-router'
|
|
|
+import { useRouter, onBeforeRouteLeave, useRoute } from 'vue-router'
|
|
|
import BlobTool from '@/utils/blobTool.js'
|
|
|
|
|
|
let { proxy } = getCurrentInstance()
|
|
|
let store = useStore()
|
|
|
+let route = useRoute()
|
|
|
let router = useRouter()
|
|
|
|
|
|
let actIndex = ref(0)
|
|
@@ -452,7 +453,20 @@ function getActList() {
|
|
|
})
|
|
|
actListShow.value = actList.value
|
|
|
if(actListShow.value.length) {
|
|
|
- getListInfo(actListShow.value[0], 0)
|
|
|
+ if(route.query.id) {
|
|
|
+ let index = actListShow.value.findIndex(item => item.id === route.query.id)
|
|
|
+ if(index === -1) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未找到相关活动'
|
|
|
+ })
|
|
|
+ getListInfo(actListShow.value[0], 0)
|
|
|
+ } else {
|
|
|
+ getListInfo(actListShow.value[index], index)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ getListInfo(actListShow.value[0], 0)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}).finally(() => {
|
|
@@ -651,7 +665,7 @@ function exitAct(index, info) {
|
|
|
message: proxy.$t('elMessage.handoverExit')
|
|
|
})
|
|
|
} else {
|
|
|
- ElMessageBox.confirm(proxy.$t('elMessage.exitAct')).then(() => {
|
|
|
+ ElMessageBox.confirm(scoreData.value.allotStatus === 1 ? '您的作品已被分配,退出后将清空所有记录,是否确认退出?' : proxy.$t('elMessage.exitAct')).then(() => {
|
|
|
let params = {
|
|
|
grant_type: 'cancel-enroll',
|
|
|
activityId: actInfo.value.id
|
|
@@ -690,21 +704,7 @@ function handleRemove(file, files) {
|
|
|
fileList.value = fileList.value.filter(item => item.name != file.name)
|
|
|
}
|
|
|
|
|
|
-function handleChange(file, files) {
|
|
|
- let info = {
|
|
|
- name: file.name,
|
|
|
- url: '',
|
|
|
- size: file.size,
|
|
|
- createTime: '',
|
|
|
- extension: '',
|
|
|
- type: '',
|
|
|
- blob: '',
|
|
|
- hash: '',
|
|
|
- duration: 0,
|
|
|
- cnt: '',
|
|
|
- tmdid: store.userInfo.sub,
|
|
|
- tag: []
|
|
|
- }
|
|
|
+async function handleChange(file, files) {
|
|
|
if(fileList.value.find(item => item.name === file.name)) {
|
|
|
ElMessage({
|
|
|
type: 'warning',
|
|
@@ -729,6 +729,19 @@ function handleChange(file, files) {
|
|
|
files.splice(fileList.value.length, 1)
|
|
|
return
|
|
|
}
|
|
|
+ let nameType = file.name.split('.')[file.name.split('.').length - 1]
|
|
|
+ if (['mp4', 'mp3', 'ogg', 'wav', 'webm'].includes(nameType.toLowerCase())) {
|
|
|
+ /* 检查上传媒体文件编码信息是否符合要求 */
|
|
|
+ let checkMediaFile = await proxy.$tools.checkMediaFile(file.raw)
|
|
|
+ if (!checkMediaFile) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '多媒体文件编码信息不正确,无法播放,请重新上传'
|
|
|
+ })
|
|
|
+ files.splice(fileList.value.length, 1)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
file.progress = 0
|
|
|
fileList.value.push(file)
|
|
|
}
|