import { AxiosPromise } from 'axios';
import request from '/@/utils/request';
import type { CopyToParams, GetRemarkParams, UpdateRemarkParams, ListConfigsByMonthParams } from './types'
export function AddPaiban(params: object) {
	return request({
		url: '/staff/schedule/add',
		method: 'post',
		data: params,
	});
}
export function deleteIdPaiban(params: string) {
	return request({
		url: '/staff/schedule/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}

export function Add(params: object) {
	return request({
		url: '/staff/schedule/config/add',
		method: 'post',
		data: params,
	});
}
export function update(params: object) {
	return request({
		url: '/staff/schedule/config/update',
		method: 'post',
		data: params,
	});
}
export function deleteId(params: string) {
	return request({
		url: '/staff/schedule/config/delete',
		method: 'post',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
		data: params,
	});
}
export function list(params: object) {
    return request({
      url: '/staff/schedule/config/list',
      method: 'post',
      params
    })
}
export function listWeeksOfYear(params: object) {
    return request({
      url: '/staff/schedule/listWeeksOfYear',
      method: 'post',
      headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
	params,
    })
}
export function listConfigsByWeek(params: object) {
    return request({
      url: '/staff/schedule/listConfigsByWeek',
      method: 'post',
      headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
	params,
    })
}
export function saveUserRemark(params: object) {
    return request({
      url: '/staff/schedule/remark/saveUserRemark',
      method: 'post',
      headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
		},
	params,
    })
}


/**
 * 复制排班
 * @param params 
 * @returns 
 */
export function copyPaiBanToApi(params: CopyToParams): AxiosPromise<void> {
	return request({
		url: '/staff/schedule/copyTo',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
			},
		params
	})
}


/**
 * 获取排班备注
 * @param params 
 * @returns 
 */
export function getRemarkApi(params: GetRemarkParams) {
	return request({
		url: '/staff/schedule/getRemark',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		params
	})
}


/**
 * 更新排班备注
 * @param params 
 * @returns 
 */
export function updateRemarkApi(params: UpdateRemarkParams) {
	return request({
		url: '/staff/schedule/updateRemark',
		method: 'post',
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		params
	})
}

/**
 * 获取医护月排班数据Api
 */
export function listConfigsByMonthApi(params: ListConfigsByMonthParams) {
	return request({
		url: '/staff/schedule/listConfigsByMonth',
		method: 'post',
		params
	})
}