hfn-components 0.3.2 → 0.3.3

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.
@@ -11,6 +11,14 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
11
11
  readonly type: import("vue").PropType<import("hfn-components/es/utils").chartType>;
12
12
  readonly default: "";
13
13
  };
14
+ readonly titleText: {
15
+ readonly type: StringConstructor;
16
+ readonly default: "";
17
+ };
18
+ readonly titleText2: {
19
+ readonly type: StringConstructor;
20
+ readonly default: "";
21
+ };
14
22
  readonly xAxisData: {
15
23
  readonly type: import("vue").PropType<string[]>;
16
24
  readonly default: readonly [];
@@ -31,14 +39,14 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
31
39
  readonly type: NumberConstructor;
32
40
  readonly default: 4;
33
41
  };
34
- readonly titleText: {
35
- readonly type: StringConstructor;
36
- readonly default: "";
37
- };
38
42
  readonly yAxisUnit: {
39
43
  readonly type: StringConstructor;
40
44
  readonly default: "";
41
45
  };
46
+ readonly yAxisObj: {
47
+ readonly type: ObjectConstructor;
48
+ readonly default: () => void;
49
+ };
42
50
  readonly tooltipUnit: {
43
51
  readonly type: StringConstructor;
44
52
  readonly default: "";
@@ -68,13 +76,15 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
68
76
  readonly chartData: any[];
69
77
  readonly chartId: string;
70
78
  readonly chartType: import("hfn-components/es/utils").chartType;
79
+ readonly titleText: string;
80
+ readonly titleText2: string;
71
81
  readonly xAxisData: string[];
72
82
  readonly collation: string;
73
83
  readonly isReturn: boolean;
74
84
  readonly isPercent: boolean;
75
85
  readonly floatNumber: number;
76
- readonly titleText: string;
77
86
  readonly yAxisUnit: string;
87
+ readonly yAxisObj: Record<string, any>;
78
88
  readonly tooltipUnit: string;
79
89
  readonly watchResize: boolean;
80
90
  readonly showLegend: boolean;
@@ -107,6 +117,14 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
107
117
  readonly type: import("vue").PropType<import("hfn-components/es/utils").chartType>;
108
118
  readonly default: "";
109
119
  };
120
+ readonly titleText: {
121
+ readonly type: StringConstructor;
122
+ readonly default: "";
123
+ };
124
+ readonly titleText2: {
125
+ readonly type: StringConstructor;
126
+ readonly default: "";
127
+ };
110
128
  readonly xAxisData: {
111
129
  readonly type: import("vue").PropType<string[]>;
112
130
  readonly default: readonly [];
@@ -127,14 +145,14 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
127
145
  readonly type: NumberConstructor;
128
146
  readonly default: 4;
129
147
  };
130
- readonly titleText: {
131
- readonly type: StringConstructor;
132
- readonly default: "";
133
- };
134
148
  readonly yAxisUnit: {
135
149
  readonly type: StringConstructor;
136
150
  readonly default: "";
137
151
  };
152
+ readonly yAxisObj: {
153
+ readonly type: ObjectConstructor;
154
+ readonly default: () => void;
155
+ };
138
156
  readonly tooltipUnit: {
139
157
  readonly type: StringConstructor;
140
158
  readonly default: "";
@@ -163,13 +181,15 @@ export declare const HtChart: import("hfn-components/es/utils").SFCWithInstall<i
163
181
  readonly chartData: any[];
164
182
  readonly chartId: string;
165
183
  readonly chartType: import("hfn-components/es/utils").chartType;
184
+ readonly titleText: string;
185
+ readonly titleText2: string;
166
186
  readonly xAxisData: string[];
167
187
  readonly collation: string;
168
188
  readonly isReturn: boolean;
169
189
  readonly isPercent: boolean;
170
190
  readonly floatNumber: number;
171
- readonly titleText: string;
172
191
  readonly yAxisUnit: string;
192
+ readonly yAxisObj: Record<string, any>;
173
193
  readonly tooltipUnit: string;
174
194
  readonly watchResize: boolean;
175
195
  readonly showLegend: boolean;
@@ -13,6 +13,14 @@ export declare const chartProps: {
13
13
  readonly type: PropType<chartType>;
14
14
  readonly default: "";
15
15
  };
16
+ readonly titleText: {
17
+ readonly type: StringConstructor;
18
+ readonly default: "";
19
+ };
20
+ readonly titleText2: {
21
+ readonly type: StringConstructor;
22
+ readonly default: "";
23
+ };
16
24
  readonly xAxisData: {
17
25
  readonly type: PropType<string[]>;
18
26
  readonly default: readonly [];
@@ -33,14 +41,14 @@ export declare const chartProps: {
33
41
  readonly type: NumberConstructor;
34
42
  readonly default: 4;
35
43
  };
36
- readonly titleText: {
37
- readonly type: StringConstructor;
38
- readonly default: "";
39
- };
40
44
  readonly yAxisUnit: {
41
45
  readonly type: StringConstructor;
42
46
  readonly default: "";
43
47
  };
48
+ readonly yAxisObj: {
49
+ readonly type: ObjectConstructor;
50
+ readonly default: () => void;
51
+ };
44
52
  readonly tooltipUnit: {
45
53
  readonly type: StringConstructor;
46
54
  readonly default: "";
@@ -15,6 +15,16 @@ const chartProps = {
15
15
  type: String,
16
16
  default: ""
17
17
  },
18
+ //图表标题
19
+ titleText: {
20
+ type: String,
21
+ default: ""
22
+ },
23
+ //图表标题
24
+ titleText2: {
25
+ type: String,
26
+ default: ""
27
+ },
18
28
  //是类目轴时x轴数据
19
29
  xAxisData: {
20
30
  type: Array,
@@ -39,16 +49,17 @@ const chartProps = {
39
49
  type: Number,
40
50
  default: 4
41
51
  },
42
- //y轴文本
43
- titleText: {
44
- type: String,
45
- default: ""
46
- },
47
52
  //Y轴单位
48
53
  yAxisUnit: {
49
54
  type: String,
50
55
  default: ""
51
56
  },
57
+ // Y轴对象
58
+ yAxisObj: {
59
+ type: Object,
60
+ default: () => {
61
+ }
62
+ },
52
63
  //tooltip单位
53
64
  tooltipUnit: {
54
65
  type: String,
@@ -18,6 +18,14 @@ declare const _default: import("vue").DefineComponent<{
18
18
  readonly type: import("vue").PropType<import("hfn-components/es/utils").chartType>;
19
19
  readonly default: "";
20
20
  };
21
+ readonly titleText: {
22
+ readonly type: StringConstructor;
23
+ readonly default: "";
24
+ };
25
+ readonly titleText2: {
26
+ readonly type: StringConstructor;
27
+ readonly default: "";
28
+ };
21
29
  readonly xAxisData: {
22
30
  readonly type: import("vue").PropType<string[]>;
23
31
  readonly default: readonly [];
@@ -38,14 +46,14 @@ declare const _default: import("vue").DefineComponent<{
38
46
  readonly type: NumberConstructor;
39
47
  readonly default: 4;
40
48
  };
41
- readonly titleText: {
42
- readonly type: StringConstructor;
43
- readonly default: "";
44
- };
45
49
  readonly yAxisUnit: {
46
50
  readonly type: StringConstructor;
47
51
  readonly default: "";
48
52
  };
53
+ readonly yAxisObj: {
54
+ readonly type: ObjectConstructor;
55
+ readonly default: () => void;
56
+ };
49
57
  readonly tooltipUnit: {
50
58
  readonly type: StringConstructor;
51
59
  readonly default: "";
@@ -75,13 +83,15 @@ declare const _default: import("vue").DefineComponent<{
75
83
  readonly chartData: any[];
76
84
  readonly chartId: string;
77
85
  readonly chartType: import("hfn-components/es/utils").chartType;
86
+ readonly titleText: string;
87
+ readonly titleText2: string;
78
88
  readonly xAxisData: string[];
79
89
  readonly collation: string;
80
90
  readonly isReturn: boolean;
81
91
  readonly isPercent: boolean;
82
92
  readonly floatNumber: number;
83
- readonly titleText: string;
84
93
  readonly yAxisUnit: string;
94
+ readonly yAxisObj: Record<string, any>;
85
95
  readonly tooltipUnit: string;
86
96
  readonly watchResize: boolean;
87
97
  readonly showLegend: boolean;
@@ -114,6 +124,14 @@ declare const _default: import("vue").DefineComponent<{
114
124
  readonly type: import("vue").PropType<import("hfn-components/es/utils").chartType>;
115
125
  readonly default: "";
116
126
  };
127
+ readonly titleText: {
128
+ readonly type: StringConstructor;
129
+ readonly default: "";
130
+ };
131
+ readonly titleText2: {
132
+ readonly type: StringConstructor;
133
+ readonly default: "";
134
+ };
117
135
  readonly xAxisData: {
118
136
  readonly type: import("vue").PropType<string[]>;
119
137
  readonly default: readonly [];
@@ -134,14 +152,14 @@ declare const _default: import("vue").DefineComponent<{
134
152
  readonly type: NumberConstructor;
135
153
  readonly default: 4;
136
154
  };
137
- readonly titleText: {
138
- readonly type: StringConstructor;
139
- readonly default: "";
140
- };
141
155
  readonly yAxisUnit: {
142
156
  readonly type: StringConstructor;
143
157
  readonly default: "";
144
158
  };
159
+ readonly yAxisObj: {
160
+ readonly type: ObjectConstructor;
161
+ readonly default: () => void;
162
+ };
145
163
  readonly tooltipUnit: {
146
164
  readonly type: StringConstructor;
147
165
  readonly default: "";
@@ -170,13 +188,15 @@ declare const _default: import("vue").DefineComponent<{
170
188
  readonly chartData: any[];
171
189
  readonly chartId: string;
172
190
  readonly chartType: import("hfn-components/es/utils").chartType;
191
+ readonly titleText: string;
192
+ readonly titleText2: string;
173
193
  readonly xAxisData: string[];
174
194
  readonly collation: string;
175
195
  readonly isReturn: boolean;
176
196
  readonly isPercent: boolean;
177
197
  readonly floatNumber: number;
178
- readonly titleText: string;
179
198
  readonly yAxisUnit: string;
199
+ readonly yAxisObj: Record<string, any>;
180
200
  readonly tooltipUnit: string;
181
201
  readonly watchResize: boolean;
182
202
  readonly showLegend: boolean;
@@ -2,7 +2,7 @@ import { defineComponent, shallowRef, ref, reactive, watch } from 'vue';
2
2
  import { BASIC_CHART_CONFIG } from '../../../constants/chartConfig.mjs';
3
3
  import { chartProps } from './HtChart.mjs';
4
4
  import cloneDeep from 'lodash.clonedeep';
5
- import { setEchartXAxis, setEchartYAxis, setEchartTooltip, legendEnterOperate, legendLeaveOperate } from '../../../utils/chart.mjs';
5
+ import { setEchartTitle, setEchartXAxis, setEchartYAxis, setEchartTooltip, legendEnterOperate, legendLeaveOperate } from '../../../utils/chart.mjs';
6
6
  import * as echarts from 'echarts/core';
7
7
 
8
8
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -17,7 +17,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  watch(
18
18
  () => props.chartData,
19
19
  (val) => {
20
- console.log(val);
21
20
  echartOptions.series = cloneDeep(val);
22
21
  drawGraph();
23
22
  },
@@ -47,6 +46,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
47
46
  if (props.lineColor && props.lineColor.length > 0) {
48
47
  echartOptions.color = props.lineColor;
49
48
  }
49
+ setEchartTitle(echartOptions, props);
50
50
  setEchartXAxis(echartOptions, props.chartType, props.xAxisData);
51
51
  setEchartYAxis(echartOptions, props);
52
52
  setEchartTooltip(echartOptions, props);
@@ -511,7 +511,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
511
511
  __epPropKey: true;
512
512
  };
513
513
  readonly disabled: BooleanConstructor;
514
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
514
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
515
515
  readonly icon: {
516
516
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
517
517
  readonly required: false;
@@ -541,7 +541,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
541
541
  __epPropKey: true;
542
542
  };
543
543
  readonly disabled: BooleanConstructor;
544
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
544
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
545
545
  readonly icon: {
546
546
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
547
547
  readonly required: false;
@@ -587,7 +587,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
587
587
  };
588
588
  _ref: import("vue").Ref<HTMLButtonElement | undefined>;
589
589
  _size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
590
- _type: import("vue").ComputedRef<"" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger">;
590
+ _type: import("vue").ComputedRef<"" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger">;
591
591
  _disabled: import("vue").ComputedRef<boolean>;
592
592
  _props: import("vue").ComputedRef<{
593
593
  ariaDisabled: boolean;
@@ -676,7 +676,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
676
676
  __epPropKey: true;
677
677
  };
678
678
  readonly disabled: BooleanConstructor;
679
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
679
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
680
680
  readonly icon: {
681
681
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
682
682
  readonly required: false;
@@ -700,7 +700,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
700
700
  }>> & {
701
701
  onClick?: ((evt: MouseEvent) => any) | undefined;
702
702
  }, {
703
- readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown>;
703
+ readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown>;
704
704
  readonly link: boolean;
705
705
  readonly dark: boolean;
706
706
  readonly disabled: boolean;
@@ -723,7 +723,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
723
723
  readonly validator: ((val: unknown) => boolean) | undefined;
724
724
  __epPropKey: true;
725
725
  };
726
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
726
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
727
727
  }, {
728
728
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
729
729
  readonly size: {
@@ -732,7 +732,7 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
732
732
  readonly validator: ((val: unknown) => boolean) | undefined;
733
733
  __epPropKey: true;
734
734
  };
735
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
735
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
736
736
  }>> & {
737
737
  [x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
738
738
  }>>;
@@ -761,9 +761,9 @@ export declare const HtTarget: import("hfn-components/es/utils").SFCWithInstall<
761
761
  readonly validator: ((val: unknown) => boolean) | undefined;
762
762
  __epPropKey: true;
763
763
  };
764
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
764
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
765
765
  }>>, {
766
- readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown>;
766
+ readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown>;
767
767
  }, {}>;
768
768
  };
769
769
  readonly ElRow: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
@@ -511,7 +511,7 @@ declare const _default: import("vue").DefineComponent<{}, {
511
511
  __epPropKey: true;
512
512
  };
513
513
  readonly disabled: BooleanConstructor;
514
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
514
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
515
515
  readonly icon: {
516
516
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
517
517
  readonly required: false;
@@ -541,7 +541,7 @@ declare const _default: import("vue").DefineComponent<{}, {
541
541
  __epPropKey: true;
542
542
  };
543
543
  readonly disabled: BooleanConstructor;
544
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
544
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
545
545
  readonly icon: {
546
546
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
547
547
  readonly required: false;
@@ -587,7 +587,7 @@ declare const _default: import("vue").DefineComponent<{}, {
587
587
  };
588
588
  _ref: import("vue").Ref<HTMLButtonElement | undefined>;
589
589
  _size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
590
- _type: import("vue").ComputedRef<"" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger">;
590
+ _type: import("vue").ComputedRef<"" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger">;
591
591
  _disabled: import("vue").ComputedRef<boolean>;
592
592
  _props: import("vue").ComputedRef<{
593
593
  ariaDisabled: boolean;
@@ -676,7 +676,7 @@ declare const _default: import("vue").DefineComponent<{}, {
676
676
  __epPropKey: true;
677
677
  };
678
678
  readonly disabled: BooleanConstructor;
679
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
679
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
680
680
  readonly icon: {
681
681
  readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) | ((new (...args: any[]) => (string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>) & {}) | (() => string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any>))[], unknown, unknown>>;
682
682
  readonly required: false;
@@ -700,7 +700,7 @@ declare const _default: import("vue").DefineComponent<{}, {
700
700
  }>> & {
701
701
  onClick?: ((evt: MouseEvent) => any) | undefined;
702
702
  }, {
703
- readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown>;
703
+ readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown>;
704
704
  readonly link: boolean;
705
705
  readonly dark: boolean;
706
706
  readonly disabled: boolean;
@@ -723,7 +723,7 @@ declare const _default: import("vue").DefineComponent<{}, {
723
723
  readonly validator: ((val: unknown) => boolean) | undefined;
724
724
  __epPropKey: true;
725
725
  };
726
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
726
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
727
727
  }, {
728
728
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
729
729
  readonly size: {
@@ -732,7 +732,7 @@ declare const _default: import("vue").DefineComponent<{}, {
732
732
  readonly validator: ((val: unknown) => boolean) | undefined;
733
733
  __epPropKey: true;
734
734
  };
735
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
735
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
736
736
  }>> & {
737
737
  [x: `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
738
738
  }>>;
@@ -761,9 +761,9 @@ declare const _default: import("vue").DefineComponent<{}, {
761
761
  readonly validator: ((val: unknown) => boolean) | undefined;
762
762
  __epPropKey: true;
763
763
  };
764
- readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown, "", boolean>;
764
+ readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown, "", boolean>;
765
765
  }>>, {
766
- readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "success" | "warning" | "info" | "text" | "primary" | "danger", unknown>;
766
+ readonly type: import("element-plus").ButtonType<StringConstructor, "" | "default" | "text" | "success" | "warning" | "info" | "primary" | "danger", unknown>;
767
767
  }, {}>;
768
768
  };
769
769
  readonly ElRow: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
@@ -111,16 +111,16 @@ const TABLE_KEY = {
111
111
  money_name: "\u91D1\u989D\uFF08\u5143\uFF09"
112
112
  };
113
113
  const basicText4 = (val) => {
114
- return val === "-" || val === void 0 ? "-" : val.toFixed(4);
114
+ return typeof val !== "number" ? "-" : val.toFixed(4);
115
115
  };
116
116
  const percentage = (val) => {
117
- return val === "-" || val === void 0 ? "-" : (val * 100).toFixed(2) + "%";
117
+ return typeof val !== "number" ? "-" : (val * 100).toFixed(2) + "%";
118
118
  };
119
119
  const percentage4 = (val) => {
120
- return val === "-" || val === void 0 ? "-" : (val * 100).toFixed(4) + "%";
120
+ return typeof val !== "number" ? "-" : (val * 100).toFixed(4) + "%";
121
121
  };
122
122
  const absPercentage = (val) => {
123
- return val === "-" || val === void 0 ? "-" : Math.abs(val * 100).toFixed(2) + "%";
123
+ return typeof val !== "number" ? "-" : Math.abs(val * 100).toFixed(2) + "%";
124
124
  };
125
125
  const thoundsandText2 = (val) => {
126
126
  return typeof val === "number" ? splitK(dataHandle(val, false, 2)) : "-";
@@ -4,4 +4,5 @@ export declare const legendEnterOperate: (options: any, name: string) => void;
4
4
  export declare const legendLeaveOperate: (options: any) => void;
5
5
  export declare const setEchartXAxis: (options: any, type: chartType, xAxisData: string[]) => void;
6
6
  export declare const setEchartYAxis: (options: any, props: chartProp) => void;
7
+ export declare const setEchartTitle: (options: any, props: chartProp) => void;
7
8
  export declare const setEchartTooltip: (options: any, props: chartProp) => void;
@@ -90,9 +90,28 @@ const setEchartYAxis = (options, props) => {
90
90
  formatter: function(val) {
91
91
  return (props.yAxisUnit === "%" ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + props.yAxisUnit;
92
92
  }
93
- }
93
+ },
94
+ ...props.yAxisObj
94
95
  };
95
96
  };
97
+ const setEchartTitle = (options, props) => {
98
+ options.title = [
99
+ {
100
+ left: "left",
101
+ text: props.titleText,
102
+ itemGap: 0,
103
+ textStyle: {
104
+ fontSize: 12,
105
+ fontWeight: "normal"
106
+ }
107
+ },
108
+ {
109
+ left: "right",
110
+ subtext: props.titleText2,
111
+ itemGap: 0
112
+ }
113
+ ];
114
+ };
96
115
  const setEchartTooltip = (options, props) => {
97
116
  options.tooltip = {
98
117
  trigger: "axis",
@@ -175,4 +194,4 @@ const setEchartTooltip = (options, props) => {
175
194
  };
176
195
  };
177
196
 
178
- export { legendEnterOperate, legendLeaveOperate, setEchartTooltip, setEchartXAxis, setEchartYAxis };
197
+ export { legendEnterOperate, legendLeaveOperate, setEchartTitle, setEchartTooltip, setEchartXAxis, setEchartYAxis };
@@ -1,4 +1,4 @@
1
1
  export { withInstall } from './common.mjs';
2
2
  export { handleData, handleText } from './table.mjs';
3
3
  export { dataHandle, splitK } from './tool.mjs';
4
- export { legendEnterOperate, legendLeaveOperate, setEchartTooltip, setEchartXAxis, setEchartYAxis } from './chart.mjs';
4
+ export { legendEnterOperate, legendLeaveOperate, setEchartTitle, setEchartTooltip, setEchartXAxis, setEchartYAxis } from './chart.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",