import { BaseListResult, BaseResult, DictionaryData, DictionaryParamsType, EditDictionaryParams, GetDictionaryListParams, } from '@models'; import {request} from './request'; const BASE_URL = '/dictionary'; /** 获取字典列表 */ export function getDictionaryOptions(type: DictionaryParamsType): BaseResult { return request({ method: 'GET', data: {type}, url: `${BASE_URL}/getDictionary`, }); } /** 获取字典分页列表 */ export function getDictionaryList(data: GetDictionaryListParams): BaseListResult { return request({ method: 'GET', data, url: `${BASE_URL}/getDictionaryPage`, }); } /** 获取字典详情内容 */ export function getDictionaryInfo( type: DictionaryParamsType, id: string, ): BaseListResult { return request({ method: 'GET', data: {page: '1', limit: '1', type, tldId: id}, url: `${BASE_URL}/getDictionaryPage`, }); } /** 修改物料字典内容 */ export function editDictionary(data: EditDictionaryParams): BaseResult { return request({ method: 'PUT', data, url: '/materialClass/updateMaterial', }); }