|
|
@@ -12,10 +12,10 @@
|
|
|
<div class="p-20px">
|
|
|
<BasicForm @register="registerForm">
|
|
|
<template #isShow="{ model, field }">
|
|
|
- disabled-test: {{ !currentLatLng && (!currentLatLng.lat || !currentLatLng.lon) }}
|
|
|
+ <!-- disabled: {{ (!currentLatLng.lat && !currentLatLng.lng) || !model['gpsNum'] }} -->
|
|
|
<Switch
|
|
|
:checked="model[field]"
|
|
|
- :disabled="!currentLatLng && (!currentLatLng.lat || !currentLatLng.lon)"
|
|
|
+ :disabled="(!currentLatLng.lat && !currentLatLng.lng) || !model['gpsNum']"
|
|
|
@change="handleUpdateSwitch"
|
|
|
/>
|
|
|
</template>
|
|
|
@@ -50,9 +50,15 @@
|
|
|
props: {
|
|
|
currentLatLng: {
|
|
|
type: Object as PropType<{
|
|
|
- lat: number;
|
|
|
- lng: number;
|
|
|
+ lat: number | null;
|
|
|
+ lng: number | null;
|
|
|
}>,
|
|
|
+ default: () => {
|
|
|
+ return {
|
|
|
+ lat: null,
|
|
|
+ lng: null,
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
emits: ['register', 'success', 'open-map', 'reload', 'cancel', 'update-gps'],
|