fix(mobile): preserve assistant IDs and scope state

This commit is contained in:
2026-07-12 12:15:02 +08:00
parent 36b7bf28bf
commit 0d64cf0f21
8 changed files with 91 additions and 39 deletions
@@ -41,6 +41,7 @@ import { computed, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import type { PersonalItem, PersonalItemSourceType, PersonalItemStatus, PersonalSpace } from '@/types/api';
import { loadPersonalItems, loadPersonalSpace, mergePersonalRows } from '@/services/personal-assistant';
import { personalItemRoute } from '@/services/personal-assistant-id';
const pageNum = ref(1);
const pageSize = 10;
@@ -92,7 +93,7 @@ const changeStatus = (event: { detail: { value: string | number } }) => { status
const sourceText = (value: PersonalItemSourceType) => ({ TEXT: '文字', FILE: '文件', URL: '外部网页' })[value];
const statusText = (value: PersonalItemStatus) => ({ QUEUED: '等待处理', PARSING: '解析中', READY: '可检索', FAILED: '解析失败', DELETING: '删除中', DELETED: '已删除' })[value];
const formatBytes = (bytes: number) => bytes >= 1048576 ? `${(bytes / 1048576).toFixed(1)}MB` : `${Math.ceil(bytes / 1024)}KB`;
const openItem = (id: number) => uni.navigateTo({ url: `/pages/user/assistant/item?id=${id}` });
const openItem = (id: string) => uni.navigateTo({ url: personalItemRoute(id) });
const openCapture = () => uni.navigateTo({ url: '/pages/user/assistant/capture' });
const goBack = () => uni.navigateBack();
onShow(refresh);