Commit caf9ed3e74c16783377c4dfea4c8563414e89df8

Authored by ww
1 parent ba503b7b

perf: 告警记录列表状态确认字段变更

... ... @@ -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,
... ...