@ezuikit/player-theme 2.0.2-beta.6 → 2.0.2-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +140 -623
- package/dist/index.mjs +141 -624
- package/dist/index.umd.js +161 -607
- package/dist/style.css +3 -2
- package/dist/style.js +2 -2
- package/dist/types/index.d.ts +67 -43
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @ezuikit/player-theme v2.0.2-beta.
|
|
3
|
-
* Copyright (c) 2025-12-
|
|
2
|
+
* @ezuikit/player-theme v2.0.2-beta.7
|
|
3
|
+
* Copyright (c) 2025-12-10 Ezviz-OpenBiz
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
@@ -13,6 +13,7 @@ var require$$1 = require('@ezuikit/utils-tools');
|
|
|
13
13
|
var screenfull = require('screenfull');
|
|
14
14
|
var I18n = require('@ezuikit/utils-i18n');
|
|
15
15
|
var Logger = require('@ezuikit/utils-logger');
|
|
16
|
+
var controlDatePicker = require('@ezuikit/control-date-picker');
|
|
16
17
|
var controlTimeLine = require('@ezuikit/control-time-line');
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -43,7 +44,8 @@ var THEME_PROPS = [
|
|
|
43
44
|
'speed',
|
|
44
45
|
'urlInfo',
|
|
45
46
|
'videoLevelList',
|
|
46
|
-
'videoLevel'
|
|
47
|
+
'videoLevel',
|
|
48
|
+
'recMonth'
|
|
47
49
|
];
|
|
48
50
|
/**
|
|
49
51
|
* 当移动端 picker 控件打开时需要关闭动画(定时器)
|
|
@@ -189,8 +191,9 @@ var EVENTS = {
|
|
|
189
191
|
/** 全局全屏控件销毁 */ globalFullscreenDestroy: 'Control.globalFullscreenDestroy',
|
|
190
192
|
/** 日期面板展示隐藏变换 */ datePanelOpenChange: 'Control.datePanelOpenChange',
|
|
191
193
|
/** 日期改变 */ dateChange: 'Control.dateChange',
|
|
194
|
+
/** 日期改变 */ dateMonthChange: 'Control.dateMonthChange',
|
|
192
195
|
/** 日期销毁 */ dateDestroy: 'Control.datePanelDestroy',
|
|
193
|
-
/**
|
|
196
|
+
/** 时间轴拖动结束 */ timeLineChange: 'Control.timeLineChange',
|
|
194
197
|
/** 时间轴图片列表面板 */ timeLinePanelOpenChange: 'Control.timeLinePanelOpenChange',
|
|
195
198
|
/** 时间轴控件销毁 */ timeLineDestroy: 'Control.timeLineDestroy',
|
|
196
199
|
/** 主题控件挂载前 切换新的主题也会触发,如果想首次获取需要在 onInitializing 回调中进行监听 */ beforeMountControls: 'Control.beforeMountControls',
|
|
@@ -201,7 +204,7 @@ var EVENTS = {
|
|
|
201
204
|
/** 加载控件销毁 */ loadingDestroy: 'Control.loadingDestroy',
|
|
202
205
|
/** 消息控件销毁 */ messageDestroy: 'Control.messageDestroy',
|
|
203
206
|
/** 播放器内容区域销毁 */ contentDestroy: 'Control.contentDestroy',
|
|
204
|
-
contentRerender: 'Control.contentRerender'
|
|
207
|
+
/** 播放器内容区域重新渲染 */ contentRerender: 'Control.contentRerender'
|
|
205
208
|
},
|
|
206
209
|
/**
|
|
207
210
|
* 主题控件相关
|
|
@@ -4062,11 +4065,11 @@ function debounce(func, wait) {
|
|
|
4062
4065
|
// 对讲
|
|
4063
4066
|
// =======================================================
|
|
4064
4067
|
theme.on(EVENTS.talkingChange, function(talking) {
|
|
4065
|
-
var _theme_controls_talkControl,
|
|
4068
|
+
var _theme_controls, _theme_controls_talkControl, _theme_controls1;
|
|
4066
4069
|
theme._talking = talking;
|
|
4067
|
-
if (talking !== ((
|
|
4068
|
-
var _theme_controls_talkControl1,
|
|
4069
|
-
(
|
|
4070
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.talkControl) && talking !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_talkControl = _theme_controls1.talkControl) == null ? void 0 : _theme_controls_talkControl.active)) {
|
|
4071
|
+
var _theme_controls_talkControl1, _theme_controls2;
|
|
4072
|
+
(_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_talkControl1 = _theme_controls2.talkControl) == null ? void 0 : _theme_controls_talkControl1.emit(EVENTS.talkingChange, talking);
|
|
4070
4073
|
}
|
|
4071
4074
|
});
|
|
4072
4075
|
theme.on(EVENTS.talkVolumeChange, function(value) {
|
|
@@ -4077,9 +4080,9 @@ function debounce(func, wait) {
|
|
|
4077
4080
|
// 录制
|
|
4078
4081
|
// =======================================================
|
|
4079
4082
|
theme.on(EVENTS.recordingChange, function(recording) {
|
|
4080
|
-
var _theme_controls_recordControl,
|
|
4083
|
+
var _theme_controls, _theme_controls_recordControl, _theme_controls1;
|
|
4081
4084
|
theme._recording = recording;
|
|
4082
|
-
if (recording !== ((
|
|
4085
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.recordControl) && recording !== ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_recordControl = _theme_controls1.recordControl) == null ? void 0 : _theme_controls_recordControl.active)) theme.controls.recordControl.active = recording;
|
|
4083
4086
|
});
|
|
4084
4087
|
// =======================================================
|
|
4085
4088
|
// 清晰度
|
|
@@ -4096,14 +4099,14 @@ function debounce(func, wait) {
|
|
|
4096
4099
|
// 放大
|
|
4097
4100
|
// =======================================================
|
|
4098
4101
|
theme.on(EVENTS.zoomingChange, function(zooming) {
|
|
4099
|
-
var _theme_controls_zoomControl1,
|
|
4100
|
-
if (((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 =
|
|
4102
|
+
var _theme_controls1, _theme_controls_zoomControl1, _theme_controls2;
|
|
4103
|
+
if (((_theme_controls1 = theme.controls) == null ? void 0 : _theme_controls1.zoomControl) && ((_theme_controls2 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl1 = _theme_controls2.zoomControl) == null ? void 0 : _theme_controls_zoomControl1.active) !== zooming) {
|
|
4101
4104
|
theme.controls.zoomControl.active = zooming;
|
|
4102
4105
|
}
|
|
4103
4106
|
});
|
|
4104
4107
|
theme.on(EVENTS.zoomChange, function(zoom) {
|
|
4105
|
-
var _theme_controls_zoomControl,
|
|
4106
|
-
if (((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_zoomControl =
|
|
4108
|
+
var _theme_controls, _theme_controls_zoomControl, _theme_controls1;
|
|
4109
|
+
if (((_theme_controls = theme.controls) == null ? void 0 : _theme_controls.zoomControl) && ((_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_zoomControl = _theme_controls1.zoomControl) == null ? void 0 : _theme_controls_zoomControl.value) !== zoom) {
|
|
4107
4110
|
theme.controls.zoomControl.value = zoom;
|
|
4108
4111
|
}
|
|
4109
4112
|
});
|
|
@@ -4129,31 +4132,40 @@ function debounce(func, wait) {
|
|
|
4129
4132
|
// 全屏
|
|
4130
4133
|
// =======================================================
|
|
4131
4134
|
theme == null ? void 0 : theme.on(EVENTS.fullscreenChange, function(info) {
|
|
4132
|
-
if (
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4135
|
+
if (theme.zoomUtil) {
|
|
4136
|
+
if ([
|
|
4137
|
+
0,
|
|
4138
|
+
180
|
|
4139
|
+
].includes(theme.orientationAngle) && info.isMobile && info.isCurrentFullscreen) {
|
|
4140
|
+
var // 代表移动端播放内容节点被旋转了 90度
|
|
4141
|
+
_theme_zoomUtil_setTransform, _theme_zoomUtil;
|
|
4142
|
+
(_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
|
|
4143
|
+
} else {
|
|
4144
|
+
var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
|
|
4145
|
+
(_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
|
|
4146
|
+
}
|
|
4142
4147
|
}
|
|
4143
4148
|
});
|
|
4144
4149
|
theme == null ? void 0 : theme.on(EVENTS.orientationChange, function(angle) {
|
|
4145
|
-
if (
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4150
|
+
if (theme.zoomUtil) {
|
|
4151
|
+
if ([
|
|
4152
|
+
0,
|
|
4153
|
+
180
|
|
4154
|
+
].includes(angle) && Utils.isMobile && theme.isCurrentFullscreen) {
|
|
4155
|
+
var // 代表移动端播放内容节点被旋转了 90度
|
|
4156
|
+
_theme_zoomUtil_setTransform, _theme_zoomUtil;
|
|
4157
|
+
(_theme_zoomUtil = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform = _theme_zoomUtil.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform.call(_theme_zoomUtil, true);
|
|
4158
|
+
} else {
|
|
4159
|
+
var _theme_zoomUtil_setTransform1, _theme_zoomUtil1;
|
|
4160
|
+
(_theme_zoomUtil1 = theme.zoomUtil) == null ? void 0 : (_theme_zoomUtil_setTransform1 = _theme_zoomUtil1.setTransform) == null ? void 0 : _theme_zoomUtil_setTransform1.call(_theme_zoomUtil1, false);
|
|
4161
|
+
}
|
|
4155
4162
|
}
|
|
4156
4163
|
});
|
|
4164
|
+
// 日期选择器
|
|
4165
|
+
theme == null ? void 0 : theme.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
4166
|
+
var _theme_controls_dateControl_emit, _theme_controls_dateControl, _theme_controls;
|
|
4167
|
+
(_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : (_theme_controls_dateControl_emit = _theme_controls_dateControl.emit) == null ? void 0 : _theme_controls_dateControl_emit.call(_theme_controls_dateControl, EVENTS.control.dateMonthChange, dates);
|
|
4168
|
+
});
|
|
4157
4169
|
}
|
|
4158
4170
|
/**
|
|
4159
4171
|
* 控件向主题发现通信消息 control.on -> theme.emit ,仅用来转发控件的事件
|
|
@@ -4356,9 +4368,9 @@ function debounce(func, wait) {
|
|
|
4356
4368
|
});
|
|
4357
4369
|
theme.controls.timeLineControl.on(EVENTS.control.timeLinePanelOpenChange, function(open) {
|
|
4358
4370
|
var _theme_controls_dateControl, _theme_controls;
|
|
4359
|
-
if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.
|
|
4360
|
-
var
|
|
4361
|
-
(_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (
|
|
4371
|
+
if ((_theme_controls = theme.controls) == null ? void 0 : (_theme_controls_dateControl = _theme_controls.dateControl) == null ? void 0 : _theme_controls_dateControl.datePicker) {
|
|
4372
|
+
var _theme_controls_dateControl_datePicker, _theme_controls_dateControl1, _theme_controls1;
|
|
4373
|
+
(_theme_controls1 = theme.controls) == null ? void 0 : (_theme_controls_dateControl1 = _theme_controls1.dateControl) == null ? void 0 : (_theme_controls_dateControl_datePicker = _theme_controls_dateControl1.datePicker) == null ? void 0 : _theme_controls_dateControl_datePicker.hide();
|
|
4362
4374
|
}
|
|
4363
4375
|
theme.emit(EVENTS.control.timeLinePanelOpenChange, open);
|
|
4364
4376
|
});
|
|
@@ -4651,12 +4663,12 @@ function getDefaultExportFromCjs (x) {
|
|
|
4651
4663
|
* Released under the MIT License.
|
|
4652
4664
|
*/
|
|
4653
4665
|
|
|
4654
|
-
var dist$
|
|
4655
|
-
var hasRequiredDist$
|
|
4666
|
+
var dist$1;
|
|
4667
|
+
var hasRequiredDist$1;
|
|
4656
4668
|
|
|
4657
|
-
function requireDist$
|
|
4658
|
-
if (hasRequiredDist$
|
|
4659
|
-
hasRequiredDist$
|
|
4669
|
+
function requireDist$1 () {
|
|
4670
|
+
if (hasRequiredDist$1) return dist$1;
|
|
4671
|
+
hasRequiredDist$1 = 1;
|
|
4660
4672
|
|
|
4661
4673
|
/**
|
|
4662
4674
|
* Zoom position
|
|
@@ -5363,12 +5375,12 @@ function requireDist$2 () {
|
|
|
5363
5375
|
}();
|
|
5364
5376
|
Zoom.VERSION = '0.0.2';
|
|
5365
5377
|
|
|
5366
|
-
dist$
|
|
5367
|
-
return dist$
|
|
5378
|
+
dist$1 = Zoom;
|
|
5379
|
+
return dist$1;
|
|
5368
5380
|
}
|
|
5369
5381
|
|
|
5370
|
-
var distExports$
|
|
5371
|
-
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$
|
|
5382
|
+
var distExports$1 = requireDist$1();
|
|
5383
|
+
var Zoom = /*@__PURE__*/getDefaultExportFromCjs(distExports$1);
|
|
5372
5384
|
|
|
5373
5385
|
function _extends$h() {
|
|
5374
5386
|
_extends$h = Object.assign || function(target) {
|
|
@@ -6443,7 +6455,7 @@ function _set_prototype_of$d(o, p) {
|
|
|
6443
6455
|
return CapturePicture;
|
|
6444
6456
|
}(Control);
|
|
6445
6457
|
|
|
6446
|
-
var dist
|
|
6458
|
+
var dist = {};
|
|
6447
6459
|
|
|
6448
6460
|
/*
|
|
6449
6461
|
* @ezuikit/control-ptz v0.0.1
|
|
@@ -6451,11 +6463,11 @@ var dist$1 = {};
|
|
|
6451
6463
|
* Released under the MIT License.
|
|
6452
6464
|
*/
|
|
6453
6465
|
|
|
6454
|
-
var hasRequiredDist
|
|
6466
|
+
var hasRequiredDist;
|
|
6455
6467
|
|
|
6456
|
-
function requireDist
|
|
6457
|
-
if (hasRequiredDist
|
|
6458
|
-
hasRequiredDist
|
|
6468
|
+
function requireDist () {
|
|
6469
|
+
if (hasRequiredDist) return dist;
|
|
6470
|
+
hasRequiredDist = 1;
|
|
6459
6471
|
|
|
6460
6472
|
var deepmerge$1 = deepmerge;
|
|
6461
6473
|
var utilsTools = require$$1;
|
|
@@ -7378,13 +7390,13 @@ function requireDist$1 () {
|
|
|
7378
7390
|
return Ptz;
|
|
7379
7391
|
}(BasePtz);
|
|
7380
7392
|
|
|
7381
|
-
dist
|
|
7382
|
-
dist
|
|
7383
|
-
dist
|
|
7384
|
-
return dist
|
|
7393
|
+
dist.BasePtz = BasePtz;
|
|
7394
|
+
dist.MobilePtz = MobilePtz;
|
|
7395
|
+
dist.Ptz = Ptz;
|
|
7396
|
+
return dist;
|
|
7385
7397
|
}
|
|
7386
7398
|
|
|
7387
|
-
var distExports
|
|
7399
|
+
var distExports = requireDist();
|
|
7388
7400
|
|
|
7389
7401
|
function _defineProperties$4(target, props) {
|
|
7390
7402
|
for(var i = 0; i < props.length; i++){
|
|
@@ -7483,7 +7495,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7483
7495
|
this.$turntable.classList.add("" + PREFIX_CLASS + "-ptz-turntable");
|
|
7484
7496
|
this.$panel.appendChild(this.$turntable);
|
|
7485
7497
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7486
|
-
this._ptzControl = new distExports
|
|
7498
|
+
this._ptzControl = new distExports.Ptz(this.$turntable, _extends$b({}, this._options, {
|
|
7487
7499
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7488
7500
|
onDirection: this._onDirection.bind(this)
|
|
7489
7501
|
}));
|
|
@@ -7492,7 +7504,7 @@ function _set_prototype_of$c(o, p) {
|
|
|
7492
7504
|
};
|
|
7493
7505
|
_proto.renderMobileExtend = function renderMobileExtend($container) {
|
|
7494
7506
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7495
|
-
if (!this._ptzControl1) this._ptzControl1 = new distExports
|
|
7507
|
+
if (!this._ptzControl1) this._ptzControl1 = new distExports.MobilePtz($container, _extends$b({}, this._options, {
|
|
7496
7508
|
onSpeedChange: this._onSpeedChange.bind(this),
|
|
7497
7509
|
onDirection: this._onDirection.bind(this)
|
|
7498
7510
|
}));
|
|
@@ -8620,541 +8632,6 @@ var SPEED_DEFAULT_OPTIONS = {
|
|
|
8620
8632
|
return Speed;
|
|
8621
8633
|
}(Select);
|
|
8622
8634
|
|
|
8623
|
-
/*
|
|
8624
|
-
* @ezuikit/control-date-picker v0.0.1-alpha.2
|
|
8625
|
-
* Copyright (c) 2025-11-12 Ezviz-OpenBiz
|
|
8626
|
-
* Released under the MIT License.
|
|
8627
|
-
*/
|
|
8628
|
-
|
|
8629
|
-
var dist;
|
|
8630
|
-
var hasRequiredDist;
|
|
8631
|
-
|
|
8632
|
-
function requireDist () {
|
|
8633
|
-
if (hasRequiredDist) return dist;
|
|
8634
|
-
hasRequiredDist = 1;
|
|
8635
|
-
|
|
8636
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
8637
|
-
try {
|
|
8638
|
-
var info = gen[key](arg);
|
|
8639
|
-
var value = info.value;
|
|
8640
|
-
} catch (error) {
|
|
8641
|
-
reject(error);
|
|
8642
|
-
return;
|
|
8643
|
-
}
|
|
8644
|
-
if (info.done) {
|
|
8645
|
-
resolve(value);
|
|
8646
|
-
} else {
|
|
8647
|
-
Promise.resolve(value).then(_next, _throw);
|
|
8648
|
-
}
|
|
8649
|
-
}
|
|
8650
|
-
function _async_to_generator(fn) {
|
|
8651
|
-
return function() {
|
|
8652
|
-
var self = this, args = arguments;
|
|
8653
|
-
return new Promise(function(resolve, reject) {
|
|
8654
|
-
var gen = fn.apply(self, args);
|
|
8655
|
-
function _next(value) {
|
|
8656
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8657
|
-
}
|
|
8658
|
-
function _throw(err) {
|
|
8659
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
8660
|
-
}
|
|
8661
|
-
_next(undefined);
|
|
8662
|
-
});
|
|
8663
|
-
};
|
|
8664
|
-
}
|
|
8665
|
-
function _ts_generator(thisArg, body) {
|
|
8666
|
-
var f, y, t, _ = {
|
|
8667
|
-
label: 0,
|
|
8668
|
-
sent: function() {
|
|
8669
|
-
if (t[0] & 1) throw t[1];
|
|
8670
|
-
return t[1];
|
|
8671
|
-
},
|
|
8672
|
-
trys: [],
|
|
8673
|
-
ops: []
|
|
8674
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
8675
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
8676
|
-
return this;
|
|
8677
|
-
}), g;
|
|
8678
|
-
function verb(n) {
|
|
8679
|
-
return function(v) {
|
|
8680
|
-
return step([
|
|
8681
|
-
n,
|
|
8682
|
-
v
|
|
8683
|
-
]);
|
|
8684
|
-
};
|
|
8685
|
-
}
|
|
8686
|
-
function step(op) {
|
|
8687
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
8688
|
-
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
8689
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
8690
|
-
if (y = 0, t) op = [
|
|
8691
|
-
op[0] & 2,
|
|
8692
|
-
t.value
|
|
8693
|
-
];
|
|
8694
|
-
switch(op[0]){
|
|
8695
|
-
case 0:
|
|
8696
|
-
case 1:
|
|
8697
|
-
t = op;
|
|
8698
|
-
break;
|
|
8699
|
-
case 4:
|
|
8700
|
-
_.label++;
|
|
8701
|
-
return {
|
|
8702
|
-
value: op[1],
|
|
8703
|
-
done: false
|
|
8704
|
-
};
|
|
8705
|
-
case 5:
|
|
8706
|
-
_.label++;
|
|
8707
|
-
y = op[1];
|
|
8708
|
-
op = [
|
|
8709
|
-
0
|
|
8710
|
-
];
|
|
8711
|
-
continue;
|
|
8712
|
-
case 7:
|
|
8713
|
-
op = _.ops.pop();
|
|
8714
|
-
_.trys.pop();
|
|
8715
|
-
continue;
|
|
8716
|
-
default:
|
|
8717
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
8718
|
-
_ = 0;
|
|
8719
|
-
continue;
|
|
8720
|
-
}
|
|
8721
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
8722
|
-
_.label = op[1];
|
|
8723
|
-
break;
|
|
8724
|
-
}
|
|
8725
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
8726
|
-
_.label = t[1];
|
|
8727
|
-
t = op;
|
|
8728
|
-
break;
|
|
8729
|
-
}
|
|
8730
|
-
if (t && _.label < t[2]) {
|
|
8731
|
-
_.label = t[2];
|
|
8732
|
-
_.ops.push(op);
|
|
8733
|
-
break;
|
|
8734
|
-
}
|
|
8735
|
-
if (t[2]) _.ops.pop();
|
|
8736
|
-
_.trys.pop();
|
|
8737
|
-
continue;
|
|
8738
|
-
}
|
|
8739
|
-
op = body.call(thisArg, _);
|
|
8740
|
-
} catch (e) {
|
|
8741
|
-
op = [
|
|
8742
|
-
6,
|
|
8743
|
-
e
|
|
8744
|
-
];
|
|
8745
|
-
y = 0;
|
|
8746
|
-
} finally{
|
|
8747
|
-
f = t = 0;
|
|
8748
|
-
}
|
|
8749
|
-
if (op[0] & 5) throw op[1];
|
|
8750
|
-
return {
|
|
8751
|
-
value: op[0] ? op[1] : void 0,
|
|
8752
|
-
done: true
|
|
8753
|
-
};
|
|
8754
|
-
}
|
|
8755
|
-
}
|
|
8756
|
-
var AppendJS = /*#__PURE__*/ function() {
|
|
8757
|
-
function AppendJS() {}
|
|
8758
|
-
AppendJS.loadScript = function loadScript(src) {
|
|
8759
|
-
return _async_to_generator(function() {
|
|
8760
|
-
return _ts_generator(this, function(_state) {
|
|
8761
|
-
switch(_state.label){
|
|
8762
|
-
case 0:
|
|
8763
|
-
return [
|
|
8764
|
-
4,
|
|
8765
|
-
new Promise(function(resolve, reject) {
|
|
8766
|
-
if (AppendJS.LoadedScr.includes(src)) {
|
|
8767
|
-
return resolve(src);
|
|
8768
|
-
}
|
|
8769
|
-
if (AppendJS.LoadingScrQueue[src]) {
|
|
8770
|
-
return AppendJS.LoadingScrQueue[src].push(resolve);
|
|
8771
|
-
} else {
|
|
8772
|
-
AppendJS.LoadingScrQueue[src] = [
|
|
8773
|
-
resolve
|
|
8774
|
-
];
|
|
8775
|
-
}
|
|
8776
|
-
var link;
|
|
8777
|
-
if (src.includes('.js')) {
|
|
8778
|
-
link = document.createElement('script');
|
|
8779
|
-
link.src = src;
|
|
8780
|
-
link.async = true;
|
|
8781
|
-
} else if (src.includes('.css')) {
|
|
8782
|
-
link = document.createElement('link');
|
|
8783
|
-
link.rel = 'stylesheet';
|
|
8784
|
-
link.href = src;
|
|
8785
|
-
}
|
|
8786
|
-
link.onload = function() {
|
|
8787
|
-
AppendJS.LoadedScr.push(src);
|
|
8788
|
-
AppendJS.LoadingScrQueue[src].forEach(function(resolve) {
|
|
8789
|
-
return resolve(src);
|
|
8790
|
-
});
|
|
8791
|
-
AppendJS.LoadingScrQueue[src] = [];
|
|
8792
|
-
};
|
|
8793
|
-
link.onerror = function() {
|
|
8794
|
-
return reject(new Error('Failed to load ' + src));
|
|
8795
|
-
};
|
|
8796
|
-
document.head.appendChild(link);
|
|
8797
|
-
})
|
|
8798
|
-
];
|
|
8799
|
-
case 1:
|
|
8800
|
-
return [
|
|
8801
|
-
2,
|
|
8802
|
-
_state.sent()
|
|
8803
|
-
];
|
|
8804
|
-
}
|
|
8805
|
-
});
|
|
8806
|
-
})();
|
|
8807
|
-
};
|
|
8808
|
-
AppendJS.loadScriptsBatch = function loadScriptsBatch(srcArr) {
|
|
8809
|
-
return _async_to_generator(function() {
|
|
8810
|
-
return _ts_generator(this, function(_state) {
|
|
8811
|
-
switch(_state.label){
|
|
8812
|
-
case 0:
|
|
8813
|
-
return [
|
|
8814
|
-
4,
|
|
8815
|
-
Promise.all(srcArr.map(AppendJS.loadScript))
|
|
8816
|
-
];
|
|
8817
|
-
case 1:
|
|
8818
|
-
return [
|
|
8819
|
-
2,
|
|
8820
|
-
_state.sent()
|
|
8821
|
-
];
|
|
8822
|
-
}
|
|
8823
|
-
});
|
|
8824
|
-
})();
|
|
8825
|
-
};
|
|
8826
|
-
AppendJS.remove = function remove(src) {
|
|
8827
|
-
src.forEach(function(item) {
|
|
8828
|
-
var link = document.querySelector('script[src="' + item + '"]') || document.querySelector('link[href="' + item + '"]');
|
|
8829
|
-
if (link) {
|
|
8830
|
-
link.remove();
|
|
8831
|
-
}
|
|
8832
|
-
});
|
|
8833
|
-
};
|
|
8834
|
-
AppendJS.clear = function clear() {
|
|
8835
|
-
AppendJS.remove(AppendJS.LoadedScr);
|
|
8836
|
-
};
|
|
8837
|
-
return AppendJS;
|
|
8838
|
-
}();
|
|
8839
|
-
/** 已经加载完的js/css */ AppendJS.LoadedScr = [];
|
|
8840
|
-
/** 正在加载的js/css */ AppendJS.LoadingScrQueue = {};
|
|
8841
|
-
|
|
8842
|
-
function _defineProperties(target, props) {
|
|
8843
|
-
for(var i = 0; i < props.length; i++){
|
|
8844
|
-
var descriptor = props[i];
|
|
8845
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
8846
|
-
descriptor.configurable = true;
|
|
8847
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
8848
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
8852
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
8853
|
-
return Constructor;
|
|
8854
|
-
}
|
|
8855
|
-
var DEFAULT_OPTIONS = {
|
|
8856
|
-
staticPath: '.',
|
|
8857
|
-
place: 'top-right',
|
|
8858
|
-
language: 'zh-CN',
|
|
8859
|
-
current: new Date(),
|
|
8860
|
-
maxDate: new Date()
|
|
8861
|
-
};
|
|
8862
|
-
/**
|
|
8863
|
-
* 日期选择器
|
|
8864
|
-
*/ var DatePicker = /*#__PURE__*/ function() {
|
|
8865
|
-
function DatePicker(container, options) {
|
|
8866
|
-
var _this = this;
|
|
8867
|
-
this._open = false;
|
|
8868
|
-
this._change = true;
|
|
8869
|
-
this.$container = container;
|
|
8870
|
-
this.options = Object.assign({}, DEFAULT_OPTIONS, options);
|
|
8871
|
-
this.options.staticPath = (this.options.staticPath || '').replace(/\/$/, '');
|
|
8872
|
-
if (this.options.current) {
|
|
8873
|
-
this._date = this.options.current;
|
|
8874
|
-
}
|
|
8875
|
-
this._init();
|
|
8876
|
-
this.$container.addEventListener('click', function() {
|
|
8877
|
-
if (_this._open) _this.hide();
|
|
8878
|
-
else _this.show();
|
|
8879
|
-
});
|
|
8880
|
-
document.body.addEventListener('click', function(e) {
|
|
8881
|
-
if (!_this.$container.contains(e.target)) {
|
|
8882
|
-
_this.hide();
|
|
8883
|
-
}
|
|
8884
|
-
});
|
|
8885
|
-
}
|
|
8886
|
-
var _proto = DatePicker.prototype;
|
|
8887
|
-
_proto._init = function _init() {
|
|
8888
|
-
var _this = this;
|
|
8889
|
-
// 因为挂载在行内,需要父标签设置 position: relative;
|
|
8890
|
-
this.$container.style.cssText += ";position: relative;";
|
|
8891
|
-
this.$container.classList.add("datepicker-inline-" + this.options.place);
|
|
8892
|
-
AppendJS.loadScriptsBatch([
|
|
8893
|
-
"" + this.options.staticPath + "/rec/jquery.min.js",
|
|
8894
|
-
"" + this.options.staticPath + "/rec/datepicker.min.css"
|
|
8895
|
-
]).then(function() {
|
|
8896
|
-
AppendJS.loadScriptsBatch([
|
|
8897
|
-
"" + _this.options.staticPath + "/rec/datepicker.js"
|
|
8898
|
-
]).then(function() {
|
|
8899
|
-
AppendJS.loadScriptsBatch([
|
|
8900
|
-
"" + _this.options.staticPath + "/rec/datepicker.zh-CN.js",
|
|
8901
|
-
"" + _this.options.staticPath + "/rec/datepicker.en-US.js"
|
|
8902
|
-
]).then(function() {
|
|
8903
|
-
window.$(_this.$container).datepicker({
|
|
8904
|
-
date: _this.options.current,
|
|
8905
|
-
language: _this.options.language,
|
|
8906
|
-
endDate: _this.options.maxDate,
|
|
8907
|
-
inline: true
|
|
8908
|
-
});
|
|
8909
|
-
_this.hide();
|
|
8910
|
-
window.$(_this.$container).on('pick.datepicker', function(e) {
|
|
8911
|
-
var _this__date, _this__date1, _this__date2, _this__date3, _this__date4, _this__date5;
|
|
8912
|
-
if (e.view === 'year' && ((_this__date = _this._date) == null ? void 0 : _this__date.getFullYear()) !== e.date.getFullYear()) {
|
|
8913
|
-
_this.options.onYearChange == null ? void 0 : _this.options.onYearChange.call(_this.options, e.date);
|
|
8914
|
-
} else if (e.view === 'month' && (((_this__date1 = _this._date) == null ? void 0 : _this__date1.getMonth()) !== e.date.getMonth() || ((_this__date2 = _this._date) == null ? void 0 : _this__date2.getFullYear()) !== e.date.getFullYear())) {
|
|
8915
|
-
_this.options.onMonthChange == null ? void 0 : _this.options.onMonthChange.call(_this.options, e.date);
|
|
8916
|
-
} else if ([
|
|
8917
|
-
'day',
|
|
8918
|
-
'pick'
|
|
8919
|
-
].includes(e.view || e.type) && (((_this__date3 = _this._date) == null ? void 0 : _this__date3.getDate()) !== e.date.getDate() || ((_this__date4 = _this._date) == null ? void 0 : _this__date4.getMonth()) !== e.date.getMonth() || ((_this__date5 = _this._date) == null ? void 0 : _this__date5.getFullYear()) !== e.date.getFullYear())) {
|
|
8920
|
-
if (_this._change) {
|
|
8921
|
-
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, e.date);
|
|
8922
|
-
}
|
|
8923
|
-
_this._date = new Date(e.date.getTime());
|
|
8924
|
-
}
|
|
8925
|
-
if (e.view === 'day') _this.hide();
|
|
8926
|
-
_this._change = true;
|
|
8927
|
-
});
|
|
8928
|
-
});
|
|
8929
|
-
});
|
|
8930
|
-
});
|
|
8931
|
-
};
|
|
8932
|
-
/**
|
|
8933
|
-
* 设置日期, change = true 时触发 onChange 事件
|
|
8934
|
-
*
|
|
8935
|
-
* @param date 设置的日期
|
|
8936
|
-
* @param change 是否触发 onChange 事件
|
|
8937
|
-
*/ _proto.setDate = function setDate(date, change) {
|
|
8938
|
-
if (change === void 0) change = true;
|
|
8939
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8940
|
-
if ($datepicker) {
|
|
8941
|
-
this._change = change;
|
|
8942
|
-
window.$(this.$container).datepicker('setDate', date);
|
|
8943
|
-
}
|
|
8944
|
-
};
|
|
8945
|
-
/**
|
|
8946
|
-
* 隐藏面板, 会触发 onPanelChange 事件
|
|
8947
|
-
*/ _proto.hide = function hide() {
|
|
8948
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8949
|
-
if ($datepicker) {
|
|
8950
|
-
if (this._open) {
|
|
8951
|
-
this._open = false;
|
|
8952
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, false, this._date);
|
|
8953
|
-
}
|
|
8954
|
-
$datepicker.classList.add('datepicker-hide');
|
|
8955
|
-
}
|
|
8956
|
-
};
|
|
8957
|
-
/**
|
|
8958
|
-
* 显示面板, 会触发 onPanelChange 事件
|
|
8959
|
-
*/ _proto.show = function show() {
|
|
8960
|
-
var $datepicker = this.$container.querySelector(".datepicker-inline");
|
|
8961
|
-
if ($datepicker) {
|
|
8962
|
-
var _window_$_datepicker, _window_$;
|
|
8963
|
-
if (!this._open) {
|
|
8964
|
-
this._open = true;
|
|
8965
|
-
this.options.onPanelChange == null ? void 0 : this.options.onPanelChange.call(this.options, true, this._date);
|
|
8966
|
-
}
|
|
8967
|
-
if (this._date) this.setDate(this._date, false);
|
|
8968
|
-
(_window_$_datepicker = (_window_$ = window.$(this.$container)).datepicker) == null ? void 0 : _window_$_datepicker.call(_window_$, 'showView');
|
|
8969
|
-
if (this.options.place === 'bottom-left') {
|
|
8970
|
-
$datepicker.style.cssText += "top: " + (this.$container.clientHeight + 10) + "px; bottom: auto; right: auto; left: 0px";
|
|
8971
|
-
} else {
|
|
8972
|
-
$datepicker.style.cssText += "bottom: " + (this.$container.clientHeight + 10) + "px; top: auto";
|
|
8973
|
-
}
|
|
8974
|
-
$datepicker.classList.remove('datepicker-hide');
|
|
8975
|
-
}
|
|
8976
|
-
};
|
|
8977
|
-
/**
|
|
8978
|
-
* 销毁
|
|
8979
|
-
*/ _proto.destroy = function destroy() {
|
|
8980
|
-
this.hide();
|
|
8981
|
-
this._date = undefined;
|
|
8982
|
-
window.$(this.$container).datepicker('destroy');
|
|
8983
|
-
// AppendJS.remove([
|
|
8984
|
-
// `${this.options.staticPath}/rec/jquery.min.js`,
|
|
8985
|
-
// `${this.options.staticPath}/rec/datepicker.min.css`,
|
|
8986
|
-
// `${this.options.staticPath}/rec/datepicker.js`,
|
|
8987
|
-
// `${this.options.staticPath}/rec/datepicker.zh-CN.js`,
|
|
8988
|
-
// `${this.options.staticPath}/rec/datepicker.en-US.js`,
|
|
8989
|
-
// ]);
|
|
8990
|
-
};
|
|
8991
|
-
_create_class(DatePicker, [
|
|
8992
|
-
{
|
|
8993
|
-
key: "date",
|
|
8994
|
-
get: /**
|
|
8995
|
-
* 获取日期
|
|
8996
|
-
*/ function get() {
|
|
8997
|
-
return this._date;
|
|
8998
|
-
}
|
|
8999
|
-
}
|
|
9000
|
-
]);
|
|
9001
|
-
return DatePicker;
|
|
9002
|
-
}();
|
|
9003
|
-
|
|
9004
|
-
dist = DatePicker;
|
|
9005
|
-
return dist;
|
|
9006
|
-
}
|
|
9007
|
-
|
|
9008
|
-
var distExports = requireDist();
|
|
9009
|
-
var DatePickerUtil = /*@__PURE__*/getDefaultExportFromCjs(distExports);
|
|
9010
|
-
|
|
9011
|
-
/**
|
|
9012
|
-
* @description 时间操作
|
|
9013
|
-
*/ var DateTime = /*#__PURE__*/ function() {
|
|
9014
|
-
function DateTime() {}
|
|
9015
|
-
/**
|
|
9016
|
-
* @description 时间格式化
|
|
9017
|
-
* @param {Date | number | string} date
|
|
9018
|
-
* @param {string} formatType 格式 'YYYY-MM-DD hh:mm:ss' 或 'YYYYMMDDhhmmss' 或 'YYYY/MM/DD hh:mm:ss' 或 'hh:mm:ss' 或 'YYYYMMDDThhmmssZ'
|
|
9019
|
-
* @param {number} timeZone 时区偏移量 默认 0
|
|
9020
|
-
*/ DateTime.formate = function formate(date, formatType, timeZone) {
|
|
9021
|
-
if (timeZone === void 0) timeZone = 0;
|
|
9022
|
-
var dateTime = date;
|
|
9023
|
-
if (typeof date === 'string') {
|
|
9024
|
-
dateTime = DateTime.strToDate(date);
|
|
9025
|
-
} else if (typeof date === 'number') {
|
|
9026
|
-
dateTime = new Date(date);
|
|
9027
|
-
}
|
|
9028
|
-
dateTime = new Date(dateTime.getTime() - timeZone * 3600 * 1000);
|
|
9029
|
-
var year = dateTime.getFullYear();
|
|
9030
|
-
var month = String(dateTime.getMonth() + 1).padStart(2, '0');
|
|
9031
|
-
var day = String(dateTime.getDate()).padStart(2, '0');
|
|
9032
|
-
var hours = String(dateTime.getHours()).padStart(2, '0');
|
|
9033
|
-
var minutes = String(dateTime.getMinutes()).padStart(2, '0');
|
|
9034
|
-
var seconds = String(dateTime.getSeconds()).padStart(2, '0');
|
|
9035
|
-
switch(formatType){
|
|
9036
|
-
case 'YYYY-MM-DD hh:mm:ss':
|
|
9037
|
-
return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
9038
|
-
case 'YYYYMMDDhhmmss':
|
|
9039
|
-
return "" + year + month + day + hours + minutes + seconds;
|
|
9040
|
-
case 'YYYY/MM/DD hh:mm:ss':
|
|
9041
|
-
return year + "/" + month + "/" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
9042
|
-
case 'YYYYMMDDThhmmssZ':
|
|
9043
|
-
return "" + year + month + day + "T" + hours + minutes + seconds + "Z";
|
|
9044
|
-
case 'YYYY/MM/DD':
|
|
9045
|
-
return year + "/" + month + "/" + day;
|
|
9046
|
-
case 'YYYYMMDD':
|
|
9047
|
-
return "" + year + month + day;
|
|
9048
|
-
case 'YYYY-MM-DD':
|
|
9049
|
-
return year + "-" + month + "-" + day;
|
|
9050
|
-
case 'YYYY':
|
|
9051
|
-
return "" + year;
|
|
9052
|
-
case 'MM':
|
|
9053
|
-
return "" + month;
|
|
9054
|
-
case 'DD':
|
|
9055
|
-
return "" + day;
|
|
9056
|
-
case 'hh:mm:ss':
|
|
9057
|
-
return hours + ":" + minutes + ":" + seconds;
|
|
9058
|
-
case 'hh':
|
|
9059
|
-
return "" + hours;
|
|
9060
|
-
case 'mm':
|
|
9061
|
-
return "" + minutes;
|
|
9062
|
-
case 'ss':
|
|
9063
|
-
return "" + seconds;
|
|
9064
|
-
default:
|
|
9065
|
-
throw new Error('Unsupported format type');
|
|
9066
|
-
}
|
|
9067
|
-
};
|
|
9068
|
-
/**
|
|
9069
|
-
* @description 对比两个时间的差值
|
|
9070
|
-
* @param {Date | string | number} date1
|
|
9071
|
-
* @param {Date | string | number} date2
|
|
9072
|
-
* @param {"year" | "month" | "day" | "hour" | "minute" | "second"} diffType
|
|
9073
|
-
*/ DateTime.diff = function diff(date1, date2, diffType) {
|
|
9074
|
-
/** @type {Date} */ var dateTime1 = date1;
|
|
9075
|
-
if (typeof date1 === 'string') {
|
|
9076
|
-
dateTime1 = DateTime.strToDate(date1);
|
|
9077
|
-
} else if (typeof date1 === 'number') {
|
|
9078
|
-
dateTime1 = new Date(date1);
|
|
9079
|
-
}
|
|
9080
|
-
/** @type {Date} */ var dateTime2 = date2;
|
|
9081
|
-
if (typeof date2 === 'string') {
|
|
9082
|
-
dateTime1 = DateTime.strToDate(date2);
|
|
9083
|
-
} else if (typeof date2 === 'number') {
|
|
9084
|
-
dateTime1 = new Date(date2);
|
|
9085
|
-
}
|
|
9086
|
-
var diffSecond = dateTime1.getTime() - dateTime2.getTime();
|
|
9087
|
-
// diff
|
|
9088
|
-
switch(diffType){
|
|
9089
|
-
case 'year':
|
|
9090
|
-
return dateTime1.getFullYear() - dateTime2.getFullYear();
|
|
9091
|
-
case 'month':
|
|
9092
|
-
// 计算总月份差
|
|
9093
|
-
// eslint-disable-next-line no-case-declarations
|
|
9094
|
-
var months = (dateTime1.getFullYear() - dateTime2.getFullYear()) * 12 + (dateTime1.getMonth() - dateTime2.getMonth());
|
|
9095
|
-
// 如果结束日的日期小于开始日的日期,则减去一个月
|
|
9096
|
-
if (dateTime1.getDate() < dateTime2.getDate()) {
|
|
9097
|
-
months--;
|
|
9098
|
-
}
|
|
9099
|
-
return months;
|
|
9100
|
-
case 'day':
|
|
9101
|
-
return diffSecond / 60 / 60 / 24;
|
|
9102
|
-
case 'hour':
|
|
9103
|
-
return diffSecond / 60 / 60;
|
|
9104
|
-
case 'minute':
|
|
9105
|
-
return diffSecond / 60;
|
|
9106
|
-
case 'second':
|
|
9107
|
-
return diffSecond;
|
|
9108
|
-
default:
|
|
9109
|
-
throw new Error('Unsupported diff type');
|
|
9110
|
-
}
|
|
9111
|
-
};
|
|
9112
|
-
DateTime.now = function now() {
|
|
9113
|
-
return Date.now();
|
|
9114
|
-
};
|
|
9115
|
-
/**
|
|
9116
|
-
*
|
|
9117
|
-
* @param {string} str 日期, 2025-04-10 10:10:10 或 2025/04/10 10:10:10 或 20250410101010 或 20250410T101010Z 或 秒 或 毫秒
|
|
9118
|
-
* @example
|
|
9119
|
-
* DateTime.strToDate("2025/04/10 10:10:10") // Date
|
|
9120
|
-
* DateTime.strToDate("2025-04-10 10:10:10") // Date
|
|
9121
|
-
* DateTime.strToDate("20250410101010") // Date
|
|
9122
|
-
* DateTime.strToDate("20250410T101010Z") // Date
|
|
9123
|
-
*/ DateTime.strToDate = function strToDate(str) {
|
|
9124
|
-
var time = (str + '').replace(/-/gi, '').replace(/:/gi, '').replace(/\//gi, '').replace(/ /gi, '').replace(/T|Z/gi, '');
|
|
9125
|
-
// 兼容
|
|
9126
|
-
if ((str + '').length === 10) {
|
|
9127
|
-
// 时间戳 秒
|
|
9128
|
-
return new Date(+str);
|
|
9129
|
-
} else if ((str + '').length === 13) {
|
|
9130
|
-
// 时间戳 毫秒
|
|
9131
|
-
return new Date(+str);
|
|
9132
|
-
}
|
|
9133
|
-
var year = time.slice(0, 4);
|
|
9134
|
-
var month = time.slice(4, 6);
|
|
9135
|
-
var day = time.slice(6, 8);
|
|
9136
|
-
var hour = time.slice(8, 10);
|
|
9137
|
-
var minute = time.slice(10, 12);
|
|
9138
|
-
var second = time.slice(12, 14);
|
|
9139
|
-
return new Date(year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second);
|
|
9140
|
-
};
|
|
9141
|
-
/**
|
|
9142
|
-
* @description 补充十位
|
|
9143
|
-
* @param {number} num
|
|
9144
|
-
* @returns {string}
|
|
9145
|
-
* @example
|
|
9146
|
-
* DateTime.padStart(1) // "01"
|
|
9147
|
-
* DateTime.padStart(33) // "33"
|
|
9148
|
-
*/ DateTime.padStart = function padStart(num) {
|
|
9149
|
-
if (num < 10) {
|
|
9150
|
-
return '0' + num;
|
|
9151
|
-
} else {
|
|
9152
|
-
return num + '';
|
|
9153
|
-
}
|
|
9154
|
-
};
|
|
9155
|
-
return DateTime;
|
|
9156
|
-
}();
|
|
9157
|
-
|
|
9158
8635
|
function _extends$5() {
|
|
9159
8636
|
_extends$5 = Object.assign || function(target) {
|
|
9160
8637
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -9197,20 +8674,29 @@ function _set_prototype_of$6(o, p) {
|
|
|
9197
8674
|
function DatePickerControl(options) {
|
|
9198
8675
|
var _this;
|
|
9199
8676
|
var _this_options_props_urlInfo_searchParams, _this_options_props_urlInfo, _this_options_props;
|
|
9200
|
-
_this = Control.call(this, _extends$5({
|
|
8677
|
+
_this = Control.call(this, _extends$5({
|
|
8678
|
+
maxDate: new Date()
|
|
8679
|
+
}, options, {
|
|
9201
8680
|
tagName: 'span',
|
|
9202
8681
|
controlType: 'button',
|
|
9203
8682
|
classNameSuffix: 'date'
|
|
9204
8683
|
})) || this;
|
|
9205
8684
|
_this.options = options;
|
|
9206
|
-
_this._value = DateTime.
|
|
8685
|
+
_this._value = require$$1.DateTime.format(((_this_options_props = _this.options.props) == null ? void 0 : (_this_options_props_urlInfo = _this_options_props.urlInfo) == null ? void 0 : (_this_options_props_urlInfo_searchParams = _this_options_props_urlInfo.searchParams) == null ? void 0 : _this_options_props_urlInfo_searchParams.begin) || new Date(), 'YYYY-MM-DD');
|
|
9207
8686
|
_this._render();
|
|
8687
|
+
// 日期上的点
|
|
8688
|
+
_this.on(EVENTS.control.dateMonthChange, function(dates) {
|
|
8689
|
+
var _this_datePicker_updateBadges, _this_datePicker;
|
|
8690
|
+
(_this_datePicker = _this.datePicker) == null ? void 0 : (_this_datePicker_updateBadges = _this_datePicker.updateBadges) == null ? void 0 : _this_datePicker_updateBadges.call(_this_datePicker, dates);
|
|
8691
|
+
});
|
|
9208
8692
|
return _this;
|
|
9209
8693
|
}
|
|
9210
8694
|
var _proto = DatePickerControl.prototype;
|
|
9211
8695
|
_proto._render = function _render() {
|
|
9212
8696
|
var _this = this;
|
|
9213
|
-
|
|
8697
|
+
var _this_options_props;
|
|
8698
|
+
var isMobile1 = require$$1.isMobile();
|
|
8699
|
+
if (isMobile1) {
|
|
9214
8700
|
var _this_locale;
|
|
9215
8701
|
this.$container.innerHTML = '\n <span class="' + PREFIX_CLASS + '-mobile-date-filter" title="' + (((_this_locale = this.locale) == null ? void 0 : _this_locale.BTN_CALENDAR) || '') + '">\n <span class="' + PREFIX_CLASS + '-mobile-date-filter-value">' + this._getDateStr() + "</span>\n " + IconComponents.filter() + "\n <span>";
|
|
9216
8702
|
} else {
|
|
@@ -9219,25 +8705,45 @@ function _set_prototype_of$6(o, p) {
|
|
|
9219
8705
|
title: (_this_locale1 = this.locale) == null ? void 0 : _this_locale1.BTN_CALENDAR
|
|
9220
8706
|
});
|
|
9221
8707
|
}
|
|
9222
|
-
this.
|
|
9223
|
-
|
|
9224
|
-
|
|
8708
|
+
this.datePicker = new controlDatePicker.DatePicker(this.$container, {
|
|
8709
|
+
isMobile: isMobile1,
|
|
8710
|
+
getPopupContainer: function() {
|
|
8711
|
+
return _this.$container;
|
|
8712
|
+
},
|
|
8713
|
+
mode: 'date',
|
|
8714
|
+
offset: [
|
|
8715
|
+
0,
|
|
8716
|
+
-10
|
|
8717
|
+
],
|
|
8718
|
+
badges: ((_this_options_props = this.options.props) == null ? void 0 : _this_options_props.recMonth) || [],
|
|
8719
|
+
language: this.options.language === 'zh' ? 'zh' : 'en',
|
|
9225
8720
|
current: new Date(this._value + ' 00:00:00'),
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
8721
|
+
placement: 'tr',
|
|
8722
|
+
triggerClose: true,
|
|
8723
|
+
disabledDate: function(date) {
|
|
8724
|
+
return date.getTime() > (_this.options.maxDate || new Date()).getTime();
|
|
8725
|
+
},
|
|
8726
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8727
|
+
onOk: function(date, _mode) {
|
|
8728
|
+
if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && isMobile1) {
|
|
8729
|
+
_this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
8730
|
+
_this.options.onOk == null ? void 0 : _this.options.onOk.call(_this.options, date);
|
|
9232
8731
|
_this.emit(EVENTS.control.dateChange, date);
|
|
9233
8732
|
if (date && _this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
9234
8733
|
_this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = _this._getDateStr();
|
|
9235
8734
|
}
|
|
9236
8735
|
}
|
|
9237
8736
|
},
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
8737
|
+
onChange: function(date, mode) {
|
|
8738
|
+
if (date && _this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD') && !isMobile1 && mode === 'date') {
|
|
8739
|
+
_this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
8740
|
+
_this.options.onChange == null ? void 0 : _this.options.onChange.call(_this.options, date);
|
|
8741
|
+
_this.emit(EVENTS.control.dateChange, date);
|
|
8742
|
+
}
|
|
8743
|
+
},
|
|
8744
|
+
onOpenChange: function(open) {
|
|
8745
|
+
_this.options.onPanelChange == null ? void 0 : _this.options.onPanelChange.call(_this.options, open, _this.datePicker.current);
|
|
8746
|
+
_this.emit(EVENTS.control.datePanelOpenChange, open, _this.datePicker.current);
|
|
9241
8747
|
}
|
|
9242
8748
|
});
|
|
9243
8749
|
};
|
|
@@ -9247,28 +8753,27 @@ function _set_prototype_of$6(o, p) {
|
|
|
9247
8753
|
* @param change 是否触发 onChange 事件
|
|
9248
8754
|
*/ _proto.setDate = function setDate(date, change) {
|
|
9249
8755
|
if (change === void 0) change = true;
|
|
9250
|
-
var
|
|
9251
|
-
(
|
|
9252
|
-
if (date && !change && this._value !== DateTime.
|
|
9253
|
-
this._value = DateTime.
|
|
8756
|
+
var _this_datePicker;
|
|
8757
|
+
(_this_datePicker = this.datePicker) == null ? void 0 : _this_datePicker.setCurrent(date, change);
|
|
8758
|
+
if (date && !change && this._value !== require$$1.DateTime.format(date, 'YYYY-MM-DD')) {
|
|
8759
|
+
this._value = require$$1.DateTime.format(date, 'YYYY-MM-DD');
|
|
9254
8760
|
if (date && this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value")) {
|
|
9255
8761
|
this.$container.querySelector("." + PREFIX_CLASS + "-mobile-date-filter-value").innerHTML = this._getDateStr();
|
|
9256
8762
|
}
|
|
9257
8763
|
}
|
|
9258
8764
|
};
|
|
9259
8765
|
_proto.reset = function reset() {
|
|
9260
|
-
|
|
9261
|
-
(_this_dataPickerUtil = this.dataPickerUtil) == null ? void 0 : _this_dataPickerUtil.hide();
|
|
8766
|
+
if (this.datePicker) this.datePicker.open = false;
|
|
9262
8767
|
Control.prototype.reset.call(this);
|
|
9263
8768
|
};
|
|
9264
8769
|
/**
|
|
9265
8770
|
* 销毁控件
|
|
9266
8771
|
* @override
|
|
9267
8772
|
*/ _proto.destroy = function destroy() {
|
|
9268
|
-
if (this.
|
|
9269
|
-
this.
|
|
8773
|
+
if (this.datePicker) {
|
|
8774
|
+
this.datePicker.destroy();
|
|
9270
8775
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9271
|
-
this.
|
|
8776
|
+
this.datePicker = null;
|
|
9272
8777
|
}
|
|
9273
8778
|
Control.prototype.destroy.call(this);
|
|
9274
8779
|
};
|
|
@@ -9278,6 +8783,7 @@ function _set_prototype_of$6(o, p) {
|
|
|
9278
8783
|
};
|
|
9279
8784
|
/**
|
|
9280
8785
|
* 点击 Control 会触发
|
|
8786
|
+
* @overload super._onControlClick(e: Event)
|
|
9281
8787
|
*/ _proto._onControlClick = function _onControlClick(e) {
|
|
9282
8788
|
Control.prototype._onControlClick.call(this, e);
|
|
9283
8789
|
};
|
|
@@ -10350,8 +9856,7 @@ var _renderDatePicker = function(theme, container, props) {
|
|
|
10350
9856
|
return container;
|
|
10351
9857
|
},
|
|
10352
9858
|
language: theme.options.language,
|
|
10353
|
-
locales: theme.i18n.translations
|
|
10354
|
-
staticPath: theme.options.staticPath
|
|
9859
|
+
locales: theme.i18n.translations
|
|
10355
9860
|
}, ((_theme_options = theme.options) == null ? void 0 : _theme_options["dateOptions"]) || {}, {
|
|
10356
9861
|
props: props
|
|
10357
9862
|
}));
|
|
@@ -10650,7 +10155,18 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10650
10155
|
*/ _this._footerMoreControl = null, /** 头部控件 @since 0.0.1 @private */ _this._header = null, /** 低部控件 @since 0.0.1 @private */ _this._footer = null, /** 回放底部时间轴 @since 0.0.1 @private */ _this._recFooter = null, /**
|
|
10651
10156
|
* 移动端扩展容器, 扩展的控件渲染在指定容器以外, 仅只用端适用, 为了可以放置大的控件和方便开发接入
|
|
10652
10157
|
* @private
|
|
10653
|
-
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null,
|
|
10158
|
+
*/ _this._mobileExtend = null, /** @since 0.0.1 @private */ _this._interactiveResult = null, /** @since 0.0.1 @private */ _this._themeData = null, _this._fullscreen = null, _this.zoomUtil = null, /** 清除屏幕旋转 */ _this._cleanupOrientation = null, /** resizeObserver 监听销毁 */ _this._cleanUpResizeObserver = null, /** 容器的宽 */ _this._width = 0, /** 容器的高 */ _this._height = 0, /** 当前容器的全屏状态 true: 全屏, false: 非全屏 */ _this._isCurrentFullscreen = false, /** 屏幕旋转角度 0 | 90 | 180 | 270 */ _this._orientationAngle = 0, /** 是否播放中 @private */ _this._playing = false, /** 加载中 */ _this._loading = false, /** 音量 */ _this._volume = 0, /** 静音 */ _this._muted = false, /** 电子放大倍数 @private */ _this._zoom = 1, /** 放大中 true: 可缩放状态,false: 禁止缩放状态(不能缩放) @private */ _this._zooming = false, /** 录制中 @private */ _this._recording = false, /** 对讲中 @private */ _this._talking = false, /** 倍速 @private */ _this._speed = 1, /** 自定清晰度 @private */ _this._videoLevelAuto = false, /** 清晰度列表 */ _this.videoLevelList = [], /** 回放片段列表 */ _this.recordList = [], /** 窗口尺寸变化时,设置窗口超出隐藏,防止出现滚动条 */ _this._resizeOverflowTimer = null, // /**
|
|
10159
|
+
// * 记录回放的月份
|
|
10160
|
+
// *
|
|
10161
|
+
// * key: {序列号}_{通道号}_{rec | cloud | cloudRecord} 比如:BC7799091_1_rec BC7799091_1_cloud BC7799091_1_cloudRecord
|
|
10162
|
+
// *
|
|
10163
|
+
// * value: 月份列表 比如 ["2025-12-01", "2025-12-02"]
|
|
10164
|
+
// * @private
|
|
10165
|
+
// */
|
|
10166
|
+
// _recMonthObj: Record<string, string[]> = {};
|
|
10167
|
+
/**
|
|
10168
|
+
* 录像回放的月份列表 @private
|
|
10169
|
+
*/ _this.recMonth = [], /** 清理 header/footer 动画 定时器 @private */ _this._onPauseTimingFunc = null, /** 销毁标识 @readonly */ _this.destroyed = false, /** 播放地址信息 */ _this.urlInfo = null, _this.scaleMode = 0;
|
|
10654
10170
|
_this._initOptions(options);
|
|
10655
10171
|
if (_this.options.type === 'ezopen') {
|
|
10656
10172
|
var _this_urlInfo_searchParams, _this_urlInfo;
|
|
@@ -10660,7 +10176,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10660
10176
|
}
|
|
10661
10177
|
if (_this.urlInfo.type === 'rec') {
|
|
10662
10178
|
var _this_urlInfo_searchParams1, _this_urlInfo1, _this_urlInfo_searchParams2, _this_urlInfo2;
|
|
10663
|
-
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? DateTime.
|
|
10179
|
+
_this._seekDate = ((_this_urlInfo1 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams1 = _this_urlInfo1.searchParams) == null ? void 0 : _this_urlInfo_searchParams1.begin) ? require$$1.DateTime.toDate((_this_urlInfo2 = _this.urlInfo) == null ? void 0 : (_this_urlInfo_searchParams2 = _this_urlInfo2.searchParams) == null ? void 0 : _this_urlInfo_searchParams2.begin) : require$$1.DateTime.toDate(require$$1.DateTime.format(new Date(), 'YYYY/MM/DD') + ' 00:00:00');
|
|
10664
10180
|
}
|
|
10665
10181
|
}
|
|
10666
10182
|
_this._getRecType(_this.options.url);
|
|
@@ -10907,6 +10423,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
10907
10423
|
this._themeData = null;
|
|
10908
10424
|
if (this.i18n) this.i18n = null;
|
|
10909
10425
|
this.recType = '';
|
|
10426
|
+
this.recMonth = []; // 清空数据
|
|
10910
10427
|
this.emit(EVENTS.theme.destroyed);
|
|
10911
10428
|
this.removeAllListeners();
|
|
10912
10429
|
if (this.logger) this.logger = null;
|
|
@@ -11872,7 +11389,7 @@ var THEME_DEFAULT_OPTIONS = {
|
|
|
11872
11389
|
zh: zh,
|
|
11873
11390
|
en: en
|
|
11874
11391
|
};
|
|
11875
|
-
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.
|
|
11392
|
+
/** 版本号 @since 0.0.1 */ Theme.THEME_VERSION = '2.0.2-beta.7';
|
|
11876
11393
|
|
|
11877
11394
|
exports.Control = Control;
|
|
11878
11395
|
exports.Fullscreen = Fullscreen;
|