hfn-components 0.2.5 → 0.2.7
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/component.ts +13 -0
- package/defaults.ts +5 -0
- package/index.ts +6 -0
- package/make-installer.ts +17 -0
- package/package.json +2 -2
- package/plugin.ts +1 -0
- package/dist/index.css +0 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
- package/es/component.d.ts +0 -3
- package/es/component.mjs +0 -10
- package/es/components/chart/index.d.ts +0 -171
- package/es/components/chart/index.mjs +0 -7
- package/es/components/chart/src/HtChart.d.ts +0 -65
- package/es/components/chart/src/HtChart.mjs +0 -86
- package/es/components/chart/src/HtChart.vue.d.ts +0 -177
- package/es/components/chart/src/HtChart.vue.mjs +0 -91
- package/es/components/chart/src/HtChart.vue2.mjs +0 -104
- package/es/components/chart/src/chartConfig.d.ts +0 -7
- package/es/components/chart/src/chartConfig.mjs +0 -88
- package/es/components/chart/style/index.d.ts +0 -1
- package/es/components/chart/style/index.mjs +0 -1
- package/es/components/elTable/index.d.ts +0 -714
- package/es/components/elTable/index.mjs +0 -7
- package/es/components/elTable/src/columnDeal.vue.d.ts +0 -37
- package/es/components/elTable/src/columnDeal.vue.mjs +0 -35
- package/es/components/elTable/src/columnDeal.vue2.mjs +0 -19
- package/es/components/elTable/src/elTable.d.ts +0 -38
- package/es/components/elTable/src/elTable.mjs +0 -30
- package/es/components/elTable/src/elTable.vue.d.ts +0 -713
- package/es/components/elTable/src/elTable.vue.mjs +0 -56
- package/es/components/elTable/src/elTable.vue2.mjs +0 -29
- package/es/components/index.d.ts +0 -2
- package/es/components/index.mjs +0 -4
- package/es/components/table/HtTable.d.ts +0 -142
- package/es/components/table/HtTable.mjs +0 -136
- package/es/components/table/HtTable.vue.d.ts +0 -1847
- package/es/components/table/HtTable.vue.mjs +0 -449
- package/es/components/table/HtTable.vue2.mjs +0 -124
- package/es/components/table/index.d.ts +0 -1845
- package/es/components/table/index.mjs +0 -7
- package/es/constants/index.d.ts +0 -2
- package/es/constants/index.mjs +0 -2
- package/es/constants/key.d.ts +0 -1
- package/es/constants/key.mjs +0 -3
- package/es/constants/table.d.ts +0 -61
- package/es/constants/table.mjs +0 -73
- package/es/defaults.d.ts +0 -4
- package/es/defaults.mjs +0 -7
- package/es/index.d.ts +0 -5
- package/es/index.mjs +0 -10
- package/es/make-installer.d.ts +0 -4
- package/es/make-installer.mjs +0 -14
- package/es/plugin.d.ts +0 -2
- package/es/plugin.mjs +0 -3
- package/es/utils/chart.d.ts +0 -7
- package/es/utils/chart.mjs +0 -172
- package/es/utils/common.d.ts +0 -3
- package/es/utils/common.mjs +0 -15
- package/es/utils/index.d.ts +0 -4
- package/es/utils/index.mjs +0 -4
- package/es/utils/table.d.ts +0 -2
- package/es/utils/table.mjs +0 -31
- package/es/utils/tool.d.ts +0 -2
- package/es/utils/tool.mjs +0 -42
- package/global.d.ts +0 -14
- package/theme-chalk/ht-chart.css +0 -1
- package/theme-chalk/index.css +0 -1
- package/theme-chalk/src/chart.scss +0 -53
- package/theme-chalk/src/index.scss +0 -1
package/es/constants/index.d.ts
DELETED
package/es/constants/index.mjs
DELETED
package/es/constants/key.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const INSTALLED_KEY: unique symbol;
|
package/es/constants/key.mjs
DELETED
package/es/constants/table.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export declare const TABLE_KEY: {
|
|
2
|
-
readonly index: "序号";
|
|
3
|
-
readonly year: "年份";
|
|
4
|
-
readonly fundName: "基金名称";
|
|
5
|
-
readonly cucmulativeReturn: "区间收益";
|
|
6
|
-
readonly excessReturn: "超额区间收益";
|
|
7
|
-
readonly vol: "年化波动率";
|
|
8
|
-
readonly excessVol: "超额年化波动率";
|
|
9
|
-
readonly sharpeRatio: "夏普比率";
|
|
10
|
-
readonly excessSharpeRatio: "超额夏普比率";
|
|
11
|
-
readonly calmarRatio: "卡玛比率";
|
|
12
|
-
readonly excessCalmarRatio: "超额卡玛比率";
|
|
13
|
-
readonly sortinoRatio: "索提诺比率";
|
|
14
|
-
readonly excessSortinoRatio: "超额索提诺比率";
|
|
15
|
-
readonly downsideDev: "下行风险";
|
|
16
|
-
readonly excessDownsideDev: "超额下行风险";
|
|
17
|
-
readonly interval: "最大回撤起止区间";
|
|
18
|
-
readonly maxDrawdown: "最大回撤";
|
|
19
|
-
readonly excessMaxDrawdown: "超额最大回撤";
|
|
20
|
-
readonly maxDrawdownDays: "最大回撤回补期(天)";
|
|
21
|
-
readonly excessMaxDrawdownDays: "超额最大回撤回补期(天)";
|
|
22
|
-
readonly maxNormalDays: "最长连续不创新高天数(天)";
|
|
23
|
-
readonly excessMaxNormalDays: "超额最长连续不创新高天数(天)";
|
|
24
|
-
readonly annualReturn: "年化收益";
|
|
25
|
-
readonly excessAnnualReturn: "超额年化收益";
|
|
26
|
-
readonly corr: "相关系数";
|
|
27
|
-
readonly informationRatio: "信息比率";
|
|
28
|
-
readonly trackingError: "跟踪误差";
|
|
29
|
-
readonly alpha: "Alpha";
|
|
30
|
-
readonly beta: "Beta";
|
|
31
|
-
readonly skew: "偏度";
|
|
32
|
-
readonly kurt: "峰度";
|
|
33
|
-
readonly cVaR: "VaR(95%置信)";
|
|
34
|
-
readonly indexReturns: "同期指数收益";
|
|
35
|
-
readonly '01': "1月";
|
|
36
|
-
readonly '02': "2月";
|
|
37
|
-
readonly '03': "3月";
|
|
38
|
-
readonly '04': "4月";
|
|
39
|
-
readonly '05': "5月";
|
|
40
|
-
readonly '06': "6月";
|
|
41
|
-
readonly '07': "7月";
|
|
42
|
-
readonly '08': "8月";
|
|
43
|
-
readonly '09': "9月";
|
|
44
|
-
readonly '10': "10月";
|
|
45
|
-
readonly '11': "11月";
|
|
46
|
-
readonly '12': "12月";
|
|
47
|
-
readonly MonthlyPositiveRatio: "月胜率";
|
|
48
|
-
readonly all_year: "全年";
|
|
49
|
-
};
|
|
50
|
-
export declare const CLOUMN_DEAL: {
|
|
51
|
-
basicText4: (val: number | string | undefined) => string;
|
|
52
|
-
colorText: (val: number | string | undefined) => string;
|
|
53
|
-
colorPercentage: (val: number | string | undefined) => string;
|
|
54
|
-
percentage: (val: number | string | undefined) => string;
|
|
55
|
-
absPercentage: (val: number | string | undefined) => string;
|
|
56
|
-
notProcessed: null;
|
|
57
|
-
other: null;
|
|
58
|
-
};
|
|
59
|
-
export declare const convertKey: (data: any, key: string) => any;
|
|
60
|
-
export type clounmKyeType = keyof typeof TABLE_KEY;
|
|
61
|
-
export type dealKeyType = keyof typeof CLOUMN_DEAL;
|
package/es/constants/table.mjs
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const TABLE_KEY = {
|
|
2
|
-
index: "\u5E8F\u53F7",
|
|
3
|
-
year: "\u5E74\u4EFD",
|
|
4
|
-
fundName: "\u57FA\u91D1\u540D\u79F0",
|
|
5
|
-
cucmulativeReturn: "\u533A\u95F4\u6536\u76CA",
|
|
6
|
-
excessReturn: "\u8D85\u989D\u533A\u95F4\u6536\u76CA",
|
|
7
|
-
vol: "\u5E74\u5316\u6CE2\u52A8\u7387",
|
|
8
|
-
excessVol: "\u8D85\u989D\u5E74\u5316\u6CE2\u52A8\u7387",
|
|
9
|
-
sharpeRatio: "\u590F\u666E\u6BD4\u7387",
|
|
10
|
-
excessSharpeRatio: "\u8D85\u989D\u590F\u666E\u6BD4\u7387",
|
|
11
|
-
calmarRatio: "\u5361\u739B\u6BD4\u7387",
|
|
12
|
-
excessCalmarRatio: "\u8D85\u989D\u5361\u739B\u6BD4\u7387",
|
|
13
|
-
sortinoRatio: "\u7D22\u63D0\u8BFA\u6BD4\u7387",
|
|
14
|
-
excessSortinoRatio: "\u8D85\u989D\u7D22\u63D0\u8BFA\u6BD4\u7387",
|
|
15
|
-
downsideDev: "\u4E0B\u884C\u98CE\u9669",
|
|
16
|
-
excessDownsideDev: "\u8D85\u989D\u4E0B\u884C\u98CE\u9669",
|
|
17
|
-
interval: "\u6700\u5927\u56DE\u64A4\u8D77\u6B62\u533A\u95F4",
|
|
18
|
-
maxDrawdown: "\u6700\u5927\u56DE\u64A4",
|
|
19
|
-
excessMaxDrawdown: "\u8D85\u989D\u6700\u5927\u56DE\u64A4",
|
|
20
|
-
maxDrawdownDays: "\u6700\u5927\u56DE\u64A4\u56DE\u8865\u671F\uFF08\u5929\uFF09",
|
|
21
|
-
excessMaxDrawdownDays: "\u8D85\u989D\u6700\u5927\u56DE\u64A4\u56DE\u8865\u671F\uFF08\u5929\uFF09",
|
|
22
|
-
maxNormalDays: "\u6700\u957F\u8FDE\u7EED\u4E0D\u521B\u65B0\u9AD8\u5929\u6570\uFF08\u5929\uFF09",
|
|
23
|
-
excessMaxNormalDays: "\u8D85\u989D\u6700\u957F\u8FDE\u7EED\u4E0D\u521B\u65B0\u9AD8\u5929\u6570\uFF08\u5929\uFF09",
|
|
24
|
-
annualReturn: "\u5E74\u5316\u6536\u76CA",
|
|
25
|
-
excessAnnualReturn: "\u8D85\u989D\u5E74\u5316\u6536\u76CA",
|
|
26
|
-
corr: "\u76F8\u5173\u7CFB\u6570",
|
|
27
|
-
informationRatio: "\u4FE1\u606F\u6BD4\u7387",
|
|
28
|
-
trackingError: "\u8DDF\u8E2A\u8BEF\u5DEE",
|
|
29
|
-
alpha: "Alpha",
|
|
30
|
-
beta: "Beta",
|
|
31
|
-
skew: "\u504F\u5EA6",
|
|
32
|
-
kurt: "\u5CF0\u5EA6",
|
|
33
|
-
cVaR: "VaR\uFF0895%\u7F6E\u4FE1\uFF09",
|
|
34
|
-
indexReturns: "\u540C\u671F\u6307\u6570\u6536\u76CA",
|
|
35
|
-
"01": "1\u6708",
|
|
36
|
-
"02": "2\u6708",
|
|
37
|
-
"03": "3\u6708",
|
|
38
|
-
"04": "4\u6708",
|
|
39
|
-
"05": "5\u6708",
|
|
40
|
-
"06": "6\u6708",
|
|
41
|
-
"07": "7\u6708",
|
|
42
|
-
"08": "8\u6708",
|
|
43
|
-
"09": "9\u6708",
|
|
44
|
-
"10": "10\u6708",
|
|
45
|
-
"11": "11\u6708",
|
|
46
|
-
"12": "12\u6708",
|
|
47
|
-
MonthlyPositiveRatio: "\u6708\u80DC\u7387",
|
|
48
|
-
all_year: "\u5168\u5E74"
|
|
49
|
-
};
|
|
50
|
-
const basicText4 = (val) => {
|
|
51
|
-
return val === "-" || val === void 0 ? "-" : val.toFixed(4);
|
|
52
|
-
};
|
|
53
|
-
const percentage = (val) => {
|
|
54
|
-
return val === "-" || val === void 0 ? "-" : (val * 100).toFixed(2) + "%";
|
|
55
|
-
};
|
|
56
|
-
const absPercentage = (val) => {
|
|
57
|
-
return val === "-" || val === void 0 ? "-" : Math.abs(val * 100).toFixed(2) + "%";
|
|
58
|
-
};
|
|
59
|
-
const CLOUMN_DEAL = {
|
|
60
|
-
basicText4,
|
|
61
|
-
colorText: basicText4,
|
|
62
|
-
colorPercentage: percentage,
|
|
63
|
-
percentage,
|
|
64
|
-
absPercentage,
|
|
65
|
-
notProcessed: null,
|
|
66
|
-
other: null
|
|
67
|
-
};
|
|
68
|
-
const convertKey = (data, key) => {
|
|
69
|
-
const newKey = key.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
70
|
-
return data[key] || data[newKey];
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export { CLOUMN_DEAL, TABLE_KEY, convertKey };
|
package/es/defaults.d.ts
DELETED
package/es/defaults.mjs
DELETED
package/es/index.d.ts
DELETED
package/es/index.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import installer from './defaults.mjs';
|
|
2
|
-
export { makeInstaller } from './make-installer.mjs';
|
|
3
|
-
export { HtElTable } from './components/elTable/index.mjs';
|
|
4
|
-
export { HtChart } from './components/chart/index.mjs';
|
|
5
|
-
export { columnDealProps, elTableProps } from './components/elTable/src/elTable.mjs';
|
|
6
|
-
export { chartProps } from './components/chart/src/HtChart.mjs';
|
|
7
|
-
|
|
8
|
-
const install = installer.install;
|
|
9
|
-
|
|
10
|
-
export { installer as default, install };
|
package/es/make-installer.d.ts
DELETED
package/es/make-installer.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { INSTALLED_KEY } from './constants/key.mjs';
|
|
2
|
-
|
|
3
|
-
const makeInstaller = (components = []) => {
|
|
4
|
-
const install = (app) => {
|
|
5
|
-
if (app[INSTALLED_KEY]) return;
|
|
6
|
-
app[INSTALLED_KEY] = true;
|
|
7
|
-
components.forEach((c) => app.use(c));
|
|
8
|
-
};
|
|
9
|
-
return {
|
|
10
|
-
install
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { makeInstaller };
|
package/es/plugin.d.ts
DELETED
package/es/plugin.mjs
DELETED
package/es/utils/chart.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { chartProp } from 'hfn-components/es/components/chart';
|
|
2
|
-
export type chartType = 'category' | 'time';
|
|
3
|
-
export declare const legendEnterOperate: (options: any, name: string) => void;
|
|
4
|
-
export declare const legendLeaveOperate: (options: any) => void;
|
|
5
|
-
export declare const setEchartXAxis: (options: any, type: chartType, xAxisData: string[]) => void;
|
|
6
|
-
export declare const setEchartYAxis: (options: any, props: chartProp) => void;
|
|
7
|
-
export declare const setEchartTooltip: (options: any, props: chartProp) => void;
|
package/es/utils/chart.mjs
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
const legendEnterOperate = (options, name) => {
|
|
2
|
-
options.series.forEach((series) => {
|
|
3
|
-
if (series.name === name) {
|
|
4
|
-
if (series.type === "line") {
|
|
5
|
-
if (series.lineStyle) {
|
|
6
|
-
series.lineStyle.opacity = 1;
|
|
7
|
-
} else {
|
|
8
|
-
series.lineStyle = {
|
|
9
|
-
opacity: 1
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
} else if (series.type === "bar") {
|
|
13
|
-
if (series.itemStyle) {
|
|
14
|
-
series.itemStyle.opacity = 1;
|
|
15
|
-
} else {
|
|
16
|
-
series.itemStyle = {
|
|
17
|
-
opacity: 1
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
if (series.type === "line") {
|
|
23
|
-
if (series.lineStyle) {
|
|
24
|
-
series.lineStyle.opacity = 0.1;
|
|
25
|
-
} else {
|
|
26
|
-
series.lineStyle = {
|
|
27
|
-
opacity: 0.1
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
} else if (series.type === "bar") {
|
|
31
|
-
if (series.itemStyle) {
|
|
32
|
-
series.itemStyle.opacity = 0.1;
|
|
33
|
-
} else {
|
|
34
|
-
series.itemStyle = {
|
|
35
|
-
opacity: 0.1
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
const legendLeaveOperate = (options) => {
|
|
43
|
-
options.series.forEach((series) => {
|
|
44
|
-
if (series.type === "line") {
|
|
45
|
-
if (series.lineStyle) {
|
|
46
|
-
series.lineStyle.opacity = 1;
|
|
47
|
-
} else {
|
|
48
|
-
series.lineStyle = {
|
|
49
|
-
opacity: 1
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
} else if (series.type === "bar") {
|
|
53
|
-
if (series.itemStyle) {
|
|
54
|
-
series.itemStyle.opacity = 1;
|
|
55
|
-
} else {
|
|
56
|
-
series.itemStyle = {
|
|
57
|
-
opacity: 1
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const setEchartXAxis = (options, type, xAxisData) => {
|
|
64
|
-
if (type === "category") {
|
|
65
|
-
const xAxis = [...xAxisData];
|
|
66
|
-
options.xAxis = {
|
|
67
|
-
type,
|
|
68
|
-
data: xAxis,
|
|
69
|
-
axisTick: {
|
|
70
|
-
alignWithLabel: true
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
} else if (type === "time") {
|
|
74
|
-
options.xAxis = {
|
|
75
|
-
type,
|
|
76
|
-
minInterval: 24 * 60 * 60 * 1e3,
|
|
77
|
-
axisLine: {
|
|
78
|
-
onZero: false
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const setEchartYAxis = (options, props) => {
|
|
84
|
-
options.yAxis = {
|
|
85
|
-
type: "value",
|
|
86
|
-
axisLabel: {
|
|
87
|
-
show: true,
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
-
formatter: function(val) {
|
|
90
|
-
return (props.yAxisUnit === "%" ? val > 0 ? "+" : "" : "") + parseFloat(val.toFixed(props.floatNumber)) + props.yAxisUnit;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
const setEchartTooltip = (options, props) => {
|
|
96
|
-
options.tooltip = {
|
|
97
|
-
trigger: "axis",
|
|
98
|
-
// tooltip提示框格式自定义
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
-
formatter: function(paramItems) {
|
|
101
|
-
let html = "";
|
|
102
|
-
if (Array.isArray(paramItems)) {
|
|
103
|
-
const params = paramItems.filter((item) => item.data !== void 0 && item.data !== null);
|
|
104
|
-
if (params.length === 0) return "";
|
|
105
|
-
if (props.chartType === "category") {
|
|
106
|
-
params.sort((a, b) => b.value - a.value);
|
|
107
|
-
} else {
|
|
108
|
-
params.sort((a, b) => {
|
|
109
|
-
if (Array.isArray(a.value) && Array.isArray(b.value)) {
|
|
110
|
-
return props.collation === "des" ? b.value[1] - a.value[1] : a.value[1] - b.value[1];
|
|
111
|
-
} else {
|
|
112
|
-
return 0;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
html += `<div>${props.chartType === "category" ? params[0].name : Array.isArray(params[0].value) ? params[0].value[0] : ""}</div>`;
|
|
117
|
-
if (params.length > 30) html += '<div style="display: flex;">';
|
|
118
|
-
const len = Math.ceil(params.length / 3);
|
|
119
|
-
for (let i = 0; i < params.length; i++) {
|
|
120
|
-
if ((i + 1) % len === 1 && params.length > 30) {
|
|
121
|
-
html += '<div style="display: flex; flex-direction: column;">';
|
|
122
|
-
}
|
|
123
|
-
if (params[i].value === void 0 || params[i].value === null) ; else {
|
|
124
|
-
html += '<div style="display: flex;align-items:center">';
|
|
125
|
-
html += `<span
|
|
126
|
-
style="display:inline-block;
|
|
127
|
-
margin-right:5px;
|
|
128
|
-
border-radius:10px;
|
|
129
|
-
width:10px;height:10px;
|
|
130
|
-
background-color:${params[i].color};
|
|
131
|
-
">
|
|
132
|
-
</span>`;
|
|
133
|
-
if (props.isReturn) {
|
|
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
|
-
}
|
|
144
|
-
} else {
|
|
145
|
-
if (props.chartType === "category") {
|
|
146
|
-
html += `<span style='color:${params[i].color}'>
|
|
147
|
-
${params[i].seriesName.includes("series") ? params[i].name : params[i].seriesName}
|
|
148
|
-
</span>\uFF1A
|
|
149
|
-
${params[i].value.toFixed(props.floatNumber)}${props.tooltipUnit}
|
|
150
|
-
`;
|
|
151
|
-
} else {
|
|
152
|
-
html += `<span style='color:${params[i].color}'>${params[i].seriesName}</span>\uFF1A${params[i].value[1]?.toFixed(props.floatNumber)}${props.tooltipUnit}`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
html += "</div>";
|
|
156
|
-
}
|
|
157
|
-
if ((i + 1) % len === 0 && params.length > 30) {
|
|
158
|
-
html += "</div>";
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (params.length > 30) html += "</div>";
|
|
162
|
-
}
|
|
163
|
-
return html;
|
|
164
|
-
},
|
|
165
|
-
textStyle: {
|
|
166
|
-
color: "rgba(0,0,0,0.7)"
|
|
167
|
-
// 设置文字颜色
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export { legendEnterOperate, legendLeaveOperate, setEchartTooltip, setEchartXAxis, setEchartYAxis };
|
package/es/utils/common.d.ts
DELETED
package/es/utils/common.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const withInstall = (main, extra) => {
|
|
2
|
-
main.install = (app) => {
|
|
3
|
-
for (const comp of [main, ...Object.values(extra ?? {})]) {
|
|
4
|
-
app.component(comp.name, comp);
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
if (extra) {
|
|
8
|
-
for (const [key, comp] of Object.entries(extra)) {
|
|
9
|
-
main[key] = comp;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return main;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { withInstall };
|
package/es/utils/index.d.ts
DELETED
package/es/utils/index.mjs
DELETED
package/es/utils/table.d.ts
DELETED
package/es/utils/table.mjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { splitK } from './tool.mjs';
|
|
2
|
-
|
|
3
|
-
const handleData = (value, type) => {
|
|
4
|
-
if (isNaN(parseFloat(value))) return "-";
|
|
5
|
-
let val = parseFloat(value);
|
|
6
|
-
if (type.includes("percent")) {
|
|
7
|
-
val = val * 100;
|
|
8
|
-
}
|
|
9
|
-
const floatMatch = type.match(/float(\d+)/);
|
|
10
|
-
if (floatMatch) {
|
|
11
|
-
const precision = Number(floatMatch[1]);
|
|
12
|
-
val = val.toFixed(precision);
|
|
13
|
-
}
|
|
14
|
-
if (type.includes("splitK")) {
|
|
15
|
-
val = splitK(val);
|
|
16
|
-
}
|
|
17
|
-
if (type.includes("sign")) {
|
|
18
|
-
val = Number(val) > 0 ? "+" + val : val;
|
|
19
|
-
}
|
|
20
|
-
if (type.includes("percent")) {
|
|
21
|
-
val = val + "%";
|
|
22
|
-
}
|
|
23
|
-
return val;
|
|
24
|
-
};
|
|
25
|
-
const handleText = (value, type) => {
|
|
26
|
-
if (type === "name") {
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { handleData, handleText };
|
package/es/utils/tool.d.ts
DELETED
package/es/utils/tool.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
function dataHandle(val, isPer, floatNum) {
|
|
2
|
-
val = parseFloat(val);
|
|
3
|
-
if (isNaN(val)) {
|
|
4
|
-
return "-";
|
|
5
|
-
} else {
|
|
6
|
-
if (isPer) {
|
|
7
|
-
val = val * 100;
|
|
8
|
-
}
|
|
9
|
-
if (Number(val.toFixed(floatNum)) === 0) {
|
|
10
|
-
const a = 0;
|
|
11
|
-
return a.toFixed(floatNum);
|
|
12
|
-
} else {
|
|
13
|
-
return val.toFixed(floatNum);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function splitK(num) {
|
|
18
|
-
let decimal = String(num).split(".")[1] || "";
|
|
19
|
-
if (decimal === "") {
|
|
20
|
-
decimal = "00";
|
|
21
|
-
}
|
|
22
|
-
const tempArr = [];
|
|
23
|
-
const revNumArr = String(num).split(".")[0].split("").reverse();
|
|
24
|
-
const mark = revNumArr[revNumArr.length - 1];
|
|
25
|
-
if (mark === "-") {
|
|
26
|
-
revNumArr.splice(-1, 1);
|
|
27
|
-
}
|
|
28
|
-
for (const i in revNumArr) {
|
|
29
|
-
tempArr.push(revNumArr[i]);
|
|
30
|
-
const index = parseFloat(i);
|
|
31
|
-
if ((index + 1) % 3 === 0 && Number(i) !== revNumArr.length - 1) {
|
|
32
|
-
tempArr.push(",");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (mark === "-") {
|
|
36
|
-
tempArr.push(mark);
|
|
37
|
-
}
|
|
38
|
-
const zs = tempArr.reverse().join("");
|
|
39
|
-
return decimal ? zs + "." + decimal : zs;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { dataHandle, splitK };
|
package/global.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// declare module '*.vue' {
|
|
2
|
-
// import { defineComponent } from 'vue'
|
|
3
|
-
// const componentOptions:ReturnType<typeof defineComponent>
|
|
4
|
-
// export default componentOptions
|
|
5
|
-
// }
|
|
6
|
-
|
|
7
|
-
declare module '@vue/runtime-core' {
|
|
8
|
-
export interface GlobalComponents {
|
|
9
|
-
HtTable: (typeof import('hfn-components'))['HtTable']
|
|
10
|
-
}
|
|
11
|
-
interface ComponentCustomProperties {
|
|
12
|
-
// 你可以在这里添加自定义属性
|
|
13
|
-
}
|
|
14
|
-
}
|
package/theme-chalk/ht-chart.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.echart-box{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.echart-content{flex:auto}.echart-lenged{box-sizing:border-box;display:flex;flex-wrap:wrap;font-size:12px;height:auto;margin-top:6px;padding-right:22px;position:relative;width:100%;z-index:999}.bg-span{height:2px;width:14px}.bg-span,.bg-span-bar{display:inline-block;margin-right:6px}.bg-span-bar{border-radius:2px;height:10px;width:16px}.span-box{cursor:pointer;margin-left:5px;margin-right:6px}.noData,.span-box{align-items:center;display:flex}.noData{bottom:0;color:#ccc;font-size:16px;height:100%;justify-content:center;position:absolute;width:100%}
|
package/theme-chalk/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.echart-box{display:flex;flex-direction:column;height:100%;position:relative;width:100%}.echart-content{flex:auto}.echart-lenged{box-sizing:border-box;display:flex;flex-wrap:wrap;font-size:12px;height:auto;margin-top:6px;padding-right:22px;position:relative;width:100%;z-index:999}.bg-span{height:2px;width:14px}.bg-span,.bg-span-bar{display:inline-block;margin-right:6px}.bg-span-bar{border-radius:2px;height:10px;width:16px}.span-box{cursor:pointer;margin-left:5px;margin-right:6px}.noData,.span-box{align-items:center;display:flex}.noData{bottom:0;color:#ccc;font-size:16px;height:100%;justify-content:center;position:absolute;width:100%}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.echart-box {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
position: relative;
|
|
7
|
-
}
|
|
8
|
-
.echart-content {
|
|
9
|
-
flex: auto;
|
|
10
|
-
}
|
|
11
|
-
.echart-lenged {
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: auto;
|
|
14
|
-
margin-top: 6px;
|
|
15
|
-
padding-right: 22px;
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
position: relative;
|
|
21
|
-
z-index: 999;
|
|
22
|
-
}
|
|
23
|
-
.bg-span {
|
|
24
|
-
display: inline-block;
|
|
25
|
-
width: 14px;
|
|
26
|
-
height: 2px;
|
|
27
|
-
margin-right: 6px;
|
|
28
|
-
}
|
|
29
|
-
.bg-span-bar {
|
|
30
|
-
display: inline-block;
|
|
31
|
-
width: 16px;
|
|
32
|
-
height: 10px;
|
|
33
|
-
border-radius: 2px;
|
|
34
|
-
margin-right: 6px;
|
|
35
|
-
}
|
|
36
|
-
.span-box {
|
|
37
|
-
margin-left: 5px;
|
|
38
|
-
margin-right: 6px;
|
|
39
|
-
cursor: pointer;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
.noData {
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
font-size: 16px;
|
|
47
|
-
display: flex;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
align-items: center;
|
|
50
|
-
position: absolute;
|
|
51
|
-
bottom: 0px;
|
|
52
|
-
color: #ccc;
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@use './chart.scss';
|