jojotaoo_components 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/maps/heilongjiang.json +25543 -0
  2. package/dist/components/charts/BackgroundCard.vue.d.ts +17 -0
  3. package/dist/components/charts/BackgroundCard.vue.d.ts.map +1 -0
  4. package/dist/components/charts/BackgroundCard.vue.js +140 -0
  5. package/dist/components/charts/BarChart.vue.d.ts +20 -0
  6. package/dist/components/charts/BarChart.vue.d.ts.map +1 -0
  7. package/dist/components/charts/BarChart.vue.js +109 -0
  8. package/dist/components/charts/CustomLegend.vue.d.ts +28 -0
  9. package/dist/components/charts/CustomLegend.vue.d.ts.map +1 -0
  10. package/dist/components/charts/CustomLegend.vue.js +198 -0
  11. package/dist/components/charts/DataFetchManager.vue.d.ts +10 -0
  12. package/dist/components/charts/DataFetchManager.vue.d.ts.map +1 -0
  13. package/dist/components/charts/DataFetchManager.vue.js +127 -0
  14. package/dist/components/charts/DateTimeDisplay.vue.d.ts +17 -0
  15. package/dist/components/charts/DateTimeDisplay.vue.d.ts.map +1 -0
  16. package/dist/components/charts/DateTimeDisplay.vue.js +112 -0
  17. package/dist/components/charts/GroupComponent.vue.d.ts +13 -0
  18. package/dist/components/charts/GroupComponent.vue.d.ts.map +1 -0
  19. package/dist/components/charts/GroupComponent.vue.js +106 -0
  20. package/dist/components/charts/GroupPreview.vue.d.ts +10 -0
  21. package/dist/components/charts/GroupPreview.vue.d.ts.map +1 -0
  22. package/dist/components/charts/GroupPreview.vue.js +76 -0
  23. package/dist/components/charts/HeaderLineChart.vue.d.ts +17 -0
  24. package/dist/components/charts/HeaderLineChart.vue.d.ts.map +1 -0
  25. package/dist/components/charts/HeaderLineChart.vue.js +62 -0
  26. package/dist/components/charts/ImageDisplay.vue.d.ts +17 -0
  27. package/dist/components/charts/ImageDisplay.vue.d.ts.map +1 -0
  28. package/dist/components/charts/ImageDisplay.vue.js +106 -0
  29. package/dist/components/charts/LineChart.vue.d.ts +20 -0
  30. package/dist/components/charts/LineChart.vue.d.ts.map +1 -0
  31. package/dist/components/charts/LineChart.vue.js +116 -0
  32. package/dist/components/charts/MapChart.vue.d.ts +22 -0
  33. package/dist/components/charts/MapChart.vue.d.ts.map +1 -0
  34. package/dist/components/charts/MapChart.vue.js +680 -0
  35. package/dist/components/charts/PieChart.vue.d.ts +20 -0
  36. package/dist/components/charts/PieChart.vue.d.ts.map +1 -0
  37. package/dist/components/charts/PieChart.vue.js +106 -0
  38. package/dist/components/charts/PieGridChart.vue.d.ts +20 -0
  39. package/dist/components/charts/PieGridChart.vue.d.ts.map +1 -0
  40. package/dist/components/charts/PieGridChart.vue.js +214 -0
  41. package/dist/components/charts/RiskScrollList.vue.d.ts +15 -0
  42. package/dist/components/charts/RiskScrollList.vue.d.ts.map +1 -0
  43. package/dist/components/charts/RiskScrollList.vue.js +294 -0
  44. package/dist/components/charts/ScrollList.vue.d.ts +15 -0
  45. package/dist/components/charts/ScrollList.vue.d.ts.map +1 -0
  46. package/dist/components/charts/ScrollList.vue.js +149 -0
  47. package/dist/components/charts/TextDisplay.vue.d.ts +17 -0
  48. package/dist/components/charts/TextDisplay.vue.d.ts.map +1 -0
  49. package/dist/components/charts/TextDisplay.vue.js +209 -0
  50. package/dist/composables/useChartDataFetch.d.ts +18 -0
  51. package/dist/composables/useChartDataFetch.d.ts.map +1 -0
  52. package/dist/composables/useChartDataFetch.js +131 -0
  53. package/dist/composables/useComponentRender.d.ts +20 -0
  54. package/dist/composables/useComponentRender.d.ts.map +1 -0
  55. package/dist/composables/useComponentRender.js +45 -0
  56. package/dist/composables/useDataPondManager.d.ts +20 -0
  57. package/dist/composables/useDataPondManager.d.ts.map +1 -0
  58. package/dist/composables/useDataPondManager.js +105 -0
  59. package/dist/composables/useECharts.d.ts +9 -0
  60. package/dist/composables/useECharts.d.ts.map +1 -0
  61. package/dist/composables/useECharts.js +118 -0
  62. package/dist/composables/useEventListener.d.ts +2 -0
  63. package/dist/composables/useEventListener.d.ts.map +1 -0
  64. package/dist/composables/useEventListener.js +5 -0
  65. package/dist/composables/useId.d.ts +3 -0
  66. package/dist/composables/useId.d.ts.map +1 -0
  67. package/dist/composables/useId.js +6 -0
  68. package/dist/composables/useInteractClear.d.ts +4 -0
  69. package/dist/composables/useInteractClear.d.ts.map +1 -0
  70. package/dist/composables/useInteractClear.js +26 -0
  71. package/dist/composables/useInteractDispatch.d.ts +5 -0
  72. package/dist/composables/useInteractDispatch.d.ts.map +1 -0
  73. package/dist/composables/useInteractDispatch.js +44 -0
  74. package/dist/composables/useInteractFilter.d.ts +5 -0
  75. package/dist/composables/useInteractFilter.d.ts.map +1 -0
  76. package/dist/composables/useInteractFilter.js +24 -0
  77. package/dist/composables/usePollingManager.d.ts +10 -0
  78. package/dist/composables/usePollingManager.d.ts.map +1 -0
  79. package/dist/composables/usePollingManager.js +42 -0
  80. package/dist/composables/useRequestMerge.d.ts +32 -0
  81. package/dist/composables/useRequestMerge.d.ts.map +1 -0
  82. package/dist/composables/useRequestMerge.js +131 -0
  83. package/dist/config/chartThemes.d.ts +26 -0
  84. package/dist/config/chartThemes.d.ts.map +1 -0
  85. package/dist/config/chartThemes.js +221 -0
  86. package/dist/config/componentDefinitions.d.ts +12 -0
  87. package/dist/config/componentDefinitions.d.ts.map +1 -0
  88. package/dist/config/componentDefinitions.js +503 -0
  89. package/dist/index.cjs +1 -0
  90. package/dist/index.css +2 -0
  91. package/dist/index.d.ts +33 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +38 -0
  94. package/dist/stores/dashboard.d.ts +3240 -0
  95. package/dist/stores/dashboard.d.ts.map +1 -0
  96. package/dist/stores/dashboard.js +666 -0
  97. package/dist/stores/utils.d.ts +15 -0
  98. package/dist/stores/utils.d.ts.map +1 -0
  99. package/dist/stores/utils.js +28 -0
  100. package/dist/types/canvas.d.ts +36 -0
  101. package/dist/types/canvas.d.ts.map +1 -0
  102. package/dist/types/canvas.js +1 -0
  103. package/dist/types/component.d.ts +175 -0
  104. package/dist/types/component.d.ts.map +1 -0
  105. package/dist/types/component.js +63 -0
  106. package/dist/types/events.d.ts +43 -0
  107. package/dist/types/events.d.ts.map +1 -0
  108. package/dist/types/events.js +1 -0
  109. package/dist/types/index.d.ts +5 -0
  110. package/dist/types/index.d.ts.map +1 -0
  111. package/dist/types/index.js +4 -0
  112. package/dist/types/request.d.ts +43 -0
  113. package/dist/types/request.d.ts.map +1 -0
  114. package/dist/types/request.js +18 -0
  115. package/package.json +33 -0
@@ -0,0 +1,106 @@
1
+ import { computed, toRef } from 'vue';
2
+ import { useECharts } from '../../composables/useECharts';
3
+ import { useInteractFilter } from '../../composables/useInteractFilter';
4
+ import { DEFAULT_CHART_STYLE } from '../../types';
5
+ const props = withDefaults(defineProps(), {
6
+ componentId: '',
7
+ option: () => ({}),
8
+ width: 400,
9
+ height: 300,
10
+ bgColor: '#1e1e2e',
11
+ chartStyle: undefined,
12
+ });
13
+ const optionRef = toRef(props, 'option');
14
+ const widthRef = toRef(props, 'width');
15
+ const heightRef = toRef(props, 'height');
16
+ const chartStyleRef = computed(() => props.chartStyle ?? DEFAULT_CHART_STYLE);
17
+ const componentIdRef = toRef(props, 'componentId');
18
+ const dimensions = computed(() => optionRef.value.dataset?.dimensions ?? []);
19
+ const source = computed(() => optionRef.value.dataset?.source ?? []);
20
+ const { filteredSource } = useInteractFilter(componentIdRef, dimensions, source);
21
+ const filteredOption = computed(() => {
22
+ const ds = optionRef.value.dataset;
23
+ if (!ds)
24
+ return optionRef.value;
25
+ return {
26
+ ...optionRef.value,
27
+ dataset: { ...ds, source: filteredSource.value },
28
+ };
29
+ });
30
+ const containerBg = computed(() => {
31
+ const cs = chartStyleRef.value;
32
+ if (cs.backgroundOpacity < 1 && cs.backgroundColor !== 'transparent') {
33
+ const h = cs.backgroundColor.replace('#', '');
34
+ const r = parseInt(h.substring(0, 2), 16);
35
+ const g = parseInt(h.substring(2, 4), 16);
36
+ const b = parseInt(h.substring(4, 6), 16);
37
+ return `rgba(${r}, ${g}, ${b}, ${cs.backgroundOpacity})`;
38
+ }
39
+ return props.bgColor || cs.backgroundColor;
40
+ });
41
+ const seriesOption = computed(() => {
42
+ const s = chartStyleRef.value.series;
43
+ const ds = optionRef.value.dataset ?? { dimensions: [], source: [] };
44
+ const outerRadius = s.pieRadius > 0 ? '70%' : '70%';
45
+ const innerRadius = s.pieRadius > 0 ? s.pieRadius + '%' : '0%';
46
+ return {
47
+ type: 'pie',
48
+ name: ds.dimensions?.[1] ?? '',
49
+ radius: [innerRadius, outerRadius],
50
+ center: ['50%', '55%'],
51
+ roseType: s.pieRoseType ? 'area' : undefined,
52
+ data: filteredSource.value.map((item) => ({
53
+ name: item?.[0] ?? '',
54
+ value: item?.[1] ?? 0,
55
+ })),
56
+ label: {
57
+ show: s.showLabel,
58
+ position: s.pieLabelPosition,
59
+ color: s.labelColor,
60
+ fontSize: s.labelFontSize,
61
+ },
62
+ emphasis: {
63
+ itemStyle: {
64
+ shadowBlur: 10,
65
+ shadowOffsetX: 0,
66
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
67
+ },
68
+ },
69
+ itemStyle: {
70
+ borderRadius: 4,
71
+ borderColor: 'transparent',
72
+ borderWidth: 2,
73
+ },
74
+ };
75
+ });
76
+ const { chartRef } = useECharts(filteredOption, widthRef, heightRef, chartStyleRef, seriesOption, 'pie');
77
+ const __VLS_defaults = {
78
+ componentId: '',
79
+ option: () => ({}),
80
+ width: 400,
81
+ height: 300,
82
+ bgColor: '#1e1e2e',
83
+ chartStyle: undefined,
84
+ };
85
+ const __VLS_ctx = {
86
+ ...{},
87
+ ...{},
88
+ ...{},
89
+ ...{},
90
+ };
91
+ let __VLS_components;
92
+ let __VLS_intrinsics;
93
+ let __VLS_directives;
94
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
95
+ ref: "chartRef",
96
+ ...{ class: "pie-chart" },
97
+ ...{ style: ({ backgroundColor: __VLS_ctx.containerBg }) },
98
+ });
99
+ /** @type {__VLS_StyleScopedClasses['pie-chart']} */ ;
100
+ // @ts-ignore
101
+ [containerBg,];
102
+ const __VLS_export = (await import('vue')).defineComponent({
103
+ __typeProps: {},
104
+ props: {},
105
+ });
106
+ export default {};
@@ -0,0 +1,20 @@
1
+ import type { ChartStyleConfig } from '../../types';
2
+ type __VLS_Props = {
3
+ componentId?: string;
4
+ option?: Record<string, any>;
5
+ width?: number;
6
+ height?: number;
7
+ bgColor?: string;
8
+ chartStyle?: ChartStyleConfig;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ bgColor: string;
12
+ height: number;
13
+ option: Record<string, any>;
14
+ chartStyle: ChartStyleConfig;
15
+ width: number;
16
+ componentId: string;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
20
+ //# sourceMappingURL=PieGridChart.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PieGridChart.vue.d.ts","sourceRoot":"","sources":["../../../src/components/charts/PieGridChart.vue"],"names":[],"mappings":"AAqOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAInD,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAC;AAqPF,QAAA,MAAM,YAAY;aAvPN,MAAM;YADP,MAAM;YAFN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gBAIf,gBAAgB;WAHrB,MAAM;iBAFA,MAAM;6EA8PpB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,214 @@
1
+ import { computed, toRef } from 'vue';
2
+ import { useECharts } from '../../composables/useECharts';
3
+ import { useInteractFilter } from '../../composables/useInteractFilter';
4
+ import { DEFAULT_CHART_STYLE } from '../../types';
5
+ import CustomLegend from './CustomLegend.vue';
6
+ const props = withDefaults(defineProps(), {
7
+ componentId: '',
8
+ option: () => ({}),
9
+ width: 400,
10
+ height: 300,
11
+ bgColor: '#1e1e2e',
12
+ chartStyle: undefined,
13
+ });
14
+ const optionRef = toRef(props, 'option');
15
+ const widthRef = toRef(props, 'width');
16
+ const heightRef = toRef(props, 'height');
17
+ const chartStyleRef = computed(() => props.chartStyle ?? DEFAULT_CHART_STYLE);
18
+ const componentIdRef = toRef(props, 'componentId');
19
+ const dimensions = computed(() => optionRef.value.dataset?.dimensions ?? []);
20
+ const source = computed(() => optionRef.value.dataset?.source ?? []);
21
+ const { filteredSource } = useInteractFilter(componentIdRef, dimensions, source);
22
+ const filteredOption = computed(() => {
23
+ const ds = optionRef.value.dataset;
24
+ if (!ds)
25
+ return optionRef.value;
26
+ return {
27
+ ...optionRef.value,
28
+ dataset: { ...ds, source: filteredSource.value },
29
+ legend: { show: false },
30
+ };
31
+ });
32
+ const containerBg = computed(() => {
33
+ const cs = chartStyleRef.value;
34
+ if (cs.backgroundOpacity < 1 && cs.backgroundColor !== 'transparent') {
35
+ const h = cs.backgroundColor.replace('#', '');
36
+ const r = parseInt(h.substring(0, 2), 16);
37
+ const g = parseInt(h.substring(2, 4), 16);
38
+ const b = parseInt(h.substring(4, 6), 16);
39
+ return `rgba(${r}, ${g}, ${b}, ${cs.backgroundOpacity})`;
40
+ }
41
+ return props.bgColor || cs.backgroundColor;
42
+ });
43
+ const filteredData = computed(() => filteredSource.value.map((item) => ({ name: item?.[0] ?? '' })));
44
+ const legendData = computed(() => {
45
+ const total = filteredSource.value.reduce((sum, item) => sum + (Number(item?.[1]) || 0), 0);
46
+ return filteredSource.value.map((item) => ({
47
+ name: item?.[0] ?? '',
48
+ value: item?.[1] ?? 0,
49
+ percent: total > 0 ? ((Number(item?.[1]) / total) * 100).toFixed(1) : '0',
50
+ }));
51
+ });
52
+ const colorList = computed(() => chartStyleRef.value.series.colorList);
53
+ const totalValue = computed(() => filteredSource.value.reduce((sum, item) => sum + (Number(item?.[1]) || 0), 0));
54
+ const seriesOption = computed(() => {
55
+ const s = chartStyleRef.value.series;
56
+ const ds = optionRef.value.dataset ?? { dimensions: [], source: [] };
57
+ const outerRadius = s.pieRadius > 0 ? '70%' : '70%';
58
+ const innerRadius = s.pieRadius > 0 ? s.pieRadius + '%' : '0%';
59
+ return {
60
+ type: 'pie',
61
+ name: ds.dimensions?.[1] ?? '',
62
+ radius: [innerRadius, outerRadius],
63
+ center: ['50%', '50%'],
64
+ roseType: s.pieRoseType ? 'area' : undefined,
65
+ data: filteredSource.value.map((item) => ({
66
+ name: item?.[0] ?? '',
67
+ value: item?.[1] ?? 0,
68
+ })),
69
+ label: {
70
+ show: s.showLabel,
71
+ position: s.pieLabelPosition,
72
+ color: s.labelColor,
73
+ fontSize: s.labelFontSize,
74
+ // formatter: ['{a|{c}}','{b|{b}}'].join('\n'),
75
+ // rich: {
76
+ // a: {
77
+ // fontSize: s.labelFontSize,
78
+ // color: s.labelColor,
79
+ // fontWeight: 900,
80
+ // },
81
+ // b: {
82
+ // fontSize: s.labelFontSize / 2,
83
+ // color: 'gray',
84
+ // lineHeight: 18,
85
+ // padding: [s.labelFontSize / 5, 0, 0, 0],
86
+ // }
87
+ // }
88
+ // formatter: [
89
+ // '{a|{b} ({d}%)}',
90
+ // '{b|这段文本采用样式b}这段用默认样式{x|这段用样式x}'
91
+ // ].join('\n'),
92
+ // rich: {
93
+ // a: {
94
+ // color: 'red',
95
+ // lineHeight: 10
96
+ // },
97
+ // b: {
98
+ // backgroundColor: {
99
+ // image: 'xxx/xxx.jpg'
100
+ // },
101
+ // height: 40
102
+ // },
103
+ // x: {
104
+ // fontSize: 18,
105
+ // fontFamily: 'Microsoft YaHei',
106
+ // borderColor: '#449933',
107
+ // borderRadius: 4
108
+ // },
109
+ // }
110
+ },
111
+ emphasis: {
112
+ focus: 'self',
113
+ itemStyle: {
114
+ shadowBlur: 10,
115
+ shadowOffsetX: 0,
116
+ shadowColor: 'rgba(0, 0, 0, 0.5)',
117
+ },
118
+ },
119
+ blur: {
120
+ itemStyle: {
121
+ opacity: 0.3,
122
+ },
123
+ },
124
+ itemStyle: {
125
+ borderRadius: 0,
126
+ borderColor: 'transparent',
127
+ borderWidth: 2,
128
+ },
129
+ };
130
+ });
131
+ const { chartRef, chartInstance } = useECharts(filteredOption, widthRef, heightRef, chartStyleRef, seriesOption, 'pie');
132
+ const __VLS_defaults = {
133
+ componentId: '',
134
+ option: () => ({}),
135
+ width: 400,
136
+ height: 300,
137
+ bgColor: '#1e1e2e',
138
+ chartStyle: undefined,
139
+ };
140
+ const __VLS_ctx = {
141
+ ...{},
142
+ ...{},
143
+ ...{},
144
+ ...{},
145
+ };
146
+ let __VLS_components;
147
+ let __VLS_intrinsics;
148
+ let __VLS_directives;
149
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
150
+ ...{ class: "pie-grid-chart" },
151
+ ...{ style: ({ backgroundColor: __VLS_ctx.containerBg }) },
152
+ });
153
+ /** @type {__VLS_StyleScopedClasses['pie-grid-chart']} */ ;
154
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
155
+ ...{ class: "chart-area" },
156
+ });
157
+ /** @type {__VLS_StyleScopedClasses['chart-area']} */ ;
158
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
159
+ ref: "chartRef",
160
+ ...{ class: "pie-chart" },
161
+ });
162
+ /** @type {__VLS_StyleScopedClasses['pie-chart']} */ ;
163
+ if (__VLS_ctx.chartStyle?.series.subTitle) {
164
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
165
+ ...{ class: (['center-text', { fontSize: __VLS_ctx.chartStyle.series.labelFontSize }]) },
166
+ });
167
+ /** @type {__VLS_StyleScopedClasses['fontSize']} */ ;
168
+ /** @type {__VLS_StyleScopedClasses['center-text']} */ ;
169
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
170
+ ...{ class: "total-label" },
171
+ });
172
+ /** @type {__VLS_StyleScopedClasses['total-label']} */ ;
173
+ (__VLS_ctx.totalValue);
174
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
175
+ ...{ class: "sub-title" },
176
+ });
177
+ /** @type {__VLS_StyleScopedClasses['sub-title']} */ ;
178
+ (__VLS_ctx.chartStyle.series.subTitle);
179
+ }
180
+ if (__VLS_ctx.chartStyle?.legend.show && __VLS_ctx.chartStyle?.legend.layoutMode === 'grid') {
181
+ const __VLS_0 = CustomLegend;
182
+ // @ts-ignore
183
+ const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
184
+ data: (__VLS_ctx.legendData),
185
+ colorList: (__VLS_ctx.colorList),
186
+ chartInstance: (__VLS_ctx.chartInstance),
187
+ icon: (__VLS_ctx.chartStyle.legend.icon),
188
+ fontSize: (__VLS_ctx.chartStyle.legend.fontSize),
189
+ textColor: (__VLS_ctx.chartStyle.legend.textColor),
190
+ gridColumns: (__VLS_ctx.chartStyle.legend.gridColumns),
191
+ itemGap: (__VLS_ctx.chartStyle.legend.itemGap),
192
+ unit: (__VLS_ctx.chartStyle.legend.unit || ''),
193
+ position: "bottom-flow",
194
+ }));
195
+ const __VLS_2 = __VLS_1({
196
+ data: (__VLS_ctx.legendData),
197
+ colorList: (__VLS_ctx.colorList),
198
+ chartInstance: (__VLS_ctx.chartInstance),
199
+ icon: (__VLS_ctx.chartStyle.legend.icon),
200
+ fontSize: (__VLS_ctx.chartStyle.legend.fontSize),
201
+ textColor: (__VLS_ctx.chartStyle.legend.textColor),
202
+ gridColumns: (__VLS_ctx.chartStyle.legend.gridColumns),
203
+ itemGap: (__VLS_ctx.chartStyle.legend.itemGap),
204
+ unit: (__VLS_ctx.chartStyle.legend.unit || ''),
205
+ position: "bottom-flow",
206
+ }, ...__VLS_functionalComponentArgsRest(__VLS_1));
207
+ }
208
+ // @ts-ignore
209
+ [containerBg, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, chartStyle, totalValue, legendData, colorList, chartInstance,];
210
+ const __VLS_export = (await import('vue')).defineComponent({
211
+ __typeProps: {},
212
+ props: {},
213
+ });
214
+ export default {};
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ option?: Record<string, any>;
3
+ width?: number;
4
+ height?: number;
5
+ riskProps?: Record<string, any>;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ height: number;
9
+ option: Record<string, any>;
10
+ width: number;
11
+ riskProps: Record<string, any>;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ //# sourceMappingURL=RiskScrollList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RiskScrollList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/charts/RiskScrollList.vue"],"names":[],"mappings":"AA6TA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAC;AAmWF,QAAA,MAAM,YAAY;YArWP,MAAM;YAFN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WACpB,MAAM;eAEF,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;6EAuW/B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,294 @@
1
+ import { computed } from 'vue';
2
+ const props = withDefaults(defineProps(), {
3
+ option: () => ({}),
4
+ width: 400,
5
+ height: 400,
6
+ riskProps: () => ({}),
7
+ });
8
+ const rp = computed(() => props.riskProps ?? {});
9
+ const ds = computed(() => props.option?.dataset ?? { dimensions: [], source: [] });
10
+ const source = computed(() => ds.value.source ?? []);
11
+ const doubledSource = computed(() => [...source.value, ...source.value]);
12
+ const scrollSpeed = computed(() => rp.value.scrollSpeed ?? 30);
13
+ const visibleRows = computed(() => rp.value.visibleRows ?? 5);
14
+ const showFooter = computed(() => rp.value.showFooter ?? true);
15
+ const bgColor = computed(() => rp.value.bgColor ?? '#ffffff');
16
+ const borderRadius = computed(() => rp.value.borderRadius ?? 12);
17
+ const borderColor = computed(() => rp.value.borderColor ?? '#e8ecf1');
18
+ const containerBorderWidth = computed(() => rp.value.containerBorderWidth ?? 0);
19
+ const shadow = computed(() => rp.value.shadow ?? '0 1px 4px rgba(0,0,0,0.04)');
20
+ const maxHeight = computed(() => rp.value.maxHeight ?? 500);
21
+ const itemPadding = computed(() => rp.value.itemPadding ?? '16px 24px');
22
+ const itemBorderColor = computed(() => rp.value.itemBorderColor ?? '#f0f2f5');
23
+ const itemBorderWidth = computed(() => rp.value.itemBorderWidth ?? 1);
24
+ const itemBorderRadius = computed(() => rp.value.itemBorderRadius ?? 0);
25
+ const itemBoxBorderColor = computed(() => rp.value.itemBoxBorderColor ?? '#e8ecf1');
26
+ const itemBoxBorderWidth = computed(() => rp.value.itemBoxBorderWidth ?? 0);
27
+ const itemBoxBorderRadius = computed(() => rp.value.itemBoxBorderRadius ?? 8);
28
+ const itemGap = computed(() => rp.value.itemGap ?? 0);
29
+ const itemHoverBg = computed(() => rp.value.itemHoverBg ?? '#fafbfc');
30
+ const dotSize = computed(() => rp.value.dotSize ?? 10);
31
+ const nameFontSize = computed(() => rp.value.nameFontSize ?? 15);
32
+ const nameFontWeight = computed(() => rp.value.nameFontWeight ?? 600);
33
+ const nameColor = computed(() => rp.value.nameColor ?? '#1d2a3a');
34
+ const subFontSize = computed(() => rp.value.subFontSize ?? 13);
35
+ const subColor = computed(() => rp.value.subColor ?? '#6b7a8a');
36
+ const timeColor = computed(() => rp.value.timeColor ?? '#8c9aa8');
37
+ const typeTagBg = computed(() => rp.value.typeTagBg ?? '#f4f6f9');
38
+ const typeTagColor = computed(() => rp.value.typeTagColor ?? '#8c9aa8');
39
+ const footerBg = computed(() => rp.value.footerBg ?? '#fafbfc');
40
+ const footerColor = computed(() => rp.value.footerColor ?? '#8c9aa8');
41
+ const footerFontSize = computed(() => rp.value.footerFontSize ?? 13);
42
+ const footerAlign = computed(() => rp.value.footerAlign ?? 'right');
43
+ // Container padding props
44
+ const containerPaddingTop = computed(() => rp.value.containerPaddingTop ?? 0);
45
+ const containerPaddingRight = computed(() => rp.value.containerPaddingRight ?? 0);
46
+ const containerPaddingBottom = computed(() => rp.value.containerPaddingBottom ?? 0);
47
+ const containerPaddingLeft = computed(() => rp.value.containerPaddingLeft ?? 0);
48
+ // Item background color props
49
+ const itemBgColor = computed(() => rp.value.itemBgColor ?? '#ffffff');
50
+ const itemBgOdd = computed(() => rp.value.itemBgOdd ?? '#fafbfc');
51
+ const itemBgEven = computed(() => rp.value.itemBgEven ?? '#ffffff');
52
+ const useZebra = computed(() => rp.value.useZebra ?? false);
53
+ const riskTypes = computed(() => rp.value.riskTypes ?? []);
54
+ const defaultColor = computed(() => rp.value.defaultColor ?? '#b0bec5');
55
+ const badgeOpacity = computed(() => rp.value.badgeOpacity ?? 0.3);
56
+ function hexToRgba(hex, alpha) {
57
+ const h = hex.replace('#', '');
58
+ const r = parseInt(h.substring(0, 2), 16);
59
+ const g = parseInt(h.substring(2, 4), 16);
60
+ const b = parseInt(h.substring(4, 6), 16);
61
+ return `rgba(${r},${g},${b},${alpha})`;
62
+ }
63
+ function getLevelStyle(level) {
64
+ const found = riskTypes.value.find((t) => t.name === level);
65
+ const color = found?.color ?? defaultColor.value;
66
+ return { color, bg: hexToRgba(color, badgeOpacity.value) };
67
+ }
68
+ function getCell(row, ci) {
69
+ return row[ci] ?? '';
70
+ }
71
+ const totalContentHeight = computed(() => source.value.length * 56);
72
+ const viewportHeight = computed(() => visibleRows.value * 56);
73
+ const duration = computed(() => totalContentHeight.value / scrollSpeed.value);
74
+ const containerStyle = computed(() => ({
75
+ width: '100%',
76
+ height: '100%',
77
+ background: 'tranparent', // || bgColor.value,
78
+ borderRadius: borderRadius.value + 'px',
79
+ border: `${containerBorderWidth.value}px solid ${borderColor.value}`,
80
+ boxShadow: shadow.value,
81
+ overflow: 'hidden',
82
+ display: 'flex',
83
+ flexDirection: 'column',
84
+ fontFamily: "'PingFang SC', 'Microsoft YaHei', sans-serif",
85
+ padding: `${containerPaddingTop.value}px ${containerPaddingRight.value}px ${containerPaddingBottom.value}px ${containerPaddingLeft.value}px`,
86
+ }));
87
+ const viewportStyle = computed(() => ({
88
+ flex: '1',
89
+ overflow: 'hidden',
90
+ }));
91
+ const scrollClass = computed(() => 'scroll-content scroll-animate');
92
+ const scrollContentStyle = computed(() => ({
93
+ '--scroll-duration': duration.value + 's',
94
+ }));
95
+ const useFullBorder = computed(() => rp.value.itemUseFullBorder ?? false);
96
+ const itemStyle = computed(() => {
97
+ const hasBoxBorder = itemBoxBorderWidth.value > 0;
98
+ return {
99
+ display: 'flex',
100
+ alignItems: 'flex-start',
101
+ padding: itemPadding.value,
102
+ ...(hasBoxBorder
103
+ ? { border: `${itemBoxBorderWidth.value}px solid ${itemBoxBorderColor.value}` }
104
+ : useFullBorder.value
105
+ ? { border: `${itemBorderWidth.value}px solid ${itemBorderColor.value}` }
106
+ : { borderBottom: `${itemBorderWidth.value}px solid ${itemBorderColor.value}` }),
107
+ gap: '14px',
108
+ transition: 'background 0.15s',
109
+ cursor: 'default',
110
+ marginBottom: itemGap.value + 'px',
111
+ borderRadius: hasBoxBorder ? itemBoxBorderRadius.value + 'px' : itemBorderRadius.value + 'px',
112
+ };
113
+ });
114
+ const nameStyle = computed(() => ({
115
+ fontWeight: nameFontWeight.value,
116
+ fontSize: nameFontSize.value + 'px',
117
+ color: nameColor.value,
118
+ }));
119
+ const timeStyle = computed(() => ({
120
+ color: timeColor.value,
121
+ fontSize: subFontSize.value + 'px',
122
+ whiteSpace: 'nowrap',
123
+ }));
124
+ function dotStyle(row) {
125
+ const s = getLevelStyle(getCell(row, 1));
126
+ return {
127
+ flexShrink: '0',
128
+ width: dotSize.value + 'px',
129
+ height: dotSize.value + 'px',
130
+ borderRadius: '50%',
131
+ marginTop: '5px',
132
+ background: s.color,
133
+ };
134
+ }
135
+ function badgeStyle(row) {
136
+ const s = getLevelStyle(getCell(row, 1));
137
+ return {
138
+ display: 'inline-flex',
139
+ alignItems: 'center',
140
+ justifyContent: 'center',
141
+ padding: '1px 12px',
142
+ borderRadius: '30px',
143
+ fontSize: '12px',
144
+ fontWeight: '600',
145
+ lineHeight: '22px',
146
+ minWidth: '36px',
147
+ letterSpacing: '0.3px',
148
+ background: s.bg,
149
+ color: s.color,
150
+ };
151
+ }
152
+ function subTagStyle(row) {
153
+ return {
154
+ fontSize: '12px',
155
+ color: typeTagColor.value,
156
+ background: typeTagBg.value,
157
+ padding: '0 10px',
158
+ borderRadius: '30px',
159
+ lineHeight: '22px',
160
+ marginLeft: '6px',
161
+ };
162
+ }
163
+ const riskSubStyle = computed(() => ({
164
+ display: 'flex',
165
+ alignItems: 'center',
166
+ gap: '16px',
167
+ flexWrap: 'wrap',
168
+ fontSize: subFontSize.value + 'px',
169
+ color: subColor.value,
170
+ }));
171
+ const footerStyle = computed(() => ({
172
+ padding: '14px 24px',
173
+ borderTop: `1px solid ${itemBorderColor.value}`,
174
+ display: 'flex',
175
+ justifyContent: footerAlign.value === 'center' ? 'center' : footerAlign.value === 'left' ? 'flex-start' : 'flex-end',
176
+ background: footerBg.value,
177
+ fontSize: footerFontSize.value + 'px',
178
+ color: footerColor.value,
179
+ flexShrink: '0',
180
+ }));
181
+ const __VLS_defaults = {
182
+ option: () => ({}),
183
+ width: 400,
184
+ height: 400,
185
+ riskProps: () => ({}),
186
+ };
187
+ const __VLS_ctx = {
188
+ ...{},
189
+ ...{},
190
+ ...{},
191
+ ...{},
192
+ };
193
+ let __VLS_components;
194
+ let __VLS_intrinsics;
195
+ let __VLS_directives;
196
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
197
+ ...{ class: "risk-scroll-list" },
198
+ ...{ style: (__VLS_ctx.containerStyle) },
199
+ });
200
+ /** @type {__VLS_StyleScopedClasses['risk-scroll-list']} */ ;
201
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
202
+ ...{ class: "scroll-viewport" },
203
+ ...{ style: (__VLS_ctx.viewportStyle) },
204
+ });
205
+ /** @type {__VLS_StyleScopedClasses['scroll-viewport']} */ ;
206
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
207
+ ...{ class: (__VLS_ctx.scrollClass) },
208
+ ...{ style: (__VLS_ctx.scrollContentStyle) },
209
+ });
210
+ for (const [row, ri] of __VLS_vFor((__VLS_ctx.doubledSource))) {
211
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
212
+ key: (ri),
213
+ ...{ class: "risk-list-item" },
214
+ ...{ style: ({
215
+ ...__VLS_ctx.itemStyle,
216
+ '--item-hover-bg': __VLS_ctx.itemHoverBg,
217
+ background: __VLS_ctx.useZebra ? (ri % 2 === 0 ? __VLS_ctx.itemBgOdd : __VLS_ctx.itemBgEven) : __VLS_ctx.itemBgColor,
218
+ }) },
219
+ });
220
+ /** @type {__VLS_StyleScopedClasses['risk-list-item']} */ ;
221
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
222
+ ...{ class: "risk-dot" },
223
+ ...{ style: (__VLS_ctx.dotStyle(row)) },
224
+ });
225
+ /** @type {__VLS_StyleScopedClasses['risk-dot']} */ ;
226
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
227
+ ...{ class: "risk-content" },
228
+ });
229
+ /** @type {__VLS_StyleScopedClasses['risk-content']} */ ;
230
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
231
+ ...{ class: "risk-main" },
232
+ });
233
+ /** @type {__VLS_StyleScopedClasses['risk-main']} */ ;
234
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
235
+ ...{ class: "company-name" },
236
+ ...{ style: (__VLS_ctx.nameStyle) },
237
+ });
238
+ /** @type {__VLS_StyleScopedClasses['company-name']} */ ;
239
+ (__VLS_ctx.getCell(row, 0));
240
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
241
+ ...{ class: "risk-badge" },
242
+ ...{ style: (__VLS_ctx.badgeStyle(row)) },
243
+ });
244
+ /** @type {__VLS_StyleScopedClasses['risk-badge']} */ ;
245
+ (__VLS_ctx.getCell(row, 1) || '未标注');
246
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
247
+ ...{ class: "risk-sub" },
248
+ ...{ style: (__VLS_ctx.riskSubStyle) },
249
+ });
250
+ /** @type {__VLS_StyleScopedClasses['risk-sub']} */ ;
251
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
252
+ ...{ class: "risk-type" },
253
+ });
254
+ /** @type {__VLS_StyleScopedClasses['risk-type']} */ ;
255
+ (__VLS_ctx.getCell(row, 2));
256
+ if (__VLS_ctx.getCell(row, 4)) {
257
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
258
+ ...{ class: "sub-tag" },
259
+ ...{ style: (__VLS_ctx.subTagStyle(row)) },
260
+ });
261
+ /** @type {__VLS_StyleScopedClasses['sub-tag']} */ ;
262
+ (__VLS_ctx.getCell(row, 4));
263
+ }
264
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
265
+ ...{ class: "risk-time" },
266
+ ...{ style: (__VLS_ctx.timeStyle) },
267
+ });
268
+ /** @type {__VLS_StyleScopedClasses['risk-time']} */ ;
269
+ (__VLS_ctx.getCell(row, 3) || '—');
270
+ // @ts-ignore
271
+ [containerStyle, viewportStyle, scrollClass, scrollContentStyle, doubledSource, itemStyle, itemHoverBg, useZebra, itemBgOdd, itemBgEven, itemBgColor, dotStyle, nameStyle, getCell, getCell, getCell, getCell, getCell, getCell, badgeStyle, riskSubStyle, subTagStyle, timeStyle,];
272
+ }
273
+ if (__VLS_ctx.source.length === 0) {
274
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
275
+ ...{ class: "empty-state" },
276
+ });
277
+ /** @type {__VLS_StyleScopedClasses['empty-state']} */ ;
278
+ }
279
+ if (__VLS_ctx.showFooter) {
280
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
281
+ ...{ class: "list-footer" },
282
+ ...{ style: (__VLS_ctx.footerStyle) },
283
+ });
284
+ /** @type {__VLS_StyleScopedClasses['list-footer']} */ ;
285
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
286
+ (__VLS_ctx.source.length);
287
+ }
288
+ // @ts-ignore
289
+ [source, source, showFooter, footerStyle,];
290
+ const __VLS_export = (await import('vue')).defineComponent({
291
+ __typeProps: {},
292
+ props: {},
293
+ });
294
+ export default {};
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ option?: Record<string, any>;
3
+ width?: number;
4
+ height?: number;
5
+ scrollProps?: Record<string, any>;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ height: number;
9
+ option: Record<string, any>;
10
+ width: number;
11
+ scrollProps: Record<string, any>;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ //# sourceMappingURL=ScrollList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrollList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/charts/ScrollList.vue"],"names":[],"mappings":"AAiKA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAClC,CAAC;AAuLF,QAAA,MAAM,YAAY;YAzLP,MAAM;YAFN,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WACpB,MAAM;iBAEA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;6EA2LjC,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}