/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-03 16:31:27
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-05-09 14:16:19
 * @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 { Key } from 'react';
import { request } from 'umi';

//获取table列表数据

export type TableItemDataType = {
  unitTypeCode:string,
  unitTypeName:string,
  secondItemMap:any[]
}


export const getData = (params?: any) => {
  return request<TableItemDataType[]>('/performance/item/getUnitTypeSecondItem', {
    method: 'GET',
    params: { ...params }
  });
};

export const gainData = (params?: any) => {
  return request('/performance/item/auto', {
    method: 'GET',
    params: { ...params }
  });
};




//新增表格数据

export const addData = (data:any) => {
  return request('/performance/item/addUnitTypeSecondItem', {
    method: 'POST',
    data
  });
};




//保存评分项
export const saveScoreData = (data:{nonAssessmentCode:string,secondItem:any[]}) => {
  return request('/performance/item/addNonAssessmentSecondItemMap', {
    method: 'POST',
    data
  });
};


//删除表格操作
export const delData = (ids:Key[]) => {
  return request('/performance/item/deleteUnitTypeSecondItem', {
    method: 'POST',
    data:ids
  });
};



//获取穿梭框列表数据
export const getTransferTableData = (unitTypeCode:string) => {
  return request('/performance/item/getSecondItem', {
    method: 'GET',
    params:{unitTypeCode}
  });
};











