| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { reactive, ref } from 'vue'; |
| | | import { activeRoomId, activeSampleId, setRoomConfig } from '/@/stores/chatRoom'; |
| | | import { reactive } from 'vue'; |
| | | import { activeRoomId, activeSampleId, exampleSceneList, 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; |
| | | }>(); |
| | | const props = defineProps(['exampleList']); |
| | | |
| | | const initGroupedArr = () => { |
| | | const groups = []; |
| | | let i = 0; |
| | |
| | | emits('updateChatInput', item.sample_question); |
| | | setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false); |
| | | activeSampleId.value = item.sample_id; |
| | | // topGroupId.value = item.section_a_id; |
| | | }; |
| | | //换一批 |
| | | const batchChange = () => { |
| | |
| | | const tagListClick = (tagList) => { |
| | | let result = []; |
| | | tagList.forEach((tag) => { |
| | | props.exampleList.forEach((sample) => { |
| | | exampleSceneList.value.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({ |
| | | tagListClick, |