/*
 * @Author: zc
 * @description 知识库 - 知识管理
 */
import request from '@/utils/request';
/**
 * @description 知识检索（工单）
 * @param {object} params
 * @return {*}
 */
export const knowPopScreen = (params: object) => {
	return request({
		url: '/api/v1/Knowledge/knowpopscreen',
		method: 'get',
		params,
	});
};
/**
 * @description 知识库列表页 基础数据
 * @return {*}
 */
export const baseData = () => {
	return request({
		url: '/api/v1/Knowledge/knowledge-status-data',
		method: 'get',
	});
};
/**
 * @description 知识查询 （所有知识列表）
 * @param {object} params
 * @return {*}
 */
export const KnowledgePaged = (params: object) => {
	return request({
		url: '/api/v1/Knowledge',
		method: 'get',
		params,
	});
};
/**
 * @description 知识库新增
 * @param {object} data
 * @return {*}
 */
export const KnowledgeAdd = (data: object) => {
	return request({
		url: '/api/v1/Knowledge/add',
		method: 'post',
		data,
	});
};
/**
 * @description 知识库修改
 * @param {object} data
 * @return {*}
 */
export const KnowledgeUpdate = (data: object) => {
	return request({
		url: '/api/v1/Knowledge/update',
		method: 'put',
		data,
	});
};
/**
 * @description 知识库删除
 * @param {object} data
 * @return {*}
 */
export const KnowledgeDel = (data: object) => {
	return request({
		url: `/api/v1/Knowledge`,
		method: 'delete',
		data,
	});
};
/**
 * @description 知识库详情 第二个参数传入 {IsAddPv:true} 增加浏览量 查询详情
 * @param {string} Id
 * @param params
 * @return {*}
 */
export const KnowledgeInfo = (Id: string | string[], params?: object) => {
	return request({
		url: `/api/v1/Knowledge/info/${Id}`,
		method: 'get',
		params,
	});
};
/**
 * @description 知识库下架
 * @param {string} data
 * @return {*}
 */
export const KnowledgeOffShelf = (data: object) => {
	return request({
		url: `/api/v1/Knowledge/offshelf`,
		method: 'put',
		data,
	});
};
/*export const KnowledgeOffShelf = (Id: string) => {
	return request({
		url: `/api/v1/Knowledge/offshelf?Id=${Id}`,
		method: 'put',
	});
};*/
/**
 * @description 知识库上架
 * @param {string} Id
 * @return {*}
 */
export const KnowledgeOnTheShelf = (Id: string) => {
	return request({
		url: `/api/v1/Knowledge/ontheshelf?Id=${Id}`,
		method: 'put',
	});
};
/**
 * @description 知识申请-关联知识-获取知识列表
 * @param {object} params
 * @return {*}
 */
export const KnowledgeGetKnowledge = (params?: object) => {
	return request({
		url: `/api/v1/Knowledge/getknowledge`,
		method: 'get',
		params,
	});
};
/**
 * @description  新增-开始流程
 * @param {string} id
 * @param {object} data
 * @return {*}
 */
export const KnowledgeAddStartFlow = (id: object, data: object) => {
	return request({
		url: `/api/v1/Knowledge/${id}/add-startflow`,
		method: 'post',
		data,
	});
};
/**
 * @description  删除-开始流程
 * @param {string} id
 * @param {object} data
 * @return {*}
 */
export const KnowledgeDeleteStartFlow = (id: object, data: object) => {
	return request({
		url: `/api/v1/Knowledge/${id}/remove-startflow`,
		method: 'post',
		data,
	});
};
/**
 * @description  查询知识库办理流程开启参数-新增
 * @return {*}
 */
export const KnowledgeAddStartFlowParams = () => {
	return request({
		url: `/api/v1/Knowledge/add-flow-start`,
		method: 'get',
	});
};
/**
 * @description  查询知识库办理流程开启参数-更新
 * @return {*}
 */
export const KnowledgeUpdateStartFlowParams = () => {
	return request({
		url: `/api/v1/Knowledge/update-flow-start`,
		method: 'get',
	});
};
/**
 * @description  查询知识库办理流程开启参数-删除
 * @return {*}
 */
export const KnowledgeDeleteStartFlowParams = () => {
	return request({
		url: `/api/v1/Knowledge/remove-flow-start`,
		method: 'get',
	});
};
/**
 * @description  查询知识库办理流程开启参数-下架
 * @return {*}
 */
export const KnowledgeOffShelfStartFlowParams = () => {
	return request({
		url: `/api/v1/Knowledge/offshelf-flow-start`,
		method: 'get',
	});
};
/**
 * @description  知识收藏
 * @param {object} data
 * @return {*}
 */
export const knowledgeCollect = (data: object) => {
	return request({
		url: `/api/v1/Knowledge/knowledge_collect`,
		method: 'post',
		data,
	});
};
/**
 * @description  知识收藏
 * @param {object} data
 * @return {*}
 */
export const knowledgeScore = (data: object) => {
	return request({
		url: `/api/v1/Knowledge/knowledge_score`,
		method: 'delete',
		data,
	});
};
/**
 * @description  校验标题是否重复
 * @param {object} params
 * @return {*}
 */
export const knowledgeTitle = (params: object) => {
	return request({
		url: `/api/v1/Knowledge/title`,
		method: 'get',
		params,
	});
};
/**
 * @description  校验知识标题摘要内容是否重复
 * @param {object} data
 * @return {*}
 */
export const knowledgeContent = (data: object) => {
	return request({
		url: `/api/v1/Knowledge/finding_duplicate`,
		method: 'post',
		data,
	});
};
/**
 * @description  获取知识库审批信息
 * @param {object} params
 * @return {*}
 */
export const knowledgeApproval = (params: object) => {
	return request({
		url: `/api/v1/Knowledge/audit_log`,
		method: 'get',
		params,
	});
};
/**
 * @description  知识库管理导出
 * @param {object} data
 * @return {*}
 */
export const knowledgeExport = (data: object) => {
	return request(
		{
			url: `/api/v1/Knowledge/export`,
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description  知识库详情导出
 * @param {object} data
 * @return {*}
 */
export const knowledgeDetailExport = (data: object) => {
	return request(
		{
			url: `/api/v1/Knowledge/info/export`,
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description  根据入参分词返回关键词集合
 * @param {object} params
 * @return {*}
 */
export const knowledgeKeyword = (params: object) => {
	return request({
		url: `/api/v1/Knowledge/participle`,
		method: 'get',
		params,
	});
};
/**
 * @description  知识库批量审核
 * @param {object} data
 * @return {*}
 */
export const knowledgeBatchAudit = (data: object) => {
	return request({
		url: `/api/v1/Knowledge/batch_audit`,
		method: 'post',
		data,
	});
};
