import request from '@/utils/request'

// 查询商品信息列表
export function listRegionals(query) {
	return new Promise((resolve, reject) => {
		let response = [{
			refuelId: 1356,
			oilName: "广州猎德大桥",
			mapRows: [{
				oilName: "ECA点-1",
				longitude: 117.670323,
				latitude: 38.831509,
			},{
				oilName: "ECA点-2",
				longitude: 117.695141,
				latitude: 38.800045,
			},{
				oilName: "ECA点-3",
				longitude: 117.659597,
				latitude: 38.785127,
			},{
				oilName: "ECA点-4",
				longitude: 117.620267,
				latitude: 38.808076,
			},{
				oilName: "ECA点-5",
				longitude: 117.670323,
				latitude: 38.831509,
			}]
		},{
			refuelId: 1236,
			oilName: "广州海心沙大桥",
			mapRows: [{
				oilName: "ECA点-1",
				longitude: 119.325,
				latitude: 37.295833,
			},{
				oilName: "ECA点-2",
				longitude: 119.416667,
				latitude: 37.295833,
			},{
				oilName: "ECA点-3",
				longitude: 119.313833,
				latitude: 37.1945,
			},{
				oilName: "ECA点-4",
				longitude: 119.234667,
				latitude: 37.208333,
			},{
				oilName: "ECA点-5",
				longitude: 119.325,
				latitude: 37.295833,
			}]
		},{
			refuelId: 2314,
			oilName: "广州琶洲大桥",
			mapRows: [{
				"oilName": "ECA点-1",
				"longitude": 113.63450425210995,
				"latitude": 22.546098312607935
			},
			{
				"oilName": "ECA点-2",
				"longitude": 113.67801087579336,
				"latitude": 22.545796187077745
			},
			{
				"oilName": "ECA点-3",
				"longitude": 113.67075977184614,
				"latitude": 22.495945474596027
			},
			{
				"oilName": "ECA点-4",
				"longitude": 113.62725314816271,
				"latitude": 22.496851851186605
			}]
		},{
			refuelId: 3236,
			oilName: "广州南沙大桥",
			mapRows: [{
				"oilName": "ECA点-1",
				"longitude": 113.64362338337796,
				"latitude": 22.64419740275247
			},
			{
				"oilName": "ECA点-2",
				"longitude": 113.65578254504979,
				"latitude": 22.647985636619836
			},
			{
				"oilName": "ECA点-3",
				"longitude": 113.66586426201387,
				"latitude": 22.63863725304392
			},
			{
				"oilName": "ECA点-4",
				"longitude": 113.66005963709516,
				"latitude": 22.626905948164342
			},
			{
				"oilName": "ECA点-5",
				"longitude": 113.6471672596441,
				"latitude": 22.62776135581181
			},
			{
				"oilName": "ECA点-6",
				"longitude": 113.63561911112161,
				"latitude": 22.634665717537814
			}]
		}]
		resolve(JSON.parse(JSON.stringify(response)));
	})
    // return request({
    //     url: '/regional/list',
    //     method: 'get',
    //     params: query
    // })
}

// 查询商品信息详细
export function getRegionals(refuelId) {
    return request({
        url: '/regional/' + refuelId,
        method: 'get'
    })
}

// 新增商品信息
export function addRegional(data) {
    return request({
        url: '/regional',
        method: 'post',
        data: data
    })
}

// 修改商品信息
export function updateRegional(data) {
    return request({
        url: '/regional',
        method: 'put',
        data: data
    })
}

// 删除商品信息
export function delRegional(refuelId) {
    return request({
        url: '/regional/' + refuelId,
        method: 'delete'
    })
}

