From fc5832caff5464370dc55470e3408c11c6d6700a Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 29 十月 2024 13:24:15 +0800
Subject: [PATCH] 删除多余的代码

---
 src/views/project/ch/home/component/waterRight/center.vue |   58 ++++++----------------------------------------------------
 1 files changed, 6 insertions(+), 52 deletions(-)

diff --git a/src/views/project/ch/home/component/waterRight/center.vue b/src/views/project/ch/home/component/waterRight/center.vue
index 444e49f..089f32c 100644
--- a/src/views/project/ch/home/component/waterRight/center.vue
+++ b/src/views/project/ch/home/component/waterRight/center.vue
@@ -12,26 +12,7 @@
 			</div>
 		</div>
 		<div class="main">
-			<el-carousel height="80" :interval="6000" indicator-position="none" v-show="!state.isShowExample">
-				<el-carousel-item v-for="(group, index) in state.m_groupArr" :key="index" class="set-carousel-item">
-					<div
-						class="main_item flex items-center cursor-pointer"
-						v-for="(item, index) in group"
-						:key="index"
-						:class="{ main_item_active: item.sample_id === activeSampleId }"
-						@click="changeExample(item)"
-					>
-						<div class="left flex items-center justify-center" :class="['color' + index]">
-							<img :src="item.Icon" alt="" />
-						</div>
-						<div class="right">
-							<h4>{{ item.sample_title }}</h4>
-							<p>{{ item.sample_question }}</p>
-						</div>
-					</div>
-				</el-carousel-item>
-			</el-carousel>
-			<el-carousel height="80" :interval="6000" indicator-position="none" v-show="state.isShowExample">
+			<el-carousel height="80" :interval="6000" indicator-position="none">
 				<el-carousel-item v-for="(group, index) in state.m_groupArr" :key="index" class="set-carousel-item">
 					<div
 						class="main_item flex items-center cursor-pointer"
@@ -55,22 +36,18 @@
 </template>
 
 <script setup lang="ts">
-import { onMounted, reactive, ref } from 'vue';
-import { getSelectSample } from '/@/api/ai/chat';
-import { activeRoomId, activeSampleId, activeSectionAId, setRoomConfig } from '/@/stores/chatRoom';
+import { reactive } from 'vue';
+import { activeRoomId, activeSampleId, setRoomConfig } from '/@/stores/chatRoom';
 let state = reactive({
 	exampleContent: [],
 	isShowExample: false,
 	m_groupArr: [],
 });
-const exampleList = ref([]); //妯$増鍒楄〃
 const emits = defineEmits<{
 	(event: 'advanceExampleClick', data): void;
 	(event: 'updateChatInput', val): void;
 }>();
-onMounted(() => {
-	getSelectListSample();
-});
+const props = defineProps(['exampleList']);
 
 const initGroupedArr = () => {
 	const groups = [];
@@ -82,25 +59,11 @@
 	state.m_groupArr = groups;
 };
 
-//鑾峰彇妯$増鍒楄〃
-const getSelectListSample = async () => {
-	const res = await getSelectSample({});
-	const array = [];
-	res.samples.forEach((sample, index) => {
-		sample.Icon = '/static/images/wave/ChatImg.png';
-		sample.BgColor = randomHexColor();
-		if (index < 4) {
-			array.push(sample);
-		}
-	});
-	exampleList.value = res.samples;
-};
-
 const changeExample = (item) => {
 	emits('updateChatInput', item.sample_question);
 	setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false);
 	activeSampleId.value = item.sample_id;
-	activeSectionAId.value = item.section_a_id;
+	// topGroupId.value = item.section_a_id;
 };
 //鎹竴鎵�
 const batchChange = () => {
@@ -110,7 +73,6 @@
 		const j = Math.floor(Math.random() * (i + 1));
 		[groups[i], groups[j]] = [groups[j], groups[i]];
 	}
-
 	state.m_groupArr = groups;
 };
 //鎵撳紑楂樼骇绀轰緥
@@ -120,24 +82,16 @@
 const tagListClick = (tagList) => {
 	let result = [];
 	tagList.forEach((tag) => {
-		exampleList.value.forEach((sample) => {
+		props.exampleList.forEach((sample) => {
 			if (tag == sample.group_id) {
 				result.push(sample);
 			}
 		});
 	});
 	state.exampleContent = result;
-
 	initGroupedArr();
 };
-//闅忔満鐢熸垚棰滆壊
-const randomHexColor = () => {
-	return `#${Math.floor(Math.random() * 16777215)
-		.toString(16)
-		.padEnd(6, '0')}`;
-};
 defineExpose({
-	getSelectListSample,
 	tagListClick,
 });
 </script>

--
Gitblit v1.9.3