You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.1 KiB
78 lines
2.1 KiB
|
1 month ago
|
import request from '@/config/axios'
|
||
|
|
|
||
|
|
/** 地图信息 */
|
||
|
|
export interface Map {
|
||
|
|
id: number // 编号
|
||
|
|
parentId?: number // 父级编号
|
||
|
|
type?: number // 类型
|
||
|
|
name?: string // 名称
|
||
|
|
data: string // 数据
|
||
|
|
}
|
||
|
|
|
||
|
|
// 地图 API
|
||
|
|
export const MapApi = {
|
||
|
|
// 查询地图分页
|
||
|
|
getMapPage: async (params: any) => {
|
||
|
|
return await request.get({ url: `/shorepower/map/page`, params })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 查询地图详情
|
||
|
|
getMap: async (id: number) => {
|
||
|
|
return await request.get({ url: `/shorepower/map/get?id=` + id })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 新增地图
|
||
|
|
createMap: async (data: Map) => {
|
||
|
|
return await request.post({ url: `/shorepower/map/create`, data })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 修改地图
|
||
|
|
updateMap: async (data: Map) => {
|
||
|
|
return await request.put({ url: `/shorepower/map/update`, data })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 删除地图
|
||
|
|
deleteMap: async (id: number) => {
|
||
|
|
return await request.delete({ url: `/shorepower/map/delete?id=` + id })
|
||
|
|
},
|
||
|
|
|
||
|
|
/** 批量删除地图 */
|
||
|
|
deleteMapList: async (ids: number[]) => {
|
||
|
|
return await request.delete({ url: `/shorepower/map/delete-list?ids=${ids.join(',')}` })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 导出地图 Excel
|
||
|
|
exportMap: async (params) => {
|
||
|
|
return await request.download({ url: `/shorepower/map/export-excel`, params })
|
||
|
|
},
|
||
|
|
|
||
|
|
// 查询地图详情
|
||
|
|
getAllData: async (type?: number, parentId?: number) => {
|
||
|
|
const params = type
|
||
|
|
? parentId
|
||
|
|
? `?type=$${type}&parentId=${parentId}`
|
||
|
|
: `?type=${type}`
|
||
|
|
: parentId
|
||
|
|
? `?parentId=${parentId}`
|
||
|
|
: ''
|
||
|
|
const data = await request.get({ url: `/shorepower/map/expand/selectAll` + params })
|
||
|
|
console.log('data:', data)
|
||
|
|
return data
|
||
|
|
},
|
||
|
|
// 查询船舶信息
|
||
|
|
getShipInfo: async (params: any) => {
|
||
|
|
return await request.post({
|
||
|
|
url: `/shorepower/shore-power-and-ship/expand/getShipInfo`,
|
||
|
|
params
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
// 查询用电接口设备状态
|
||
|
|
getDeviceStatusByIds: async (ids: any) => {
|
||
|
|
return await request.get({
|
||
|
|
url: `/energy/device/getDeviceStatusByIds?ids=${ids.join(',')}`,
|
||
|
|
// params
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|