import apis from '@/configs/http';
import { redirectToLogin, redirectTo } from '@/common/NavFuncs';

export default {
	namespaced: true,
	actions: {
		getProvinceAll({ commit },param) {
			return apis.sz.post('/TOrder/getProvinceAll',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getProvince({ commit },param) {
			return apis.sz.post('/TOrder/getProvince',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getEquipmentStatistics({ commit },param) {
			return apis.sz.post('/TOrder/getEquipmentStatistics',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getStatistics({ commit },param) {
			return apis.sz.post('/TOrder/getStatistics',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getMainStatistics({ commit },param) {
			return apis.sz.post('/TOrder/getMainStatistics',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getEquipmentListByUser({ commit },param) {
			return apis.sz.post('/TEquipment/getEquipmentListByUser',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		getEquipmentListByProvince({ commit },param) {
			return apis.sz.post('/TEquipment/getEquipmentListByProvince',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		updata({ commit },param) {
			return apis.sz.post('/TEquipment/updateName',param)
				.then(res => {
					const { data } = res;
					return res;
				});
		},
		//修改定时
		updateRule({ commit },param) {
			return apis.sz.post('/TEquipment/updateRule',param)
				.then(res => {
					var data = res;
					return data;
				});
		},
		getMachineNum({ commit },param) {
			return apis.sz.post('/TEquipment/getMachineNum',param)
				.then(res => {
					const { data } = res;
					return data;
				});
		},
		//获取参数
		getParameters({ commit },param) {
			return apis.sz.post('/TParameters/getParameters',param)
				.then(res => {
					// const { data } = res;
					return res;
				});
		},
		//修改参数
		updateParameters({ commit },param) {
			return apis.sz.post('/TParameters/updateParameters',param)
				.then(res => {
					// const { data } = res;
					return res;
				});
		},
		//添加闹钟list
		addAlarmClock({ commit },param) {
			return apis.sz.post('/TAlarmClock/add',param)
				.then(res => {
					// const { data } = res;
					return res;
				});
		},
		//添加闹钟item
		addAlarmClockItem({ commit },param) {
			return apis.sz.post('/TAlarmClockItem/add',param)
				.then(res => {
					// const { data } = res;
					return res;
				});
		},
		//修改闹钟
		updateAlarmClock({ commit },param) {
			return apis.sz.post('/TAlarmClock/updata',param)
				.then(res => {
					// const { data } = res;
					return res;
				});
		},
	}
}

