2022-03-21 00:57:23 +08:00
|
|
|
import test from './test.mock'
|
2022-03-24 09:19:14 +08:00
|
|
|
import { MockMethod } from 'vite-plugin-mock'
|
|
|
|
import { RequestHttpEnum } from '@/enums/httpEnum'
|
2022-03-21 00:57:23 +08:00
|
|
|
|
|
|
|
// 单个X数据
|
2022-04-02 11:34:54 +08:00
|
|
|
export const chartDataUrl = '/mock/chartData'
|
2022-09-08 20:23:01 +08:00
|
|
|
export const chartSingleDataUrl = '/mock/chartSingleData'
|
2022-06-25 15:51:03 +08:00
|
|
|
export const numberFloatUrl = '/mock/number/float'
|
|
|
|
export const numberIntUrl = '/mock/number/int'
|
|
|
|
export const textUrl = '/mock/text'
|
2022-06-26 15:26:57 +08:00
|
|
|
export const imageUrl = '/mock/image'
|
2022-06-27 20:26:24 +08:00
|
|
|
export const rankListUrl = '/mock/rankList'
|
|
|
|
export const scrollBoardUrl = '/mock/scrollBoard'
|
2022-09-08 17:01:21 +08:00
|
|
|
export const radarUrl = '/mock/radarData'
|
2022-09-17 12:12:22 +08:00
|
|
|
export const heatMapUrl = '/mock/heatMapData'
|
2022-09-17 21:43:20 +08:00
|
|
|
export const scatterBasicUrl = '/mock/scatterBasic'
|
2022-09-25 17:48:51 +08:00
|
|
|
export const mapUrl = '/mock/map'
|
2022-10-27 11:40:53 +08:00
|
|
|
export const capsuleUrl = '/mock/capsule'
|
2022-09-22 09:01:19 +08:00
|
|
|
export const wordCloudUrl = '/mock/wordCloud'
|
2022-09-26 21:18:01 +08:00
|
|
|
export const treemapUrl = '/mock/treemap'
|
2022-10-12 21:08:24 +08:00
|
|
|
export const threeEarth01Url = '/mock/threeEarth01Data'
|
2023-03-30 13:37:07 +08:00
|
|
|
export const sankeyUrl = '/mock/sankey'
|
2023-03-30 16:40:30 +08:00
|
|
|
export const graphUrl = '/mock/graphData'
|
2022-03-21 00:57:23 +08:00
|
|
|
|
2022-04-02 11:34:54 +08:00
|
|
|
const mockObject: MockMethod[] = [
|
|
|
|
{
|
|
|
|
// 正则
|
|
|
|
// url: /\/mock\/mockData(|\?\S*)$/,
|
2022-06-25 15:51:03 +08:00
|
|
|
url: chartDataUrl,
|
2022-04-02 11:34:54 +08:00
|
|
|
method: RequestHttpEnum.GET,
|
2022-06-27 20:26:24 +08:00
|
|
|
response: () => test.fetchMockData
|
2022-04-02 11:34:54 +08:00
|
|
|
},
|
2022-09-08 20:23:01 +08:00
|
|
|
{
|
|
|
|
url: chartSingleDataUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchMockSingleData
|
|
|
|
},
|
2022-05-02 23:33:39 +08:00
|
|
|
{
|
2022-06-25 15:51:03 +08:00
|
|
|
url: numberFloatUrl,
|
2022-05-02 23:33:39 +08:00
|
|
|
method: RequestHttpEnum.GET,
|
2022-06-27 20:26:24 +08:00
|
|
|
response: () => test.fetchNumberFloat
|
2022-06-25 15:51:03 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
url: numberIntUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
2022-06-27 20:26:24 +08:00
|
|
|
response: () => test.fetchNumberInt
|
2022-06-25 15:51:03 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
url: textUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
2022-06-27 20:26:24 +08:00
|
|
|
response: () => test.fetchText
|
2022-05-02 23:33:39 +08:00
|
|
|
},
|
2022-06-26 15:26:57 +08:00
|
|
|
{
|
|
|
|
url: imageUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
2022-06-27 20:26:24 +08:00
|
|
|
response: () => test.fetchImage(Math.round(Math.random() * 10))
|
2022-06-26 15:26:57 +08:00
|
|
|
},
|
2022-06-27 20:26:24 +08:00
|
|
|
{
|
|
|
|
url: rankListUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchRankList
|
|
|
|
},
|
|
|
|
{
|
|
|
|
url: scrollBoardUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchScrollBoard
|
2022-09-08 17:01:21 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
url: radarUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchRadar
|
|
|
|
},
|
2022-09-17 12:12:22 +08:00
|
|
|
{
|
|
|
|
url: heatMapUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchHeatmap
|
2022-09-17 21:43:20 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
url: scatterBasicUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchScatterBasic
|
|
|
|
},
|
2022-09-25 17:48:51 +08:00
|
|
|
{
|
|
|
|
url: mapUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchMap
|
|
|
|
},
|
2022-10-27 11:40:53 +08:00
|
|
|
{
|
|
|
|
url: capsuleUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchCapsule
|
|
|
|
},
|
2022-09-25 22:10:42 +08:00
|
|
|
{
|
2022-09-22 09:01:19 +08:00
|
|
|
url: wordCloudUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchWordCloud
|
2022-09-26 21:18:01 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
url: treemapUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchTreemap
|
|
|
|
},
|
2022-10-12 21:08:24 +08:00
|
|
|
{
|
|
|
|
url: threeEarth01Url,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.threeEarth01Data
|
|
|
|
},
|
2023-03-30 13:37:07 +08:00
|
|
|
{
|
|
|
|
url: sankeyUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.fetchSankey
|
|
|
|
},
|
2023-03-30 16:40:30 +08:00
|
|
|
{
|
|
|
|
url: graphUrl,
|
|
|
|
method: RequestHttpEnum.GET,
|
|
|
|
response: () => test.graphData
|
|
|
|
},
|
2022-04-02 11:34:54 +08:00
|
|
|
]
|
2022-03-24 09:19:14 +08:00
|
|
|
|
2022-04-02 11:34:54 +08:00
|
|
|
export default mockObject
|