From 8a5fd737f22ff39f045340adc91971bcedd8901b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 16 五月 2026 16:11:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro

---
 src/views/aiIndustrialBrain/components/AiAssistantWorkspace.vue |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/views/aiIndustrialBrain/components/AiAssistantWorkspace.vue b/src/views/aiIndustrialBrain/components/AiAssistantWorkspace.vue
index 2f55511..1eb5e7b 100644
--- a/src/views/aiIndustrialBrain/components/AiAssistantWorkspace.vue
+++ b/src/views/aiIndustrialBrain/components/AiAssistantWorkspace.vue
@@ -17,7 +17,7 @@
             v-if="assistantMode !== 'pending'"
             :key="assistantMode"
             class="workspace-chat"
-            :assistants="assistantMode === 'purchase' ? [purchaseAssistant] : [generalAssistant]"
+            :assistants="resolvedAssistants"
             :default-assistant="assistantMode"
             :hide-trigger="true"
             :auto-open="true"
@@ -43,7 +43,7 @@
 import { computed } from "vue";
 import { ArrowLeftBold } from "@element-plus/icons-vue";
 import AIChatSidebar from "@/components/AIChatSidebar/index.vue";
-import { generalAssistant, purchaseAssistant } from "@/components/AIChatSidebar/assistants";
+import { assistantRegistry } from "@/components/AIChatSidebar/assistants";
 
 const props = defineProps({
   visible: {
@@ -60,11 +60,17 @@
 
 const agentKey = computed(() => String(props.agent?.key || ""));
 const agentTitle = computed(() => String(props.agent?.name || "AI鍔╂墜"));
+
+/**
+ * 缁存姢瑙勫垯锛�
+ * AI宸ヤ笟澶ц剳鏂板鏅鸿兘浣撴椂锛岃嫢甯屾湜鍙充晶寮圭獥鍙敤锛岄渶淇濊瘉鏅鸿兘浣� key 鍦� assistantRegistry 涓湁鍚屽悕閰嶇疆銆�
+ * 鏈厤缃椂浼氳繘鍏� pending锛堝紑鍙戜腑锛夋�侊紝浣滀负鏄惧紡鎻愰啋銆�
+ */
+const resolvedAssistant = computed(() => assistantRegistry[agentKey.value] || null);
 const assistantMode = computed(() => {
-  if (agentKey.value === "purchase") return "purchase";
-  if (agentKey.value === "general") return "general";
-  return "pending";
+  return resolvedAssistant.value ? agentKey.value : "pending";
 });
+const resolvedAssistants = computed(() => (resolvedAssistant.value ? [resolvedAssistant.value] : []));
 </script>
 
 <style scoped>

--
Gitblit v1.9.3