12345678910111213141516171819202122232425262728293031323334 |
- import service from '../../utils/axios'
- // 获取字典列表
- export function getDictionaryList(param) {
- return service.post('/admin/dic/list', param)
- }
- export const getDictionaryById = async (id) => {
- // 模拟 API 调用延迟
- await new Promise(resolve => setTimeout(resolve, 500));
- return {
- id,
- label: `Dictionary ${id}`,
- value: `Value ${id}`,
- typeLabel: 'Type Label',
- typeId: 'Type ID',
- description: 'Description',
- sortNo: 1,
- };
- };
- export const addDictionary = async (data) => {
- // 模拟 API 调用延迟
- await new Promise(resolve => setTimeout(resolve, 500));
- console.log('API: Adding dictionary item', data);
- return { ...data, id: Date.now() };
- };
- export const updateDictionary = async (data) => {
- // 模拟 API 调用延迟
- await new Promise(resolve => setTimeout(resolve, 500));
- console.log('API: Updating dictionary item', data);
- return data;
- };
|