@dfsj/components 3.7.2-alpha.6 → 4.0.0-alpha.1
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 +61 -453
- package/README.md +101 -24
- package/dist/_virtual/_rollupPluginBabelHelpers.js +13 -0
- package/dist/components/Boards/src/Boards.vue.js +10 -4
- package/dist/components/Boards/src/Boards.vue2.js +10 -152
- package/dist/components/Boards/src/hooKs/useStyle.d.ts +13 -5
- package/dist/components/Boards/src/hooKs/useStyle.js +10 -104
- package/dist/components/Boards/src/props.d.ts +5 -23
- package/dist/components/Boards/src/props.js +10 -56
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.js +10 -4
- package/dist/components/ClickOutSide/src/ClickOutSide.vue2.js +10 -25
- package/dist/components/Descriptions/src/Descriptions.vue.js +10 -4
- package/dist/components/Descriptions/src/Descriptions.vue2.js +10 -150
- package/dist/components/Editor/src/Editor.vue.js +10 -4
- package/dist/components/Editor/src/Editor.vue2.js +10 -137
- package/dist/components/Form/src/Form.vue.js +10 -4
- package/dist/components/Form/src/Form.vue2.js +10 -394
- package/dist/components/Form/src/components/useRenderCheckbox.js +10 -32
- package/dist/components/Form/src/components/useRenderRadio.js +10 -32
- package/dist/components/Form/src/components/useRenderSelect.js +10 -51
- package/dist/components/Form/src/helper/componentMap.js +10 -32
- package/dist/components/Form/src/helper/index.js +10 -108
- package/dist/components/Form/src/types/index.d.ts +80 -84
- package/dist/components/Form/src/types/index.js +10 -30
- package/dist/components/Form/src/useForm.js +10 -289
- package/dist/components/Highlight/src/Highlight.vue.js +10 -4
- package/dist/components/Highlight/src/Highlight.vue2.js +10 -61
- package/dist/components/Icon/src/Icon.vue.js +10 -4
- package/dist/components/Icon/src/Icon.vue2.js +10 -122
- package/dist/components/Icon/src/SvgIcon.vue.js +10 -6
- package/dist/components/Icon/src/SvgIcon.vue2.js +10 -44
- package/dist/components/Icon/src/SvgIcon.vue3.js +10 -13
- package/dist/components/InputPassword/src/InputPassword.vue.js +10 -4
- package/dist/components/InputPassword/src/InputPassword.vue2.js +10 -57
- package/dist/components/Modal/src/BasicModal.vue.js +10 -4
- package/dist/components/Modal/src/BasicModal.vue2.js +10 -154
- package/dist/components/Modal/src/components/ModalFooter.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalFooter.vue2.js +10 -39
- package/dist/components/Modal/src/components/ModalHeader.vue.js +10 -4
- package/dist/components/Modal/src/components/ModalHeader.vue2.js +10 -80
- package/dist/components/Modal/src/config.d.ts +3 -2
- package/dist/components/Modal/src/config.js +10 -28
- package/dist/components/Modal/src/hooks/useModalDrag.js +10 -109
- package/dist/components/Modal/src/hooks/useTimeout.js +10 -52
- package/dist/components/Modal/src/props.d.ts +16 -56
- package/dist/components/Modal/src/props.js +10 -130
- package/dist/components/Modal/src/utils/index.js +10 -85
- package/dist/components/NodeAxis/src/AbstractNodeProvider.js +10 -21
- package/dist/components/NodeAxis/src/CanvasNodeRender.d.ts +3 -12
- package/dist/components/NodeAxis/src/CanvasNodeRender.js +10 -411
- package/dist/components/NodeAxis/src/NodeAxis.vue.js +10 -4
- package/dist/components/NodeAxis/src/NodeAxis.vue2.js +10 -68
- package/dist/components/NodeAxis/src/NodeModel.js +10 -62
- package/dist/components/NodeAxis/src/NodeRender.js +10 -28
- package/dist/components/NodeAxis/src/NullLayerProvider.js +10 -86
- package/dist/components/NodeAxis/src/NullProvider.js +10 -65
- package/dist/components/NodeAxis/src/TimerNodePlayer.js +10 -148
- package/dist/components/NodeAxis/src/config/node-axis.options.js +10 -55
- package/dist/components/NodeAxis/src/enum/index.js +10 -19
- package/dist/components/NodeAxis/src/utils/assign.js +10 -42
- package/dist/components/Stateful/src/State.js +10 -78
- package/dist/components/Stateful/src/Stateful.vue.js +10 -4
- package/dist/components/Stateful/src/Stateful.vue2.js +10 -52
- package/dist/components/Stateful/src/props.d.ts +2 -6
- package/dist/components/Stateful/src/props.js +10 -28
- package/dist/components/Table/index.d.ts +3 -3
- package/dist/components/Table/src/Table.vue.js +10 -4
- package/dist/components/Table/src/Table.vue2.js +10 -583
- package/dist/components/Table/src/components/ColumnSetting.vue.js +10 -4
- package/dist/components/Table/src/components/ColumnSetting.vue2.js +10 -263
- package/dist/components/Table/src/components/TableActions.vue.js +10 -4
- package/dist/components/Table/src/components/TableActions.vue2.js +10 -107
- package/dist/components/Table/src/helper/index.js +10 -10
- package/dist/components/Table/src/types/index.d.ts +11 -13
- package/dist/components/Table/src/useTable.d.ts +36 -1
- package/dist/components/Table/src/useTable.js +10 -283
- package/dist/components/UnifyChart/src/ChartToolbox.vue.js +10 -4
- package/dist/components/UnifyChart/src/ChartToolbox.vue2.js +10 -82
- package/dist/components/UnifyChart/src/UnifyChart.vue.js +10 -4
- package/dist/components/UnifyChart/src/UnifyChart.vue2.js +10 -57
- package/dist/components/UnifyChart/src/hooks/useLoader.js +10 -92
- package/dist/components/UnifyChart/src/hooks/useRender.d.ts +8 -13
- package/dist/components/UnifyChart/src/hooks/useRender.js +10 -49
- package/dist/components/UnifyChart/src/props.d.ts +13 -59
- package/dist/components/UnifyChart/src/props.js +10 -32
- package/dist/components/UnifyChart/src/useDownLoad.js +10 -26
- package/dist/components/Visual/src/BufferLayerPlayer.js +10 -309
- package/dist/components/Visual/src/ResolvableLayerProvider.js +10 -252
- package/dist/components/Visual/src/config/default.manager.js +10 -6
- package/dist/components/Visual/src/config/default.provider.js +10 -17
- package/dist/components/Visual/src/mapping.js +10 -6
- package/dist/components/Visual/src/resolvers/IntervalResolver.js +10 -168
- package/dist/components/Visual/src/resolvers/tools.resolver.js +10 -151
- package/dist/components/Visual/src/utils/NodeMath.js +10 -99
- package/dist/components/Windows/src/ModalWrap.vue.js +10 -4
- package/dist/components/Windows/src/ModalWrap.vue2.js +10 -132
- package/dist/components/Windows/src/Windows.vue.js +10 -6
- package/dist/components/Windows/src/Windows.vue2.js +10 -55
- package/dist/components/Windows/src/Windows.vue3.js +10 -24
- package/dist/components/Windows/src/props.js +10 -8
- package/dist/directives/clickOutside.js +10 -70
- package/dist/directives/repeatClick.js +10 -28
- package/dist/directives/resizable.js +10 -195
- package/dist/index.d.ts +0 -1
- package/dist/index.js +11 -52
- package/dist/index.min.css +3 -3
- package/dist/themes/index.js +9 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/utils/index.js +10 -23
- package/package.json +54 -25
- package/dist/components/Boards/src/Boards.vue.d.ts +0 -104
- package/dist/components/ClickOutSide/src/ClickOutSide.vue.d.ts +0 -7
- package/dist/components/Descriptions/src/Descriptions.vue.d.ts +0 -97
- package/dist/components/Editor/src/Editor.vue.d.ts +0 -51
- package/dist/components/Form/src/Form.vue.d.ts +0 -838
- package/dist/components/Highlight/src/Highlight.vue.d.ts +0 -41
- package/dist/components/Icon/src/Icon.vue.d.ts +0 -49
- package/dist/components/Icon/src/SvgIcon.vue.d.ts +0 -45
- package/dist/components/InputPassword/src/InputPassword.vue.d.ts +0 -27
- package/dist/components/Modal/src/BasicModal.vue.d.ts +0 -419
- package/dist/components/Modal/src/components/ModalFooter.vue.d.ts +0 -86
- package/dist/components/Modal/src/components/ModalHeader.vue.d.ts +0 -241
- package/dist/components/NodeAxis/src/BCanvasNodeRender.d.ts +0 -19
- package/dist/components/NodeAxis/src/BCanvasNodeRender.js +0 -344
- package/dist/components/NodeAxis/src/NodeAxis.vue.d.ts +0 -17
- package/dist/components/Stateful/src/Stateful.vue.d.ts +0 -22
- package/dist/components/Table/src/Table.vue.d.ts +0 -1535
- package/dist/components/Table/src/components/ColumnSetting.vue.d.ts +0 -30
- package/dist/components/Table/src/components/TableActions.vue.d.ts +0 -229
- package/dist/components/UnifyChart/src/ChartToolbox.vue.d.ts +0 -46
- package/dist/components/UnifyChart/src/UnifyChart.vue.d.ts +0 -95
- package/dist/components/Video/index.d.ts +0 -2
- package/dist/components/Video/src/VideoPlayer.vue.d.ts +0 -60
- package/dist/components/Video/src/VideoPlayer.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayer.vue2.js +0 -107
- package/dist/components/Video/src/VideoPlayerToolbar.vue.d.ts +0 -34
- package/dist/components/Video/src/VideoPlayerToolbar.vue.js +0 -5
- package/dist/components/Video/src/VideoPlayerToolbar.vue2.js +0 -65
- package/dist/components/Video/src/abstract/AbstractVideoControl.d.ts +0 -7
- package/dist/components/Video/src/abstract/Observable.d.ts +0 -6
- package/dist/components/Video/src/abstract/Observable.js +0 -89
- package/dist/components/Video/src/abstract/VideoControl.d.ts +0 -32
- package/dist/components/Video/src/abstract/VideoControl.js +0 -48
- package/dist/components/Video/src/control/DaHua.d.ts +0 -12
- package/dist/components/Video/src/control/DaHua.js +0 -154
- package/dist/components/Video/src/control/Hikvision.d.ts +0 -28
- package/dist/components/Video/src/control/Hikvision.js +0 -249
- package/dist/components/Video/src/control/VideoFactory.d.ts +0 -3
- package/dist/components/Video/src/control/VideoFactory.js +0 -31
- package/dist/components/Video/src/enums/CommonEnum.d.ts +0 -26
- package/dist/components/Video/src/enums/CommonEnum.js +0 -31
- package/dist/components/Windows/src/ModalWrap.vue.d.ts +0 -14
- package/dist/components/Windows/src/Windows.vue.d.ts +0 -21
- package/dist/helper/lang.d.ts +0 -1
- package/dist/helper/lang.js +0 -546
- package/dist/node_modules/.pnpm/@vueuse_core@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/core/index.js +0 -393
- package/dist/node_modules/.pnpm/@vueuse_shared@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/shared/index.js +0 -53
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { defineComponent, toRefs, computed, openBlock, createElementBlock, renderSlot, createVNode, unref, mergeProps, withModifiers } from 'vue';
|
|
2
|
-
import { useFullscreen } from '../../../node_modules/.pnpm/@vueuse_core@13.9.0_vue@3.5.20_typescript@5.9.2_/node_modules/@vueuse/core/index.js';
|
|
3
|
-
import '../../Icon/src/Icon.vue.js';
|
|
4
|
-
import '../../Icon/src/SvgIcon.vue.js';
|
|
5
|
-
import propTypes from 'vue-types';
|
|
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 };
|
|
@@ -1,89 +0,0 @@
|
|
|
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 };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import AbstractVideoControl from "./AbstractVideoControl";
|
|
2
|
-
import Observable from "./Observable";
|
|
3
|
-
export interface VideoBaseOpt {
|
|
4
|
-
ip: string;
|
|
5
|
-
port: string | number;
|
|
6
|
-
channel: string | number;
|
|
7
|
-
username: string;
|
|
8
|
-
streamType: string | number;
|
|
9
|
-
password: string;
|
|
10
|
-
wrapEl: any;
|
|
11
|
-
canvasEl: any;
|
|
12
|
-
videoEl: any;
|
|
13
|
-
needPlugin: boolean;
|
|
14
|
-
needLogin: boolean;
|
|
15
|
-
}
|
|
16
|
-
export default class VideoControl extends Observable implements AbstractVideoControl {
|
|
17
|
-
ip: string;
|
|
18
|
-
port: string | number;
|
|
19
|
-
channel: string | number;
|
|
20
|
-
streamType: string | number;
|
|
21
|
-
username: string;
|
|
22
|
-
password: string;
|
|
23
|
-
wrapEl: any;
|
|
24
|
-
isPlayback: boolean;
|
|
25
|
-
playbackIndex: number;
|
|
26
|
-
state: object;
|
|
27
|
-
player: any;
|
|
28
|
-
needPlugin: boolean;
|
|
29
|
-
needLogin: boolean;
|
|
30
|
-
constructor(opt: Partial<VideoBaseOpt>);
|
|
31
|
-
get identify(): string;
|
|
32
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
-
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
4
|
-
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
5
|
-
import _inherits from '@babel/runtime/helpers/inherits';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
|
-
import Observable from './Observable.js';
|
|
8
|
-
|
|
9
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
-
var VideoControl = /*#__PURE__*/function (_Observable) {
|
|
12
|
-
function VideoControl(opt) {
|
|
13
|
-
var _this;
|
|
14
|
-
_classCallCheck(this, VideoControl);
|
|
15
|
-
_this = _callSuper(this, VideoControl);
|
|
16
|
-
_defineProperty(_this, "ip", void 0);
|
|
17
|
-
_defineProperty(_this, "port", void 0);
|
|
18
|
-
_defineProperty(_this, "channel", void 0);
|
|
19
|
-
_defineProperty(_this, "streamType", void 0);
|
|
20
|
-
_defineProperty(_this, "username", void 0);
|
|
21
|
-
_defineProperty(_this, "password", void 0);
|
|
22
|
-
_defineProperty(_this, "wrapEl", void 0);
|
|
23
|
-
_defineProperty(_this, "isPlayback", void 0);
|
|
24
|
-
_defineProperty(_this, "playbackIndex", void 0);
|
|
25
|
-
_defineProperty(_this, "state", void 0);
|
|
26
|
-
_defineProperty(_this, "player", void 0);
|
|
27
|
-
_defineProperty(_this, "needPlugin", void 0);
|
|
28
|
-
_defineProperty(_this, "needLogin", void 0);
|
|
29
|
-
console.log('opt', opt);
|
|
30
|
-
_this.ip = opt.ip;
|
|
31
|
-
_this.port = opt.port;
|
|
32
|
-
_this.channel = opt.channel;
|
|
33
|
-
_this.streamType = opt.streamType;
|
|
34
|
-
_this.username = opt.username;
|
|
35
|
-
_this.password = opt.password;
|
|
36
|
-
_this.wrapEl = opt.wrapEl;
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
_inherits(VideoControl, _Observable);
|
|
40
|
-
return _createClass(VideoControl, [{
|
|
41
|
-
key: "identify",
|
|
42
|
-
get: function get() {
|
|
43
|
-
return this.ip + '_' + this.port;
|
|
44
|
-
}
|
|
45
|
-
}]);
|
|
46
|
-
}(Observable);
|
|
47
|
-
|
|
48
|
-
export { VideoControl as default };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import VideoControl, { VideoBaseOpt } from "../abstract/VideoControl";
|
|
2
|
-
export default class DaHua extends VideoControl {
|
|
3
|
-
canvasEl: any;
|
|
4
|
-
videoEl: any;
|
|
5
|
-
constructor(opts: Partial<VideoBaseOpt>);
|
|
6
|
-
generateEl(): void;
|
|
7
|
-
removeEl(): void;
|
|
8
|
-
login(): void;
|
|
9
|
-
stop(): void;
|
|
10
|
-
play(isPlayback?: boolean): void;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
-
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
|
|
4
|
-
import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
5
|
-
import _inherits from '@babel/runtime/helpers/inherits';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
7
|
-
import VideoControl from '../abstract/VideoControl.js';
|
|
8
|
-
import { EventEnum } from '../enums/CommonEnum.js';
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
|
-
var DEF = {
|
|
15
|
-
ip: '172.168.1.247',
|
|
16
|
-
port: 80,
|
|
17
|
-
username: 'admin',
|
|
18
|
-
password: 'admin123',
|
|
19
|
-
channel: 1,
|
|
20
|
-
streamType: 0
|
|
21
|
-
};
|
|
22
|
-
var DaHua = /*#__PURE__*/function (_VideoControl) {
|
|
23
|
-
function DaHua(opts) {
|
|
24
|
-
var _this;
|
|
25
|
-
_classCallCheck(this, DaHua);
|
|
26
|
-
_this = _callSuper(this, DaHua, [_objectSpread(_objectSpread({}, DEF), opts)]);
|
|
27
|
-
_defineProperty(_this, "canvasEl", void 0);
|
|
28
|
-
_defineProperty(_this, "videoEl", void 0);
|
|
29
|
-
_this.isPlayback = false;
|
|
30
|
-
_this.playbackIndex = 0;
|
|
31
|
-
_this.generateEl();
|
|
32
|
-
_this.play();
|
|
33
|
-
return _this;
|
|
34
|
-
}
|
|
35
|
-
_inherits(DaHua, _VideoControl);
|
|
36
|
-
return _createClass(DaHua, [{
|
|
37
|
-
key: "generateEl",
|
|
38
|
-
value: function generateEl() {
|
|
39
|
-
this.canvasEl = document.createElement('canvas');
|
|
40
|
-
this.canvasEl.style.cssText = "position: absolute;left: 0;top: 0;width: 100%;height: 100%;";
|
|
41
|
-
this.videoEl = document.createElement('video');
|
|
42
|
-
this.videoEl.style.cssText = "display: none;width:100%;height:100%;position:absolute;top:0;left:0";
|
|
43
|
-
if (this.wrapEl) {
|
|
44
|
-
this.wrapEl.appendChild(this.canvasEl);
|
|
45
|
-
this.wrapEl.appendChild(this.videoEl);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "removeEl",
|
|
50
|
-
value: function removeEl() {
|
|
51
|
-
var remove = function remove(el) {
|
|
52
|
-
var parent = el === null || el === void 0 ? void 0 : el.parentNode;
|
|
53
|
-
if (parent) {
|
|
54
|
-
parent.removeChild(el);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
remove(this.videoEl);
|
|
58
|
-
remove(this.canvasEl);
|
|
59
|
-
this.videoEl = null;
|
|
60
|
-
this.canvasEl = null;
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: "login",
|
|
64
|
-
value: function login() {
|
|
65
|
-
var ip = this.ip,
|
|
66
|
-
port = this.port,
|
|
67
|
-
username = this.username,
|
|
68
|
-
password = this.password;
|
|
69
|
-
var target = ip + ':' + port;
|
|
70
|
-
setIP(target);
|
|
71
|
-
RPC.login(username, password, false).then(function (res) {
|
|
72
|
-
console.info('登录成功', res);
|
|
73
|
-
RPC.keepAlive(300, 60000, _getSession(), target);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
key: "stop",
|
|
78
|
-
value: function stop() {
|
|
79
|
-
var _this$player, _this$player$pause;
|
|
80
|
-
this === null || this === void 0 || (_this$player = this.player) === null || _this$player === void 0 || (_this$player$pause = _this$player.pause) === null || _this$player$pause === void 0 || _this$player$pause.call(_this$player);
|
|
81
|
-
this.dispatch(EventEnum.PAUSE, {
|
|
82
|
-
type: 'Pause',
|
|
83
|
-
target: this
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}, {
|
|
87
|
-
key: "play",
|
|
88
|
-
value: function play() {
|
|
89
|
-
var _this2 = this;
|
|
90
|
-
var isPlayback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
91
|
-
this.stop();
|
|
92
|
-
var ip = this.ip,
|
|
93
|
-
port = this.port,
|
|
94
|
-
username = this.username,
|
|
95
|
-
password = this.password,
|
|
96
|
-
streamType = this.streamType,
|
|
97
|
-
channel = this.channel;
|
|
98
|
-
var url;
|
|
99
|
-
var options = {
|
|
100
|
-
wsURL: 'ws://' + ip + ':' + port + '/rtspoverwebsocket',
|
|
101
|
-
rtspURL: !isPlayback ? 'rtsp://' + ip + ':' + port + '/cam/realmonitor?channel=' + channel + '&subtype=' + streamType + '&proto=Private3' : 'rtsp://' + ip + ':' + port + '/' + url,
|
|
102
|
-
username: username,
|
|
103
|
-
password: password,
|
|
104
|
-
lessRateCanvas: true,
|
|
105
|
-
playback: this.isPlayback,
|
|
106
|
-
isPrivateProtocol: false,
|
|
107
|
-
realm: RPC.realm,
|
|
108
|
-
playbackIndex: this.playbackIndex
|
|
109
|
-
};
|
|
110
|
-
this.player = new PlayerControl(options);
|
|
111
|
-
console.log('this.player', this.player);
|
|
112
|
-
this.player.on('PlayStart', function (e) {
|
|
113
|
-
_this2.dispatch(EventEnum.PLAY, {
|
|
114
|
-
type: 'PlayStart',
|
|
115
|
-
target: _this2
|
|
116
|
-
});
|
|
117
|
-
console.log('PlayStart', e);
|
|
118
|
-
if (!_this2.player.isPlayback) ;
|
|
119
|
-
});
|
|
120
|
-
this.player.on('Error', function (e) {
|
|
121
|
-
console.log('Error: ' + JSON.stringify(e));
|
|
122
|
-
_this2.dispatch(EventEnum.ERROR, {
|
|
123
|
-
type: 'Error',
|
|
124
|
-
code: ''
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
this.player.on('WorkerReady', function (ev) {
|
|
128
|
-
_this2.dispatch(EventEnum.READY, {
|
|
129
|
-
type: 'WorkerReady',
|
|
130
|
-
target: _this2
|
|
131
|
-
});
|
|
132
|
-
console.log('准备好了 开始链接播放..', ev);
|
|
133
|
-
_this2.player.connect();
|
|
134
|
-
});
|
|
135
|
-
console.log('this.', this);
|
|
136
|
-
this.player.init(this.canvasEl, this.videoEl);
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "dispose",
|
|
140
|
-
value: function dispose() {
|
|
141
|
-
var _this$player2, _this$player2$stop, _this$player3, _this$player3$close;
|
|
142
|
-
this.dispatch(EventEnum.DISPOSE, {
|
|
143
|
-
type: 'dispose',
|
|
144
|
-
target: this
|
|
145
|
-
});
|
|
146
|
-
this.player && ((_this$player2 = this.player) === null || _this$player2 === void 0 || (_this$player2$stop = _this$player2.stop) === null || _this$player2$stop === void 0 ? void 0 : _this$player2$stop.call(_this$player2));
|
|
147
|
-
this.player && ((_this$player3 = this.player) === null || _this$player3 === void 0 || (_this$player3$close = _this$player3.close) === null || _this$player3$close === void 0 ? void 0 : _this$player3$close.call(_this$player3));
|
|
148
|
-
this.removeEl();
|
|
149
|
-
this.player = null;
|
|
150
|
-
}
|
|
151
|
-
}]);
|
|
152
|
-
}(VideoControl);
|
|
153
|
-
|
|
154
|
-
export { DaHua as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import VideoControl, { VideoBaseOpt } from '../abstract/VideoControl';
|
|
2
|
-
interface IHikvision {
|
|
3
|
-
elId: string;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
szBasePath: string;
|
|
7
|
-
}
|
|
8
|
-
type HikvisionOpt = Partial<VideoBaseOpt> & IHikvision;
|
|
9
|
-
export default class Hikvision extends VideoControl {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
elId: string;
|
|
13
|
-
container: any;
|
|
14
|
-
szBasePath: string;
|
|
15
|
-
constructor(opts: Partial<HikvisionOpt>);
|
|
16
|
-
get pluginElId(): string;
|
|
17
|
-
generateEl(): void;
|
|
18
|
-
removeEl(): void;
|
|
19
|
-
checkPlugin(): boolean;
|
|
20
|
-
play(): void;
|
|
21
|
-
stop(): void;
|
|
22
|
-
dispose(): void;
|
|
23
|
-
login(): void;
|
|
24
|
-
logout(): void;
|
|
25
|
-
fullScreen(flag: boolean): void;
|
|
26
|
-
downloadPlugin(): void;
|
|
27
|
-
}
|
|
28
|
-
export {};
|