import store from '@/store'
// import { getAnalog } from "@/api/ship/ship";
let analogResponse = {
	"data": [{
			"0a4": "113.1047683",
			"0a5": "22.1617233",
			"iboatName": "易站科技",
			"sn": "490023417",
			"0aA": "0",
			"0a9": "9",
			"time": "2023-08-25 10:25:44",
		}]
}
export function getCurrencyConfigByMid(mid, needValue = true, divisor = 1) {
	let currencyConfig = store.state.data.analogList[0] || {};
	return currencyConfig[mid] || ""
}
export function getAnalog(query = {}) {
	return new Promise((resolve, reject) => {
		setTimeout(() => {
			resolve(JSON.parse(JSON.stringify(analogResponse)));
		},200);
	})
}

export const handleGetAnalog = () => {
	return new Promise((resolve, reject) => {
		getAnalog().then((response) => {
			store.state.data.analogList = response.data;
			store.state.data.curAnalogSn = store.state.data.analogList[0].sn;
			resolve(response)
		});
	})
}