hfn-components 0.2.1 → 0.2.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.
@@ -34,9 +34,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  () => props.lineColor,
35
35
  () => {
36
36
  echartOptions.color = props.lineColor;
37
- echartInit();
37
+ if (myChart.value) {
38
+ echartInit();
39
+ }
38
40
  },
39
- { deep: true }
41
+ { deep: true, immediate: true }
40
42
  );
41
43
  const drawGraph = () => {
42
44
  echartOptions.color = props.lineColor;
@@ -62,7 +64,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
62
64
  setTimeout(() => {
63
65
  if (!myChart.value) {
64
66
  const ele = document.getElementById(props.chartId);
65
- myChart.value = echarts.init(ele, null, { devicePixelRatio: 2 });
67
+ myChart.value = echarts.init(ele, null, { devicePixelRatio: 2, locale: "ZH" });
66
68
  }
67
69
  myChart.value.setOption(echartOptions, true);
68
70
  }, 200);
@@ -653,7 +653,7 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
653
653
  readonly convertKey: (data: any, key: string) => any;
654
654
  ColumnDeal: import("vue").DefineComponent<{
655
655
  readonly dealType: {
656
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
656
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
657
657
  readonly default: "";
658
658
  };
659
659
  readonly text: {
@@ -662,7 +662,7 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
662
662
  };
663
663
  }, {
664
664
  props: import("@vue/shared").LooseRequired<{
665
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
665
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
666
666
  readonly text?: string | number | undefined;
667
667
  } & {}>;
668
668
  readonly CLOUMN_DEAL: {
@@ -670,11 +670,12 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
670
670
  colorText: (val: string | number | undefined) => string;
671
671
  colorPercentage: (val: string | number | undefined) => string;
672
672
  percentage: (val: string | number | undefined) => string;
673
+ absPercentage: (val: string | number | undefined) => string;
673
674
  notProcessed: null;
674
675
  };
675
676
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
676
677
  readonly dealType: {
677
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
678
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
678
679
  readonly default: "";
679
680
  };
680
681
  readonly text: {
@@ -683,7 +684,7 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
683
684
  };
684
685
  }>>, {
685
686
  readonly text: string | number | undefined;
686
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
687
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
687
688
  }, {}>;
688
689
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
689
690
  readonly dataSource: {
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  readonly dealType: {
3
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
3
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
4
4
  readonly default: "";
5
5
  };
6
6
  readonly text: {
@@ -9,7 +9,7 @@ declare const _default: import("vue").DefineComponent<{
9
9
  };
10
10
  }, {
11
11
  props: import("@vue/shared").LooseRequired<{
12
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
12
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
13
13
  readonly text?: string | number | undefined;
14
14
  } & {}>;
15
15
  readonly CLOUMN_DEAL: {
@@ -17,11 +17,12 @@ declare const _default: import("vue").DefineComponent<{
17
17
  colorText: (val: string | number | undefined) => string;
18
18
  colorPercentage: (val: string | number | undefined) => string;
19
19
  percentage: (val: string | number | undefined) => string;
20
+ absPercentage: (val: string | number | undefined) => string;
20
21
  notProcessed: null;
21
22
  };
22
23
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
24
  readonly dealType: {
24
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
25
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
25
26
  readonly default: "";
26
27
  };
27
28
  readonly text: {
@@ -30,6 +31,6 @@ declare const _default: import("vue").DefineComponent<{
30
31
  };
31
32
  }>>, {
32
33
  readonly text: string | number | undefined;
33
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
34
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
34
35
  }, {}>;
35
36
  export default _default;
@@ -26,7 +26,7 @@ export declare const elTableProps: {
26
26
  };
27
27
  export declare const columnDealProps: {
28
28
  readonly dealType: {
29
- readonly type: PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
29
+ readonly type: PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
30
30
  readonly default: "";
31
31
  };
32
32
  readonly text: {
@@ -653,7 +653,7 @@ declare const _default: import("vue").DefineComponent<{
653
653
  readonly convertKey: (data: any, key: string) => any;
654
654
  ColumnDeal: import("vue").DefineComponent<{
655
655
  readonly dealType: {
656
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
656
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
657
657
  readonly default: "";
658
658
  };
659
659
  readonly text: {
@@ -662,7 +662,7 @@ declare const _default: import("vue").DefineComponent<{
662
662
  };
663
663
  }, {
664
664
  props: import("@vue/shared").LooseRequired<{
665
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
665
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
666
666
  readonly text?: string | number | undefined;
667
667
  } & {}>;
668
668
  readonly CLOUMN_DEAL: {
@@ -670,11 +670,12 @@ declare const _default: import("vue").DefineComponent<{
670
670
  colorText: (val: string | number | undefined) => string;
671
671
  colorPercentage: (val: string | number | undefined) => string;
672
672
  percentage: (val: string | number | undefined) => string;
673
+ absPercentage: (val: string | number | undefined) => string;
673
674
  notProcessed: null;
674
675
  };
675
676
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
676
677
  readonly dealType: {
677
- readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed">;
678
+ readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed">;
678
679
  readonly default: "";
679
680
  };
680
681
  readonly text: {
@@ -683,7 +684,7 @@ declare const _default: import("vue").DefineComponent<{
683
684
  };
684
685
  }>>, {
685
686
  readonly text: string | number | undefined;
686
- readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "notProcessed";
687
+ readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "absPercentage" | "notProcessed";
687
688
  }, {}>;
688
689
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
689
690
  readonly dataSource: {
@@ -52,6 +52,7 @@ export declare const CLOUMN_DEAL: {
52
52
  colorText: (val: number | string | undefined) => string;
53
53
  colorPercentage: (val: number | string | undefined) => string;
54
54
  percentage: (val: number | string | undefined) => string;
55
+ absPercentage: (val: number | string | undefined) => string;
55
56
  notProcessed: null;
56
57
  };
57
58
  export declare const convertKey: (data: any, key: string) => any;
@@ -53,11 +53,15 @@ const basicText4 = (val) => {
53
53
  const percentage = (val) => {
54
54
  return val === "-" || val === void 0 ? "-" : (val * 100).toFixed(2) + "%";
55
55
  };
56
+ const absPercentage = (val) => {
57
+ return val === "-" || val === void 0 ? "-" : Math.abs(val * 100).toFixed(2) + "%";
58
+ };
56
59
  const CLOUMN_DEAL = {
57
60
  basicText4,
58
61
  colorText: basicText4,
59
62
  colorPercentage: percentage,
60
63
  percentage,
64
+ absPercentage,
61
65
  notProcessed: null
62
66
  };
63
67
  const convertKey = (data, key) => {
@@ -131,7 +131,16 @@ const setEchartTooltip = (options, props) => {
131
131
  ">
132
132
  </span>`;
133
133
  if (props.isReturn) {
134
- html += `<span style='color:${params[i].color}'>${params[i].seriesName}</span>\uFF1A${params[i].value[2]?.toFixed(props.floatNumber)}\uFF08${params[i].value[1] > 0 ? "+" : ""}${params[i].value[1]}%\uFF09`;
134
+ if (
135
+ // params[i].seriesId === 'excess' ||
136
+ params[i].seriesName === "\u7D2F\u8BA1\u8D85\u989D"
137
+ ) {
138
+ html += `<span style='color:${params[i].color}'>
139
+ ${params[i].seriesName}</span>\uFF1A${params[i].value[1].toFixed(2)}%
140
+ `;
141
+ } else {
142
+ html += `<span style='color:${params[i].color}'>${params[i].seriesName}</span>\uFF1A${params[i].value[2]?.toFixed(props.floatNumber)}\uFF08${params[i].value[1] > 0 ? "+" : ""}${params[i].value[1]}%\uFF09`;
143
+ }
135
144
  } else {
136
145
  if (props.chartType === "category") {
137
146
  html += `<span style='color:${params[i].color}'>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfn-components",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "module": "es/index.mjs",