Browse Source

上传调试

hbchen 1 year ago
parent
commit
064b3484ef
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/views/semantics_manage/asr/components/mediaUpload.vue

+ 10 - 3
src/views/semantics_manage/asr/components/mediaUpload.vue

@@ -62,7 +62,8 @@
         </div>
         <div class="dia-bot">
           <el-button type="primary" plain style="margin-right:20px;min-width:120px ;" @click="cancelHandle">取消</el-button>
-          <el-button type="primary" @click="saveHandle" style="min-width:120px;" :disabled="fileList.length==0">开始转写</el-button>
+          <el-button type="primary" @click="saveHandle" style="min-width:120px;" >开始转写</el-button>
+          <!-- :disabled="fileList.length==0" -->
         </div>
         <!-- :http-request="handleUpload"
           :before-upload="handleBeforeUpload" -->
@@ -83,7 +84,7 @@
 <script>
 import {uploadFileDirect} from "@/utils/common.js"
 import {asrInterface} from '@/api/modules/semanticsApi.js';
-
+import MD5 from "js-md5";
   export default {
     name:"editTag",
     props:{
@@ -182,7 +183,10 @@ import {asrInterface} from '@/api/modules/semanticsApi.js';
         let fileFront=file.name.split('.')[0]
         this.uploadingFileNames.push(fileFront)
 
-        let temName = `asr/media/${new Date().getTime()}`
+        const t = new Date().getTime().toString();
+        const temName = `asr/media/${process.env.NODE_ENV}/${MD5(t)}.${
+          file.raw.type.split("/")[1]
+        }`;
         let clientType = this.$setting.dynamicOutLinks.ObjectStorageClient ||
                   this.$store.state.dynamicOutLinks.ObjectStorageClient ||
                   JSON.parse(localStorage.getItem('dynamicOutLinks')).ObjectStorageClient
@@ -271,6 +275,9 @@ import {asrInterface} from '@/api/modules/semanticsApi.js';
         this.$emit("update:diaShow",false)
       },
       saveHandle(){
+        this.$emit("uploadSuccess")
+        this.$emit("update:diaShow",false)
+        return 
         if(this.uploadingFileNames && this.uploadingFileNames.length>0){
           return this.$message.error("还有音/视频未上传完成,请等待上传成功后再转写!") 
         }