diff --git a/src/api/frobot/map/station/station.js b/src/api/frobot/map/station/station.js index b28081a..6f8fc92 100644 --- a/src/api/frobot/map/station/station.js +++ b/src/api/frobot/map/station/station.js @@ -14,4 +14,11 @@ export function queryAllStationWithTaskStatus() { }) } -export default { queryAllStations, queryAllStationWithTaskStatus } +export function syncCurrentMapData() { + return request({ + url: '/mapinfo/syncCurrentMapData', + method: 'post' + }) +} + +export default { queryAllStations, queryAllStationWithTaskStatus, syncCurrentMapData } diff --git a/src/i18n/langs/en.js b/src/i18n/langs/en.js index 31229cb..2c57a24 100644 --- a/src/i18n/langs/en.js +++ b/src/i18n/langs/en.js @@ -103,7 +103,44 @@ export default { 'submit_msg': 'Submitted successfully', 'add_msg': 'Added successfully', 'edit_msg': 'Edited successfully', - 'del_msg': 'Delete successfully' + 'del_msg': 'Delete successfully', + 'request_timeout': 'Network request timeout', + 'request_failed': 'Interface request failed', + 'error': 'Error' + }, + 'dashboard': { + 'today': 'Today', + 'week': 'This Week', + 'month': 'This Month', + 'total_tasks': 'Total Tasks', + 'executing_tasks': 'Executing', + 'completed_tasks': 'Completed', + 'cancellation_rate': 'Cancellation Rate', + 'completion_rate': 'Completion Rate', + 'online_vehicles': 'Online Vehicles', + 'current_tasks': 'Current Tasks', + 'refresh': 'Refresh', + 'task_code': 'Task Code', + 'task_type': 'Task Type', + 'target_point': 'Target Point', + 'status': 'Status', + 'executing_vehicle': 'Executing Vehicle', + 'create_time': 'Create Time', + 'task_pending': 'Pending', + 'task_executing': 'Executing', + 'task_completed': 'Completed', + 'task_cancelled': 'Cancelled', + 'vehicle_status': 'Vehicle Status', + 'vehicle_idle': 'Idle', + 'battery': 'Battery', + 'signal': 'Signal', + 'ice': 'Ice', + 'water': 'Water', + 'room_status': 'Room Status', + 'no_vehicle_data': 'No vehicle data', + 'no_room_data': 'No room data', + 'room_executing': 'Executing', + 'room_idle': 'Idle' }, 'monitor': { 'sys': 'System', diff --git a/src/i18n/langs/hotel/en.js b/src/i18n/langs/hotel/en.js index 04b5b22..cfb2690 100644 --- a/src/i18n/langs/hotel/en.js +++ b/src/i18n/langs/hotel/en.js @@ -53,6 +53,9 @@ export default { 'failed': 'Go Home command failed, please try again' }, 'empty': 'No room data available', - 'query_failed': 'Failed to query room status, please check network' + 'query_failed': 'Failed to query room status, please check network', + 'sync_map': 'Sync Station', + 'sync_map_success': 'Map synced successfully', + 'sync_map_failed': 'Map sync failed, please try again' } } diff --git a/src/i18n/langs/hotel/vi.js b/src/i18n/langs/hotel/vi.js index 98fc8be..0416c6f 100644 --- a/src/i18n/langs/hotel/vi.js +++ b/src/i18n/langs/hotel/vi.js @@ -53,6 +53,9 @@ export default { 'failed': 'Lệnh Go Home thất bại, vui lòng thử lại' }, 'empty': 'Không có dữ liệu phòng', - 'query_failed': 'Truy vấn trạng thái phòng thất bại, kiểm tra mạng' + 'query_failed': 'Truy vấn trạng thái phòng thất bại, kiểm tra mạng', + 'sync_map': 'Đồng bộ bản đồ', + 'sync_map_success': 'Đồng bộ bản đồ thành công', + 'sync_map_failed': 'Đồng bộ bản đồ thất bại, vui lòng thử lại' } } diff --git a/src/i18n/langs/hotel/zh.js b/src/i18n/langs/hotel/zh.js index 4c9375b..085c241 100644 --- a/src/i18n/langs/hotel/zh.js +++ b/src/i18n/langs/hotel/zh.js @@ -53,6 +53,9 @@ export default { 'failed': 'Go Home 指令下发失败,请重试' }, 'empty': '暂无房间数据', - 'query_failed': '查询房间状态失败,请检查网络' + 'query_failed': '查询房间状态失败,请检查网络', + 'sync_map': '同步站点', + 'sync_map_success': '地图同步成功', + 'sync_map_failed': '地图同步失败,请重试' } } diff --git a/src/i18n/langs/zh-CN.js b/src/i18n/langs/zh-CN.js index 85c69e6..ea15e2d 100644 --- a/src/i18n/langs/zh-CN.js +++ b/src/i18n/langs/zh-CN.js @@ -103,7 +103,44 @@ export default { 'submit_msg': '提交成功', 'add_msg': '新增成功', 'edit_msg': '编辑成功', - 'del_msg': '删除成功' + 'del_msg': '删除成功', + 'request_timeout': '网络请求超时', + 'request_failed': '接口请求失败', + 'error': '异常' + }, + 'dashboard': { + 'today': '今天', + 'week': '本周', + 'month': '本月', + 'total_tasks': '总任务数', + 'executing_tasks': '执行中', + 'completed_tasks': '已完成', + 'cancellation_rate': '取消率', + 'completion_rate': '完成率', + 'online_vehicles': '在线车辆', + 'current_tasks': '当前任务', + 'refresh': '刷新', + 'task_code': '任务编号', + 'task_type': '任务类型', + 'target_point': '目标点', + 'status': '状态', + 'executing_vehicle': '执行车辆', + 'create_time': '创建时间', + 'task_pending': '待执行', + 'task_executing': '执行中', + 'task_completed': '已完成', + 'task_cancelled': '已取消', + 'vehicle_status': '车辆状态', + 'vehicle_idle': '空闲', + 'battery': '电量', + 'signal': '信号', + 'ice': '冰', + 'water': '水', + 'room_status': '房间状态', + 'no_vehicle_data': '暂无车辆数据', + 'no_room_data': '暂无房间数据', + 'room_executing': '执行中', + 'room_idle': '空闲' }, 'monitor': { 'sys': '系统', diff --git a/src/utils/request.js b/src/utils/request.js index 7589044..a7551fc 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -5,6 +5,7 @@ import store from '../store' import { getToken } from '@/utils/auth' import Config from '@/settings' import Cookies from 'js-cookie' +import i18n from '@/i18n' const baseURLStr = window.g.prod.VUE_APP_BASE_API @@ -55,7 +56,7 @@ service.interceptors.response.use( } catch (e) { if (error.toString().indexOf('Error: timeout') !== -1) { Notification.error({ - title: '网络请求超时', + title: i18n.t('auto.common.request_timeout'), duration: 5000 }) return Promise.reject(error) @@ -82,7 +83,7 @@ service.interceptors.response.use( } } else { Notification.error({ - title: '接口请求失败', + title: i18n.t('auto.common.request_failed'), duration: 5000 }) } diff --git a/src/views/frobot/hotel/index.vue b/src/views/frobot/hotel/index.vue index 39e6f06..020c907 100644 --- a/src/views/frobot/hotel/index.vue +++ b/src/views/frobot/hotel/index.vue @@ -8,6 +8,7 @@
Go Home + {{ $t('hotel.sync_map') }} {{ $t('hotel.refresh') }} {{ $t('hotel.last_update') }}: {{ lastUpdateTime }}
@@ -172,7 +173,7 @@ -