@dfsj/components 3.0.0
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/CHANGELOG.md +203 -0
- package/LICENSE +22 -0
- package/README.md +27 -0
- package/dist/components/Boards/index.d.ts +4 -0
- package/dist/components/Boards/src/Boards.vue.d.ts +33 -0
- package/dist/components/Boards/src/Boards.vue.js +5 -0
- package/dist/components/Boards/src/Boards.vue2.js +113 -0
- package/dist/components/Boards/src/props.d.ts +27 -0
- package/dist/components/Boards/src/props.js +18 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/src/composables/use-month-range-header.d.ts +16 -0
- package/dist/components/DatePicker/src/composables/use-month-range-header.js +52 -0
- package/dist/components/DatePicker/src/composables/use-range-picker.d.ts +100 -0
- package/dist/components/DatePicker/src/composables/use-range-picker.js +99 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.d.ts +19 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue.js +5 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-date-range.vue2.js +564 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.d.ts +16 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue.js +5 -0
- package/dist/components/DatePicker/src/date-picker-com/panel-month-range.vue2.js +210 -0
- package/dist/components/DatePicker/src/index.d.ts +196 -0
- package/dist/components/DatePicker/src/index.js +87 -0
- package/dist/components/DatePicker/src/panel-utils.d.ts +2 -0
- package/dist/components/DatePicker/src/panel-utils.js +25 -0
- package/dist/components/Editor/index.d.ts +6 -0
- package/dist/components/Editor/src/Editor.vue.d.ts +50 -0
- package/dist/components/Editor/src/Editor.vue.js +5 -0
- package/dist/components/Editor/src/Editor.vue2.js +138 -0
- package/dist/components/Form/index.d.ts +16 -0
- package/dist/components/Form/src/Form.vue.d.ts +164 -0
- package/dist/components/Form/src/Form.vue.js +5 -0
- package/dist/components/Form/src/Form.vue2.js +378 -0
- package/dist/components/Form/src/components/useRenderCheckbox.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderCheckbox.js +33 -0
- package/dist/components/Form/src/components/useRenderRadio.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderRadio.js +33 -0
- package/dist/components/Form/src/components/useRenderSelect.d.ts +4 -0
- package/dist/components/Form/src/components/useRenderSelect.js +52 -0
- package/dist/components/Form/src/helper/componentMap.d.ts +5 -0
- package/dist/components/Form/src/helper/componentMap.js +35 -0
- package/dist/components/Form/src/helper/index.d.ts +7 -0
- package/dist/components/Form/src/helper/index.js +109 -0
- package/dist/components/Form/src/types/index.d.ts +533 -0
- package/dist/components/Form/src/types/index.js +31 -0
- package/dist/components/Form/src/useForm.d.ts +1 -0
- package/dist/components/Form/src/useForm.js +290 -0
- package/dist/components/Highlight/index.d.ts +2 -0
- package/dist/components/Highlight/src/Highlight.vue.d.ts +41 -0
- package/dist/components/Highlight/src/Highlight.vue.js +5 -0
- package/dist/components/Highlight/src/Highlight.vue2.js +62 -0
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Icon/src/Icon.vue.d.ts +49 -0
- package/dist/components/Icon/src/Icon.vue.js +5 -0
- package/dist/components/Icon/src/Icon.vue2.js +123 -0
- package/dist/components/Icon/src/SvgIcon.vue.d.ts +45 -0
- package/dist/components/Icon/src/SvgIcon.vue.js +7 -0
- package/dist/components/Icon/src/SvgIcon.vue2.js +45 -0
- package/dist/components/Icon/src/SvgIcon.vue3.js +14 -0
- package/dist/components/InputPassword/index.d.ts +2 -0
- package/dist/components/InputPassword/src/InputPassword.vue.d.ts +27 -0
- package/dist/components/InputPassword/src/InputPassword.vue.js +5 -0
- package/dist/components/InputPassword/src/InputPassword.vue2.js +58 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/src/BasicModal.vue.d.ts +280 -0
- package/dist/components/Modal/src/BasicModal.vue.js +5 -0
- package/dist/components/Modal/src/BasicModal.vue2.js +150 -0
- package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +86 -0
- package/dist/components/Modal/src/components/ModalFooter.vue.js +5 -0
- package/dist/components/Modal/src/components/ModalFooter.vue2.js +30 -0
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +142 -0
- package/dist/components/Modal/src/components/ModalHeader.vue.js +5 -0
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +63 -0
- package/dist/components/Modal/src/config.d.ts +24 -0
- package/dist/components/Modal/src/config.js +25 -0
- package/dist/components/Modal/src/hooks/useModalDrag.d.ts +24 -0
- package/dist/components/Modal/src/hooks/useModalDrag.js +108 -0
- package/dist/components/Modal/src/hooks/useTimeout.d.ts +15 -0
- package/dist/components/Modal/src/hooks/useTimeout.js +53 -0
- package/dist/components/Modal/src/props.d.ts +131 -0
- package/dist/components/Modal/src/props.js +107 -0
- package/dist/components/Modal/src/utils/index.d.ts +3 -0
- package/dist/components/Modal/src/utils/index.js +86 -0
- package/dist/components/Stateful/index.d.ts +4 -0
- package/dist/components/Stateful/src/State.d.ts +20 -0
- package/dist/components/Stateful/src/State.js +82 -0
- package/dist/components/Stateful/src/Stateful.vue.d.ts +44 -0
- package/dist/components/Stateful/src/Stateful.vue.js +5 -0
- package/dist/components/Stateful/src/Stateful.vue2.js +46 -0
- package/dist/components/Stateful/src/props.d.ts +39 -0
- package/dist/components/Stateful/src/props.js +29 -0
- package/dist/components/Table/index.d.ts +14 -0
- package/dist/components/Table/src/Table.vue.d.ts +537 -0
- package/dist/components/Table/src/Table.vue.js +5 -0
- package/dist/components/Table/src/Table.vue2.js +582 -0
- package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +30 -0
- package/dist/components/Table/src/components/ColumnSetting.vue.js +5 -0
- package/dist/components/Table/src/components/ColumnSetting.vue2.js +264 -0
- package/dist/components/Table/src/components/TableActions.vue.d.ts +20 -0
- package/dist/components/Table/src/components/TableActions.vue.js +5 -0
- package/dist/components/Table/src/components/TableActions.vue2.js +108 -0
- package/dist/components/Table/src/helper/index.d.ts +2 -0
- package/dist/components/Table/src/helper/index.js +11 -0
- package/dist/components/Table/src/types/index.d.ts +87 -0
- package/dist/components/Table/src/useTable.d.ts +1 -0
- package/dist/components/Table/src/useTable.js +284 -0
- package/dist/components/UnifyChart/index.d.ts +4 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +63 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue.js +5 -0
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +83 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +185 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue.js +5 -0
- package/dist/components/UnifyChart/src/UnifyChart.vue2.js +54 -0
- package/dist/components/UnifyChart/src/hooks/useLoader.d.ts +11 -0
- package/dist/components/UnifyChart/src/hooks/useRender.d.ts +24 -0
- package/dist/components/UnifyChart/src/hooks/useRender.js +49 -0
- package/dist/components/UnifyChart/src/props.d.ts +145 -0
- package/dist/components/UnifyChart/src/props.js +33 -0
- package/dist/components/Video/index.d.ts +2 -0
- package/dist/components/Video/src/VideoPlayer.vue.d.ts +60 -0
- package/dist/components/Video/src/VideoPlayer.vue.js +5 -0
- package/dist/components/Video/src/VideoPlayer.vue2.js +107 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +34 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue.js +5 -0
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +65 -0
- package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +7 -0
- package/dist/components/Video/src/abstract/Observable.d.ts +6 -0
- package/dist/components/Video/src/abstract/Observable.js +89 -0
- package/dist/components/Video/src/abstract/VideoControl.d.ts +32 -0
- package/dist/components/Video/src/abstract/VideoControl.js +50 -0
- package/dist/components/Video/src/control/DaHua.d.ts +12 -0
- package/dist/components/Video/src/control/DaHua.js +156 -0
- package/dist/components/Video/src/control/Hikvision.d.ts +28 -0
- package/dist/components/Video/src/control/Hikvision.js +251 -0
- package/dist/components/Video/src/control/VideoFactory.d.ts +3 -0
- package/dist/components/Video/src/control/VideoFactory.js +32 -0
- package/dist/components/Video/src/enums/CommonEnum.d.ts +26 -0
- package/dist/components/Video/src/enums/CommonEnum.js +31 -0
- package/dist/components/Windows/index.d.ts +4 -0
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +14 -0
- package/dist/components/Windows/src/ModalWrap.vue.js +5 -0
- package/dist/components/Windows/src/ModalWrap.vue2.js +90 -0
- package/dist/components/Windows/src/Windows.vue.d.ts +18 -0
- package/dist/components/Windows/src/Windows.vue.js +7 -0
- package/dist/components/Windows/src/Windows.vue2.js +51 -0
- package/dist/components/Windows/src/Windows.vue3.js +22 -0
- package/dist/components/Windows/src/props.d.ts +20 -0
- package/dist/components/Windows/src/props.js +9 -0
- package/dist/directives/clickOutside.d.ts +3 -0
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/repeatClick.d.ts +3 -0
- package/dist/helper/lang.d.ts +1 -0
- package/dist/helper/lang.js +546 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +36 -0
- package/dist/index.min.css +6 -0
- package/dist/node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js +268 -0
- package/dist/node_modules/.pnpm/@vueuse_shared@10.7.2_vue@3.4.21/node_modules/@vueuse/shared/index.js +34 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/is.d.ts +25 -0
- package/dist/utils/is.js +36 -0
- package/dist/utils/propTypes.d.ts +10 -0
- package/dist/utils/propTypes.js +35 -0
- package/dist/utils/tsxHelper.d.ts +5 -0
- package/dist/utils/tsxHelper.js +18 -0
- package/package.json +64 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { State } from '../../../Stateful';
|
|
2
|
+
import { useLoaderProps } from '../props';
|
|
3
|
+
export declare function useLoader(props: useLoaderProps, { immediate, condition, watchCondition }: {
|
|
4
|
+
immediate?: boolean;
|
|
5
|
+
condition?: {};
|
|
6
|
+
watchCondition?: boolean;
|
|
7
|
+
}): {
|
|
8
|
+
datasource: import("vue").Ref<any>;
|
|
9
|
+
fetchData: () => Promise<void>;
|
|
10
|
+
stateful: State;
|
|
11
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { IToolbox } from '../props';
|
|
3
|
+
type EChartsType = object | any;
|
|
4
|
+
export interface RenderConfig {
|
|
5
|
+
setOptions: Function;
|
|
6
|
+
echarts: EChartsType;
|
|
7
|
+
createOptions: Function;
|
|
8
|
+
getInstance: Function;
|
|
9
|
+
assemble: Function;
|
|
10
|
+
toggleTable: Function;
|
|
11
|
+
transform: Function;
|
|
12
|
+
toggleStatistic: Function;
|
|
13
|
+
}
|
|
14
|
+
type Toolbox = Array<IToolbox>;
|
|
15
|
+
export declare function useRender(config: RenderConfig, datasource: Ref, toolbox: Toolbox): {
|
|
16
|
+
refreshCharts: (data: any) => void;
|
|
17
|
+
getBindValue: import("vue").ComputedRef<{
|
|
18
|
+
instance: Function;
|
|
19
|
+
toggleTable: Function;
|
|
20
|
+
toggleStatistic: Function;
|
|
21
|
+
toolbox: Toolbox;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { computed, watch, onMounted } from 'vue';
|
|
2
|
+
import { EToolbox } from '../props.js';
|
|
3
|
+
|
|
4
|
+
function useRender(config, datasource, toolbox) {
|
|
5
|
+
var getInstance = config.getInstance,
|
|
6
|
+
setOptions = config.setOptions,
|
|
7
|
+
_config$transform = config.transform,
|
|
8
|
+
transform = _config$transform === void 0 ? function (d) {
|
|
9
|
+
return d;
|
|
10
|
+
} : _config$transform,
|
|
11
|
+
_config$createOptions = config.createOptions,
|
|
12
|
+
createOptions = _config$createOptions === void 0 ? function (p) {
|
|
13
|
+
return p;
|
|
14
|
+
} : _config$createOptions,
|
|
15
|
+
assemble = config.assemble,
|
|
16
|
+
toggleTable = config.toggleTable,
|
|
17
|
+
toggleStatistic = config.toggleStatistic;
|
|
18
|
+
var getBindValue = computed(function () {
|
|
19
|
+
return {
|
|
20
|
+
instance: getInstance,
|
|
21
|
+
toggleTable: toggleTable,
|
|
22
|
+
toggleStatistic: toggleStatistic,
|
|
23
|
+
toolbox: toolbox !== null && toolbox !== void 0 ? toolbox : [EToolbox.Download, EToolbox.Table, EToolbox.Statistic]
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
function refreshCharts(data) {
|
|
27
|
+
if (!data) return;
|
|
28
|
+
transform(data);
|
|
29
|
+
var optioned = createOptions(data);
|
|
30
|
+
var options = assemble(data, optioned);
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
setOptions(options, true);
|
|
33
|
+
}, 100);
|
|
34
|
+
}
|
|
35
|
+
watch(function () {
|
|
36
|
+
return datasource.value;
|
|
37
|
+
}, function (v) {
|
|
38
|
+
refreshCharts(v);
|
|
39
|
+
});
|
|
40
|
+
onMounted(function () {
|
|
41
|
+
refreshCharts(datasource.value);
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
refreshCharts: refreshCharts,
|
|
45
|
+
getBindValue: getBindValue
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { useRender };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export interface Convert {
|
|
2
|
+
createOptions: Function;
|
|
3
|
+
transform: Function;
|
|
4
|
+
}
|
|
5
|
+
export declare const unifyChartProps: {
|
|
6
|
+
data: import("vue-types").VueTypeValidableDef<{
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>> & {
|
|
11
|
+
default: () => {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
} & {
|
|
15
|
+
default: () => {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
options: import("vue-types").VueTypeValidableDef<{
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>> & {
|
|
24
|
+
default: () => {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
} & {
|
|
28
|
+
default: () => {
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
width: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
33
|
+
default: string;
|
|
34
|
+
} & {
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
height: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
38
|
+
default: string;
|
|
39
|
+
} & {
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
target: import("vue-types").VueTypeValidableDef<{
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
}>> & {
|
|
47
|
+
default: () => {
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
};
|
|
50
|
+
} & {
|
|
51
|
+
default: () => {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
convert: () => Convert;
|
|
56
|
+
datasource: import("vue-types").VueTypeValidableDef<{
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
}>> & {
|
|
61
|
+
default: () => {
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
};
|
|
64
|
+
} & {
|
|
65
|
+
default: () => {
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
toolbox: () => Array<IToolbox>;
|
|
70
|
+
chartHooks: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
71
|
+
default: (...args: any[]) => any;
|
|
72
|
+
};
|
|
73
|
+
stateful: import("vue-types").VueTypeValidableDef<{
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
}>> & {
|
|
78
|
+
default: () => {
|
|
79
|
+
[key: string]: any;
|
|
80
|
+
};
|
|
81
|
+
} & {
|
|
82
|
+
default: () => {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
interface Options {
|
|
88
|
+
loader: Function;
|
|
89
|
+
condition: Object;
|
|
90
|
+
}
|
|
91
|
+
export declare const compProps: {
|
|
92
|
+
target: import("vue-types").VueTypeValidableDef<{
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}>> & {
|
|
97
|
+
default: () => {
|
|
98
|
+
[key: string]: any;
|
|
99
|
+
};
|
|
100
|
+
} & {
|
|
101
|
+
default: () => {
|
|
102
|
+
[key: string]: any;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
options: () => Options;
|
|
106
|
+
};
|
|
107
|
+
export type useLoaderProps = {
|
|
108
|
+
target: Object;
|
|
109
|
+
options: Options;
|
|
110
|
+
};
|
|
111
|
+
export declare enum EToolbox {
|
|
112
|
+
Download = 0,
|
|
113
|
+
Statistic = 1,
|
|
114
|
+
Table = 2
|
|
115
|
+
}
|
|
116
|
+
export type EToolboxKeys = keyof typeof EToolbox;
|
|
117
|
+
export type IToolbox = EToolbox[EToolboxKeys];
|
|
118
|
+
export declare const toolboxProps: {
|
|
119
|
+
instance: import("vue-types").VueTypeValidableDef<{
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
}, import("vue-types/dist/types").ValidatorFunction<{
|
|
122
|
+
[key: string]: any;
|
|
123
|
+
}>> & {
|
|
124
|
+
default: () => {
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
};
|
|
127
|
+
} & {
|
|
128
|
+
default: () => {
|
|
129
|
+
[key: string]: any;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
iconSize: import("vue-types").VueTypeValidableDef<number, import("vue-types/dist/types").ValidatorFunction<number>> & {
|
|
133
|
+
default: number;
|
|
134
|
+
} & {
|
|
135
|
+
default: number;
|
|
136
|
+
};
|
|
137
|
+
toggleTable: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
138
|
+
default: (...args: any[]) => any;
|
|
139
|
+
};
|
|
140
|
+
toggleStatistic: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
141
|
+
default: (...args: any[]) => any;
|
|
142
|
+
};
|
|
143
|
+
toolbox: () => Array<IToolbox>;
|
|
144
|
+
};
|
|
145
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
2
|
+
|
|
3
|
+
var unifyChartProps = {
|
|
4
|
+
data: propTypes.object.def({}),
|
|
5
|
+
options: propTypes.object.def({}),
|
|
6
|
+
width: propTypes.string.def('100%'),
|
|
7
|
+
height: propTypes.string.def('100%'),
|
|
8
|
+
target: propTypes.object.def({}),
|
|
9
|
+
convert: Object,
|
|
10
|
+
datasource: propTypes.object.def({}),
|
|
11
|
+
toolbox: Array,
|
|
12
|
+
chartHooks: propTypes.func,
|
|
13
|
+
stateful: propTypes.object.def({})
|
|
14
|
+
};
|
|
15
|
+
var compProps = {
|
|
16
|
+
target: propTypes.object.def({}),
|
|
17
|
+
options: Object
|
|
18
|
+
};
|
|
19
|
+
var EToolbox;
|
|
20
|
+
(function (EToolbox) {
|
|
21
|
+
EToolbox[EToolbox["Download"] = 0] = "Download";
|
|
22
|
+
EToolbox[EToolbox["Statistic"] = 1] = "Statistic";
|
|
23
|
+
EToolbox[EToolbox["Table"] = 2] = "Table";
|
|
24
|
+
})(EToolbox || (EToolbox = {}));
|
|
25
|
+
var toolboxProps = {
|
|
26
|
+
instance: propTypes.object.def({}),
|
|
27
|
+
iconSize: propTypes.number.def(28),
|
|
28
|
+
toggleTable: propTypes.func,
|
|
29
|
+
toggleStatistic: propTypes.func,
|
|
30
|
+
toolbox: Array
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { EToolbox, compProps, toolboxProps, unifyChartProps };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
host: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
3
|
+
default: string;
|
|
4
|
+
};
|
|
5
|
+
port: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
channel: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
username: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
password: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
15
|
+
default: string;
|
|
16
|
+
};
|
|
17
|
+
streamType: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
videoType: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
21
|
+
default: string;
|
|
22
|
+
} & {
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
host: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
port: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
channel: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
username: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
password: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
streamType: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
videoType: import("vue-types").VueTypeValidableDef<string, import("vue-types/dist/types").ValidatorFunction<string>> & {
|
|
47
|
+
default: string;
|
|
48
|
+
} & {
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
}>>, {
|
|
52
|
+
host: string;
|
|
53
|
+
port: string;
|
|
54
|
+
channel: string;
|
|
55
|
+
username: string;
|
|
56
|
+
password: string;
|
|
57
|
+
streamType: string;
|
|
58
|
+
videoType: string;
|
|
59
|
+
}, {}>;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import { defineComponent, ref, getCurrentInstance, onMounted, nextTick, toRaw, unref, onBeforeUnmount, openBlock, createElementBlock, createBlock, withCtx, createElementVNode, withModifiers, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
3
|
+
import './VideoPlayerToolbar.vue.js';
|
|
4
|
+
import { EventEnum } from './enums/CommonEnum.js';
|
|
5
|
+
import VideoFactory from './control/VideoFactory.js';
|
|
6
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
7
|
+
import script$1 from './VideoPlayerToolbar.vue2.js';
|
|
8
|
+
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
var _hoisted_1 = {
|
|
12
|
+
style: {
|
|
13
|
+
"color": "white"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var script = defineComponent({
|
|
17
|
+
__name: 'VideoPlayer',
|
|
18
|
+
props: {
|
|
19
|
+
host: propTypes.string,
|
|
20
|
+
port: propTypes.string,
|
|
21
|
+
channel: propTypes.string,
|
|
22
|
+
username: propTypes.string,
|
|
23
|
+
password: propTypes.string,
|
|
24
|
+
streamType: propTypes.string,
|
|
25
|
+
videoType: propTypes.string.def('Hikvision')
|
|
26
|
+
},
|
|
27
|
+
setup: function setup(__props) {
|
|
28
|
+
var _getCurrentInstance;
|
|
29
|
+
var instance = null;
|
|
30
|
+
var wrapEl = ref();
|
|
31
|
+
var isPlay = ref(false);
|
|
32
|
+
var isFullscreen = ref(false);
|
|
33
|
+
var props = __props;
|
|
34
|
+
var componentId = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.uid;
|
|
35
|
+
onMounted(function () {
|
|
36
|
+
nextTick(function () {
|
|
37
|
+
instance = VideoFactory.create(props.videoType, _objectSpread({
|
|
38
|
+
wrapEl: wrapEl.value,
|
|
39
|
+
elId: componentId
|
|
40
|
+
}, toRaw(unref(props))));
|
|
41
|
+
instance.on(EventEnum.PLAY, function (ev) {
|
|
42
|
+
console.log('开始播放', {
|
|
43
|
+
ev: ev
|
|
44
|
+
});
|
|
45
|
+
isPlay.value = true;
|
|
46
|
+
});
|
|
47
|
+
instance.on(EventEnum.PAUSE, function (ev) {
|
|
48
|
+
console.log('结束播放', {
|
|
49
|
+
ev: ev
|
|
50
|
+
});
|
|
51
|
+
isPlay.value = false;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
function stop() {
|
|
56
|
+
var _instance, _instance$stop;
|
|
57
|
+
console.log('props.control', instance);
|
|
58
|
+
(_instance = instance) === null || _instance === void 0 || (_instance$stop = _instance.stop) === null || _instance$stop === void 0 || _instance$stop.call(_instance);
|
|
59
|
+
}
|
|
60
|
+
function play() {
|
|
61
|
+
var _instance2, _instance2$play;
|
|
62
|
+
console.log('props.control', instance);
|
|
63
|
+
(_instance2 = instance) === null || _instance2 === void 0 || (_instance2$play = _instance2.play) === null || _instance2$play === void 0 || _instance2$play.call(_instance2);
|
|
64
|
+
}
|
|
65
|
+
function toggleFullScreen() {
|
|
66
|
+
isFullscreen.value = !isFullscreen.value;
|
|
67
|
+
instance.fullScreen(isFullscreen.value);
|
|
68
|
+
}
|
|
69
|
+
onBeforeUnmount(function () {
|
|
70
|
+
var _instance3, _instance3$dispose;
|
|
71
|
+
(_instance3 = instance) === null || _instance3 === void 0 || (_instance3$dispose = _instance3.dispose) === null || _instance3$dispose === void 0 || _instance3$dispose.call(_instance3);
|
|
72
|
+
instance = null;
|
|
73
|
+
});
|
|
74
|
+
function downloadFile() {
|
|
75
|
+
var fileUrl = 'libs/hikvision/WebComponentsKit.exe';
|
|
76
|
+
console.log('fileUrl', fileUrl);
|
|
77
|
+
var link = document.createElement('a');
|
|
78
|
+
link.href = fileUrl;
|
|
79
|
+
link.download = 'WebComponentsKit.exe';
|
|
80
|
+
link.click();
|
|
81
|
+
}
|
|
82
|
+
return function (_ctx, _cache) {
|
|
83
|
+
return openBlock(), createElementBlock("div", {
|
|
84
|
+
ref_key: "wrapEl",
|
|
85
|
+
ref: wrapEl,
|
|
86
|
+
"class": "wrap-el"
|
|
87
|
+
}, [wrapEl.value ? (openBlock(), createBlock(script$1, {
|
|
88
|
+
key: 0,
|
|
89
|
+
stop: stop,
|
|
90
|
+
play: play,
|
|
91
|
+
isPlay: isPlay.value,
|
|
92
|
+
isFullscreen: isFullscreen.value,
|
|
93
|
+
"toggle-fullscreen-fn": toggleFullScreen,
|
|
94
|
+
"dom-ref": wrapEl.value
|
|
95
|
+
}, {
|
|
96
|
+
"default": withCtx(function () {
|
|
97
|
+
return [createElementVNode("span", _hoisted_1, [createElementVNode("span", {
|
|
98
|
+
onClick: withModifiers(downloadFile, ["stop"])
|
|
99
|
+
}, "下载插件"), createTextVNode(" " + toDisplayString(unref(componentId)), 1)])];
|
|
100
|
+
}),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["isPlay", "isFullscreen", "dom-ref"])) : createCommentVNode("v-if", true)], 512);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export { script as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
domRef: import("vue-types").VueTypeValidableDef<any, import("vue-types/dist/types").ValidatorFunction<any>>;
|
|
3
|
+
stop: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
4
|
+
default: (...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
play: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
7
|
+
default: (...args: any[]) => any;
|
|
8
|
+
};
|
|
9
|
+
isPlay: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>>;
|
|
10
|
+
isFullscreen: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>>;
|
|
11
|
+
toggleFullscreenFn: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
12
|
+
default: (...args: any[]) => any;
|
|
13
|
+
};
|
|
14
|
+
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
domRef: import("vue-types").VueTypeValidableDef<any, import("vue-types/dist/types").ValidatorFunction<any>>;
|
|
18
|
+
stop: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
19
|
+
default: (...args: any[]) => any;
|
|
20
|
+
};
|
|
21
|
+
play: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
22
|
+
default: (...args: any[]) => any;
|
|
23
|
+
};
|
|
24
|
+
isPlay: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>>;
|
|
25
|
+
isFullscreen: import("vue-types").VueTypeValidableDef<boolean, import("vue-types/dist/types").ValidatorFunction<boolean>>;
|
|
26
|
+
toggleFullscreenFn: import("vue-types").VueTypeValidableDef<(...args: any[]) => any, import("vue-types/dist/types").ValidatorFunction<(...args: any[]) => any>> & {
|
|
27
|
+
default: (...args: any[]) => any;
|
|
28
|
+
};
|
|
29
|
+
}>>, {
|
|
30
|
+
stop: (...args: any[]) => any;
|
|
31
|
+
play: (...args: any[]) => any;
|
|
32
|
+
toggleFullscreenFn: (...args: any[]) => any;
|
|
33
|
+
}, {}>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineComponent, toRefs, computed, openBlock, createElementBlock, renderSlot, createVNode, unref, mergeProps, withModifiers } from 'vue';
|
|
2
|
+
import { useFullscreen } from '../../../node_modules/.pnpm/@vueuse_core@10.7.2_vue@3.4.21/node_modules/@vueuse/core/index.js';
|
|
3
|
+
import '../../Icon/src/Icon.vue.js';
|
|
4
|
+
import '../../Icon/src/SvgIcon.vue.js';
|
|
5
|
+
import propTypes from '../../../utils/propTypes.js';
|
|
6
|
+
import script$1 from '../../Icon/src/Icon.vue2.js';
|
|
7
|
+
|
|
8
|
+
var _hoisted_1 = {
|
|
9
|
+
"class": "video-player-toolbar"
|
|
10
|
+
};
|
|
11
|
+
var script = defineComponent({
|
|
12
|
+
__name: 'VideoPlayerToolbar',
|
|
13
|
+
props: {
|
|
14
|
+
domRef: propTypes.any,
|
|
15
|
+
stop: propTypes.func,
|
|
16
|
+
play: propTypes.func,
|
|
17
|
+
isPlay: propTypes.bool,
|
|
18
|
+
isFullscreen: propTypes.bool,
|
|
19
|
+
toggleFullscreenFn: propTypes.func
|
|
20
|
+
},
|
|
21
|
+
setup: function setup(__props) {
|
|
22
|
+
var props = __props;
|
|
23
|
+
var _toRefs = toRefs(props),
|
|
24
|
+
domRef = _toRefs.domRef,
|
|
25
|
+
isPlay = _toRefs.isPlay,
|
|
26
|
+
isFullscreen = _toRefs.isFullscreen;
|
|
27
|
+
console.log('props', props.domRef);
|
|
28
|
+
var _useFullscreen = useFullscreen(domRef.value),
|
|
29
|
+
toggleDom = _useFullscreen.toggle;
|
|
30
|
+
var getAttr = computed(function () {
|
|
31
|
+
return {
|
|
32
|
+
color: "#fff",
|
|
33
|
+
size: 24
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
function playToggle() {
|
|
37
|
+
if (isPlay.value) {
|
|
38
|
+
var _props$stop;
|
|
39
|
+
(_props$stop = props.stop) === null || _props$stop === void 0 || _props$stop.call(props);
|
|
40
|
+
} else {
|
|
41
|
+
var _props$play;
|
|
42
|
+
(_props$play = props.play) === null || _props$play === void 0 || _props$play.call(props);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function fullToggle() {
|
|
46
|
+
var _props$toggleFullscre;
|
|
47
|
+
toggleDom();
|
|
48
|
+
(_props$toggleFullscre = props.toggleFullscreenFn) === null || _props$toggleFullscre === void 0 || _props$toggleFullscre.call(props);
|
|
49
|
+
}
|
|
50
|
+
return function (_ctx, _cache) {
|
|
51
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default"), createVNode(unref(script$1), mergeProps({
|
|
52
|
+
icon: !unref(isFullscreen) ? 'mdi:fullscreen' : 'mdi:fit-to-screen'
|
|
53
|
+
}, getAttr.value, {
|
|
54
|
+
onClick: withModifiers(fullToggle, ["stop"])
|
|
55
|
+
}), null, 16, ["icon"]), createVNode(unref(script$1), mergeProps({
|
|
56
|
+
icon: !unref(isPlay) ? 'mdi:play-circle-outline' : 'mdi:pause-circle',
|
|
57
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(function () {
|
|
58
|
+
return playToggle();
|
|
59
|
+
}, ["stop"]))
|
|
60
|
+
}, getAttr.value), null, 16, ["icon"])]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export { script as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import _typeof from '@babel/runtime/helpers/typeof';
|
|
2
|
+
|
|
3
|
+
var Observable = function Observable() {
|
|
4
|
+
this.Events = {};
|
|
5
|
+
this.__cnt = 0;
|
|
6
|
+
};
|
|
7
|
+
Observable.hasOwnKey = Function.call.bind(Object.hasOwnProperty);
|
|
8
|
+
Observable.slice = Function.call.bind(Array.prototype.slice);
|
|
9
|
+
Observable.prototype.on = function (eventName, callback, context) {
|
|
10
|
+
return this.bindEvent(eventName, callback, 0, context);
|
|
11
|
+
};
|
|
12
|
+
Observable.prototype.un = function (event) {
|
|
13
|
+
var eventName = '';
|
|
14
|
+
var key = '';
|
|
15
|
+
var r = false;
|
|
16
|
+
var type = _typeof(event);
|
|
17
|
+
var that = this;
|
|
18
|
+
if (type === 'string') {
|
|
19
|
+
if (Observable.hasOwnKey(this.Events, event)) {
|
|
20
|
+
delete this.Events[event];
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
} else if (type === 'object') {
|
|
25
|
+
eventName = event[0];
|
|
26
|
+
key = event[1];
|
|
27
|
+
if (Observable.hasOwnKey(this.Events, eventName) && Observable.hasOwnKey(this.Events[eventName], key)) {
|
|
28
|
+
delete this.Events[eventName][key];
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
} else if (type === 'function') {
|
|
33
|
+
that.eachEvent(that.Events, function (keyA, itemA) {
|
|
34
|
+
that.eachEvent(itemA, function (keyB, itemB) {
|
|
35
|
+
if (itemB[0] === event) {
|
|
36
|
+
delete that.Events[keyA][keyB];
|
|
37
|
+
r = true;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
return r;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
Observable.prototype.once = function (eventName, callback, context) {
|
|
46
|
+
return this.bindEvent(eventName, callback, 1, context);
|
|
47
|
+
};
|
|
48
|
+
Observable.prototype.action = function (eventName, args) {
|
|
49
|
+
if (Observable.hasOwnKey(this.Events, eventName)) {
|
|
50
|
+
this.eachEvent(this.Events[eventName], function (key, item) {
|
|
51
|
+
item[0].apply(item[2], args);
|
|
52
|
+
if (item[1]) {
|
|
53
|
+
delete this.Events[eventName][key];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
Observable.prototype.dispatch = function (eventName) {
|
|
59
|
+
var that = this;
|
|
60
|
+
var args = Observable.slice(arguments, 1);
|
|
61
|
+
setTimeout(function () {
|
|
62
|
+
that.action(eventName, args);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
Observable.prototype.dispatchSync = function (eventName) {
|
|
66
|
+
this.action(eventName, Observable.slice(arguments, 1));
|
|
67
|
+
};
|
|
68
|
+
Observable.prototype.clear = function () {
|
|
69
|
+
this.Events = {};
|
|
70
|
+
};
|
|
71
|
+
Observable.prototype.bindEvent = function (eventName, callback, isOne, context) {
|
|
72
|
+
if (typeof eventName !== 'string' || typeof callback !== 'function') {
|
|
73
|
+
throw new Error('传入的事件名称和回调函数有误!');
|
|
74
|
+
}
|
|
75
|
+
if (!Observable.hasOwnKey(this.Events, eventName)) {
|
|
76
|
+
this.Events[eventName] = {};
|
|
77
|
+
}
|
|
78
|
+
this.Events[eventName][++this.__cnt] = [callback, isOne, context];
|
|
79
|
+
return [eventName, this.__cnt];
|
|
80
|
+
};
|
|
81
|
+
Observable.prototype.eachEvent = function (obj, callback) {
|
|
82
|
+
for (var key in obj) {
|
|
83
|
+
if (Observable.hasOwnKey(obj, key)) {
|
|
84
|
+
callback(key, obj[key]);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { Observable as default };
|