/*
 * @Author: zc
 * @description 预案库 - 预案管理
 */
import request from '@/utils/request';
/**
 * @description 获取预案库列表基础信息
 * @param {object} params
 */
export const getPlanBaseData = (params?: object) => {
	return request({
		url: '/api/v1/Plan/list/status-data',
		method: 'get',
	});
};
/**
 * @description 获取预案库列表
 * @param {object} params
 */
export const getPlanList = (params?: object) => {
	return request({
		url: '/api/v1/Plan/list',
		method: 'get',
		params,
	});
};
/**
 * @description 获取预案库列表导出
 * @param {object} data
 */
export const getPlanExport = (data: object) => {
	return request(
		{
			url: '/api/v1/Plan/export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 新增预案库草稿
 * @param {object} data
 */
export const addPlanDraft = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/draft',
		method: 'post',
		data,
	});
};
/**
 * @description 新增预案库草稿直接到审核
 * @param {object} data
 */
export const addPlanDraftAudit = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/add',
		method: 'post',
		data,
	});
};
/**
 * @description 预案库详情
 * @param {object} params
 */
export const planDetail = (params: object) => {
	return request({
		url: '/api/v1/Plan/list/info',
		method: 'get',
		params,
	});
};
/**
 * @description 预案库编辑草稿
 * @param {object} data
 */
export const editPlanDraft = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/draftupdate',
		method: 'put',
		data,
	});
};
/**
 * @description 预案库编辑草稿到审核
 * @param {object} data
 */
export const editPlanAudit = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/update',
		method: 'put',
		data,
	});
};
/**
 * @description 预案库评分
 * @param {object} data
 */
export const planScore = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/score',
		method: 'put',
		data,
	});
};
/**
 * @description 预案库审核
 * @param {object} data
 */
export const planAudit = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/examin',
		method: 'put',
		data,
	});
};
/**
 * @description 案例查重
 * @param {object} data
 */
export const planRepeat = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/exist',
		method: 'post',
		data,
	});
};
/**
 * @description 预案库详情导出
 * @param {object} data
 */
export const planDetailExport = (data: object) => {
	return request(
		{
			url: '/api/v1/Plan/list/info/export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 预案库删除提交到审核
 * @param {object} data
 */
export const planDelAudit = (data: object) => {
	return request({
		url: '/api/v1/Plan/list/remove',
		method: 'delete',
		data,
	});
};
/**
 * @description 预案库上架
 * @param {string} id
 */
export const planOnShelf = (id: string) => {
	return request({
		url: `/api/v1/Plan/list/onshelf/${id}`,
		method: 'get',
	});
};
/**
 * @description 预案库下架
 * @param {string} id
 */
export const planOffShelf = (id: string) => {
	return request({
		url: `/api/v1/Plan/list/offshelf/${id}`,
		method: 'get',
	});
};
/**
 * @description 查询预案库申请理由
 * @param {string} id
 */
export const planReason = (id: string) => {
	return request({
		url: `/api/v1/Plan/list/reason/${id}`,
		method: 'get',
	});
};
