From 220e4fab27b7f419b3e89e2f2d28ae789aac09d7 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期四, 08 十月 2026 16:29:55 +0800
Subject: [PATCH] 5种场景模式家长端ok
---
xiaozhi-esp32-server/main/manager-mobile/src/pages/agent/index.vue | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/xiaozhi-esp32-server/main/manager-mobile/src/pages/agent/index.vue b/xiaozhi-esp32-server/main/manager-mobile/src/pages/agent/index.vue
index 104aced..746cb7e 100644
--- a/xiaozhi-esp32-server/main/manager-mobile/src/pages/agent/index.vue
+++ b/xiaozhi-esp32-server/main/manager-mobile/src/pages/agent/index.vue
@@ -9,12 +9,13 @@
</route>
<script lang="ts" setup>
-import { onLoad } from '@dcloudio/uni-app'
-import { onMounted, ref } from 'vue'
+import { onLoad, onShow } from '@dcloudio/uni-app'
+import { onMounted, ref, watch } from 'vue'
import CustomTabs from '@/components/custom-tabs/index.vue'
import { t } from '@/i18n'
import ChatHistory from '@/pages/chat-history/index.vue'
import DeviceManagement from '@/pages/device/index.vue'
+import ParentTaskList from '@/pages/parent-task/index.vue'
import VoiceprintManagement from '@/pages/voiceprint/index.vue'
import AgentEdit from './edit.vue'
@@ -44,7 +45,7 @@
// #endif
// 鏅鸿兘浣揑D
-const currentAgentId = ref('default')
+const currentAgentId = ref('')
// 褰撳墠 tab
const currentTab = ref('agent-config')
@@ -57,6 +58,7 @@
const deviceRef = ref()
const chatRef = ref()
const voiceprintRef = ref()
+const parentTaskRef = ref()
// 鏇存柊鍒锋柊鍣ㄧ姸鎬�
function updateRefresherEnabled(value: boolean) {
@@ -88,6 +90,12 @@
value: 'voiceprint-management',
icon: '/static/tabbar/microphone.png',
activeIcon: '/static/tabbar/microphone_activate.png',
+ },
+ {
+ label: t('agent.parentTasks'),
+ value: 'parent-tasks',
+ icon: '/static/tabbar/system.png',
+ activeIcon: '/static/tabbar/system_activate.png',
},
]
@@ -127,6 +135,11 @@
await voiceprintRef.value.refresh()
}
break
+ case 'parent-tasks':
+ if (parentTaskRef.value?.refresh) {
+ await parentTaskRef.value.refresh()
+ }
+ break
}
}
catch (error) {
@@ -154,6 +167,12 @@
if (options?.agentId) {
currentAgentId.value = options.agentId
console.log('鎺ユ敹鍒版櫤鑳戒綋ID:', options.agentId)
+ }
+})
+
+onShow(() => {
+ if (currentTab.value === 'parent-tasks' && parentTaskRef.value?.refresh) {
+ parentTaskRef.value.refresh()
}
})
@@ -192,7 +211,7 @@
<!-- Tab 鍐呭 -->
<view class="flex-1">
<AgentEdit
- v-if="currentTab === 'agent-config'"
+ v-if="currentTab === 'agent-config' && currentAgentId"
:agent-id="currentAgentId"
/>
<DeviceManagement
@@ -211,6 +230,12 @@
:agent-id="currentAgentId"
@update-refresher-enabled="updateRefresherEnabled"
/>
+ <ParentTaskList
+ v-else-if="currentTab === 'parent-tasks'"
+ ref="parentTaskRef"
+ embedded
+ :agent-id="currentAgentId"
+ />
</view>
</scroll-view>
</view>
--
Gitblit v1.9.1