import request from '/@/utils/request';
import type { BasicFormT } from './types'

export const addPropertyRightsAPI = (data: BasicFormT) => {
	return request({
		url: '/admin/propertyRights/add',
		method: 'post',
		data,
	});
};
// 根据模板id查询产权
export const getPropertyRightsByIdAPI = (templateId: string | number) => {
    return request({
        url: '/admin/propertyRights/getByTemplateId',
        method: 'get',
        params: { templateId },
    });
}

export const getPropertyRightsPageAPI = (query?: {
	page?: number;
	size?: number;
	enterpriseName?: string;
	creditCode?: string;
}) => {
	return request({
		url: '/admin/propertyRights/page',
		method: 'post',
		data: query,
	});
};

export const updatePropertyRightsAPI = (data: BasicFormT) => {
	return request({
		url: '/admin/propertyRights/updateInfo',
		method: 'put',
		data,
	});
};

export const getPropertyRightsDetailAPI = (id: string | number) => {
	return request({
		url: '/admin/propertyRights/view',
		method: 'get',
		params: { id },
	});
};
// /admin/propertyRights/getByProcessInstanceId 根据流程实例id查询
export const getPropertyRightsByProcessInstanceIdAPI = (processInstanceId: string) => {
    return request({
        url: '/admin/propertyRights/getByProcessInstanceId',
        method: 'get',
        params: { processInstanceId },
    });
}
// 根据id查询流程详情
export const getProcessInfoByIdAPI = (id: string | number) => {
	return request({
		url:'/admin/flow/form/processInfo',
		method: 'get',
		params: { id },
	})
}