| | |
| | | return options; |
| | | } |
| | | |
| | | export const fetchMapData = async (intl) => { |
| | | export const fetchMapData = async (curFloor) => { |
| | | clearMapData(); |
| | | await Http.doPostPromise('api/map/list', {}, (res) => { |
| | | const mapItemList = res.data.itemList; |
| | | await Http.doPostPromise('api/map/list', { floor: curFloor }, (res) => { |
| | | const mapItemList = eval(res.data); |
| | | mapItemList.forEach(item => { |
| | | let sprite; |
| | | switch (item.type) { |
| | |
| | | |
| | | } |
| | | |
| | | export const saveMapData = async (intl) => { |
| | | export const saveMapData = async (intl, floor) => { |
| | | if (!mapContainer) { |
| | | return; |
| | | } |
| | |
| | | }) |
| | | |
| | | const closeLoading = message.loading({ content: intl.formatMessage({ id: 'common.loading.api.message', defaultMessage: '等待服务器......' }), duration: API_TIMEOUT }); |
| | | await Http.doPostPromise('api/map/save', { itemList: mapItemList }, (res) => { |
| | | await Http.doPostPromise('api/map/save', { |
| | | itemList: mapItemList, |
| | | floor: floor |
| | | }, (res) => { |
| | | closeLoading(); |
| | | }).catch((error) => { |
| | | closeLoading(); |