From 7d68c674fc27260c59ab66b349c1f3158c0c0843 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期五, 25 十月 2024 15:33:09 +0800 Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test --- src/views/project/ch/home/component/waterRight/center.vue | 68 ++++++++++++++++++++++------------ 1 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/views/project/ch/home/component/waterRight/center.vue b/src/views/project/ch/home/component/waterRight/center.vue index b0ca19b..a9d96e6 100644 --- a/src/views/project/ch/home/component/waterRight/center.vue +++ b/src/views/project/ch/home/component/waterRight/center.vue @@ -8,26 +8,29 @@ </div> <div class="cursor-pointer"> <span class="mr-1 changeBatch" @click="batchChange">鎹竴鎵�</span> - <i class="iconfont icon-shuaxin"></i> + <i class="myiconfont icon-shuaxin"></i> </div> </div> - <div class="main"> - <div - class="main_item flex items-center cursor-pointer" - v-for="(item, index) in state.exampleContent" - :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 height="80" :interval="5000" indicator-position="none"> + <el-carousel-item v-for="group in batchSourceData" :key="group" class="set-carousel-item"> + <div + class="main_item flex items-center cursor-pointer" + v-for="(item, index) in state.exampleContent" + :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> </div> </div> </template> @@ -36,7 +39,6 @@ import { computed, onMounted, reactive, ref } from 'vue'; import { getSelectSample } from '/@/api/ai/chat'; import { activeRoomId, activeSampleId, activeSectionAId, setRoomConfig } from '/@/stores/chatRoom'; -import emitter from '/@/utils/mitt'; let state = reactive({ exampleContent: [], exampleRandomContent: [], @@ -44,11 +46,12 @@ const exampleList = ref([]); //妯$増鍒楄〃 const emits = defineEmits<{ (event: 'advanceExampleClick', data): void; - (event:'updateChatInput',val):void; + (event: 'updateChatInput', val): void; }>(); onMounted(() => { getSelectListSample(); }); +//鎹竴鎵规暟鎹簮 const groupedArray = computed(() => { const groups = []; let i = 0; @@ -57,12 +60,18 @@ } return groups; }); +//鑷姩鎾斁 +const batchSourceData = computed(() => { + const batch = []; + let i = 0; + while (exampleList.value.length > i) { + batch.push(exampleList.value.slice(i, (i += 4))); + } + return batch; +}); //鑾峰彇妯$増鍒楄〃 const getSelectListSample = async () => { - const res = await getSelectSample({ - section_b_id: '', - }); - // console.log(res, 63); + const res = await getSelectSample({}); state.exampleRandomContent = res.samples; const array = []; @@ -78,7 +87,7 @@ }; const changeExample = (item) => { - emits('updateChatInput',item.sample_question) + emits('updateChatInput', item.sample_question); setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false); activeSampleId.value = item.sample_id; activeSectionAId.value = item.section_a_id; @@ -202,6 +211,10 @@ } } } + .set-carousel-item { + display: flex; + flex-wrap: wrap; + } } } @@ -220,4 +233,11 @@ :deep(.el-drawer__body) { overflow-x: hidden; } +:deep(.el-carousel--horizontal) { + width: 100%; +} +:deep(.el-carousel__container) { + width: 100%; + height: 200px !important; +} </style> -- Gitblit v1.9.3