|
@@ -49,15 +49,13 @@ function AddBuilding(props) {
|
49
|
49
|
const [fileUploadDisabled, setFileUploadDisabled] = useState(false)
|
50
|
50
|
|
51
|
51
|
// console.log('props.building: ', props.building)
|
52
|
|
- if (props.building.buildingId !== undefined) {
|
53
|
|
- const { buildingId } = props.building
|
|
52
|
+ const { buildingId } = props.building
|
54
|
53
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
55
|
|
- useEffect(() => {
|
56
|
|
- if (buildingId !== '') {
|
|
54
|
+ useEffect(() => {
|
|
55
|
+ if (buildingId && buildingId !== '') {
|
57
|
56
|
getById(buildingId)
|
58
|
57
|
}
|
59
|
|
- }, [])
|
60
|
|
- }
|
|
58
|
+ }, [buildingId])
|
61
|
59
|
|
62
|
60
|
// 获取详情信息
|
63
|
61
|
function getById(currentId) {
|