fix: 会议看板参与人/巡检人/班次下拉兼容历史数据
- 会议看板 participants 兼容普通字符串,避免 JSON.parse 抛错导致整页空白
- 设备巡检记录 inspector 统一按字符串拆分成人员标签,与定时任务的数组返回兼容
- 班次下拉把 sys_dept_id 为空或 0 的班次视为全局可用
Co-Authored-By: Claude Code <noreply@anthropic.com>
| | |
| | | let [resp1,resp2] = await Promise.all([getMeetSummary(),getMeetSummaryItems()]) |
| | | stats.value = resp1.data |
| | | meetings.value = resp2.data.map(item => { |
| | | // 旧数据的 participants 可能是“生产部、质检部”这种普通字符串, |
| | | // 直接 JSON.parse 会抛错导致整张看板空白,这里做兜底。 |
| | | let participants = [] |
| | | try { |
| | | const parsed = JSON.parse(item.participants) |
| | | participants = Array.isArray(parsed) ? parsed : [parsed] |
| | | } catch { |
| | | participants = String(item.participants || "") |
| | | .split(/[、,,]/) |
| | | .map(name => name.trim()) |
| | | .filter(Boolean) |
| | | } |
| | | return { |
| | | ...item, |
| | | participants: JSON.parse(item.participants) |
| | | participants |
| | | } |
| | | }) |
| | | console.log('会议看板页面加载完成') |
| | |
| | | <div class="person-tags"> |
| | | <!-- 调试信息,上线时删除 --> |
| | | <!-- {{ console.log('inspector data:', row.inspector) }} --> |
| | | <template v-if="row.inspector && row.inspector.length > 0"> |
| | | <el-tag v-for="(person, index) in row.inspector" |
| | | <template v-if="rowInspectorList(row).length > 0"> |
| | | <el-tag v-for="(person, index) in rowInspectorList(row)" |
| | | :key="index" |
| | | size="small" |
| | | type="primary" |
| | |
| | | return operationConfig; |
| | | }; |
| | | |
| | | // 巡检人:定时任务接口返回数组,巡检记录接口返回逗号分隔字符串,统一成数组展示 |
| | | const rowInspectorList = row => { |
| | | const value = row?.inspector; |
| | | if (Array.isArray(value)) return value.filter(Boolean); |
| | | return String(value || "") |
| | | .split(",") |
| | | .map(item => item.trim()) |
| | | .filter(Boolean); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | radioChange("taskManage"); |
| | | }); |
| | |
| | | return (classType.value || []).filter(item => { |
| | | if (["998", "999"].includes(String(item?.id))) return true; |
| | | const itemDeptId = item.deptId ?? item.sysDeptId ?? item.dept_id; |
| | | // 不限部门的班次(sys_dept_id 为空或 0)对所有部门都可用 |
| | | if (!itemDeptId || String(itemDeptId) === "0") return true; |
| | | return String(itemDeptId) === String(schedulingQuery.deptId); |
| | | }); |
| | | }); |