/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-03 16:31:27
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-04-12 17:24:01
 * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */



import { request } from 'umi';

//获取table列表数据

export type PositionLevelRateTableRowType = {
  positionLevelCode:string,
  positionLevelName:string,
  positionLevelRate:string,
  position:{
    code:string,
    name:string
  }[]
}


export const getData = () => {
  return request<PositionLevelRateTableRowType[]>('/performance/setting/getPositionLevel', {
    method: 'GET',
  });
};


//获取岗位字典数据

export const getPositionDicData = () => {
  return request('/performance/setting/getCenterPositionList', {
    method: 'GET',
  });
};

//保存

export type SavePositionLevelDataType= {
  positionLevelCode:string,
  positionLevelName:string,
  positionLevelRate:string,
  position:{
    code:string,
    name:string
  }[]
}

export const savePositionLevel = (data:SavePositionLevelDataType) => {
  return request('/performance/setting/addPositionLevel', {
    method: 'POST',
    data
  });
};












