| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, reactive, computed } from 'vue'; |
| | | import { computed, onMounted, reactive } from 'vue'; |
| | | import { getSectionList } from '/@/api/ai/chat'; |
| | | import router from '/@/router'; |
| | | import { activeRoomId, activeSectionAId, setRoomConfig } from '/@/stores/chatRoom'; |
| | | import { activeRoomId, activeSectionAId, setRoomConfig, sectionAList } from '/@/stores/chatRoom'; |
| | | |
| | | let state = reactive({ |
| | | applicationScenarios: [], |
| | | scenariosIds: [], |
| | | }); |
| | | const emits = defineEmits<{ |
| | | (event: 'tagListClick', data): void; |
| | | }>(); |
| | | const changeScenarios = async (item) => { |
| | | activeSectionAId.value = item.section_id; |
| | | setRoomConfig(activeRoomId.value, 'isAnswerByLLM', false); |
| | |
| | | const getMainSectionList = async () => { |
| | | const res = await getSectionList(); |
| | | let result = []; |
| | | const iconList = ['biaodan', 'putong', 'zhongduancanshuchaxun', 'shidu']; |
| | | const iconList = [ |
| | | 'biaodan', |
| | | 'putong', |
| | | 'zhongduancanshuchaxun', |
| | | 'shidu', |
| | | 'fuwenbenkuang', |
| | | 'fuwenben', |
| | | 'jiliandongxuanzeqi', |
| | | 'jinridaiban', |
| | | 'gongju', |
| | | ]; |
| | | res.sections.forEach((sectionItem, index) => { |
| | | sectionItem.Icon = iconList[index]; |
| | | }); |
| | | state.applicationScenarios = res.sections; |
| | | sectionAList.value = res.sections; |
| | | res.sections?.[0] && changeScenarios(res.sections[0]); |
| | | }; |
| | | const groupedArray = computed(() => { |
| | |
| | | const lookMore = () => { |
| | | router.push({ |
| | | name: 'Scenario', |
| | | query: { |
| | | ID: activeSectionAId.value, |
| | | }, |
| | | }); |
| | | }; |
| | | onMounted(() => { |