/*
 * @Author: zc
 * @description 呼叫中心
 */
import request from '@/utils/request';
/**
 * @description  分机小休原因
 */
export const telRestBaseData = () => {
	return request({
		url: `/api/v1/IPPbx/rest/basedata`,
		method: 'get',
	});
};
/**
 * @description 分机休息（wex）
 */
export const telRestAdd = (data: object) => {
	return request({
		url: `/api/v1/Pbx/rest-add`,
		method: 'post',
		data,
	});
};
/**
 * @description 分机休息wex 需要审核
 * @param {object}  params
 */
export const telRestProcess = (params?: object) => {
	return request({
		url: `/api/v1/Pbx/begin-rest`,
		method: 'get',
		params,
	});
};

/**
 * @description 查询小休流程开启参数
 */
export const restFlowStart = () => {
	return request({
		url: `/api/v1/Pbx/flow-start`,
		method: 'get',
	});
};
/**
 * @description 删除分机休息
 */
export const restFlowDel = () => {
	return request({
		url: `/api/v1/Pbx/rest-del`,
		method: 'get',
	});
};
/**
 * @description 开始小休流程
 * @param {object} data
 */
export const restFlowStartWex = (data: object) => {
	return request({
		url: `/api/v1/Pbx/rest-flow`,
		method: 'post',
		data,
	});
};
/**
 * @description 分机结束休息wex
 */
export const telUnrestWex = () => {
	return request({
		url: `/api/v1/Pbx/un-rest-wex`,
		method: 'get',
	});
};
/*------------------------------呼叫中心--------------------------------------------- */
/**
 * @description 查询呼叫中心所有分机列表
 * @param params
 */
export const getTelList = (params?: object) => {
	return request({
		url: `/api/v1/IPPbx/query-tels`,
		method: 'get',
		params,
	});
};
/**
 * @description 查询呼叫中心黑白名单列表
 * @param params
 */
export const queryBlacklist = (params?: object) => {
	return request({
		url: `/api/v1/IPPbx/query-blacklist`,
		method: 'get',
		params,
	});
};

/**
 * @description 新增呼叫中心黑白名单
 * @param {object} data
 */
export const addBlacklist = (data: object) => {
	return request({
		url: `/api/v1/IPPbx/add-blacklist`,
		method: 'post',
		data,
	});
};
/**
 * @description 删除呼叫中心黑白名单
 * @param {object} data
 */
export const removeBlacklist = (data: object) => {
	return request({
		url: `/api/v1/IPPbx/remove-blacklist`,
		method: 'post',
		data,
	});
};
/**
 * @description 呼叫中心签入
 * @param {object} data
 */
export const dutyOn = (data?: object) => {
	return request({
		url: `/api/v1/IPPbx/on-duty`,
		method: 'post',
		data,
	});
};
/**
 * @description 呼叫中心签出
 * @param {object} data
 */
export const dutyOff = (data?: object) => {
	return request({
		url: `/api/v1/IPPbx/off-duty`,
		method: 'post',
		data,
	});
};
/**
 * @description 呼叫中心开始示忙
 * @param {object} data
 */
export const busyOn = (data?: object) => {
	return request({
		url: `/api/v1/IPPbx/rest`,
		method: 'post',
		data,
	});
};
/**
 * @description 呼叫中结束示忙
 * @param {object} data
 */
export const busyOff = (data?: object) => {
	return request({
		url: `/api/v1/IPPbx/unrest`,
		method: 'post',
		data,
	});
};
/**
 * @description 查询当前用户的分机状态
 */
export const getTelStatus = () => {
	return request({
		url: `/api/v1/IPPbx/tel-state`,
		method: 'get',
	});
};
/**
 * @description 切换呼入呼出模式
 * @param {object} data
 */
export const switchMode = (data?: object) => {
	return request({
		url: `/api/v1/IPPbx/change-telmodel`,
		method: 'post',
		data,
	});
};
/**
 * @description 动作开始 1话后整理 2 保持 4静音
 * @param {object} params
 */
export const startAfterCall = (params:object) => {
	return request({
		url: `/api/v1/IPPbx/callennd-arrange-begin`,
		method: 'get',
		params
	});
};
/**
 * @description 动作结束 1话后整理 2 保持 4静音
 * @param {object} params
 */
export const endAfterCall = (params:object) => {
	return request({
		url: `/api/v1/IPPbx/callend-arrange-end`,
		method: 'get',
		params
	});
};
/**
 * @description 查询今日等待数
 * @param {object} params
 */
export const getTodayWaitNum = (params?:object) => {
	return request({
		url: `/api/v1/IPPbx/query-todaywaitnum`,
		method: 'get',
		params
	});
};