|
|
@ -145,7 +145,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<!-- eslint-disable no-undef --> |
|
|
|
<!-- eslint-disable no-undef --> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { getMapData, savePlace, updateSchoolStatus } from '@/api/sch/place'; |
|
|
|
import { getMapData, addPlace, updatePlace, updateSchoolStatus } from '@/api/sch/place'; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'Place', |
|
|
|
name: 'Place', |
|
|
|
data() { |
|
|
|
data() { |
|
|
@ -427,7 +427,7 @@ export default { |
|
|
|
// 保存接口 |
|
|
|
// 保存接口 |
|
|
|
if (this.checkPlaceFormValidate()) { |
|
|
|
if (this.checkPlaceFormValidate()) { |
|
|
|
// 先访问接口,返回id插入placeForm |
|
|
|
// 先访问接口,返回id插入placeForm |
|
|
|
const resp = await savePlace(this.placeForm); |
|
|
|
const resp = this.savePlace(this.placeForm); |
|
|
|
if (resp.code != 200) { |
|
|
|
if (resp.code != 200) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -473,6 +473,13 @@ export default { |
|
|
|
this.placeMarkerList = tmpArr1; |
|
|
|
this.placeMarkerList = tmpArr1; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
async savePlace(item) { |
|
|
|
|
|
|
|
if (item.placeId) { |
|
|
|
|
|
|
|
return updatePlace(item); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return addPlace(item) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
checkPlaceFormValidate() { |
|
|
|
checkPlaceFormValidate() { |
|
|
|
const valid = []; |
|
|
|
const valid = []; |
|
|
|
if (!this.placeForm.name) { |
|
|
|
if (!this.placeForm.name) { |
|
|
@ -570,7 +577,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 修改场地状态 |
|
|
|
// 修改场地状态 |
|
|
|
async changePlaceStatus(item) { |
|
|
|
async changePlaceStatus(item) { |
|
|
|
const resp = await savePlace(item); |
|
|
|
const resp = await updatePlace(item); |
|
|
|
if (resp.code == 200) { |
|
|
|
if (resp.code == 200) { |
|
|
|
this.resetMarkers(); |
|
|
|
this.resetMarkers(); |
|
|
|
} |
|
|
|
} |
|
|
|