From 1abf30691f42f2b07c622fbbd4a957c23546bb0c Mon Sep 17 00:00:00 2001
From: yangyin <18723093654@163.com>
Date: 星期日, 30 六月 2024 16:56:46 +0800
Subject: [PATCH] fix: 联调数据案例

---
 src/views/project/ch/home/component/waterRight/center.vue |   73 ++++++------------------------------
 1 files changed, 13 insertions(+), 60 deletions(-)

diff --git a/src/views/project/ch/home/component/waterRight/center.vue b/src/views/project/ch/home/component/waterRight/center.vue
index 44cb534..5fc7726 100644
--- a/src/views/project/ch/home/component/waterRight/center.vue
+++ b/src/views/project/ch/home/component/waterRight/center.vue
@@ -70,16 +70,16 @@
 							<i class="iconfont icon-zhongduancanshu" title="鏀剁缉" @click="handleExpandClick(2)" v-show="state.isShowExpand"></i>
 						</div>
 						<div class="mt20 w100">
-							<div class="w100 pb-[20px]" v-for="item in state.exampleContentList" :key="item.ID">
+							<div class="w100 pb-[20px]" v-for="item in state.exampleContentList" :key="item.sample_id">
 								<div class="cursor-pointer flex box-border p-[12px] w100 rounded bg-[#f5f7fd] transition-[background-color .2s]">
 									<i
 										class="iconfont icon-chazhaobiaodanliebiao pl-[2px] w-[16px] h-[16px] font12 text-[#fff] transform-[scale(.85)] rounded-[50%]"
 										:style="`background-color:${item.BgColor}`"
 									></i>
 									<div class="ml-6 flex-1 min-w-0">
-										<div class="text-sm text-[#000] m-0 p-0 font-bold">{{ item.Title }}</div>
+										<div class="text-sm text-[#000] m-0 p-0 font-bold">{{ item.sample_title }}</div>
 										<div class="mt-[6px] text-[13px] text-[#666] h-[20px] whitespace-nowrap text-ellipsis overflow-hidden">
-											{{ item.Content }}
+											{{ item.sample_question }}
 										</div>
 									</div>
 								</div>
@@ -143,6 +143,7 @@
 import { getSelectSample } from '/@/api/ai/chat';
 let state = reactive({
 	exampleContent: [],
+	exampleRandomContent: [],
 	tabNameList: [
 		{ ID: 1, Name: '鎻愰棶绀轰緥' },
 		{ ID: 2, Name: '鎸囦护妯℃澘' },
@@ -219,55 +220,7 @@
 			Title: '鍙戠幇鎺㈢储',
 		},
 	],
-	exampleContentList: [
-		{
-			ID: 1,
-			Title: '濡備綍鎻愬崌鑷繁鐨勮亴鍦虹珵浜夊姏锛�',
-			Content:
-				'鑱屽満绔炰簤鍔涙槸琛¢噺涓�涓汉鏄惁鎴愬姛鐨勯噸瑕佹爣鍑嗐�傝亴鍦虹珵浜夊姏鐨勬彁鍗囷紝闇�瑕侀暱鏈熺殑鍔姏鍜屽潥鎸併�備笅闈㈡槸涓�浜涙彁鍗囪亴鍦虹珵浜夊姏鐨勬柟娉曪細1. 淇濇寔涓撴敞锛氫笓娉ㄤ簬鑷繁鐨勫伐浣滐紝涓嶆柇瀛︿範鏂版妧鑳斤紝鎻愬崌鎶�鑳芥按骞炽��2. 淇濇寔瀛︿範锛氫笉鏂涔犳柊鐭ヨ瘑锛屼笉鏂彁鍗囪嚜宸辩殑涓撲笟鐭ヨ瘑銆�3. 淇濇寔鐑儏锛氫繚鎸佺Н鏋佸悜涓婄殑蹇冩�侊紝涓嶆柇杩芥眰鏂颁簨鐗┿��4. 淇濇寔閫傚綋鐨勪紤鎭細閫傚綋鐨勪紤鎭彲浠ヨ韬綋鏇村姞鍋ュ悍锛屾彁楂樺伐浣滄晥鐜囥��5. 淇濇寔绉瀬鐨勬�佸害锛氱Н鏋佺殑鎬佸害鍙互婵�鍙戝憳宸ョ殑鍒涢�犲姏锛屾彁鍗囧伐浣滅殑绉瀬鎬с��',
-		},
-		{
-			ID: 2,
-			Title: '鐖辨姢鍔ㄧ墿瑙嗛鍓ф湰',
-			Content: '璇锋媴浠荤紪鍓э紝鎴戦渶瑕佹媿鎽勪竴涓叧浜庣埍鎶ゅ姩鐗╃殑瑙嗛锛岃缁欐垜鐢熸垚鎷嶆憚鍐呭鍜岃剼鏈�',
-		},
-		{
-			ID: 3,
-			Title: '娉㈢矑浜岃薄鎬�',
-			Content: '瑙i噴涓�涓嬫尝绮掍簩璞℃�х悊璁�',
-		},
-		{
-			ID: 4,
-			Title: '濡備綍鎻愬崌鑷繁鐨勮亴鍦虹珵浜夊姏锛�',
-			Content:
-				'鑱屽満绔炰簤鍔涙槸琛¢噺涓�涓汉鏄惁鎴愬姛鐨勯噸瑕佹爣鍑嗐�傝亴鍦虹珵浜夊姏鐨勬彁鍗囷紝闇�瑕侀暱鏈熺殑鍔姏鍜屽潥鎸併�備笅闈㈡槸涓�浜涙彁鍗囪亴鍦虹珵浜夊姏鐨勬柟娉曪細1. 淇濇寔涓撴敞锛氫笓娉ㄤ簬鑷繁鐨勫伐浣滐紝涓嶆柇瀛︿範鏂版妧鑳斤紝鎻愬崌鎶�鑳芥按骞炽��2. 淇濇寔瀛︿範锛氫笉鏂涔犳柊鐭ヨ瘑锛屼笉鏂彁鍗囪嚜宸辩殑涓撲笟鐭ヨ瘑銆�3. 淇濇寔鐑儏锛氫繚鎸佺Н鏋佸悜涓婄殑蹇冩�侊紝涓嶆柇杩芥眰鏂颁簨鐗┿��4. 淇濇寔閫傚綋鐨勪紤鎭細閫傚綋鐨勪紤鎭彲浠ヨ韬綋鏇村姞鍋ュ悍锛屾彁楂樺伐浣滄晥鐜囥��5. 淇濇寔绉瀬鐨勬�佸害锛氱Н鏋佺殑鎬佸害鍙互婵�鍙戝憳宸ョ殑鍒涢�犲姏锛屾彁鍗囧伐浣滅殑绉瀬鎬с��',
-		},
-		{
-			ID: 5,
-			Title: '鎸戦�夊悎閫傜殑绀肩墿',
-			Content: '璇峰コ瀹㈡埛鍚冮キ锛屽噯澶囬�佷竴涓皬绀肩墿锛岄�変粈涔堢ぜ鐗╁悎閫傚憿',
-		},
-		{
-			ID: 6,
-			Title: '瑙f柟绋媥虏-y虏=49',
-			Content: '姝f暣鏁皒,y婊¤冻x^2-y^2=49锛屾眰x鍜寉鐨勫��',
-		},
-		{
-			ID: 7,
-			Title: '璁$畻鐞冧綋浣撶Н',
-			Content: '璁$畻鐞冧綋浣撶Н',
-		},
-		{
-			ID: 8,
-			Title: '鐖辨姢鍔ㄧ墿瑙嗛鍓ф湰',
-			Content: '璇锋媴浠荤紪鍓э紝鎴戦渶瑕佹媿鎽勪竴涓叧浜庣埍鎶ゅ姩鐗╃殑瑙嗛锛岃缁欐垜鐢熸垚鎷嶆憚鍐呭鍜岃剼鏈�',
-		},
-		{
-			ID: 9,
-			Title: '璇楁剰缈昏瘧锛氭棩鏈堜笌鐖�',
-			Content: '缈昏瘧涓鸿嫳鏂囷細娴笘涓囧崈锛屽惥鐖辨湁涓夛紝鏃ャ�佹湀銆佸嵖锛屾棩涓烘湞锛屾湀涓烘毊锛屽嵖涓烘湞鏈濇毊鏆��',
-		},
-	],
+	exampleContentList: [],
 	instructContentList: [
 		{
 			ID: 1,
@@ -307,17 +260,18 @@
 const groupedArray = computed(() => {
 	const groups = [];
 	let i = 0;
-	while (state.exampleContent.length > i) {
-		groups.push(state.exampleContent.slice(i, (i += 4)));
+	while (state.exampleRandomContent.length > i) {
+		groups.push(state.exampleRandomContent.slice(i, (i += 4)));
 	}
 	return groups;
 });
-
 const getSelectListSample = async () => {
 	const res = await getSelectSample({
 		section_b_id: '',
 	});
 	// console.log(res, 63);
+	state.exampleRandomContent = res.samples;
+
 	const array = [];
 	res.samples.forEach((sample, index) => {
 		sample.Icon = '/static/images/wave/ChatImg.png';
@@ -326,18 +280,17 @@
 			array.push(sample);
 		}
 	});
+	state.exampleContentList = res.samples;
 	state.exampleContent = array;
 };
 
 const changeExample = (item) => {
 	state.exampleIndex = item.sample_id;
 };
+//鎹竴鎵�
 const batchChange = () => {
-	const batch = [];
-	for (let i = 0; i < groupedArray.value.length; i++) {
-		batch.push(state.exampleContent[state.exampleIndex]);
-		state.exampleIndex = (state.exampleIndex + 1) % state.exampleContent.length;
-	}
+	state.exampleContent = groupedArray.value[state.exampleIndex];
+	console.log(state.exampleContent, 341);
 };
 //楂樼骇绀轰緥
 const advanceExampleClick = () => {

--
Gitblit v1.9.3