Jelajahi Sumber

feat: 转文字版块调整

sunxiao 3 bulan lalu
induk
melakukan
ec70fd7981

+ 9 - 1
src/components/CallView/index.vue

@@ -7,6 +7,7 @@ import useVoiceStore from "@/store/modules/voice";
 import AudioPlayer from '@/components/AudioPlayer';
 import CustomRowItem from '@/components/CustomRowItem';
 import VoiceToText from '@/components/VoiceToText';
+import { watch, watchEffect } from 'vue';
 
 const emit = defineEmits(['onEnd'])
 
@@ -42,11 +43,18 @@ const typeEnum = {
   2: '传统服务'
 }
 
-watch(() => props.data.id, () => {
+watch(() => props.data, () => {
+  // console.log("中间层", props.data);
+  // // times: audioPlayerRef.value.durationTime
+  // callDetails.value = {...props.data };
+})
+
+watchEffect(() => {
   // times: audioPlayerRef.value.durationTime
   callDetails.value = {...props.data };
 })
 
+
 const durationTime = computed(() => {
   const durationTime = audioPlayerRef.value?.durationTime;
   return durationTime ? durationTime: '00:00';

+ 15 - 4
src/components/VoiceToText/index.vue

@@ -1,6 +1,7 @@
 <script setup>
 import { ElMessage } from 'element-plus'
 import { workbenchApi } from '@/api/voice/workbench';
+import { watchEffect } from 'vue';
 
 const emit = defineEmits(['onParsed']);
 const props = defineProps({
@@ -20,8 +21,15 @@ const isExpandStatus = ref({});
 
 const loading = computed(() => loadingStatus.value['loading' + props.id]);
 
-watch(() => props.id, () => {
-  parsedVoiceList.value = props.content? JSON.parse(props.content) : [];
+// watch(() => props.id, () => {
+//   parsedVoiceList.value = props.content ? JSON.parse(props.content) : [];
+//   Object.keys(isExpandStatus.value).forEach(key => {
+//     isExpandStatus.value[key] = false;
+//   })
+// })
+
+watchEffect(() => {
+  parsedVoiceList.value = props.content ? JSON.parse(props.content) : [];
   Object.keys(isExpandStatus.value).forEach(key => {
     isExpandStatus.value[key] = false;
   })
@@ -62,13 +70,16 @@ const handleTransformVoiceToText = async () => {
         <slot></slot>
         <span
           class="text-[#165DFF] text-[12px] cursor-pointer"
-          @click="handleTransformVoiceToText">{{ isExpandStatus['id' + id] ? '收起文字' : '转文字'}}
+          @click="handleTransformVoiceToText"
+           v-if="!content"
+          >{{ isExpandStatus['id' + id] ? '收起文字' : '转文字'}}
         </span>
         <el-icon class="is-loading" v-show="loading">
           <Loading />
         </el-icon>
       </div>
-      <ul class="record-play-content" v-show="isExpandStatus['id' + id]">
+      <!-- v-show="isExpandStatus['id' + id]" -->
+      <ul class="record-play-content" >
         <li v-for="item, index in parsedVoiceList" :key="index">
           <span>
             {{ item.Text }}

+ 3 - 3
src/views/system/role/index.vue

@@ -115,13 +115,13 @@
          </el-table-column>
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template #default="scope">
-              <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1 && scope.row.roleId !== 106">
+              <el-tooltip content="修改" placement="top" v-if="scope.row.roleId !== 1">
                 <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
               </el-tooltip>
-              <el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1 && scope.row.roleId !== 106">
+              <el-tooltip content="删除" placement="top" v-if="scope.row.roleId !== 1">
                 <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']"></el-button>
               </el-tooltip>
-              <el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1 && scope.row.roleId !== 106">
+              <el-tooltip content="数据权限" placement="top" v-if="scope.row.roleId !== 1">
                 <el-button link type="primary" icon="CircleCheck" @click="handleDataScope(scope.row)" v-hasPermi="['system:role:edit']"></el-button>
               </el-tooltip>
               <el-tooltip content="分配用户" placement="top" v-if="scope.row.roleId !== 1">

+ 1 - 1
src/views/voice/analyse/index.vue

@@ -6,7 +6,7 @@ const userTableData = ref([]);
 const robotTableData = ref([]);
 
 const formatNum = num => {
-  return num + '%';
+  return (num || 0) + '%';
   // return (Number(num === null ? 0 : num.toFixed(2))).toFixed() + '%';
 }
 

+ 0 - 1
src/views/voice/services/index.vue

@@ -399,7 +399,6 @@ onMounted(() => {
               </el-icon>
               <span>新增小区</span>
             </div>
-            <span class="text-[#999]">添加或删除完成后 10 分钟后生效</span>
           </div>
         </div>
 

+ 3 - 1
src/views/voice/whiteList/index.vue

@@ -130,11 +130,12 @@ onMounted(() => {
       </el-row>
     </div>
     
-    <div class="add-btn-card">
+    <div class="add-btn-card space-x-[15px]">
       <div class="btn space-x-[5px]" @click="handleAddPhoneNum">
         <el-icon><CirclePlus /></el-icon>
         <span>新增电话</span>
       </div>
+      <span class="text-[#999]">添加或删除完成后 10 分钟后生效</span>
     </div>
 
     <div class="table-card">
@@ -230,6 +231,7 @@ onMounted(() => {
 
   .add-btn-card {
     display: flex;
+    align-items: center;
     justify-content: flex-start;
     margin: 20px 0;