import request from "@/utils/httpRequest";
import { SYS_PATH as prefix } from "@/api/AppPath";

export default {
	save: function (inputForm) {
		return request({
			url: prefix + "/datav/dataComponent/save",
			method: "post",
			data: inputForm,
		});
	},

	delete: function (ids) {
		return request({
			url: prefix + "/datav/dataComponent/delete",
			method: "delete",
			params: { ids: ids },
		});
	},

	queryById: function (id) {
		return request({
			url: prefix + "/datav/dataComponent/queryById",
			method: "get",
			params: { id: id },
		});
	},

	list: function (params) {
		return request({
			url: prefix + "/datav/dataComponent/list",
			method: "get",
			params: params,
		});
	},

	exportTemplate: function () {
		return request({
			url: prefix + "/datav/dataComponent/import/template",
			method: "get",
			responseType: "blob",
		});
	},

	exportExcel: function (params) {
		return request({
			url: prefix + "/datav/dataComponent/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},

	importExcel: function (data) {
		return request({
			url: prefix + "/datav/dataComponent/import",
			method: "post",
			data: data,
		});
	},
};
