|
@@ -122,6 +122,9 @@ const onSend = (text = '') => {
|
|
})
|
|
})
|
|
state.chats.push(answer)
|
|
state.chats.push(answer)
|
|
scrollToEnd()
|
|
scrollToEnd()
|
|
|
|
+ const floatingDiv = ref_auto.value
|
|
|
|
+ floatingDiv.style.visibility = 'hidden';
|
|
|
|
+ floatingDiv.style.display = 'flex';
|
|
ssePost(`/installed-apps/${window.czrConfig.dify.appId}/chat-messages`, {
|
|
ssePost(`/installed-apps/${window.czrConfig.dify.appId}/chat-messages`, {
|
|
body: state.params,
|
|
body: state.params,
|
|
}, {
|
|
}, {
|
|
@@ -269,7 +272,7 @@ const onNormal = (item) => {
|
|
}
|
|
}
|
|
const initTextHandle = () => {
|
|
const initTextHandle = () => {
|
|
let debounceTimer;
|
|
let debounceTimer;
|
|
- const DEBOUNCE_TIME = 300;
|
|
|
|
|
|
+ const DEBOUNCE_TIME = 500;
|
|
const textarea = ref_text.value
|
|
const textarea = ref_text.value
|
|
const floatingDiv = ref_auto.value
|
|
const floatingDiv = ref_auto.value
|
|
|
|
|
|
@@ -331,8 +334,10 @@ const initTextHandle = () => {
|
|
state.autoList = res?.data?.list.map(v => v.title) || []
|
|
state.autoList = res?.data?.list.map(v => v.title) || []
|
|
if (state.autoList.length > 0) {
|
|
if (state.autoList.length > 0) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- floatingDiv.style.top = (-floatingDiv.clientHeight - 2 - 20) + 'px';
|
|
|
|
- floatingDiv.style.visibility = 'visible';
|
|
|
|
|
|
+ if (state.text) {
|
|
|
|
+ floatingDiv.style.top = (-floatingDiv.clientHeight - 2 - 20) + 'px';
|
|
|
|
+ floatingDiv.style.visibility = 'visible';
|
|
|
|
+ }
|
|
}, 10)
|
|
}, 10)
|
|
}
|
|
}
|
|
})
|
|
})
|