Commit Graph

26 Commits

Author SHA1 Message Date
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
LiangShiyong 0660f206f4 优化起草合同的样式,隐藏评查点设置的自定义代码 2025-12-08 21:40:12 +08:00
LiangShiyong d88cfc818b feat: 1. 实现一键替换。
2. 优化追加附件和模板上传的样式。
2025-12-03 12:07:56 +08:00
LiangShiyong 8fbf915656 添加新的骨架屏,将评查点列表和评查文件列表,文档列表进行数据分类 2025-06-04 17:31:10 +08:00
LiangShiyong cd8b167863 将内容替换隐藏 2025-06-04 11:45:33 +08:00
LiangShiyong b02978508d 删除所有console.log输出,优化评查结果的表格的显示,添加新的页码获取逻辑 2025-06-02 18:55:00 +08:00
LiangShiyong 6c40c4d074 修复文件上传可以传文档bug 2025-04-25 19:17:37 +08:00
LiangShiyong 5c2c367856 新增提示Toast组件 2025-04-21 09:22:13 +08:00
LiangShiyong 60680cd4bf 合并评查点新增代码 2025-04-13 15:09:01 +08:00
HuangZhiwen 0411599f18 完美版本 2025-04-10 10:34:28 +08:00
HuangZhiwen 8be2fd5d67 接近完美版本 2025-04-10 10:16:15 +08:00
HuangZhiwen e235532469 暂存2 2025-04-10 02:23:55 +08:00
HuangZhiwen f99a1f05d4 暂存 2025-04-10 02:06:56 +08:00
HuangZhiwen ebdf97aebf 基础组件完善 2025-04-09 01:34:14 +08:00
HuangZhiwen c3cdff2354 暂存 2025-04-08 16:52:16 +08:00
HuangZhiwen a5cad46a84 编辑情况优化-需要继续完善-暂存 2025-04-07 20:24:52 +08:00
HuangZhiwen 046dd109e0 分数,评查点分组数据对接上 2025-04-07 19:41:22 +08:00
HuangZhiwen 8885aec931 评查点,增改逻辑完善 2025-04-07 01:49:24 +08:00
HuangZhiwen d84df0e8a3 新增数据,编辑数据初步完善 2025-04-03 16:25:55 +08:00
HuangZhiwen a7626d2f90 修复好前段逻辑, 2025-04-02 18:13:12 +08:00
HuangZhiwen cbf5c967ff 评查点新增修改逻辑完善 2025-04-02 10:06:09 +08:00
HuangZhiwen 29699df14a 优化样式 2025-03-28 16:06:58 +08:00
HuangZhiwen aae2bc10b2 第一版完成 2025-03-28 15:15:05 +08:00
HuangZhiwen 0079786b25 暂存 2025-03-28 14:45:54 +08:00