gerson
2024-07-01 87bce04d7cdf5ca427757071e7cc3b0847b64dfc
src/views/project/ch/home/component/waterRight/center.vue
@@ -17,7 +17,7 @@
            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]">
@@ -141,6 +141,8 @@
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: [],
@@ -148,7 +150,6 @@
      { ID: 1, Name: '提问示例' },
      { ID: 2, Name: '指令模板' },
   ],
   exampleIndex: 0,
   isShowAdvanceExample: false,
   activeName: 1,
   searchInput: '',
@@ -285,7 +286,9 @@
};
const changeExample = (item) => {
   state.exampleIndex = item.sample_id;
   emitter.emit('updateChatInput',item.sample_question)
   activeSampleId.value = item.sample_id
};
//换一批
const batchChange = () => {
@@ -296,6 +299,7 @@
//高级示例
const advanceExampleClick = () => {
   state.isShowAdvanceExample = true;
};
//切换到指令/提问
const handleTabClick = (item) => {