index.ts
1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { defHttp } from '@/utils/external/http/axios'
import { DictItem, UploadResponse } from './model'
enum Api {
GET_DICT = '/dict_item',
UPLOAD = '/oss/upload',
DOWNLOAD = '/oss/download_file/',
AREALIST = '/area/list',
PLATFORM = '/platform/get',
CONFIGURATION = '/configuration/center'
}
export const getDictItemByCode = (value: string) => {
return defHttp.post<DictItem[]>({
url: `${Api.GET_DICT}/find`,
params: {
dictCode: value
}
})
}
export const upload = (file: FormData) => {
return defHttp.post<UploadResponse>({
url: Api.UPLOAD,
params: file
})
}
export const downloadFile = (fileName: string) => {
return defHttp.get({ url: `${Api.DOWNLOAD}${fileName}` })
}
//获取区域
export const getAreaList = (data: object) => {
return defHttp.post<any>({
url: Api.AREALIST,
data
})
}
//获取企业定制
export const getPlatformInfo = () => defHttp.get({ url: Api.PLATFORM })
//获取组态列表
export const getConfigurationList = (params: object) => {
return defHttp.get({ url: `${Api.CONFIGURATION}`, params })
}