hfn-components 0.3.0 → 0.3.2
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.
- package/es/components/chart/src/HtChart.vue.mjs +1 -1
- package/es/components/elTable/index.d.ts +23 -7
- package/es/components/elTable/src/columnDeal.vue.d.ts +23 -7
- package/es/components/elTable/src/columnDeal.vue.mjs +14 -10
- package/es/components/elTable/src/columnDeal.vue2.mjs +1 -2
- package/es/components/elTable/src/elTable.d.ts +10 -1
- package/es/components/elTable/src/elTable.mjs +10 -0
- package/es/components/elTable/src/elTable.vue.d.ts +23 -7
- package/es/components/elTable/src/elTable.vue.mjs +5 -3
- package/es/components/htTarget/src/htTarget.vue.mjs +1 -1
- package/es/components/pieChart/src/HtPieChart.vue.mjs +1 -1
- package/es/components/pieChart/src/HtPieChart.vue2.mjs +2 -3
- package/es/components/table/HtTable.vue.mjs +1 -1
- package/es/constants/chartConfig.d.ts +1 -1
- package/es/constants/chartConfig.mjs +4 -4
- package/es/constants/index.mjs +1 -1
- package/es/constants/table.d.ts +2 -0
- package/es/constants/table.mjs +6 -1
- package/es/css/index.css +59 -0
- package/es/utils/chart.mjs +1 -1
- package/package.json +1 -1
|
@@ -85,6 +85,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
85
85
|
$setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
|
|
86
86
|
]);
|
|
87
87
|
}
|
|
88
|
-
var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
88
|
+
var chart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/chart/src/HtChart.vue"]]);
|
|
89
89
|
|
|
90
90
|
export { chart as default };
|
|
@@ -708,18 +708,22 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
|
|
|
708
708
|
readonly convertKey: (data: any, key: string) => any;
|
|
709
709
|
ColumnDeal: import("vue").DefineComponent<{
|
|
710
710
|
readonly dealType: {
|
|
711
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
711
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
712
712
|
readonly default: "";
|
|
713
713
|
};
|
|
714
714
|
readonly text: {
|
|
715
715
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
716
716
|
readonly default: undefined;
|
|
717
717
|
};
|
|
718
|
+
readonly dealFunction: {
|
|
719
|
+
readonly type: FunctionConstructor;
|
|
720
|
+
readonly default: () => void;
|
|
721
|
+
};
|
|
722
|
+
readonly row: {
|
|
723
|
+
readonly type: ObjectConstructor;
|
|
724
|
+
readonly default: () => void;
|
|
725
|
+
};
|
|
718
726
|
}, {
|
|
719
|
-
props: import("@vue/shared").LooseRequired<{
|
|
720
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
721
|
-
readonly text?: string | number | undefined;
|
|
722
|
-
} & {}>;
|
|
723
727
|
readonly CLOUMN_DEAL: {
|
|
724
728
|
basicText4: (val: string | number | undefined) => string;
|
|
725
729
|
colorText: (val: string | number | undefined) => string;
|
|
@@ -728,21 +732,33 @@ export declare const HtElTable: import("hfn-components/es/utils").SFCWithInstall
|
|
|
728
732
|
percentage4: (val: string | number | undefined) => string;
|
|
729
733
|
absPercentage: (val: string | number | undefined) => string;
|
|
730
734
|
thoundsandText2: (val: string | number | undefined) => string;
|
|
735
|
+
thoundsandText4: (val: string | number | undefined) => string;
|
|
731
736
|
notProcessed: null;
|
|
732
737
|
other: null;
|
|
738
|
+
customDeal: null;
|
|
733
739
|
};
|
|
734
740
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
735
741
|
readonly dealType: {
|
|
736
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
742
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
737
743
|
readonly default: "";
|
|
738
744
|
};
|
|
739
745
|
readonly text: {
|
|
740
746
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
741
747
|
readonly default: undefined;
|
|
742
748
|
};
|
|
749
|
+
readonly dealFunction: {
|
|
750
|
+
readonly type: FunctionConstructor;
|
|
751
|
+
readonly default: () => void;
|
|
752
|
+
};
|
|
753
|
+
readonly row: {
|
|
754
|
+
readonly type: ObjectConstructor;
|
|
755
|
+
readonly default: () => void;
|
|
756
|
+
};
|
|
743
757
|
}>>, {
|
|
744
758
|
readonly text: string | number | undefined;
|
|
745
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
759
|
+
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal";
|
|
760
|
+
readonly dealFunction: Function;
|
|
761
|
+
readonly row: Record<string, any>;
|
|
746
762
|
}, {}>;
|
|
747
763
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
748
764
|
readonly dataSource: {
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
readonly dealType: {
|
|
3
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
3
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
4
4
|
readonly default: "";
|
|
5
5
|
};
|
|
6
6
|
readonly text: {
|
|
7
7
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
8
8
|
readonly default: undefined;
|
|
9
9
|
};
|
|
10
|
+
readonly dealFunction: {
|
|
11
|
+
readonly type: FunctionConstructor;
|
|
12
|
+
readonly default: () => void;
|
|
13
|
+
};
|
|
14
|
+
readonly row: {
|
|
15
|
+
readonly type: ObjectConstructor;
|
|
16
|
+
readonly default: () => void;
|
|
17
|
+
};
|
|
10
18
|
}, {
|
|
11
|
-
props: import("@vue/shared").LooseRequired<{
|
|
12
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
13
|
-
readonly text?: string | number | undefined;
|
|
14
|
-
} & {}>;
|
|
15
19
|
readonly CLOUMN_DEAL: {
|
|
16
20
|
basicText4: (val: string | number | undefined) => string;
|
|
17
21
|
colorText: (val: string | number | undefined) => string;
|
|
@@ -20,20 +24,32 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
20
24
|
percentage4: (val: string | number | undefined) => string;
|
|
21
25
|
absPercentage: (val: string | number | undefined) => string;
|
|
22
26
|
thoundsandText2: (val: string | number | undefined) => string;
|
|
27
|
+
thoundsandText4: (val: string | number | undefined) => string;
|
|
23
28
|
notProcessed: null;
|
|
24
29
|
other: null;
|
|
30
|
+
customDeal: null;
|
|
25
31
|
};
|
|
26
32
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
33
|
readonly dealType: {
|
|
28
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
34
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
29
35
|
readonly default: "";
|
|
30
36
|
};
|
|
31
37
|
readonly text: {
|
|
32
38
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
33
39
|
readonly default: undefined;
|
|
34
40
|
};
|
|
41
|
+
readonly dealFunction: {
|
|
42
|
+
readonly type: FunctionConstructor;
|
|
43
|
+
readonly default: () => void;
|
|
44
|
+
};
|
|
45
|
+
readonly row: {
|
|
46
|
+
readonly type: ObjectConstructor;
|
|
47
|
+
readonly default: () => void;
|
|
48
|
+
};
|
|
35
49
|
}>>, {
|
|
36
50
|
readonly text: string | number | undefined;
|
|
37
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
51
|
+
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal";
|
|
52
|
+
readonly dealFunction: Function;
|
|
53
|
+
readonly row: Record<string, any>;
|
|
38
54
|
}, {}>;
|
|
39
55
|
export default _default;
|
|
@@ -4,32 +4,36 @@ import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { key: 0 };
|
|
6
6
|
const _hoisted_2 = { key: 1 };
|
|
7
|
-
const _hoisted_3 =
|
|
7
|
+
const _hoisted_3 = ["innerHTML"];
|
|
8
|
+
const _hoisted_4 = { key: 3 };
|
|
8
9
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
9
|
-
return
|
|
10
|
+
return _ctx.dealType === "notProcessed" || _ctx.dealType === "other" ? (openBlock(), createElementBlock(
|
|
10
11
|
"div",
|
|
11
12
|
_hoisted_1,
|
|
12
|
-
toDisplayString(
|
|
13
|
+
toDisplayString(_ctx.text),
|
|
13
14
|
1
|
|
14
15
|
/* TEXT */
|
|
15
|
-
)) :
|
|
16
|
+
)) : _ctx.dealType === "colorText" || _ctx.dealType === "colorPercentage" ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
16
17
|
createElementVNode(
|
|
17
18
|
"span",
|
|
18
19
|
{
|
|
19
|
-
style: normalizeStyle({ color:
|
|
20
|
+
style: normalizeStyle({ color: _ctx.text > 0 ? "red" : _ctx.text < 0 ? "green" : "" })
|
|
20
21
|
},
|
|
21
|
-
toDisplayString(
|
|
22
|
+
toDisplayString(_ctx.text !== void 0 ? $setup.CLOUMN_DEAL[_ctx.dealType](_ctx.text) : "-"),
|
|
22
23
|
5
|
|
23
24
|
/* TEXT, STYLE */
|
|
24
25
|
)
|
|
25
|
-
])) : (openBlock(), createElementBlock(
|
|
26
|
+
])) : _ctx.dealType === "customDeal" ? (openBlock(), createElementBlock("div", {
|
|
27
|
+
key: 2,
|
|
28
|
+
innerHTML: _ctx.dealFunction(_ctx.row, _ctx.text)
|
|
29
|
+
}, null, 8, _hoisted_3)) : (openBlock(), createElementBlock(
|
|
26
30
|
"div",
|
|
27
|
-
|
|
28
|
-
toDisplayString(
|
|
31
|
+
_hoisted_4,
|
|
32
|
+
toDisplayString(_ctx.text !== void 0 ? $setup.CLOUMN_DEAL[_ctx.dealType](_ctx.text) : "-"),
|
|
29
33
|
1
|
|
30
34
|
/* TEXT */
|
|
31
35
|
));
|
|
32
36
|
}
|
|
33
|
-
var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
37
|
+
var ColumnDeal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/elTable/src/columnDeal.vue"]]);
|
|
34
38
|
|
|
35
39
|
export { ColumnDeal as default };
|
|
@@ -8,8 +8,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8
8
|
props: columnDealProps,
|
|
9
9
|
setup(__props, { expose: __expose }) {
|
|
10
10
|
__expose();
|
|
11
|
-
const
|
|
12
|
-
const __returned__ = { props, get CLOUMN_DEAL() {
|
|
11
|
+
const __returned__ = { get CLOUMN_DEAL() {
|
|
13
12
|
return CLOUMN_DEAL;
|
|
14
13
|
} };
|
|
15
14
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
@@ -3,6 +3,7 @@ import type { clounmKyeType, dealKeyType } from 'hfn-components/es/constants';
|
|
|
3
3
|
export interface ElTableColumns {
|
|
4
4
|
key: clounmKyeType;
|
|
5
5
|
dealType: dealKeyType;
|
|
6
|
+
dealFunction?: Function;
|
|
6
7
|
width: string | number;
|
|
7
8
|
customizeLabel?: string;
|
|
8
9
|
}
|
|
@@ -26,13 +27,21 @@ export declare const elTableProps: {
|
|
|
26
27
|
};
|
|
27
28
|
export declare const columnDealProps: {
|
|
28
29
|
readonly dealType: {
|
|
29
|
-
readonly type: PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
30
|
+
readonly type: PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
30
31
|
readonly default: "";
|
|
31
32
|
};
|
|
32
33
|
readonly text: {
|
|
33
34
|
readonly type: PropType<string | number | undefined>;
|
|
34
35
|
readonly default: undefined;
|
|
35
36
|
};
|
|
37
|
+
readonly dealFunction: {
|
|
38
|
+
readonly type: FunctionConstructor;
|
|
39
|
+
readonly default: () => void;
|
|
40
|
+
};
|
|
41
|
+
readonly row: {
|
|
42
|
+
readonly type: ObjectConstructor;
|
|
43
|
+
readonly default: () => void;
|
|
44
|
+
};
|
|
36
45
|
};
|
|
37
46
|
export type ElTableProps = ExtractPropTypes<typeof elTableProps>;
|
|
38
47
|
export type ColumnDealProps = ExtractPropTypes<typeof columnDealProps>;
|
|
@@ -708,18 +708,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
708
708
|
readonly convertKey: (data: any, key: string) => any;
|
|
709
709
|
ColumnDeal: import("vue").DefineComponent<{
|
|
710
710
|
readonly dealType: {
|
|
711
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
711
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
712
712
|
readonly default: "";
|
|
713
713
|
};
|
|
714
714
|
readonly text: {
|
|
715
715
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
716
716
|
readonly default: undefined;
|
|
717
717
|
};
|
|
718
|
+
readonly dealFunction: {
|
|
719
|
+
readonly type: FunctionConstructor;
|
|
720
|
+
readonly default: () => void;
|
|
721
|
+
};
|
|
722
|
+
readonly row: {
|
|
723
|
+
readonly type: ObjectConstructor;
|
|
724
|
+
readonly default: () => void;
|
|
725
|
+
};
|
|
718
726
|
}, {
|
|
719
|
-
props: import("@vue/shared").LooseRequired<{
|
|
720
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
721
|
-
readonly text?: string | number | undefined;
|
|
722
|
-
} & {}>;
|
|
723
727
|
readonly CLOUMN_DEAL: {
|
|
724
728
|
basicText4: (val: string | number | undefined) => string;
|
|
725
729
|
colorText: (val: string | number | undefined) => string;
|
|
@@ -728,21 +732,33 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
728
732
|
percentage4: (val: string | number | undefined) => string;
|
|
729
733
|
absPercentage: (val: string | number | undefined) => string;
|
|
730
734
|
thoundsandText2: (val: string | number | undefined) => string;
|
|
735
|
+
thoundsandText4: (val: string | number | undefined) => string;
|
|
731
736
|
notProcessed: null;
|
|
732
737
|
other: null;
|
|
738
|
+
customDeal: null;
|
|
733
739
|
};
|
|
734
740
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
735
741
|
readonly dealType: {
|
|
736
|
-
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other">;
|
|
742
|
+
readonly type: import("vue").PropType<"basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal">;
|
|
737
743
|
readonly default: "";
|
|
738
744
|
};
|
|
739
745
|
readonly text: {
|
|
740
746
|
readonly type: import("vue").PropType<string | number | undefined>;
|
|
741
747
|
readonly default: undefined;
|
|
742
748
|
};
|
|
749
|
+
readonly dealFunction: {
|
|
750
|
+
readonly type: FunctionConstructor;
|
|
751
|
+
readonly default: () => void;
|
|
752
|
+
};
|
|
753
|
+
readonly row: {
|
|
754
|
+
readonly type: ObjectConstructor;
|
|
755
|
+
readonly default: () => void;
|
|
756
|
+
};
|
|
743
757
|
}>>, {
|
|
744
758
|
readonly text: string | number | undefined;
|
|
745
|
-
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "notProcessed" | "other";
|
|
759
|
+
readonly dealType: "basicText4" | "colorText" | "colorPercentage" | "percentage" | "percentage4" | "absPercentage" | "thoundsandText2" | "thoundsandText4" | "notProcessed" | "other" | "customDeal";
|
|
760
|
+
readonly dealFunction: Function;
|
|
761
|
+
readonly row: Record<string, any>;
|
|
746
762
|
}, {}>;
|
|
747
763
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
748
764
|
readonly dataSource: {
|
|
@@ -34,8 +34,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
34
34
|
}, null, 8, ["dealType", "text"])) : (openBlock(), createBlock($setup["ColumnDeal"], {
|
|
35
35
|
key: 1,
|
|
36
36
|
dealType: item.dealType,
|
|
37
|
-
text: $setup.convertKey(scope.row, item.key)
|
|
38
|
-
|
|
37
|
+
text: $setup.convertKey(scope.row, item.key),
|
|
38
|
+
row: scope.row,
|
|
39
|
+
"deal-function": item.dealFunction
|
|
40
|
+
}, null, 8, ["dealType", "text", "row", "deal-function"]))
|
|
39
41
|
]),
|
|
40
42
|
_: 2
|
|
41
43
|
/* DYNAMIC */
|
|
@@ -51,6 +53,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
51
53
|
[$setup["vLoading"], $setup.props.loading]
|
|
52
54
|
]);
|
|
53
55
|
}
|
|
54
|
-
var elTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
56
|
+
var elTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/elTable/src/elTable.vue"]]);
|
|
55
57
|
|
|
56
58
|
export { elTable as default };
|
|
@@ -199,6 +199,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
199
199
|
}, 8, ["modelValue"])
|
|
200
200
|
]);
|
|
201
201
|
}
|
|
202
|
-
var htTarget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
202
|
+
var htTarget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/htTarget/src/htTarget.vue"]]);
|
|
203
203
|
|
|
204
204
|
export { htTarget as default };
|
|
@@ -18,6 +18,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
18
18
|
$setup.noData ? (openBlock(), createElementBlock("div", _hoisted_3, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
|
|
19
19
|
]);
|
|
20
20
|
}
|
|
21
|
-
var htPieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
21
|
+
var htPieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/pieChart/src/HtPieChart.vue"]]);
|
|
22
22
|
|
|
23
23
|
export { htPieChart as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, shallowRef, reactive, watch, ref } from 'vue';
|
|
2
2
|
import { pieProps } from './HtPieChart.mjs';
|
|
3
3
|
import cloneDeep from 'lodash.clonedeep';
|
|
4
|
-
import {
|
|
4
|
+
import { useBasicPieConfig } from '../../../constants/chartConfig.mjs';
|
|
5
5
|
import * as echarts from 'echarts/core';
|
|
6
6
|
|
|
7
7
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -11,7 +11,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
__expose();
|
|
12
12
|
const props = __props;
|
|
13
13
|
const myChart = shallowRef();
|
|
14
|
-
const echartOptions = reactive(cloneDeep(
|
|
14
|
+
const echartOptions = reactive(cloneDeep(useBasicPieConfig(props.floatNumber)));
|
|
15
15
|
watch(
|
|
16
16
|
() => props.chartData,
|
|
17
17
|
(val) => {
|
|
@@ -86,7 +86,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
86
|
myChart.value.setOption(echartOptions, true);
|
|
87
87
|
}, 200);
|
|
88
88
|
};
|
|
89
|
-
console.log(echarts);
|
|
90
89
|
const __returned__ = { props, myChart, echartOptions, chartResize, noData, drawGraph, setLenged, setEchartTooltip, echartInit };
|
|
91
90
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
92
91
|
return __returned__;
|
|
@@ -444,6 +444,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
444
444
|
/* STABLE_FRAGMENT */
|
|
445
445
|
);
|
|
446
446
|
}
|
|
447
|
-
var Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/
|
|
447
|
+
var Table = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/zhanghang/Documents/project/component-library/packages/components/table/HtTable.vue"]]);
|
|
448
448
|
|
|
449
449
|
export { Table as default };
|
|
@@ -5,4 +5,4 @@ import type { ComposeOption } from 'echarts/core';
|
|
|
5
5
|
export type ECOption = ComposeOption<BarSeriesOption | LineSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | DatasetComponentOption>;
|
|
6
6
|
export default echarts;
|
|
7
7
|
export declare const BASIC_CHART_CONFIG: any;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const useBasicPieConfig: any;
|
|
@@ -85,7 +85,7 @@ const BASIC_CHART_CONFIG = {
|
|
|
85
85
|
],
|
|
86
86
|
series: []
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const useBasicPieConfig = (floatNumber = 2) => ({
|
|
89
89
|
series: [
|
|
90
90
|
{
|
|
91
91
|
name: "",
|
|
@@ -95,7 +95,7 @@ const BASIC_PIE_CONFIG = {
|
|
|
95
95
|
label: {
|
|
96
96
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
97
97
|
formatter: function(params) {
|
|
98
|
-
const val = params.data.percent ? (params.data.percent * 100).toFixed(
|
|
98
|
+
const val = params.data.percent ? (params.data.percent * 100).toFixed(floatNumber) : params.percent.toFixed(floatNumber);
|
|
99
99
|
return ` ${params.name}: ${val}%`;
|
|
100
100
|
},
|
|
101
101
|
fontWeight: "bolder",
|
|
@@ -104,6 +104,6 @@ const BASIC_PIE_CONFIG = {
|
|
|
104
104
|
data: []
|
|
105
105
|
}
|
|
106
106
|
]
|
|
107
|
-
};
|
|
107
|
+
});
|
|
108
108
|
|
|
109
|
-
export { BASIC_CHART_CONFIG,
|
|
109
|
+
export { BASIC_CHART_CONFIG, useBasicPieConfig };
|
package/es/constants/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { INSTALLED_KEY } from './key.mjs';
|
|
2
2
|
export { CLOUMN_DEAL, TABLE_KEY, convertKey } from './table.mjs';
|
|
3
3
|
export { BASIC_KEY, TARGET_END_KEY, TARGET_HEAD_KEY } from './target.mjs';
|
|
4
|
-
export { BASIC_CHART_CONFIG,
|
|
4
|
+
export { BASIC_CHART_CONFIG, useBasicPieConfig } from './chartConfig.mjs';
|
package/es/constants/table.d.ts
CHANGED
|
@@ -110,8 +110,10 @@ export declare const CLOUMN_DEAL: {
|
|
|
110
110
|
percentage4: (val: number | string | undefined) => string;
|
|
111
111
|
absPercentage: (val: number | string | undefined) => string;
|
|
112
112
|
thoundsandText2: (val: number | string | undefined) => string;
|
|
113
|
+
thoundsandText4: (val: number | string | undefined) => string;
|
|
113
114
|
notProcessed: null;
|
|
114
115
|
other: null;
|
|
116
|
+
customDeal: null;
|
|
115
117
|
};
|
|
116
118
|
export declare const convertKey: (data: any, key: string) => any;
|
|
117
119
|
export type clounmKyeType = keyof typeof TABLE_KEY;
|
package/es/constants/table.mjs
CHANGED
|
@@ -125,6 +125,9 @@ const absPercentage = (val) => {
|
|
|
125
125
|
const thoundsandText2 = (val) => {
|
|
126
126
|
return typeof val === "number" ? splitK(dataHandle(val, false, 2)) : "-";
|
|
127
127
|
};
|
|
128
|
+
const thoundsandText4 = (val) => {
|
|
129
|
+
return typeof val === "number" ? splitK(dataHandle(val, false, 4)) : "-";
|
|
130
|
+
};
|
|
128
131
|
const CLOUMN_DEAL = {
|
|
129
132
|
basicText4,
|
|
130
133
|
colorText: basicText4,
|
|
@@ -133,8 +136,10 @@ const CLOUMN_DEAL = {
|
|
|
133
136
|
percentage4,
|
|
134
137
|
absPercentage,
|
|
135
138
|
thoundsandText2,
|
|
139
|
+
thoundsandText4,
|
|
136
140
|
notProcessed: null,
|
|
137
|
-
other: null
|
|
141
|
+
other: null,
|
|
142
|
+
customDeal: null
|
|
138
143
|
};
|
|
139
144
|
const convertKey = (data, key) => {
|
|
140
145
|
const newKey = key.replace(/([A-Z])/g, "_$1").toLowerCase();
|
package/es/css/index.css
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.echart-box {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.echart-content {
|
|
10
|
+
flex: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.echart-lenged {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: auto;
|
|
16
|
+
margin-top: 6px;
|
|
17
|
+
padding-right: 22px;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-wrap: wrap;
|
|
21
|
+
font-size: 12px;
|
|
22
|
+
position: relative;
|
|
23
|
+
z-index: 999;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.bg-span {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
width: 14px;
|
|
29
|
+
height: 2px;
|
|
30
|
+
margin-right: 6px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bg-span-bar {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
width: 16px;
|
|
36
|
+
height: 10px;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
margin-right: 6px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.span-box {
|
|
42
|
+
margin-left: 5px;
|
|
43
|
+
margin-right: 6px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.noData {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
font-size: 16px;
|
|
53
|
+
display: flex;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
align-items: center;
|
|
56
|
+
position: absolute;
|
|
57
|
+
bottom: 0px;
|
|
58
|
+
color: #ccc;
|
|
59
|
+
}
|
package/es/utils/chart.mjs
CHANGED