From d2efaa204e1217b90b5f99581e5a68802867f20e Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 28 十月 2024 13:42:48 +0800 Subject: [PATCH] group_type --- src/components/chat/components/playBar/PlayBar.vue | 92 +++++++++++++++++++++++++++++++++++----------- 1 files changed, 70 insertions(+), 22 deletions(-) diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue index 28f6947..9d22026 100644 --- a/src/components/chat/components/playBar/PlayBar.vue +++ b/src/components/chat/components/playBar/PlayBar.vue @@ -1,5 +1,35 @@ <template> - <div class="playInput hl_input"> + <div class="playInput hl_input rounded-b-[22px] input-border input-shadow" :class="{ 'rounded-t-[22px]': !currentGroupTypeIsShow }"> + <!-- 搴旂敤鍦烘櫙 --> + <div v-if="!currentGroupTypeIsShow" class="application-scenarios absolute bottom-[114%] left-4"> + <div class="flex-items-center space-x-2"> + <div + class="border border-gray-400 border-solid h-8 flex-items-center px-3 py-2 rounded-2xl cursor-pointer space-x-1 hover:bg-[#c5e0ff] hover:text-[#1c86ff]" + v-for="item in groupTypeList" + @click="groupTypeClick(item)" + > + <span :class="['ywifont', groupTypeMapIcon[item]]"></span> + <div class="">{{ item }}</div> + </div> + </div> + </div> + <!-- 褰撳墠搴旂敤鍦烘櫙 --> + <div + v-else + class="bg-[#f9fafb] rounded-t-[22px] absolute bottom-[100%] left-0 w-full input-border h-11 flex-items-center justify-between text-[14px]" + style="padding: 4px 4px 4px 18px; border-bottom: none" + > + <div class="flex-items-center"> + <span :class="[groupTypeMapIcon[activeGroupType]]" class="ywifont mr-2 !text-[14px]"></span> + <div>{{ activeGroupType }}</div> + </div> + <el-tooltip content="閫�鍑哄簲鐢ㄥ満鏅�" placement="top"> + <span + @click="closeCurrentGroupType" + class="ywifont ywicon-guanbi mr-3 rounded-sm p-1 hover:bg-[#eaebec] cursor-pointer" + ></span> + </el-tooltip> + </div> <div class="assembly flex"> <el-button title="鎻掍欢鑿滃崟" class="label flex items-center cursor-pointer" link> <img src="/static/images/wave/PlugIn.png" class="set-icon box-border" /> @@ -9,7 +39,6 @@ <div class="set-input"> <!-- @input="inputText" --> - <el-input ref="inputRef" class="relative align-bottom set-inputAnswer" @@ -41,11 +70,7 @@ <span class="text-sm text-gray-500 pr-1.5">{{ index + 1 }}</span> <template v-if="sentenceSplitMap?.[item.question]"> <template v-for="part in sentenceSplitMap[item.question]"> - <span - v-if="part.isKeyword" - class="text-blue-400 font-bold cursor-pointer" - >{{ part.partStr }}</span - > + <span v-if="part.isKeyword" class="text-blue-400 font-bold cursor-pointer">{{ part.partStr }}</span> <span v-else>{{ part.partStr }}</span> </template> </template> @@ -57,11 +82,11 @@ <div class="upload_img space-y"> <div class="imgbox cursor-pointer flex items-center"> <!-- <el-button title="AI鐪嬪浘" class="cursor-pointer" link style="margin-left: unset"> - <img src="/static/images/wave/LookImg.png" class="set-img-icon box-border" /> - </el-button> --> + <img src="/static/images/wave/LookImg.png" class="set-img-icon box-border" /> + </el-button> --> <!-- <el-button title="AI璇煶瀵硅瘽" class="cursor-pointer" link style="margin-left: unset" @click="audioChangeWord"> - <img src="/static/images/wave/HeadImg.png" class="set-img-icon box-border" /> - </el-button> --> + <img src="/static/images/wave/HeadImg.png" class="set-img-icon box-border" /> + </el-button> --> <el-button title="鍙戦��" :disabled="isTalking" class="cursor-pointer" link @click="emits('sendClick')"> <div class="send"> @@ -85,13 +110,14 @@ import type { InputInstance } from 'element-plus'; import { ElMessage } from 'element-plus'; import getCaretCoordinates from 'textarea-caret'; -import { computed, nextTick, ref } from 'vue'; +import { computed, nextTick, ref, triggerRef } from 'vue'; import InfoDetail from './InfoDetail.vue'; import VoicePage from './voicePage/VoicePage.vue'; import { getMetricsNames, querySimilarityHistory } from '/@/api/ai/chat'; import { onClickOutside } from '@vueuse/core'; import _ from 'lodash'; +import { activeGroupType, groupTypeList, groupTypeMapIcon } from '/@/stores/chatRoom'; const emits = defineEmits(['sendClick']); const props = defineProps(['isTalking', 'isHome']); const voicePageIsShow = defineModel('voicePageIsShow', { @@ -217,7 +243,7 @@ */ const getSentenceMatchMap = (sentences: string[], keywords: any[]) => { if (!sentences || sentences.length === 0) return null; - if (!keywords || keywords.length===0) { + if (!keywords || keywords.length === 0) { return sentences.map((item) => ({ partStr: item, startIndex: 0, @@ -375,6 +401,21 @@ infoDetailIsShow.value = true; }; //#endregion + +//#region ====================== 褰撳墠搴旂敤鍦烘櫙 ====================== +const currentGroupTypeIsShow = computed(() => !!activeGroupType.value); + +const groupTypeClick = (item) => { + activeGroupType.value = item; + + inputRef.value.focus(); +}; + +// 鍏抽棴褰撳墠 groupType 闈㈡澘 +const closeCurrentGroupType = () => { + activeGroupType.value = null; +}; +//#endregion </script> <style scoped lang="scss"> .set-waterTitle { @@ -426,6 +467,21 @@ border-color: #1c86ff; color: #fff; } + +.input-shadow { + -webkit-box-shadow: 0 0 0 1px transparent, 0 3px 16px 0 #dee0f3; + box-shadow: 0 0 0 1px transparent, 0 3px 16px 0 #dee0f3; +} + +.input-border { + border: 1px solid #00000030; + + -webkit-transition: border-color 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; + transition: border-color 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; + -o-transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; + transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; + transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; +} .playInput { align-items: flex-start; width: 760px; @@ -438,15 +494,7 @@ align-items: flex-end; -webkit-box-sizing: border-box; box-sizing: border-box; - border-radius: 22px; - border: 1px solid #00000030; - -webkit-box-shadow: 0 0 0 1px transparent, 0 3px 16px 0 #dee0f3; - box-shadow: 0 0 0 1px transparent, 0 3px 16px 0 #dee0f3; - -webkit-transition: border-color 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; - transition: border-color 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; - -o-transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; - transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; - transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out, -webkit-box-shadow 0.1s ease-in-out; + background-color: #fff; .assembly { position: relative; -- Gitblit v1.9.3