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