feat: 对话过程中不允许点击versionTree

This commit is contained in:
2026-04-22 09:43:24 +08:00
parent 8cc83ae12b
commit fae2e21ca6
2 changed files with 18 additions and 5 deletions

View File

@@ -187,7 +187,7 @@
isPaused.value = false
isGenerating.value = true
params.message = message.text
if (message.hasOwnProperty('useReport')) {
if (Object.prototype.hasOwnProperty.call(message, 'useReport')) {
params.useReport = message.useReport
}
@@ -589,7 +589,7 @@
thinkingText: combinedThinkingText,
text: combinedContent,
image_url: combinedImageUrl,
webAddress: !!webAddress ? JSON.parse(webAddress) : null,
webAddress: webAddress ? JSON.parse(webAddress) : null,
isUser: false,
id: result.length + 1,
sessionId: sessionId
@@ -688,7 +688,8 @@
}
defineExpose({
setChatInfo
setChatInfo,
isGenerating
})
</script>

View File

@@ -1,7 +1,9 @@
<template>
<div class="agent-wrapper flex space-between">
<div class="openVersionTree">
<div class="btn" @click="versionTreeData.drawer = true">Version Tree</div>
<div class="btn" :class="{ 'is-disabled': isAgentGenerating }" @click="handleOpenVersionTree">
Version Tree
</div>
</div>
<div class="content-wrapper">
<KeepAlive :max="10">
@@ -55,6 +57,7 @@
const VersionTreeIndexRef = ref()
const agentRef = ref()
const sketchList = ref([])
const isAgentGenerating = computed(() => Boolean(agentRef.value?.isGenerating))
const updateSketchList = (newVal) => {
sketchList.value = newVal
// VersionTreeIndexRef.value.getVersionTree()
@@ -63,7 +66,7 @@
const handleDeleteSketch = (id) => {
sketchList.value = sketchList.value
.map((sketchItem) => {
if (sketchItem.hasOwnProperty(id)) {
if (Object.prototype.hasOwnProperty.call(sketchItem, id)) {
delete sketchItem[id]
}
return sketchItem
@@ -79,6 +82,11 @@
drawer: false
})
const handleOpenVersionTree = () => {
if (isAgentGenerating.value) return
versionTreeData.value.drawer = true
}
const handleRestore = () => {
// agentRef.value?.inputRef?.addReportTag('Restore')
clearNodeChat({ projectId: projectStore.state.id, id: projectStore.state.nodeId }).then(
@@ -203,6 +211,10 @@ const handleGetProjectInfoAndHistory = () => {
border-radius: 2.5rem;
z-index: -1;
}
&.is-disabled {
cursor: not-allowed;
opacity: 0.6;
}
}
}