// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {
	// 参数配置对象
	const config = vm.vuex_config

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {
		// 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等
		login: (params = {}) => vm.$u.post(config.adminPath + "/sys/user/login", params),
		getMenuList: (params = {}) => vm.$u.get(config.adminPath + "/sys/user/get"),
		getAllDict: (params = {}) => vm.$u.post(config.adminPath + "/sys/dict/typeAll", params),
		getStationByUser: (params = {}) => vm.$u.post(config.adminPath + "/business/station"),
		getUserInfo: (params = {}) => vm.$u.get(config.adminPath + "/sys/user/get", params),
		changePsd: (params = {}) => vm.$u.put(config.adminPath + "/sys/user/pwd", params),
		logout: (params = {}) => vm.$u.get(config.adminPath + "/sys/user/logout", params),
		GetDictListByType: (params = {}) => vm.$u.post(config.adminPath + "/sys/dict/typeList", params),
		GetNewFile: (params = {}) => vm.$u.post(config.adminPath + "/business/station/selectLastOne?version=" +
			params),



		lang: (params = {}) => vm.$u.get("/lang/" + params.lang),
		index: (params = {}) => vm.$u.get(config.adminPath + "/mobile/index", params),

		sendCode: (params = {}) =>
			vm.$u.post(config.adminPath + "/mobile/login/sendCode", params),
		registerUser: (params = {}) =>
			vm.$u.post(config.adminPath + "/mobile/user/registerUser", params),
		//首页相关api
		getIndexCardInfo: (params = {}) =>
			vm.$u.get(config.adminPath + "/mobile/index/getIndexCardInfo", params),
		getM2mOrderFlowList: (params = {}) =>
			vm.$u.get(config.adminPath + "/mobile/index/getM2mOrderFlowList", params),
		//获取卡可购买套餐包
		getM2mOrderPackageList: (params = {}) =>
			vm.$u.get(
				config.adminPath + "/mobile/index/getM2mOrderPackageList",
				params
			),

		authInfo: (params = {}) =>
			vm.$u.get(config.adminPath + "/authInfo", params),
		menuTree: (params = {}) =>
			vm.$u.get(config.adminPath + "/menuTree", params),
		switchSys: (params = {}) =>
			vm.$u.get(config.adminPath + "/switch/" + params.sysCode),
		dictData: (params = {}) =>
			vm.$u.get(config.adminPath + "/system/dict/data/type/" + params.dictType),

		// 账号服务：验证码接口、忘记密码接口、注册账号接口等
		validCode: (params = {}) => vm.$u.getText("/validCode", params),
		getFpValidCode: (params = {}) =>
			vm.$u.post("/account/getFpValidCode", params),
		savePwdByValidCode: (params = {}) =>
			vm.$u.post("/account/savePwdByValidCode", params),
		getRegValidCode: (params = {}) =>
			vm.$u.post("/account/getRegValidCode", params),
		saveRegByValidCode: (params = {}) =>
			vm.$u.post("/account/saveRegByValidCode", params),

		// APP公共服务
		upgradeCheck: () =>
			vm.$u.post("/app/upgrade/check", {
				appCode: config.appCode,
				appVersion: config.appVersion,
			}),
		commentSave: (params = {}) => vm.$u.post("/app/comment/save", params),

		//获取通知
		GetMessage: (params = {}) =>
			vm.$u.post("/business/messageInfo/selectMessageInfo", params),
		UpdateMessageStatus: (params = {}) =>
			vm.$u.post("/business/messageInfo/updateMessageReadStatus", params),

		GetLanguageConfig: (params = {}) =>
			vm.$u.post("/business/station/getTermDictionary", params),

		// 个人信息修改
		user: {
			saveUserInfo: (params = {}) =>
				vm.$u.post(config.adminPath + "/mobile/user/saveUserInfo", params),
			infoSavePwd: (params = {}) =>
				vm.$u.put(config.adminPath + "/system/user/profile/updatePwd", params),
			infoSavePqa: (params = {}) =>
				vm.$u.post(config.adminPath + "/sys/user/infoSavePqa", params),
		},

		// 员工用户查询
		empUser: {
			listData: (params = {}) =>
				vm.$u.get(config.adminPath + "/sys/empUser/listData", params),
		},

		// 组织机构查询
		office: {
			treeData: (params = {}) =>
				vm.$u.get(config.adminPath + "/sys/office/treeData", params),
		},


		//实时告警 
		alarm: {
			// 获取告警事件列表
			GetAlarmList: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/event/page", params),
			// 获取告警事件列表
			GetHistoryAlarmList: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/event/hispage", params),

			//获取电站数据
			GetStationlist: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station", params),

			//获取联级电站数据
			GetNewStationlist: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station/nationStation", params),

			// 获取设备类型
			GetDeviceType: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/device/treeDevices", params),

			// 获取历史告警数据
			GetAlarmHistoryList: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/event/hispage", params),

			// 确认告警
			SetAlarmConfirm: (params = {}) =>
				vm.$u.put(config.adminPath + "/flow/event/confirm", params),

			// 告警数量
			GetEventNumber: (params = {}) =>
				vm.$u.post(config.adminPath + "flow/event/eventNum"),
		},

		// 增删改查例子
		testData: {
			form: (params = {}) =>
				vm.$u.post(config.adminPath + "/test/testData/form", params),
			list: (params = {}) =>
				vm.$u.post(config.adminPath + "/test/testData/listData", params),
			save: (params = {}) =>
				vm.$u.postJson(config.adminPath + "/test/testData/save", params),
			disable: (params = {}) =>
				vm.$u.post(config.adminPath + "/test/testData/disable", params),
			enable: (params = {}) =>
				vm.$u.post(config.adminPath + "/test/testData/enable", params),
			delete: (params = {}) =>
				vm.$u.post(config.adminPath + "/test/testData/delete", params),
		},

		// 工单
		workOrder: {
			// 获取工单数量
			GetQueryTodoList: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/processFlow/queryTodoList", params),
			// 获取单个工单信息
			GetWorkOrderDetail: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/processFlow/workOrderDetails", params),
			// 保存工单
			saveOrder: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/processFlow/saveOrder", params),
			// 完成工单
			doTask: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/processFlow/doTask", params),
			// 文件下载
			FileDownload: (params = {}) =>
				vm.$u.post(config.adminPath + "/media/currencyFile/download", params),
		},

		//电站
		station: {
			//获取电站状态
			GetStationStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station/findStationStatus", params),
			// 根据电站状态查询电站
			getStationListByStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station/findListByStationStatus ", params),
			getStationPostionData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/dynamicConfig/pointListData", params)
		},

		//设备
		device: {
			//按电站查询设备类型,维护设备的设备类型时使用
			GetDeviceType: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/deviceConfig/queryDeviceTypeByGroup", params),
			// 电站下的设备
			GetDeviceByStationId: (id = {}) =>
				vm.$u.get(config.adminPath + "/business/device/" + id),
			// 电站下的设备
			GetDeviceByType: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/device/page", params),



		},

		//告警
		warning: {
			// 设备下的告警
			getWarningListById: (params = {}) =>
				vm.$u.post(config.adminPath + "/flow/event/dropDownList", params),
		},

		//集团数据
		groupData: {
			// 给电站用的大屏数据----总览页面
			getForStationCockpit: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pvStation/forStationCockpit", params),

			///分页查询电站
			getStationPage: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station/page", params),

			//根据电站id查询电站详情
			getStationDetailById: (id = {}) =>
				vm.$u.post(config.adminPath + "/business/station/" + id),

			//根据电站id查询电站数据
			getStationData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pvStation/pvPanel", params),

			//根据电站id查询电站实时曲线
			getStationRealtimeCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pvStation/realtimeCurve", params),

			//根据电站id查询电站设备
			getStationDevice: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pvStation/inverterList", params),

			//根据设备的数据
			getDevicePanelData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/inverter/panelData", params),
			//根据设备的功率曲线
			getDeviceCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/inverter/curve", params),
			//根据设备的点
			getDeviceDot: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/inverter/attribute", params),
		},

		//策略模块

		policy: {
			// 查询下发设备接口
			getIssueDevices: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/getIssueDevices", params),

			// 查询计划曲线模板接口
			getTemplate: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/getTemplate", params),

			// 查询下发模型数据（取出data数据发给下发接口）
			getIssueDatas: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/getIssueDatas", params),

			// 查看设备下发状态
			queryIssueStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/queryIssueStatus", params),

			// 查看设备下发状态
			insertIssueStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/insertIssueStatus", params),

			// 查看详情
			lookPlanningCurveTemplateDetail: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planning/planningCurveTemplateDetail", params),

			// 查看曲线详情
			lookPlanningCurveTemplateChartData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planning/planningCurveTemplateChartData", params),

			// 下发
			SetOrderIssued: (params = {}) =>
				vm.$u.post(config.adminPath + "/media/orderSend/orderIssued", params),

			// 指令下发
			GetOrderProgressBar: (params = {}) =>
				vm.$u.post(config.adminPath + "/media/orderSend/progressBar", params),

			// 获取修改值
			GetSubstitutionValueList: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/substitutionValue/page", params),
			// 保存修改值
			SaveSubstitutionValue: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/substitutionValue/add", params),
			// 控制下发
			GetPlanCurveIssueData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/planningIssue/getPlanCurveIssueData", params),
		},

		homePageData: {
			// 获取电站配置信息
			GetHomePageComponents: (id = {}) =>
				vm.$u.post(config.adminPath + `/business/homeConfig/${id}`),

			// 充放电量
			GetElecData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/elecData", params),

			// 数据总览
			GetPcsTotalData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/pcsTotalData", params),


			// 运行曲线
			GetRealtimeCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/realtimeCurve", params),

			// 拓扑图--状态监控
			GetOpenStationMiddle: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/middle", params),

			// 拓扑图--状态监控
			GetOpenStationMiddlePart: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/middlePart", params),

			// 环控数据
			GetAirCondition: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/getAirCondition", params),

			// 拓扑图--电表
			GetMiddlePart: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/middlePart", params),

			// 拓扑图--状态监控
			GetbozhouTuopuStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/bozhou/status", params),
			// 上海科技园充放电量
			GetKJYElecData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/getPCSElecData", params),

			// 上海科技园电站数据
			GetKJYPcsTotalData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/getEleTotalData", params),

			//  上海科技园空调数据
			GetShanghaiKJYAirData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/commonAirCondition", params),

			// 查询历史曲线
			GetHistoryData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/point/getPointCurve", params),

			// 瑞安汽车
			GetRAPcsTotalData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/getPcsTotalData", params),

			// 瑞安汽车充放电
			GetPCSElecData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/getPCSElecData", params),

			// 慈溪环控
			GetCircleCtr: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/circleCtr", params),
			// 晶科数据
			GetJingKeData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/jingke/status", params),

			// 获取soc曲线
			GetSocCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/batteryStack/socCurve", params),

			GetJKCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/jingke/realtimeCurve", params),
			GetWSHStatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/weiShanHu/status", params),

			GetZzhbtatus: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/zhongZiHuanBao/status", params),
			// 中自环保光伏数据
			GetZZHBPv: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/zhongZiHuanBao/getStationData", params),
			// 微山湖光伏数据
			GetWSHPv: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/weiShanHu/getStationData", params),
			//获取动态配置
			GetDynamicConfig: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/dynamicConfig/pointListData", params),
			//横沥光伏
			GetMiddlePartInverter: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/middlePartInverter", params),
			//并网负载侧电表
			GetElec: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/getElec", params),
			//横沥103电表
			GetEleMeter: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/getEleMeter", params),
			//横沥103光伏
			GetOpticalStorage: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/getOpticalStorage", params),
			// 挚达光伏
			GetZhiDaPv: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/getPVElec", params),

			//获取配置曲线
			GetDynamicRealTimeCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/dynamicRealtimeCurve", params),

			GetFireConfig: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/topologyAttribute/DataConfig", params),

			getPvElecData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/openStation/getPvData", params)

		},



		//设备列表
		deviceList: {
			// 获取设备列表
			GetTreeVirtualDevices: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/device/treeVirtualDevices", params),

			// 获取设备数据			
			GetNewValue: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/newValue", params),

			// 获取组数据
			GetPackTemperatureVoltageData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/packTemperatureVoltageData", params),

			// 电池包温度电压柱状图以及运行数据
			GetTemVolData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/common/packTemperatureVoltageData", params),

			// 温度电压正太分布
			GetTemperatureVoltageData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/station/temperatureVoltageData", params),

			//获取电度表曲线
			GetTtackHisData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/batteryStack/stackHisData", params),



			//获取光伏发电功率
			GetPvCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pcs/pvCurve", params),


			GetPageDevice: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/device/homePageTreeDevices", params),
			//功率曲线
			GetPCSCurve: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/pcs/pcsCurve", params),

			// 遥信遥测数据
			GetPCSPoint: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/point/page", params),


		},

		//收益
		enrnings: {
			GetTotal: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/earningsCalculate/getTotal", params),
			GetPvMonthData: (params = {}) =>
				vm.$u.post(config.adminPath + "/business/earningsCalculate/getPvMonthData", params),
		
		},


		proxyPrice: {
			// 查询区域
			GetIndustrialElecRegionList: (params = {}) => vm.$u.post(config.adminPath +
				"/business/industrialElecRegion/list", params),
			/** 查询自定义电价*/
			GetCustomElecPricePage: (params = {}) => vm.$u.post(config.adminPath +
				"/business/elecPriceCurve/all", params),
			/** 查询所有代理电价-分页*/
			GetIndustrialElecPricePage: (params = {}) => vm.$u.post(config.adminPath +
				"/business/industrialElecPrice/page", params),
			//根据id查询分时电价折线图
			GetTouLineById: (id = {}) => vm.$u.get(config.adminPath +
				`/business/industrialElecPrice/getTouLineById/${id}`),
			//根据id查询分时电价历史数据图表/表格
			GetTouLineHistoryById: (id = {}) => vm.$u.get(config.adminPath +
				`/business/industrialElecPrice/getTouLineHistoryById/${id}`),
			//根据id查询峰谷电差价折线图/表格
			GetMaxPriceDiffById: (id = {}) => vm.$u.get(config.adminPath +
				`/business/industrialElecPrice/getMaxPriceDiffById/${id}`),


		}


	}


}

export default {
	install,
}