Prechádzať zdrojové kódy

reactor:修复语音转写无法转写的BUG;

zhangchong 10 mesiacov pred
rodič
commit
159c37a185

+ 42 - 383
src/views/statistics/order/detailSourceTime.vue

@@ -42,6 +42,7 @@
 				:pagination="false"
 				:toolButton="['refresh', 'setting', 'exportAll']"
 				@export-all="exportTable($event, true)"
+        :key="Math.random()"
 			>
 			</ProTable>
 		</el-card>
@@ -50,368 +51,14 @@
 <script setup lang="tsx" name="statisticsOrderDetailSourceTime">
 import { onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
-import { orderSourceList, orderSourceListExport } from '@/api/statistics/order';
+import { orderSourceTime, orderSourceTimeExport, orderSourceTimeHeader } from '@/api/statistics/order';
 import { defaultDate, shortcuts } from '@/utils/constants';
 import { useRouter } from 'vue-router';
 import { downloadFileByStream } from '@/utils/tools';
 import Other from '@/utils/other';
 
 // 表格配置项
-const columns = ref<any[]>([
-	{ prop: 'time', label: '日期', align: 'center', minWidth: 100, fixed: 'left' },
-	{
-		prop: 'subtotal',
-		label: '小计',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.subtotal}
-						</el-button>
-					) : (
-						<span>{scope.row.subtotal}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'phone',
-		label: '电话',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.phone}
-						</el-button>
-					) : (
-						<span>{scope.row.phone}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'web',
-		label: '因特网',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.web}
-						</el-button>
-					) : (
-						<span>{scope.row.web}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'rests',
-		label: '其他',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.rests}
-						</el-button>
-					) : (
-						<span>{scope.row.rests}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'created',
-		label: '自建',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.created}
-						</el-button>
-					) : (
-						<span>{scope.row.created}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'weChat',
-		label: '微信',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.weChat}
-						</el-button>
-					) : (
-						<span>{scope.row.weChat}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'app',
-		label: 'APP',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.app}
-						</el-button>
-					) : (
-						<span>{scope.row.app}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'wisdomYB',
-		label: '智慧宜宾',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.wisdomYB}
-						</el-button>
-					) : (
-						<span>{scope.row.wisdomYB}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'platform',
-		label: '综治平台',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.platform}
-						</el-button>
-					) : (
-						<span>{scope.row.platform}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'platform12328',
-		label: '省12328平台',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.platform12328}
-						</el-button>
-					) : (
-						<span>{scope.row.platform12328}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'mayorAndNetizens',
-		label: '市长和网民',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.mayorAndNetizens}
-						</el-button>
-					) : (
-						<span>{scope.row.mayorAndNetizens}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'mediaYB',
-		label: '宜宾融媒体',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.mediaYB}
-						</el-button>
-					) : (
-						<span>{scope.row.mediaYB}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'platform12345',
-		label: '省12345平台',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.platform12345}
-						</el-button>
-					) : (
-						<span>{scope.row.platform12345}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'interaction',
-		label: '省政民互动',
-		minWidth: 120,
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.interaction}
-						</el-button>
-					) : (
-						<span>{scope.row.interaction}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'serviceYB',
-		label: '宜办事',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.serviceYB}
-						</el-button>
-					) : (
-						<span>{scope.row.serviceYB}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'cityTransfer',
-		label: '市州互转',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.cityTransfer}
-						</el-button>
-					) : (
-						<span>{scope.row.serviceYB}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'platform110',
-		label: '宜宾110平台',
-		align: 'center',
-		minWidth: 120,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.platform110}
-						</el-button>
-					) : (
-						<span>{scope.row.platform110}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'noService',
-		label: '办不成事反映窗口',
-		align: 'center',
-		minWidth: 150,
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.noService}
-						</el-button>
-					) : (
-						<span>{scope.row.noService}</span>
-					)}
-				</>
-			);
-		},
-	},
-	{
-		prop: 'iyb',
-		label: 'i宜宾',
-		align: 'center',
-		render: (scope) => {
-			return (
-				<>
-					{scope.row.time !== '合计' ? (
-						<el-button type="primary" link onClick={() => linkDetail(scope)}>
-							{scope.row.iyb}
-						</el-button>
-					) : (
-						<span>{scope.row.iyb}</span>
-					)}
-				</>
-			);
-		},
-	},
-]);
+const columns = ref<any[]>([]);
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
@@ -434,20 +81,45 @@ const handleQuery = () => {
 	queryList();
 };
 /** 获取列表 */
-const queryList = () => {
+const queryList = async () => {
 	state.loading = true;
-	let request = Other.deepClone(state.queryParams);
-	request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
-	request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
-	Reflect.deleteProperty(request, 'crTime');
-	orderSourceList(request)
-		.then((res: any) => {
-			state.tableData = res.result ?? [];
-			state.loading = false;
-		})
-		.catch(() => {
-			state.loading = false;
+	try {
+		let request = Other.deepClone(state.queryParams);
+		request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
+		request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
+		Reflect.deleteProperty(request, 'crTime');
+		const dataRes = await orderSourceTime(request);
+		const headerRes = await orderSourceTimeHeader();
+		console.log(dataRes, headerRes);
+		columns.value = headerRes.result.map((item: any) => {
+			return {
+				prop: item.value.replace(item.value[0], item.value[0].toLowerCase()),
+				label: item.key,
+				align: 'center',
+				minWidth: 120,
+			};
 		});
+		columns.value.unshift(
+			{
+				prop: 'time',
+				label: '时间段',
+				align: 'center',
+				minWidth: 120,
+				fixed: 'left',
+			},
+			{
+				prop: 'subtotal',
+				label: '小计',
+				align: 'center',
+				minWidth: 100,
+			}
+		);
+		state.tableData = dataRes.result;
+		state.loading = false;
+	} catch (e) {
+		state.loading = false;
+		console.log(e);
+	}
 };
 /** 重置按钮操作 */
 const resetQuery = (formEl: FormInstance | undefined) => {
@@ -455,20 +127,6 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	formEl.resetFields();
 	queryList();
 };
-// 查看明细
-const router = useRouter();
-const linkDetail = (scope: any) => {
-	router.push({
-		name: 'statisticsDetailSourceOrder',
-		query: {
-			IdentityType: scope.row.IdentityType,
-			startTime: state.queryParams.crTime[0],
-			endTime: state.queryParams.crTime[1],
-      Time: scope.row.time,
-      SourceChannel:scope.column.label
-		},
-	});
-};
 // 表格导出
 const exportTable = (columnInfos: any, isExportAll = false) => {
 	let request = Other.deepClone(state.queryParams);
@@ -481,7 +139,7 @@ const exportTable = (columnInfos: any, isExportAll = false) => {
 		isExportAll,
 	};
 	state.loading = true;
-	orderSourceListExport(req)
+	orderSourceTimeExport(req)
 		.then((res: any) => {
 			state.loading = false;
 			downloadFileByStream(res);
@@ -491,6 +149,7 @@ const exportTable = (columnInfos: any, isExportAll = false) => {
 		});
 };
 // 查看图表
+const router = useRouter();
 const onDetail = () => {
 	router.push({
 		name: 'statisticsOrderTimeSource',

+ 12 - 14
src/views/statistics/order/timeSource.vue

@@ -127,26 +127,24 @@ const queryList = async () => {
     const legendData = headerRes.result.map((item: any) => {
       return item.key;
     });
-    const xData = dataRes.result.map((item: any) => {
-      return item.time;
-    })
+    const xData = dataRes.result.map((item: any) => item.time).filter((item: any) => item !== '合计');
     const seriesHeader = headerRes.result.map((item: any) => {
       return {
         prop: item.value.replace(item.value[0],item.value[0].toLowerCase()),
         label: item.key,
       };
     });
-    // for(let i of seriesHeader){
-    //   const item = dataRes.result.filter((j: any) =>j.time === i.prop);
-    //   for(let j of dataRes.result){
-    //     if(j.time === i.prop)
-    //   }
-    //   console.log(item,'11')
-    // }
+    for(let i of headerRes.result){
+      for(let j of dataRes.result){
+        // 判断j的键名和i.prop是否相等
+        console.log(j,i.value.replace(i.value[0],i.value[0].toLowerCase()),j[i.value.replace(i.value[0],i.value[0].toLowerCase())],i)
+        if(i.value.replace(i.value[0],i.value[0].toLowerCase()) === j[i.value.replace(i.value[0],i.value[0].toLowerCase())]){
+          console.log(i)
+        }
+      }
+    }
     const seriesData = dataRes.result.map((item: any) => {
-      for(let i of headerRes.result){
 
-      }
       return {
         name:'' ,
         type: 'bar',
@@ -158,8 +156,8 @@ const queryList = async () => {
         data: item.data,
       }
     })
-    console.log(seriesHeader)
-    setOption(legendData,xData,[])
+    console.log(state.tableData,columns.value)
+    // setOption(legendData,xData,[])
     state.loading = false;
   }catch (e){
     state.loading = false;

+ 2 - 2
src/views/todo/seats/accept/Call-summary.vue

@@ -93,12 +93,12 @@ const route = useRoute();
 const loading = ref(false);
 // 无效id
 const invalidId = computed(() => {
-	return !route.params.callId || route.params.callId.length === 13;
+	return !route.query.callId || route.query.callId.length === 13;
 });
 const getRecognize = async () => {
 	loading.value = true;
 	try {
-		const callId = route.params.callId;
+		const callId = route.query.callId;
 		if (invalidId.value) {
 			// ElMessage.info('暂未获取到通话ID,请关闭页面重新进入重试');
 			loading.value = false;

+ 3 - 7
src/views/todo/seats/accept/Real-time-quality.vue

@@ -13,16 +13,12 @@
 	</div>
 </template>
 <script setup lang="ts" name="orderAcceptRealtimeQuality">
-import { nextTick, onActivated, onDeactivated, onMounted, ref, watch } from 'vue';
+import { onActivated, onDeactivated, onMounted, ref } from 'vue';
 import mittBus from '@/utils/mitt';
-import other from '@/utils/other';
-import { useRoute } from 'vue-router';
 import { formatDate } from '@/utils/formatTime';
-const tagList = ref([
-]);
+const tagList = ref([]);
 const talkEnd = ref(false);
 // 订阅消息
-const route = useRoute();
 const subscribe = () => {
 	// 接受消息
 	mittBus.on('wsNotice', (message: any) => {
@@ -37,7 +33,7 @@ const wsNotice = (message: any) => {
 			console.log(data.body.content[0].name, '语音提醒消息');
 			tagList.value.push({
 				name: data.body.content[0].name,
-        timestamp: data.body.content[0].timestamp,
+				timestamp: data.body.content[0].timestamp,
 			});
 		}
 	} catch (error) {

+ 1 - 1
src/views/todo/seats/accept/Voice-assistant.vue

@@ -220,7 +220,7 @@ const subscribe = () => {
 	// 接受消息
 	mittBus.on('wsReceive', (message: any) => {
 		const data = JSON.parse(message.data);
-		if (data.body.content.callId === route.params.callId) {
+		if (data.body.content.callId === route.query.callId) {
 			// 判断是否是当前通话
 			wsReceive(message);
 		}