Commit Graph

523 Commits

Author SHA1 Message Date
wren 99fce169cb fix: normalize review detail manual notes 2026-05-06 10:06:50 +08:00
wren c3ef4dcefc fix: restore reviewsTest detail rendering 2026-05-06 10:01:21 +08:00
wren b36e102aa0 docs: refresh frontend integration notes 2026-05-06 09:42:29 +08:00
wren c54f84382b feat: align frontend document and rule management flows 2026-05-06 09:40:37 +08:00
wren 8a5044b024 fix: remove document review status postgrest fallback 2026-05-06 09:37:02 +08:00
wren 37e1611ed4 fix: cut reviewsTest over to new review detail apis 2026-05-06 09:19:03 +08:00
jandejang 9e0909ab35 完善规则配置页交互细节 2026-04-30 17:59:43 +08:00
wren 2eb40e8af6 feat: show usable rule counts 2026-04-30 17:59:35 +08:00
wren 3fb7e9f5d0 feat: stabilize document type and upload flows 2026-04-30 17:44:05 +08:00
wren 81c5e98b53 refactor: rewrite document-type management for new backend API
- API client: switch from /api/v3/document-types to /api/document-types,
  replace group_ids with ruleSetIds, add getEntryModules/getRuleSets
- List page: simplified to code/name/entry_module/rule_sets/status columns
- New/Edit page: code + name + description + entry_module dropdown +
  rule_set multi-select checklist
- Fix DocumentType type import collision in documents.ts
2026-04-30 13:18:24 +08:00
wren 477bcafeb7 feat: extend DocumentType interface with code, entryModuleId, isEnabled, ruleSetIds 2026-04-30 12:52:26 +08:00
wren dd249ccfb7 refactor: replace PostgREST calls in upload page with new API endpoints
- getDocumentTypes: switch from PostgREST /document_types to
  GET /api/document-types
- getTodayDocuments: switch from PostgREST /documents to
  GET /api/documents/list with userId + dateFrom params
- getQueueStatus: gracefully handle 404 (endpoint not yet migrated)
  by returning empty queue state instead of erroring
2026-04-30 12:27:51 +08:00
wren 73fd8617e1 refactor: switch upload to new POST /api/upload with flat FormData
Replace the old nested upload_info JSON approach with flat
multipart fields (typeId, region, fileRole, createdBy, autoRun,
speed) matching the new leaudit-platform backend.

- uploadDocumentToServer: POST ${API_BASE_URL}/api/upload
- handleFileUpload: pass region from userInfo.area, derive speed
  from priority enum, pass createdBy from JWT user_id
- UploadResult replaces FileUploadResponse with documentId/fileId
  replacing the old nested result.id/result.file_name pattern
2026-04-30 12:16:24 +08:00
wren 185f55cec6 fix: pass through server 403 message instead of hardcoded '无权限'
The axios response interceptor was discarding the server's
permission-denied message (e.g. "缺少「用户列表」权限") and
replacing it with a generic "无权限". Now it reads the server
response body and surfaces the exact permission that's missing.
2026-04-30 11:47:32 +08:00
wren e2ae791fa2 fix: allow admin role to edit in role-permissions page
Previously only provincial_admin could edit roles/permissions in
the UI. Now admin (city-level admin) role can also edit. The
backend already enforces fine-grained permission checks, so the
UI gate just needs to match can_manage semantics.
2026-04-30 11:36:11 +08:00
wren 55e2c6993f fix: tighten entry module rbac flows 2026-04-29 22:25:06 +08:00
wren b544b1a795 fix: support local entry module icons 2026-04-29 19:50:10 +08:00
wren 55e65e00f5 fix: allow entry module editor route 2026-04-29 19:37:42 +08:00
wren b31707661b fix: sync frontend token from server session 2026-04-29 18:52:58 +08:00
wren 790b9566e1 feat: restore settings routes for admin modules 2026-04-29 18:39:45 +08:00
wren 1b67358e5b fix: hide unsupported menus in minimal scope 2026-04-29 18:14:04 +08:00
wren 3d3d8d6e6b fix: align login and home routing with leaudit backend 2026-04-29 18:02:31 +08:00
wren 7dbeaac5f8 fix: bootstrap session after password login 2026-04-29 15:58:59 +08:00
wren 0369de68cc fix: complete admin login redirect flow 2026-04-29 15:53:10 +08:00
wren de3edd4049 chore: point frontend api config to 172.15.0.59 2026-04-29 12:37:28 +08:00
wren 23ab13dd1e feat: hook document list to leaudit list api 2026-04-29 12:20:16 +08:00
wren c10b70b286 chore: point dev api config to local leaudit platform 2026-04-29 12:01:16 +08:00
jandejang 84d2e0a1a5 对齐规则列表页交互样式 2026-04-29 11:22:20 +08:00
jandejang dce5ac0c9a 保存规则库 YAML 维护改造进展 2026-04-28 22:00:00 +08:00
LiangShiyong 7b86293263 Merge branch 'PingChuan' into shiy-login 2026-04-21 15:09:44 +08:00
LiangShiyong a3fd2c7fed feat: 初步完成评查详情页面的work文档和pdf文档的加载的页面三栏设计的重构。 2026-04-21 15:08:14 +08:00
PingChuan 5ea7e2f44e Merge branch 'shiy-login' into PingChuan 2026-04-20 17:56:52 +08:00
PingChuan 5aa040c94e feat:自建 RAG 聊天应用,限制知识库文档格式,只允许上传(".pdf", ".docx", ".md", ".txt") 2026-04-20 17:55:49 +08:00
LiangShiyong 4e19672b38 添加pdf的略缩图组件的实现。 2026-04-17 19:01:52 +08:00
LiangShiyong dd94e97f3c Merge branch 'PingChuan' into shiy-login 2026-04-14 09:47:24 +08:00
LiangShiyong cdf1d4f096 fix: 修复首页交叉评查和知识库入口的渲染逻辑。 2026-04-14 09:45:12 +08:00
LiangShiyong 6aaced82da Merge branch 'Wren-dev' into shiy-login 2026-04-10 16:46:32 +08:00
PingChuan 5bee9288b9 feat:替换 Dify 为自建 RAG去实现
1、修复了若干无权限时的失败提示语
2、新增了一个生成后续建议问题的功能
3、重构了知识问答部分的权限管理模块
4、修复了若干渲染不恰当的样式渲染
2026-04-10 16:20:32 +08:00
TanWenyan f525707358 feat(rules): VLM 字段补齐多实体逐字段开关,对齐 LLM 字段行为
- 多实体总开关开启后,VLM 字段可点击单独切换 multi_entity(绿色=已开启)
- 新增 VLM 字段时默认写入 multi_entity: false
- 删除按钮 stopPropagation 避免触发多实体切换

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 15:12:17 +08:00
TanWenyan cd852ee721 fix(frontend): guard response.error.includes against non-string error values
If the API returns a non-string error (e.g. numeric HTTP status code),
calling .includes() directly on it throws "N.includes is not a function".
Convert to string via JSON.stringify first.

Fixes save button crash on rules/new page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:32:21 +08:00
TanWenyan aec34d139a fix(frontend): comprehensive defensive guards in ReviewSettings
Multiple locations in ReviewSettings.tsx call .includes() or .filter()
on variables that could theoretically be non-arrays:

1. availableFields.filter/.includes - added safeAvailableFields guard
2. newFields.map field.includes('_') - added typeof===string guard + filter
3. (prior fix) cfgAvailableFields includes/every in renderRuleConfig
4. (prior fix) selectedFields includes in renderFieldTags

These prevent TypeError crashes when config objects contain unexpected
types (e.g. {} instead of []) from stale API data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:29:21 +08:00
TanWenyan 804e24eff9 fix(frontend): guard availableFields.includes in renderRuleConfig
config.availableFields may be undefined or a non-array value (e.g. {}),
causing TypeError when calling .includes/.every directly on it.
Precompute cfgAvailableFields with Array.isArray guard before use.

Fixes: N.includes is not a function on rules/new page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:04:10 +08:00
TanWenyan a8949d9abf fix(frontend): guard against non-array selectedFields in renderFieldTags
When config.fields is a non-array value (e.g. empty object {}),
the fallback logic could still result in a non-array if both
config.fields and config.selectedFields are abnormal values.
Added double-guard: after the fallback chain, explicitly assert
Array.isArray before using selectedFields.includes().

Fixes: TypeError: _.includes is not a function on rules/new page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 16:59:24 +08:00
TanWenyan 64893e7dad fix: processFieldName handles object fields ({name, multi_entity}) format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:11:04 +08:00
TanWenyan d226ada0fe fix(ui): use inline style for multi-entity green background to override ant-btn
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:25:03 +08:00
TanWenyan 623cf8c427 fix(ui): match extraction field chips with review settings style, green only for multi-entity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:20:32 +08:00
TanWenyan 9d6a5364bb fix(ui): use inline tailwind for field chips instead of scoped CSS class
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:16:59 +08:00
TanWenyan 95351893c6 fix(ui): compact multi-entity field chips to match tag-button size
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:04:21 +08:00
TanWenyan bc3e26c93e feat(frontend): field-level multi_entity toggle in extraction settings
- evaluation_points.ts: LLMFieldConfig type, LLMFieldType union,
  VLMField.multi_entity
- ExtractionSettings.tsx:
  - LLM fields render as colored buttons (green=multi_entity, gray=normal)
  - Click to toggle individual field multi_entity when switch is on
  - Toggle switch on: converts all string fields to {name, multi_entity:true}
  - Toggle switch off: converts back to plain strings
  - New fields default to multi_entity:true when switch is on

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:34:45 +08:00
TanWenyan 5d3cb2ba34 fix: unwrap PostgREST proxy response format for pointCode 2026-03-23 20:56:27 +08:00