From ef721915b1a4afc33454e71460769bd3d7c264a9 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期四, 17 十月 2024 13:42:20 +0800
Subject: [PATCH] 完成 recordset

---
 src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
index 698f07e..f45bbc5 100644
--- a/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
+++ b/src/components/chat/chatComponents/summaryCom/components/recordSet/RecordSet.vue
@@ -385,7 +385,7 @@
 	const values = res?.values ?? [];
 	//#region ====================== 鍒锋柊褰撳墠 filter ======================
 	// 鍙洿鏂� value锛屼笉鐩存帴瑕嗙洊锛岄槻姝涪澶卞搷搴旀��
-	updateVisibleParams(res)
+	updateVisibleParams(res);
 	//#endregion
 	groupedValues = _.groupBy(values, (item) => item[nameIndex]);
 	if (isMultiCompare.value) {
@@ -409,7 +409,6 @@
 	}
 };
 
-
 const handleQueryChange = async (val: any, item: RecordSetParamsItem) => {
 	if (!val) return;
 	const historyId = (props as any).originData.historyId;
@@ -429,7 +428,7 @@
 			if (curVal.agent_key !== curAgentKey) return preVal;
 
 			const filter = (curVal.filter ?? []).reduce((subPreVal, subCurVal) => {
-				if (item.type === RecordSetParamsType.TimeRange) {
+				if (subCurVal.type === RecordSetParamsType.TimeRange) {
 					subPreVal.push(
 						...[
 							{
@@ -459,7 +458,6 @@
 
 			return preVal;
 		}, []);
-
 		const params = {
 			history_id: historyId,
 			// 鏌ヨ鍓嶅悗 agent_key 涓嶄細鍙�
@@ -665,7 +663,23 @@
 	if (curAgentKey !== triggerAgentKey) {
 		return;
 	}
-	const newSummary = res?.summary?.[props.summaryIndex];
+	if (!curAgentKey) {
+		return;
+	}
+
+	// 褰撳墠椤规墍鍦ㄧ储寮�
+	let currentIndex = -1;
+	for (let index = 0; index < (props as any).originData.content.origin.summary.length; index++) {
+		const item = (props as any).originData.content.origin.summary[index];
+		if (item.agent_key === curAgentKey) {
+			currentIndex++;
+			if (index === props.summaryIndex) {
+				break;
+			}
+		}
+	}
+
+	const newSummary = res?.summary?.[currentIndex];
 	if (!newSummary) return;
 
 	updateCurrent(newSummary);

--
Gitblit v1.9.3