diff --git a/src/api/mock/index.ts b/src/api/mock/index.ts index bf9b2f52..eea66104 100644 --- a/src/api/mock/index.ts +++ b/src/api/mock/index.ts @@ -15,6 +15,7 @@ export const radarUrl = '/mock/radarData' export const heatMapUrl = '/mock/heatMapData' export const scatterBasicUrl = '/mock/scatterBasic' export const mapUrl = '/mock/map' +export const capsuleUrl = '/mock/capsule' export const wordCloudUrl = '/mock/wordCloud' export const treemapUrl = '/mock/treemap' export const threeEarth01Url = '/mock/threeEarth01Data' @@ -82,6 +83,11 @@ const mockObject: MockMethod[] = [ method: RequestHttpEnum.GET, response: () => test.fetchMap }, + { + url: capsuleUrl, + method: RequestHttpEnum.GET, + response: () => test.fetchCapsule + }, { url: wordCloudUrl, method: RequestHttpEnum.GET, diff --git a/src/api/mock/test.mock.ts b/src/api/mock/test.mock.ts index 65afb3d4..3126c69c 100644 --- a/src/api/mock/test.mock.ts +++ b/src/api/mock/test.mock.ts @@ -39,6 +39,22 @@ export default { ] } }, + // 胶囊图 + fetchCapsule:{ + code: 0, + status: 200, + msg: '请求成功', + data: { + dimensions: ['name', 'value'], + "source": [ + { "name": "厦门", "value|0-40": 20 }, + { "name": "南阳", "value|20-60": 40 }, + { "name": "北京", "value|40-80": 60 }, + { "name": "上海", "value|60-100": 80 }, + { "name": "新疆", "value": 100 } + ] + } + }, // 图表 fetchMockData: { code: 0, diff --git a/src/assets/images/chart/charts/capsule.png b/src/assets/images/chart/charts/capsule.png new file mode 100644 index 00000000..e3d6dbd7 Binary files /dev/null and b/src/assets/images/chart/charts/capsule.png differ diff --git a/src/packages/components/Charts/Mores/CapsuleChart/config.ts b/src/packages/components/Charts/Mores/CapsuleChart/config.ts new file mode 100644 index 00000000..46e523f5 --- /dev/null +++ b/src/packages/components/Charts/Mores/CapsuleChart/config.ts @@ -0,0 +1,23 @@ +import { PublicConfigClass } from '@/packages/public' +import { CapsuleChartConfig } from './index' +import { CreateComponentType } from '@/packages/index.d' +import { chartInitConfig } from '@/settings/designSetting' + +import cloneDeep from 'lodash/cloneDeep' +import dataJson from './data.json' + + +export const option = { + dataset:dataJson, + colors: ['#e062ae', '#fb7293', '#e690d1', '#32c5e9', '#96bfff'], + unit: '', + itemHeight:10, + showValue: true +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key: string = CapsuleChartConfig.key + public attr = { ...chartInitConfig,w: 300, h: 200 ,zIndex: -1} + public chartConfig = cloneDeep(CapsuleChartConfig) + public option = cloneDeep(option) +} diff --git a/src/packages/components/Charts/Mores/CapsuleChart/config.vue b/src/packages/components/Charts/Mores/CapsuleChart/config.vue new file mode 100644 index 00000000..f04325e1 --- /dev/null +++ b/src/packages/components/Charts/Mores/CapsuleChart/config.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/packages/components/Charts/Mores/CapsuleChart/data.json b/src/packages/components/Charts/Mores/CapsuleChart/data.json new file mode 100644 index 00000000..206bb50b --- /dev/null +++ b/src/packages/components/Charts/Mores/CapsuleChart/data.json @@ -0,0 +1,10 @@ +{ + "dimensions": ["name", "value"], + "source": [ + { "name": "厦门", "value": 20 }, + { "name": "南阳", "value": 40 }, + { "name": "背景", "value": 60 }, + { "name": "上海", "value": 80 }, + { "name": "新疆", "value": 100 } + ] +} diff --git a/src/packages/components/Charts/Mores/CapsuleChart/index.ts b/src/packages/components/Charts/Mores/CapsuleChart/index.ts new file mode 100644 index 00000000..96c24793 --- /dev/null +++ b/src/packages/components/Charts/Mores/CapsuleChart/index.ts @@ -0,0 +1,15 @@ +import image from '@/assets/images/chart/charts/capsule.png' +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const CapsuleChartConfig: ConfigType = { + key: 'CapsuleChart', + chartKey: 'VCapsuleChart', + conKey: 'VCCapsuleChart', + title: '胶囊柱图', + category: ChatCategoryEnum.MORE, + categoryName: ChatCategoryEnumName.MORE, + package: PackagesCategoryEnum.CHARTS, + chartFrame: ChartFrameEnum.COMMON, + image +} diff --git a/src/packages/components/Charts/Mores/CapsuleChart/index.vue b/src/packages/components/Charts/Mores/CapsuleChart/index.vue new file mode 100644 index 00000000..6532af4f --- /dev/null +++ b/src/packages/components/Charts/Mores/CapsuleChart/index.vue @@ -0,0 +1,223 @@ + + + + diff --git a/src/packages/components/Charts/Mores/index.ts b/src/packages/components/Charts/Mores/index.ts index 7539cf21..1828a518 100644 --- a/src/packages/components/Charts/Mores/index.ts +++ b/src/packages/components/Charts/Mores/index.ts @@ -4,5 +4,7 @@ import { FunnelConfig } from './Funnel/index' import { HeatmapConfig } from './Heatmap/index' import { WaterPoloConfig } from './WaterPolo/index' import { TreeMapConfig } from './TreeMap/index' +import { CapsuleChartConfig } from './CapsuleChart' -export default [ProcessConfig, RadarConfig, FunnelConfig, HeatmapConfig, WaterPoloConfig, TreeMapConfig] + +export default [ProcessConfig, RadarConfig, FunnelConfig, HeatmapConfig, WaterPoloConfig, TreeMapConfig,CapsuleChartConfig] 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 77673eac..5db0c094 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 @@ -75,6 +75,7 @@ import { heatMapUrl, scatterBasicUrl, mapUrl, + capsuleUrl, wordCloudUrl, treemapUrl, threeEarth01Url @@ -122,6 +123,9 @@ const apiList = [ { value: `【地图数据】${mapUrl}` }, + { + value: `【胶囊柱图】${capsuleUrl}` + }, { value: `【词云】${wordCloudUrl}` },