import { projectconfig } from "../static/projectconfig"
import { Store } from 'le5le-store'



export const network = {

	/*** 加载Json文件 */
	async getJsonFile(axios, filepath)
	{
		console.log(filepath)
		axios.get(filepath)
			.then(res =>
			{
				return res.data;
			})
			.catch(error =>
			{
				//console.log("searchWarningList 异常:" + error);
			});
	},
	/**
	 * 根据标签点名查询对应的数据
	 * @param {*} axios this.$axios
	 * @param {*} tagNameArray []
	 */
	getTagValues(axios, tagNameArray)
	{
		axios.get(projectconfig.restful.host + projectconfig.restful.searchTagValues,
			{
				params:
				{
					keys: tagNameArray.join(',')
				}
			}
		).then(res =>
		{
			Store.set('wxwData', res.data);
		}).catch(error =>
		{
			//console.log("getTagValues 异常:" + error);
		});
	}

}