Jelajahi Sumber

fix: 修复快速操作按钮交互逻辑并补全页面跳转延迟处理

1. 为sendQuickAction函数新增type参数,点击快速操作时清空快捷操作列表
2. 在保存和保留工具的逻辑中添加100ms延迟后切换幻灯片与更新子页面状态
lsc 6 hari lalu
induk
melakukan
c52bd92814

+ 8 - 5
src/components/CollapsibleToolbar/componets/aiChat.vue

@@ -30,7 +30,7 @@
           </div>
           <div class="coco-quick-list">
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'page'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction3)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction3, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickGenChoicesTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickGenChoicesDesc }}</span>
@@ -45,7 +45,7 @@
             </button>
 
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'page'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction4)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction4, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickGenWebTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickGenWebDesc }}</span>
@@ -59,7 +59,7 @@
               </span>
             </button>
             <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'"
-              @click="sendQuickAction(lang.ssAiChatQuickAction5)">
+              @click="sendQuickAction(lang.ssAiChatQuickAction5, 1)">
               <span class="coco-quick-action-copy">
                 <span class="coco-quick-action-title">{{ lang.ssAiChatQuickRecommendToolsTitle }}</span>
                 <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickRecommendToolsDesc }}</span>
@@ -72,7 +72,7 @@
                 </svg>
               </span>
             </button>
-            <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'" @click="sendQuickAction(lang.ssBatchInteractiveWeb)">
+            <button type="button" class="coco-quick-action" v-if="cocoQuickTab === 'course'" @click="sendQuickAction(lang.ssBatchInteractiveWeb, 1)">
                 <span class="coco-quick-action-copy">
                     <span class="coco-quick-action-title">{{ lang.ssAiChatQuickBatchGenToolsTitle }}</span>
                     <span class="coco-quick-action-desc">{{ lang.ssAiChatQuickBatchGenToolsDesc }}</span>
@@ -434,8 +434,11 @@ const prevChatResult = () => {
   })
 }
 
-const sendQuickAction = (action: string) => {
+const sendQuickAction = (action: string, type: number = 2) => {
   inputText.value = action
+  if (type === 1) {
+    isQuickActions.value = []
+  }
   // sendMessage()
 }
 

+ 8 - 0
src/views/Editor/Canvas/ChildPageDisplay.vue

@@ -242,6 +242,10 @@ const saveTool = (url: string, type: any, index: number) => {
   changeSlideIndex(childPageIndex.value)
   toolsArray[index].isSet = true
   setTool()
+  setTimeout(() => {
+    changeSlideIndex(childPageIndex.value + 1)
+    setChildPageState(false, [], slideIndex.value || 0)
+  }, 100)
   console.log('保留工具', toolsArray)
 }
 
@@ -263,6 +267,10 @@ const keepAllTools = () => {
   })
   changeSlideIndex(childPageIndex.value)
   setTool()
+  setTimeout(() => {
+    changeSlideIndex(childPageIndex.value + 1)
+    setChildPageState(false, [], slideIndex.value || 0)
+  }, 100)
 }
 
 // 判断工具type