Jelajahi Sumber

更新直播间数据 重置

yuhongqi 1 bulan lalu
induk
melakukan
dd88112f7c
2 mengubah file dengan 9 tambahan dan 4 penghapusan
  1. 5 2
      src/components/VideoUpload/index.vue
  2. 4 2
      src/views/live/live/index.vue

+ 5 - 2
src/components/VideoUpload/index.vue

@@ -226,6 +226,9 @@ export default {
       },
     };
   },
+  mounted() {
+    this.reset();
+  },
   watch: {
     localUploadType(newType) {
       this.$emit("update:uploadType", newType);
@@ -341,11 +344,11 @@ export default {
     handleRemove(file, fileList) {
       console.log(file, fileList.length);
     },
-    resetUpload() {
+    reset() {
       // 重置内部状态
       this.txProgress = 0;
-      this.hwProgress = 0;
       this.fileList = [];
+      this.$refs.upload.clearFiles();
       this.uploadKey++;
     },
     /** 查询视频库列表 */

+ 4 - 2
src/views/live/live/index.vue

@@ -236,6 +236,7 @@
           <video-upload :fileKey.sync="form.fileKey" :fileSize.sync="form.fileSize"
                         :videoUrl.sync="form.videoUrl" :fileName.sync="form.fileName" :line_1.sync="form.lineOne"
                         :uploadType.sync="form.uploadType" :isTranscode.sync="form.isTranscode"
+                        ref="videoUpload"
                         :transcodeFileKey.sync="form.transcodeFileKey" @video-duration="handleVideoDuration"
                         @change="handleVideoChange"></video-upload>
         </el-form-item>
@@ -638,8 +639,9 @@ export default {
       this.open = true;
       setTimeout(() => {
         this.$refs.myeditor.setText("");
+        this.$refs.videoUpload.reset();
       }, 100);
-      this.title = "添加直播";
+      this.title = "添加直播";
     },
     updateText(text){
       this.form.liveDesc=text
@@ -662,7 +664,7 @@ export default {
           }
         }, 1);
         this.open = true;
-        this.title = "修改直播";
+        this.title = "修改直播";
       });
     },
     /** 提交按钮 */