/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-03 16:31:27
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-03-30 10:30:33
 * @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 ManaIndicItemTableRowType = {
  id:number;
  name:string;
  hospId:string;
  code:string;
  guide:number;
  guideName:string;
  scoreType:number;
  scoreTypeName:string;
  scoreCeiling:number;
  scoreFloor:number;
  dataType:number;
  dataTypeName:number;
  source:number;
  sourceName:string;
}


export const getManaIndicListData = (params?:any) => {
  return request<{
       current:number;
       list:ManaIndicItemTableRowType[];
       pageSize:number;
       totalCount:number;
       totalPage:number;
  }>('/performance/managerIndicator/list', {
    method: 'GET',
    params:{...params}
  });
};


//新增表格数据
export type AddTableDataType = {
  hospId:number;
  code:string;
  name:string;
  guide:number;
  scoreType:number;
  scoreCeiling:number;
  scoreFloor:number;
  dataType:number;
  source:number;
}

export const addData = (data:AddTableDataType) => {
  return request('/performance/managerIndicator/add', {
    method: 'POST',
    data
  });
};



//编辑表格数据

export type ManaIndicItemTableRowEditType = {
  id:number;
  hospId:number;
  code:string;
  name:string;
  guide:number;
  scoreType:number;
  scoreCeiling:number;
  scoreFloor:number;
  dataType:number;
  source:number;
}

export const editData = (data:ManaIndicItemTableRowEditType) => {
  return request('/performance/managerIndicator/edit', {
    method: 'POST',
    data
  });
};

//删除表格操作
export const delData = (id:string) => {
  return request('/performance/managerIndicator/delete', {
    method: 'POST',
    params:{id}
  });
};








