| | |
| | | class="main_item flex items-center cursor-pointer" |
| | | v-for="(item, index) in state.exampleContent" |
| | | :key="index" |
| | | :class="{ main_item_active: item.sample_id === state.exampleIndex }" |
| | | :class="{ main_item_active: item.sample_id === activeSampleId }" |
| | | @click="changeExample(item)" |
| | | > |
| | | <div class="left flex items-center justify-center" :class="['color' + index]"> |
| | |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import { onMounted, reactive, computed } from 'vue'; |
| | | import { getSelectSample } from '/@/api/ai/chat'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { activeSampleId } from '/@/stores/chatRoom'; |
| | | let state = reactive({ |
| | | exampleContent: [], |
| | | exampleRandomContent: [], |
| | |
| | | { ID: 1, Name: '提问示例' }, |
| | | { ID: 2, Name: '指令模板' }, |
| | | ], |
| | | exampleIndex: 0, |
| | | isShowAdvanceExample: false, |
| | | activeName: 1, |
| | | searchInput: '', |
| | |
| | | }; |
| | | |
| | | const changeExample = (item) => { |
| | | state.exampleIndex = item.sample_id; |
| | | emitter.emit('updateChatInput',item.sample_question) |
| | | activeSampleId.value = item.sample_id |
| | | |
| | | }; |
| | | //换一批 |
| | | const batchChange = () => { |
| | |
| | | //高级示例 |
| | | const advanceExampleClick = () => { |
| | | state.isShowAdvanceExample = true; |
| | | |
| | | }; |
| | | //切换到指令/提问 |
| | | const handleTabClick = (item) => { |