|
@@ -15,13 +15,13 @@
|
|
|
</div>
|
|
|
<div class="w-full">
|
|
|
<video-uploader :fileList="videofileList" :public_video_url='formDataForm.cover_image' @fileRemove="fileRemove"
|
|
|
- @success="fileSuccess"></video-uploader>
|
|
|
+ @success="fileSuccess" @error="flieError"></video-uploader>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<div class="flex justify-end">
|
|
|
- <el-button type="primary" @click="submitForm(form)">{{
|
|
|
+ <!-- <el-button type="primary" @click="submitForm(form)">{{
|
|
|
$t('system.confirm')
|
|
|
- }}</el-button>
|
|
|
+ }}</el-button> -->
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</template>
|
|
@@ -36,6 +36,7 @@ const props = defineProps({
|
|
|
const form = ref<FormInstance>();
|
|
|
const loading = ref(false);
|
|
|
const formDataForm = ref({ videos: [] })
|
|
|
+const subimtData =ref({ videos: [] });
|
|
|
const videofileList = ref([])
|
|
|
const emit = defineEmits(['close']);
|
|
|
const fileRemove = (e: object) => {
|
|
@@ -43,10 +44,26 @@ const fileRemove = (e: object) => {
|
|
|
console.log(formDataForm.value, e, 'fileRemove');
|
|
|
}
|
|
|
const fileSuccess = (e: object) => {
|
|
|
+ // console.log('111111111111111111111111111');
|
|
|
+ subimtData.value.videos = [];
|
|
|
+
|
|
|
formDataForm.value.videos.push({ name: e.fname, duration: parseInt(e.duration), url: e.url, key: e.key, })
|
|
|
- console.log(formDataForm.value, 'fileSuccess');
|
|
|
+ subimtData.value.videos.push({ name: e.fname, duration: parseInt(e.duration), url: e.url, key: e.key, })
|
|
|
+ let params = {
|
|
|
+ video_id: formDataForm.value.video_id,
|
|
|
+ videos: subimtData.value.videos
|
|
|
+ }
|
|
|
+ videoStockEpisodeAdd(params).then(res => {
|
|
|
+ ElMessage.success(e.fname +"上传成功!");
|
|
|
+ }).catch(e => {
|
|
|
+
|
|
|
+ })
|
|
|
+ // console.log(formDataForm.value, 'fileSuccess');
|
|
|
}
|
|
|
|
|
|
+// const flieError = (e:object) =>{
|
|
|
+// console.log(e, 'rrrrrrrrrrrrrrrrr');
|
|
|
+// }
|
|
|
const submitForm = (formEl: FormInstance | undefined) => {
|
|
|
loading.value = true;
|
|
|
console.log(formDataForm.value, formEl, 'formEl');
|