src/components/chat/components/playBar/PlayBar.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/components/chat/components/playBar/phrase/CommonPhrases.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/layout/component/sidebar/components/MenuList.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/components/chat/components/playBar/PlayBar.vue
@@ -1,5 +1,5 @@ <template> <div class="playInput hl_input rounded-[22px] input-border input-shadow" > <div class="playInput hl_input rounded-[22px] input-border input-shadow"> <!-- åºç¨åºæ¯ --> <div class="application-scenarios absolute bottom-[114%] left-4"> <div class="flex-items-center space-x-2"> @@ -31,7 +31,12 @@ </el-tooltip> </div> --> <div class="assembly flex"> <el-button title="æä»¶èå" class="label flex items-center cursor-pointer" link> <el-button title="è¾å ¥å¸¸ç¨è¯æ é¢ï¼å¯å¿«æ·è°ç¨å¸¸ç¨è¯" class="label flex items-center cursor-pointer" link @click="commonPhrasesClick" > <img src="/static/images/wave/PlugIn.png" class="set-icon box-border" /> </el-button> </div> @@ -103,24 +108,29 @@ @updateInputValue="updateInputValue" :isHome="isHome" /> <CommonPhrases v-model:isShow="isShowPhrase" v-show="isShowPhrase" :isHome="isHome"/> </div> </template> <script setup lang="ts"> import { onClickOutside } from '@vueuse/core'; import type { InputInstance } from 'element-plus'; import { ElMessage } from 'element-plus'; import _ from 'lodash'; import getCaretCoordinates from 'textarea-caret'; import { computed, nextTick, ref, triggerRef } from 'vue'; import { computed, nextTick, ref } from 'vue'; import InfoDetail from './InfoDetail.vue'; import CommonPhrases from './phrase/CommonPhrases.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', { type: Boolean, default: false, }); const isShowPhrase = defineModel('isShowPhrase', { type: Boolean, default: false, }); @@ -213,7 +223,7 @@ lastIsFinish = false; const res = await querySimilarityHistory({ question: text, group_type:activeGroupType.value group_type: activeGroupType.value, }); lastIsFinish = true; const handleValues = res?.values ?? []; @@ -417,6 +427,12 @@ activeGroupType.value = null; }; //#endregion //#region ====================== 常ç¨è¯åè½ ====================== const commonPhrasesClick = () => { isShowPhrase.value = true; }; //#endregion </script> <style scoped lang="scss"> .set-waterTitle { src/components/chat/components/playBar/phrase/CommonPhrases.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,138 @@ <template> <div class="container" :class="isHome ? 'top-[100%] mt-[8px]' : 'bottom-[100%] mb-[8px]'"> <div class="container_header"> <div class="title">常ç¨è¯</div> <span class="ywifont ywicon-guanbi text-[15px] cursor-pointer text-[#767a97]" @click="closeCommonPhrases"></span> </div> <div class="container_content"> <div class="set_phrases" :style="{ height: commonPhrases.length * 40 + 'px' }"> <div class="w-full h-full absolute top-0"> <div class="py-0 mt-0 box-border h-full"> <div style="overflow-anchor: none" v-for="(item, index) in commonPhrases" :key="index"> <div class="phase_item"> <div class="flex flex-col"> <div class="title"> {{ item.title }} </div> <div class="content"> {{ item.content }} </div> </div> </div> </div> </div> </div> </div> </div> <div class="container_add"> <span class="ywifont ywicon-jia text-[15px] cursor-pointer text-[#767a97]"></span> </div> </div> </template> <script setup lang="ts"> import { ref } from 'vue'; const commonPhrases = ref([ { id: 1, title: 'ä½ å¥½ï¼è¯·é®æä»ä¹å¯ä»¥å¸®å©æ¨ï¼', content: 'æ¨å¥½ï¼ææ³å¨è¯¢ä¸ä¸å ³äºæ¨ç订åã', }, { id: 2, title: 'æµè¯1?', content: 'ææ³å¨è¯¢ä¸ä¸å ³äºæ¨ç订åã', }, { id: 3, title: 'æµè¯2?', content: 'ææ³å¨è¯¢ä¸ä¸å ³äºæ¨ç订åã', }, ]); const props = defineProps(['isHome']); const closeCommonPhrases = () => {}; </script> <style scoped lang="scss"> .container { position: absolute; width: 100%; max-height: 45vh; padding: 0 8px 8px; left: 0px; border-radius: 12px; background-color: #ffffff; border: 1px solid #e5e5e5; box-shadow: 0px 8px 25px 0px #0000000d; display: flex; flex-direction: column; z-index: 100; &_header { width: 100%; display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 6px; color: #060607; .title { font-size: 14px; color: #060607; font-weight: 600; line-height: 20px; letter-spacing: 0.25px; flex-grow: 1; display: flex; } } &_content { width: 100%; max-height: 40vh; height: fit-content; .set_phrases { outline: none; overflow-y: auto; position: relative; transition: height 0.1s linear; .phase_item { display: flex; flex-direction: row; justify-content: space-between; align-items: center; cursor: pointer; padding: 6px 8px; flex-shrink: 0; background: #fff; border-radius: 8px; width: 100%; .title { font-size: 14px; color: #060607; font-family: PingFang HK; font-weight: 600; font-style: normal; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } .content { font-size: 12px; color: #5e6772; font-family: PingFang SC; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } } } } &_add { display: flex; flex-direction: row; align-items: center; cursor: pointer; padding: 6px 8px; background: #fff; border-radius: 8px; } } </style> src/layout/component/sidebar/components/MenuList.vue
@@ -75,9 +75,7 @@ <el-form-item prop="verifyCode" label="éªè¯ç "> <el-input v-model="state.loginPhoneForm.verifyCode" placeholder="请è¾å ¥åä½éªè¯ç " maxlength="6" clearable> <template #append> <el-button type="primary" @click="handleSendVerifyCode" :disabled="countdown > 0">{{ countdown > 0 ? `${countdown}ç§åéè¯` : 'è·åéªè¯ç ' }}</el-button> <el-button type="primary" @click="handleSendVerifyCode" :disabled="hasSended">{{ sendCodeMsg }}</el-button> </template> </el-input> </el-form-item> @@ -106,7 +104,7 @@ const formPhoneRef = ref(); //ææºå·ç»å½ const isLoginStatus = ref(!!Local.get(accessSessionKey)); const userName = ref(''); const countdown = ref(0); const countdown = ref(null); const firstUserCharacter = computed(() => userName.value?.[0]?.toUpperCase()); watchEffect(() => { if (!isLoginStatus.value) return; @@ -162,7 +160,7 @@ verifyCode: [{ required: true, message: '请è¾å ¥éªè¯ç ', trigger: 'blur' }], }; const handleClick = (item) => { if(!item.routerName) return; if (!item.routerName) return; gotoRoute({ name: item.routerName }); }; const LOGIN_CLIENT = 'Web端'; @@ -174,6 +172,12 @@ const handleClose = () => { state.isShowLogin = false; }; const hasSended = computed(() => { return countdown.value !== null; }); const sendCodeMsg = computed(() => { return !hasSended.value ? 'è·åéªè¯ç ' : `${countdown.value} ç§åéè¯`; }); //ç»å½ const onSubmit = async () => { if (state.activeLoginName === 'accountUser') { @@ -184,7 +188,6 @@ user: state.loginForm.account, pass: state.loginForm.pwd, client: LOGIN_CLIENT, }); if (!res.json_ok) { return ElMessage.error(res.json_msg); @@ -199,7 +202,6 @@ phone: state.loginPhoneForm.phoneUser, code: state.loginPhoneForm.verifyCode, client: LOGIN_CLIENT, }); if (!res.json_ok) { return ElMessage.error(res.json_msg);