空值判断

dev
dengjia 2025-07-22 09:21:28 +08:00
parent 7f163a0e67
commit b2fa80e604
2 changed files with 12 additions and 4 deletions

View File

@ -337,9 +337,13 @@ const fnGetData = async () => {
if (!props.corpInfoId) return;
const { data } = await getBusCompanyInfo({ id: props.corpInfoId });
form.value = data;
form.value.area = [form.value.province, form.value.city, form.value.county];
if (form.value.province) {
form.value.area = [form.value.province, form.value.city, form.value.county];
}
form.value.sectorId = data.sectorId.split(",");
form.value.address = `${form.value.longitude}-${form.value.latitude}`;
if (form.value.longitude) {
form.value.address = `${form.value.longitude}-${form.value.latitude}`;
}
thirdList.value = data.thirdList;
};

View File

@ -102,8 +102,12 @@ const thirdListOptions = [
const fnGetData = async () => {
const { data } = await getBusCompanyInfo({ id: id });
info.value = data;
info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
info.value.address = `${info.value.longitude}-${info.value.latitude}`;
if (info.value.province) {
info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
}
if (info.value.longitude) {
info.value.address = `${info.value.longitude}-${info.value.latitude}`;
}
thirdList.value = info.value.thirdList;
const { data: servicePlatformList } = await getBusServicePlatformListAll();
target.value = servicePlatformList.find(