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.
@@ -1,14 +1,14 @@
1
- import { defineComponent as se, mergeModels as oe, ref as S, useModel as fe, onUnmounted as ye, resolveComponent as _, createBlock as E, openBlock as s, withCtx as o, createVNode as n, createElementBlock as M, createCommentVNode as b, createElementVNode as g, createTextVNode as Y, 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 V, genFileId as ge } from "element-plus";
3
- import { fileApi as le, routerUtil as de } from "jmash-core";
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 U, C as m } from "./index-CF3wLv0W.mjs";
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-B33Lg-af.mjs";
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
- }, Ue = ["src"], Me = { class: "dialog-footer" }, Se = /* @__PURE__ */ se({
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: N }) {
29
- const { t: c } = ve(), e = ue(), $ = S(le.uploadUrl()), T = S(le.authHeader()), y = S(), I = fe(B, "modelValue"), p = S([]), P = S("");
30
- let k = null;
31
- const q = B, x = N, j = () => {
32
- I.value = !1;
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, h = [".mp4", ".flv", ".mov", ".avi", ".mkv"], l = v.name.toLowerCase();
36
- if (!h.some((r) => l.endsWith(r))) {
37
- ne.confirm(c("video.onlySupportVideo"), c("file.warning"), {
38
- confirmButtonText: c("common.confirm"),
39
- cancelButtonText: c("common.cancel"),
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
- c("video.videoLtRequired", { size: q.videoMaxSize })
52
+ f("video.videoLtRequired", { size: q.videoMaxSize })
53
53
  );
54
- k = URL.createObjectURL(v), P.value = k;
54
+ S = URL.createObjectURL(v), y.value = S;
55
55
  }, W = async (u, v) => {
56
56
  if (console.log("文件上传返回结果:", u, v), !u.fileSrc) {
57
- V.error(c("video.uploadFail") || "视频上传失败,未获取到文件路径"), L();
57
+ g.error(f("video.uploadFail") || "视频上传失败,未获取到文件路径"), Y();
58
58
  return;
59
59
  }
60
60
  try {
61
- const h = {
62
- tenant: e.query.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参数:", h);
66
+ console.log("调用liveVideoUpload参数:", E);
67
67
  const l = await F.liveVideoUpload(
68
- h
68
+ E
69
69
  );
70
70
  if (console.log("liveVideoUpload接口返回:", l), !l || !l.data || !l.data.mediaUrl) {
71
- V.error("视频上传成功,但腾讯云点播未返回播放地址"), L();
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
- V({ message: c("video.uploadSuccess"), type: "success" }), P.value = a.playUrl, k = null, x("filesResponse", a), x("uploadFileList", v), setTimeout(() => {
84
- I.value = !1;
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 (h) {
87
- console.error("调用liveVideoUpload接口失败:", h), V.error(
88
- c("video.uploadFail") || "视频文件上传成功,但同步至腾讯云点播失败,请重试"
89
- ), L();
86
+ } catch (E) {
87
+ console.error("调用liveVideoUpload接口失败:", E), g.error(
88
+ f("video.uploadFail") || "视频文件上传成功,但同步至腾讯云点播失败,请重试"
89
+ ), Y();
90
90
  }
91
91
  }, Z = (u) => {
92
- y.value.clearFiles();
92
+ e.value.clearFiles();
93
93
  const v = u[0];
94
- v.uid = ge(), y.value.handleStart(v);
95
- }, D = () => {
96
- L();
94
+ v.uid = ge(), e.value.handleStart(v);
95
+ }, R = () => {
96
+ Y();
97
97
  }, C = () => {
98
- L(), H();
98
+ Y(), H();
99
99
  };
100
100
  function z() {
101
101
  if (p.value.length === 0) {
102
- V.warning(c("video.pleaseSelectVideo"));
102
+ g.warning(f("video.pleaseSelectVideo"));
103
103
  return;
104
104
  }
105
- y.value.submit();
105
+ e.value.submit();
106
106
  }
107
107
  const H = () => {
108
- y.value && (y.value.clearFiles(), p.value = []);
109
- }, L = () => {
110
- k && (URL.revokeObjectURL(k), P.value = "", k = null);
111
- }, X = async (u, v) => new Promise((h) => {
112
- ne.confirm(v, c("file.warning"), {
113
- confirmButtonText: c("common.confirm"),
114
- cancelButtonText: c("common.cancel"),
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
- h(!0);
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), h(!1);
122
+ l !== -1 && p.value.splice(l, 1), E(!1);
123
123
  });
124
124
  });
125
125
  return ye(() => {
126
- L();
126
+ Y();
127
127
  }), ae({ clearFileList: H }), (u, v) => {
128
- const h = _("upload-filled"), l = _("el-icon"), a = _("el-upload"), d = _("el-button"), f = _("el-dialog");
129
- return s(), E(f, {
130
- modelValue: I.value,
131
- "onUpdate:modelValue": v[1] || (v[1] = (r) => I.value = 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
- g("div", Me, [
138
- n(d, { onClick: j }, {
137
+ h("div", Ue, [
138
+ n(s, { onClick: j }, {
139
139
  default: o(() => [
140
- Y(w(u.$t("common.cancel")), 1)
140
+ I(w(u.$t("common.cancel")), 1)
141
141
  ]),
142
142
  _: 1
143
143
  }),
144
- n(d, {
144
+ n(s, {
145
145
  type: "primary",
146
146
  onClick: z
147
147
  }, {
148
148
  default: o(() => [
149
- Y(w(u.$t("common.confirm")), 1)
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: y,
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: T.value,
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": D,
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
- g("div", { class: "el-upload__tip" }, " 注:可上传mp4/flv/mov/avi/mkv格式视频,图片/文档类文件不支持 ", -1)
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(h)
178
+ n(E)
179
179
  ]),
180
180
  _: 1
181
181
  }),
182
- g("div", be, [
183
- Y(w(u.$t("common.dragFiles")), 1),
184
- g("em", null, w(u.$t("video.uploadEvent")), 1)
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
- P.value ? (s(), M("div", ke, [
190
- v[3] || (v[3] = g("h4", { style: { "font-size": "14px", margin: "15px 0 10px", color: "#333" } }, " 视频预览 ", -1)),
191
- g("video", {
192
- src: P.value,
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, Ue)
198
- ])) : b("", !0)
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__ */ se({
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
- const { proxy: ae } = Te(), N = (l) => !l || l.startsWith("http://") || l.startsWith("https://") || l.startsWith(He) ? l : le.fileCompleteRangeUrl(l), c = S();
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 $ = (l) => {
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 = $(e.replayMode), K(
232
+ e.updateMask = L(e.replayMode), K(
232
233
  () => e.replayMode,
233
234
  () => {
234
- e.updateMask = $(e.replayMode);
235
+ e.updateMask = L(e.replayMode);
235
236
  }
236
237
  );
237
- const T = S(null), y = S(null), I = _e(() => k.query.copy === "true");
238
+ const p = U(null), y = U(null), S = _e(() => D.query.copy === "true");
238
239
  Ve(() => {
239
- U.liveTypeEnum.values && U.liveTypeEnum.values.length > 0 && (e.liveType = U.liveTypeEnum.values[0].key), U.replayModeEnum.values && U.replayModeEnum.values.length > 0 && (e.replayMode = U.replayModeEnum.values[1].key), U.showModeEnum.values && U.showModeEnum.values.length > 0 && (e.showMode = U.showModeEnum.values[0].key), q();
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 { t: p } = ve(), P = he(), k = ue(), q = async () => {
242
- const l = k.query.liveId;
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
- V.warning("未获取到直播数据");
248
+ g.warning("未获取到直播数据");
248
249
  return;
249
250
  }
250
- a.data.liveType === m.LIVE_TYPE.fake_live ? T.value = {
251
- playUrl: N(a.data.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: N(a.data.playUrl)
255
+ playUrl: $(a.data.playUrl)
255
256
  });
256
- const d = (f) => {
257
- if (!f) return;
258
- const r = new Date(f);
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 = d(a.data.startTime)), a.data.endTime && (e.endTime = d(a.data.endTime)), a.data.replayEndTime && (e.replayEndTime = d(a.data.replayEndTime)), a.data.replayStartTime && (e.replayStartTime = d(a.data.replayStartTime)), I.value) {
263
- const f = { ...a.data };
264
- delete f.liveId, f.liveName = `${f.liveName}`, e.liveId = void 0, Object.assign(e, f), V.info("已加载原直播数据,当前为复制模式(创建新直播)");
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), V.error("获取直播详情失败");
269
+ console.error("获取直播详情失败:", a), g.error("获取直播详情失败");
269
270
  }
270
271
  }, x = re({
271
272
  liveType: [
272
273
  {
273
274
  required: !0,
274
- message: p("liveVideo.liveTypeRequired"),
275
+ message: _("liveVideo.liveTypeRequired"),
275
276
  trigger: "change"
276
277
  }
277
278
  ],
278
279
  liveName: [
279
280
  {
280
281
  required: !0,
281
- message: p("liveVideo.liveNameRequired"),
282
+ message: _("liveVideo.liveNameRequired"),
282
283
  trigger: "blur"
283
284
  }
284
285
  ],
285
286
  startTime: [
286
287
  {
287
288
  required: !0,
288
- message: p("liveVideo.startTimeRequired"),
289
+ message: _("liveVideo.startTimeRequired"),
289
290
  trigger: "change"
290
291
  }
291
292
  ],
292
293
  streamerName: [
293
294
  {
294
295
  required: !0,
295
- message: p("liveVideo.streamerNameRequired"),
296
+ message: _("liveVideo.streamerNameRequired"),
296
297
  trigger: "blur"
297
298
  }
298
299
  ],
299
300
  preStreamPic: [
300
301
  {
301
302
  required: !0,
302
- message: p("liveVideo.preStreamPicRequired"),
303
+ message: _("liveVideo.preStreamPicRequired"),
303
304
  trigger: "change"
304
305
  }
305
306
  ],
306
307
  endTime: [
307
308
  {
308
309
  required: !0,
309
- message: p("liveVideo.endTimeRequired"),
310
+ message: _("liveVideo.endTimeRequired"),
310
311
  trigger: "change"
311
312
  },
312
313
  {
313
- validator: (l, a, d) => {
314
+ validator: (l, a, s) => {
314
315
  if (e.liveType === m.LIVE_TYPE.vod && e.startTime && a) {
315
- const f = new Date(e.startTime).getTime();
316
- new Date(a).getTime() <= f ? d(new Error("结束时间必须大于开始时间")) : d();
316
+ const c = new Date(e.startTime).getTime();
317
+ new Date(a).getTime() <= c ? s(new Error("结束时间必须大于开始时间")) : s();
317
318
  } else
318
- d();
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: p("liveVideo.replayEndTimeRequired"),
327
+ message: _("liveVideo.replayEndTimeRequired"),
327
328
  trigger: "change",
328
- validator: (l, a, d) => {
329
- e.replayMode === m.REPLAY_MODE.end && !a ? d(new Error(p("liveVideo.replayEndTimeRequired"))) : d();
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
- de.closeTagView(k.fullPath, P, !1);
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 D = S({
347
+ const R = U({
347
348
  visible: !1
348
- }), C = S(!1);
349
+ }), C = U(!1);
349
350
  function z() {
350
- D.value.visible = !0;
351
+ R.value.visible = !0;
351
352
  }
352
353
  const H = () => {
353
354
  C.value = !0;
354
- }, L = (l) => {
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, V.success("本地视频上传成功!");
361
+ }, e.playUrl = a, g.success("本地视频上传成功!");
361
362
  } else
362
- V.error("视频地址解析失败,请重新上传");
363
+ g.error("视频地址解析失败,请重新上传");
363
364
  }, X = (l) => {
364
- T.value = null, y.value = null;
365
- const a = N(l.playUrl);
366
- e.liveType === m.LIVE_TYPE.fake_live ? (T.value = {
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, c.value && c.value.validateField("fakeLiveSetting");
376
+ }), e.playUrl = a, P.value && P.value.validateField("fakeLiveSetting");
376
377
  }, u = () => {
377
- if (T.value && e.startTime) {
378
- const l = new Date(e.startTime).getTime(), a = (T.value.totalSeconds || 0) * 1e3, d = new Date(l + a);
379
- e.endTime = d.toISOString(), c.value && c.value.validateField("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 && T.value ? u() : e.endTime = "";
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 && T.value && l && u();
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 = $(l);
393
+ l !== m.REPLAY_MODE.end && (e.replayEndTime = void 0), e.updateMask = L(l);
393
394
  }
394
395
  );
395
- const h = async () => {
396
+ const E = async () => {
396
397
  var a;
397
- if (e.liveType === m.LIVE_TYPE.fake_live && !T.value) {
398
- V.error(p("liveVideo.fakeLiveRequired"));
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
- V.error(p("liveVideo.vodRequired"));
403
+ g.error(_("liveVideo.vodRequired"));
403
404
  return;
404
405
  }
405
- if (await ((a = c.value) == null ? void 0 : a.validate()))
406
+ if (await ((a = P.value) == null ? void 0 : a.validate()))
406
407
  try {
407
- let d;
408
- if (I.value) {
409
- const f = { ...e };
410
- delete f.liveId, d = await F.create(f);
411
- } else k.query.liveId ? d = await F.update(e) : d = await F.create(e);
412
- d.status === 200 && (V.success(p("common.submitSuccess")), de.closeTagView(k.fullPath, P, !1));
413
- } catch (d) {
414
- V.error(p("common.submitFail") + d.message);
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 d = _("el-radio"), f = _("el-radio-group"), r = _("el-form-item"), O = _("el-input"), G = _("el-date-picker"), J = _("jmash-single-image-upload"), pe = _("jmash-editor"), ce = _("el-form"), te = _("el-button");
419
- return s(), M("div", Pe, [
420
- g("div", Le, [
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: c,
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 R, ie;
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(f, {
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
- (s(!0), M(Q, null, ee(t(U).liveTypeEnum.values, (i) => (s(), E(d, {
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
- Y(w(i.value), 1)
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 ? (s(), M("div", Ye, " 实时直播形式,根据实际画面进行传播,无法快进或回放 ")) : b("", !0),
460
- t(e).liveType === t(m).LIVE_TYPE.fake_live ? (s(), E(r, {
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
- g("button", {
468
+ h("button", {
468
469
  type: "button",
469
470
  class: "fakeLive",
470
471
  onClick: z
471
472
  }, " 伪直播设置 "),
472
- (i = T.value) != null && i.playUrl ? (s(), M("div", De, "已设置")) : (s(), M("div", Ie, " 未设置 "))
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"])) : b("", !0),
477
- t(e).liveType === t(m).LIVE_TYPE.vod ? (s(), E(r, {
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
- g("button", {
485
+ h("button", {
485
486
  type: "button",
486
487
  class: "fakeLive",
487
488
  onClick: z
488
489
  }, " 点播设置 "),
489
- g("button", {
490
+ h("button", {
490
491
  type: "button",
491
492
  class: "fakeLive",
492
493
  onClick: H
493
494
  }, " 从本地上传视频 "),
494
- (i = y.value) != null && i.playUrl ? (s(), M("div", Ne, "已设置")) : (s(), M("div", Re, "未设置"))
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"])) : b("", !0),
499
- (R = T.value) != null && R.playUrl && t(e).liveType === t(m).LIVE_TYPE.fake_live ? (s(), E(r, {
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 = T.value) != null && i.playUrl ? (s(), M("video", {
507
+ (i = p.value) != null && i.playUrl ? (d(), M("video", {
507
508
  key: 0,
508
- src: T.value.playUrl,
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)) : b("", !0)
516
+ }, " 您的浏览器不支持视频播放 ", 8, $e)) : k("", !0)
516
517
  ];
517
518
  }),
518
519
  _: 1
519
- })) : b("", !0),
520
- (ie = y.value) != null && ie.playUrl && t(e).liveType === t(m).LIVE_TYPE.vod ? (s(), E(r, {
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 ? (s(), M("video", {
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)) : b("", !0)
537
+ }, " 您的浏览器不支持视频播放 ", 8, qe)) : k("", !0)
537
538
  ];
538
539
  }),
539
540
  _: 1
540
- })) : b("", !0),
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 ? (s(), E(r, {
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"])) : b("", !0),
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(f, {
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
- (s(!0), M(Q, null, ee(t(U).showModeEnum.values, (i) => (s(), E(d, {
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
- Y(w(i.value), 1)
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
- g("div", Ce, [
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
- g("div", Fe, [
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 ? (s(), E(r, {
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
- g("div", xe, [
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"])) : b("", !0),
682
- t(e).liveType !== t(m).LIVE_TYPE.vod ? (s(), E(r, {
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(f, {
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
- (s(!0), M(Q, null, ee(t(U).replayModeEnum.values, (i) => (s(), E(d, {
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
- Y(w(i.value), 1)
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"])) : b("", !0),
709
- t(e).replayMode === t(m).REPLAY_MODE.end && t(e).liveType !== t(m).LIVE_TYPE.vod ? (s(), E(r, {
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"])) : b("", !0),
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
- g("div", ze, [
745
+ h("div", ze, [
745
746
  n(te, {
746
747
  type: "primary",
747
748
  onClick: j
748
749
  }, {
749
750
  default: o(() => [
750
- Y(w(l.$t("common.back")), 1)
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: h
757
+ onClick: E
757
758
  }, {
758
759
  default: o(() => [
759
- Y(w(l.$t("common.confirm")), 1)
760
+ I(w(l.$t("common.confirm")), 1)
760
761
  ]),
761
762
  _: 1
762
763
  })
763
764
  ])
764
765
  ]),
765
- D.value.visible ? (s(), E(Ee, {
766
+ R.value.visible ? (d(), b(Ee, {
766
767
  key: 0,
767
- modelValue: D.value.visible,
768
- "onUpdate:modelValue": a[9] || (a[9] = (R) => D.value.visible = R),
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"])) : b("", !0),
772
+ }, null, 8, ["modelValue"])) : k("", !0),
772
773
  n(we, {
773
774
  modelValue: C.value,
774
- "onUpdate:modelValue": a[10] || (a[10] = (R) => C.value = R),
775
+ "onUpdate:modelValue": a[10] || (a[10] = (N) => C.value = N),
775
776
  "video-max-size": 800,
776
- onFilesResponse: L
777
+ onFilesResponse: Y
777
778
  }, null, 8, ["modelValue"])
778
779
  ]);
779
780
  };
780
781
  }
781
- }), Je = /* @__PURE__ */ me(Oe, [["__scopeId", "data-v-f4a47fea"]]);
782
+ }), Je = /* @__PURE__ */ me(Oe, [["__scopeId", "data-v-3f4fc057"]]);
782
783
  export {
783
784
  Je as default
784
785
  };