/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-07 11:12:10
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-03-22 14:50:23
 * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicMana/service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */




import { request } from 'umi';



//获取表格数据

export type BusinessDicTableData = {
  id:number;
  hospId:number;
  code:string;
  name:string;
  value:string;
  typeCode:string;
  dictSort:string;
  defaultFlag:number;
  reserved1:string;
  reserved2:string;
}

export const getBusinessDicTableData = (params:BusinessDicTableData) => {
    return request('/performance/dict/getDictDataList', {
      method: 'GET',
      params:{...params}
    });
};


//新增表格数据

export type AddBusinessDicTableData = {
  hospId:number;
  code:string;
  name:string;
  value:string;
  typeCode:string;
  dictSort:string;
  defaultFlag:number;
  reserved1:string;
  reserved2:string;
}

export const addBusinessDicTableData = (data:AddBusinessDicTableData) => {
    return request('/performance/dict/addData', {
      method: 'POST',
      data
    });
};

//编辑表格数据

export const editPubDicRelaTbaleData = (data:BusinessDicTableData) => {
    return request('/performance/dict/editData', {
      method: 'POST',
      data
    });
};


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


//获取职类

export type JobCateoryType = {
    
}

export const  getJobCateory= () => {
  return request<JobCateoryType[]>('/performance/dict/getDictTypeList', {
    method: 'GET',
  });
};