| | |
| | | <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="queryParams.searchInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | <el-input v-model="queryParams.sample_title" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | </el-input> |
| | | </div> |
| | | <div class="mt20 w100 relative"> |
| | |
| | | <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="queryParams.instructInput" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | <el-input v-model="instructParams.template_title" placeholder="搜索更多" class="set-input" :prefix-icon="Search" clearable> |
| | | </el-input> |
| | | </div> |
| | | <div class="mt20 w100 relative"> |
| | |
| | | <i class="iconfont icon-zhongduancanshu" title="收缩" @click="handleExpandClick(2)" v-show="state.isShowExpand"></i> |
| | | </div> |
| | | <div class="mt20 w100"> |
| | | <div |
| | | class="w100 pb-[20px] flex overflow-auto flex-col" |
| | | v-for="item in state.instructContentList" |
| | | :key="item.template_id" |
| | | > |
| | | <div class="w100 pb-[20px] flex overflow-auto flex-col" v-for="item in showInstructList" :key="item.template_id"> |
| | | <div class="bg-[#f5f7fd] p-[12px] transition-[background-color .2s] flex flex-col rounded-2xl"> |
| | | <div class="flex justify-between"> |
| | | <span class="set-title">{{ item.template_title }}</span> |
| | |
| | | Title: '发现探索', |
| | | }, |
| | | ], |
| | | |
| | | instructContentList: [], |
| | | |
| | | activeLabelName: 0, |
| | | activeInstructName: 0, |
| | | isShowExpand: false, |
| | | }); |
| | | const exampleList = ref([]); |
| | | const exampleList = ref([]); //模版列表 |
| | | const instructContentList = ref([]); //指令列表 |
| | | |
| | | onMounted(() => { |
| | | getSelectListSample(); |
| | | getUserTemplate(); |
| | |
| | | //获取用户模板 |
| | | const getUserTemplate = async () => { |
| | | const res = await getUserTemplateList(); |
| | | state.instructContentList = res.templates; |
| | | instructContentList.value = res.templates; |
| | | }; |
| | | //换一批 |
| | | const batchChange = () => { |
| | | const index = Math.floor(Math.random() * groupedArray.value.length); |
| | | state.exampleContent = groupedArray.value[index]; |
| | | // console.log(state.exampleContent, 341); |
| | | }; |
| | | //高级示例 |
| | | const advanceExampleClick = () => { |
| | |
| | | .toString(16) |
| | | .padEnd(6, '0')}`; |
| | | }; |
| | | //#region ====================== 搜索聊天室 ====================== |
| | | //#region ====================== 搜索模板/指令 ====================== |
| | | const queryParams = ref({ |
| | | searchInput: '', |
| | | instructInput: '', |
| | | sample_title: '', |
| | | }); |
| | | const { query, queryData } = useSearch(exampleList, queryParams); |
| | | |
| | | const debounceQuery = debounce(query); |
| | | |
| | | watch( |
| | | () => queryParams.value.searchInput, |
| | | () => queryParams.value.sample_title, |
| | | (val) => { |
| | | debounceQuery(); |
| | | } |
| | | ); |
| | | //指令 |
| | | const instructParams = ref({ |
| | | template_title: '', |
| | | }); |
| | | const { query: queryInstruct, queryData: showInstructList } = useSearch(instructContentList, instructParams); |
| | | |
| | | const instructQuery = debounce(queryInstruct); |
| | | |
| | | watch( |
| | | () => instructParams.value.template_title, |
| | | (val) => { |
| | | instructQuery(); |
| | | } |
| | | ); |
| | | //#endregion |
| | | </script> |
| | | <style scoped lang="scss"> |