diff --git a/src/api/mock/index.ts b/src/api/mock/index.ts index eea66104..d924d2cb 100644 --- a/src/api/mock/index.ts +++ b/src/api/mock/index.ts @@ -19,6 +19,7 @@ export const capsuleUrl = '/mock/capsule' export const wordCloudUrl = '/mock/wordCloud' export const treemapUrl = '/mock/treemap' export const threeEarth01Url = '/mock/threeEarth01Data' +export const sankeyUrl = '/mock/sankey' const mockObject: MockMethod[] = [ { @@ -103,6 +104,12 @@ const mockObject: MockMethod[] = [ method: RequestHttpEnum.GET, response: () => test.threeEarth01Data }, + + { + url: sankeyUrl, + method: RequestHttpEnum.GET, + response: () => test.fetchSankey + }, ] export default mockObject diff --git a/src/api/mock/sankey.json b/src/api/mock/sankey.json new file mode 100644 index 00000000..269c6b39 --- /dev/null +++ b/src/api/mock/sankey.json @@ -0,0 +1,86 @@ +{ + "label": [ + { + "name": "a" + }, + { + "name": "b" + }, + { + "name": "a1" + }, + { + "name": "a2" + }, + { + "name": "b1" + }, + { + "name": "b2" + } + ], + "links": [ + { + "source": "a", + "target": "a1", + "value": "@integer(0, 10)" + }, + { + "source": "a", + "target": "a2", + "value": "@integer(0, 10)" + }, + { + "source": "b", + "target": "b1", + "value": "@integer(0, 10)" + }, + { + "source": "a", + "target": "b1", + "value": "@integer(0, 10)" + }, + { + "source": "b1", + "target": "a1", + "value": "@integer(0, 10)" + }, + { + "source": "b1", + "target": "b2", + "value": "@integer(0, 10)" + } + ], + "levels": [ + { + "depth": 0, + "itemStyle": { + "color": "#decbe4" + }, + "lineStyle": { + "color": "source", + "opacity": 0.9 + } + }, + { + "depth": 1, + "itemStyle": { + "color": "#b3cde3" + }, + "lineStyle": { + "color": "source", + "opacity": 0.6 + } + }, + { + "depth": 2, + "itemStyle": { + "color": "#ccebc5" + }, + "lineStyle": { + "color": "source", + "opacity": 0.6 + } + } + ] +} diff --git a/src/api/mock/test.mock.ts b/src/api/mock/test.mock.ts index 9db8cc78..04532871 100644 --- a/src/api/mock/test.mock.ts +++ b/src/api/mock/test.mock.ts @@ -2,6 +2,7 @@ import heatmapJson from './heatMapData.json' import scatterJson from './scatter.json' import mapJson from './map.json' import tTreemapJson from './treemap.json' +import sankeyJson from './sankey.json' export default { // 单图表 @@ -219,5 +220,12 @@ export default { 'endArray|10': [{ name: '@name', N: '@integer(10, 100)', E: '@integer(10, 100)' }] } ] - } + }, + // 桑基图 + fetchSankey: { + code: 0, + status: 200, + msg: '请求成功', + data: sankeyJson + }, } diff --git a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestTargetConfig/index.vue b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestTargetConfig/index.vue index 3b9f92d4..47737c17 100644 --- a/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestTargetConfig/index.vue +++ b/src/views/chart/ContentConfigurations/components/ChartData/components/ChartDataRequest/components/RequestTargetConfig/index.vue @@ -80,7 +80,8 @@ import { capsuleUrl, wordCloudUrl, treemapUrl, - threeEarth01Url + threeEarth01Url, + sankeyUrl } from '@/api/mock' const props = defineProps({ @@ -142,6 +143,9 @@ const apiList = [ }, { value: `【三维地球】${threeEarth01Url}` + }, + { + value: `【桑基图】${sankeyUrl}` } ]