@ctc-front/components-ui-next 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +258 -0
- package/dist/index.js +1858 -149
- package/dist/style-with-element-plus.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +30 -17
package/dist/index.js
CHANGED
|
@@ -1,17 +1,75 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o,
|
|
2
|
-
import { ElDialog as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, h as d, inject as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onUnmounted as b, openBlock as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useAttrs as O, useSlots as k, useTemplateRef as A, vShow as j, watch as M, withCtx as N, withDirectives as P } from "vue";
|
|
2
|
+
import { ElDatePicker as F, ElDialog as I, ElDrawer as L, ElIcon as R, ElInput as z, ElPagination as B, ElScrollbar as ee, ElSegmented as te, ElSlider as ne, ElTable as V, ElTableColumn as re, ElTag as ie, ElTooltip as H, vLoading as ae } from "element-plus";
|
|
3
3
|
//#region src/config.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
return
|
|
4
|
+
var oe = Symbol("CtcComponentsUiConfig");
|
|
5
|
+
function U() {
|
|
6
|
+
return f(oe, {});
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.41_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js
|
|
10
|
-
var
|
|
10
|
+
var W = /* @__PURE__ */ l({
|
|
11
|
+
name: "ArrowDown",
|
|
12
|
+
__name: "arrow-down",
|
|
13
|
+
setup(e) {
|
|
14
|
+
return (e, t) => (x(), i("svg", {
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
viewBox: "0 0 1024 1024"
|
|
17
|
+
}, [a("path", {
|
|
18
|
+
fill: "currentColor",
|
|
19
|
+
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
|
|
20
|
+
})]));
|
|
21
|
+
}
|
|
22
|
+
}), se = /* @__PURE__ */ l({
|
|
23
|
+
name: "ArrowRight",
|
|
24
|
+
__name: "arrow-right",
|
|
25
|
+
setup(e) {
|
|
26
|
+
return (e, t) => (x(), i("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
viewBox: "0 0 1024 1024"
|
|
29
|
+
}, [a("path", {
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
32
|
+
})]));
|
|
33
|
+
}
|
|
34
|
+
}), ce = /* @__PURE__ */ l({
|
|
35
|
+
name: "Bell",
|
|
36
|
+
__name: "bell",
|
|
37
|
+
setup(e) {
|
|
38
|
+
return (e, t) => (x(), i("svg", {
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
viewBox: "0 0 1024 1024"
|
|
41
|
+
}, [
|
|
42
|
+
a("path", {
|
|
43
|
+
fill: "currentColor",
|
|
44
|
+
d: "M512 64a64 64 0 0 1 64 64v64H448v-64a64 64 0 0 1 64-64"
|
|
45
|
+
}),
|
|
46
|
+
a("path", {
|
|
47
|
+
fill: "currentColor",
|
|
48
|
+
d: "M256 768h512V448a256 256 0 1 0-512 0zm256-640a320 320 0 0 1 320 320v384H192V448a320 320 0 0 1 320-320"
|
|
49
|
+
}),
|
|
50
|
+
a("path", {
|
|
51
|
+
fill: "currentColor",
|
|
52
|
+
d: "M96 768h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32m352 128h128a64 64 0 0 1-128 0"
|
|
53
|
+
})
|
|
54
|
+
]));
|
|
55
|
+
}
|
|
56
|
+
}), le = /* @__PURE__ */ l({
|
|
57
|
+
name: "Camera",
|
|
58
|
+
__name: "camera",
|
|
59
|
+
setup(e) {
|
|
60
|
+
return (e, t) => (x(), i("svg", {
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
62
|
+
viewBox: "0 0 1024 1024"
|
|
63
|
+
}, [a("path", {
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
d: "M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"
|
|
66
|
+
})]));
|
|
67
|
+
}
|
|
68
|
+
}), G = /* @__PURE__ */ l({
|
|
11
69
|
name: "Close",
|
|
12
70
|
__name: "close",
|
|
13
71
|
setup(e) {
|
|
14
|
-
return (e, t) => (
|
|
72
|
+
return (e, t) => (x(), i("svg", {
|
|
15
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16
74
|
viewBox: "0 0 1024 1024"
|
|
17
75
|
}, [a("path", {
|
|
@@ -19,11 +77,23 @@ var F = /* @__PURE__ */ c({
|
|
|
19
77
|
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
20
78
|
})]));
|
|
21
79
|
}
|
|
22
|
-
}),
|
|
80
|
+
}), K = /* @__PURE__ */ l({
|
|
81
|
+
name: "Fold",
|
|
82
|
+
__name: "fold",
|
|
83
|
+
setup(e) {
|
|
84
|
+
return (e, t) => (x(), i("svg", {
|
|
85
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
86
|
+
viewBox: "0 0 1024 1024"
|
|
87
|
+
}, [a("path", {
|
|
88
|
+
fill: "currentColor",
|
|
89
|
+
d: "M896 192H128v128h768zm0 256H384v128h512zm0 256H128v128h768zM320 384 128 512l192 128z"
|
|
90
|
+
})]));
|
|
91
|
+
}
|
|
92
|
+
}), q = /* @__PURE__ */ l({
|
|
23
93
|
name: "FullScreen",
|
|
24
94
|
__name: "full-screen",
|
|
25
95
|
setup(e) {
|
|
26
|
-
return (e, t) => (
|
|
96
|
+
return (e, t) => (x(), i("svg", {
|
|
27
97
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
98
|
viewBox: "0 0 1024 1024"
|
|
29
99
|
}, [a("path", {
|
|
@@ -31,11 +101,23 @@ var F = /* @__PURE__ */ c({
|
|
|
31
101
|
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
32
102
|
})]));
|
|
33
103
|
}
|
|
34
|
-
}),
|
|
104
|
+
}), ue = /* @__PURE__ */ l({
|
|
105
|
+
name: "Loading",
|
|
106
|
+
__name: "loading",
|
|
107
|
+
setup(e) {
|
|
108
|
+
return (e, t) => (x(), i("svg", {
|
|
109
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
110
|
+
viewBox: "0 0 1024 1024"
|
|
111
|
+
}, [a("path", {
|
|
112
|
+
fill: "currentColor",
|
|
113
|
+
d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
|
|
114
|
+
})]));
|
|
115
|
+
}
|
|
116
|
+
}), de = /* @__PURE__ */ l({
|
|
35
117
|
name: "Minus",
|
|
36
118
|
__name: "minus",
|
|
37
119
|
setup(e) {
|
|
38
|
-
return (e, t) => (
|
|
120
|
+
return (e, t) => (x(), i("svg", {
|
|
39
121
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
122
|
viewBox: "0 0 1024 1024"
|
|
41
123
|
}, [a("path", {
|
|
@@ -43,10 +125,112 @@ var F = /* @__PURE__ */ c({
|
|
|
43
125
|
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
|
|
44
126
|
})]));
|
|
45
127
|
}
|
|
128
|
+
}), fe = /* @__PURE__ */ l({
|
|
129
|
+
name: "MuteNotification",
|
|
130
|
+
__name: "mute-notification",
|
|
131
|
+
setup(e) {
|
|
132
|
+
return (e, t) => (x(), i("svg", {
|
|
133
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
134
|
+
viewBox: "0 0 1024 1024"
|
|
135
|
+
}, [a("path", {
|
|
136
|
+
fill: "currentColor",
|
|
137
|
+
d: "m241.216 832 63.616-64H768V448c0-42.368-10.24-82.304-28.48-117.504l46.912-47.232C815.36 331.392 832 387.84 832 448v320h96a32 32 0 1 1 0 64zm-90.24 0H96a32 32 0 1 1 0-64h96V448a320.13 320.13 0 0 1 256-313.6V128a64 64 0 1 1 128 0v6.4a319.55 319.55 0 0 1 171.648 97.088l-45.184 45.44A256 256 0 0 0 256 448v278.336L151.04 832zM448 896h128a64 64 0 0 1-128 0"
|
|
138
|
+
}), a("path", {
|
|
139
|
+
fill: "currentColor",
|
|
140
|
+
d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z"
|
|
141
|
+
})]));
|
|
142
|
+
}
|
|
143
|
+
}), pe = /* @__PURE__ */ l({
|
|
144
|
+
name: "Mute",
|
|
145
|
+
__name: "mute",
|
|
146
|
+
setup(e) {
|
|
147
|
+
return (e, t) => (x(), i("svg", {
|
|
148
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
149
|
+
viewBox: "0 0 1024 1024"
|
|
150
|
+
}, [a("path", {
|
|
151
|
+
fill: "currentColor",
|
|
152
|
+
d: "m412.16 592.128-45.44 45.44A191.23 191.23 0 0 1 320 512V256a192 192 0 1 1 384 0v44.352l-64 64V256a128 128 0 1 0-256 0v256c0 30.336 10.56 58.24 28.16 80.128m51.968 38.592A128 128 0 0 0 640 512v-57.152l64-64V512a192 192 0 0 1-287.68 166.528zM314.88 779.968l46.144-46.08A223 223 0 0 0 480 768h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64h64v-64c-61.44 0-118.4-19.2-165.12-52.032M266.752 737.6A286.98 286.98 0 0 1 192 544v-32a32 32 0 0 1 64 0v32c0 56.832 21.184 108.8 56.064 148.288z"
|
|
153
|
+
}), a("path", {
|
|
154
|
+
fill: "currentColor",
|
|
155
|
+
d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056z"
|
|
156
|
+
})]));
|
|
157
|
+
}
|
|
158
|
+
}), me = /* @__PURE__ */ l({
|
|
159
|
+
name: "Refresh",
|
|
160
|
+
__name: "refresh",
|
|
161
|
+
setup(e) {
|
|
162
|
+
return (e, t) => (x(), i("svg", {
|
|
163
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
164
|
+
viewBox: "0 0 1024 1024"
|
|
165
|
+
}, [a("path", {
|
|
166
|
+
fill: "currentColor",
|
|
167
|
+
d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
|
|
168
|
+
})]));
|
|
169
|
+
}
|
|
170
|
+
}), he = /* @__PURE__ */ l({
|
|
171
|
+
name: "Search",
|
|
172
|
+
__name: "search",
|
|
173
|
+
setup(e) {
|
|
174
|
+
return (e, t) => (x(), i("svg", {
|
|
175
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
176
|
+
viewBox: "0 0 1024 1024"
|
|
177
|
+
}, [a("path", {
|
|
178
|
+
fill: "currentColor",
|
|
179
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
|
|
180
|
+
})]));
|
|
181
|
+
}
|
|
182
|
+
}), ge = /* @__PURE__ */ l({
|
|
183
|
+
name: "VideoCamera",
|
|
184
|
+
__name: "video-camera",
|
|
185
|
+
setup(e) {
|
|
186
|
+
return (e, t) => (x(), i("svg", {
|
|
187
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
188
|
+
viewBox: "0 0 1024 1024"
|
|
189
|
+
}, [a("path", {
|
|
190
|
+
fill: "currentColor",
|
|
191
|
+
d: "M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"
|
|
192
|
+
})]));
|
|
193
|
+
}
|
|
194
|
+
}), _e = /* @__PURE__ */ l({
|
|
195
|
+
name: "VideoPause",
|
|
196
|
+
__name: "video-pause",
|
|
197
|
+
setup(e) {
|
|
198
|
+
return (e, t) => (x(), i("svg", {
|
|
199
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
200
|
+
viewBox: "0 0 1024 1024"
|
|
201
|
+
}, [a("path", {
|
|
202
|
+
fill: "currentColor",
|
|
203
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-96-544q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32m192 0q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32"
|
|
204
|
+
})]));
|
|
205
|
+
}
|
|
206
|
+
}), ve = /* @__PURE__ */ l({
|
|
207
|
+
name: "VideoPlay",
|
|
208
|
+
__name: "video-play",
|
|
209
|
+
setup(e) {
|
|
210
|
+
return (e, t) => (x(), i("svg", {
|
|
211
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
212
|
+
viewBox: "0 0 1024 1024"
|
|
213
|
+
}, [a("path", {
|
|
214
|
+
fill: "currentColor",
|
|
215
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z"
|
|
216
|
+
})]));
|
|
217
|
+
}
|
|
218
|
+
}), ye = /* @__PURE__ */ l({
|
|
219
|
+
name: "Warning",
|
|
220
|
+
__name: "warning",
|
|
221
|
+
setup(e) {
|
|
222
|
+
return (e, t) => (x(), i("svg", {
|
|
223
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
224
|
+
viewBox: "0 0 1024 1024"
|
|
225
|
+
}, [a("path", {
|
|
226
|
+
fill: "currentColor",
|
|
227
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
|
|
228
|
+
})]));
|
|
229
|
+
}
|
|
46
230
|
});
|
|
47
231
|
//#endregion
|
|
48
|
-
//#region src/
|
|
49
|
-
function
|
|
232
|
+
//#region src/composables/useFullscreen.ts
|
|
233
|
+
function be(e, n) {
|
|
50
234
|
let r = t(() => e.fullscreen ?? !1);
|
|
51
235
|
function i() {
|
|
52
236
|
n("update:fullscreen", !r.value);
|
|
@@ -58,11 +242,11 @@ function R(e, n) {
|
|
|
58
242
|
}
|
|
59
243
|
//#endregion
|
|
60
244
|
//#region src/components/dialog/src/useResizable.ts
|
|
61
|
-
function
|
|
245
|
+
function xe(e, t, n) {
|
|
62
246
|
return Math.min(Math.max(e, t), n);
|
|
63
247
|
}
|
|
64
|
-
function
|
|
65
|
-
let n =
|
|
248
|
+
function J(e, t) {
|
|
249
|
+
let n = S(!1), r = S({}), i = () => {};
|
|
66
250
|
function a() {
|
|
67
251
|
i(), i = () => {};
|
|
68
252
|
}
|
|
@@ -73,7 +257,7 @@ function ee(e, t) {
|
|
|
73
257
|
o.preventDefault(), a();
|
|
74
258
|
let c = s.getBoundingClientRect(), l = e.minWidth ?? 400, u = e.minHeight ?? 240, d = Math.max(l, window.innerWidth - c.left - 32), f = Math.max(u, window.innerHeight - c.top - 32), p = o.clientX, m = o.clientY;
|
|
75
259
|
function h(e) {
|
|
76
|
-
let i = Math.round(
|
|
260
|
+
let i = Math.round(xe(c.width + e.clientX - p, l, d)), a = Math.round(xe(c.height + e.clientY - m, u, f));
|
|
77
261
|
n.value = !0, r.value = {
|
|
78
262
|
height: `${a}px`,
|
|
79
263
|
width: `${i}px`
|
|
@@ -89,7 +273,7 @@ function ee(e, t) {
|
|
|
89
273
|
window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
|
|
90
274
|
};
|
|
91
275
|
}
|
|
92
|
-
return
|
|
276
|
+
return v(a), {
|
|
93
277
|
isResized: n,
|
|
94
278
|
resizeStyle: r,
|
|
95
279
|
startResize: o
|
|
@@ -97,7 +281,7 @@ function ee(e, t) {
|
|
|
97
281
|
}
|
|
98
282
|
//#endregion
|
|
99
283
|
//#region src/components/dialog/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
100
|
-
var
|
|
284
|
+
var Se = { class: "ctc-dialog__header-content" }, Ce = { class: "ctc-dialog__title" }, we = { class: "ctc-dialog__header-actions" }, Te = ["aria-label", "title"], Ee = { class: "ctc-dialog__content" }, De = /* @__PURE__ */ l({
|
|
101
285
|
name: "CtcDialog",
|
|
102
286
|
inheritAttrs: !1,
|
|
103
287
|
__name: "index",
|
|
@@ -187,12 +371,12 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
187
371
|
"close",
|
|
188
372
|
"closed"
|
|
189
373
|
],
|
|
190
|
-
setup(e, { emit:
|
|
191
|
-
let l = e, u =
|
|
192
|
-
function
|
|
374
|
+
setup(e, { emit: s }) {
|
|
375
|
+
let l = e, u = s, d = O(), f = k(), m = U(), { isFullscreen: h, toggleFullscreen: g } = be(l, u), { isResized: _, resizeStyle: v, startResize: y } = J(l, u), b = t(() => h.value ? {} : v.value), S = t(() => _.value && !h.value), C = t(() => l.closeOnClickModal ?? m.dialog?.closeOnClickModal ?? !1);
|
|
376
|
+
function T(e) {
|
|
193
377
|
u("update:modelValue", e);
|
|
194
378
|
}
|
|
195
|
-
function
|
|
379
|
+
function A() {
|
|
196
380
|
if (l.beforeClose) {
|
|
197
381
|
l.beforeClose((e) => {
|
|
198
382
|
e || u("update:modelValue", !1);
|
|
@@ -201,22 +385,22 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
201
385
|
}
|
|
202
386
|
u("update:modelValue", !1);
|
|
203
387
|
}
|
|
204
|
-
return (t,
|
|
388
|
+
return (t, s) => (x(), n(D(I), p(D(d), {
|
|
205
389
|
class: ["ctc-dialog", {
|
|
206
390
|
"ctc-dialog--content-fill": e.contentFill,
|
|
207
391
|
"ctc-dialog--resizable": e.resizable,
|
|
208
|
-
"ctc-dialog--resized":
|
|
392
|
+
"ctc-dialog--resized": S.value
|
|
209
393
|
}],
|
|
210
|
-
style:
|
|
394
|
+
style: b.value,
|
|
211
395
|
"model-value": e.modelValue,
|
|
212
|
-
fullscreen:
|
|
396
|
+
fullscreen: D(h),
|
|
213
397
|
title: e.title,
|
|
214
398
|
width: e.width,
|
|
215
399
|
"align-center": e.alignCenter,
|
|
216
400
|
"append-to": e.appendTo,
|
|
217
401
|
"before-close": e.beforeClose,
|
|
218
402
|
"close-delay": e.closeDelay,
|
|
219
|
-
"close-on-click-modal":
|
|
403
|
+
"close-on-click-modal": C.value,
|
|
220
404
|
"close-on-press-escape": e.closeOnPressEscape,
|
|
221
405
|
"destroy-on-close": e.destroyOnClose,
|
|
222
406
|
draggable: e.draggable,
|
|
@@ -232,46 +416,46 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
232
416
|
"header-class": "ctc-dialog__header",
|
|
233
417
|
"body-class": "ctc-dialog__body",
|
|
234
418
|
"footer-class": "ctc-dialog__footer",
|
|
235
|
-
"onUpdate:modelValue":
|
|
236
|
-
onOpen:
|
|
237
|
-
onOpened:
|
|
238
|
-
onClose:
|
|
239
|
-
onClosed:
|
|
419
|
+
"onUpdate:modelValue": T,
|
|
420
|
+
onOpen: s[2] ||= (e) => u("open"),
|
|
421
|
+
onOpened: s[3] ||= (e) => u("opened"),
|
|
422
|
+
onClose: s[4] ||= (e) => u("close"),
|
|
423
|
+
onClosed: s[5] ||= (e) => u("closed")
|
|
240
424
|
}), o({
|
|
241
|
-
header:
|
|
425
|
+
header: N(() => [a("div", Se, [w(t.$slots, "header", {}, () => [a("span", Ce, E(e.title), 1)])]), a("div", we, [e.showFullscreen ? (x(), i("button", {
|
|
242
426
|
key: 0,
|
|
243
427
|
class: "ctc-dialog__fullscreen-toggle",
|
|
244
428
|
type: "button",
|
|
245
|
-
"aria-label":
|
|
246
|
-
title:
|
|
429
|
+
"aria-label": D(h) ? "退出全屏" : "全屏显示",
|
|
430
|
+
title: D(h) ? "退出全屏" : "全屏显示",
|
|
247
431
|
"data-ctc-fullscreen-toggle": "",
|
|
248
|
-
onClick:
|
|
249
|
-
}, [
|
|
250
|
-
default:
|
|
432
|
+
onClick: s[0] ||= (...e) => D(g) && D(g)(...e)
|
|
433
|
+
}, [c(D(R), { "aria-hidden": "true" }, {
|
|
434
|
+
default: N(() => [D(h) ? (x(), n(D(de), { key: 0 })) : (x(), n(D(q), { key: 1 }))]),
|
|
251
435
|
_: 1
|
|
252
|
-
})], 8,
|
|
436
|
+
})], 8, Te)) : r("", !0), e.showClose ? (x(), i("button", {
|
|
253
437
|
key: 1,
|
|
254
438
|
class: "ctc-dialog__close",
|
|
255
439
|
type: "button",
|
|
256
440
|
"aria-label": "关闭弹窗",
|
|
257
441
|
title: "关闭",
|
|
258
442
|
"data-ctc-close": "",
|
|
259
|
-
onClick:
|
|
260
|
-
}, [
|
|
261
|
-
default:
|
|
443
|
+
onClick: A
|
|
444
|
+
}, [c(D(R), { "aria-hidden": "true" }, {
|
|
445
|
+
default: N(() => [c(D(G))]),
|
|
262
446
|
_: 1
|
|
263
447
|
})])) : r("", !0)])]),
|
|
264
|
-
default:
|
|
448
|
+
default: N(() => [a("div", Ee, [w(t.$slots, "default")]), e.resizable && !D(h) ? (x(), i("div", {
|
|
265
449
|
key: 0,
|
|
266
450
|
class: "ctc-dialog__resize-handle",
|
|
267
451
|
"aria-hidden": "true",
|
|
268
452
|
"data-ctc-resize-handle": "",
|
|
269
|
-
onPointerdown:
|
|
453
|
+
onPointerdown: s[1] ||= (...e) => D(y) && D(y)(...e)
|
|
270
454
|
}, null, 32)) : r("", !0)]),
|
|
271
455
|
_: 2
|
|
272
|
-
}, [
|
|
456
|
+
}, [D(f).footer ? {
|
|
273
457
|
name: "footer",
|
|
274
|
-
fn:
|
|
458
|
+
fn: N(() => [w(t.$slots, "footer")]),
|
|
275
459
|
key: "0"
|
|
276
460
|
} : void 0]), 1040, [
|
|
277
461
|
"class",
|
|
@@ -298,10 +482,10 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
298
482
|
"z-index"
|
|
299
483
|
]));
|
|
300
484
|
}
|
|
301
|
-
}),
|
|
485
|
+
}), Oe = { class: "ctc-drawer__header-content" }, ke = { class: "ctc-drawer__title" }, Ae = { class: "ctc-drawer__header-actions" }, je = ["aria-label", "title"], Me = { class: "ctc-drawer__content" }, Ne = {
|
|
302
486
|
key: 0,
|
|
303
487
|
class: "ctc-drawer__footer"
|
|
304
|
-
},
|
|
488
|
+
}, Pe = /* @__PURE__ */ l({
|
|
305
489
|
name: "CtcDrawer",
|
|
306
490
|
inheritAttrs: !1,
|
|
307
491
|
__name: "index",
|
|
@@ -369,21 +553,21 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
369
553
|
"closed"
|
|
370
554
|
],
|
|
371
555
|
setup(e, { emit: o }) {
|
|
372
|
-
let
|
|
373
|
-
function
|
|
556
|
+
let s = e, l = o, u = O(), d = k(), { isFullscreen: f, toggleFullscreen: m } = be(s, l), g = t(() => f.value ? "100%" : s.size);
|
|
557
|
+
function _(e) {
|
|
374
558
|
l("update:modelValue", e);
|
|
375
559
|
}
|
|
376
|
-
function
|
|
377
|
-
if (
|
|
378
|
-
|
|
560
|
+
function v() {
|
|
561
|
+
if (s.beforeClose) {
|
|
562
|
+
s.beforeClose((e) => {
|
|
379
563
|
e || l("update:modelValue", !1);
|
|
380
564
|
});
|
|
381
565
|
return;
|
|
382
566
|
}
|
|
383
567
|
l("update:modelValue", !1);
|
|
384
568
|
}
|
|
385
|
-
return (t, o) => (
|
|
386
|
-
class: ["ctc-drawer", { "is-fullscreen":
|
|
569
|
+
return (t, o) => (x(), n(D(L), p(D(u), {
|
|
570
|
+
class: ["ctc-drawer", { "is-fullscreen": D(f) }],
|
|
387
571
|
"model-value": e.modelValue,
|
|
388
572
|
"append-to": e.appendTo,
|
|
389
573
|
"before-close": e.beforeClose,
|
|
@@ -395,40 +579,40 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
395
579
|
modal: e.modal,
|
|
396
580
|
"modal-class": e.modalClass,
|
|
397
581
|
"show-close": !1,
|
|
398
|
-
size:
|
|
582
|
+
size: g.value,
|
|
399
583
|
"z-index": e.zIndex,
|
|
400
584
|
"header-class": "ctc-drawer__header",
|
|
401
585
|
"body-class": "ctc-drawer__body",
|
|
402
|
-
"onUpdate:modelValue":
|
|
586
|
+
"onUpdate:modelValue": _,
|
|
403
587
|
onOpen: o[1] ||= (e) => l("open"),
|
|
404
588
|
onOpened: o[2] ||= (e) => l("opened"),
|
|
405
589
|
onClose: o[3] ||= (e) => l("close"),
|
|
406
590
|
onClosed: o[4] ||= (e) => l("closed")
|
|
407
591
|
}), {
|
|
408
|
-
header:
|
|
592
|
+
header: N(() => [a("div", Oe, [w(t.$slots, "header", {}, () => [a("span", ke, E(e.title), 1)])]), a("div", Ae, [e.showFullscreen ? (x(), i("button", {
|
|
409
593
|
key: 0,
|
|
410
594
|
class: "ctc-drawer__fullscreen-toggle",
|
|
411
595
|
type: "button",
|
|
412
|
-
"aria-label":
|
|
413
|
-
title:
|
|
596
|
+
"aria-label": D(f) ? "退出全屏" : "全屏显示",
|
|
597
|
+
title: D(f) ? "退出全屏" : "全屏显示",
|
|
414
598
|
"data-ctc-fullscreen-toggle": "",
|
|
415
|
-
onClick: o[0] ||= (...e) =>
|
|
416
|
-
}, [
|
|
417
|
-
default:
|
|
599
|
+
onClick: o[0] ||= (...e) => D(m) && D(m)(...e)
|
|
600
|
+
}, [c(D(R), { "aria-hidden": "true" }, {
|
|
601
|
+
default: N(() => [D(f) ? (x(), n(D(de), { key: 0 })) : (x(), n(D(q), { key: 1 }))]),
|
|
418
602
|
_: 1
|
|
419
|
-
})], 8,
|
|
603
|
+
})], 8, je)) : r("", !0), e.showClose ? (x(), i("button", {
|
|
420
604
|
key: 1,
|
|
421
605
|
class: "ctc-drawer__close",
|
|
422
606
|
type: "button",
|
|
423
607
|
"aria-label": "关闭抽屉",
|
|
424
608
|
title: "关闭",
|
|
425
609
|
"data-ctc-close": "",
|
|
426
|
-
onClick:
|
|
427
|
-
}, [
|
|
428
|
-
default:
|
|
610
|
+
onClick: v
|
|
611
|
+
}, [c(D(R), { "aria-hidden": "true" }, {
|
|
612
|
+
default: N(() => [c(D(G))]),
|
|
429
613
|
_: 1
|
|
430
614
|
})])) : r("", !0)])]),
|
|
431
|
-
default:
|
|
615
|
+
default: N(() => [a("div", { class: h(["ctc-drawer__layout", { "has-footer": D(d).footer }]) }, [a("div", Me, [w(t.$slots, "default")]), D(d).footer ? (x(), i("div", Ne, [w(t.$slots, "footer")])) : r("", !0)], 2)]),
|
|
432
616
|
_: 3
|
|
433
617
|
}, 16, [
|
|
434
618
|
"class",
|
|
@@ -446,7 +630,7 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
446
630
|
"z-index"
|
|
447
631
|
]));
|
|
448
632
|
}
|
|
449
|
-
}),
|
|
633
|
+
}), Y = /* @__PURE__ */ l({
|
|
450
634
|
name: "CtcFlex",
|
|
451
635
|
__name: "index",
|
|
452
636
|
props: {
|
|
@@ -473,16 +657,16 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
473
657
|
};
|
|
474
658
|
return n.gap !== 0 && n.gap !== "" && (e.gap = typeof n.gap == "number" ? `${n.gap}px` : n.gap), n.fill && (e.flex = n.grow), n.direction === "column" ? e.minHeight = "0" : e.minWidth = "0", n.scroll === "x" ? (e.overflowX = "auto", e.overflowY = "hidden") : n.scroll === "y" ? (e.overflowX = "hidden", e.overflowY = "auto") : n.scroll && (e.overflow = "auto"), e;
|
|
475
659
|
});
|
|
476
|
-
return (e, t) => (
|
|
660
|
+
return (e, t) => (x(), i("div", {
|
|
477
661
|
class: "ctc-flex",
|
|
478
|
-
style:
|
|
479
|
-
}, [
|
|
662
|
+
style: _(r.value)
|
|
663
|
+
}, [w(e.$slots, "default")], 4));
|
|
480
664
|
}
|
|
481
|
-
}),
|
|
665
|
+
}), Fe = /* @__PURE__ */ new Set([
|
|
482
666
|
"selection",
|
|
483
667
|
"index",
|
|
484
668
|
"expand"
|
|
485
|
-
]),
|
|
669
|
+
]), Ie = /* @__PURE__ */ new Map(), Le = l({
|
|
486
670
|
name: "CtcTableColumn",
|
|
487
671
|
props: {
|
|
488
672
|
column: {
|
|
@@ -497,8 +681,8 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
497
681
|
setup(e) {
|
|
498
682
|
let t = (e) => e.slot ?? e.prop, n = (e, t) => {
|
|
499
683
|
if (!t) return;
|
|
500
|
-
let n =
|
|
501
|
-
return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean),
|
|
684
|
+
let n = Ie.get(t);
|
|
685
|
+
return n || (n = t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean), Ie.set(t, n)), n.reduce((e, t) => {
|
|
502
686
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
503
687
|
}, e);
|
|
504
688
|
}, r = (r, i) => {
|
|
@@ -519,8 +703,8 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
519
703
|
config: t
|
|
520
704
|
}) : t.renderHeader?.(n);
|
|
521
705
|
}, a = (t) => {
|
|
522
|
-
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader:
|
|
523
|
-
return
|
|
706
|
+
let { children: n, slot: o, headerSlot: s, renderCell: c, renderHeader: l, formatter: u, ...f } = t, p = !!n?.length, m = o ?? t.prop, h = !!(m && e.slots[m] || c || u), g = !!(s && e.slots[s] || l), _ = t.type ? Fe.has(t.type) : !1;
|
|
707
|
+
return d(re, f, {
|
|
524
708
|
default: p ? () => n?.map(a) : h && !_ ? (e) => r(t, e) : void 0,
|
|
525
709
|
header: g ? (e) => i(t, e) : void 0
|
|
526
710
|
});
|
|
@@ -530,15 +714,15 @@ var B = { class: "ctc-dialog__header-content" }, te = { class: "ctc-dialog__titl
|
|
|
530
714
|
});
|
|
531
715
|
//#endregion
|
|
532
716
|
//#region src/components/table/src/merge.ts
|
|
533
|
-
function
|
|
717
|
+
function Re(e, t) {
|
|
534
718
|
return t.replace(/\[(?:'([^']*)'|"([^"]*)"|([^\]]+))\]/g, ".$1$2$3").split(".").filter(Boolean).reduce((e, t) => {
|
|
535
719
|
if (!(typeof e != "object" || !e)) return e[t];
|
|
536
720
|
}, e);
|
|
537
721
|
}
|
|
538
|
-
function
|
|
539
|
-
return n.every((n) => Object.is(
|
|
722
|
+
function ze(e, t, n) {
|
|
723
|
+
return n.every((n) => Object.is(Re(e, n), Re(t, n)));
|
|
540
724
|
}
|
|
541
|
-
function
|
|
725
|
+
function Be(e, t) {
|
|
542
726
|
let n = new Map(t.filter((e) => e.prop && e.by.length > 0).map((e) => [e.prop, e]));
|
|
543
727
|
return ({ column: t, rowIndex: r }) => {
|
|
544
728
|
if (t.type === "selection" || t.type === "index" || t.type === "expand") return;
|
|
@@ -546,12 +730,12 @@ function ce(e, t) {
|
|
|
546
730
|
if (!a) return;
|
|
547
731
|
let o = e[r];
|
|
548
732
|
if (!o) return;
|
|
549
|
-
if (r > 0 &&
|
|
733
|
+
if (r > 0 && ze(e[r - 1], o, a.by)) return {
|
|
550
734
|
rowspan: 0,
|
|
551
735
|
colspan: 0
|
|
552
736
|
};
|
|
553
737
|
let s = 1;
|
|
554
|
-
for (; r + s < e.length &&
|
|
738
|
+
for (; r + s < e.length && ze(o, e[r + s], a.by);) s += 1;
|
|
555
739
|
return {
|
|
556
740
|
rowspan: s,
|
|
557
741
|
colspan: 1
|
|
@@ -560,10 +744,10 @@ function ce(e, t) {
|
|
|
560
744
|
}
|
|
561
745
|
//#endregion
|
|
562
746
|
//#region src/components/table/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
563
|
-
var
|
|
747
|
+
var Ve = {
|
|
564
748
|
key: 0,
|
|
565
749
|
class: "ctc-table__pagination"
|
|
566
|
-
},
|
|
750
|
+
}, He = /* @__PURE__ */ l({
|
|
567
751
|
name: "CtcTable",
|
|
568
752
|
inheritAttrs: !1,
|
|
569
753
|
__name: "index",
|
|
@@ -598,91 +782,1616 @@ var le = {
|
|
|
598
782
|
"prev-click",
|
|
599
783
|
"next-click"
|
|
600
784
|
],
|
|
601
|
-
setup(a, { expose:
|
|
602
|
-
let u = a,
|
|
603
|
-
let e = Object.fromEntries(Object.entries(m).filter(([e]) => !
|
|
604
|
-
return !("border" in m) &&
|
|
785
|
+
setup(a, { expose: s, emit: l }) {
|
|
786
|
+
let u = V, d = a, f = l, m = O(), g = k(), _ = U(), v = A("tableRef"), y = /* @__PURE__ */ new Set(/* @__PURE__ */ "currentPage.pageSize.total.layout.pageSizes.pagerCount.background.disabled.hideOnSinglePage.small.prevText.nextText.prevIcon.nextIcon.popperClass.popperStyle.teleported.appendSizeTo.pageCount.defaultCurrentPage.defaultPageSize.onUpdate:currentPage.onUpdate:pageSize.onCurrentChange.onSizeChange.onPrevClick.onNextClick".split(".")), b = t(() => {
|
|
787
|
+
let e = Object.fromEntries(Object.entries(m).filter(([e]) => !y.has(e) && e !== "height" && e !== "spanMethod" && e !== "span-method")), t = {};
|
|
788
|
+
return !("border" in m) && _.table?.border !== void 0 && (t.border = _.table.border), !("stripe" in m) && _.table?.stripe !== void 0 && (t.stripe = _.table.stripe), {
|
|
605
789
|
...t,
|
|
606
790
|
...e
|
|
607
791
|
};
|
|
608
|
-
}),
|
|
609
|
-
...
|
|
610
|
-
...
|
|
611
|
-
})),
|
|
612
|
-
if (typeof
|
|
613
|
-
}),
|
|
614
|
-
|
|
615
|
-
if (
|
|
792
|
+
}), S = t(() => d.pageSize ?? _.table?.pageSize ?? 10), T = t(() => ({
|
|
793
|
+
..._.table?.paginationProps,
|
|
794
|
+
...d.paginationProps
|
|
795
|
+
})), E = t(() => {
|
|
796
|
+
if (typeof d.height == "string" || typeof d.height == "number") return d.height;
|
|
797
|
+
}), j = t(() => d.autoHeight && E.value === void 0), M = t(() => E.value ?? (j.value ? "100%" : void 0)), F = t(() => {
|
|
798
|
+
let e = m.spanMethod ?? m["span-method"];
|
|
799
|
+
if (typeof e == "function") return e;
|
|
800
|
+
if (d.merge.length !== 0) return Be(d.data, d.merge);
|
|
616
801
|
});
|
|
617
|
-
function
|
|
618
|
-
|
|
619
|
-
}
|
|
620
|
-
return
|
|
621
|
-
elTableRef:
|
|
622
|
-
clearSelection: () =>
|
|
623
|
-
toggleRowSelection: (e, t) =>
|
|
624
|
-
toggleAllSelection: () =>
|
|
625
|
-
toggleRowExpansion: (e, t) =>
|
|
626
|
-
setCurrentRow: (e) =>
|
|
627
|
-
clearSort: () =>
|
|
628
|
-
clearFilter: (e) =>
|
|
629
|
-
doLayout: () =>
|
|
630
|
-
sort: (e, t) =>
|
|
631
|
-
scrollTo: (e, t) =>
|
|
632
|
-
setScrollTop: (e) =>
|
|
633
|
-
setScrollLeft: (e) =>
|
|
634
|
-
}), (t, a) => (
|
|
802
|
+
function I(e, t) {
|
|
803
|
+
f("current-change", e, t);
|
|
804
|
+
}
|
|
805
|
+
return s({
|
|
806
|
+
elTableRef: v,
|
|
807
|
+
clearSelection: () => v.value?.clearSelection(),
|
|
808
|
+
toggleRowSelection: (e, t) => v.value?.toggleRowSelection(e, t),
|
|
809
|
+
toggleAllSelection: () => v.value?.toggleAllSelection(),
|
|
810
|
+
toggleRowExpansion: (e, t) => v.value?.toggleRowExpansion(e, t),
|
|
811
|
+
setCurrentRow: (e) => v.value?.setCurrentRow(e),
|
|
812
|
+
clearSort: () => v.value?.clearSort(),
|
|
813
|
+
clearFilter: (e) => v.value?.clearFilter(e),
|
|
814
|
+
doLayout: () => v.value?.doLayout(),
|
|
815
|
+
sort: (e, t) => v.value?.sort(e, t),
|
|
816
|
+
scrollTo: (e, t) => v.value?.scrollTo(e, t),
|
|
817
|
+
setScrollTop: (e) => v.value?.setScrollTop(e),
|
|
818
|
+
setScrollLeft: (e) => v.value?.setScrollLeft(e)
|
|
819
|
+
}), (t, a) => (x(), i("div", { class: h(["ctc-table", { "ctc-table--auto-height": j.value }]) }, [P((x(), n(D(u), p({
|
|
635
820
|
ref_key: "tableRef",
|
|
636
|
-
ref:
|
|
637
|
-
},
|
|
638
|
-
data:
|
|
639
|
-
height:
|
|
640
|
-
"span-method":
|
|
641
|
-
onCurrentChange:
|
|
821
|
+
ref: v
|
|
822
|
+
}, b.value, {
|
|
823
|
+
data: d.data,
|
|
824
|
+
height: M.value,
|
|
825
|
+
"span-method": F.value,
|
|
826
|
+
onCurrentChange: I
|
|
642
827
|
}), o({
|
|
643
|
-
default:
|
|
828
|
+
default: N(() => [(x(!0), i(e, null, C(d.columns, (e, t) => (x(), n(Le, {
|
|
644
829
|
key: e.prop ?? e.property ?? e.label ?? t,
|
|
645
830
|
column: e,
|
|
646
|
-
slots:
|
|
831
|
+
slots: D(g)
|
|
647
832
|
}, null, 8, ["column", "slots"]))), 128))]),
|
|
648
833
|
_: 2
|
|
649
|
-
}, [
|
|
834
|
+
}, [D(g).empty ? {
|
|
650
835
|
name: "empty",
|
|
651
|
-
fn:
|
|
836
|
+
fn: N(() => [w(t.$slots, "empty")]),
|
|
652
837
|
key: "0"
|
|
653
|
-
} : void 0,
|
|
838
|
+
} : void 0, D(g).append ? {
|
|
654
839
|
name: "append",
|
|
655
|
-
fn:
|
|
840
|
+
fn: N(() => [w(t.$slots, "append")]),
|
|
656
841
|
key: "1"
|
|
657
842
|
} : void 0]), 1040, [
|
|
658
843
|
"data",
|
|
659
844
|
"height",
|
|
660
845
|
"span-method"
|
|
661
|
-
])), [[
|
|
662
|
-
"current-page":
|
|
663
|
-
"page-size":
|
|
664
|
-
total:
|
|
665
|
-
"onUpdate:currentPage": a[0] ||= (e) =>
|
|
666
|
-
"onUpdate:pageSize": a[1] ||= (e) =>
|
|
667
|
-
onCurrentChange: a[2] ||= (e) =>
|
|
668
|
-
onSizeChange: a[3] ||= (e) =>
|
|
669
|
-
onPrevClick: a[4] ||= (e) =>
|
|
670
|
-
onNextClick: a[5] ||= (e) =>
|
|
846
|
+
])), [[D(ae), d.loading]]), d.pagination ? (x(), i("div", Ve, [c(D(B), p(T.value, {
|
|
847
|
+
"current-page": d.currentPage,
|
|
848
|
+
"page-size": S.value,
|
|
849
|
+
total: d.total,
|
|
850
|
+
"onUpdate:currentPage": a[0] ||= (e) => f("update:currentPage", e),
|
|
851
|
+
"onUpdate:pageSize": a[1] ||= (e) => f("update:pageSize", e),
|
|
852
|
+
onCurrentChange: a[2] ||= (e) => f("page-change", e),
|
|
853
|
+
onSizeChange: a[3] ||= (e) => f("page-size-change", e),
|
|
854
|
+
onPrevClick: a[4] ||= (e) => f("prev-click", e),
|
|
855
|
+
onNextClick: a[5] ||= (e) => f("next-click", e)
|
|
671
856
|
}), null, 16, [
|
|
672
857
|
"current-page",
|
|
673
858
|
"page-size",
|
|
674
859
|
"total"
|
|
675
|
-
]),
|
|
676
|
-
}
|
|
677
|
-
}),
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
860
|
+
]), w(t.$slots, "pagination")])) : r("", !0)], 2));
|
|
861
|
+
}
|
|
862
|
+
}), Ue = {
|
|
863
|
+
key: 0,
|
|
864
|
+
class: "ctc-report__bar-left"
|
|
865
|
+
}, We = {
|
|
866
|
+
key: 1,
|
|
867
|
+
class: "ctc-report__bar-right"
|
|
868
|
+
}, X = /* @__PURE__ */ l({
|
|
869
|
+
__name: "ReportBar",
|
|
870
|
+
setup(e) {
|
|
871
|
+
return (e, t) => (x(), n(D(Y), {
|
|
872
|
+
class: "ctc-report__bar",
|
|
873
|
+
direction: "row",
|
|
874
|
+
align: "center",
|
|
875
|
+
justify: "space-between"
|
|
876
|
+
}, {
|
|
877
|
+
default: N(() => [w(e.$slots, "default", {}, () => [e.$slots.left ? (x(), i("div", Ue, [w(e.$slots, "left")])) : r("", !0), e.$slots.right ? (x(), i("div", We, [w(e.$slots, "right")])) : r("", !0)])]),
|
|
878
|
+
_: 3
|
|
879
|
+
}));
|
|
880
|
+
}
|
|
881
|
+
}), Ge = {
|
|
882
|
+
key: 0,
|
|
883
|
+
class: "ctc-report__container-top"
|
|
884
|
+
}, Ke = {
|
|
885
|
+
key: 0,
|
|
886
|
+
class: "ctc-report__table-bar"
|
|
887
|
+
}, qe = {
|
|
888
|
+
key: 0,
|
|
889
|
+
class: "ctc-report__title"
|
|
890
|
+
}, Je = {
|
|
891
|
+
key: 1,
|
|
892
|
+
class: "ctc-report__before"
|
|
893
|
+
}, Ye = {
|
|
894
|
+
key: 2,
|
|
895
|
+
class: "ctc-report__after"
|
|
896
|
+
}, Xe = /* @__PURE__ */ l({
|
|
897
|
+
name: "CtcReport",
|
|
898
|
+
inheritAttrs: !1,
|
|
899
|
+
__name: "index",
|
|
900
|
+
props: {
|
|
901
|
+
title: { default: "" },
|
|
902
|
+
autoHeight: {
|
|
903
|
+
type: Boolean,
|
|
904
|
+
default: !0
|
|
905
|
+
},
|
|
906
|
+
height: {},
|
|
907
|
+
margin: { default: 0 },
|
|
908
|
+
padding: { default: 0 },
|
|
909
|
+
containerMargin: { default: 0 },
|
|
910
|
+
containerPadding: { default: "var(--ctc-space-4)" }
|
|
911
|
+
},
|
|
912
|
+
emits: [
|
|
913
|
+
"update:currentPage",
|
|
914
|
+
"update:pageSize",
|
|
915
|
+
"current-change",
|
|
916
|
+
"page-change",
|
|
917
|
+
"page-size-change",
|
|
918
|
+
"prev-click",
|
|
919
|
+
"next-click"
|
|
920
|
+
],
|
|
921
|
+
setup(s, { expose: l, emit: d }) {
|
|
922
|
+
let f = s, m = d, v = k(), y = O(), b = A("tableRef"), S = /* @__PURE__ */ new Set([
|
|
923
|
+
"custom-tool-bar",
|
|
924
|
+
"tool-bar",
|
|
925
|
+
"tool-bar-left",
|
|
926
|
+
"tool-bar-right",
|
|
927
|
+
"search-bar",
|
|
928
|
+
"search-bar-left",
|
|
929
|
+
"search-bar-right",
|
|
930
|
+
"container-top",
|
|
931
|
+
"table-bar",
|
|
932
|
+
"table-title",
|
|
933
|
+
"table-info-left",
|
|
934
|
+
"table-info-right",
|
|
935
|
+
"default",
|
|
936
|
+
"table-empty",
|
|
937
|
+
"append-table"
|
|
938
|
+
]);
|
|
939
|
+
function T(e) {
|
|
940
|
+
return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : e.map((e) => `${e}px`).join(" ");
|
|
941
|
+
}
|
|
942
|
+
let j = t(() => ({
|
|
943
|
+
margin: T(f.margin),
|
|
944
|
+
padding: T(f.padding)
|
|
945
|
+
})), M = t(() => ({
|
|
946
|
+
margin: T(f.containerMargin),
|
|
947
|
+
padding: T(f.containerPadding)
|
|
948
|
+
}));
|
|
949
|
+
function P() {
|
|
950
|
+
return Object.fromEntries(Object.entries(y).filter(([e]) => e !== "class" && e !== "style"));
|
|
951
|
+
}
|
|
952
|
+
function F() {
|
|
953
|
+
return Object.keys(v).filter((e) => !S.has(e) && !(e === "empty" && v["table-empty"]));
|
|
954
|
+
}
|
|
955
|
+
function I(e, t) {
|
|
956
|
+
m("current-change", e, t);
|
|
957
|
+
}
|
|
958
|
+
return l({
|
|
959
|
+
tableRef: b,
|
|
960
|
+
clearSelection: () => b.value?.clearSelection(),
|
|
961
|
+
toggleRowSelection: (e, t) => b.value?.toggleRowSelection(e, t),
|
|
962
|
+
toggleAllSelection: () => b.value?.toggleAllSelection(),
|
|
963
|
+
toggleRowExpansion: (e, t) => b.value?.toggleRowExpansion(e, t),
|
|
964
|
+
setCurrentRow: (e) => b.value?.setCurrentRow(e),
|
|
965
|
+
clearSort: () => b.value?.clearSort(),
|
|
966
|
+
clearFilter: (e) => b.value?.clearFilter(e),
|
|
967
|
+
doLayout: () => b.value?.doLayout(),
|
|
968
|
+
sort: (e, t) => b.value?.sort(e, t),
|
|
969
|
+
scrollTo: (e, t) => b.value?.scrollTo(e, t),
|
|
970
|
+
setScrollTop: (e) => b.value?.setScrollTop(e),
|
|
971
|
+
setScrollLeft: (e) => b.value?.setScrollLeft(e)
|
|
972
|
+
}), (t, s) => (x(), n(D(Y), {
|
|
973
|
+
class: h(["ctc-report", D(y).class]),
|
|
974
|
+
style: _(D(y).style)
|
|
975
|
+
}, {
|
|
976
|
+
default: N(() => [v["custom-tool-bar"] || v["tool-bar"] || v["tool-bar-left"] || v["tool-bar-right"] || v["search-bar"] || v["search-bar-left"] || v["search-bar-right"] ? (x(), i("div", {
|
|
977
|
+
key: 0,
|
|
978
|
+
class: "ctc-report__header",
|
|
979
|
+
style: _(j.value)
|
|
980
|
+
}, [v["custom-tool-bar"] ? w(t.$slots, "custom-tool-bar", {}, void 0, void 0, 0) : v["tool-bar"] || v["tool-bar-left"] || v["tool-bar-right"] ? (x(), n(X, {
|
|
981
|
+
key: 1,
|
|
982
|
+
class: "ctc-report__toolbar"
|
|
983
|
+
}, o({ _: 2 }, [
|
|
984
|
+
v["tool-bar"] ? {
|
|
985
|
+
name: "default",
|
|
986
|
+
fn: N(() => [w(t.$slots, "tool-bar")]),
|
|
987
|
+
key: "0"
|
|
988
|
+
} : void 0,
|
|
989
|
+
v["tool-bar-left"] ? {
|
|
990
|
+
name: "left",
|
|
991
|
+
fn: N(() => [w(t.$slots, "tool-bar-left")]),
|
|
992
|
+
key: "1"
|
|
993
|
+
} : void 0,
|
|
994
|
+
v["tool-bar-right"] ? {
|
|
995
|
+
name: "right",
|
|
996
|
+
fn: N(() => [w(t.$slots, "tool-bar-right")]),
|
|
997
|
+
key: "2"
|
|
998
|
+
} : void 0
|
|
999
|
+
]), 1024)) : r("", !0), v["search-bar"] || v["search-bar-left"] || v["search-bar-right"] ? (x(), n(X, {
|
|
1000
|
+
key: 2,
|
|
1001
|
+
class: "ctc-report__search"
|
|
1002
|
+
}, o({ _: 2 }, [
|
|
1003
|
+
v["search-bar"] ? {
|
|
1004
|
+
name: "default",
|
|
1005
|
+
fn: N(() => [w(t.$slots, "search-bar")]),
|
|
1006
|
+
key: "0"
|
|
1007
|
+
} : void 0,
|
|
1008
|
+
v["search-bar-left"] ? {
|
|
1009
|
+
name: "left",
|
|
1010
|
+
fn: N(() => [w(t.$slots, "search-bar-left")]),
|
|
1011
|
+
key: "1"
|
|
1012
|
+
} : void 0,
|
|
1013
|
+
v["search-bar-right"] ? {
|
|
1014
|
+
name: "right",
|
|
1015
|
+
fn: N(() => [w(t.$slots, "search-bar-right")]),
|
|
1016
|
+
key: "2"
|
|
1017
|
+
} : void 0
|
|
1018
|
+
]), 1024)) : r("", !0)], 4)) : r("", !0), c(D(Y), {
|
|
1019
|
+
class: "ctc-report__container",
|
|
1020
|
+
fill: "",
|
|
1021
|
+
style: _(M.value)
|
|
1022
|
+
}, {
|
|
1023
|
+
default: N(() => [v["container-top"] ? (x(), i("div", Ge, [w(t.$slots, "container-top")])) : r("", !0), c(D(Y), {
|
|
1024
|
+
class: "ctc-report__body",
|
|
1025
|
+
fill: ""
|
|
1026
|
+
}, {
|
|
1027
|
+
default: N(() => [
|
|
1028
|
+
v["table-bar"] || v["table-title"] || f.title || v["table-info-left"] || v["table-info-right"] ? (x(), i("div", Ke, [v["table-bar"] ? w(t.$slots, "table-bar", {}, void 0, void 0, 0) : (x(), i(e, { key: 1 }, [v["table-title"] || f.title ? (x(), i("div", qe, [w(t.$slots, "table-title", {}, () => [a("h2", null, E(f.title), 1)])])) : r("", !0), v["table-info-left"] || v["table-info-right"] ? (x(), n(X, {
|
|
1029
|
+
key: 1,
|
|
1030
|
+
class: "ctc-report__info"
|
|
1031
|
+
}, o({ _: 2 }, [v["table-info-left"] ? {
|
|
1032
|
+
name: "left",
|
|
1033
|
+
fn: N(() => [w(t.$slots, "table-info-left")]),
|
|
1034
|
+
key: "0"
|
|
1035
|
+
} : void 0, v["table-info-right"] ? {
|
|
1036
|
+
name: "right",
|
|
1037
|
+
fn: N(() => [w(t.$slots, "table-info-right")]),
|
|
1038
|
+
key: "1"
|
|
1039
|
+
} : void 0]), 1024)) : r("", !0)], 64))])) : r("", !0),
|
|
1040
|
+
v.default ? (x(), i("div", Je, [w(t.$slots, "default")])) : r("", !0),
|
|
1041
|
+
a("div", { class: h(["ctc-report__table", { "ctc-report__table--auto-height": f.autoHeight && f.height === void 0 }]) }, [c(D(He), p({
|
|
1042
|
+
ref_key: "tableRef",
|
|
1043
|
+
ref: b
|
|
1044
|
+
}, P(), {
|
|
1045
|
+
"auto-height": f.autoHeight,
|
|
1046
|
+
height: f.height,
|
|
1047
|
+
"onUpdate:currentPage": s[0] ||= (e) => m("update:currentPage", e),
|
|
1048
|
+
"onUpdate:pageSize": s[1] ||= (e) => m("update:pageSize", e),
|
|
1049
|
+
onCurrentChange: I,
|
|
1050
|
+
onPageChange: s[2] ||= (e) => m("page-change", e),
|
|
1051
|
+
onPageSizeChange: s[3] ||= (e) => m("page-size-change", e),
|
|
1052
|
+
onPrevClick: s[4] ||= (e) => m("prev-click", e),
|
|
1053
|
+
onNextClick: s[5] ||= (e) => m("next-click", e)
|
|
1054
|
+
}), o({ _: 2 }, [v["table-empty"] ? {
|
|
1055
|
+
name: "empty",
|
|
1056
|
+
fn: N(() => [w(t.$slots, "table-empty")]),
|
|
1057
|
+
key: "0"
|
|
1058
|
+
} : void 0, C(F(), (e) => ({
|
|
1059
|
+
name: e,
|
|
1060
|
+
fn: N((n) => [w(t.$slots, e, g(u(n)))])
|
|
1061
|
+
}))]), 1040, ["auto-height", "height"])], 2),
|
|
1062
|
+
v["append-table"] ? (x(), i("div", Ye, [w(t.$slots, "append-table")])) : r("", !0)
|
|
1063
|
+
]),
|
|
1064
|
+
_: 3
|
|
1065
|
+
})]),
|
|
1066
|
+
_: 3
|
|
1067
|
+
}, 8, ["style"])]),
|
|
1068
|
+
_: 3
|
|
1069
|
+
}, 8, ["class", "style"]));
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
//#endregion
|
|
1073
|
+
//#region src/components/video/src/time.ts
|
|
1074
|
+
function Z(e) {
|
|
1075
|
+
return String(e).padStart(2, "0");
|
|
1076
|
+
}
|
|
1077
|
+
function Ze(e) {
|
|
1078
|
+
return `${e.getFullYear()}-${Z(e.getMonth() + 1)}-${Z(e.getDate())} ${Z(e.getHours())}:${Z(e.getMinutes())}:${Z(e.getSeconds())}`;
|
|
1079
|
+
}
|
|
1080
|
+
function Qe() {
|
|
1081
|
+
let e = /* @__PURE__ */ new Date();
|
|
1082
|
+
return e.setHours(0, 0, 0, 0), Ze(e);
|
|
1083
|
+
}
|
|
1084
|
+
function $e(e) {
|
|
1085
|
+
let t = /(?:^|\s)(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/.exec(e || "");
|
|
1086
|
+
return t ? Number(t[1]) + Number(t[2] ?? 0) / 60 + Number(t[3] ?? 0) / 3600 : 0;
|
|
1087
|
+
}
|
|
1088
|
+
function Q(e) {
|
|
1089
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})\s+(.*)$/.exec(e || "");
|
|
1090
|
+
if (t) {
|
|
1091
|
+
let [, e, n, r, i] = t;
|
|
1092
|
+
return Date.UTC(Number(e), Number(n) - 1, Number(r)) / 864e5 * 24 + $e(i ?? "");
|
|
1093
|
+
}
|
|
1094
|
+
return $e(e);
|
|
1095
|
+
}
|
|
1096
|
+
function et(e, t) {
|
|
1097
|
+
let n = Q(t) - Q(e);
|
|
1098
|
+
return n > 0 ? n : n < 0 ? n + 24 : 0;
|
|
1099
|
+
}
|
|
1100
|
+
function tt(e) {
|
|
1101
|
+
let t = Math.max(0, Math.round(e * 3600));
|
|
1102
|
+
return `${Z(Math.floor(t / 3600))}:${Z(Math.floor(t % 3600 / 60))}:${Z(t % 60)}`;
|
|
1103
|
+
}
|
|
1104
|
+
function nt(e, t) {
|
|
1105
|
+
let n = e || "00:00", r = Math.max(0, Math.round((t - Q(n)) * 36e5));
|
|
1106
|
+
return n.split(" ")[0] ? Ze(new Date(new Date(n.replace(" ", "T")).getTime() + r)) : tt(($e(n) * 36e5 + r) % 864e5 / 36e5);
|
|
1107
|
+
}
|
|
1108
|
+
function rt() {
|
|
1109
|
+
return Q(Ze(/* @__PURE__ */ new Date()));
|
|
1110
|
+
}
|
|
1111
|
+
//#endregion
|
|
1112
|
+
//#region src/components/video/src/useMpegtsPlayer.ts
|
|
1113
|
+
var it = 2e4, at = 6e4;
|
|
1114
|
+
function ot(e, t) {
|
|
1115
|
+
let n = e, r = n?.response?.data ?? n, i = String(r?.msg ?? r?.message ?? "").trim();
|
|
1116
|
+
if (i) return /network error/i.test(i) ? "网络异常,请检查网络后重试" : /timeout/i.test(i) ? "请求超时,请重试" : i;
|
|
1117
|
+
let a = n?.response?.status;
|
|
1118
|
+
return typeof a == "number" && a >= 400 ? `${t}(HTTP ${a})` : t;
|
|
1119
|
+
}
|
|
1120
|
+
var st = null;
|
|
1121
|
+
function ct() {
|
|
1122
|
+
return st ||= import("@brid9e/mpegts.js").then((e) => e.default), st;
|
|
1123
|
+
}
|
|
1124
|
+
function lt(e) {
|
|
1125
|
+
let n = S(), r = S(!1), i = S(!1), a = S(""), o = S(!1), s = S(!1), c = S([]), l = S(0), u = S(""), d = null, f = null, p = null, h = 0, g = t(() => c.value[l.value]);
|
|
1126
|
+
function _() {
|
|
1127
|
+
y(), p = setTimeout(() => {
|
|
1128
|
+
p = null, r.value && (r.value = !1, i.value = !0, a.value = "视频加载超时,请重试");
|
|
1129
|
+
}, it);
|
|
1130
|
+
}
|
|
1131
|
+
function y() {
|
|
1132
|
+
p &&= (clearTimeout(p), null);
|
|
1133
|
+
}
|
|
1134
|
+
function b() {
|
|
1135
|
+
f &&= (clearTimeout(f), null);
|
|
1136
|
+
}
|
|
1137
|
+
function x() {
|
|
1138
|
+
i.value = !1, a.value = "";
|
|
1139
|
+
}
|
|
1140
|
+
function C(t, n) {
|
|
1141
|
+
i.value = !0, a.value = t, r.value = !1, y(), e.onError?.({
|
|
1142
|
+
channel: e.channel(),
|
|
1143
|
+
error: n ?? Error(t),
|
|
1144
|
+
mode: e.mode()
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
function w(e) {
|
|
1148
|
+
r.value = !0, s.value = e, _();
|
|
1149
|
+
}
|
|
1150
|
+
function T() {
|
|
1151
|
+
if (b(), y(), d) {
|
|
1152
|
+
let e = d;
|
|
1153
|
+
d = null, e.pause(), e.unload(), e.detachMediaElement(), e.destroy();
|
|
1154
|
+
}
|
|
1155
|
+
let e = n.value;
|
|
1156
|
+
e && (e.removeAttribute("src"), e.load());
|
|
1157
|
+
}
|
|
1158
|
+
async function E(e, t, i) {
|
|
1159
|
+
let a = await ct();
|
|
1160
|
+
if (i !== h) return;
|
|
1161
|
+
if (!a.isSupported()) {
|
|
1162
|
+
C("当前浏览器不支持 flv 播放");
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
if (T(), n.value || await m(), i !== h) return;
|
|
1166
|
+
if (!n.value) {
|
|
1167
|
+
C("视频容器尚未就绪");
|
|
1168
|
+
return;
|
|
1169
|
+
}
|
|
1170
|
+
let o = a.createPlayer({
|
|
1171
|
+
type: "flv",
|
|
1172
|
+
url: e,
|
|
1173
|
+
isLive: t
|
|
1174
|
+
}, t ? {
|
|
1175
|
+
enableWorker: !1,
|
|
1176
|
+
enableStashBuffer: !1,
|
|
1177
|
+
stashInitialSize: 128,
|
|
1178
|
+
lazyLoad: !1,
|
|
1179
|
+
autoCleanupSourceBuffer: !0,
|
|
1180
|
+
autoDisableAudioOnUnsupportedCodec: !0,
|
|
1181
|
+
autoDisableAudioTimeout: 1e3
|
|
1182
|
+
} : {
|
|
1183
|
+
enableWorker: !1,
|
|
1184
|
+
lazyLoad: !1,
|
|
1185
|
+
seekType: "range",
|
|
1186
|
+
enableStashBuffer: !0,
|
|
1187
|
+
stashInitialSize: 8192,
|
|
1188
|
+
autoCleanupSourceBuffer: !0,
|
|
1189
|
+
autoCleanupMaxBackwardDuration: 120,
|
|
1190
|
+
autoCleanupMinBackwardDuration: 60,
|
|
1191
|
+
autoDisableAudioOnUnsupportedCodec: !0,
|
|
1192
|
+
autoDisableAudioTimeout: 1e3
|
|
1193
|
+
});
|
|
1194
|
+
o.attachMediaElement(n.value), o.on(a.Events.ERROR, () => {
|
|
1195
|
+
i === h && C("视频流播放中断,请重试");
|
|
1196
|
+
}), o.load();
|
|
1197
|
+
let s = o.play();
|
|
1198
|
+
s && typeof s.catch == "function" && s.catch(() => {}), d = o, r.value && _();
|
|
1199
|
+
}
|
|
1200
|
+
async function D(t) {
|
|
1201
|
+
let n = e.source?.();
|
|
1202
|
+
return n?.live ? n.live(t) : t.liveUrl ? { url: t.liveUrl } : null;
|
|
1203
|
+
}
|
|
1204
|
+
async function O(t, n, r) {
|
|
1205
|
+
let i = e.source?.();
|
|
1206
|
+
return i?.playback ? i.playback(t, {
|
|
1207
|
+
beginTime: n,
|
|
1208
|
+
endTime: r
|
|
1209
|
+
}) : t.playbackUrl ? { url: t.playbackUrl } : null;
|
|
1210
|
+
}
|
|
1211
|
+
async function k(t = !0) {
|
|
1212
|
+
let n = e.channel();
|
|
1213
|
+
if (!n) return;
|
|
1214
|
+
let r = ++h;
|
|
1215
|
+
s.value = !1, t && w(!1), x();
|
|
1216
|
+
try {
|
|
1217
|
+
let t = await D(n);
|
|
1218
|
+
if (r !== h || e.channel()?.id !== n.id) return;
|
|
1219
|
+
if (!t?.url) {
|
|
1220
|
+
C("未获取到拉流地址");
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
await E(t.url, !0, r), r === h && N(t.expireTime, r);
|
|
1224
|
+
} catch (e) {
|
|
1225
|
+
r === h && C(ot(e, "视频加载失败,请切换其他通道"), e);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
async function A(t = !0, n = !1) {
|
|
1229
|
+
let r = e.channel();
|
|
1230
|
+
if (!r) return;
|
|
1231
|
+
let i = ++h;
|
|
1232
|
+
s.value = !1, n || (u.value = e.beginTime()), t && w(!1), x();
|
|
1233
|
+
try {
|
|
1234
|
+
let t = await O(r, u.value || e.beginTime(), e.endTime());
|
|
1235
|
+
if (i !== h || e.channel()?.id !== r.id) return;
|
|
1236
|
+
let n = t?.segments ?? [];
|
|
1237
|
+
if (c.value = n, n.length > 0) l.value = 0, await E(n[0].url, !1, i);
|
|
1238
|
+
else if (t?.url) c.value = [], await E(t.url, !1, i);
|
|
1239
|
+
else {
|
|
1240
|
+
C("该时段无录像");
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
i === h && N(t?.expireTime, i);
|
|
1244
|
+
} catch (e) {
|
|
1245
|
+
i === h && C(ot(e, "录像获取失败,请切换其他时段"), e);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
async function j(t) {
|
|
1249
|
+
if (e.mode() !== "playback") return;
|
|
1250
|
+
let n = e.channel();
|
|
1251
|
+
if (!n) return;
|
|
1252
|
+
let i = ++h;
|
|
1253
|
+
x(), w(!0);
|
|
1254
|
+
try {
|
|
1255
|
+
u.value = nt(e.beginTime(), t);
|
|
1256
|
+
let r = await O(n, u.value, e.endTime());
|
|
1257
|
+
if (i !== h || e.channel()?.id !== n.id) return;
|
|
1258
|
+
let a = r?.segments ?? [];
|
|
1259
|
+
if (c.value = a, a.length > 0) l.value = 0, await E(a[0].url, !1, i);
|
|
1260
|
+
else if (r?.url) c.value = [], await E(r.url, !1, i);
|
|
1261
|
+
else {
|
|
1262
|
+
C("该时段无录像");
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
i === h && N(r?.expireTime, i);
|
|
1266
|
+
} catch {
|
|
1267
|
+
r.value = !1, s.value = !1, y();
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
function N(t, n) {
|
|
1271
|
+
if (b(), !t) return;
|
|
1272
|
+
let r = new Date(t.replace(/-/g, "/")).getTime() - Date.now() - at;
|
|
1273
|
+
r <= 0 || (f = setTimeout(() => {
|
|
1274
|
+
f = null, !(n !== h || !e.channel()) && (e.mode() === "playback" ? A(!1, !0) : k(!1));
|
|
1275
|
+
}, r));
|
|
1276
|
+
}
|
|
1277
|
+
function P() {
|
|
1278
|
+
r.value = !1, s.value = !1, y();
|
|
1279
|
+
}
|
|
1280
|
+
function F() {
|
|
1281
|
+
o.value = !1;
|
|
1282
|
+
}
|
|
1283
|
+
function I() {
|
|
1284
|
+
o.value = !0;
|
|
1285
|
+
}
|
|
1286
|
+
function L() {
|
|
1287
|
+
let t = n.value;
|
|
1288
|
+
!t || e.mode() !== "playback" || (t.paused ? t.play().catch(() => {}) : t.pause());
|
|
1289
|
+
}
|
|
1290
|
+
function R() {
|
|
1291
|
+
if (e.mode() !== "playback") return;
|
|
1292
|
+
let t = l.value + 1;
|
|
1293
|
+
if (c.value.length > 0 && t < c.value.length) {
|
|
1294
|
+
l.value = t;
|
|
1295
|
+
let e = c.value[t];
|
|
1296
|
+
e && E(e.url, !1, h);
|
|
1297
|
+
return;
|
|
1298
|
+
}
|
|
1299
|
+
e.onPlaybackEnded?.({
|
|
1300
|
+
channel: e.channel(),
|
|
1301
|
+
mode: e.mode()
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
function z() {
|
|
1305
|
+
if (e.mode() !== "playback") return NaN;
|
|
1306
|
+
let t = n.value, r = g.value, i = Q(u.value || e.beginTime() || "00:00");
|
|
1307
|
+
if (!t || !r) return NaN;
|
|
1308
|
+
let a = c.value.slice(0, l.value).reduce((e, t) => e + et(t.segmentBeginTime ?? "", t.segmentEndTime ?? ""), 0), o = t.currentTime > 0 ? t.currentTime / 3600 : 0;
|
|
1309
|
+
return i + a + o;
|
|
1310
|
+
}
|
|
1311
|
+
function B() {
|
|
1312
|
+
r.value || !e.channel() || (e.mode() === "live" ? k(!0) : g.value ? j(z()) : A(!0, !0));
|
|
1313
|
+
}
|
|
1314
|
+
function ee() {
|
|
1315
|
+
h++, T(), r.value = !1, i.value = !1, a.value = "", o.value = !1, s.value = !1, c.value = [], l.value = 0, u.value = e.beginTime();
|
|
1316
|
+
}
|
|
1317
|
+
function te() {
|
|
1318
|
+
let t = e.channel();
|
|
1319
|
+
ee(), t && (e.mode() === "live" ? k(!0) : A(!0));
|
|
1320
|
+
}
|
|
1321
|
+
return M([() => e.channel()?.id, () => e.mode()], () => te(), { immediate: !0 }), M([() => e.beginTime(), () => e.endTime()], () => {
|
|
1322
|
+
e.mode() === "playback" && te();
|
|
1323
|
+
}), v(() => {
|
|
1324
|
+
h++, T(), b();
|
|
1325
|
+
}), {
|
|
1326
|
+
clearWatchdog: y,
|
|
1327
|
+
cursorHour: z,
|
|
1328
|
+
currentSegment: g,
|
|
1329
|
+
destroy: T,
|
|
1330
|
+
error: i,
|
|
1331
|
+
errorText: a,
|
|
1332
|
+
isPaused: o,
|
|
1333
|
+
isSeekReload: s,
|
|
1334
|
+
loading: r,
|
|
1335
|
+
onEnded: R,
|
|
1336
|
+
onPause: I,
|
|
1337
|
+
onPlay: F,
|
|
1338
|
+
onPlaying: P,
|
|
1339
|
+
playbackBeginTime: u,
|
|
1340
|
+
reload: B,
|
|
1341
|
+
segmentIndex: l,
|
|
1342
|
+
segments: c,
|
|
1343
|
+
seekTo: j,
|
|
1344
|
+
togglePause: L,
|
|
1345
|
+
videoEl: n
|
|
1346
|
+
};
|
|
1347
|
+
}
|
|
1348
|
+
//#endregion
|
|
1349
|
+
//#region src/components/video/src/useVideoTimeline.ts
|
|
1350
|
+
var ut = {
|
|
1351
|
+
none: () => !0,
|
|
1352
|
+
alt: (e) => e.altKey,
|
|
1353
|
+
ctrl: (e) => e.ctrlKey,
|
|
1354
|
+
meta: (e) => e.metaKey,
|
|
1355
|
+
shift: (e) => e.shiftKey
|
|
1356
|
+
};
|
|
1357
|
+
function $(e, t) {
|
|
1358
|
+
return typeof window > "u" ? t : getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
|
|
1359
|
+
}
|
|
1360
|
+
function dt(e) {
|
|
1361
|
+
let n = S(), r = S(0), i = S(!1), a = S(-1), o = S(0), s = null, c = null, l = !1, u = null, d = null, f = e.axisRange ?? S({
|
|
1362
|
+
start: 0,
|
|
1363
|
+
end: 24
|
|
1364
|
+
}), p = t(() => f.value.start), h = t(() => f.value.end), g = t(() => Math.max(h.value - p.value, 1e-4)), _ = t(() => Math.min(h.value, e.availableEndHour?.() ?? h.value)), v = t(() => _.value < h.value - 1e-6), x = S(g.value), C = S(p.value), w = t(() => Math.min(C.value + x.value, h.value)), T = [
|
|
1365
|
+
1 / 12,
|
|
1366
|
+
.25,
|
|
1367
|
+
.5,
|
|
1368
|
+
1,
|
|
1369
|
+
2,
|
|
1370
|
+
4,
|
|
1371
|
+
6,
|
|
1372
|
+
8,
|
|
1373
|
+
12,
|
|
1374
|
+
24,
|
|
1375
|
+
48
|
|
1376
|
+
], E = t(() => {
|
|
1377
|
+
let e = x.value / 20;
|
|
1378
|
+
for (let t of T) if (t >= e) return t;
|
|
1379
|
+
return T[T.length - 1] ?? 48;
|
|
1380
|
+
}), D = t(() => (o.value, {
|
|
1381
|
+
alarm: $("--el-color-danger", "#f56c6c"),
|
|
1382
|
+
forbidden: $("--ctc-color-text-placeholder", "#94969e"),
|
|
1383
|
+
hoverBox: $("--ctc-color-surface-elevated", "#282a32"),
|
|
1384
|
+
hoverHint: $("--ctc-color-text-secondary", "#b8bcc6"),
|
|
1385
|
+
hoverLinePlayed: $("--ctc-color-on-primary", "#ffffff"),
|
|
1386
|
+
hoverLineRest: $("--ctc-color-primary", "#1f5eff"),
|
|
1387
|
+
hoverText: $("--ctc-color-text", "#e5e7eb"),
|
|
1388
|
+
labelPlayed: $("--ctc-color-on-primary", "#ffffff"),
|
|
1389
|
+
labelRest: $("--ctc-color-text-secondary", "#b8bcc6"),
|
|
1390
|
+
played: $("--ctc-color-primary", "#1f5eff"),
|
|
1391
|
+
tickPlayed: $("--ctc-color-on-primary", "#ffffff"),
|
|
1392
|
+
tickRest: $("--ctc-color-text-placeholder", "#98a2b3"),
|
|
1393
|
+
track: $("--ctc-color-fill", "#2e3039")
|
|
1394
|
+
}));
|
|
1395
|
+
function O(e, t, n, r = !1) {
|
|
1396
|
+
let i = n - t, a = /* @__PURE__ */ new Date(Math.floor(e / 24) * 864e5), o = `${String(a.getUTCMonth() + 1).padStart(2, "0")}-${String(a.getUTCDate()).padStart(2, "0")}`;
|
|
1397
|
+
if (r) {
|
|
1398
|
+
let t = Math.floor((e % 24 + 24) % 24 * 3600);
|
|
1399
|
+
return `${o} ${String(Math.floor(t / 3600)).padStart(2, "0")}:${String(Math.floor(t % 3600 / 60)).padStart(2, "0")}:${String(t % 60).padStart(2, "0")}`;
|
|
1400
|
+
}
|
|
1401
|
+
let s = Math.round((e % 24 + 24) % 24 * 60), c = `${String(Math.floor(s / 60)).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}`;
|
|
1402
|
+
return Math.floor(t / 24) === Math.floor(n / 24) ? c : i >= 168 ? o : `${o} ${c}`;
|
|
1403
|
+
}
|
|
1404
|
+
let k = t(() => {
|
|
1405
|
+
let e = p.value + r.value * g.value, t = (e % 24 + 24) % 24 * 3600, n = `${String(Math.floor(t / 3600)).padStart(2, "0")}:${String(Math.floor(t % 3600 / 60)).padStart(2, "0")}:${String(Math.floor(t % 60)).padStart(2, "0")}`;
|
|
1406
|
+
if (Math.floor(p.value / 24) !== Math.floor(h.value / 24)) {
|
|
1407
|
+
let t = /* @__PURE__ */ new Date(Math.floor(e / 24) * 864e5);
|
|
1408
|
+
return `${String(t.getUTCMonth() + 1).padStart(2, "0")}-${String(t.getUTCDate()).padStart(2, "0")} ${n}`;
|
|
1409
|
+
}
|
|
1410
|
+
return n;
|
|
1411
|
+
});
|
|
1412
|
+
function A(e) {
|
|
1413
|
+
let t = Q(e);
|
|
1414
|
+
return /^\d{4}-\d{2}-\d{2}/.test(e) ? t : Math.floor(p.value / 24) * 24 + t;
|
|
1415
|
+
}
|
|
1416
|
+
let j = t(() => {
|
|
1417
|
+
let t = p.value + r.value * g.value;
|
|
1418
|
+
return e.alarms.value.filter((e) => t >= A(e.startTime) && t <= A(e.endTime));
|
|
1419
|
+
});
|
|
1420
|
+
function N() {
|
|
1421
|
+
if (e.getCursorHour) {
|
|
1422
|
+
let t = e.getCursorHour();
|
|
1423
|
+
if (Number.isFinite(t)) return t;
|
|
1424
|
+
}
|
|
1425
|
+
let t = e.videoRef.value, n = t?.duration;
|
|
1426
|
+
return t && n && Number.isFinite(n) ? p.value + t.currentTime / n * g.value : p.value + r.value * g.value;
|
|
1427
|
+
}
|
|
1428
|
+
function P() {
|
|
1429
|
+
let e = x.value, t = p.value + r.value * g.value, n = C.value, i = Math.min(n + e, h.value), a = e * .15;
|
|
1430
|
+
t < n + a && n > p.value ? C.value = Math.max(p.value, t - a) : t > i - a && i < h.value && (C.value = Math.min(h.value - e, t - e + a));
|
|
1431
|
+
}
|
|
1432
|
+
function F() {
|
|
1433
|
+
let t = e.videoRef.value, a = n.value;
|
|
1434
|
+
if (!t || !a || t.paused || i.value) {
|
|
1435
|
+
c = null;
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1438
|
+
r.value = Math.max(0, Math.min(1, (N() - p.value) / g.value)), P(), I(), c = requestAnimationFrame(F);
|
|
1439
|
+
}
|
|
1440
|
+
function I() {
|
|
1441
|
+
let t = n.value;
|
|
1442
|
+
if (!t) return;
|
|
1443
|
+
let o = t.getContext("2d");
|
|
1444
|
+
if (!o) return;
|
|
1445
|
+
let s = t.getBoundingClientRect();
|
|
1446
|
+
if (s.width <= 0 || s.height <= 0) return;
|
|
1447
|
+
let c = window.devicePixelRatio || 1;
|
|
1448
|
+
t.width = s.width * c, t.height = s.height * c, o.scale(c, c), o.clearRect(0, 0, s.width, s.height);
|
|
1449
|
+
let l = o, u = D.value, d = s.width, f = s.height, m = f / 2, h = C.value, y = w.value, b = p.value + r.value * g.value, x = (e) => (e - h) / (y - h) * d, S = (e) => Math.max(0, Math.min(d, e)), T = (e) => Math.max(10, Math.min(d - 10, e));
|
|
1450
|
+
l.fillStyle = u.track, l.fillRect(0, 0, d, f);
|
|
1451
|
+
let k = S(x(p.value)), j = S(x(b));
|
|
1452
|
+
l.fillStyle = u.played, l.fillRect(k, 0, Math.max(j - k, 0), f);
|
|
1453
|
+
for (let t of e.alarms.value) {
|
|
1454
|
+
let e = A(t.startTime), n = A(t.endTime);
|
|
1455
|
+
if (n < h || e > y) continue;
|
|
1456
|
+
let r = S(x(e)), i = S(x(n));
|
|
1457
|
+
i - r < 1 || (l.globalAlpha = .85, l.fillStyle = u.alarm, l.fillRect(r, 0, i - r, f), l.globalAlpha = 1);
|
|
1458
|
+
}
|
|
1459
|
+
l.lineWidth = 1, l.textAlign = "left", l.textBaseline = "middle";
|
|
1460
|
+
let M = E.value, N = y - h, P = N >= 168 || Math.floor(h / 24) === Math.floor(y / 24) ? 34 : 52, F = Math.max(M, (P + 8) / d * N), I = Math.max(1, Math.ceil(F / M));
|
|
1461
|
+
function L(e, t) {
|
|
1462
|
+
l.strokeStyle = e, l.fillStyle = t, l.font = M < .5 ? "8px sans-serif" : "9px sans-serif";
|
|
1463
|
+
let n = Math.ceil(h / M) * M, r = 0;
|
|
1464
|
+
for (; n <= y + 1e-6;) {
|
|
1465
|
+
let e = x(n);
|
|
1466
|
+
e >= 0 && e <= d && (l.globalAlpha = .55, l.beginPath(), l.moveTo(e, 0), l.lineTo(e, f / 2), l.stroke(), l.globalAlpha = 1, r % I === 0 && l.fillText(O(n, h, y), T(e + 4), m)), n += M, r++;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
function R(e, t, n, r) {
|
|
1470
|
+
t - e <= 0 || (l.save(), l.beginPath(), l.rect(e, 0, t - e, f), l.clip(), L(n, r), l.restore());
|
|
1471
|
+
}
|
|
1472
|
+
if (R(0, j, u.tickPlayed, u.labelPlayed), R(j, d, u.tickRest, u.labelRest), v.value && _.value < y) {
|
|
1473
|
+
let e = S(x(_.value)), t = S(x(y));
|
|
1474
|
+
t - e >= 1 && (l.globalAlpha = .32, l.fillStyle = u.forbidden, l.fillRect(e, 0, t - e, f), l.globalAlpha = 1);
|
|
1475
|
+
}
|
|
1476
|
+
if (a.value >= 0 && !i.value) {
|
|
1477
|
+
let e = h + a.value * (y - h), t = x(e), n = t >= k && t <= j, r = e > _.value + 1e-6;
|
|
1478
|
+
l.strokeStyle = n ? u.hoverLinePlayed : u.hoverLineRest, l.lineWidth = 1, l.setLineDash([3, 3]), l.beginPath(), l.moveTo(t, 0), l.lineTo(t, f), l.stroke(), l.setLineDash([]), l.font = "bold 9px sans-serif";
|
|
1479
|
+
let i = O(e, h, y, !0), o = "(还未生成回放)", s = Math.max(l.measureText(i).width, l.measureText(o).width), c = T(t), d = s + 10, p = r ? 28 : 14, g = m - p / 2;
|
|
1480
|
+
l.globalAlpha = .95, l.fillStyle = u.hoverBox, l.fillRect(c - d / 2, g, d, p), l.globalAlpha = 1, l.fillStyle = u.hoverText, l.textAlign = "center", l.textBaseline = "middle", r ? (l.fillText(i, c, m - 7), l.fillStyle = u.hoverHint, l.fillText(o, c, m + 7)) : l.fillText(i, c, m);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
function L(t) {
|
|
1484
|
+
let a = n.value;
|
|
1485
|
+
if (!a) return;
|
|
1486
|
+
let o = a.getBoundingClientRect(), s = Math.max(0, Math.min(1, (t.clientX - o.left) / o.width)), u = C.value + s * x.value, d = Math.min(u, _.value);
|
|
1487
|
+
if (r.value = Math.max(0, Math.min(1, (d - p.value) / g.value)), e.onSeekHour ? l = !0 : e.videoRef.value?.duration && Number.isFinite(e.videoRef.value.duration) && (e.videoRef.value.currentTime = r.value * e.videoRef.value.duration, e.mode.value === "playback" && e.videoRef.value.paused && e.videoRef.value.play()), P(), I(), !i.value) {
|
|
1488
|
+
let t = e.videoRef.value;
|
|
1489
|
+
t && !t.paused && e.mode.value === "playback" && !c && F();
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
function R(e) {
|
|
1493
|
+
i.value = !0, L(e);
|
|
1494
|
+
}
|
|
1495
|
+
function z(e) {
|
|
1496
|
+
i.value && L(e);
|
|
1497
|
+
}
|
|
1498
|
+
function B() {
|
|
1499
|
+
if (i.value = !1, e.onSeekHour && l) {
|
|
1500
|
+
l = !1;
|
|
1501
|
+
let t = p.value + r.value * g.value;
|
|
1502
|
+
e.onSeekHour(Math.max(p.value, Math.min(_.value, t)));
|
|
1503
|
+
}
|
|
1504
|
+
let t = e.videoRef.value;
|
|
1505
|
+
t && !t.paused && e.mode.value === "playback" && !c && F();
|
|
1506
|
+
}
|
|
1507
|
+
function ee(e) {
|
|
1508
|
+
let t = n.value;
|
|
1509
|
+
if (!t) return;
|
|
1510
|
+
let r = t.getBoundingClientRect();
|
|
1511
|
+
a.value = Math.max(0, Math.min(1, (e.clientX - r.left) / r.width)), s && cancelAnimationFrame(s), s = requestAnimationFrame(I);
|
|
1512
|
+
}
|
|
1513
|
+
function te() {
|
|
1514
|
+
a.value = -1, s && cancelAnimationFrame(s), s = requestAnimationFrame(I);
|
|
1515
|
+
}
|
|
1516
|
+
function ne(t) {
|
|
1517
|
+
if (!ut[e.zoomModifier?.() ?? "none"](t)) return;
|
|
1518
|
+
t.preventDefault();
|
|
1519
|
+
let n = Math.abs(t.deltaY) > Math.abs(t.deltaX) ? t.deltaY : t.deltaX;
|
|
1520
|
+
if (Math.abs(n) < 1) return;
|
|
1521
|
+
let r = x.value, i = n > 0 ? 1.5 : 1 / 1.5, a = Math.max(.25, Math.min(g.value, r * i));
|
|
1522
|
+
a !== r && (x.value = a);
|
|
1523
|
+
}
|
|
1524
|
+
function V() {
|
|
1525
|
+
!e.videoRef.value || i.value || (r.value = Math.max(0, Math.min(1, (N() - p.value) / g.value)), I());
|
|
1526
|
+
}
|
|
1527
|
+
function re() {
|
|
1528
|
+
e.mode.value === "playback" && !c && F();
|
|
1529
|
+
}
|
|
1530
|
+
function ie() {
|
|
1531
|
+
a.value = -1, s &&= (cancelAnimationFrame(s), null), c &&= (cancelAnimationFrame(c), null), i.value = !1, l = !1, r.value = 0, x.value = g.value, C.value = p.value, m(I);
|
|
1532
|
+
}
|
|
1533
|
+
return y(() => {
|
|
1534
|
+
document.addEventListener("mousemove", z), document.addEventListener("mouseup", B), d = new MutationObserver(() => {
|
|
1535
|
+
o.value++, m(I);
|
|
1536
|
+
}), d.observe(document.documentElement, {
|
|
1537
|
+
attributeFilter: [
|
|
1538
|
+
"class",
|
|
1539
|
+
"data-ctc-theme",
|
|
1540
|
+
"data-ctc-theme-mode",
|
|
1541
|
+
"style"
|
|
1542
|
+
],
|
|
1543
|
+
attributes: !0
|
|
1544
|
+
}), m(I);
|
|
1545
|
+
}), b(() => {
|
|
1546
|
+
document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", B), s && cancelAnimationFrame(s), c && cancelAnimationFrame(c), u?.disconnect(), d?.disconnect();
|
|
1547
|
+
}), M(n, (e) => {
|
|
1548
|
+
u?.disconnect(), !(!e || typeof ResizeObserver > "u") && (u = new ResizeObserver(() => I()), u.observe(e), m(I));
|
|
1549
|
+
}, { immediate: !0 }), M(x, () => {
|
|
1550
|
+
let e = p.value + r.value * g.value, t = x.value;
|
|
1551
|
+
C.value = Math.max(p.value, Math.min(h.value - t, e - t / 2)), m(I);
|
|
1552
|
+
}), M(f, (e) => {
|
|
1553
|
+
x.value = Math.max(.1, e.end - e.start), C.value = e.start, m(I);
|
|
1554
|
+
}), M(C, () => m(I)), M(e.mode, () => {
|
|
1555
|
+
e.mode.value === "playback" && m(I);
|
|
1556
|
+
}), {
|
|
1557
|
+
cursorPercent: r,
|
|
1558
|
+
cursorTimeText: k,
|
|
1559
|
+
currentAlarms: j,
|
|
1560
|
+
drawTimeline: I,
|
|
1561
|
+
onCanvasMouseLeave: te,
|
|
1562
|
+
onCanvasMouseMove: ee,
|
|
1563
|
+
onTimelineMouseDown: R,
|
|
1564
|
+
onTimelineWheel: ne,
|
|
1565
|
+
onVideoTimeUpdate: V,
|
|
1566
|
+
resetTimeline: ie,
|
|
1567
|
+
startSync: re,
|
|
1568
|
+
timelineCanvas: n
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1571
|
+
//#endregion
|
|
1572
|
+
//#region src/components/video/src/VideoChannelNav.vue?vue&type=script&setup=true&lang.ts
|
|
1573
|
+
var ft = { class: "ctc-video__sidebar" }, pt = { class: "ctc-video__sidebar-toolbar" }, mt = ["onClick"], ht = { class: "ctc-video__channel-label" }, gt = {
|
|
1574
|
+
key: 0,
|
|
1575
|
+
class: "ctc-video__empty"
|
|
1576
|
+
}, _t = /* @__PURE__ */ l({
|
|
1577
|
+
name: "CtcVideoChannelNav",
|
|
1578
|
+
__name: "VideoChannelNav",
|
|
1579
|
+
props: {
|
|
1580
|
+
activeChannel: {},
|
|
1581
|
+
channels: {},
|
|
1582
|
+
emptyText: {},
|
|
1583
|
+
tree: {}
|
|
1584
|
+
},
|
|
1585
|
+
emits: ["select", "toggle-collapsed"],
|
|
1586
|
+
setup(o, { expose: s, emit: l }) {
|
|
1587
|
+
let u = o, d = l, f = S(""), p = S(/* @__PURE__ */ new Set());
|
|
1588
|
+
function m(e, t = /* @__PURE__ */ new Set()) {
|
|
1589
|
+
for (let n of e) n.children?.length && (t.add(n.key), m(n.children, t));
|
|
1590
|
+
return t;
|
|
1591
|
+
}
|
|
1592
|
+
M(() => u.tree, (e) => {
|
|
1593
|
+
p.value = e?.length ? m(e) : /* @__PURE__ */ new Set();
|
|
1594
|
+
}, { immediate: !0 });
|
|
1595
|
+
let g = t(() => {
|
|
1596
|
+
let e = u.tree;
|
|
1597
|
+
if (!e?.length) return [];
|
|
1598
|
+
let t = f.value.trim().toLowerCase();
|
|
1599
|
+
if (!t) return e;
|
|
1600
|
+
function n(e) {
|
|
1601
|
+
return e.flatMap((e) => {
|
|
1602
|
+
let r = e.children ? n(e.children) : [];
|
|
1603
|
+
return e.label.toLowerCase().includes(t) || r.length > 0 ? [{
|
|
1604
|
+
...e,
|
|
1605
|
+
children: r
|
|
1606
|
+
}] : [];
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
return n(e);
|
|
1610
|
+
}), v = t(() => {
|
|
1611
|
+
if (!u.tree?.length) {
|
|
1612
|
+
let e = f.value.trim().toLowerCase();
|
|
1613
|
+
return u.channels.filter((t) => !e || t.name.toLowerCase().includes(e)).map((e) => ({
|
|
1614
|
+
channel: e,
|
|
1615
|
+
depth: 0,
|
|
1616
|
+
hasChildren: !1,
|
|
1617
|
+
key: e.id,
|
|
1618
|
+
label: e.name,
|
|
1619
|
+
online: e.online,
|
|
1620
|
+
open: !1,
|
|
1621
|
+
value: e.id
|
|
1622
|
+
}));
|
|
1623
|
+
}
|
|
1624
|
+
let e = [];
|
|
1625
|
+
function t(n, r) {
|
|
1626
|
+
for (let i of n) {
|
|
1627
|
+
let n = !!i.children?.length, a = n && p.value.has(i.key);
|
|
1628
|
+
e.push({
|
|
1629
|
+
channel: i.value ? u.channels.find((e) => e.id === i.value) : void 0,
|
|
1630
|
+
depth: r,
|
|
1631
|
+
hasChildren: n,
|
|
1632
|
+
key: i.key,
|
|
1633
|
+
label: i.label,
|
|
1634
|
+
node: i,
|
|
1635
|
+
online: i.online,
|
|
1636
|
+
open: a,
|
|
1637
|
+
value: i.value
|
|
1638
|
+
}), n && a && t(i.children, r + 1);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
return t(g.value, 0), e;
|
|
1642
|
+
});
|
|
1643
|
+
function y(e) {
|
|
1644
|
+
let t = new Set(p.value);
|
|
1645
|
+
t.has(e) ? t.delete(e) : t.add(e), p.value = t;
|
|
1646
|
+
}
|
|
1647
|
+
function b(e) {
|
|
1648
|
+
if (e.hasChildren) {
|
|
1649
|
+
y(e.key);
|
|
1650
|
+
return;
|
|
1651
|
+
}
|
|
1652
|
+
e.value && d("select", e.value);
|
|
1653
|
+
}
|
|
1654
|
+
return s({ keyword: f }), (t, o) => (x(), i("aside", ft, [a("div", pt, [c(D(z), {
|
|
1655
|
+
modelValue: f.value,
|
|
1656
|
+
"onUpdate:modelValue": o[0] ||= (e) => f.value = e,
|
|
1657
|
+
size: "small",
|
|
1658
|
+
clearable: "",
|
|
1659
|
+
placeholder: "搜索通道",
|
|
1660
|
+
class: "ctc-video__search"
|
|
1661
|
+
}, {
|
|
1662
|
+
prefix: N(() => [c(D(R), null, {
|
|
1663
|
+
default: N(() => [c(D(he))]),
|
|
1664
|
+
_: 1
|
|
1665
|
+
})]),
|
|
1666
|
+
_: 1
|
|
1667
|
+
}, 8, ["modelValue"]), a("button", {
|
|
1668
|
+
type: "button",
|
|
1669
|
+
class: "ctc-video__icon-button",
|
|
1670
|
+
title: "收起通道列表",
|
|
1671
|
+
onClick: o[1] ||= (e) => d("toggle-collapsed")
|
|
1672
|
+
}, [c(D(R), null, {
|
|
1673
|
+
default: N(() => [c(D(K))]),
|
|
1674
|
+
_: 1
|
|
1675
|
+
})])]), c(D(ee), { class: "ctc-video__sidebar-body" }, {
|
|
1676
|
+
default: N(() => [(x(!0), i(e, null, C(v.value, (e) => (x(), i("button", {
|
|
1677
|
+
key: e.key,
|
|
1678
|
+
type: "button",
|
|
1679
|
+
class: h(["ctc-video__channel", {
|
|
1680
|
+
"is-active": e.value === u.activeChannel,
|
|
1681
|
+
"is-parent": e.hasChildren
|
|
1682
|
+
}]),
|
|
1683
|
+
style: _({ paddingLeft: `calc(var(--ctc-video-space) + ${e.depth} * var(--ctc-video-tree-indent))` }),
|
|
1684
|
+
onClick: (t) => b(e)
|
|
1685
|
+
}, [w(t.$slots, "channel", {
|
|
1686
|
+
channel: e.channel,
|
|
1687
|
+
node: e.node,
|
|
1688
|
+
row: e,
|
|
1689
|
+
active: e.value === u.activeChannel,
|
|
1690
|
+
depth: e.depth,
|
|
1691
|
+
online: e.online,
|
|
1692
|
+
hasChildren: e.hasChildren
|
|
1693
|
+
}, () => [
|
|
1694
|
+
e.hasChildren ? (x(), n(D(R), {
|
|
1695
|
+
key: 0,
|
|
1696
|
+
class: "ctc-video__channel-caret"
|
|
1697
|
+
}, {
|
|
1698
|
+
default: N(() => [e.open ? (x(), n(D(W), { key: 0 })) : (x(), n(D(se), { key: 1 }))]),
|
|
1699
|
+
_: 2
|
|
1700
|
+
}, 1024)) : (x(), n(D(R), {
|
|
1701
|
+
key: 1,
|
|
1702
|
+
class: "ctc-video__channel-icon"
|
|
1703
|
+
}, {
|
|
1704
|
+
default: N(() => [c(D(ge))]),
|
|
1705
|
+
_: 1
|
|
1706
|
+
})),
|
|
1707
|
+
a("span", ht, E(e.label), 1),
|
|
1708
|
+
e.online === void 0 ? r("", !0) : (x(), i("span", {
|
|
1709
|
+
key: 2,
|
|
1710
|
+
class: h(["ctc-video__dot", { "is-online": e.online }])
|
|
1711
|
+
}, null, 2))
|
|
1712
|
+
])], 14, mt))), 128)), v.value.length === 0 ? (x(), i("div", gt, E(u.emptyText), 1)) : r("", !0)]),
|
|
1713
|
+
_: 3
|
|
1714
|
+
})]));
|
|
1715
|
+
}
|
|
1716
|
+
}), vt = { class: "ctc-video__toolbar" }, yt = {
|
|
1717
|
+
key: 0,
|
|
1718
|
+
class: "ctc-video__record-timer"
|
|
1719
|
+
}, bt = {
|
|
1720
|
+
type: "button",
|
|
1721
|
+
class: "ctc-video__tool-button ctc-video__rate-button",
|
|
1722
|
+
title: "播放速度"
|
|
1723
|
+
}, xt = ["onClick"], St = {
|
|
1724
|
+
type: "button",
|
|
1725
|
+
class: "ctc-video__tool-button",
|
|
1726
|
+
disabled: ""
|
|
1727
|
+
}, Ct = 150, wt = 5, Tt = /* @__PURE__ */ l({
|
|
1728
|
+
name: "CtcVideoToolbar",
|
|
1729
|
+
__name: "VideoToolbar",
|
|
1730
|
+
props: {
|
|
1731
|
+
channelName: {},
|
|
1732
|
+
fullscreenTarget: {},
|
|
1733
|
+
mode: {},
|
|
1734
|
+
video: {}
|
|
1735
|
+
},
|
|
1736
|
+
emits: ["notice", "reload"],
|
|
1737
|
+
setup(o, { emit: s }) {
|
|
1738
|
+
let l = o, u = s, d = [
|
|
1739
|
+
.5,
|
|
1740
|
+
1,
|
|
1741
|
+
1.5,
|
|
1742
|
+
2,
|
|
1743
|
+
4
|
|
1744
|
+
], f = S(0), p = S(50), m = S(!1), g = S(!1), _ = S(1), b = S(!1), w = S(!1), O = S(0), k = null, A = null, F = null, I = null, L = [], z = 0, B = "video/webm", ee = t(() => f.value === 0 ? fe : ce), te = t(() => {
|
|
1745
|
+
let e = Math.floor(O.value / 60);
|
|
1746
|
+
return `${String(e).padStart(2, "0")}:${String(O.value % 60).padStart(2, "0")}`;
|
|
1747
|
+
});
|
|
1748
|
+
function V(e) {
|
|
1749
|
+
u("notice", e);
|
|
1750
|
+
}
|
|
1751
|
+
function re(e) {
|
|
1752
|
+
e.volume = f.value / 100, e.muted = f.value === 0;
|
|
1753
|
+
}
|
|
1754
|
+
function ie(e) {
|
|
1755
|
+
e.playbackRate = _.value;
|
|
1756
|
+
}
|
|
1757
|
+
function ae() {
|
|
1758
|
+
k && clearTimeout(k), m.value = !0;
|
|
1759
|
+
}
|
|
1760
|
+
function oe() {
|
|
1761
|
+
k && clearTimeout(k), k = setTimeout(() => {
|
|
1762
|
+
m.value = !1, k = null;
|
|
1763
|
+
}, Ct);
|
|
1764
|
+
}
|
|
1765
|
+
function U() {
|
|
1766
|
+
f.value > 0 ? (p.value = f.value, f.value = 0) : f.value = p.value || 50;
|
|
1767
|
+
}
|
|
1768
|
+
function W() {
|
|
1769
|
+
A && clearTimeout(A), g.value = !0;
|
|
1770
|
+
}
|
|
1771
|
+
function se() {
|
|
1772
|
+
A && clearTimeout(A), A = setTimeout(() => {
|
|
1773
|
+
g.value = !1, A = null;
|
|
1774
|
+
}, Ct);
|
|
1775
|
+
}
|
|
1776
|
+
function G(e) {
|
|
1777
|
+
_.value = e, g.value = !1, l.video && ie(l.video);
|
|
1778
|
+
}
|
|
1779
|
+
function K(e, t) {
|
|
1780
|
+
let n = l.channelName || "视频", r = (/* @__PURE__ */ new Date()).toISOString().replace(/[.:]/g, "-"), i = URL.createObjectURL(e), a = document.createElement("a");
|
|
1781
|
+
a.href = i, a.download = `${n}_${r}.${t}`, a.click(), URL.revokeObjectURL(i);
|
|
1782
|
+
}
|
|
1783
|
+
function ue() {
|
|
1784
|
+
let e = l.video;
|
|
1785
|
+
if (!e?.videoWidth) {
|
|
1786
|
+
V("视频未加载,无法截屏");
|
|
1787
|
+
return;
|
|
1788
|
+
}
|
|
1789
|
+
try {
|
|
1790
|
+
let t = document.createElement("canvas");
|
|
1791
|
+
t.width = e.videoWidth, t.height = e.videoHeight, t.getContext("2d")?.drawImage(e, 0, 0, t.width, t.height), t.toBlob((e) => {
|
|
1792
|
+
e ? K(e, "png") : V("截屏失败");
|
|
1793
|
+
}, "image/png");
|
|
1794
|
+
} catch {
|
|
1795
|
+
V("截屏失败");
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
function de() {
|
|
1799
|
+
return [
|
|
1800
|
+
"video/mp4;codecs=avc1",
|
|
1801
|
+
"video/mp4;codecs=h264",
|
|
1802
|
+
"video/mp4",
|
|
1803
|
+
"video/webm;codecs=vp9",
|
|
1804
|
+
"video/webm;codecs=vp8",
|
|
1805
|
+
"video/webm"
|
|
1806
|
+
].find((e) => MediaRecorder.isTypeSupported?.(e)) ?? "video/webm";
|
|
1807
|
+
}
|
|
1808
|
+
function he() {
|
|
1809
|
+
let e = l.video, t = e?.captureStream?.bind(e);
|
|
1810
|
+
if (!e || !t || typeof MediaRecorder > "u") {
|
|
1811
|
+
V("当前浏览器不支持录屏");
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
try {
|
|
1815
|
+
L = [], B = de(), I = new MediaRecorder(t(), { mimeType: B }), I.addEventListener("dataavailable", (e) => {
|
|
1816
|
+
e.data.size > 0 && L.push(e.data);
|
|
1817
|
+
}), I.addEventListener("stop", () => {
|
|
1818
|
+
if (Date.now() - z < wt * 1e3) V(`录制时长不足 ${wt} 秒,已取消保存`);
|
|
1819
|
+
else if (L.length > 0) {
|
|
1820
|
+
let e = B.startsWith("video/mp4") ? "mp4" : "webm";
|
|
1821
|
+
K(new Blob(L, { type: B }), e);
|
|
1822
|
+
}
|
|
1823
|
+
L = [], I = null;
|
|
1824
|
+
}), I.start(), z = Date.now(), O.value = 0, F = setInterval(() => {
|
|
1825
|
+
O.value = Math.floor((Date.now() - z) / 1e3);
|
|
1826
|
+
}, 1e3), w.value = !0;
|
|
1827
|
+
} catch {
|
|
1828
|
+
V("录屏启动失败");
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
function ve() {
|
|
1832
|
+
I?.stop(), w.value = !1, F &&= (clearInterval(F), null);
|
|
1833
|
+
}
|
|
1834
|
+
function ye() {
|
|
1835
|
+
w.value ? ve() : he();
|
|
1836
|
+
}
|
|
1837
|
+
function be() {
|
|
1838
|
+
b.value = document.fullscreenElement === l.fullscreenTarget;
|
|
1839
|
+
}
|
|
1840
|
+
function xe() {
|
|
1841
|
+
let e = l.fullscreenTarget ?? l.video?.parentElement;
|
|
1842
|
+
e && (document.fullscreenElement ? document.exitFullscreen() : e.requestFullscreen());
|
|
1843
|
+
}
|
|
1844
|
+
return M(f, () => {
|
|
1845
|
+
l.video && re(l.video);
|
|
1846
|
+
}), M(() => l.video, (e) => {
|
|
1847
|
+
e && (re(e), ie(e));
|
|
1848
|
+
}, { immediate: !0 }), M(() => l.channelName, () => {
|
|
1849
|
+
_.value = 1, l.video && ie(l.video), w.value && ve();
|
|
1850
|
+
}), y(() => {
|
|
1851
|
+
document.addEventListener("fullscreenchange", be);
|
|
1852
|
+
}), v(() => {
|
|
1853
|
+
document.removeEventListener("fullscreenchange", be), w.value && ve(), k && clearTimeout(k), A && clearTimeout(A);
|
|
1854
|
+
}), (t, s) => (x(), i("div", vt, [
|
|
1855
|
+
a("div", {
|
|
1856
|
+
class: "ctc-video__tool",
|
|
1857
|
+
onMouseenter: ae,
|
|
1858
|
+
onMouseleave: oe
|
|
1859
|
+
}, [c(D(H), {
|
|
1860
|
+
content: f.value === 0 ? "取消静音" : "静音",
|
|
1861
|
+
placement: "top",
|
|
1862
|
+
"show-arrow": !1,
|
|
1863
|
+
teleported: !1,
|
|
1864
|
+
disabled: m.value
|
|
1865
|
+
}, {
|
|
1866
|
+
default: N(() => [a("button", {
|
|
1867
|
+
type: "button",
|
|
1868
|
+
class: "ctc-video__tool-button",
|
|
1869
|
+
onClick: U
|
|
1870
|
+
}, [c(D(R), null, {
|
|
1871
|
+
default: N(() => [(x(), n(T(ee.value)))]),
|
|
1872
|
+
_: 1
|
|
1873
|
+
})])]),
|
|
1874
|
+
_: 1
|
|
1875
|
+
}, 8, ["content", "disabled"]), P(a("div", {
|
|
1876
|
+
class: "ctc-video__popup",
|
|
1877
|
+
onMouseenter: ae,
|
|
1878
|
+
onMouseleave: oe
|
|
1879
|
+
}, [c(D(ne), {
|
|
1880
|
+
modelValue: f.value,
|
|
1881
|
+
"onUpdate:modelValue": s[0] ||= (e) => f.value = e,
|
|
1882
|
+
vertical: "",
|
|
1883
|
+
height: "80px",
|
|
1884
|
+
"show-tooltip": !1
|
|
1885
|
+
}, null, 8, ["modelValue"])], 544), [[j, m.value]])], 32),
|
|
1886
|
+
c(D(H), {
|
|
1887
|
+
content: "截屏",
|
|
1888
|
+
placement: "top",
|
|
1889
|
+
"show-arrow": !1,
|
|
1890
|
+
teleported: !1
|
|
1891
|
+
}, {
|
|
1892
|
+
default: N(() => [a("button", {
|
|
1893
|
+
type: "button",
|
|
1894
|
+
class: "ctc-video__tool-button",
|
|
1895
|
+
onClick: ue
|
|
1896
|
+
}, [c(D(R), null, {
|
|
1897
|
+
default: N(() => [c(D(le))]),
|
|
1898
|
+
_: 1
|
|
1899
|
+
})])]),
|
|
1900
|
+
_: 1
|
|
1901
|
+
}),
|
|
1902
|
+
c(D(H), {
|
|
1903
|
+
content: w.value ? "停止录屏" : "录屏",
|
|
1904
|
+
placement: "top",
|
|
1905
|
+
"show-arrow": !1,
|
|
1906
|
+
teleported: !1
|
|
1907
|
+
}, {
|
|
1908
|
+
default: N(() => [a("button", {
|
|
1909
|
+
type: "button",
|
|
1910
|
+
class: h(["ctc-video__tool-button", { "is-recording": w.value }]),
|
|
1911
|
+
onClick: ye
|
|
1912
|
+
}, [c(D(R), null, {
|
|
1913
|
+
default: N(() => [w.value ? (x(), n(D(_e), { key: 0 })) : (x(), n(D(ge), { key: 1 }))]),
|
|
1914
|
+
_: 1
|
|
1915
|
+
})], 2)]),
|
|
1916
|
+
_: 1
|
|
1917
|
+
}, 8, ["content"]),
|
|
1918
|
+
w.value ? (x(), i("span", yt, E(te.value), 1)) : r("", !0),
|
|
1919
|
+
o.mode === "playback" ? (x(), i("div", {
|
|
1920
|
+
key: 1,
|
|
1921
|
+
class: "ctc-video__tool",
|
|
1922
|
+
onMouseenter: W,
|
|
1923
|
+
onMouseleave: se
|
|
1924
|
+
}, [a("button", bt, E(_.value) + "x ", 1), P(a("div", {
|
|
1925
|
+
class: "ctc-video__popup ctc-video__rate-popup",
|
|
1926
|
+
onMouseenter: W,
|
|
1927
|
+
onMouseleave: se
|
|
1928
|
+
}, [(x(), i(e, null, C(d, (e) => a("button", {
|
|
1929
|
+
key: e,
|
|
1930
|
+
type: "button",
|
|
1931
|
+
class: h(["ctc-video__rate-option", { "is-active": e === _.value }]),
|
|
1932
|
+
onClick: (t) => G(e)
|
|
1933
|
+
}, E(e) + "x ", 11, xt)), 64))], 544), [[j, g.value]])], 32)) : r("", !0),
|
|
1934
|
+
o.mode === "live" ? (x(), n(D(H), {
|
|
1935
|
+
key: 2,
|
|
1936
|
+
content: "语音喊话(暂未开放)",
|
|
1937
|
+
placement: "top",
|
|
1938
|
+
"show-arrow": !1,
|
|
1939
|
+
teleported: !1
|
|
1940
|
+
}, {
|
|
1941
|
+
default: N(() => [a("button", St, [c(D(R), null, {
|
|
1942
|
+
default: N(() => [c(D(pe))]),
|
|
1943
|
+
_: 1
|
|
1944
|
+
})])]),
|
|
1945
|
+
_: 1
|
|
1946
|
+
})) : r("", !0),
|
|
1947
|
+
c(D(H), {
|
|
1948
|
+
content: b.value ? "退出全屏" : "全屏",
|
|
1949
|
+
placement: "top",
|
|
1950
|
+
"show-arrow": !1,
|
|
1951
|
+
teleported: !1
|
|
1952
|
+
}, {
|
|
1953
|
+
default: N(() => [a("button", {
|
|
1954
|
+
type: "button",
|
|
1955
|
+
class: "ctc-video__tool-button",
|
|
1956
|
+
onClick: xe
|
|
1957
|
+
}, [c(D(R), null, {
|
|
1958
|
+
default: N(() => [c(D(q))]),
|
|
1959
|
+
_: 1
|
|
1960
|
+
})])]),
|
|
1961
|
+
_: 1
|
|
1962
|
+
}, 8, ["content"]),
|
|
1963
|
+
c(D(H), {
|
|
1964
|
+
content: "刷新",
|
|
1965
|
+
placement: "top",
|
|
1966
|
+
"show-arrow": !1,
|
|
1967
|
+
teleported: !1
|
|
1968
|
+
}, {
|
|
1969
|
+
default: N(() => [a("button", {
|
|
1970
|
+
type: "button",
|
|
1971
|
+
class: "ctc-video__tool-button",
|
|
1972
|
+
onClick: s[1] ||= (e) => u("reload")
|
|
1973
|
+
}, [c(D(R), null, {
|
|
1974
|
+
default: N(() => [c(D(me))]),
|
|
1975
|
+
_: 1
|
|
1976
|
+
})])]),
|
|
1977
|
+
_: 1
|
|
1978
|
+
})
|
|
1979
|
+
]));
|
|
1980
|
+
}
|
|
1981
|
+
}), Et = {
|
|
1982
|
+
key: 0,
|
|
1983
|
+
class: "ctc-video__header"
|
|
1984
|
+
}, Dt = { class: "ctc-video__header-title" }, Ot = {
|
|
1985
|
+
key: 2,
|
|
1986
|
+
class: "ctc-video__header-name"
|
|
1987
|
+
}, kt = {
|
|
1988
|
+
key: 2,
|
|
1989
|
+
class: "ctc-video__meta"
|
|
1990
|
+
}, At = { class: "ctc-video__meta-label" }, jt = ["title"], Mt = { class: "ctc-video__header-extra" }, Nt = { class: "ctc-video__body" }, Pt = { class: "ctc-video__stage" }, Ft = { class: "ctc-video__screen" }, It = [
|
|
1991
|
+
"autoplay",
|
|
1992
|
+
"loop",
|
|
1993
|
+
"muted"
|
|
1994
|
+
], Lt = {
|
|
1995
|
+
key: 0,
|
|
1996
|
+
class: "ctc-video__overlay"
|
|
1997
|
+
}, Rt = {
|
|
1998
|
+
key: 1,
|
|
1999
|
+
class: "ctc-video__hint"
|
|
2000
|
+
}, zt = {
|
|
2001
|
+
key: 2,
|
|
2002
|
+
class: "ctc-video__rec"
|
|
2003
|
+
}, Bt = {
|
|
2004
|
+
key: 3,
|
|
2005
|
+
class: "ctc-video__stage-tip"
|
|
2006
|
+
}, Vt = { class: "ctc-video__stage-empty" }, Ht = 640, Ut = 480, Wt = /* @__PURE__ */ l({
|
|
2007
|
+
name: "CtcVideoPlayer",
|
|
2008
|
+
__name: "index",
|
|
2009
|
+
props: {
|
|
2010
|
+
activeChannel: { default: "" },
|
|
2011
|
+
alwaysShowSidebar: {
|
|
2012
|
+
type: Boolean,
|
|
2013
|
+
default: !1
|
|
2014
|
+
},
|
|
2015
|
+
alarms: { default: () => [] },
|
|
2016
|
+
beginTime: { default: "" },
|
|
2017
|
+
channels: { default: () => [] },
|
|
2018
|
+
compact: {
|
|
2019
|
+
type: Boolean,
|
|
2020
|
+
default: !1
|
|
2021
|
+
},
|
|
2022
|
+
emptyText: { default: "暂无视频通道" },
|
|
2023
|
+
endTime: { default: "" },
|
|
2024
|
+
headerFields: { default: () => [
|
|
2025
|
+
"outlet",
|
|
2026
|
+
"mp",
|
|
2027
|
+
"channel",
|
|
2028
|
+
"location"
|
|
2029
|
+
] },
|
|
2030
|
+
mode: { default: "live" },
|
|
2031
|
+
showHeader: {
|
|
2032
|
+
type: Boolean,
|
|
2033
|
+
default: !1
|
|
2034
|
+
},
|
|
2035
|
+
showModeSwitch: {
|
|
2036
|
+
type: Boolean,
|
|
2037
|
+
default: !1
|
|
2038
|
+
},
|
|
2039
|
+
showSidebar: {
|
|
2040
|
+
type: Boolean,
|
|
2041
|
+
default: !0
|
|
2042
|
+
},
|
|
2043
|
+
showTimeline: {
|
|
2044
|
+
type: Boolean,
|
|
2045
|
+
default: !0
|
|
2046
|
+
},
|
|
2047
|
+
showToolbar: {
|
|
2048
|
+
type: Boolean,
|
|
2049
|
+
default: !0
|
|
2050
|
+
},
|
|
2051
|
+
source: {},
|
|
2052
|
+
timelineZoomModifier: { default: "none" },
|
|
2053
|
+
tree: {}
|
|
2054
|
+
},
|
|
2055
|
+
emits: [
|
|
2056
|
+
"update:activeChannel",
|
|
2057
|
+
"update:beginTime",
|
|
2058
|
+
"update:endTime",
|
|
2059
|
+
"update:mode",
|
|
2060
|
+
"channel-change",
|
|
2061
|
+
"playback-ended",
|
|
2062
|
+
"seek",
|
|
2063
|
+
"source-error"
|
|
2064
|
+
],
|
|
2065
|
+
setup(l, { expose: d, emit: f }) {
|
|
2066
|
+
let p = l, _ = f, b = k(), T = S(p.activeChannel);
|
|
2067
|
+
M(() => p.activeChannel, (e) => {
|
|
2068
|
+
e !== T.value && (T.value = e);
|
|
2069
|
+
}), M(T, (e) => _("update:activeChannel", e)), M(() => p.channels, (e) => {
|
|
2070
|
+
e.length && (e.some((e) => e.id === T.value) || (T.value = e[0].id));
|
|
2071
|
+
}, { immediate: !0 });
|
|
2072
|
+
let O = t(() => p.channels.find((e) => e.id === T.value));
|
|
2073
|
+
M(O, (e) => _("channel-change", e));
|
|
2074
|
+
let A = S(p.mode);
|
|
2075
|
+
M(() => p.mode, (e) => {
|
|
2076
|
+
e !== A.value && (A.value = e);
|
|
2077
|
+
}), M(A, (e) => _("update:mode", e));
|
|
2078
|
+
let j = [{
|
|
2079
|
+
label: "实时监控",
|
|
2080
|
+
value: "live"
|
|
2081
|
+
}, {
|
|
2082
|
+
label: "历史回放",
|
|
2083
|
+
value: "playback"
|
|
2084
|
+
}], P = t({
|
|
2085
|
+
get: () => A.value,
|
|
2086
|
+
set: (e) => {
|
|
2087
|
+
A.value = e === "playback" ? "playback" : "live";
|
|
2088
|
+
}
|
|
2089
|
+
}), I = S(p.beginTime || (p.showModeSwitch ? Qe() : "")), L = S(p.endTime || (p.showModeSwitch ? Ze(/* @__PURE__ */ new Date()) : ""));
|
|
2090
|
+
M([() => p.beginTime, () => p.endTime], ([e, t]) => {
|
|
2091
|
+
I.value = e, L.value = t;
|
|
2092
|
+
}), M(I, (e) => _("update:beginTime", e)), M(L, (e) => _("update:endTime", e));
|
|
2093
|
+
let z = t({
|
|
2094
|
+
get: () => I.value && L.value ? [I.value.slice(0, 10), L.value.slice(0, 10)] : null,
|
|
2095
|
+
set: (e) => {
|
|
2096
|
+
e && (I.value = `${e[0]} 00:00:00`, L.value = `${e[1]} 23:59:59`);
|
|
2097
|
+
}
|
|
2098
|
+
});
|
|
2099
|
+
function B(e) {
|
|
2100
|
+
let t = null;
|
|
2101
|
+
return e instanceof Date ? t = e : typeof e?.toDate == "function" && (t = e.toDate()), t && !Number.isNaN(t.getTime()) ? t : null;
|
|
2102
|
+
}
|
|
2103
|
+
function ee(e) {
|
|
2104
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate()).getTime();
|
|
2105
|
+
}
|
|
2106
|
+
function ne(e) {
|
|
2107
|
+
let t = B(e);
|
|
2108
|
+
return t ? ee(t) > ee(/* @__PURE__ */ new Date()) : !1;
|
|
2109
|
+
}
|
|
2110
|
+
let V = {
|
|
2111
|
+
channel: "通道",
|
|
2112
|
+
location: "位置",
|
|
2113
|
+
mp: "监测点",
|
|
2114
|
+
outlet: "排放口"
|
|
2115
|
+
}, re = t(() => p.headerFields.flatMap((e) => {
|
|
2116
|
+
let t = O.value, n = e === "channel" ? t?.name : e === "location" ? t?.location : e === "mp" ? t?.mpName : t?.outletName;
|
|
2117
|
+
return n ? [{
|
|
2118
|
+
label: V[e],
|
|
2119
|
+
value: n
|
|
2120
|
+
}] : [];
|
|
2121
|
+
})), H = t(() => p.showModeSwitch && p.channels.length > 0), ae = t(() => p.showHeader || H.value || !!b.title || !!b.extra || !!b.header), oe = t(() => p.showSidebar && (p.channels.length > 1 || p.alwaysShowSidebar || !!p.tree?.length)), U = S(!1), W = S(!1), ce = t(() => oe.value && !U.value), le = !1, G = 0, K = 0, q = null;
|
|
2122
|
+
function de() {
|
|
2123
|
+
U.value = !0;
|
|
2124
|
+
}
|
|
2125
|
+
function fe() {
|
|
2126
|
+
if (!G || !K) return;
|
|
2127
|
+
let e = K < Ht || G < Ut;
|
|
2128
|
+
e !== W.value && (W.value = e, e ? U.value ||= (le = !0, !0) : le && (le = !1, U.value = !1));
|
|
2129
|
+
}
|
|
2130
|
+
function pe() {
|
|
2131
|
+
K = window.innerWidth, fe();
|
|
2132
|
+
}
|
|
2133
|
+
let me = S({
|
|
2134
|
+
start: Q(I.value || "00:00"),
|
|
2135
|
+
end: Q(L.value || "24:00")
|
|
2136
|
+
});
|
|
2137
|
+
M([I, L], () => {
|
|
2138
|
+
me.value = {
|
|
2139
|
+
start: Q(I.value || "00:00"),
|
|
2140
|
+
end: Q(L.value || "24:00")
|
|
2141
|
+
};
|
|
2142
|
+
});
|
|
2143
|
+
let { cursorHour: he, error: _e, errorText: be, isSeekReload: xe, loading: J, onEnded: Se, onPause: Ce, onPlay: we, onPlaying: Te, reload: Ee, seekTo: De, togglePause: Oe, videoEl: ke } = lt({
|
|
2144
|
+
beginTime: () => I.value,
|
|
2145
|
+
channel: () => O.value,
|
|
2146
|
+
endTime: () => L.value,
|
|
2147
|
+
mode: () => A.value,
|
|
2148
|
+
onError: (e) => _("source-error", e),
|
|
2149
|
+
onPlaybackEnded: (e) => _("playback-ended", e),
|
|
2150
|
+
source: () => p.source
|
|
2151
|
+
}), Ae = S();
|
|
2152
|
+
function je() {
|
|
2153
|
+
let e = Ae.value, t = ke.value;
|
|
2154
|
+
if (e) {
|
|
2155
|
+
if (!t?.videoWidth) {
|
|
2156
|
+
e.width = 0, e.height = 0;
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
2159
|
+
e.width = t.videoWidth, e.height = t.videoHeight, e.getContext("2d")?.drawImage(t, 0, 0, e.width, e.height);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
function Me(e) {
|
|
2163
|
+
je(), De(e), _("seek", {
|
|
2164
|
+
hour: e,
|
|
2165
|
+
beginTime: nt(I.value || "00:00", e)
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
let { drawTimeline: Ne, onCanvasMouseLeave: Pe, onCanvasMouseMove: Y, onTimelineMouseDown: Fe, onTimelineWheel: Ie, onVideoTimeUpdate: Le, resetTimeline: Re, startSync: ze, timelineCanvas: Be } = dt({
|
|
2169
|
+
alarms: t(() => p.alarms),
|
|
2170
|
+
axisRange: me,
|
|
2171
|
+
availableEndHour: rt,
|
|
2172
|
+
getCursorHour: he,
|
|
2173
|
+
mode: A,
|
|
2174
|
+
onSeekHour: Me,
|
|
2175
|
+
videoRef: ke,
|
|
2176
|
+
zoomModifier: () => p.timelineZoomModifier
|
|
2177
|
+
});
|
|
2178
|
+
M([T, A], () => {
|
|
2179
|
+
Re(), m(Ne);
|
|
2180
|
+
}), M(Be, (e) => {
|
|
2181
|
+
e && m(Ne);
|
|
2182
|
+
});
|
|
2183
|
+
let Ve = t(() => be.value || (A.value === "playback" ? "该时段无录像" : "视频加载失败,请切换其他通道")), He = S(""), Ue = null;
|
|
2184
|
+
function We(e) {
|
|
2185
|
+
He.value = e, Ue && clearTimeout(Ue), Ue = setTimeout(() => {
|
|
2186
|
+
He.value = "", Ue = null;
|
|
2187
|
+
}, 2e3);
|
|
2188
|
+
}
|
|
2189
|
+
let X = S(), Ge = /* @__PURE__ */ new Set([
|
|
2190
|
+
"A",
|
|
2191
|
+
"BUTTON",
|
|
2192
|
+
"INPUT",
|
|
2193
|
+
"SELECT",
|
|
2194
|
+
"TEXTAREA"
|
|
2195
|
+
]);
|
|
2196
|
+
function Ke(e) {
|
|
2197
|
+
if (e.code !== "Space" || e.repeat || A.value !== "playback" || J.value || _e.value) return;
|
|
2198
|
+
let t = e.target;
|
|
2199
|
+
t?.tagName && (t.isContentEditable || Ge.has(t.tagName) || X.value?.getClientRects().length && (e.preventDefault(), Oe()));
|
|
2200
|
+
}
|
|
2201
|
+
function qe() {
|
|
2202
|
+
we(), A.value === "playback" && ze();
|
|
2203
|
+
}
|
|
2204
|
+
function Je() {
|
|
2205
|
+
Te(), A.value === "playback" && m(ze);
|
|
2206
|
+
}
|
|
2207
|
+
function Ye() {
|
|
2208
|
+
A.value !== "playback" || J.value || _e.value || Oe();
|
|
2209
|
+
}
|
|
2210
|
+
function Xe(e) {
|
|
2211
|
+
p.channels.some((t) => t.id === e) && (T.value = e), W.value && de();
|
|
2212
|
+
}
|
|
2213
|
+
return y(() => {
|
|
2214
|
+
document.addEventListener("keydown", Ke);
|
|
2215
|
+
let e = X.value;
|
|
2216
|
+
e && (K = window.innerWidth, G = e.clientWidth, fe(), window.addEventListener("resize", pe), !(typeof ResizeObserver > "u") && (q = new ResizeObserver((t) => {
|
|
2217
|
+
G = t[0]?.contentRect.width ?? e.clientWidth, fe();
|
|
2218
|
+
}), q.observe(e)));
|
|
2219
|
+
}), v(() => {
|
|
2220
|
+
document.removeEventListener("keydown", Ke), window.removeEventListener("resize", pe), Ue && clearTimeout(Ue), q?.disconnect(), q = null;
|
|
2221
|
+
}), d({
|
|
2222
|
+
reload: Ee,
|
|
2223
|
+
seek: Me,
|
|
2224
|
+
videoRef: ke
|
|
2225
|
+
}), (t, l) => (x(), i("div", { class: h(["ctc-video", {
|
|
2226
|
+
"is-compact": p.compact,
|
|
2227
|
+
"is-narrow": W.value
|
|
2228
|
+
}]) }, [a("div", {
|
|
2229
|
+
ref_key: "panelRef",
|
|
2230
|
+
ref: X,
|
|
2231
|
+
class: "ctc-video__panel"
|
|
2232
|
+
}, [ae.value ? (x(), i("div", Et, [D(b).header ? w(t.$slots, "header", {
|
|
2233
|
+
channel: O.value,
|
|
2234
|
+
mode: A.value
|
|
2235
|
+
}, void 0, void 0, 0) : (x(), i(e, { key: 1 }, [
|
|
2236
|
+
a("div", Dt, [w(t.$slots, "title", {}, () => [A.value === "playback" ? (x(), n(D(ie), {
|
|
2237
|
+
key: 0,
|
|
2238
|
+
type: "primary",
|
|
2239
|
+
size: "small",
|
|
2240
|
+
effect: "plain",
|
|
2241
|
+
"disable-transitions": ""
|
|
2242
|
+
}, {
|
|
2243
|
+
default: N(() => [...l[11] ||= [s(" 回放 ", -1)]]),
|
|
2244
|
+
_: 1
|
|
2245
|
+
})) : O.value ? (x(), n(D(ie), {
|
|
2246
|
+
key: 1,
|
|
2247
|
+
type: O.value.online ? "success" : "danger",
|
|
2248
|
+
size: "small",
|
|
2249
|
+
effect: "plain",
|
|
2250
|
+
"disable-transitions": ""
|
|
2251
|
+
}, {
|
|
2252
|
+
default: N(() => [s(E(O.value.online ? "在线" : "离线"), 1)]),
|
|
2253
|
+
_: 1
|
|
2254
|
+
}, 8, ["type"])) : r("", !0), O.value ? (x(), i("span", Ot, E(O.value.name), 1)) : r("", !0)])]),
|
|
2255
|
+
H.value ? (x(), n(D(te), {
|
|
2256
|
+
key: 0,
|
|
2257
|
+
modelValue: P.value,
|
|
2258
|
+
"onUpdate:modelValue": l[0] ||= (e) => P.value = e,
|
|
2259
|
+
options: j,
|
|
2260
|
+
size: "small",
|
|
2261
|
+
class: "ctc-video__mode-switch"
|
|
2262
|
+
}, null, 8, ["modelValue"])) : r("", !0),
|
|
2263
|
+
H.value && A.value === "playback" ? (x(), n(D(F), {
|
|
2264
|
+
key: 1,
|
|
2265
|
+
modelValue: z.value,
|
|
2266
|
+
"onUpdate:modelValue": l[1] ||= (e) => z.value = e,
|
|
2267
|
+
type: "daterange",
|
|
2268
|
+
size: "small",
|
|
2269
|
+
"value-format": "YYYY-MM-DD",
|
|
2270
|
+
"range-separator": "至",
|
|
2271
|
+
"start-placeholder": "开始日期",
|
|
2272
|
+
"end-placeholder": "结束日期",
|
|
2273
|
+
clearable: !1,
|
|
2274
|
+
"disabled-date": ne,
|
|
2275
|
+
class: "ctc-video__range"
|
|
2276
|
+
}, null, 8, ["modelValue"])) : r("", !0),
|
|
2277
|
+
re.value.length > 0 ? (x(), i("div", kt, [(x(!0), i(e, null, C(re.value, (e) => (x(), i("span", {
|
|
2278
|
+
key: e.label,
|
|
2279
|
+
class: "ctc-video__meta-item"
|
|
2280
|
+
}, [a("span", At, E(e.label) + ":", 1), a("span", {
|
|
2281
|
+
class: "ctc-video__meta-value",
|
|
2282
|
+
title: e.value
|
|
2283
|
+
}, E(e.value), 9, jt)]))), 128))])) : r("", !0),
|
|
2284
|
+
a("div", Mt, [w(t.$slots, "extra")])
|
|
2285
|
+
], 64))])) : r("", !0), a("div", Nt, [
|
|
2286
|
+
W.value && ce.value ? (x(), i("div", {
|
|
2287
|
+
key: 0,
|
|
2288
|
+
class: "ctc-video__sidebar-backdrop",
|
|
2289
|
+
onClick: de
|
|
2290
|
+
})) : r("", !0),
|
|
2291
|
+
oe.value && !U.value ? (x(), n(_t, {
|
|
2292
|
+
key: 1,
|
|
2293
|
+
"active-channel": T.value,
|
|
2294
|
+
channels: p.channels,
|
|
2295
|
+
"empty-text": p.emptyText,
|
|
2296
|
+
tree: p.tree,
|
|
2297
|
+
onSelect: Xe,
|
|
2298
|
+
onToggleCollapsed: l[2] ||= (e) => U.value = !0
|
|
2299
|
+
}, o({ _: 2 }, [D(b).channel ? {
|
|
2300
|
+
name: "channel",
|
|
2301
|
+
fn: N((e) => [w(t.$slots, "channel", g(u(e)))]),
|
|
2302
|
+
key: "0"
|
|
2303
|
+
} : void 0]), 1032, [
|
|
2304
|
+
"active-channel",
|
|
2305
|
+
"channels",
|
|
2306
|
+
"empty-text",
|
|
2307
|
+
"tree"
|
|
2308
|
+
])) : r("", !0),
|
|
2309
|
+
a("div", Pt, [
|
|
2310
|
+
oe.value && U.value ? (x(), i("button", {
|
|
2311
|
+
key: 0,
|
|
2312
|
+
type: "button",
|
|
2313
|
+
class: "ctc-video__sidebar-reopen",
|
|
2314
|
+
title: "展开通道列表",
|
|
2315
|
+
onClick: l[3] ||= (e) => U.value = !1
|
|
2316
|
+
}, [c(D(R), null, {
|
|
2317
|
+
default: N(() => [c(D(se))]),
|
|
2318
|
+
_: 1
|
|
2319
|
+
})])) : r("", !0),
|
|
2320
|
+
a("div", Ft, [O.value ? (x(), i(e, { key: 0 }, [
|
|
2321
|
+
(x(), i("video", {
|
|
2322
|
+
ref_key: "videoEl",
|
|
2323
|
+
ref: ke,
|
|
2324
|
+
key: O.value.id,
|
|
2325
|
+
class: "ctc-video__video",
|
|
2326
|
+
autoplay: A.value !== "playback",
|
|
2327
|
+
loop: A.value !== "playback",
|
|
2328
|
+
muted: A.value !== "playback",
|
|
2329
|
+
playsinline: "",
|
|
2330
|
+
preload: "metadata",
|
|
2331
|
+
onClick: Ye,
|
|
2332
|
+
onEnded: l[4] ||= (...e) => D(Se) && D(Se)(...e),
|
|
2333
|
+
onPause: l[5] ||= (...e) => D(Ce) && D(Ce)(...e),
|
|
2334
|
+
onPlay: qe,
|
|
2335
|
+
onPlaying: Je,
|
|
2336
|
+
onTimeupdate: l[6] ||= (...e) => D(Le) && D(Le)(...e)
|
|
2337
|
+
}, null, 40, It)),
|
|
2338
|
+
a("canvas", {
|
|
2339
|
+
ref_key: "seekFrameCanvas",
|
|
2340
|
+
ref: Ae,
|
|
2341
|
+
class: h(["ctc-video__video ctc-video__seek-frame", { "is-visible": D(xe) && D(J) }])
|
|
2342
|
+
}, null, 2),
|
|
2343
|
+
D(J) ? (x(), i("div", Lt, [c(D(R), { class: "is-loading" }, {
|
|
2344
|
+
default: N(() => [c(D(ue))]),
|
|
2345
|
+
_: 1
|
|
2346
|
+
}), l[12] ||= s(" 正在加载视频... ", -1)])) : D(_e) ? (x(), i("div", Rt, [c(D(R), null, {
|
|
2347
|
+
default: N(() => [c(D(ye))]),
|
|
2348
|
+
_: 1
|
|
2349
|
+
}), s(" " + E(Ve.value), 1)])) : r("", !0),
|
|
2350
|
+
A.value === "live" && !D(J) && !D(_e) ? (x(), i("div", zt, " REC ")) : r("", !0),
|
|
2351
|
+
He.value ? (x(), i("div", Bt, E(He.value), 1)) : r("", !0),
|
|
2352
|
+
p.showToolbar && !D(J) && !D(_e) ? (x(), n(Tt, {
|
|
2353
|
+
key: 4,
|
|
2354
|
+
"channel-name": O.value.name,
|
|
2355
|
+
"fullscreen-target": X.value,
|
|
2356
|
+
mode: A.value,
|
|
2357
|
+
video: D(ke),
|
|
2358
|
+
onNotice: We,
|
|
2359
|
+
onReload: D(Ee)
|
|
2360
|
+
}, null, 8, [
|
|
2361
|
+
"channel-name",
|
|
2362
|
+
"fullscreen-target",
|
|
2363
|
+
"mode",
|
|
2364
|
+
"video",
|
|
2365
|
+
"onReload"
|
|
2366
|
+
])) : r("", !0)
|
|
2367
|
+
], 64)) : w(t.$slots, "empty", {}, () => [a("div", Vt, [c(D(R), null, {
|
|
2368
|
+
default: N(() => [A.value === "live" ? (x(), n(D(ge), { key: 0 })) : (x(), n(D(ve), { key: 1 }))]),
|
|
2369
|
+
_: 1
|
|
2370
|
+
}), a("span", null, E(p.emptyText), 1)])], void 0, 1)]),
|
|
2371
|
+
p.showTimeline && A.value === "playback" && O.value && !D(_e) && (!D(J) || D(xe)) ? (x(), i("canvas", {
|
|
2372
|
+
key: 1,
|
|
2373
|
+
ref_key: "timelineCanvas",
|
|
2374
|
+
ref: Be,
|
|
2375
|
+
class: "ctc-video__timeline",
|
|
2376
|
+
onMousedown: l[7] ||= (...e) => D(Fe) && D(Fe)(...e),
|
|
2377
|
+
onMousemove: l[8] ||= (...e) => D(Y) && D(Y)(...e),
|
|
2378
|
+
onMouseleave: l[9] ||= (...e) => D(Pe) && D(Pe)(...e),
|
|
2379
|
+
onWheel: l[10] ||= (...e) => D(Ie) && D(Ie)(...e)
|
|
2380
|
+
}, null, 544)) : r("", !0)
|
|
2381
|
+
])
|
|
2382
|
+
])], 512)], 2));
|
|
2383
|
+
}
|
|
2384
|
+
}), Gt = [
|
|
2385
|
+
De,
|
|
2386
|
+
Pe,
|
|
2387
|
+
Y,
|
|
2388
|
+
He,
|
|
2389
|
+
Xe,
|
|
2390
|
+
Wt
|
|
2391
|
+
], Kt = { install(e, t = {}) {
|
|
2392
|
+
e.provide(oe, t), Gt.forEach((t) => {
|
|
684
2393
|
e.component(t.name ?? "", t);
|
|
685
2394
|
});
|
|
686
2395
|
} };
|
|
687
2396
|
//#endregion
|
|
688
|
-
export {
|
|
2397
|
+
export { Kt as CtcComponentsUi, Kt as default, De as CtcDialog, Pe as CtcDrawer, Y as CtcFlex, Xe as CtcReport, He as CtcTable, Wt as CtcVideoPlayer };
|