提交 6f13184d 编写于 作者: D DebugIsFalse

opt: 优化组件结构

上级 2bae02a5
......@@ -68,17 +68,6 @@ function handleCollapse (state) {
}
watch(() => props.collapse, () => {
openCollapse.value = props.collapse
})
watch(
() => props.item.ansLoading,
(value, oldValue) => {
if (oldValue === undefined && value) {
setTimeout(() => {
handleCollapse(false)
}, 500)
}
},
{ immediate: true }
)
}, { immediate: true})
defineExpose({ handleCollapse })
</script>
......@@ -141,13 +141,7 @@ const scrollToView = () => {
}
const handleReGenerate = () => {
const { question } = askingData.value
askingData.value = {
question,
desLoading: true
}
nextTick(() => {
askingData.value.collapse = true
})
askingData.value = { question, desLoading: true, collapse: true }
generateFetchData(`根据上述回答,对问题"${question}"重新生成`)
}
......@@ -161,10 +155,7 @@ const createGenerateInitItem = (question) => {
if (askingData.value.question) {
data.value.push(askingData.value)
}
askingData.value = { question, desLoading: true }
nextTick(() => {
askingData.value.collapse = true
})
askingData.value = { question, desLoading: true, collapse: true }
}
const handleContinueAsk = (question) => {
if (asking.value) return
......@@ -220,7 +211,7 @@ const handleFormFetchData = (fetchData) => {
handleStopGenerate()
}
if (meta.type === 'answer') {
Object.assign(askingData.value, { ansLoading: true, desLoading: false, searchLoading: false, article: message.choices[0].message.content })
Object.assign(askingData.value, { ansLoading: true, desLoading: false, searchLoading: false, article: message.choices[0].message.content, collapse: false })
return
}
if (meta.type !== 'log') return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册