Browse Source

四步不换行问题和输入框高度问题

dev
no99 22 hours ago
parent
commit
fe9294aaa1
  1. 12
      src/views/AIchat.vue
  2. 28
      src/views/homePage.vue

12
src/views/AIchat.vue

@ -957,6 +957,7 @@ async function showThinkingProcess(stockName = null) {
flag: true, flag: true,
content: "夺宝奇兵大模型正在思考", content: "夺宝奇兵大模型正在思考",
gif: thinkingGif, gif: thinkingGif,
nowrap: true,
}); });
chatStore.messages.push(thinkingMessage1); chatStore.messages.push(thinkingMessage1);
await new Promise((resolve) => setTimeout(resolve, 1500)); await new Promise((resolve) => setTimeout(resolve, 1500));
@ -970,6 +971,7 @@ async function showThinkingProcess(stockName = null) {
flag: true, flag: true,
content: "正在解析关键数据", content: "正在解析关键数据",
gif: analyzeGif, gif: analyzeGif,
nowrap: true,
}); });
chatStore.messages.push(thinkingMessage2); chatStore.messages.push(thinkingMessage2);
@ -990,6 +992,7 @@ async function showThinkingProcess(stockName = null) {
flag: true, flag: true,
content: `正在生成${stockName}全景作战报告`, content: `正在生成${stockName}全景作战报告`,
gif: generateGif, gif: generateGif,
nowrap: true,
}); });
chatStore.messages.push(thinkingMessage3); chatStore.messages.push(thinkingMessage3);
await new Promise((resolve) => setTimeout(resolve, 1500)); await new Promise((resolve) => setTimeout(resolve, 1500));
@ -1001,6 +1004,7 @@ async function showThinkingProcess(stockName = null) {
class: "ing", class: "ing",
type: "ing", type: "ing",
content: "报告已生成!", content: "报告已生成!",
nowrap: true,
}); });
chatStore.messages.push(thinkingMessage4); chatStore.messages.push(thinkingMessage4);
await new Promise((resolve) => setTimeout(resolve, 1500)); await new Promise((resolve) => setTimeout(resolve, 1500));
@ -4506,7 +4510,7 @@ onUnmounted(() => {
alt="思考过程" alt="思考过程"
class="thinking-gif" class="thinking-gif"
/> />
<div class="ai-message-content">
<div class="ai-message-content" :class="{ fourStep: msg.nowrap }">
<div v-if="msg.flag"> <div v-if="msg.flag">
<span>{{ msg.content }}</span> <span>{{ msg.content }}</span>
<span class="loading-dots"> <span class="loading-dots">
@ -5071,7 +5075,7 @@ p {
align-items: center; align-items: center;
gap: 10px; gap: 10px;
margin-right: auto; margin-right: auto;
max-width: 80%;
/* max-width: 80%; */
} }
/* 思考过程动图样式 */ /* 思考过程动图样式 */
@ -5102,4 +5106,8 @@ p {
width: fit-content; width: fit-content;
overflow: visible; overflow: visible;
} }
.fourStep {
white-space: nowrap;
}
</style> </style>

28
src/views/homePage.vue

@ -553,6 +553,9 @@ const adjustFooterPosition = (height) => {
}, 200); }, 200);
}; };
//
const inputing = ref(false);
const onFocus = function () { const onFocus = function () {
const visualViewport = window.visualViewport; const visualViewport = window.visualViewport;
// //
@ -569,6 +572,7 @@ const onFocus = function () {
}; };
const onBlur = function () { const onBlur = function () {
inputing.value = false;
const visualViewport = window.visualViewport; const visualViewport = window.visualViewport;
setTimeout(() => { setTimeout(() => {
console.log("输入框失焦"); console.log("输入框失焦");
@ -896,13 +900,15 @@ onUnmounted(() => {
@focus="onFocus" @focus="onFocus"
@blur="onBlur" @blur="onBlur"
:autosize="{ minRows: 1, maxRows: 4 }" :autosize="{ minRows: 1, maxRows: 4 }"
placeholder="请输入股票名称或股票代码..."
class="msg-input" class="msg-input"
@keydown.enter.exact.prevent=" @keydown.enter.exact.prevent="
isLoading || isInputDisabled ? null : sendMessage() isLoading || isInputDisabled ? null : sendMessage()
" "
:disabled="isInputDisabled" :disabled="isInputDisabled"
resize="none" resize="none"
:class="{ input: !message && !inputing }"
@compositionstart="inputing = true"
@compositionend="inputing = false"
> >
</el-input> </el-input>
<img <img
@ -1520,12 +1526,6 @@ body {
padding-right: 45px !important; padding-right: 45px !important;
} }
.msg-input:deep(.el-textarea__inner::placeholder) {
white-space: nowrap !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
}
.msg-input { .msg-input {
min-height: 34px; min-height: 34px;
width: 100%; width: 100%;
@ -1545,6 +1545,20 @@ body {
outline: none; outline: none;
} }
.input::before {
content: "请输入股票名称或股票代码...";
position: absolute;
left: 11px;
top: 5px;
color: var(--el-text-color-secondary);
pointer-events: none;
white-space: nowrap ;
overflow-x: hidden ;
text-overflow: ellipsis ;
width: 80%;
z-index: 6;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.action-btn { .action-btn {
height: 21px; height: 21px;

Loading…
Cancel
Save