yangyin
2024-10-31 5f5609326cb7d69c6cf89e42fd0e654fa416d8b6
修改手机号码登录页面
已修改2个文件
已添加1个文件
184 ■■■■■ 文件已修改
src/components/chat/components/playBar/PlayBar.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/components/playBar/phrase/CommonPhrases.vue 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/component/sidebar/components/MenuList.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | 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);