mirror of
https://github.com/kailong321200875/vue-element-plus-admin.git
synced 2025-02-17 11:09:35 +08:00
61 lines
928 B
TypeScript
61 lines
928 B
TypeScript
import { SUCCESS_CODE } from '@/constants'
|
|
|
|
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: '/mock/dict/list',
|
|
method: 'get',
|
|
timeout,
|
|
response: () => {
|
|
return {
|
|
code: SUCCESS_CODE,
|
|
data: dictObj
|
|
}
|
|
}
|
|
},
|
|
// 获取某个字典
|
|
{
|
|
url: '/mock/dict/one',
|
|
method: 'get',
|
|
timeout,
|
|
response: () => {
|
|
return {
|
|
code: SUCCESS_CODE,
|
|
data: [
|
|
{
|
|
label: 'test1',
|
|
value: 0
|
|
},
|
|
{
|
|
label: 'test2',
|
|
value: 1
|
|
},
|
|
{
|
|
label: 'test3',
|
|
value: 2
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|