diff --git a/docs/个人AI助理阶段二开发推进计划.md b/docs/个人AI助理阶段二开发推进计划.md index b021db48..3c1a2619 100644 --- a/docs/个人AI助理阶段二开发推进计划.md +++ b/docs/个人AI助理阶段二开发推进计划.md @@ -1160,6 +1160,8 @@ Expected: smoke 输出 PASS;用户 A/B 无交叉可见;SSRF 拦截;所有 Expected: 浏览器控制台无业务错误;失败提示明确;不出现无引用答案。 +2026-07-12 验收记录:组织快照用户已在真实浏览器完成岗位确认、文字与公开网页收藏、READY 状态、日期范围筛选、PERSONAL/mixed 引用域和删除立即隐藏;企业单域已用同一登录态 API 验证,用户 B 隔离由真实双用户 smoke 验证。真实 PDF 已通过 multipart、私有 OSS、解析、检索、引用和跨存储清理 smoke,但 Codex 内置浏览器与 Chrome 控制通道均拒绝自动设置文件选择器,因此仍需人工在浏览器选择一次 PDF 后才能勾选本 Step。 + - [x] **Step 6: 提交** git add scripts/personal-assistant-smoke.sh scripts/demo-check.sh docs/API_INTEGRATION.md docs/DEV_SETUP.md docs/DEMO_ACCEPTANCE.md diff --git a/mobile-uni/src/pages/user/assistant/library.vue b/mobile-uni/src/pages/user/assistant/library.vue index e14ba1f5..84aa9c1a 100644 --- a/mobile-uni/src/pages/user/assistant/library.vue +++ b/mobile-uni/src/pages/user/assistant/library.vue @@ -18,6 +18,11 @@ {{ sourceLabel }} {{ statusLabel }} + + 起始:{{ dateFrom || '不限' }} + 结束:{{ dateTo || '不限' }} + + @@ -51,6 +56,8 @@ const space = ref(); const sourceType = ref(''); const status = ref(''); const keyword = ref(''); +const dateFrom = ref(''); +const dateTo = ref(''); const loading = ref(false); const message = ref(''); let requestGeneration = 0; @@ -66,7 +73,15 @@ const load = async (append = false, pageSnapshot = pageNum.value) => { message.value = ''; try { const [page, latestSpace] = await Promise.all([ - loadPersonalItems({ pageNum: pageNum.value, pageSize, sourceType: sourceType.value, status: status.value, keyword: keyword.value.trim() }), + loadPersonalItems({ + pageNum: pageNum.value, + pageSize, + sourceType: sourceType.value, + status: status.value, + keyword: keyword.value.trim(), + dateFrom: dateFrom.value, + dateTo: dateTo.value + }), loadPersonalSpace() ]); if (generation !== requestGeneration || pageSnapshot !== pageNum.value) return; @@ -81,7 +96,14 @@ const load = async (append = false, pageSnapshot = pageNum.value) => { if (generation === requestGeneration) loading.value = false; } }; -const refresh = () => { pageNum.value = 1; void load(); }; +const refresh = () => { + if (dateFrom.value && dateTo.value && dateFrom.value > dateTo.value) { + message.value = '起始日期不能晚于结束日期'; + return; + } + pageNum.value = 1; + void load(); +}; const loadMore = () => { if (loading.value) return; const nextPage = pageNum.value + 1; @@ -90,6 +112,9 @@ const loadMore = () => { }; const changeSource = (event: { detail: { value: string | number } }) => { sourceType.value = sourceOptions[Number(event.detail.value)]?.value || ''; refresh(); }; const changeStatus = (event: { detail: { value: string | number } }) => { status.value = statusOptions[Number(event.detail.value)]?.value || ''; refresh(); }; +const changeDateFrom = (event: { detail: { value: string } }) => { dateFrom.value = event.detail.value || ''; }; +const changeDateTo = (event: { detail: { value: string } }) => { dateTo.value = event.detail.value || ''; }; +const clearDates = () => { dateFrom.value = ''; dateTo.value = ''; refresh(); }; 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`; @@ -109,6 +134,7 @@ onShow(refresh); .filters { display: grid; gap: 10px; } .filter-row > * { flex: 1; min-width: 0; } .filter-select { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-size: 14px; } +.date-clear { justify-self: end; min-height: 32px; padding: 0 4px; background: transparent; color: var(--muted); font-size: 13px; } .item-list { display: grid; margin-top: 16px; gap: 10px; } .item-card { width: 100%; min-width: 0; padding: 15px; text-align: left; } .source-badge, .status-badge { padding: 3px 7px; border-radius: var(--radius); background: #eef3f9; color: var(--knowledge); font-size: 11px; } diff --git a/mobile-uni/tests/personal-assistant.test.mjs b/mobile-uni/tests/personal-assistant.test.mjs index 6c85f28b..da0b61ff 100644 --- a/mobile-uni/tests/personal-assistant.test.mjs +++ b/mobile-uni/tests/personal-assistant.test.mjs @@ -61,6 +61,11 @@ test('资料库和收藏页覆盖分页筛选以及三种真实收藏方式', as assert.match(library, /pageNum/); assert.match(library, /sourceType/); assert.match(library, /status/); + assert.match(library, /dateFrom/); + assert.match(library, /dateTo/); + assert.match(library, /mode="date"/); + assert.match(library, /dateFrom: dateFrom\.value/); + assert.match(library, /dateTo: dateTo\.value/); assert.match(library, /loadPersonalItems/); assert.match(library, /requestGeneration/); assert.match(library, /pageSnapshot/);