/*
 * @Author: zc
 * @description 知识管理
 * @version:
 * @Date: 2022-08-09 16:19:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-15 10:21:44
 */
import request from '/@/utils/request';
/**
 * @description 获取热词（工单）
 * @return {*}
 */
export const getKeyWord = () => {
	return request({
		url: '/api/v1/Knowledge/getkeyword',
		method: 'get',
	});
};
/**
 * @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} params
 * @return {*}
 */
  export const myDraftsList = (params: object) => {
	return request({
		url: '/api/v1/Knowledge/mydraftslist',
		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 {string} id
 * @return {*}
 */
export const KnowledgeDel = (id: string) => {
	return request({
		url: `/api/v1/Knowledge/${id}`,
		method: 'delete',
	});
};
/**
 * @description 知识库详情
 * @param {string} Id
 * @return {*}
 */
export const KnowledgeDetail = (Id: string | string[]) => {
	return request({
		url: `/api/v1/Knowledge/updateinfo/${Id}`,
		method: 'get',
	});
};
/**
 * @description 知识库详情 第二个参数传入 {IsAddPv:1} 增加浏览量 查询详情
 * @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} Id
 * @return {*}
 */
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  我的知识删除列表 基础数据
 * @return {*}
 */
export const deleteBase = () => {
	return request({
		url: `/api/v1/Knowledge/delete-status-data`,
		method: 'get'
	});
};
/**
 * @description  我的知识删除列表
 * @param {object} params
 * @return {*}
 */
export const KnowledgeDeleteList = (params: object) => {
	return request({
		url: `/api/v1/Knowledge/deletelist`,
		method: 'get',
		params
	});
};
/**
 * @description  审核管理列表 基础数据
 * @return {*}
 */
export const approvedBaseData = () => {
	return request({
		url: `/api/v1/Knowledge/approval-base-data`,
		method: 'get'
	});
};
/**
 * @description  审核管理列表
 * @param {object} params
 * @return {*}
 */
export const KnowledgeApprovedList = (params: object) => {
	return request({
		url: `/api/v1/Knowledge/approvedlist`,
		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 KnowledgeDeleteStartFlowParams = () => {
	return request({
		url: `/api/v1/Knowledge/remove-flow-start`,
		method: 'get'
	});
};