Commit f2a9d8756c3d225c42444a7bb6a4b82fc2f3d39c
Merge branch 'perf/alarm-log-status' into 'v1.4.0_dev'
perf: 告警记录列表状态确认字段变更 See merge request yunteng/thingskit-front!1338
Showing
1 changed file
with
2 additions
and
10 deletions
... | ... | @@ -127,20 +127,12 @@ export const getAlarmSearchSchemas = (deviceAlaramDetailMode?: boolean): FormSch |
127 | 127 | ]; |
128 | 128 | }; |
129 | 129 | |
130 | -const handleAlarmStatus = (status: string) => { | |
131 | - return status.split('_').includes('ACTIVE'); | |
132 | -}; | |
133 | - | |
134 | -const handleAlarmAckStatus = (status: string) => { | |
135 | - return status.split('_').includes('ACK'); | |
136 | -}; | |
137 | - | |
138 | 130 | export const alarmColumns: BasicColumn[] = [ |
139 | 131 | { |
140 | 132 | title: '告警状态', |
141 | 133 | dataIndex: 'status', |
142 | 134 | customRender({ record }: { record }) { |
143 | - const flag = handleAlarmStatus(record.status); | |
135 | + const flag = !!record.cleared; | |
144 | 136 | return h(Tag, { color: flag ? 'red' : 'green' }, () => (flag ? '激活' : '清除')); |
145 | 137 | }, |
146 | 138 | width: 90, |
... | ... | @@ -175,7 +167,7 @@ export const alarmColumns: BasicColumn[] = [ |
175 | 167 | title: '确认状态', |
176 | 168 | dataIndex: 'ackStatus', |
177 | 169 | customRender({ record }: { record }) { |
178 | - const flag = handleAlarmAckStatus(record.status); | |
170 | + const flag = !!record.acknowledged; | |
179 | 171 | return h(Tag, { color: flag ? 'blue' : 'orange' }, () => (flag ? '已确认' : '未确认')); |
180 | 172 | }, |
181 | 173 | width: 110, | ... | ... |