import request from '@/utils/request'

// 查询流程表单列表
export const listForm = async (query: any) => {
  return await request({
    url: '/flowable/form/list',
    method: 'get',
    params: query
  })
}
export const listAllForm = async (query: any) => {
	return await request({
		url: "/flowable/form/formList",
		method: "get",
		params: query,
	});
};

// 查询流程表单详细
export const getForm = async (formId: string) => {
	return await request({
		url: "/flowable/form/" + formId,
		method: "get",
	});
}

// 新增流程表单
export const addForm = async (data: any) => {
	return await request({
		url: "/flowable/form",
		method: "post",
		data: data,
	});
}

// 修改流程表单
export const updateForm = async (data: any) => {
	return await request({
		url: "/flowable/form",
		method: "put",
		data: data,
	});
}
// 挂载表单
export const addDeployForm = async (data: any) => {
	return await request({
		url: "/flowable/form/addDeployForm",
		method: "post",
		data: data,
	});
}

// 删除流程表单
export const delForm = async (formId: string) => {
	return await request({
		url: "/flowable/form/" + formId,
		method: "delete",
	});
}

// 导出流程表单
export const exportForm = async (query: any) => {
	return await request({
		url: "/flowable/form/export",
		method: "get",
		params: query,
	});
};
