Commit abd0a2ac30894b76b87cb741fe733f144722e6e6

Authored by 温伟
2 parents 336f5733 37972781

Merge branch 'fix/device-info/06-27' into 'main_dev'

fix: 修复设备编辑,设备信息里没有经纬度等信息,编辑处于加载状态

See merge request yunteng/thingskit-front!1393
@@ -401,16 +401,16 @@ @@ -401,16 +401,16 @@
401 // 父组件调用更新字段值的方法 401 // 父组件调用更新字段值的方法
402 function parentSetFieldsValue(data) { 402 function parentSetFieldsValue(data) {
403 const { deviceInfo = {} } = data; 403 const { deviceInfo = {} } = data;
404 - positionState.longitude = deviceInfo.longitude;  
405 - positionState.latitude = deviceInfo.latitude;  
406 - positionState.address = deviceInfo.address; 404 + positionState.longitude = deviceInfo?.longitude;
  405 + positionState.latitude = deviceInfo?.latitude;
  406 + positionState.address = deviceInfo?.address;
407 devicePositionState.value = { ...toRaw(positionState) }; 407 devicePositionState.value = { ...toRaw(positionState) };
408 - devicePic.value = deviceInfo.avatar; 408 + devicePic.value = deviceInfo?.avatar;
409 409
410 - if (deviceInfo.avatar) { 410 + if (deviceInfo?.avatar) {
411 setFieldsValue({ 411 setFieldsValue({
412 isUpdate: unref(isUpdate1), 412 isUpdate: unref(isUpdate1),
413 - icon: [{ uid: buildUUID(), name: 'name', url: deviceInfo.avatar } as FileItem], 413 + icon: [{ uid: buildUUID(), name: 'name', url: deviceInfo?.avatar } as FileItem],
414 }); 414 });
415 } 415 }
416 setFieldsValue({ 416 setFieldsValue({