mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: Fallback to fix issues
This commit is contained in:
parent
6d7b5eb219
commit
f6994e16b9
|
|
@ -653,23 +653,13 @@ function autoSendMessage() {
|
|||
audio_list: uploadAudioList.value,
|
||||
video_list: uploadVideoList.value
|
||||
})
|
||||
|
||||
if (
|
||||
props.sendMessage(inputValue.value, {
|
||||
image_list: uploadImageList.value,
|
||||
document_list: uploadDocumentList.value,
|
||||
audio_list: uploadAudioList.value,
|
||||
video_list: uploadVideoList.value
|
||||
}) !== undefined
|
||||
) {
|
||||
inputValue.value = ''
|
||||
uploadImageList.value = []
|
||||
uploadDocumentList.value = []
|
||||
uploadAudioList.value = []
|
||||
uploadVideoList.value = []
|
||||
if (quickInputRef.value) {
|
||||
quickInputRef.value.textareaStyle.height = '45px'
|
||||
}
|
||||
inputValue.value = ''
|
||||
uploadImageList.value = []
|
||||
uploadDocumentList.value = []
|
||||
uploadAudioList.value = []
|
||||
uploadVideoList.value = []
|
||||
if (quickInputRef.value) {
|
||||
quickInputRef.value.textareaStyle.height = '45px'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -357,8 +357,10 @@ const decodeQuery = (query: string) => {
|
|||
}
|
||||
}
|
||||
const confirmHandle = () => {
|
||||
localStorage.setItem(`${accessToken}userForm`, JSON.stringify(form_data_context.value))
|
||||
emit('confirm')
|
||||
if (checkInputParam()) {
|
||||
localStorage.setItem(`${accessToken}userForm`, JSON.stringify(form_data_context.value))
|
||||
emit('confirm')
|
||||
}
|
||||
}
|
||||
const cancelHandle = () => {
|
||||
emit('cancel')
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
:class="type"
|
||||
:style="{ height: firsUserInput ? '100%' : undefined }"
|
||||
>
|
||||
<div v-if="showUserInputContent" :class="firsUserInput ? 'firstUserInput' : 'popperUserInput'">
|
||||
<div v-show="showUserInputContent" :class="firsUserInput ? 'firstUserInput' : 'popperUserInput'">
|
||||
<UserForm
|
||||
v-model:api_form_data="api_form_data"
|
||||
v-model:form_data="form_data"
|
||||
|
|
@ -193,23 +193,21 @@ watch(
|
|||
|
||||
const toggleUserInput = () => {
|
||||
showUserInput.value = !showUserInput.value
|
||||
if (showUserInput.value) {
|
||||
// 保存当前数据作为初始数据(用于可能的恢复)
|
||||
initialFormData.value = JSON.parse(JSON.stringify(form_data.value))
|
||||
initialApiFormData.value = JSON.parse(JSON.stringify(api_form_data.value))
|
||||
}
|
||||
// if (showUserInput.value) {
|
||||
// // 保存当前数据作为初始数据(用于可能的恢复)
|
||||
// initialFormData.value = JSON.parse(JSON.stringify(form_data.value))
|
||||
// initialApiFormData.value = JSON.parse(JSON.stringify(api_form_data.value))
|
||||
// }
|
||||
}
|
||||
|
||||
function UserFormConfirm() {
|
||||
if (userFormRef.value?.checkInputParam()) {
|
||||
firsUserInput.value = false
|
||||
showUserInput.value = false
|
||||
}
|
||||
firsUserInput.value = false
|
||||
showUserInput.value = false
|
||||
}
|
||||
function UserFormCancel() {
|
||||
// 恢复初始数据
|
||||
form_data.value = JSON.parse(JSON.stringify(initialFormData.value))
|
||||
api_form_data.value = JSON.parse(JSON.stringify(initialApiFormData.value))
|
||||
// // 恢复初始数据
|
||||
// form_data.value = JSON.parse(JSON.stringify(initialFormData.value))
|
||||
// api_form_data.value = JSON.parse(JSON.stringify(initialApiFormData.value))
|
||||
showUserInput.value = false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue