Commit a89b11743f2ccc6016f3f072d5cac8eb15cbe4c4
1 parent
353f979f
fix: DEFECT-876 click row data not render device position
Showing
1 changed file
with
18 additions
and
5 deletions
1 | 1 | <template> |
2 | 2 | <div class="wrapper"> |
3 | - <div ref="wrapRef" :style="{ height, width }"> </div> | |
3 | + <Spin :spinning="spinning"> | |
4 | + <div ref="wrapRef" :style="{ height, width }"> </div> | |
5 | + </Spin> | |
4 | 6 | <div class="right-wrap !dark:bg-dark-900"> |
5 | 7 | <BasicTable |
6 | 8 | style="cursor: pointer" |
... | ... | @@ -91,6 +93,7 @@ |
91 | 93 | import { defaultSchemas } from './cpns/TimePeriodForm/config'; |
92 | 94 | import { QueryWay, SchemaFiled, AggregateDataEnum } from './cpns/TimePeriodForm/config'; |
93 | 95 | import { dateUtil } from '/@/utils/dateUtil'; |
96 | + import { Spin } from 'ant-design-vue'; | |
94 | 97 | |
95 | 98 | interface DeviceInfo { |
96 | 99 | alarmStatus: 0 | 1; |
... | ... | @@ -114,6 +117,7 @@ |
114 | 117 | DeviceDetailDrawer, |
115 | 118 | Loading, |
116 | 119 | TimePeriodForm, |
120 | + Spin, | |
117 | 121 | }, |
118 | 122 | props: { |
119 | 123 | width: { |
... | ... | @@ -155,14 +159,15 @@ |
155 | 159 | showSizeChanger: true, |
156 | 160 | }, |
157 | 161 | afterFetch: async (data: DeviceInfo[]) => { |
158 | - asyncFn(data); | |
162 | + createMarket(data); | |
159 | 163 | return data; |
160 | 164 | }, |
161 | 165 | }); |
162 | 166 | |
163 | - async function asyncFn(data: DeviceInfo[]) { | |
167 | + async function createMarket(data: DeviceInfo[]) { | |
164 | 168 | const BMap = (window as any).BMap; |
165 | - unref(BMapInstance)?.clearOverlays(); | |
169 | + if (!BMap) return; | |
170 | + unref(BMapInstance).clearOverlays(); | |
166 | 171 | const markerList: MarkerList[] = []; |
167 | 172 | data.forEach((item) => { |
168 | 173 | const { |
... | ... | @@ -222,6 +227,7 @@ |
222 | 227 | myCity.get(myFun); |
223 | 228 | } |
224 | 229 | |
230 | + const spinning = ref(false); | |
225 | 231 | const createDeviceInfoWindow = async (record: DeviceInfo) => { |
226 | 232 | const BMap = (window as any).BMap; |
227 | 233 | entityId = record.tbDeviceId; |
... | ... | @@ -288,7 +294,13 @@ |
288 | 294 | }; |
289 | 295 | // 点击表格某一行触发 |
290 | 296 | const deviceRowClick = async (record) => { |
291 | - createDeviceInfoWindow(record); | |
297 | + try { | |
298 | + spinning.value = true; | |
299 | + await createDeviceInfoWindow(record); | |
300 | + } catch (err) { | |
301 | + } finally { | |
302 | + spinning.value = false; | |
303 | + } | |
292 | 304 | }; |
293 | 305 | |
294 | 306 | // 设备信息 |
... | ... | @@ -452,6 +464,7 @@ |
452 | 464 | isNull, |
453 | 465 | registerDetailDrawer, |
454 | 466 | loading, |
467 | + spinning, | |
455 | 468 | timePeriodRegister, |
456 | 469 | handleCancelModal, |
457 | 470 | }; | ... | ... |