hfn-components 0.3.6 → 0.3.8
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/htTarget/src/htTarget.vue2.mjs +2 -0
- package/es/components/pieChart/index.d.ts +8 -1
- package/es/components/pieChart/src/HtPieChart.vue.d.ts +14 -1
- package/es/components/pieChart/src/HtPieChart.vue.mjs +43 -5
- package/es/components/pieChart/src/HtPieChart.vue2.mjs +26 -18
- package/es/constants/chartConfig.mjs +40 -0
- package/es/constants/target.mjs +10 -9
- package/package.json +1 -1
|
@@ -34,6 +34,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
34
34
|
() => props.dialogShow,
|
|
35
35
|
(val) => {
|
|
36
36
|
dialogShow.value = val;
|
|
37
|
+
selectedTree.value = {};
|
|
38
|
+
selectedList.value = [];
|
|
37
39
|
props.targetData.forEach((item) => {
|
|
38
40
|
if (item.key.startsWith("basic_")) {
|
|
39
41
|
const strSplit = item.key.split("_");
|
|
@@ -46,9 +46,16 @@ export declare const HtPieChart: import("hfn-components/es/utils").SFCWithInstal
|
|
|
46
46
|
echartOptions: any;
|
|
47
47
|
chartResize: () => void;
|
|
48
48
|
noData: import("vue").Ref<boolean>;
|
|
49
|
+
allLegend: import("vue").Ref<{
|
|
50
|
+
name: string;
|
|
51
|
+
lineType: string;
|
|
52
|
+
isShow: boolean;
|
|
53
|
+
color: string;
|
|
54
|
+
}[]>;
|
|
49
55
|
drawGraph: () => void;
|
|
50
|
-
|
|
56
|
+
lengedDeal: () => void;
|
|
51
57
|
setEchartTooltip: () => void;
|
|
58
|
+
legendStatus: (item: import("./src/HtPieChart.vue").Legend, index: number) => void;
|
|
52
59
|
echartInit: () => void;
|
|
53
60
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
61
|
readonly chartData: {
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export interface Legend {
|
|
2
|
+
name: string;
|
|
3
|
+
lineType: string;
|
|
4
|
+
isShow: boolean;
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
1
7
|
declare const _default: import("vue").DefineComponent<{
|
|
2
8
|
readonly chartData: {
|
|
3
9
|
readonly type: import("vue").PropType<any[]>;
|
|
@@ -46,9 +52,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
46
52
|
echartOptions: any;
|
|
47
53
|
chartResize: () => void;
|
|
48
54
|
noData: import("vue").Ref<boolean>;
|
|
55
|
+
allLegend: import("vue").Ref<{
|
|
56
|
+
name: string;
|
|
57
|
+
lineType: string;
|
|
58
|
+
isShow: boolean;
|
|
59
|
+
color: string;
|
|
60
|
+
}[]>;
|
|
49
61
|
drawGraph: () => void;
|
|
50
|
-
|
|
62
|
+
lengedDeal: () => void;
|
|
51
63
|
setEchartTooltip: () => void;
|
|
64
|
+
legendStatus: (item: Legend, index: number) => void;
|
|
52
65
|
echartInit: () => void;
|
|
53
66
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
54
67
|
readonly chartData: {
|
|
@@ -1,21 +1,59 @@
|
|
|
1
1
|
import _sfc_main from './HtPieChart.vue2.mjs';
|
|
2
|
-
import { openBlock, createElementBlock, createElementVNode, createCommentVNode } from 'vue';
|
|
2
|
+
import { openBlock, createElementBlock, createElementVNode, createCommentVNode, Fragment, renderList, normalizeStyle, toDisplayString } from 'vue';
|
|
3
3
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
4
|
|
|
5
5
|
const _hoisted_1 = { class: "echart-box" };
|
|
6
|
-
const _hoisted_2 =
|
|
7
|
-
const _hoisted_3 =
|
|
6
|
+
const _hoisted_2 = { class: "echart-lenged" };
|
|
7
|
+
const _hoisted_3 = ["onClick"];
|
|
8
|
+
const _hoisted_4 = ["id"];
|
|
9
|
+
const _hoisted_5 = {
|
|
8
10
|
key: 0,
|
|
9
11
|
class: "noData"
|
|
10
12
|
};
|
|
11
13
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12
14
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
15
|
+
createElementVNode("div", _hoisted_2, [
|
|
16
|
+
createCommentVNode(' @mouseover="legendEnter(index)"\n @mouseleave="legendLeave()" '),
|
|
17
|
+
(openBlock(true), createElementBlock(
|
|
18
|
+
Fragment,
|
|
19
|
+
null,
|
|
20
|
+
renderList($setup.allLegend, (item, index) => {
|
|
21
|
+
return openBlock(), createElementBlock("div", {
|
|
22
|
+
class: "span-box mb10",
|
|
23
|
+
key: index,
|
|
24
|
+
onClick: ($event) => $setup.legendStatus(item, index)
|
|
25
|
+
}, [
|
|
26
|
+
createElementVNode(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
class: "bg-span-bar",
|
|
30
|
+
style: normalizeStyle({ background: item.isShow ? item.color : "#ccc" })
|
|
31
|
+
},
|
|
32
|
+
null,
|
|
33
|
+
4
|
|
34
|
+
/* STYLE */
|
|
35
|
+
),
|
|
36
|
+
createElementVNode(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
style: normalizeStyle({ color: item.isShow ? "#000" : "#ccc" })
|
|
40
|
+
},
|
|
41
|
+
toDisplayString(item.name),
|
|
42
|
+
5
|
|
43
|
+
/* TEXT, STYLE */
|
|
44
|
+
)
|
|
45
|
+
], 8, _hoisted_3);
|
|
46
|
+
}),
|
|
47
|
+
128
|
|
48
|
+
/* KEYED_FRAGMENT */
|
|
49
|
+
))
|
|
50
|
+
]),
|
|
13
51
|
createElementVNode("div", {
|
|
14
52
|
class: "_100",
|
|
15
53
|
id: _ctx.chartId
|
|
16
|
-
}, null, 8,
|
|
54
|
+
}, null, 8, _hoisted_4),
|
|
17
55
|
createCommentVNode(" \u56FE\u4F8B\u5168\u7F6E\u7070\u76D2\u5B50 "),
|
|
18
|
-
$setup.noData ? (openBlock(), createElementBlock("div",
|
|
56
|
+
$setup.noData ? (openBlock(), createElementBlock("div", _hoisted_5, "\u6682\u65E0\u6570\u636E")) : createCommentVNode("v-if", true)
|
|
19
57
|
]);
|
|
20
58
|
}
|
|
21
59
|
var htPieChart = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/Users/libiluo/Desktop/company/component-library/packages/components/pieChart/src/HtPieChart.vue"]]);
|
|
@@ -42,27 +42,23 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
myChart.value.resize();
|
|
43
43
|
};
|
|
44
44
|
const noData = ref(false);
|
|
45
|
+
const allLegend = ref([]);
|
|
45
46
|
const drawGraph = () => {
|
|
46
|
-
|
|
47
|
+
lengedDeal();
|
|
47
48
|
setEchartTooltip();
|
|
48
49
|
echartInit();
|
|
49
50
|
};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
verticalAlign: "bottom"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
51
|
+
const lengedDeal = () => {
|
|
52
|
+
allLegend.value = [];
|
|
53
|
+
props.chartData.forEach((item, index) => {
|
|
54
|
+
const data = {
|
|
55
|
+
name: item.name,
|
|
56
|
+
isShow: true,
|
|
57
|
+
lineType: item.type,
|
|
58
|
+
color: echartOptions.color[index % echartOptions.color.length]
|
|
59
|
+
};
|
|
60
|
+
allLegend.value.push(data);
|
|
61
|
+
});
|
|
66
62
|
};
|
|
67
63
|
const setEchartTooltip = () => {
|
|
68
64
|
echartOptions.tooltip = {
|
|
@@ -77,6 +73,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
73
|
}
|
|
78
74
|
};
|
|
79
75
|
};
|
|
76
|
+
const legendStatus = (item, index) => {
|
|
77
|
+
const status = !item.isShow;
|
|
78
|
+
allLegend.value[index].isShow = status;
|
|
79
|
+
if (allLegend.value.every((item2) => item2.isShow === false)) {
|
|
80
|
+
noData.value = true;
|
|
81
|
+
} else {
|
|
82
|
+
noData.value = false;
|
|
83
|
+
}
|
|
84
|
+
myChart.value.setOption({
|
|
85
|
+
legend: { selected: { [item.name]: status } }
|
|
86
|
+
});
|
|
87
|
+
};
|
|
80
88
|
const echartInit = () => {
|
|
81
89
|
setTimeout(() => {
|
|
82
90
|
if (!myChart.value) {
|
|
@@ -86,7 +94,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
94
|
myChart.value.setOption(echartOptions, true);
|
|
87
95
|
}, 200);
|
|
88
96
|
};
|
|
89
|
-
const __returned__ = { props, myChart, echartOptions, chartResize, noData, drawGraph,
|
|
97
|
+
const __returned__ = { props, myChart, echartOptions, chartResize, noData, allLegend, drawGraph, lengedDeal, setEchartTooltip, legendStatus, echartInit };
|
|
90
98
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
91
99
|
return __returned__;
|
|
92
100
|
}
|
|
@@ -86,6 +86,46 @@ const BASIC_CHART_CONFIG = {
|
|
|
86
86
|
series: []
|
|
87
87
|
};
|
|
88
88
|
const useBasicPieConfig = (floatNumber = 2) => ({
|
|
89
|
+
legend: {
|
|
90
|
+
show: false
|
|
91
|
+
},
|
|
92
|
+
color: [
|
|
93
|
+
"#C13431",
|
|
94
|
+
"#1E85D2",
|
|
95
|
+
"#FD984F",
|
|
96
|
+
"#63B9BB",
|
|
97
|
+
"#BBB162",
|
|
98
|
+
"#AE76C1",
|
|
99
|
+
"#5E92F6",
|
|
100
|
+
"#F5BC32",
|
|
101
|
+
"#DA8484",
|
|
102
|
+
"#41982E",
|
|
103
|
+
"#437095",
|
|
104
|
+
"#8060A7",
|
|
105
|
+
"#7D0A0D",
|
|
106
|
+
"#572AFF",
|
|
107
|
+
"#2BE8F8",
|
|
108
|
+
"#FF1493",
|
|
109
|
+
"#E066FF",
|
|
110
|
+
"#27408B",
|
|
111
|
+
"#5191A3",
|
|
112
|
+
"#D5634C",
|
|
113
|
+
"#92d6fd",
|
|
114
|
+
"#b92e2d",
|
|
115
|
+
"#187bc9",
|
|
116
|
+
"#90bae0",
|
|
117
|
+
"#187bc9",
|
|
118
|
+
"#0070C9",
|
|
119
|
+
"#5470c6",
|
|
120
|
+
"#91cc75",
|
|
121
|
+
"#fac858",
|
|
122
|
+
"#ee6666",
|
|
123
|
+
"#73c0de",
|
|
124
|
+
"#3ba272",
|
|
125
|
+
"#fc8452",
|
|
126
|
+
"#9a60b4",
|
|
127
|
+
"#ea7ccc"
|
|
128
|
+
],
|
|
89
129
|
series: [
|
|
90
130
|
{
|
|
91
131
|
name: "",
|
package/es/constants/target.mjs
CHANGED
|
@@ -40,15 +40,16 @@ const TARGET_END_KEY = [
|
|
|
40
40
|
{ name: "\u6708\u80DC\u7387", key: "monthlyPositiveRatio", dealType: "percentage" }
|
|
41
41
|
];
|
|
42
42
|
const BASIC_KEY = [
|
|
43
|
-
{ name: "\
|
|
44
|
-
{ name:
|
|
45
|
-
{ name:
|
|
46
|
-
{ name: "\u5355\u4F4D\u51C0\u503C
|
|
47
|
-
{ name:
|
|
48
|
-
{ name: "\
|
|
49
|
-
{ name:
|
|
50
|
-
{ name:
|
|
51
|
-
{ name:
|
|
43
|
+
{ name: "\u51C0\u503C\u65E5\u671F", key: "priceDate", dealType: "notProcessed" },
|
|
44
|
+
// { name: '管理人', key: 'advisor', dealType: '' },
|
|
45
|
+
// { name: '策略', key: 'strategyOne', dealType: '' },
|
|
46
|
+
{ name: "\u5355\u4F4D\u51C0\u503C", key: "nav", dealType: "basicText4" },
|
|
47
|
+
// { name: '单位净值涨跌幅', key: 'navPriceChange', dealType: '' },
|
|
48
|
+
{ name: "\u7D2F\u8BA1\u51C0\u503C", key: "cumulativeNavWithdrawal", dealType: "basicText4" }
|
|
49
|
+
// { name: '成立日期', key: 'inceptionDate', dealType: '' },
|
|
50
|
+
// { name: '封闭期', key: 'closedPeriod', dealType: '' },
|
|
51
|
+
// { name: '开放日', key: 'openDay', dealType: '' },
|
|
52
|
+
// { name: '备案号/代码', key: 'registerNumber', dealType: '' }
|
|
52
53
|
];
|
|
53
54
|
|
|
54
55
|
export { BASIC_KEY, TARGET_END_KEY, TARGET_HEAD_KEY };
|