@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/lib/utils/api.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name 获取自定义报表
|
|
3
|
+
*/
|
|
1
4
|
export declare const getReportDemoApi: (params: any) => any;
|
|
5
|
+
/**
|
|
6
|
+
* @name 获取报表组件
|
|
7
|
+
*/
|
|
2
8
|
export declare const getReportItemApi: (params: any) => any;
|
|
3
9
|
export declare const getReportPreviewApi: (params: any) => any;
|
|
4
10
|
export declare const postReportAddApi: (data: any) => any;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 竖着的柱状图数据解释
|
|
3
|
+
* @param chartOption 图option对象
|
|
4
|
+
* @param data 解释的数据 例如:data[{name}]
|
|
5
|
+
* @param props 解释数据映射的name和value
|
|
6
|
+
*/
|
|
1
7
|
export declare const barParseData: (chartOption: any, data: any[], name?: string, props?: {
|
|
2
8
|
name: string;
|
|
3
9
|
value: string;
|
|
@@ -143,18 +149,34 @@ export declare const chartsBar: (data?: any, props?: {
|
|
|
143
149
|
label?: undefined;
|
|
144
150
|
})[];
|
|
145
151
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
152
|
+
/**
|
|
153
|
+
* 横向的柱状图数据解释
|
|
154
|
+
* @param chartOption 图option对象
|
|
155
|
+
* @param data 解释的数据
|
|
156
|
+
* @param props 解释数据映射的name和value
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* 横向bar基础模型
|
|
160
|
+
* @param data
|
|
161
|
+
* @param props
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* 拼图数据解释
|
|
165
|
+
* @param chartOption 图option对象
|
|
166
|
+
* @param data 解释的数据
|
|
167
|
+
* @param props 解释数据映射的name和value
|
|
168
|
+
*/
|
|
156
169
|
export declare const pieParseData: ({ chartOption, data, props }: any) => void;
|
|
157
|
-
|
|
170
|
+
/**
|
|
171
|
+
* pie基础模型
|
|
172
|
+
* @param data 数据
|
|
173
|
+
* @param radiusType 1:代表空心
|
|
174
|
+
* @param roseType true为玫瑰图
|
|
175
|
+
* @param isLegend 是否显示图例
|
|
176
|
+
* @param isLine 是否显示名称对应的线
|
|
177
|
+
* @param center 图显示的位置
|
|
178
|
+
*/
|
|
179
|
+
export declare const chartsPie: ({ data, radiusType, roseType, isLegend, isLine, center, isTitle, }: any) => {
|
|
158
180
|
color: string[];
|
|
159
181
|
toolbox: {
|
|
160
182
|
show: boolean;
|
|
@@ -254,6 +276,12 @@ export declare const chartsPie: ({ data, radiusType, roseType, isLegend, isLine,
|
|
|
254
276
|
};
|
|
255
277
|
}[];
|
|
256
278
|
};
|
|
279
|
+
/**
|
|
280
|
+
* 解释折线图数据
|
|
281
|
+
* @param chartOption
|
|
282
|
+
* @param data
|
|
283
|
+
* @param props
|
|
284
|
+
*/
|
|
257
285
|
export declare const lineParseData: (chartOption: any, data: any, props?: {
|
|
258
286
|
name: string;
|
|
259
287
|
value: any;
|
|
@@ -290,8 +318,13 @@ export declare const lineMode: () => {
|
|
|
290
318
|
global: boolean;
|
|
291
319
|
};
|
|
292
320
|
};
|
|
293
|
-
data:
|
|
321
|
+
data: any[];
|
|
294
322
|
};
|
|
323
|
+
/**
|
|
324
|
+
* 折线图
|
|
325
|
+
* @param data
|
|
326
|
+
* @param props
|
|
327
|
+
*/
|
|
295
328
|
export declare const chartsLine: (data?: any[], props?: {
|
|
296
329
|
name: string;
|
|
297
330
|
value: any;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
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
1
|
export declare const getUniId: () => string;
|
|
43
2
|
export declare const deepClone: <T>(obj: T | T[]) => any;
|
|
3
|
+
export declare const isComponent: (components: any, component: string) => any;
|
package/package.json
CHANGED
|
@@ -1,106 +1,87 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topdatasec/report",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "Vue3 中基于Element-plus二次封装基础组件文档",
|
|
5
5
|
"author": "wangguiwang",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"Vue3",
|
|
13
|
-
"TypeScript",
|
|
14
|
-
"Vite"
|
|
15
|
-
],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"private": false,
|
|
8
|
+
"main": "lib/t-ui-plus.umd.js",
|
|
9
|
+
"module": "lib/t-ui-plus.umd.js",
|
|
10
|
+
"types": "lib/index.d.ts",
|
|
11
|
+
"type": "module",
|
|
16
12
|
"files": [
|
|
17
|
-
"dist",
|
|
18
|
-
"es",
|
|
19
|
-
"lib",
|
|
20
13
|
"package.json",
|
|
21
14
|
"README.md",
|
|
22
|
-
"
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"lib"
|
|
23
17
|
],
|
|
24
|
-
"sideEffects": false,
|
|
25
|
-
"main": "lib/index.cjs",
|
|
26
|
-
"module": "es/index.js",
|
|
27
|
-
"unpkg": "dist/index.iife.js",
|
|
28
|
-
"jsdelivr": "dist/index.iife.js",
|
|
29
|
-
"types": "es/index.d.ts",
|
|
30
|
-
"exports": {
|
|
31
|
-
"./dist/*": "./dist/*",
|
|
32
|
-
"./es/*": "./es/*",
|
|
33
|
-
"./lib/*": "./lib/*",
|
|
34
|
-
"./css": "./dist/style.css",
|
|
35
|
-
".": {
|
|
36
|
-
"types": "./es/index.d.ts",
|
|
37
|
-
"import": "./es/index.js",
|
|
38
|
-
"require": "./lib/index.cjs"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
18
|
"scripts": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"dev": "vite",
|
|
46
|
-
"pub": "sh scripts/publish.sh",
|
|
47
|
-
"push": "sh scripts/push.sh",
|
|
48
|
-
"build": "run-s format clean build:components",
|
|
49
|
-
"format": "prettier --write components/",
|
|
50
|
-
"clean": "rimraf dist es lib",
|
|
51
|
-
"build:components": "run-p type-check build:dist build:browser build-only",
|
|
52
|
-
"type-check": "vue-tsc --build --force",
|
|
53
|
-
"build:dist": "vite build -- dir=dist",
|
|
54
|
-
"build:browser": "vite build -- dir=dist f=iife",
|
|
55
|
-
"build-only": "vite build",
|
|
56
|
-
"preview": "vite preview",
|
|
57
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
|
19
|
+
"lib": "rimraf lib && vite build",
|
|
20
|
+
"pub": "npm publish --registry=https://registry.npmjs.org/",
|
|
21
|
+
"prettier": "prettier --write \"packages/**/*.{js,ts,json,tsx,css,less,scss,vue,html,md}\""
|
|
58
22
|
},
|
|
59
23
|
"dependencies": {
|
|
60
|
-
"@vuepic/vue-datepicker": "^11.0.1",
|
|
61
|
-
"@vueuse/core": "^12.8.2",
|
|
62
24
|
"@wangeditor/editor": "^5.1.23",
|
|
63
25
|
"@wangeditor/editor-for-vue": "^1.0.2",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"topdatasec-ui": "^1.6.1",
|
|
67
|
-
"vue": "^3.5.13",
|
|
68
|
-
"vue-router": "^4.5.0"
|
|
26
|
+
"vue-draggable-plus": "^0.6.0",
|
|
27
|
+
"vuedraggable": "^4.1.0"
|
|
69
28
|
},
|
|
70
29
|
"devDependencies": {
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"prettier": "^
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
30
|
+
"@iconify-json/fa6-regular": "^1.1.13",
|
|
31
|
+
"@iconify-json/fluent": "^1.1.37",
|
|
32
|
+
"@iconify-json/ic": "^1.1.14",
|
|
33
|
+
"@iconify-json/material-symbols": "^1.1.57",
|
|
34
|
+
"@topdatasec/eslint-rc": "^1.0.4",
|
|
35
|
+
"@types/nprogress": "^0.2.0",
|
|
36
|
+
"@types/sortablejs": "^1.15.2",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
38
|
+
"@typescript-eslint/parser": "^6.7.0",
|
|
39
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
40
|
+
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
|
41
|
+
"eslint": "^8.49.0",
|
|
42
|
+
"eslint-config-prettier": "^9.0.0",
|
|
43
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
44
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
45
|
+
"lint-staged": "^14.0.1",
|
|
46
|
+
"postcss": "^8.4.29",
|
|
47
|
+
"postcss-html": "^1.5.0",
|
|
48
|
+
"prettier": "^3.0.3",
|
|
49
|
+
"rollup-plugin-visualizer": "^5.9.2",
|
|
50
|
+
"sass": "~1.77.8",
|
|
51
|
+
"standard-version": "^9.5.0",
|
|
52
|
+
"typescript": "~5.2.2",
|
|
53
|
+
"unplugin-auto-import": "^0.16.6",
|
|
54
|
+
"unplugin-icons": "^0.17.0",
|
|
55
|
+
"unplugin-vue-components": "^0.25.2",
|
|
56
|
+
"unplugin-vue-setup-extend-plus": "^1.0.0",
|
|
57
|
+
"vite": "^4.4.9",
|
|
58
|
+
"vite-plugin-compression": "^0.5.1",
|
|
92
59
|
"vite-plugin-dts": "^4.5.3",
|
|
93
|
-
"vite-plugin-
|
|
94
|
-
"
|
|
95
|
-
"
|
|
60
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
61
|
+
"vite-plugin-html": "^3.2.0",
|
|
62
|
+
"vite-plugin-pwa": "^0.16.5",
|
|
63
|
+
"vite-plugin-svg-icons": "^2.0.1",
|
|
64
|
+
"vue-tsc": "~1.8.27"
|
|
96
65
|
},
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
"
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"echarts": "^5.6.0",
|
|
68
|
+
"element-plus": "^2.9.0",
|
|
69
|
+
"pinia": "^2.1.6",
|
|
70
|
+
"topdatasec-ui": "^1.6.1",
|
|
71
|
+
"vue": "^3.4.35"
|
|
72
|
+
},
|
|
73
|
+
"repository": {
|
|
74
|
+
"type": "git",
|
|
75
|
+
"url": "https://github.com/wocwin/t-ui-plus.git"
|
|
100
76
|
},
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
"
|
|
104
|
-
"
|
|
77
|
+
"homepage": "https://wocwin.github.io/t-ui-plus/",
|
|
78
|
+
"keywords": [
|
|
79
|
+
"element-plus",
|
|
80
|
+
"vite",
|
|
81
|
+
"vite3",
|
|
82
|
+
"vitepress",
|
|
83
|
+
"vue",
|
|
84
|
+
"vue3",
|
|
85
|
+
"components"
|
|
105
86
|
]
|
|
106
|
-
}
|
|
87
|
+
}
|
package/README.zh-CN.md
DELETED
|
File without changes
|
package/dist/index.iife.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(p,e,H){"use strict";const W={class:"chart-components"},j=e.defineComponent({name:"TdsReportBar",__name:"Bar",props:{data:{}},setup(o){const n=o,t=e.computed(()=>n.data.options);return(r,a)=>{const s=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",W,[e.createVNode(s,{option:t.value},null,8,["option"])])}}}),k=o=>{const n=o;return n.install=function(t){t.component(n.name,o)},o},v=k(j),M=window.$envURL,q=o=>M.request({url:`${M}/tds/report/demo/get`,method:"get",params:o,isError:!1});function P(o=Date.now(),n="YYYY-MM-DD HH:mm:ss"){try{let t;if(typeof o=="number"||typeof o=="string"){if(t=new Date(o),isNaN(t.getTime()))throw new Error("Invalid date")}else t=o;const r=(s,i=2)=>String(s).padStart(i,"0"),a=s=>{switch(s){case"YYYY":return r(t.getFullYear());case"YY":return r(t.getFullYear()).slice(2,4);case"MM":return r(t.getMonth()+1);case"M":return String(t.getMonth()+1);case"DD":return r(t.getDate());case"D":return String(t.getDate());case"HH":return r(t.getHours());case"H":return String(t.getHours());case"mm":return r(t.getMinutes());case"m":return String(t.getMinutes());case"ss":return r(t.getSeconds());case"s":return String(t.getSeconds());case"SSS":return r(t.getMilliseconds(),3);default:return s}};return n.replace(/(YYYY|YY|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)/g,a)}catch(t){return console.error("Error formatting date:",t),""}}function G(o,n=2,t=",",r=".",a,s){typeof o!="number"&&typeof o!="string"&&console.warn("Expected value to be of type number or string"),typeof n!="number"&&console.warn("Expected precision to be of type number");const i=Number(o);if(isNaN(i)||!isFinite(i))return"";if(i===0)return i.toFixed(n);let d=i.toFixed(n);if(typeof t=="string"&&t!==""){const[c,l]=d.split(".");d=c.replace(/(\d)(?=(\d{3})+$)/g,"$1"+t)+(l?r+l:"")}return(a||"")+d+(s||"")}function J(o,n=0,t=!1){let r=null;function a(i){if(r||(r=i),i-r>=n){try{o()}catch(c){console.error("Error executing rafTimeout function:",c)}t&&(r=i,s.id=requestAnimationFrame(a))}else s.id=requestAnimationFrame(a)}const s={id:requestAnimationFrame(a)};return s}function Z(o){o&&o.id&&typeof o.id=="number"?cancelAnimationFrame(o.id):console.warn("cancelRaf received an invalid id:",o)}function B(o,n=300){let t=!0;return function(...r){return t&&(o(...r),t=!1,setTimeout(()=>{t=!0},n)),!1}}function D(o,n=300){let t=null;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{o(...r)},n)}}function K(o,n){if(Number.isNaN(o)||Number.isNaN(n))throw new Error("Both num1 and num2 must be valid numbers.");const t=o%1!==0,r=n%1!==0;if(!t&&!r)return o+n;const a=String(o).split(".")[1]??"",s=String(n).split(".")[1]??"",i=Math.max(a.length,s.length),d=Math.pow(10,i),c=o.toFixed(i),l=n.toFixed(i);return(+c.replace(".","")+ +l.replace(".",""))/d}function Q(o,n){if(!o){console.error("无效的 url");return}const t=n||o.split("?")[0].split("/").pop()||"download";try{fetch(o).then(r=>{r.ok?r.blob().then(a=>{const s=URL.createObjectURL(a),i=document.createElement("a");i.href=s,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}):console.error("请求文件失败,状态码:",r.status)})}catch(r){console.error("文件下载失败:",r)}}function X(){const o=document.documentElement;o.classList.toggle("dark"),o.classList.contains("dark")?o.style.colorScheme="dark":o.style.colorScheme="light"}function ee(){const o=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{o.value=!0},n),o}function U(o){const n=ee();return e.computed(()=>(n.value,!!o()))}function te(o,n,t){e.onMounted(()=>o.addEventListener(n,t)),e.onUnmounted(()=>o.removeEventListener(n,t))}function oe(o,n,t={}){const r=U(()=>window&&"MutationObserver"in window),a=e.ref(!1);let s;const i=e.computed(()=>{const f=e.toValue(o);return f?Array.isArray(f)?f.map(g=>e.toValue(g)).filter(g=>g):[f]:[]}),d=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{r.value&&i.value.length&&!a.value&&(s=new MutationObserver(n),i.value.forEach(f=>s.observe(f,t)))};e.watch(()=>i.value,()=>{d(),c()},{immediate:!0,flush:"post"});const l=()=>{a.value=!0,d()},h=()=>{a.value=!1,c()};return e.onBeforeUnmount(()=>d()),{stop:l,start:h}}function ne(o=window,n=0,t,r){const a=e.ref(0),s=e.ref(0),i=e.ref(0),d=e.ref(0),c=e.ref(!1),l=e.ref(!1),h=e.ref(!1),f=e.ref(!1),g=e.ref(!1),b=e.ref(0),w=e.ref(0);function x(u){c.value=!0;const y=u.target.documentElement??u.target;a.value=y.scrollLeft,i.value=y.scrollTop,l.value=a.value<b.value,h.value=a.value>b.value,f.value=i.value<w.value,g.value=i.value>w.value,b.value=a.value,w.value=i.value,L(u),t&&t(u)}const _=B(x,n);function N(u){c.value&&(c.value=!1,l.value=!1,h.value=!1,f.value=!1,g.value=!1,r&&r(u))}const L=D(N,n+200),m=e.computed(()=>{const u=e.toValue(o);return u||null});e.watch(()=>m.value,(u,y)=>{var T;if(y&&C(y),u){const E=((T=u==null?void 0:u.document)==null?void 0:T.documentElement)||(u==null?void 0:u.documentElement)||u;s.value=E.scrollWidth-E.clientWidth,d.value=E.scrollHeight-E.clientHeight,E.addEventListener("scroll",_),E.addEventListener("scrollend",L)}},{immediate:!0,flush:"post"});function C(u){var T;const y=((T=u==null?void 0:u.document)==null?void 0:T.documentElement)||(u==null?void 0:u.documentElement)||u;y.removeEventListener("scroll",_),y.removeEventListener("scrollend",L)}return e.onBeforeUnmount(()=>C(m.value)),{x:a,xScrollMax:s,y:i,yScrollMax:d,isScrolling:c,left:l,right:h,top:f,bottom:g}}function re(){const o=e.ref(0),n=e.ref(0);let t=performance.now();const r=10,a=s=>{if(n.value++,n.value>=r){const i=s-t;o.value=Math.round(1e3/(i/r)),t=s,n.value=0}requestAnimationFrame(a)};return requestAnimationFrame(a),{fps:o}}function ae(o){if(!o||typeof o!="string"||o.trim()==="")throw new Error("Invalid mediaQuery parameter. It must be a non-empty string.");const n=e.ref(window&&window.matchMedia(o).matches),t=window.matchMedia(o),r=a=>{n.value=a.matches};return e.onMounted(()=>{t.addEventListener("change",r)}),e.onBeforeUnmount(()=>{t.removeEventListener("change",r)}),{match:n}}function le(o,n,t={}){const r=U(()=>window&&"ResizeObserver"in window);let a;const s=e.ref(!1),i=e.computed(()=>{const f=e.toValue(o);return f?Array.isArray(f)?f.map(g=>e.toValue(g)).filter(g=>g):[f]:[]}),d=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{r.value&&i.value.length&&!s.value&&(a=new ResizeObserver(n),i.value.forEach(f=>a.observe(f,t)))};e.watch(()=>i.value,()=>{d(),c()},{immediate:!0,flush:"post"});const l=()=>{s.value=!0,d()},h=()=>{s.value=!1,c()};return e.onBeforeUnmount(()=>d()),{stop:l,start:h}}function se(o="default"){const n=e.useSlots(),t=r=>{var i;const a=(i=n[r])==null?void 0:i.call(n),s=d=>{if(d.type===e.Comment||Array.isArray(d.children)&&!d.children.length)return!1;if(d.type!==e.Text)return!0;if(typeof d.children=="string")return d.children.trim()!==""};return a&&(a!=null&&a.length)?a.some(c=>s(c)):!1};if(Array.isArray(o)){const r=e.reactive({});return o.forEach(a=>{const s=e.computed(()=>t(a));r[a]=s}),r}else return e.computed(()=>t(o))}const V=()=>new Date().getTime().toString(36)+"-"+Math.random().toString(36).substring(2,9),ie=o=>JSON.parse(JSON.stringify(o)),ce="rgba(51, 51, 51, 0.15)",R="rgba(51, 51, 51, 1)",de=12,ue=(o=!1)=>{const n={left:"3%",right:"3%",bottom:"2%",containLabel:!0};return o&&(n.top="5%"),n},S=["46, 145, 255","48, 212, 183","108, 108, 255","109, 237, 124","128, 218, 236","58, 200, 218","146, 218, 89","118, 218, 218","143, 192, 244","192, 192, 145","153, 136, 204","212, 217, 230","124, 186, 255","209, 182, 225","255, 197, 84","249, 140, 106","246, 179, 82","100, 161, 206","246, 175, 159","238, 97, 97"],pe=(o=[{name:"数据1",value:63},{name:"数据2",value:45},{name:"数据3",value:43}],n={name:"name",value:"value"})=>{const t=(a="rgba(46, 145, 255, 0.7)",s="rgba(46, 145, 255, 0.2)")=>({color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:a},{offset:.8,color:s}]}}),r=o.map(a=>a[n.value]);return{tooltip:{trigger:"item"},grid:ue(),title:{show:!0,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},xAxis:[{type:"category",nameGap:8,nameRotate:0,axisLabel:{color:R,rotate:0},axisLine:{show:!0,lineStyle:{color:ce,width:1}},axisTick:{show:!1},splitLine:{show:!1},data:o.map(a=>a[n.name])}],yAxis:[{type:"value",min:0,position:"left",nameTextStyle:{fontSize:de,color:R,fontWeight:"bold"},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:R,formatter:"{value}",inside:!1}}],series:[{type:"bar",barWidth:15,barGap:"0%",itemStyle:t(`rgba(${S[0]}, 0.7)`,`rgba(${S[0]}, 0.2)`),data:r,label:{show:!0,position:"top",color:"inherit",lineHeight:24}},{name:"",type:"pictorialBar",symbolSize:[15,10],symbolOffset:[0,5],itemStyle:t(`rgba(${S[0]}, 0.7)`,`rgba(${S[0]}, 0.2)`),data:r},{name:"",type:"pictorialBar",symbolSize:[15,10],symbolOffset:[0,-5],symbolPosition:"end",itemStyle:t(`rgba(${S[0]}, 0.9)`,`rgba(${S[0]}, 1)`),data:r}]}},A=[{key:"assets",name:"资产名称"},{key:"type",name:"资产类型"},{key:"data",name:"资产数据"}],$=[{assets:"name1",type:"type1",data:"data1"},{assets:"name2",type:"type2",data:"data2"},{assets:"name3",type:"type3",data:"data3"}],me=[{data:[{name:"默认数据",value:180}],label:"name1"},{data:[{name:"默认数据",value:311}],label:"name2"},{data:[{name:"默认数据",value:42}],label:"name3"},{data:[{name:"默认数据",value:32391}],label:"name4"}],fe=[{type:"report-select",label:"资产:",value:"0",data:[{label:"全部",data:"0"},{label:"10.10.2.20_root",data:"743dbb32-8a41-4990-9d76-48925b000a93"},{label:"10.10.4.206_sysdba",data:"23193788-c895-47a8-8123-65799540394c"},{label:"10.10.4.26_root@/root/files/",data:"bb7b07c9-b96b-4caf-ac76-bb45ae849844"}],uri:"/da/report/sens/get_asset_all",id:V()},{type:"range-time",data:[{start_time:"2024-08-20 19:49:34",end_time:"2024-09-12 19:49:34"}],id:V()},{type:"h1",data:"报表名称",options:{size:24,color:"rgba(0,0,0,0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:V()},{type:"h2",data:"一级标题",name:"一级标题",options:{size:18,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:V()},{type:"report-table",data:$,showColumn:A,name:"表格",options:{showColumn:{assets:!0,type:!0,data:!0},border:!0,showHeader:!0,stripe:!1},rp_item_uuid:"",id:V()}];pe();const ge=H.defineStore("tds-report",{state:()=>({componentList:[],activeComponents:{},notDraggableList:[],titleComponent:{},filterForm:{range_time:1,filter_uuid:""}}),getters:{getActiveComponents:o=>o.activeComponents},actions:{setComponentList(o){this.componentList=o},async getReportDemo(o){let n=[];o?n=(await q({report_uuid:o})).data:n={content:ie(fe),range_time:1};const t=[];n.content.forEach(r=>{(r.type==="report-select"||r.type==="range-time")&&t.push(r),r.type==="h1"&&(this.titleComponent=r),r.id=V()}),this.notDraggableList=t,this.filterForm.range_time=n.range_time,this.filterForm.filter_uuid=n.filter_uuid,n.content.splice(0,3),this.componentList=n.content},setActiveComponents(o){this.activeComponents=o},clearComponents(){this.activeComponents={},this.componentList=[],this.notDraggableList=[],this.titleComponent={},this.filterForm={range_time:1,filter_uuid:""}}}}),be={key:0},he={class:"sub-title"},F=k(((o,n)=>{const t=o.__vccOpts||o;for(const[r,a]of n)t[r]=a;return t})(e.defineComponent({name:"TdsReportConfig",__name:"Config",setup(o){const n=ge(),t=e.computed(()=>n.activeComponents);function r(c){c?(t.value.options.series[0].radius=["10%","65%"],t.value.options.graphic[0].invisible=!0,t.value.options.graphic[1].invisible=!0):(t.value.options.series[0].radius=["45%","70%"],t.value.options.graphic[0].invisible=!1,t.value.options.graphic[1].invisible=!1)}const a=e.ref("rgb(46, 145, 255)"),s=(c="rgba(46, 145, 255, 0.7)",l="rgba(46, 145, 255, 0.2)")=>({color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:c},{offset:.8,color:l}]}});function i(c){c&&(n.activeComponents.options.series[0].itemStyle=s(d(c,.7),d(c,.2)),n.activeComponents.options.series[1].itemStyle=s(d(c,.7),d(c,.2)),n.activeComponents.options.series[2].itemStyle=s(d(c,.9),d(c,1)))}function d(c,l=1){c=c.replace(/^#/,"");const h=parseInt(c.substring(0,2),16),f=parseInt(c.substring(2,4),16),g=parseInt(c.substring(4,6),16);return`rgba(${h}, ${f}, ${g}, ${l})`}return(c,l)=>{const h=e.resolveComponent("el-input"),f=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-switch"),b=e.resolveComponent("el-col"),w=e.resolveComponent("el-color-picker"),x=e.resolveComponent("el-input-number"),_=e.resolveComponent("el-row"),N=e.resolveComponent("el-collapse-item"),L=e.resolveComponent("el-collapse");return t.value.options.title?(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(f,{label:"标题"},{default:e.withCtx(()=>[e.createVNode(h,{modelValue:t.value.options.title.text,"onUpdate:modelValue":l[0]||(l[0]=m=>t.value.options.title.text=m)},null,8,["modelValue"])]),_:1}),e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(N,{title:"标题配置",name:"1"},{default:e.withCtx(()=>[e.createVNode(_,{class:"w-100%"},{default:e.withCtx(()=>[e.createVNode(b,{span:24},{default:e.withCtx(()=>[l[9]||(l[9]=e.createElementVNode("span",{class:"switch-label"},"显示标题",-1)),e.createVNode(g,{modelValue:t.value.options.title.show,"onUpdate:modelValue":l[1]||(l[1]=m=>t.value.options.title.show=m)},null,8,["modelValue"])]),_:1}),e.createVNode(b,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{modelValue:t.value.options.title.textStyle.color,"onUpdate:modelValue":l[2]||(l[2]=m=>t.value.options.title.textStyle.color=m),"show-alpha":""},null,8,["modelValue"]),l[10]||(l[10]=e.createElementVNode("p",{class:"sub-title"},"颜色",-1))]),_:1}),e.createVNode(b,{span:12},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:t.value.options.title.textStyle.fontSize,"onUpdate:modelValue":l[3]||(l[3]=m=>t.value.options.title.textStyle.fontSize=m),"controls-position":"right"},null,8,["modelValue"]),l[11]||(l[11]=e.createElementVNode("p",{class:"sub-title"},"字体大小",-1))]),_:1}),e.createVNode(b,{span:12},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:t.value.options.title.x,"onUpdate:modelValue":l[4]||(l[4]=m=>t.value.options.title.x=m),"controls-position":"right"},null,8,["modelValue"]),l[12]||(l[12]=e.createElementVNode("p",{class:"sub-title"},"横向",-1))]),_:1}),e.createVNode(b,{span:12},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:t.value.options.title.y,"onUpdate:modelValue":l[5]||(l[5]=m=>t.value.options.title.y=m),"controls-position":"right"},null,8,["modelValue"]),l[13]||(l[13]=e.createElementVNode("p",{class:"sub-title"},"纵向",-1))]),_:1})]),_:1})]),_:1}),e.createVNode(N,{title:"图形配置",name:"2"},{default:e.withCtx(()=>[t.value.options.color&&t.value.options.color.length&&t.value.type==="pie"?(e.openBlock(),e.createBlock(_,{key:0},{default:e.withCtx(()=>[e.createVNode(b,{span:24},{default:e.withCtx(()=>[l[14]||(l[14]=e.createElementVNode("span",{class:"switch-label"},"玫瑰图",-1)),e.createVNode(g,{onChange:r,modelValue:t.value.options.series[0].roseType,"onUpdate:modelValue":l[6]||(l[6]=m=>t.value.options.series[0].roseType=m)},null,8,["modelValue"])]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.data,(m,C)=>(e.openBlock(),e.createBlock(b,{span:12,class:"mb-10px",key:C},{default:e.withCtx(()=>[e.createVNode(w,{modelValue:t.value.options.color[C],"onUpdate:modelValue":u=>t.value.options.color[C]=u,"show-alpha":""},null,8,["modelValue","onUpdate:modelValue"]),e.createElementVNode("p",he,e.toDisplayString(m.label),1)]),_:2},1024))),128))]),_:1})):e.createCommentVNode("",!0),t.value.type==="bar"?(e.openBlock(),e.createBlock(_,{key:1},{default:e.withCtx(()=>[e.createVNode(b,{span:12},{default:e.withCtx(()=>[e.createVNode(w,{modelValue:a.value,"onUpdate:modelValue":l[7]||(l[7]=m=>a.value=m),onChange:i},null,8,["modelValue"]),l[15]||(l[15]=e.createElementVNode("p",{class:"sub-title"},"柱颜色",-1))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(N,{title:"图例配置",name:"3"},{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.createVNode(b,{span:24},{default:e.withCtx(()=>[l[16]||(l[16]=e.createElementVNode("span",{class:"switch-label"},"显示图例",-1)),t.value.options.legend?(e.openBlock(),e.createBlock(g,{key:0,modelValue:t.value.options.legend.show,"onUpdate:modelValue":l[8]||(l[8]=m=>t.value.options.legend.show=m)},null,8,["modelValue"])):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1})])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-9d35239c"]])),ye={class:"chart-components"},O=k(e.defineComponent({name:"TdsReportLine",__name:"Line",props:{data:{}},setup(o){const n=o,t=e.computed(()=>n.data.options);return(r,a)=>{const s=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(s,{option:t.value},null,8,["option"])])}}})),we=Object.freeze(Object.defineProperty({__proto__:null,TdsReportBar:v,TdsReportConfig:F,TdsReportLine:O},Symbol.toStringTag,{value:"Module"})),I={TdsReportBar:"TdsReportBar"},z={BackTop:["Tooltip"]};function _e(o,n){if(["NumberAnimation","Watermark"].includes(o))return[];const t=[o];o in z&&t.push(...z[o]);const r=n!=null&&n.cjs?"lib":"es",a=[`@topdatasec/report/${r}/style/global.css`];return t.forEach(s=>{a.push(`@topdatasec/report/${r}/${I[s]}/${s}.css`)}),a}function Ve(o){return{type:"component",resolve:n=>{if(n in I)return{name:n,from:"@topdatasec/report",sideEffects:_e(n,o)}}}}const Y=function(o){return Object.values(we).forEach(n=>{n&&n.install&&o.use(n)}),o},Se={install:Y};p.TdsReportBar=v,p.TdsReportConfig=F,p.TdsReportLine=O,p.VueAmazingUIResolver=Ve,p.add=K,p.cancelRaf=Z,p.dateFormat=P,p.debounce=D,p.default=Se,p.downloadFile=Q,p.formatNumber=G,p.install=Y,p.rafTimeout=J,p.throttle=B,p.toggleDark=X,p.useEventListener=te,p.useFps=re,p.useMediaQuery=ae,p.useMutationObserver=oe,p.useResizeObserver=le,p.useScroll=ne,p.useSlotsExist=se,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})})(this.TdsReportUI=this.TdsReportUI||{},Vue,pinia);
|