From f4e0552a61f1ef5942739c528256f4739b011d31 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 11 Mar 2024 16:03:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=9A=84=E4=B8=8A=E4=BC=A0=E7=BC=96=E8=BE=91=E4=B8=8E=E6=92=AD?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/contest.js | 25 ++ src/main.js | 5 + src/views/contest/PlayVideo.vue | 122 +++++++++ src/views/contest/contestDetail.vue | 11 +- .../contestSceneManage/ContestSceneManage.vue | 42 +++- .../contestSceneManage/UploadVideo.vue | 238 ++++++++++++++++++ 7 files changed, 429 insertions(+), 15 deletions(-) create mode 100644 src/views/contest/PlayVideo.vue create mode 100644 src/views/contestDataManage/contestSceneManage/UploadVideo.vue diff --git a/package.json b/package.json index fc1a606f7..852892b6b 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "vue-i18n": "^8.12.0", "vue-quill-editor": "^3.0.6", "vue-router": "^3.1.6", + "vue-video-player": "^5.0.1", "vuedraggable": "^2.24.3", "vuex": "^3.1.0", "wangeditor": "^4.6.17", diff --git a/src/api/contest.js b/src/api/contest.js index 78424957e..e70ff7fcd 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -332,6 +332,31 @@ export function publishContextSence(data) { }); } +/** 场景视频保存 + * @param {Object} data + * @param {String} data.name 场景名称 + * @param {String} data.type Video=视频 + * @param {Object} data.scene 大赛场景 + * @param {String} data.scene.url 地址 + * @param {String} data.scene.fileName 文件名 + */ +export function saveSceneVideo(data) { + return request({ + url: `/api/exercise/race/scene/custom/edit`, + method: 'post', + data + }); +} + +/** 场景视频编辑 */ +export function editSceneVideo(sceneId, data) { + return request({ + url: `/api/exercise/race/scene/custom/${sceneId}/edit`, + method: 'post', + data + }); +} + /** 竞赛试卷测试模块任务集合 * @param {String} paperId 试卷id * @param {String} moduleId 模块id diff --git a/src/main.js b/src/main.js index e7ada36b6..873798e43 100644 --- a/src/main.js +++ b/src/main.js @@ -28,6 +28,11 @@ import '@/directive/verticalDrag/index.js'; import '@/directive/waves/index.js'; import messages from '@/i18n/index'; +import VideoPlayer from 'vue-video-player/src'; +import 'vue-video-player/src/custom-theme.css'; +import 'video.js/dist/video-js.css'; + +Vue.use(VideoPlayer); Vue.use(ElementUI); Vue.use(VueI18n); Vue.config.devtools = true; // 开发环境显示vue控制台 diff --git a/src/views/contest/PlayVideo.vue b/src/views/contest/PlayVideo.vue new file mode 100644 index 000000000..1a6b79fc6 --- /dev/null +++ b/src/views/contest/PlayVideo.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue index 5e3474b98..b353db0cf 100644 --- a/src/views/contest/contestDetail.vue +++ b/src/views/contest/contestDetail.vue @@ -44,12 +44,14 @@
评分表 - 开始任务 + 开始任务 + 播放视频 下一任务
+ @@ -58,10 +60,12 @@ import { getTaskTree, getContextSenceDetail} from '@/api/contest'; import { createSimulationNoFunction } from '@/api/simulation'; import { getPublishMapInfo } from '@/api/jmap/map'; import ScoreRule from './scoreRule'; +import PlayVideo from './PlayVideo'; export default { name: 'ContestDetail', components: { - ScoreRule + ScoreRule, + PlayVideo }, data() { return { @@ -145,6 +149,9 @@ export default { this.nowKey++; this.nowData = this.taskList[this.nowKey]; }, + playSceneVideo() { + this.$refs.playVideo.doShow(this.nowData.sceneId); + }, startTask() { this.loading = true; try { diff --git a/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue index 61e26e7d3..ae4e2ba21 100644 --- a/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue +++ b/src/views/contestDataManage/contestSceneManage/ContestSceneManage.vue @@ -1,13 +1,18 @@ + + From a763880dac2ea093f8103dd2f8af06d2dfbbf7b9 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 11 Mar 2024 16:28:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contest/PlayVideo.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/contest/PlayVideo.vue b/src/views/contest/PlayVideo.vue index 1a6b79fc6..e34d3d927 100644 --- a/src/views/contest/PlayVideo.vue +++ b/src/views/contest/PlayVideo.vue @@ -6,7 +6,6 @@ ref="videoPlayer" :playsinline="false" :options="playOptions" - @ready="onPlayerReady" @play="onPlayerPlay($event)" @timeupdate="onPlayerTimeupdate($event)" /> From 51e700a2ad1ef58e8bfefed62fc87d7bae9efb33 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 11 Mar 2024 17:30:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contest/PlayVideo.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/views/contest/PlayVideo.vue b/src/views/contest/PlayVideo.vue index e34d3d927..0909cb60a 100644 --- a/src/views/contest/PlayVideo.vue +++ b/src/views/contest/PlayVideo.vue @@ -1,8 +1,7 @@