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