@topdatasec/report 1.0.8 → 1.0.10
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/LICENSE +21 -0
- package/README.md +218 -0
- package/lib/index.d.ts +5 -8
- package/{es/bar/Bar.d.ts → lib/report/components/Bar.vue.d.ts} +2 -2
- package/{es/pie/Pie.d.ts → lib/report/components/Line.vue.d.ts} +2 -2
- package/{es/line/Line.d.ts → lib/report/components/Pie.vue.d.ts} +2 -2
- package/{es/time/Time.d.ts → lib/report/components/RangeTime.vue.d.ts} +3 -3
- package/lib/report/components/Report.vue.d.ts +18 -0
- package/{es/table/Table.d.ts → lib/report/components/ReportChart.vue.d.ts} +2 -2
- package/lib/report/components/ReportDescribe.vue.d.ts +5 -0
- package/{es/select/Select.d.ts → lib/report/components/ReportSelect.vue.d.ts} +3 -3
- package/lib/report/components/ReportTable.vue.d.ts +5 -0
- package/lib/report/components/ReportText.vue.d.ts +5 -0
- package/lib/report/components/SettingTable.vue.d.ts +2 -0
- package/lib/report/components/editor/components/Setting.vue.d.ts +2 -0
- package/lib/report/components/editor/index.vue.d.ts +24 -0
- package/{es/settingFilter/settingFilter.d.ts → lib/report/components/preview/Catalogue.vue.d.ts} +5 -3
- package/lib/report/components/preview/index.vue.d.ts +24 -0
- package/lib/report/index.d.ts +5 -8
- package/lib/report/index.vue.d.ts +2 -0
- package/lib/stores/interface/index.d.ts +1 -0
- package/lib/stores/modules/report.d.ts +10 -9
- package/lib/style.css +1 -0
- package/lib/tds-report-ui.es.js +26431 -0
- package/lib/tds-report-ui.umd.js +205 -0
- package/lib/utils/api.d.ts +6 -0
- package/lib/utils/chartsOption.d.ts +45 -12
- package/lib/utils/index.d.ts +1 -41
- package/lib/withInstall.d.ts +4 -0
- package/package.json +69 -88
- package/README.zh-CN.md +0 -0
- package/dist/index.iife.js +0 -1
- package/dist/index.js +0 -919
- package/dist/index.umd.cjs +0 -1
- package/dist/style.css +0 -1
- package/es/_virtual/_plugin-vue_export-helper.js +0 -9
- package/es/bar/Bar.vue.js +0 -20
- package/es/bar/Bar.vue2.js +0 -4
- package/es/bar/index.d.ts +0 -15
- package/es/bar/index.js +0 -6
- package/es/components.d.ts +0 -4
- package/es/components.js +0 -8
- package/es/config/Config.css +0 -1
- package/es/config/Config.vue.js +0 -7
- package/es/config/Config.vue2.js +0 -207
- package/es/config/index.d.ts +0 -14
- package/es/config/index.js +0 -6
- package/es/index.d.ts +0 -10
- package/es/index.js +0 -38
- package/es/line/Line.vue.js +0 -20
- package/es/line/Line.vue2.js +0 -4
- package/es/line/index.d.ts +0 -15
- package/es/line/index.js +0 -6
- package/es/pie/index.d.ts +0 -15
- package/es/report/Report.d.ts +0 -7
- package/es/report/index.d.ts +0 -17
- package/es/select/index.d.ts +0 -25
- package/es/settingCharts/SettingCharts.d.ts +0 -5
- package/es/settingCharts/index.d.ts +0 -14
- package/es/settingFilter/index.d.ts +0 -15
- package/es/settingTable/index.d.ts +0 -14
- package/es/settingText/index.d.ts +0 -15
- package/es/settingText/settingText.d.ts +0 -5
- package/es/settingTitle/index.d.ts +0 -14
- package/es/stores/interface/index.d.ts +0 -18
- package/es/stores/modules/report.d.ts +0 -35
- package/es/stores/modules/report.js +0 -45
- package/es/style/global.css +0 -1
- package/es/table/index.d.ts +0 -15
- package/es/text/Text.d.ts +0 -5
- package/es/text/index.d.ts +0 -15
- package/es/time/index.d.ts +0 -25
- package/es/utils/api.d.ts +0 -12
- package/es/utils/api.js +0 -9
- package/es/utils/chartsOption.d.ts +0 -298
- package/es/utils/chartsOption.js +0 -187
- package/es/utils/data.d.ts +0 -4
- package/es/utils/data.js +0 -101
- package/es/utils/index.d.ts +0 -43
- package/es/utils/index.js +0 -309
- package/es/utils/resolver.d.ts +0 -11
- package/es/utils/resolver.js +0 -36
- package/es/utils/type.d.ts +0 -2
- package/es/utils/type.js +0 -9
- package/lib/_virtual/_plugin-vue_export-helper.cjs +0 -1
- package/lib/bar/Bar.d.ts +0 -5
- package/lib/bar/Bar.vue.cjs +0 -1
- package/lib/bar/Bar.vue2.cjs +0 -1
- package/lib/bar/index.cjs +0 -1
- package/lib/bar/index.d.ts +0 -15
- package/lib/components.cjs +0 -1
- package/lib/components.d.ts +0 -4
- package/lib/config/Config.css +0 -1
- package/lib/config/Config.vue.cjs +0 -1
- package/lib/config/Config.vue2.cjs +0 -1
- package/lib/config/index.cjs +0 -1
- package/lib/config/index.d.ts +0 -14
- package/lib/index.cjs +0 -1
- package/lib/line/Line.d.ts +0 -5
- package/lib/line/Line.vue.cjs +0 -1
- package/lib/line/Line.vue2.cjs +0 -1
- package/lib/line/index.cjs +0 -1
- package/lib/line/index.d.ts +0 -15
- package/lib/pie/Pie.d.ts +0 -5
- package/lib/pie/index.d.ts +0 -15
- package/lib/report/Report.d.ts +0 -7
- package/lib/select/Select.d.ts +0 -9
- package/lib/select/index.d.ts +0 -25
- package/lib/settingCharts/SettingCharts.d.ts +0 -5
- package/lib/settingCharts/index.d.ts +0 -14
- package/lib/settingFilter/index.d.ts +0 -15
- package/lib/settingFilter/settingFilter.d.ts +0 -5
- package/lib/settingTable/index.d.ts +0 -14
- package/lib/settingText/index.d.ts +0 -15
- package/lib/settingText/settingText.d.ts +0 -5
- package/lib/settingTitle/index.d.ts +0 -14
- package/lib/stores/modules/report.cjs +0 -1
- package/lib/style/global.css +0 -1
- package/lib/table/Table.d.ts +0 -5
- package/lib/table/index.d.ts +0 -15
- package/lib/text/Text.d.ts +0 -5
- package/lib/text/index.d.ts +0 -15
- package/lib/time/Time.d.ts +0 -9
- package/lib/time/index.d.ts +0 -25
- package/lib/utils/api.cjs +0 -1
- package/lib/utils/chartsOption.cjs +0 -1
- package/lib/utils/data.cjs +0 -1
- package/lib/utils/index.cjs +0 -1
- package/lib/utils/resolver.cjs +0 -1
- package/lib/utils/resolver.d.ts +0 -11
- package/lib/utils/type.cjs +0 -1
- package/lib/utils/type.d.ts +0 -2
- /package/{es/config/Config.d.ts → lib/report/components/ChartsUniConfig.vue.d.ts} +0 -0
- /package/{es/settingTable/SettingTable.d.ts → lib/report/components/SettingCharts.vue.d.ts} +0 -0
- /package/lib/{settingTable/SettingTable.d.ts → report/components/SettingDescribe.vue.d.ts} +0 -0
- /package/{es/settingTitle/settingTitle.d.ts → lib/report/components/SettingFilter.vue.d.ts} +0 -0
- /package/lib/{config/Config.d.ts → report/components/SettingText.vue.d.ts} +0 -0
- /package/lib/{settingTitle/settingTitle.d.ts → report/components/SettingTitle.vue.d.ts} +0 -0
package/es/utils/chartsOption.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import "echarts";
|
|
2
|
-
const n = "rgba(51, 51, 51, 0.15)", r = "rgba(51, 51, 51, 1)", c = 12, m = (a = !1) => {
|
|
3
|
-
const t = {
|
|
4
|
-
// top: '2%',
|
|
5
|
-
left: "3%",
|
|
6
|
-
right: "3%",
|
|
7
|
-
bottom: "2%",
|
|
8
|
-
containLabel: !0
|
|
9
|
-
};
|
|
10
|
-
return a && (t.top = "5%"), t;
|
|
11
|
-
}, e = [
|
|
12
|
-
"46, 145, 255",
|
|
13
|
-
"48, 212, 183",
|
|
14
|
-
"108, 108, 255",
|
|
15
|
-
"109, 237, 124",
|
|
16
|
-
"128, 218, 236",
|
|
17
|
-
"58, 200, 218",
|
|
18
|
-
"146, 218, 89",
|
|
19
|
-
"118, 218, 218",
|
|
20
|
-
"143, 192, 244",
|
|
21
|
-
"192, 192, 145",
|
|
22
|
-
"153, 136, 204",
|
|
23
|
-
"212, 217, 230",
|
|
24
|
-
"124, 186, 255",
|
|
25
|
-
"209, 182, 225",
|
|
26
|
-
"255, 197, 84",
|
|
27
|
-
"249, 140, 106",
|
|
28
|
-
"246, 179, 82",
|
|
29
|
-
"100, 161, 206",
|
|
30
|
-
"246, 175, 159",
|
|
31
|
-
"238, 97, 97"
|
|
32
|
-
], f = (a = [
|
|
33
|
-
{
|
|
34
|
-
name: "数据1",
|
|
35
|
-
value: 63
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: "数据2",
|
|
39
|
-
value: 45
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "数据3",
|
|
43
|
-
value: 43
|
|
44
|
-
}
|
|
45
|
-
], t = { name: "name", value: "value" }) => {
|
|
46
|
-
const i = (o = "rgba(46, 145, 255, 0.7)", s = "rgba(46, 145, 255, 0.2)") => ({
|
|
47
|
-
color: {
|
|
48
|
-
type: "linear",
|
|
49
|
-
x: 0,
|
|
50
|
-
y: 0,
|
|
51
|
-
x2: 0,
|
|
52
|
-
y2: 1,
|
|
53
|
-
colorStops: [
|
|
54
|
-
{
|
|
55
|
-
offset: 0,
|
|
56
|
-
color: o
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
offset: 0.8,
|
|
60
|
-
color: s
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
}), l = a.map((o) => o[t.value]);
|
|
65
|
-
return {
|
|
66
|
-
// 提示框组件
|
|
67
|
-
tooltip: {
|
|
68
|
-
trigger: "item"
|
|
69
|
-
//触发类型,axis:坐标轴触发
|
|
70
|
-
},
|
|
71
|
-
// 图例组件
|
|
72
|
-
// legend: {
|
|
73
|
-
// type: 'plain', //plain:普通图例;scroll:可滚动翻页的图例。当图例数量较多时使。
|
|
74
|
-
// show: true,
|
|
75
|
-
// },
|
|
76
|
-
grid: m(),
|
|
77
|
-
title: {
|
|
78
|
-
show: !0,
|
|
79
|
-
text: "样例数据",
|
|
80
|
-
textStyle: {
|
|
81
|
-
color: "#333",
|
|
82
|
-
fontSize: 18
|
|
83
|
-
},
|
|
84
|
-
x: 10,
|
|
85
|
-
y: 10
|
|
86
|
-
},
|
|
87
|
-
// x 轴设置
|
|
88
|
-
xAxis: [
|
|
89
|
-
{
|
|
90
|
-
type: "category",
|
|
91
|
-
nameGap: 8,
|
|
92
|
-
// X轴名称与轴线之间的距离
|
|
93
|
-
nameRotate: 0,
|
|
94
|
-
// 坐标轴名称旋转
|
|
95
|
-
axisLabel: {
|
|
96
|
-
color: r,
|
|
97
|
-
// X轴类目名称样式
|
|
98
|
-
rotate: 0
|
|
99
|
-
// X轴类目名称旋转角度
|
|
100
|
-
},
|
|
101
|
-
axisLine: {
|
|
102
|
-
//X轴轴线设置
|
|
103
|
-
show: !0,
|
|
104
|
-
lineStyle: {
|
|
105
|
-
color: n,
|
|
106
|
-
width: 1
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
axisTick: { show: !1 },
|
|
110
|
-
// X轴刻度相关设置
|
|
111
|
-
splitLine: { show: !1 },
|
|
112
|
-
// 横向分隔线
|
|
113
|
-
data: a.map((o) => o[t.name])
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
// y轴设置
|
|
117
|
-
yAxis: [
|
|
118
|
-
{
|
|
119
|
-
type: "value",
|
|
120
|
-
min: 0,
|
|
121
|
-
// 坐标轴刻度最小值
|
|
122
|
-
position: "left",
|
|
123
|
-
nameTextStyle: {
|
|
124
|
-
fontSize: c,
|
|
125
|
-
color: r,
|
|
126
|
-
fontWeight: "bold"
|
|
127
|
-
},
|
|
128
|
-
axisLine: { show: !1 },
|
|
129
|
-
// y轴轴线设置
|
|
130
|
-
axisTick: { show: !1 },
|
|
131
|
-
// 刻度设置
|
|
132
|
-
splitLine: { show: !1 },
|
|
133
|
-
// 纵向分隔线
|
|
134
|
-
axisLabel: {
|
|
135
|
-
color: r,
|
|
136
|
-
// y轴刻度标签
|
|
137
|
-
formatter: "{value}",
|
|
138
|
-
inside: !1
|
|
139
|
-
// 刻度标签是否朝内,默认朝外
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
],
|
|
143
|
-
series: [
|
|
144
|
-
{
|
|
145
|
-
type: "bar",
|
|
146
|
-
barWidth: 15,
|
|
147
|
-
barGap: "0%",
|
|
148
|
-
itemStyle: i(`rgba(${e[0]}, 0.7)`, `rgba(${e[0]}, 0.2)`),
|
|
149
|
-
data: l,
|
|
150
|
-
label: {
|
|
151
|
-
show: !0,
|
|
152
|
-
// 显示标签
|
|
153
|
-
position: "top",
|
|
154
|
-
// 标签位置
|
|
155
|
-
color: "inherit",
|
|
156
|
-
// 标签颜色
|
|
157
|
-
lineHeight: 24
|
|
158
|
-
// 行高
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
// 柱底圆片
|
|
163
|
-
name: "",
|
|
164
|
-
type: "pictorialBar",
|
|
165
|
-
symbolSize: [15, 10],
|
|
166
|
-
//调整截面形状
|
|
167
|
-
symbolOffset: [0, 5],
|
|
168
|
-
itemStyle: i(`rgba(${e[0]}, 0.7)`, `rgba(${e[0]}, 0.2)`),
|
|
169
|
-
data: l
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
// 柱顶圆片
|
|
173
|
-
name: "",
|
|
174
|
-
type: "pictorialBar",
|
|
175
|
-
symbolSize: [15, 10],
|
|
176
|
-
//调整截面形状
|
|
177
|
-
symbolOffset: [0, -5],
|
|
178
|
-
symbolPosition: "end",
|
|
179
|
-
itemStyle: i(`rgba(${e[0]}, 0.9)`, `rgba(${e[0]}, 1)`),
|
|
180
|
-
data: l
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
};
|
|
184
|
-
};
|
|
185
|
-
export {
|
|
186
|
-
f as chartsBar
|
|
187
|
-
};
|
package/es/utils/data.d.ts
DELETED
package/es/utils/data.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { getUniId as t } from "./index.js";
|
|
2
|
-
import { chartsBar as n } from "./chartsOption.js";
|
|
3
|
-
const e = [
|
|
4
|
-
{ key: "assets", name: "资产名称" },
|
|
5
|
-
{ key: "type", name: "资产类型" },
|
|
6
|
-
{ key: "data", name: "资产数据" }
|
|
7
|
-
], a = [
|
|
8
|
-
{ assets: "name1", type: "type1", data: "data1" },
|
|
9
|
-
{ assets: "name2", type: "type2", data: "data2" },
|
|
10
|
-
{ assets: "name3", type: "type3", data: "data3" }
|
|
11
|
-
], o = [
|
|
12
|
-
{ data: [{ name: "默认数据", value: 180 }], label: "name1" },
|
|
13
|
-
{ data: [{ name: "默认数据", value: 311 }], label: "name2" },
|
|
14
|
-
{ data: [{ name: "默认数据", value: 42 }], label: "name3" },
|
|
15
|
-
{ data: [{ name: "默认数据", value: 32391 }], label: "name4" }
|
|
16
|
-
], d = [
|
|
17
|
-
{
|
|
18
|
-
type: "report-select",
|
|
19
|
-
label: "资产:",
|
|
20
|
-
value: "0",
|
|
21
|
-
data: [
|
|
22
|
-
{
|
|
23
|
-
label: "全部",
|
|
24
|
-
data: "0"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
label: "10.10.2.20_root",
|
|
28
|
-
data: "743dbb32-8a41-4990-9d76-48925b000a93"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
label: "10.10.4.206_sysdba",
|
|
32
|
-
data: "23193788-c895-47a8-8123-65799540394c"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
label: "10.10.4.26_root@/root/files/",
|
|
36
|
-
data: "bb7b07c9-b96b-4caf-ac76-bb45ae849844"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
uri: "/da/report/sens/get_asset_all",
|
|
40
|
-
id: t()
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
type: "range-time",
|
|
44
|
-
data: [
|
|
45
|
-
{
|
|
46
|
-
start_time: "2024-08-20 19:49:34",
|
|
47
|
-
end_time: "2024-09-12 19:49:34"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
id: t()
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: "h1",
|
|
54
|
-
data: "报表名称",
|
|
55
|
-
options: {
|
|
56
|
-
size: 24,
|
|
57
|
-
color: "rgba(0,0,0,0.85)",
|
|
58
|
-
fontWeight: 500,
|
|
59
|
-
letterSpacing: 0,
|
|
60
|
-
textIndent: 0,
|
|
61
|
-
textAlign: "left"
|
|
62
|
-
},
|
|
63
|
-
id: t()
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: "h2",
|
|
67
|
-
data: "一级标题",
|
|
68
|
-
name: "一级标题",
|
|
69
|
-
options: {
|
|
70
|
-
size: 18,
|
|
71
|
-
color: " rgba(0, 0, 0, 0.85)",
|
|
72
|
-
fontWeight: 500,
|
|
73
|
-
letterSpacing: 0,
|
|
74
|
-
textIndent: 0,
|
|
75
|
-
textAlign: "left"
|
|
76
|
-
},
|
|
77
|
-
id: t()
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: "report-table",
|
|
81
|
-
data: a,
|
|
82
|
-
showColumn: e,
|
|
83
|
-
name: "表格",
|
|
84
|
-
options: {
|
|
85
|
-
showColumn: {
|
|
86
|
-
assets: !0,
|
|
87
|
-
type: !0,
|
|
88
|
-
data: !0
|
|
89
|
-
},
|
|
90
|
-
border: !0,
|
|
91
|
-
showHeader: !0,
|
|
92
|
-
stripe: !1
|
|
93
|
-
},
|
|
94
|
-
rp_item_uuid: "",
|
|
95
|
-
id: t()
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
n();
|
|
99
|
-
export {
|
|
100
|
-
d as normalValue
|
|
101
|
-
};
|
package/es/utils/index.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
export declare function dateFormat(value?: number | string | Date, format?: string): string;
|
|
3
|
-
export declare function formatNumber(value: number | string, precision?: number, separator?: string, decimal?: string, prefix?: string, suffix?: string): string;
|
|
4
|
-
export declare function rafTimeout(fn: Function, delay?: number, interval?: boolean): object;
|
|
5
|
-
export declare function cancelRaf(raf: {
|
|
6
|
-
id: number;
|
|
7
|
-
}): void;
|
|
8
|
-
export declare function throttle(fn: Function, delay?: number): any;
|
|
9
|
-
export declare function debounce(fn: Function, delay?: number): any;
|
|
10
|
-
export declare function add(num1: number, num2: number): number;
|
|
11
|
-
export declare function downloadFile(url: string, fileName?: string): void;
|
|
12
|
-
export declare function toggleDark(): void;
|
|
13
|
-
export declare function useMounted(): Ref<boolean, boolean>;
|
|
14
|
-
export declare function useSupported(callback: () => unknown): import('vue').ComputedRef<boolean>;
|
|
15
|
-
export declare function useEventListener(target: HTMLElement | Window | Document, event: string, callback: Function): void;
|
|
16
|
-
export declare function useMutationObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: MutationCallback, options?: {}): {
|
|
17
|
-
stop: () => void;
|
|
18
|
-
start: () => void;
|
|
19
|
-
};
|
|
20
|
-
export declare function useScroll(target?: Ref | HTMLElement | Window | Document, throttleDelay?: number, onScroll?: (e: Event) => void, onStop?: (e: Event) => void): {
|
|
21
|
-
x: Ref<number, number>;
|
|
22
|
-
xScrollMax: Ref<number, number>;
|
|
23
|
-
y: Ref<number, number>;
|
|
24
|
-
yScrollMax: Ref<number, number>;
|
|
25
|
-
isScrolling: Ref<boolean, boolean>;
|
|
26
|
-
left: Ref<boolean, boolean>;
|
|
27
|
-
right: Ref<boolean, boolean>;
|
|
28
|
-
top: Ref<boolean, boolean>;
|
|
29
|
-
bottom: Ref<boolean, boolean>;
|
|
30
|
-
};
|
|
31
|
-
export declare function useFps(): {
|
|
32
|
-
fps: Ref<number, number>;
|
|
33
|
-
};
|
|
34
|
-
export declare function useMediaQuery(mediaQuery: string): {
|
|
35
|
-
match: Ref<boolean, boolean>;
|
|
36
|
-
};
|
|
37
|
-
export declare function useResizeObserver(target: Ref | Ref[] | HTMLElement | HTMLElement[], callback: ResizeObserverCallback, options?: object): {
|
|
38
|
-
stop: () => void;
|
|
39
|
-
start: () => void;
|
|
40
|
-
};
|
|
41
|
-
export declare function useSlotsExist(slotsName?: string | string[]): any;
|
|
42
|
-
export declare const getUniId: () => string;
|
|
43
|
-
export declare const deepClone: <T>(obj: T | T[]) => any;
|
package/es/utils/index.js
DELETED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { onMounted as x, onUnmounted as T, ref as f, computed as h, toValue as S, watch as L, onBeforeUnmount as w, useSlots as H, reactive as R, getCurrentInstance as k, Comment as U, Text as V } from "vue";
|
|
2
|
-
function j(e = Date.now(), n = "YYYY-MM-DD HH:mm:ss") {
|
|
3
|
-
try {
|
|
4
|
-
let t;
|
|
5
|
-
if (typeof e == "number" || typeof e == "string") {
|
|
6
|
-
if (t = new Date(e), isNaN(t.getTime()))
|
|
7
|
-
throw new Error("Invalid date");
|
|
8
|
-
} else
|
|
9
|
-
t = e;
|
|
10
|
-
const r = (i, s = 2) => String(i).padStart(s, "0"), o = (i) => {
|
|
11
|
-
switch (i) {
|
|
12
|
-
case "YYYY":
|
|
13
|
-
return r(t.getFullYear());
|
|
14
|
-
case "YY":
|
|
15
|
-
return r(t.getFullYear()).slice(2, 4);
|
|
16
|
-
case "MM":
|
|
17
|
-
return r(t.getMonth() + 1);
|
|
18
|
-
case "M":
|
|
19
|
-
return String(t.getMonth() + 1);
|
|
20
|
-
case "DD":
|
|
21
|
-
return r(t.getDate());
|
|
22
|
-
case "D":
|
|
23
|
-
return String(t.getDate());
|
|
24
|
-
case "HH":
|
|
25
|
-
return r(t.getHours());
|
|
26
|
-
case "H":
|
|
27
|
-
return String(t.getHours());
|
|
28
|
-
case "mm":
|
|
29
|
-
return r(t.getMinutes());
|
|
30
|
-
case "m":
|
|
31
|
-
return String(t.getMinutes());
|
|
32
|
-
case "ss":
|
|
33
|
-
return r(t.getSeconds());
|
|
34
|
-
case "s":
|
|
35
|
-
return String(t.getSeconds());
|
|
36
|
-
case "SSS":
|
|
37
|
-
return r(t.getMilliseconds(), 3);
|
|
38
|
-
default:
|
|
39
|
-
return i;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
return n.replace(/(YYYY|YY|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)/g, o);
|
|
43
|
-
} catch (t) {
|
|
44
|
-
return console.error("Error formatting date:", t), "";
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function J(e, n = 2, t = ",", r = ".", o, i) {
|
|
48
|
-
typeof e != "number" && typeof e != "string" && console.warn("Expected value to be of type number or string"), typeof n != "number" && console.warn("Expected precision to be of type number");
|
|
49
|
-
const s = Number(e);
|
|
50
|
-
if (isNaN(s) || !isFinite(s))
|
|
51
|
-
return "";
|
|
52
|
-
if (s === 0)
|
|
53
|
-
return s.toFixed(n);
|
|
54
|
-
let c = s.toFixed(n);
|
|
55
|
-
if (typeof t == "string" && t !== "") {
|
|
56
|
-
const [l, d] = c.split(".");
|
|
57
|
-
c = l.replace(/(\d)(?=(\d{3})+$)/g, "$1" + t) + (d ? r + d : "");
|
|
58
|
-
}
|
|
59
|
-
return (o || "") + c + (i || "");
|
|
60
|
-
}
|
|
61
|
-
function P(e, n = 0, t = !1) {
|
|
62
|
-
let r = null;
|
|
63
|
-
function o(s) {
|
|
64
|
-
if (r || (r = s), s - r >= n) {
|
|
65
|
-
try {
|
|
66
|
-
e();
|
|
67
|
-
} catch (l) {
|
|
68
|
-
console.error("Error executing rafTimeout function:", l);
|
|
69
|
-
}
|
|
70
|
-
t && (r = s, i.id = requestAnimationFrame(o));
|
|
71
|
-
} else
|
|
72
|
-
i.id = requestAnimationFrame(o);
|
|
73
|
-
}
|
|
74
|
-
const i = {
|
|
75
|
-
id: requestAnimationFrame(o)
|
|
76
|
-
};
|
|
77
|
-
return i;
|
|
78
|
-
}
|
|
79
|
-
function W(e) {
|
|
80
|
-
e && e.id && typeof e.id == "number" ? cancelAnimationFrame(e.id) : console.warn("cancelRaf received an invalid id:", e);
|
|
81
|
-
}
|
|
82
|
-
function q(e, n = 300) {
|
|
83
|
-
let t = !0;
|
|
84
|
-
return function(...r) {
|
|
85
|
-
return t && (e(...r), t = !1, setTimeout(() => {
|
|
86
|
-
t = !0;
|
|
87
|
-
}, n)), !1;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function I(e, n = 300) {
|
|
91
|
-
let t = null;
|
|
92
|
-
return function(...r) {
|
|
93
|
-
t && clearTimeout(t), t = setTimeout(() => {
|
|
94
|
-
e(...r);
|
|
95
|
-
}, n);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function $(e, n) {
|
|
99
|
-
if (Number.isNaN(e) || Number.isNaN(n))
|
|
100
|
-
throw new Error("Both num1 and num2 must be valid numbers.");
|
|
101
|
-
const t = e % 1 !== 0, r = n % 1 !== 0;
|
|
102
|
-
if (!t && !r)
|
|
103
|
-
return e + n;
|
|
104
|
-
const o = String(e).split(".")[1] ?? "", i = String(n).split(".")[1] ?? "", s = Math.max(o.length, i.length), c = Math.pow(10, s), l = e.toFixed(s), d = n.toFixed(s);
|
|
105
|
-
return (+l.replace(".", "") + +d.replace(".", "")) / c;
|
|
106
|
-
}
|
|
107
|
-
function C(e, n) {
|
|
108
|
-
if (!e) {
|
|
109
|
-
console.error("无效的 url");
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const t = n || e.split("?")[0].split("/").pop() || "download";
|
|
113
|
-
try {
|
|
114
|
-
fetch(e).then((r) => {
|
|
115
|
-
r.ok ? r.blob().then((o) => {
|
|
116
|
-
const i = URL.createObjectURL(o), s = document.createElement("a");
|
|
117
|
-
s.href = i, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i);
|
|
118
|
-
}) : console.error("请求文件失败,状态码:", r.status);
|
|
119
|
-
});
|
|
120
|
-
} catch (r) {
|
|
121
|
-
console.error("文件下载失败:", r);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function Z() {
|
|
125
|
-
const e = document.documentElement;
|
|
126
|
-
e.classList.toggle("dark"), e.classList.contains("dark") ? e.style.colorScheme = "dark" : e.style.colorScheme = "light";
|
|
127
|
-
}
|
|
128
|
-
function z() {
|
|
129
|
-
const e = f(!1), n = k();
|
|
130
|
-
return n && x(() => {
|
|
131
|
-
e.value = !0;
|
|
132
|
-
}, n), e;
|
|
133
|
-
}
|
|
134
|
-
function A(e) {
|
|
135
|
-
const n = z();
|
|
136
|
-
return h(() => (n.value, !!e()));
|
|
137
|
-
}
|
|
138
|
-
function G(e, n, t) {
|
|
139
|
-
x(() => e.addEventListener(n, t)), T(() => e.removeEventListener(n, t));
|
|
140
|
-
}
|
|
141
|
-
function K(e, n, t = {}) {
|
|
142
|
-
const r = A(() => window && "MutationObserver" in window), o = f(!1);
|
|
143
|
-
let i;
|
|
144
|
-
const s = h(() => {
|
|
145
|
-
const a = S(e);
|
|
146
|
-
return a ? Array.isArray(a) ? a.map((m) => S(m)).filter((m) => m) : [a] : [];
|
|
147
|
-
}), c = () => {
|
|
148
|
-
i && (i.disconnect(), i = void 0);
|
|
149
|
-
}, l = () => {
|
|
150
|
-
r.value && s.value.length && !o.value && (i = new MutationObserver(n), s.value.forEach((a) => i.observe(a, t)));
|
|
151
|
-
};
|
|
152
|
-
L(
|
|
153
|
-
() => s.value,
|
|
154
|
-
() => {
|
|
155
|
-
c(), l();
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
immediate: !0,
|
|
159
|
-
// 立即触发回调,以便初始状态也被观察
|
|
160
|
-
flush: "post"
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
const d = () => {
|
|
164
|
-
o.value = !0, c();
|
|
165
|
-
}, v = () => {
|
|
166
|
-
o.value = !1, l();
|
|
167
|
-
};
|
|
168
|
-
return w(() => c()), {
|
|
169
|
-
stop: d,
|
|
170
|
-
start: v
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
function X(e = window, n = 0, t, r) {
|
|
174
|
-
const o = f(0), i = f(0), s = f(0), c = f(0), l = f(!1), d = f(!1), v = f(!1), a = f(!1), m = f(!1), E = f(0), y = f(0);
|
|
175
|
-
function N(u) {
|
|
176
|
-
l.value = !0;
|
|
177
|
-
const p = u.target.documentElement ?? u.target;
|
|
178
|
-
o.value = p.scrollLeft, s.value = p.scrollTop, d.value = o.value < E.value, v.value = o.value > E.value, a.value = s.value < y.value, m.value = s.value > y.value, E.value = o.value, y.value = s.value, M(u), t && t(u);
|
|
179
|
-
}
|
|
180
|
-
const Y = q(N, n);
|
|
181
|
-
function O(u) {
|
|
182
|
-
l.value && (l.value = !1, d.value = !1, v.value = !1, a.value = !1, m.value = !1, r && r(u));
|
|
183
|
-
}
|
|
184
|
-
const M = I(O, n + 200), F = h(() => {
|
|
185
|
-
const u = S(e);
|
|
186
|
-
return u || null;
|
|
187
|
-
});
|
|
188
|
-
L(
|
|
189
|
-
() => F.value,
|
|
190
|
-
(u, p) => {
|
|
191
|
-
var b;
|
|
192
|
-
if (p && D(p), u) {
|
|
193
|
-
const g = ((b = u == null ? void 0 : u.document) == null ? void 0 : b.documentElement) || (u == null ? void 0 : u.documentElement) || u;
|
|
194
|
-
i.value = g.scrollWidth - g.clientWidth, c.value = g.scrollHeight - g.clientHeight, g.addEventListener("scroll", Y), g.addEventListener("scrollend", M);
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
immediate: !0,
|
|
199
|
-
flush: "post"
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
function D(u) {
|
|
203
|
-
var b;
|
|
204
|
-
const p = ((b = u == null ? void 0 : u.document) == null ? void 0 : b.documentElement) || (u == null ? void 0 : u.documentElement) || u;
|
|
205
|
-
p.removeEventListener("scroll", Y), p.removeEventListener("scrollend", M);
|
|
206
|
-
}
|
|
207
|
-
return w(() => D(F.value)), { x: o, xScrollMax: i, y: s, yScrollMax: c, isScrolling: l, left: d, right: v, top: a, bottom: m };
|
|
208
|
-
}
|
|
209
|
-
function _() {
|
|
210
|
-
const e = f(0), n = f(0);
|
|
211
|
-
let t = performance.now();
|
|
212
|
-
const r = 10, o = (i) => {
|
|
213
|
-
if (n.value++, n.value >= r) {
|
|
214
|
-
const s = i - t;
|
|
215
|
-
e.value = Math.round(1e3 / (s / r)), t = i, n.value = 0;
|
|
216
|
-
}
|
|
217
|
-
requestAnimationFrame(o);
|
|
218
|
-
};
|
|
219
|
-
return requestAnimationFrame(o), { fps: e };
|
|
220
|
-
}
|
|
221
|
-
function Q(e) {
|
|
222
|
-
if (!e || typeof e != "string" || e.trim() === "")
|
|
223
|
-
throw new Error("Invalid mediaQuery parameter. It must be a non-empty string.");
|
|
224
|
-
const n = f(window && window.matchMedia(e).matches), t = window.matchMedia(e), r = (o) => {
|
|
225
|
-
n.value = o.matches;
|
|
226
|
-
};
|
|
227
|
-
return x(() => {
|
|
228
|
-
t.addEventListener("change", r);
|
|
229
|
-
}), w(() => {
|
|
230
|
-
t.removeEventListener("change", r);
|
|
231
|
-
}), { match: n };
|
|
232
|
-
}
|
|
233
|
-
function ee(e, n, t = {}) {
|
|
234
|
-
const r = A(() => window && "ResizeObserver" in window);
|
|
235
|
-
let o;
|
|
236
|
-
const i = f(!1), s = h(() => {
|
|
237
|
-
const a = S(e);
|
|
238
|
-
return a ? Array.isArray(a) ? a.map((m) => S(m)).filter((m) => m) : [a] : [];
|
|
239
|
-
}), c = () => {
|
|
240
|
-
o && (o.disconnect(), o = void 0);
|
|
241
|
-
}, l = () => {
|
|
242
|
-
r.value && s.value.length && !i.value && (o = new ResizeObserver(n), s.value.forEach((a) => o.observe(a, t)));
|
|
243
|
-
};
|
|
244
|
-
L(
|
|
245
|
-
() => s.value,
|
|
246
|
-
() => {
|
|
247
|
-
c(), l();
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
immediate: !0,
|
|
251
|
-
// 立即触发回调,以便初始状态也被观察
|
|
252
|
-
flush: "post"
|
|
253
|
-
}
|
|
254
|
-
);
|
|
255
|
-
const d = () => {
|
|
256
|
-
i.value = !0, c();
|
|
257
|
-
}, v = () => {
|
|
258
|
-
i.value = !1, l();
|
|
259
|
-
};
|
|
260
|
-
return w(() => c()), {
|
|
261
|
-
stop: d,
|
|
262
|
-
start: v
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
function te(e = "default") {
|
|
266
|
-
const n = H(), t = (r) => {
|
|
267
|
-
var s;
|
|
268
|
-
const o = (s = n[r]) == null ? void 0 : s.call(n), i = (c) => {
|
|
269
|
-
if (c.type === U || Array.isArray(c.children) && !c.children.length)
|
|
270
|
-
return !1;
|
|
271
|
-
if (c.type !== V)
|
|
272
|
-
return !0;
|
|
273
|
-
if (typeof c.children == "string")
|
|
274
|
-
return c.children.trim() !== "";
|
|
275
|
-
};
|
|
276
|
-
return o && (o != null && o.length) ? o.some((l) => i(l)) : !1;
|
|
277
|
-
};
|
|
278
|
-
if (Array.isArray(e)) {
|
|
279
|
-
const r = R({});
|
|
280
|
-
return e.forEach((o) => {
|
|
281
|
-
const i = h(() => t(o));
|
|
282
|
-
r[o] = i;
|
|
283
|
-
}), r;
|
|
284
|
-
} else
|
|
285
|
-
return h(() => t(e));
|
|
286
|
-
}
|
|
287
|
-
const ne = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math.random().toString(36).substring(2, 9), re = (e) => JSON.parse(JSON.stringify(e));
|
|
288
|
-
export {
|
|
289
|
-
$ as add,
|
|
290
|
-
W as cancelRaf,
|
|
291
|
-
j as dateFormat,
|
|
292
|
-
I as debounce,
|
|
293
|
-
re as deepClone,
|
|
294
|
-
C as downloadFile,
|
|
295
|
-
J as formatNumber,
|
|
296
|
-
ne as getUniId,
|
|
297
|
-
P as rafTimeout,
|
|
298
|
-
q as throttle,
|
|
299
|
-
Z as toggleDark,
|
|
300
|
-
G as useEventListener,
|
|
301
|
-
_ as useFps,
|
|
302
|
-
Q as useMediaQuery,
|
|
303
|
-
z as useMounted,
|
|
304
|
-
K as useMutationObserver,
|
|
305
|
-
ee as useResizeObserver,
|
|
306
|
-
X as useScroll,
|
|
307
|
-
te as useSlotsExist,
|
|
308
|
-
A as useSupported
|
|
309
|
-
};
|
package/es/utils/resolver.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface VueAmazingUIResolverOptions {
|
|
2
|
-
cjs?: boolean;
|
|
3
|
-
}
|
|
4
|
-
export declare function VueAmazingUIResolver(options?: VueAmazingUIResolverOptions): {
|
|
5
|
-
type: "component";
|
|
6
|
-
resolve: (componentName: string) => {
|
|
7
|
-
name: string;
|
|
8
|
-
from: string;
|
|
9
|
-
sideEffects: string[];
|
|
10
|
-
} | undefined;
|
|
11
|
-
};
|
package/es/utils/resolver.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const n = {
|
|
2
|
-
TdsReportBar: "TdsReportBar"
|
|
3
|
-
}, i = {
|
|
4
|
-
BackTop: ["Tooltip"]
|
|
5
|
-
};
|
|
6
|
-
function o(s, e) {
|
|
7
|
-
if (["NumberAnimation", "Watermark"].includes(s))
|
|
8
|
-
return [];
|
|
9
|
-
const t = [s];
|
|
10
|
-
s in i && t.push(...i[s]);
|
|
11
|
-
const r = e != null && e.cjs ? "lib" : "es", c = [`@topdatasec/report/${r}/style/global.css`];
|
|
12
|
-
return t.forEach((f) => {
|
|
13
|
-
c.push(
|
|
14
|
-
`@topdatasec/report/${r}/${n[f]}/${f}.css`
|
|
15
|
-
);
|
|
16
|
-
}), c;
|
|
17
|
-
}
|
|
18
|
-
function a(s) {
|
|
19
|
-
return {
|
|
20
|
-
type: "component",
|
|
21
|
-
resolve: (e) => {
|
|
22
|
-
if (e in n)
|
|
23
|
-
return {
|
|
24
|
-
name: e,
|
|
25
|
-
// 组件名
|
|
26
|
-
from: "@topdatasec/report",
|
|
27
|
-
// 组件库名称
|
|
28
|
-
sideEffects: o(e, s)
|
|
29
|
-
// 组件样式文件
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
a as VueAmazingUIResolver
|
|
36
|
-
};
|
package/es/utils/type.d.ts
DELETED