浏览代码

档案查询元数据信息掉接口

duy 2 年之前
父节点
当前提交
f1f426bb5c
共有 1 个文件被更改,包括 28 次插入101 次删除
  1. 28 101
      src/views/using/query.vue

+ 28 - 101
src/views/using/query.vue

@@ -38,9 +38,6 @@
                         </div>
                     </template>
                 </el-input>
-                <div class="hc-icon-mic" @click="transcribeClick">
-                    <HcIcon name="mic" :fill="isMicShow"/>
-                </div>
             </div>
 
             <div class="hc-query-filtering-collapse-box">
@@ -326,7 +323,8 @@
                         </template>
                     </HcTable>
 
-                    <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'" :ishowFile="checkId.length>0?true:false"/>
+                    <!-- <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'" :ishowFile="checkId.length>0?true:false"/> -->
+                    <MetaTable :loading="cscmetaTableLoading" v-if="tabTypeKey === 'tab5'"  :metaDataTable="cscmetaDataTabledata"   :ishowFile="checkId.length>0?true:false"/>
 
                     <HcTable :column="cscTableColumn5" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
 
@@ -349,7 +347,7 @@
 
         <!--使用弹窗查看数据-->
         <HcDialog :show="cscTableDataModal" :title="cscTableDataTitle" widths="1080px" isTable :footer="false" @close="cscTableDataModalClose">
-            <MetaTable :loading="cscTableLoading" v-if="tabTypeKey === 'tab5'"/>
+            <MetaTable :loading="cscmetaTableLoading" v-if="tabTypeKey === 'tab5'"  :metaDataTable="cscmetaDataTabledata"   :ishowFile="checkId.length>0?true:false"/>
             <HcTable :column="cscTableColumn51" :datas="cscTableData5" :loading="cscTableLoading" v-if="tabTypeKey === 'tab6'"/>
         </HcDialog>
 
@@ -389,29 +387,6 @@
            <HcNoData v-if="nodeTreeArr.length==0"/>
         </HcDialog>
 
-        <!--语音识别-->
-        <HcDialog ui="hc-media-recorder-dialog"
-                  bgColor="#fff"
-                  title="语音识别搜索"
-                  :show="isMicShow"
-                  widths="360px"
-                  saveText="确认"
-                  @close="transcribeClick"
-        >
-            <div class="hc-media-recorder-box" @click="transcribeClick">
-                <img :src="imageViewMic" alt="">
-                <div class="content-box">
-                    <div class="shut-down-icon">
-                        <HcIcon name="shut-down"/>
-                    </div>
-                    <div class="time-box">
-                        <span class="time">{{micTime}}</span>
-                        <span> / 01:00</span>
-                    </div>
-                </div>
-            </div>
-        </HcDialog>
-
     </div>
 </template>
 
@@ -425,7 +400,6 @@ import tuningApi from "~api/archiveConfig/tuning.js";
 import imageViewGui from "~src/assets/view/gui.png";
 import imageViewGui1 from "~src/assets/view/gui1.png";
 import imageViewGui2 from "~src/assets/view/gui2.png";
-import imageViewMic from "~src/assets/view/mic.gif";
 
 //变量
 const useAppState = useAppStore()
@@ -1001,6 +975,7 @@ const tableFileSelection = (rows) => {
 
 //表格行被点击
 const tableFileShow = ref(false)
+const  checkmetaFileId=ref('')
 const tableRowClick = ({row}) => {
     tableAllShow.value = true;
     tableFileShow.value = true;
@@ -1048,6 +1023,10 @@ const consultFileClick =async (row,type) => {
    if(type===1){
     cscTableData1.value=row.approvalFileList
     fileInfo.value=row
+    if(cscTableData1.value.length>0){
+        checkmetaFileId.value= cscTableData1.value[0].id
+    }
+
     // fileInfo.value.pageN=row['approvalFileList'].length||0
     // fileInfo.value.pageNumber=row['approvalFileList'].length||0
    }else if(type==2){
@@ -1082,6 +1061,7 @@ const changePdf=(row)=>{
     console.log(row,'row');
     pdfUrl.value=row['pdfFileUrl']||''
     checkId.value=row.id
+    checkmetaFileId.value=row.id
 
 }
 
@@ -1097,6 +1077,9 @@ const tabTypeTab = ref([
 ]);
 const tabTypeChange = ({key}) => {
     tabTypeKey.value = key
+    if(key==='tab5'){
+        getmetaInfo()
+    }
 }
 
 const cscTableLoading = ref(false)
@@ -1177,6 +1160,7 @@ const cscTableDataModalShow = () => {
     const key = tabTypeKey.value;
     if (key === 'tab5') {
         cscTableDataTitle.value = '元数据'
+        getmetaInfo()
     } else if (key === 'tab6') {
         cscTableDataTitle.value = '验签包'
     }
@@ -1192,6 +1176,7 @@ const cscTableDataModalClose = () => {
 const onCarrySpotChecksDrawerClose = () => {
     isCarrySpotChecksDrawer.value = false
     pdfUrl.value=''
+    tabTypeKey.value='tab1'
 }
 
 //tab数据和相关处理
@@ -1463,81 +1448,23 @@ const guiFileInfo = (item) => {
     guiInfoCurKey.value = item
 }
 
-//语音
-const isMicShow = ref(false)
-const mediaRecorderRef = ref(null)
-const micTime = ref('00:00')
-const micTimeRef = ref(null)
-const transcribeClick = async () => {
-    if (isMicShow.value) { //停止录音
-        mediaRecorderRef.value?.stop()
-        mediaRecorderRef.value = null
-        isMicShow.value = false
-        clearTimeout(micTimeRef.value);
-        micTimeRef.value = null
-        micTime.value = '00:00'
-    } else {
-        const stream = await getUserMedia()
-        if (stream === false) return false;
-        isMicShow.value = true
-        startRecorder(stream)
-    }
-}
+//获取元数据
+const cscmetaTableLoading=ref(false)
+const cscmetaDataTabledata=ref([])
+//获取元数据信息
 
-//开始录音
-const startRecorder = (stream) => {
-    let mediaRecorder = new MediaRecorder(stream);
-    mediaRecorderRef.value = mediaRecorder
-    //开始录音
-    mediaRecorder.start();
-    setMicTimeFormat() //开始计时
-    // 录音结束时,停止并下载录音文件
-    mediaRecorder.addEventListener("dataavailable", event => {
-        clearTimeout(micTimeRef.value);
-        micTimeRef.value = null
-        let audioFile = new Blob([event.data], { type: "audio/wav" });
-        transcribeApi(audioFile)
-    });
-}
-
-//发起请求
-const transcribeApi = async (file) => {
-    let formData = new FormData();
-    formData.append("file", file);
-    const { error, code, data } = await archiveQueryApi.micSearchInfo(formData)
-    console.log(data)
-}
+const getmetaInfo=async(fileId)=>{
 
-//获取录音权限
-const getUserMedia = () => {
-    return new Promise((resolve) => {
-        navigator.mediaDevices.getUserMedia({
-            audio: true
-        }).then(stream => {
-            resolve(stream)
-        }).catch(err => {
-            console.log(err)
-            resolve(false)
-        });
+    cscmetaTableLoading.value = true
+    const {error, code, data} = await tuningApi.getMetadataFileByid({
+        fileId: checkmetaFileId.value,
     })
-}
-
-//设置时间格式
-const setMicTimeFormat = () => {
-    let startNum = 0
-    micTime.value = '00:00'
-    micTimeRef.value = setInterval(() => {
-        if (startNum < 60) {
-            startNum++
-            let min = Math.floor(startNum / 60) //分
-            let sec = Math.floor(startNum % 60) //秒
-            min = min < 10 ? '0' + min : min
-            sec = sec < 10 ? '0' + sec : sec
-            micTime.value = `${min}:${sec}`
-        } else {
-            transcribeClick()
-        }
-    },1000)
+    cscmetaTableLoading.value = false
+    if (!error && code === 200) {
+        cscmetaDataTabledata.value=getArrValue(data)
+    } else {
+        cscmetaDataTabledata.value=[]
+    }
 }
 </script>