xyvcard-live 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-ChiF1rpJ.mjs → add-BLsL8P1U.mjs} +189 -188
- package/dist/{index-DvelxTYe.mjs → index-4CE42QMk.mjs} +1 -1
- package/dist/{index-h7kY6d7R.mjs → index-BLDsRKaV.mjs} +239 -237
- package/dist/index-Dp2UAkIx.mjs +176 -0
- package/dist/{index-DwrSZRq5.mjs → index-RZcNAod0.mjs} +1 -1
- package/dist/{index-CF3wLv0W.mjs → index-fq7bb0vi.mjs} +425 -423
- package/dist/index.mjs +3 -2
- package/dist/{index.vue_vue_type_script_setup_true_lang-COMf6E9p.mjs → index.vue_vue_type_script_setup_true_lang-CJXGox4V.mjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-DTE6pgZK.mjs → index.vue_vue_type_script_setup_true_lang-Di2r6a4i.mjs} +1 -1
- package/dist/{info-DS6MFv2x.mjs → info-BWEoRsbx.mjs} +3 -3
- package/dist/{lives-B33Lg-af.mjs → lives-D_2sdL4L.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dts/src/index.d.ts +1 -0
- package/dts/src/router/index.d.ts +1 -0
- package/dts/src/views/live/zb-live-login/index.vue.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lives copy-DSbXR9ms.mjs +0 -286
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElMessageBox as ne, ElMessage as
|
|
3
|
-
import { fileApi as le, routerUtil as
|
|
1
|
+
import { defineComponent as de, mergeModels as oe, ref as U, useModel as fe, onUnmounted as ye, resolveComponent as V, createBlock as b, openBlock as d, withCtx as o, createVNode as n, createElementBlock as M, createCommentVNode as k, createElementVNode as h, createTextVNode as I, toDisplayString as w, getCurrentInstance as Te, reactive as re, watch as K, computed as _e, onMounted as Ve, unref as t, Fragment as Q, renderList as ee } from "vue";
|
|
2
|
+
import { ElMessageBox as ne, ElMessage as g, genFileId as ge } from "element-plus";
|
|
3
|
+
import { fileApi as le, routerUtil as se } from "jmash-core";
|
|
4
4
|
import { useRoute as ue, useRouter as he } from "vue-router";
|
|
5
|
-
import { l as F, _ as me, D as
|
|
5
|
+
import { l as F, _ as me, D as T, C as m } from "./index-fq7bb0vi.mjs";
|
|
6
6
|
import { useI18n as ve } from "vue-i18n";
|
|
7
|
-
import Ee from "./lives-
|
|
7
|
+
import Ee from "./lives-D_2sdL4L.mjs";
|
|
8
8
|
const be = { class: "el-upload__text" }, ke = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "video-preview"
|
|
11
|
-
},
|
|
11
|
+
}, Me = ["src"], Ue = { class: "dialog-footer" }, Se = /* @__PURE__ */ de({
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: /* @__PURE__ */ oe({
|
|
14
14
|
limit: {
|
|
@@ -25,18 +25,18 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
25
25
|
modelModifiers: {}
|
|
26
26
|
}),
|
|
27
27
|
emits: /* @__PURE__ */ oe(["filesResponse", "uploadFileList"], ["update:modelValue"]),
|
|
28
|
-
setup(B, { expose: ae, emit:
|
|
29
|
-
const { t:
|
|
30
|
-
let
|
|
31
|
-
const q = B, x =
|
|
32
|
-
|
|
28
|
+
setup(B, { expose: ae, emit: _ }) {
|
|
29
|
+
const { t: f } = ve(), D = ue(), $ = U(le.uploadUrl()), P = U(le.authHeader()), e = U(), L = fe(B, "modelValue"), p = U([]), y = U("");
|
|
30
|
+
let S = null;
|
|
31
|
+
const q = B, x = _, j = () => {
|
|
32
|
+
L.value = !1;
|
|
33
33
|
}, A = async (u) => {
|
|
34
34
|
if (!u || u.status !== "ready") return;
|
|
35
|
-
const v = u.raw,
|
|
36
|
-
if (!
|
|
37
|
-
ne.confirm(
|
|
38
|
-
confirmButtonText:
|
|
39
|
-
cancelButtonText:
|
|
35
|
+
const v = u.raw, E = [".mp4", ".flv", ".mov", ".avi", ".mkv"], l = v.name.toLowerCase();
|
|
36
|
+
if (!E.some((r) => l.endsWith(r))) {
|
|
37
|
+
ne.confirm(f("video.onlySupportVideo"), f("file.warning"), {
|
|
38
|
+
confirmButtonText: f("common.confirm"),
|
|
39
|
+
cancelButtonText: f("common.cancel"),
|
|
40
40
|
type: "warning"
|
|
41
41
|
}).catch(() => {
|
|
42
42
|
const r = p.value.findIndex(
|
|
@@ -49,26 +49,26 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
49
49
|
if (!(u.size / 1024 / 1024 < q.videoMaxSize))
|
|
50
50
|
return X(
|
|
51
51
|
u,
|
|
52
|
-
|
|
52
|
+
f("video.videoLtRequired", { size: q.videoMaxSize })
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
S = URL.createObjectURL(v), y.value = S;
|
|
55
55
|
}, W = async (u, v) => {
|
|
56
56
|
if (console.log("文件上传返回结果:", u, v), !u.fileSrc) {
|
|
57
|
-
|
|
57
|
+
g.error(f("video.uploadFail") || "视频上传失败,未获取到文件路径"), Y();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
62
|
-
tenant:
|
|
61
|
+
const E = {
|
|
62
|
+
tenant: D.query.tenant,
|
|
63
63
|
requestId: Math.random() * 10 + "",
|
|
64
64
|
mediaFile: u.fileSrc
|
|
65
65
|
};
|
|
66
|
-
console.log("调用liveVideoUpload参数:",
|
|
66
|
+
console.log("调用liveVideoUpload参数:", E);
|
|
67
67
|
const l = await F.liveVideoUpload(
|
|
68
|
-
|
|
68
|
+
E
|
|
69
69
|
);
|
|
70
70
|
if (console.log("liveVideoUpload接口返回:", l), !l || !l.data || !l.data.mediaUrl) {
|
|
71
|
-
|
|
71
|
+
g.error("视频上传成功,但腾讯云点播未返回播放地址"), Y();
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
const a = {
|
|
@@ -80,73 +80,73 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
80
80
|
fileName: v.name,
|
|
81
81
|
fileSize: v.size
|
|
82
82
|
};
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
g({ message: f("video.uploadSuccess"), type: "success" }), y.value = a.playUrl, S = null, x("filesResponse", a), x("uploadFileList", v), setTimeout(() => {
|
|
84
|
+
L.value = !1;
|
|
85
85
|
}, 800);
|
|
86
|
-
} catch (
|
|
87
|
-
console.error("调用liveVideoUpload接口失败:",
|
|
88
|
-
|
|
89
|
-
),
|
|
86
|
+
} catch (E) {
|
|
87
|
+
console.error("调用liveVideoUpload接口失败:", E), g.error(
|
|
88
|
+
f("video.uploadFail") || "视频文件上传成功,但同步至腾讯云点播失败,请重试"
|
|
89
|
+
), Y();
|
|
90
90
|
}
|
|
91
91
|
}, Z = (u) => {
|
|
92
|
-
|
|
92
|
+
e.value.clearFiles();
|
|
93
93
|
const v = u[0];
|
|
94
|
-
v.uid = ge(),
|
|
95
|
-
},
|
|
96
|
-
|
|
94
|
+
v.uid = ge(), e.value.handleStart(v);
|
|
95
|
+
}, R = () => {
|
|
96
|
+
Y();
|
|
97
97
|
}, C = () => {
|
|
98
|
-
|
|
98
|
+
Y(), H();
|
|
99
99
|
};
|
|
100
100
|
function z() {
|
|
101
101
|
if (p.value.length === 0) {
|
|
102
|
-
|
|
102
|
+
g.warning(f("video.pleaseSelectVideo"));
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
e.value.submit();
|
|
106
106
|
}
|
|
107
107
|
const H = () => {
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
}, X = async (u, v) => new Promise((
|
|
112
|
-
ne.confirm(v,
|
|
113
|
-
confirmButtonText:
|
|
114
|
-
cancelButtonText:
|
|
108
|
+
e.value && (e.value.clearFiles(), p.value = []);
|
|
109
|
+
}, Y = () => {
|
|
110
|
+
S && (URL.revokeObjectURL(S), y.value = "", S = null);
|
|
111
|
+
}, X = async (u, v) => new Promise((E) => {
|
|
112
|
+
ne.confirm(v, f("file.warning"), {
|
|
113
|
+
confirmButtonText: f("common.confirm"),
|
|
114
|
+
cancelButtonText: f("common.cancel"),
|
|
115
115
|
type: "warning"
|
|
116
116
|
}).then(() => {
|
|
117
|
-
|
|
117
|
+
E(!0);
|
|
118
118
|
}).catch(() => {
|
|
119
119
|
const l = p.value.findIndex(
|
|
120
120
|
(a) => a.name === u.name
|
|
121
121
|
);
|
|
122
|
-
l !== -1 && p.value.splice(l, 1),
|
|
122
|
+
l !== -1 && p.value.splice(l, 1), E(!1);
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
return ye(() => {
|
|
126
|
-
|
|
126
|
+
Y();
|
|
127
127
|
}), ae({ clearFileList: H }), (u, v) => {
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
modelValue:
|
|
131
|
-
"onUpdate:modelValue": v[1] || (v[1] = (r) =>
|
|
128
|
+
const E = V("upload-filled"), l = V("el-icon"), a = V("el-upload"), s = V("el-button"), c = V("el-dialog");
|
|
129
|
+
return d(), b(c, {
|
|
130
|
+
modelValue: L.value,
|
|
131
|
+
"onUpdate:modelValue": v[1] || (v[1] = (r) => L.value = r),
|
|
132
132
|
width: "700px",
|
|
133
133
|
"close-on-click-modal": !1,
|
|
134
134
|
onClose: C
|
|
135
135
|
}, {
|
|
136
136
|
footer: o(() => [
|
|
137
|
-
|
|
138
|
-
n(
|
|
137
|
+
h("div", Ue, [
|
|
138
|
+
n(s, { onClick: j }, {
|
|
139
139
|
default: o(() => [
|
|
140
|
-
|
|
140
|
+
I(w(u.$t("common.cancel")), 1)
|
|
141
141
|
]),
|
|
142
142
|
_: 1
|
|
143
143
|
}),
|
|
144
|
-
n(
|
|
144
|
+
n(s, {
|
|
145
145
|
type: "primary",
|
|
146
146
|
onClick: z
|
|
147
147
|
}, {
|
|
148
148
|
default: o(() => [
|
|
149
|
-
|
|
149
|
+
I(w(u.$t("common.confirm")), 1)
|
|
150
150
|
]),
|
|
151
151
|
_: 1
|
|
152
152
|
})
|
|
@@ -155,47 +155,47 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
155
155
|
default: o(() => [
|
|
156
156
|
n(a, {
|
|
157
157
|
ref_key: "uploadRef",
|
|
158
|
-
ref:
|
|
158
|
+
ref: e,
|
|
159
159
|
"file-list": p.value,
|
|
160
160
|
"onUpdate:fileList": v[0] || (v[0] = (r) => p.value = r),
|
|
161
161
|
action: $.value,
|
|
162
|
-
headers:
|
|
162
|
+
headers: P.value,
|
|
163
163
|
drag: "",
|
|
164
164
|
limit: q.limit,
|
|
165
165
|
"on-exceed": Z,
|
|
166
166
|
"auto-upload": !1,
|
|
167
167
|
"on-change": A,
|
|
168
168
|
"on-success": W,
|
|
169
|
-
"on-remove":
|
|
169
|
+
"on-remove": R,
|
|
170
170
|
accept: "video/mp4,video/flv,video/mov,video/avi,video/mkv"
|
|
171
171
|
}, {
|
|
172
172
|
tip: o(() => [...v[2] || (v[2] = [
|
|
173
|
-
|
|
173
|
+
h("div", { class: "el-upload__tip" }, " 注:可上传mp4/flv/mov/avi/mkv格式视频,图片/文档类文件不支持 ", -1)
|
|
174
174
|
])]),
|
|
175
175
|
default: o(() => [
|
|
176
176
|
n(l, { class: "el-icon--upload" }, {
|
|
177
177
|
default: o(() => [
|
|
178
|
-
n(
|
|
178
|
+
n(E)
|
|
179
179
|
]),
|
|
180
180
|
_: 1
|
|
181
181
|
}),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
h("div", be, [
|
|
183
|
+
I(w(u.$t("common.dragFiles")), 1),
|
|
184
|
+
h("em", null, w(u.$t("video.uploadEvent")), 1)
|
|
185
185
|
])
|
|
186
186
|
]),
|
|
187
187
|
_: 1
|
|
188
188
|
}, 8, ["file-list", "action", "headers", "limit"]),
|
|
189
|
-
|
|
190
|
-
v[3] || (v[3] =
|
|
191
|
-
|
|
192
|
-
src:
|
|
189
|
+
y.value ? (d(), M("div", ke, [
|
|
190
|
+
v[3] || (v[3] = h("h4", { style: { "font-size": "14px", margin: "15px 0 10px", color: "#333" } }, " 视频预览 ", -1)),
|
|
191
|
+
h("video", {
|
|
192
|
+
src: y.value,
|
|
193
193
|
controls: "",
|
|
194
194
|
width: "100%",
|
|
195
195
|
"max-height": "300px",
|
|
196
196
|
playsinline: ""
|
|
197
|
-
}, " 您的浏览器不支持视频预览 ", 8,
|
|
198
|
-
])) :
|
|
197
|
+
}, " 您的浏览器不支持视频预览 ", 8, Me)
|
|
198
|
+
])) : k("", !0)
|
|
199
199
|
]),
|
|
200
200
|
_: 1
|
|
201
201
|
}, 8, ["modelValue"]);
|
|
@@ -216,106 +216,107 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
216
216
|
}, Ne = {
|
|
217
217
|
key: 1,
|
|
218
218
|
class: "setting-status"
|
|
219
|
-
}, $e = ["src"], qe = ["src"], Ce = { class: "files-list" }, Fe = { class: "files-list" }, xe = { class: "files-list" }, ze = { class: "button-container" }, He = "https://mm.sooyie.cn/v1/file/range/", Oe = /* @__PURE__ */
|
|
219
|
+
}, $e = ["src"], qe = ["src"], Ce = { class: "files-list" }, Fe = { class: "files-list" }, xe = { class: "files-list" }, ze = { class: "button-container" }, He = "https://mm.sooyie.cn/v1/file/range/", Oe = /* @__PURE__ */ de({
|
|
220
220
|
__name: "add",
|
|
221
221
|
setup(B) {
|
|
222
|
-
|
|
222
|
+
T.liveTypeEnum.useEnumValues(), T.showModeEnum.useEnumValues(), T.replayModeEnum.useEnumValues();
|
|
223
|
+
const { proxy: ae } = Te(), { t: _ } = ve(), f = he(), D = ue(), $ = (l) => !l || l.startsWith("http://") || l.startsWith("https://") || l.startsWith(He) ? l : le.fileCompleteRangeUrl(l), P = U();
|
|
223
224
|
let e = re({
|
|
224
225
|
requestId: Math.random() * 10 + "",
|
|
225
226
|
updateMask: ""
|
|
226
227
|
});
|
|
227
|
-
const
|
|
228
|
+
const L = (l) => {
|
|
228
229
|
let a = "liveName,liveType,startTime,showMode,preStreamPic,liveStreamPic,bgPic,streamerName,liveDescprition,replayMode,playUrl";
|
|
229
230
|
return l === m.REPLAY_MODE.end && (a += ",replayEndTime"), e.liveType !== m.LIVE_TYPE.live && (a += ",endTime"), a;
|
|
230
231
|
};
|
|
231
|
-
e.updateMask =
|
|
232
|
+
e.updateMask = L(e.replayMode), K(
|
|
232
233
|
() => e.replayMode,
|
|
233
234
|
() => {
|
|
234
|
-
e.updateMask =
|
|
235
|
+
e.updateMask = L(e.replayMode);
|
|
235
236
|
}
|
|
236
237
|
);
|
|
237
|
-
const
|
|
238
|
+
const p = U(null), y = U(null), S = _e(() => D.query.copy === "true");
|
|
238
239
|
Ve(() => {
|
|
239
|
-
|
|
240
|
+
T.liveTypeEnum.values && T.liveTypeEnum.values.length > 0 && (e.liveType = T.liveTypeEnum.values[0].key), T.replayModeEnum.values && T.replayModeEnum.values.length > 0 && (e.replayMode = T.replayModeEnum.values[1].key), T.showModeEnum.values && T.showModeEnum.values.length > 0 && (e.showMode = T.showModeEnum.values[0].key), q();
|
|
240
241
|
});
|
|
241
|
-
const
|
|
242
|
-
const l =
|
|
242
|
+
const q = async () => {
|
|
243
|
+
const l = D.query.liveId;
|
|
243
244
|
if (l)
|
|
244
245
|
try {
|
|
245
246
|
const a = await F.findById({ liveId: l });
|
|
246
247
|
if (!a.data) {
|
|
247
|
-
|
|
248
|
+
g.warning("未获取到直播数据");
|
|
248
249
|
return;
|
|
249
250
|
}
|
|
250
|
-
a.data.liveType === m.LIVE_TYPE.fake_live ?
|
|
251
|
-
playUrl:
|
|
251
|
+
a.data.liveType === m.LIVE_TYPE.fake_live ? p.value = {
|
|
252
|
+
playUrl: $(a.data.playUrl),
|
|
252
253
|
totalSeconds: a.data.totalSeconds || 0
|
|
253
254
|
} : a.data.liveType === m.LIVE_TYPE.vod && (y.value = {
|
|
254
|
-
playUrl:
|
|
255
|
+
playUrl: $(a.data.playUrl)
|
|
255
256
|
});
|
|
256
|
-
const
|
|
257
|
-
if (!
|
|
258
|
-
const r = new Date(
|
|
257
|
+
const s = (c) => {
|
|
258
|
+
if (!c) return;
|
|
259
|
+
const r = new Date(c);
|
|
259
260
|
if (!(isNaN(r.getTime()) || r.getFullYear() === 1970))
|
|
260
261
|
return r.toISOString();
|
|
261
262
|
};
|
|
262
|
-
if (a.data.startTime && (e.startTime =
|
|
263
|
-
const
|
|
264
|
-
delete
|
|
263
|
+
if (a.data.startTime && (e.startTime = s(a.data.startTime)), a.data.endTime && (e.endTime = s(a.data.endTime)), a.data.replayEndTime && (e.replayEndTime = s(a.data.replayEndTime)), a.data.replayStartTime && (e.replayStartTime = s(a.data.replayStartTime)), S.value) {
|
|
264
|
+
const c = { ...a.data };
|
|
265
|
+
delete c.liveId, c.liveName = `${c.liveName}`, e.liveId = void 0, Object.assign(e, c), g.info("已加载原直播数据,当前为复制模式(创建新直播)");
|
|
265
266
|
} else
|
|
266
267
|
Object.assign(e, a.data);
|
|
267
268
|
} catch (a) {
|
|
268
|
-
console.error("获取直播详情失败:", a),
|
|
269
|
+
console.error("获取直播详情失败:", a), g.error("获取直播详情失败");
|
|
269
270
|
}
|
|
270
271
|
}, x = re({
|
|
271
272
|
liveType: [
|
|
272
273
|
{
|
|
273
274
|
required: !0,
|
|
274
|
-
message:
|
|
275
|
+
message: _("liveVideo.liveTypeRequired"),
|
|
275
276
|
trigger: "change"
|
|
276
277
|
}
|
|
277
278
|
],
|
|
278
279
|
liveName: [
|
|
279
280
|
{
|
|
280
281
|
required: !0,
|
|
281
|
-
message:
|
|
282
|
+
message: _("liveVideo.liveNameRequired"),
|
|
282
283
|
trigger: "blur"
|
|
283
284
|
}
|
|
284
285
|
],
|
|
285
286
|
startTime: [
|
|
286
287
|
{
|
|
287
288
|
required: !0,
|
|
288
|
-
message:
|
|
289
|
+
message: _("liveVideo.startTimeRequired"),
|
|
289
290
|
trigger: "change"
|
|
290
291
|
}
|
|
291
292
|
],
|
|
292
293
|
streamerName: [
|
|
293
294
|
{
|
|
294
295
|
required: !0,
|
|
295
|
-
message:
|
|
296
|
+
message: _("liveVideo.streamerNameRequired"),
|
|
296
297
|
trigger: "blur"
|
|
297
298
|
}
|
|
298
299
|
],
|
|
299
300
|
preStreamPic: [
|
|
300
301
|
{
|
|
301
302
|
required: !0,
|
|
302
|
-
message:
|
|
303
|
+
message: _("liveVideo.preStreamPicRequired"),
|
|
303
304
|
trigger: "change"
|
|
304
305
|
}
|
|
305
306
|
],
|
|
306
307
|
endTime: [
|
|
307
308
|
{
|
|
308
309
|
required: !0,
|
|
309
|
-
message:
|
|
310
|
+
message: _("liveVideo.endTimeRequired"),
|
|
310
311
|
trigger: "change"
|
|
311
312
|
},
|
|
312
313
|
{
|
|
313
|
-
validator: (l, a,
|
|
314
|
+
validator: (l, a, s) => {
|
|
314
315
|
if (e.liveType === m.LIVE_TYPE.vod && e.startTime && a) {
|
|
315
|
-
const
|
|
316
|
-
new Date(a).getTime() <=
|
|
316
|
+
const c = new Date(e.startTime).getTime();
|
|
317
|
+
new Date(a).getTime() <= c ? s(new Error("结束时间必须大于开始时间")) : s();
|
|
317
318
|
} else
|
|
318
|
-
|
|
319
|
+
s();
|
|
319
320
|
},
|
|
320
321
|
trigger: "change"
|
|
321
322
|
}
|
|
@@ -323,16 +324,16 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
323
324
|
replayEndTime: [
|
|
324
325
|
{
|
|
325
326
|
required: !0,
|
|
326
|
-
message:
|
|
327
|
+
message: _("liveVideo.replayEndTimeRequired"),
|
|
327
328
|
trigger: "change",
|
|
328
|
-
validator: (l, a,
|
|
329
|
-
e.replayMode === m.REPLAY_MODE.end && !a ?
|
|
329
|
+
validator: (l, a, s) => {
|
|
330
|
+
e.replayMode === m.REPLAY_MODE.end && !a ? s(new Error(_("liveVideo.replayEndTimeRequired"))) : s();
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
]
|
|
333
334
|
});
|
|
334
335
|
function j() {
|
|
335
|
-
|
|
336
|
+
se.closeTagView(D.fullPath, f, !1);
|
|
336
337
|
}
|
|
337
338
|
function A(l) {
|
|
338
339
|
e.preStreamPic = l.response.fileSrc;
|
|
@@ -343,27 +344,27 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
343
344
|
function Z(l) {
|
|
344
345
|
e.bgPic = l.response.fileSrc;
|
|
345
346
|
}
|
|
346
|
-
const
|
|
347
|
+
const R = U({
|
|
347
348
|
visible: !1
|
|
348
|
-
}), C =
|
|
349
|
+
}), C = U(!1);
|
|
349
350
|
function z() {
|
|
350
|
-
|
|
351
|
+
R.value.visible = !0;
|
|
351
352
|
}
|
|
352
353
|
const H = () => {
|
|
353
354
|
C.value = !0;
|
|
354
|
-
},
|
|
355
|
+
}, Y = (l) => {
|
|
355
356
|
if (console.log(l, "=>files "), l != null && l.playUrl) {
|
|
356
357
|
const a = l.playUrl;
|
|
357
358
|
y.value = {
|
|
358
359
|
playUrl: a,
|
|
359
360
|
totalSeconds: l.totalSeconds || 0
|
|
360
|
-
}, e.playUrl = a,
|
|
361
|
+
}, e.playUrl = a, g.success("本地视频上传成功!");
|
|
361
362
|
} else
|
|
362
|
-
|
|
363
|
+
g.error("视频地址解析失败,请重新上传");
|
|
363
364
|
}, X = (l) => {
|
|
364
|
-
|
|
365
|
-
const a =
|
|
366
|
-
e.liveType === m.LIVE_TYPE.fake_live ? (
|
|
365
|
+
p.value = null, y.value = null;
|
|
366
|
+
const a = $(l.playUrl);
|
|
367
|
+
e.liveType === m.LIVE_TYPE.fake_live ? (p.value = {
|
|
367
368
|
playUrl: a,
|
|
368
369
|
totalSeconds: l.totalSeconds || 0,
|
|
369
370
|
liveId: l.liveId,
|
|
@@ -372,81 +373,81 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
372
373
|
playUrl: a,
|
|
373
374
|
liveId: l.liveId,
|
|
374
375
|
liveName: l.liveName
|
|
375
|
-
}), e.playUrl = a,
|
|
376
|
+
}), e.playUrl = a, P.value && P.value.validateField("fakeLiveSetting");
|
|
376
377
|
}, u = () => {
|
|
377
|
-
if (
|
|
378
|
-
const l = new Date(e.startTime).getTime(), a = (
|
|
379
|
-
e.endTime =
|
|
378
|
+
if (p.value && e.startTime) {
|
|
379
|
+
const l = new Date(e.startTime).getTime(), a = (p.value.totalSeconds || 0) * 1e3, s = new Date(l + a);
|
|
380
|
+
e.endTime = s.toISOString(), P.value && P.value.validateField("endTime");
|
|
380
381
|
}
|
|
381
382
|
}, v = () => {
|
|
382
|
-
e.playUrl = "", e.liveType === m.LIVE_TYPE.fake_live &&
|
|
383
|
+
e.playUrl = "", e.liveType === m.LIVE_TYPE.fake_live && p.value ? u() : e.endTime = "";
|
|
383
384
|
};
|
|
384
385
|
K(
|
|
385
386
|
() => e.startTime,
|
|
386
387
|
(l) => {
|
|
387
|
-
e.liveType === m.LIVE_TYPE.fake_live &&
|
|
388
|
+
e.liveType === m.LIVE_TYPE.fake_live && p.value && l && u();
|
|
388
389
|
}
|
|
389
390
|
), K(
|
|
390
391
|
() => e.replayMode,
|
|
391
392
|
(l) => {
|
|
392
|
-
l !== m.REPLAY_MODE.end && (e.replayEndTime = void 0), e.updateMask =
|
|
393
|
+
l !== m.REPLAY_MODE.end && (e.replayEndTime = void 0), e.updateMask = L(l);
|
|
393
394
|
}
|
|
394
395
|
);
|
|
395
|
-
const
|
|
396
|
+
const E = async () => {
|
|
396
397
|
var a;
|
|
397
|
-
if (e.liveType === m.LIVE_TYPE.fake_live && !
|
|
398
|
-
|
|
398
|
+
if (e.liveType === m.LIVE_TYPE.fake_live && !p.value) {
|
|
399
|
+
g.error(_("liveVideo.fakeLiveRequired"));
|
|
399
400
|
return;
|
|
400
401
|
}
|
|
401
402
|
if (e.liveType === m.LIVE_TYPE.vod && !y.value) {
|
|
402
|
-
|
|
403
|
+
g.error(_("liveVideo.vodRequired"));
|
|
403
404
|
return;
|
|
404
405
|
}
|
|
405
|
-
if (await ((a =
|
|
406
|
+
if (await ((a = P.value) == null ? void 0 : a.validate()))
|
|
406
407
|
try {
|
|
407
|
-
let
|
|
408
|
-
if (
|
|
409
|
-
const
|
|
410
|
-
delete
|
|
411
|
-
} else
|
|
412
|
-
|
|
413
|
-
} catch (
|
|
414
|
-
|
|
408
|
+
let s;
|
|
409
|
+
if (S.value) {
|
|
410
|
+
const c = { ...e };
|
|
411
|
+
delete c.liveId, s = await F.create(c);
|
|
412
|
+
} else D.query.liveId ? s = await F.update(e) : s = await F.create(e);
|
|
413
|
+
s.status === 200 && (g.success(_("common.submitSuccess")), se.closeTagView(D.fullPath, f, !1));
|
|
414
|
+
} catch (s) {
|
|
415
|
+
g.error(_("common.submitFail") + s.message);
|
|
415
416
|
}
|
|
416
417
|
};
|
|
417
418
|
return (l, a) => {
|
|
418
|
-
const
|
|
419
|
-
return
|
|
420
|
-
|
|
419
|
+
const s = V("el-radio"), c = V("el-radio-group"), r = V("el-form-item"), O = V("el-input"), G = V("el-date-picker"), J = V("jmash-single-image-upload"), pe = V("jmash-editor"), ce = V("el-form"), te = V("el-button");
|
|
420
|
+
return d(), M("div", Pe, [
|
|
421
|
+
h("div", Le, [
|
|
421
422
|
n(ce, {
|
|
422
423
|
ref_key: "liveFormRef",
|
|
423
|
-
ref:
|
|
424
|
+
ref: P,
|
|
424
425
|
model: t(e),
|
|
425
426
|
rules: x,
|
|
426
427
|
style: { "max-width": "800px" },
|
|
427
428
|
"label-width": "auto"
|
|
428
429
|
}, {
|
|
429
430
|
default: o(() => {
|
|
430
|
-
var
|
|
431
|
+
var N, ie;
|
|
431
432
|
return [
|
|
432
433
|
n(r, {
|
|
433
434
|
label: l.$t("liveVideo.liveType"),
|
|
434
435
|
prop: "liveType"
|
|
435
436
|
}, {
|
|
436
437
|
default: o(() => [
|
|
437
|
-
n(
|
|
438
|
+
n(c, {
|
|
438
439
|
modelValue: t(e).liveType,
|
|
439
440
|
"onUpdate:modelValue": a[0] || (a[0] = (i) => t(e).liveType = i),
|
|
440
441
|
onChange: v
|
|
441
442
|
}, {
|
|
442
443
|
default: o(() => [
|
|
443
|
-
(
|
|
444
|
+
(d(!0), M(Q, null, ee(t(T).liveTypeEnum.values, (i) => (d(), b(s, {
|
|
444
445
|
key: i.key,
|
|
445
446
|
border: !0,
|
|
446
447
|
value: i.key
|
|
447
448
|
}, {
|
|
448
449
|
default: o(() => [
|
|
449
|
-
|
|
450
|
+
I(w(i.value), 1)
|
|
450
451
|
]),
|
|
451
452
|
_: 2
|
|
452
453
|
}, 1032, ["value"]))), 128))
|
|
@@ -456,75 +457,75 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
456
457
|
]),
|
|
457
458
|
_: 1
|
|
458
459
|
}, 8, ["label"]),
|
|
459
|
-
t(e).liveType === t(m).LIVE_TYPE.live ? (
|
|
460
|
-
t(e).liveType === t(m).LIVE_TYPE.fake_live ? (
|
|
460
|
+
t(e).liveType === t(m).LIVE_TYPE.live ? (d(), M("div", Ye, " 实时直播形式,根据实际画面进行传播,无法快进或回放 ")) : k("", !0),
|
|
461
|
+
t(e).liveType === t(m).LIVE_TYPE.fake_live ? (d(), b(r, {
|
|
461
462
|
key: 1,
|
|
462
463
|
label: l.$t("liveVideo.fakeLive")
|
|
463
464
|
}, {
|
|
464
465
|
default: o(() => {
|
|
465
466
|
var i;
|
|
466
467
|
return [
|
|
467
|
-
|
|
468
|
+
h("button", {
|
|
468
469
|
type: "button",
|
|
469
470
|
class: "fakeLive",
|
|
470
471
|
onClick: z
|
|
471
472
|
}, " 伪直播设置 "),
|
|
472
|
-
(i =
|
|
473
|
+
(i = p.value) != null && i.playUrl ? (d(), M("div", De, "已设置")) : (d(), M("div", Ie, " 未设置 "))
|
|
473
474
|
];
|
|
474
475
|
}),
|
|
475
476
|
_: 1
|
|
476
|
-
}, 8, ["label"])) :
|
|
477
|
-
t(e).liveType === t(m).LIVE_TYPE.vod ? (
|
|
477
|
+
}, 8, ["label"])) : k("", !0),
|
|
478
|
+
t(e).liveType === t(m).LIVE_TYPE.vod ? (d(), b(r, {
|
|
478
479
|
key: 2,
|
|
479
480
|
label: l.$t("liveVideo.vod")
|
|
480
481
|
}, {
|
|
481
482
|
default: o(() => {
|
|
482
483
|
var i;
|
|
483
484
|
return [
|
|
484
|
-
|
|
485
|
+
h("button", {
|
|
485
486
|
type: "button",
|
|
486
487
|
class: "fakeLive",
|
|
487
488
|
onClick: z
|
|
488
489
|
}, " 点播设置 "),
|
|
489
|
-
|
|
490
|
+
h("button", {
|
|
490
491
|
type: "button",
|
|
491
492
|
class: "fakeLive",
|
|
492
493
|
onClick: H
|
|
493
494
|
}, " 从本地上传视频 "),
|
|
494
|
-
(i = y.value) != null && i.playUrl ? (
|
|
495
|
+
(i = y.value) != null && i.playUrl ? (d(), M("div", Ne, "已设置")) : (d(), M("div", Re, "未设置"))
|
|
495
496
|
];
|
|
496
497
|
}),
|
|
497
498
|
_: 1
|
|
498
|
-
}, 8, ["label"])) :
|
|
499
|
-
(
|
|
499
|
+
}, 8, ["label"])) : k("", !0),
|
|
500
|
+
(N = p.value) != null && N.playUrl && t(e).liveType === t(m).LIVE_TYPE.fake_live ? (d(), b(r, {
|
|
500
501
|
key: 3,
|
|
501
502
|
label: "视频预览"
|
|
502
503
|
}, {
|
|
503
504
|
default: o(() => {
|
|
504
505
|
var i;
|
|
505
506
|
return [
|
|
506
|
-
(i =
|
|
507
|
+
(i = p.value) != null && i.playUrl ? (d(), M("video", {
|
|
507
508
|
key: 0,
|
|
508
|
-
src:
|
|
509
|
+
src: p.value.playUrl,
|
|
509
510
|
controls: "",
|
|
510
511
|
width: "400",
|
|
511
512
|
height: "250",
|
|
512
513
|
autoplay: "",
|
|
513
514
|
muted: "",
|
|
514
515
|
playsinline: ""
|
|
515
|
-
}, " 您的浏览器不支持视频播放 ", 8, $e)) :
|
|
516
|
+
}, " 您的浏览器不支持视频播放 ", 8, $e)) : k("", !0)
|
|
516
517
|
];
|
|
517
518
|
}),
|
|
518
519
|
_: 1
|
|
519
|
-
})) :
|
|
520
|
-
(ie = y.value) != null && ie.playUrl && t(e).liveType === t(m).LIVE_TYPE.vod ? (
|
|
520
|
+
})) : k("", !0),
|
|
521
|
+
(ie = y.value) != null && ie.playUrl && t(e).liveType === t(m).LIVE_TYPE.vod ? (d(), b(r, {
|
|
521
522
|
key: 4,
|
|
522
523
|
label: "视频预览"
|
|
523
524
|
}, {
|
|
524
525
|
default: o(() => {
|
|
525
526
|
var i;
|
|
526
527
|
return [
|
|
527
|
-
(i = y.value) != null && i.playUrl ? (
|
|
528
|
+
(i = y.value) != null && i.playUrl ? (d(), M("video", {
|
|
528
529
|
key: 0,
|
|
529
530
|
src: y.value.playUrl,
|
|
530
531
|
controls: "",
|
|
@@ -533,11 +534,11 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
533
534
|
autoplay: "",
|
|
534
535
|
muted: "",
|
|
535
536
|
playsinline: ""
|
|
536
|
-
}, " 您的浏览器不支持视频播放 ", 8, qe)) :
|
|
537
|
+
}, " 您的浏览器不支持视频播放 ", 8, qe)) : k("", !0)
|
|
537
538
|
];
|
|
538
539
|
}),
|
|
539
540
|
_: 1
|
|
540
|
-
})) :
|
|
541
|
+
})) : k("", !0),
|
|
541
542
|
n(r, {
|
|
542
543
|
label: l.$t("liveVideo.liveName"),
|
|
543
544
|
prop: "liveName"
|
|
@@ -571,7 +572,7 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
571
572
|
]),
|
|
572
573
|
_: 1
|
|
573
574
|
}, 8, ["label"]),
|
|
574
|
-
t(e).liveType !== t(m).LIVE_TYPE.live ? (
|
|
575
|
+
t(e).liveType !== t(m).LIVE_TYPE.live ? (d(), b(r, {
|
|
575
576
|
key: 5,
|
|
576
577
|
label: l.$t("liveVideo.endTime"),
|
|
577
578
|
prop: "endTime"
|
|
@@ -589,7 +590,7 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
589
590
|
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
590
591
|
]),
|
|
591
592
|
_: 1
|
|
592
|
-
}, 8, ["label"])) :
|
|
593
|
+
}, 8, ["label"])) : k("", !0),
|
|
593
594
|
n(r, {
|
|
594
595
|
label: l.$t("liveVideo.streamerName"),
|
|
595
596
|
prop: "streamerName"
|
|
@@ -610,17 +611,17 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
610
611
|
prop: "showMode"
|
|
611
612
|
}, {
|
|
612
613
|
default: o(() => [
|
|
613
|
-
n(
|
|
614
|
+
n(c, {
|
|
614
615
|
modelValue: t(e).showMode,
|
|
615
616
|
"onUpdate:modelValue": a[5] || (a[5] = (i) => t(e).showMode = i)
|
|
616
617
|
}, {
|
|
617
618
|
default: o(() => [
|
|
618
|
-
(
|
|
619
|
+
(d(!0), M(Q, null, ee(t(T).showModeEnum.values, (i) => (d(), b(s, {
|
|
619
620
|
key: i.key,
|
|
620
621
|
value: i.key
|
|
621
622
|
}, {
|
|
622
623
|
default: o(() => [
|
|
623
|
-
|
|
624
|
+
I(w(i.value), 1)
|
|
624
625
|
]),
|
|
625
626
|
_: 2
|
|
626
627
|
}, 1032, ["value"]))), 128))
|
|
@@ -635,7 +636,7 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
635
636
|
prop: "preStreamPic"
|
|
636
637
|
}, {
|
|
637
638
|
default: o(() => [
|
|
638
|
-
|
|
639
|
+
h("div", Ce, [
|
|
639
640
|
n(J, {
|
|
640
641
|
"picture-url": t(e).preStreamPic,
|
|
641
642
|
onImageSrc: A,
|
|
@@ -651,7 +652,7 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
651
652
|
prop: "liveStreamPic"
|
|
652
653
|
}, {
|
|
653
654
|
default: o(() => [
|
|
654
|
-
|
|
655
|
+
h("div", Fe, [
|
|
655
656
|
n(J, {
|
|
656
657
|
"picture-url": t(e).liveStreamPic,
|
|
657
658
|
onImageSrc: W,
|
|
@@ -662,13 +663,13 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
662
663
|
]),
|
|
663
664
|
_: 1
|
|
664
665
|
}, 8, ["label"]),
|
|
665
|
-
t(e).showMode === t(m).SHOW_MODE.vertical ? (
|
|
666
|
+
t(e).showMode === t(m).SHOW_MODE.vertical ? (d(), b(r, {
|
|
666
667
|
key: 6,
|
|
667
668
|
label: l.$t("liveVideo.bgPic"),
|
|
668
669
|
prop: "bgPic"
|
|
669
670
|
}, {
|
|
670
671
|
default: o(() => [
|
|
671
|
-
|
|
672
|
+
h("div", xe, [
|
|
672
673
|
n(J, {
|
|
673
674
|
"picture-url": t(e).bgPic,
|
|
674
675
|
onImageSrc: Z,
|
|
@@ -678,25 +679,25 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
678
679
|
])
|
|
679
680
|
]),
|
|
680
681
|
_: 1
|
|
681
|
-
}, 8, ["label"])) :
|
|
682
|
-
t(e).liveType !== t(m).LIVE_TYPE.vod ? (
|
|
682
|
+
}, 8, ["label"])) : k("", !0),
|
|
683
|
+
t(e).liveType !== t(m).LIVE_TYPE.vod ? (d(), b(r, {
|
|
683
684
|
key: 7,
|
|
684
685
|
label: l.$t("liveVideo.replayMode"),
|
|
685
686
|
prop: "replayMode"
|
|
686
687
|
}, {
|
|
687
688
|
default: o(() => [
|
|
688
|
-
n(
|
|
689
|
+
n(c, {
|
|
689
690
|
modelValue: t(e).replayMode,
|
|
690
691
|
"onUpdate:modelValue": a[6] || (a[6] = (i) => t(e).replayMode = i)
|
|
691
692
|
}, {
|
|
692
693
|
default: o(() => [
|
|
693
|
-
(
|
|
694
|
+
(d(!0), M(Q, null, ee(t(T).replayModeEnum.values, (i) => (d(), b(s, {
|
|
694
695
|
key: i.key,
|
|
695
696
|
border: !0,
|
|
696
697
|
value: i.key
|
|
697
698
|
}, {
|
|
698
699
|
default: o(() => [
|
|
699
|
-
|
|
700
|
+
I(w(i.value), 1)
|
|
700
701
|
]),
|
|
701
702
|
_: 2
|
|
702
703
|
}, 1032, ["value"]))), 128))
|
|
@@ -705,8 +706,8 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
705
706
|
}, 8, ["modelValue"])
|
|
706
707
|
]),
|
|
707
708
|
_: 1
|
|
708
|
-
}, 8, ["label"])) :
|
|
709
|
-
t(e).replayMode === t(m).REPLAY_MODE.end && t(e).liveType !== t(m).LIVE_TYPE.vod ? (
|
|
709
|
+
}, 8, ["label"])) : k("", !0),
|
|
710
|
+
t(e).replayMode === t(m).REPLAY_MODE.end && t(e).liveType !== t(m).LIVE_TYPE.vod ? (d(), b(r, {
|
|
710
711
|
key: 8,
|
|
711
712
|
label: l.$t("liveVideo.replayEndTime"),
|
|
712
713
|
prop: "replayEndTime"
|
|
@@ -723,7 +724,7 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
723
724
|
}, null, 8, ["modelValue", "placeholder"])
|
|
724
725
|
]),
|
|
725
726
|
_: 1
|
|
726
|
-
}, 8, ["label"])) :
|
|
727
|
+
}, 8, ["label"])) : k("", !0),
|
|
727
728
|
n(r, {
|
|
728
729
|
label: l.$t("liveVideo.liveDescprition"),
|
|
729
730
|
prop: "liveDescprition"
|
|
@@ -741,44 +742,44 @@ const be = { class: "el-upload__text" }, ke = {
|
|
|
741
742
|
}),
|
|
742
743
|
_: 1
|
|
743
744
|
}, 8, ["model", "rules"]),
|
|
744
|
-
|
|
745
|
+
h("div", ze, [
|
|
745
746
|
n(te, {
|
|
746
747
|
type: "primary",
|
|
747
748
|
onClick: j
|
|
748
749
|
}, {
|
|
749
750
|
default: o(() => [
|
|
750
|
-
|
|
751
|
+
I(w(l.$t("common.back")), 1)
|
|
751
752
|
]),
|
|
752
753
|
_: 1
|
|
753
754
|
}),
|
|
754
755
|
n(te, {
|
|
755
756
|
type: "primary",
|
|
756
|
-
onClick:
|
|
757
|
+
onClick: E
|
|
757
758
|
}, {
|
|
758
759
|
default: o(() => [
|
|
759
|
-
|
|
760
|
+
I(w(l.$t("common.confirm")), 1)
|
|
760
761
|
]),
|
|
761
762
|
_: 1
|
|
762
763
|
})
|
|
763
764
|
])
|
|
764
765
|
]),
|
|
765
|
-
|
|
766
|
+
R.value.visible ? (d(), b(Ee, {
|
|
766
767
|
key: 0,
|
|
767
|
-
modelValue:
|
|
768
|
-
"onUpdate:modelValue": a[9] || (a[9] = (
|
|
768
|
+
modelValue: R.value.visible,
|
|
769
|
+
"onUpdate:modelValue": a[9] || (a[9] = (N) => R.value.visible = N),
|
|
769
770
|
width: "1200px",
|
|
770
771
|
onConfirmSelect: X
|
|
771
|
-
}, null, 8, ["modelValue"])) :
|
|
772
|
+
}, null, 8, ["modelValue"])) : k("", !0),
|
|
772
773
|
n(we, {
|
|
773
774
|
modelValue: C.value,
|
|
774
|
-
"onUpdate:modelValue": a[10] || (a[10] = (
|
|
775
|
+
"onUpdate:modelValue": a[10] || (a[10] = (N) => C.value = N),
|
|
775
776
|
"video-max-size": 800,
|
|
776
|
-
onFilesResponse:
|
|
777
|
+
onFilesResponse: Y
|
|
777
778
|
}, null, 8, ["modelValue"])
|
|
778
779
|
]);
|
|
779
780
|
};
|
|
780
781
|
}
|
|
781
|
-
}), Je = /* @__PURE__ */ me(Oe, [["__scopeId", "data-v-
|
|
782
|
+
}), Je = /* @__PURE__ */ me(Oe, [["__scopeId", "data-v-3f4fc057"]]);
|
|
782
783
|
export {
|
|
783
784
|
Je as default
|
|
784
785
|
};
|