| | |
| | | <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 1"> |
| | | <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px] overflow-auto"> |
| | | <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl"> |
| | | <el-input v-model="state.searchInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search"> </el-input> |
| | | <el-input v-model="queryParams.searchInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | </el-input> |
| | | </div> |
| | | <div class="mt20 w100 relative"> |
| | | <div |
| | |
| | | <i class="iconfont icon-zhongduancanshu" title="收缩" @click="handleExpandClick(2)" v-show="state.isShowExpand"></i> |
| | | </div> |
| | | <div class="mt20 w100"> |
| | | <div class="w100 pb-[20px]" v-for="item in state.exampleContentList" :key="item.sample_id"> |
| | | <div class="cursor-pointer flex box-border p-[12px] w100 rounded bg-[#f5f7fd] transition-[background-color .2s]" @click="changeExample(item)"> |
| | | <div class="w100 pb-[20px]" v-for="item in queryData" :key="item.sample_id"> |
| | | <div |
| | | class="cursor-pointer flex box-border p-[12px] w100 rounded bg-[#f5f7fd] transition-[background-color .2s]" |
| | | @click="changeExample(item)" |
| | | > |
| | | <i |
| | | class="iconfont icon-chazhaobiaodanliebiao pl-[2px] w-[16px] h-[16px] font12 text-[#fff] transform-[scale(.85)] rounded-[50%]" |
| | | :style="`background-color:${item.BgColor}`" |
| | |
| | | <div class="box-border w-[354px] flex-1 min-h-0 bg-[#e0e7fb]" v-show="state.activeName == 2"> |
| | | <div class="flex flex-col w100 h100 pt-0 pr-[15px] pb-0 pl-[20px] overflow-auto"> |
| | | <div class="flex items-center w100 h-[30px] border border-solid border-[#b2b2b2] transition-[border-color 1s] rounded-2xl"> |
| | | <el-input v-model="state.searchInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search"> </el-input> |
| | | <el-input v-model="queryParams.instructInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | </el-input> |
| | | </div> |
| | | <div class="mt20 w100 relative"> |
| | | <div |
| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { Search } from '@element-plus/icons-vue'; |
| | | import { computed, onMounted, reactive } from 'vue'; |
| | | import { computed, onMounted, reactive, ref, watch } from 'vue'; |
| | | import { getSelectSample, getUserTemplateList } from '/@/api/ai/chat'; |
| | | import { activeSampleId } from '/@/stores/chatRoom'; |
| | | import emitter from '/@/utils/mitt'; |
| | | import { useSearch } from '/@/hooks/useSearch'; |
| | | import { debounce, getRecentDateRange } from '/@/utils/util'; |
| | | |
| | | let state = reactive({ |
| | | exampleContent: [], |
| | | exampleRandomContent: [], |
| | |
| | | ], |
| | | isShowAdvanceExample: false, |
| | | activeName: 1, |
| | | searchInput: '', |
| | | exampleTabList: [ |
| | | { |
| | | ID: 1, |
| | |
| | | Title: '发现探索', |
| | | }, |
| | | ], |
| | | exampleContentList: [], |
| | | |
| | | instructContentList: [], |
| | | |
| | | activeLabelName: 0, |
| | | activeInstructName: 0, |
| | | isShowExpand: false, |
| | | }); |
| | | const exampleList = ref([]); |
| | | onMounted(() => { |
| | | getSelectListSample(); |
| | | getUserTemplate(); |
| | |
| | | } |
| | | return groups; |
| | | }); |
| | | //获取模版列表 |
| | | const getSelectListSample = async () => { |
| | | const res = await getSelectSample({ |
| | | section_b_id: '', |
| | |
| | | array.push(sample); |
| | | } |
| | | }); |
| | | state.exampleContentList = res.samples; |
| | | exampleList.value = res.samples; |
| | | state.exampleContent = array; |
| | | }; |
| | | |
| | |
| | | .toString(16) |
| | | .padEnd(6, '0')}`; |
| | | }; |
| | | //#region ====================== 搜索聊天室 ====================== |
| | | const queryParams = ref({ |
| | | searchInput: '', |
| | | instructInput: '', |
| | | }); |
| | | const { query, queryData } = useSearch(exampleList, queryParams); |
| | | |
| | | const debounceQuery = debounce(query); |
| | | |
| | | watch( |
| | | () => queryParams.value.searchInput, |
| | | (val) => { |
| | | debounceQuery(); |
| | | } |
| | | ); |
| | | //#endregion |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .pc-prompts { |