import config from "@/config";
import http from "@/utils/request";

export default {
	earlyWarn:{
		list:{
			url: `${config.API_URL}/spare.parts.water.level.warning.list`,
			name: "备件水位预警管理列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add:{
			url: `${config.API_URL}/spare.parts.water.level.warning.edit`,
			name: "新增/编辑水位信息",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/spare.parts.water.level.warning.delete`,
			name: "删除水位信息",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		batchEdit:{
			url: `${config.API_URL}/spare.parts.water.level.warning.batch.edit`,
			name: "批量编辑预估用量",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		room:{
			url: `${config.API_URL}/regional.room.code.list`,
			name: "区域机房代码列表",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export:{
			url: `${config.API_URL}/spare.parts.water.level.warning.export`,
			name: "导出备件预警列表",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		field:{
			url: `${config.API_URL}/spare.parts.warning.field.list`,
			name: "预警管理自定义检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		template:{
			url: `${config.API_URL}/warning.management.import.template`,
			name: "预计六个月用量导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/spare.parts.water.level.warning.batch.import`,
			name: "预计六个月用量导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
	},
	exclude:{
		list:{
			url: `${config.API_URL}/warning.exclude.list`,
			name: "排除备件列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/warning.exclude.field.list`,
			name: "排除备件检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		template:{
			url: `${config.API_URL}/warning.exclude.import.template`,
			name: "排除备件导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/warning.exclude.import`,
			name: "排除备件导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
	}

};
