import { baseServer, dict } from '@/api'
import request from '@/utils/require'

// 详情
export function detailsFn(rybh) {
	return request({
		url: `${baseServer}/personnel/${rybh}`,
		method: 'get'
	})
}

// 删除
export function deleteFn(sbbh) {
	return request({
		url: `${baseServer}/personnel/${sbbh}`,
		method: 'delete'
	})
}

// 获取分页列表
export function getPageList(data) {
	let { page, size } = data
	delete data.page
	delete data.size
	return request({
		url: `${baseServer}/personnelPage/${page}/${size}`,
		method: 'post',
		data: data
	})
}

// 新增
export function addFn(params) {
	return request({
		url: `${baseServer}/personnel`,
		method: 'post',
		data: params
	})
}

// 根据 库点编码
export function tyshs(id) {
	return request({
		url: `${baseServer}/sinkpointList/${id}`,
		method: 'get'
	})
}

// 编辑
export function editFn(data) {
	return request({
		url: `${baseServer}/personnel`,
		method: 'put',
		data: data
	})
}
// 启用状态 变更
export function personnelEnabled(data) {
	return request({
		url: `${baseServer}/personnelEnabled`,
		method: 'post',
		data: data
	})
}

// 政治面貌
export function zzmm() {
	return request({
		url: `${dict}/dataDictionary/findByGroupId/ZZ001`,
		method: 'get'
	})
}
