Browse Source

视频组件可修改已上传的视频

yjf_v2
liwenxuan 2 years ago
parent
commit
799d6fde19
  1. 22
      src/components/DesignForm/formControlAttr.vue

22
src/components/DesignForm/formControlAttr.vue

@ -1275,6 +1275,17 @@ const isNotWrite = (val:any) =>{
//liwenxuan 20240108 vidioupload start
import { VideoMsg } from '@/api/DesignForm/types'
import { genFileId } from 'element-plus'
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
const upload = ref<UploadInstance>()
const handleExceed: UploadProps['onExceed'] = (files) => {
upload.value!.clearFiles()
const file = files[0] as UploadRawFile
file.uid = genFileId()
upload.value!.handleStart(file)
}
const videoIndex = ref(0);
const videoMsgArr:VideoMsg[] = reactive<VideoMsg[]>([{
CreatedAt: '',
@ -1457,15 +1468,18 @@ const handleClose = (done: () => void) => {
<el-row v-else-if="item.type === 'uploadvideo_url'">
<!-- {{ controlData.control }} -->
<el-upload
v-if="!controlData.control.videoMsg[videoIndex].videoReady"
:action="uploadUrl" :before-remove="beforeRemove"
:on-success="videoUploadOk" :show-file-list="true"
:on-error="videoUploadErr"
:limit="1"
:on-exceed="handleExceed"
accept=".mp4,.MOV,.WMV,.FLV,.AVI,.AVCHD,.WebM,.MKV,.rmvb">
<el-button type="primary">点此上传</el-button>
<el-button v-if="!controlData.control.videoMsg[videoIndex].videoReady" type="primary">点此上传</el-button>
<el-button v-if="controlData.control.videoMsg[videoIndex].videoReady" type="primary">已上传,点击修改</el-button>
</el-upload>
<el-button v-if="controlData.control.videoMsg[videoIndex].videoReady" type="primary">已上传<!-- ,点击修改 --></el-button>
<!-- <el-button v-if="controlData.control.videoMsg[videoIndex].videoReady" type="primary">已上传,点击修改</el-button>
v-if="!controlData.control.videoMsg[videoIndex].videoReady"-->
</el-row>
<!-- <el-row v-else-if="item.type === 'uploadvideo_poster'">
<el-upload

Loading…
Cancel
Save