feat: add useCrudSchemas hook

This commit is contained in:
陈凯龙
2022-04-26 15:03:48 +08:00
parent ab0f59ac91
commit 00d947e2f8
11 changed files with 468 additions and 162 deletions

63
mock/dict/index.ts Normal file
View File

@@ -0,0 +1,63 @@
import { config } from '@/config/axios/config'
import { MockMethod } from 'vite-plugin-mock'
const { result_code } = config
const timeout = 1000
const dictObj: Recordable = {
importance: [
{
value: 0,
label: 'tableDemo.commonly'
},
{
value: 1,
label: 'tableDemo.good'
},
{
value: 2,
label: 'tableDemo.important'
}
]
}
export default [
// 字典接口
{
url: '/dict/list',
method: 'get',
timeout,
response: () => {
return {
code: result_code,
data: dictObj
}
}
},
// 获取某个字典
{
url: '/dict/one',
method: 'get',
timeout,
response: () => {
return {
code: result_code,
data: [
{
label: 'test1',
value: 0
},
{
label: 'test2',
value: 1
},
{
label: 'test3',
value: 2
}
]
}
}
}
] as MockMethod[]