| | |
| | | <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 { activeRoomId, activeSampleId, topGroupId, setRoomConfig } from '/@/stores/chatRoom'; |
| | | let state = reactive({ |
| | | exampleContent: [], |
| | | isShowExample: false, |
| | |
| | | const getSelectListSample = async () => { |
| | | const res = await getSelectSample({}); |
| | | const array = []; |
| | | res.samples.forEach((sample, index) => { |
| | | res.samples.filter(item=>item.group_id===topGroupId.value).forEach((sample, index) => { |
| | | sample.Icon = '/static/images/wave/ChatImg.png'; |
| | | sample.BgColor = randomHexColor(); |
| | | if (index < 4) { |
| | |
| | | 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 = () => { |