Showing
2 changed files
with
2 additions
and
36 deletions
... | ... | @@ -179,29 +179,12 @@ |
179 | 179 | }); |
180 | 180 | return [...acc]; |
181 | 181 | }, []); |
182 | - let tempList: Recordable[] = []; | |
183 | - const objectFormat = dataFormats.reduce((acc: Recordable, curr: Recordable) => { | |
184 | - const keys = Object.keys(curr); | |
185 | - const values = Object.values(curr); | |
186 | - tempList.push(...values); | |
187 | - acc = { | |
188 | - [keys[0]]: tempList.reduce((acc: Recordable, curr: Recordable) => { | |
189 | - return { | |
190 | - ...acc, | |
191 | - ...curr, | |
192 | - }; | |
193 | - }, {}), | |
194 | - }; | |
195 | - return { | |
196 | - ...acc, | |
197 | - }; | |
198 | - }, {}); | |
199 | 182 | Modal.info({ |
200 | 183 | title: '告警详情', |
201 | 184 | width: 600, |
202 | 185 | centered: true, |
203 | 186 | maskClosable: true, |
204 | - content: h(JsonPreview, { data: JSON.parse(JSON.stringify(objectFormat)) }), | |
187 | + content: h(JsonPreview, { data: JSON.parse(JSON.stringify(dataFormats)), deep: 4 }), | |
205 | 188 | }); |
206 | 189 | }; |
207 | 190 | const handleAlarmDetailFormat = async (keys: string[]) => { | ... | ... |
... | ... | @@ -139,29 +139,12 @@ |
139 | 139 | }); |
140 | 140 | return [...acc]; |
141 | 141 | }, []); |
142 | - let tempList: Recordable[] = []; | |
143 | - const objectFormat = dataFormats.reduce((acc: Recordable, curr: Recordable) => { | |
144 | - const keys = Object.keys(curr); | |
145 | - const values = Object.values(curr); | |
146 | - tempList.push(...values); | |
147 | - acc = { | |
148 | - [keys[0]]: tempList.reduce((acc: Recordable, curr: Recordable) => { | |
149 | - return { | |
150 | - ...acc, | |
151 | - ...curr, | |
152 | - }; | |
153 | - }, {}), | |
154 | - }; | |
155 | - return { | |
156 | - ...acc, | |
157 | - }; | |
158 | - }, {}); | |
159 | 142 | Modal.info({ |
160 | 143 | title: '告警详情', |
161 | 144 | width: 600, |
162 | 145 | centered: true, |
163 | 146 | maskClosable: true, |
164 | - content: h(JsonPreview, { data: JSON.parse(JSON.stringify(objectFormat)) }), | |
147 | + content: h(JsonPreview, { data: JSON.parse(JSON.stringify(dataFormats)), deep: 4 }), | |
165 | 148 | }); |
166 | 149 | }; |
167 | 150 | const handleAlarmDetailFormat = async (keys: string[]) => { | ... | ... |