From f0cea7706c8140393596ef17f10ff9ee237fdcf3 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Mon, 11 Mar 2024 09:57:48 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + .../contestSeasonManage/editContent.vue | 49 +++++++++++++------ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 8c4db5cec..fc1a606f7 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ }, "dependencies": { "@stomp/stompjs": "^5.4.4", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^1.0.2", "axios": "^0.18.0", "dayjs": "^1.11.5", "echarts": "^4.7.0", diff --git a/src/views/contestDataManage/contestSeasonManage/editContent.vue b/src/views/contestDataManage/contestSeasonManage/editContent.vue index 8fda96b5c..38b22718b 100644 --- a/src/views/contestDataManage/contestSeasonManage/editContent.vue +++ b/src/views/contestDataManage/contestSeasonManage/editContent.vue @@ -1,15 +1,20 @@ + + diff --git a/src/views/newMap/display/terminals/terminalMenu.vue b/src/views/newMap/display/terminals/terminalMenu.vue index b395f5da4..893169003 100644 --- a/src/views/newMap/display/terminals/terminalMenu.vue +++ b/src/views/newMap/display/terminals/terminalMenu.vue @@ -69,7 +69,7 @@ export default { } else { this.initPictureShow(); } - } else if (!clientIdList || !clientIdList.length) { + } else if (clientIdList.length) { this.initTerminalList(clientIdList); if (this.$store.state.trainingNew.trainingDetail && this.$store.state.trainingNew.trainingDetail.client) { const client = this.findTerminalFromMap(this.$store.state.trainingNew.trainingDetail.client); diff --git a/src/views/newMap/newMapdraft/clientConfig.vue b/src/views/newMap/newMapdraft/clientConfig.vue index b0c52fae0..214ca18f7 100644 --- a/src/views/newMap/newMapdraft/clientConfig.vue +++ b/src/views/newMap/newMapdraft/clientConfig.vue @@ -65,7 +65,8 @@ export default { { label: '轨道详览', key: 'troDetailWork' }, { label: '通号端', key: 'maintainerSelect' }, { label: '乘客信息发布系统', key: 'pisScreen' }, - { label: 'TMS', key: 'tms' } + { label: 'TMS', key: 'tms' }, + { label: 'PA', value: 'paScreen' } ] }; }, diff --git a/src/views/newMap/newMapdraft/mapoperate/terminals/terminals.vue b/src/views/newMap/newMapdraft/mapoperate/terminals/terminals.vue index 2beca8b83..4568b4ec7 100644 --- a/src/views/newMap/newMapdraft/mapoperate/terminals/terminals.vue +++ b/src/views/newMap/newMapdraft/mapoperate/terminals/terminals.vue @@ -287,6 +287,11 @@ export default { code: 'pisScreen', isShow: () => type === 'METRO' }, + { + name: 'PA', + code: 'paScreen', + isShow: () => type === 'METRO' + }, { name: '大屏', code: 'bigScreen', diff --git a/src/views/publish/publishMap/chooseTraining.vue b/src/views/publish/publishMap/chooseTraining.vue index 075d222cc..c8edaa29b 100644 --- a/src/views/publish/publishMap/chooseTraining.vue +++ b/src/views/publish/publishMap/chooseTraining.vue @@ -79,13 +79,13 @@ export default { title: this.$t('lesson.trainingName'), prop: 'name' }, - { - title: this.$t('lesson.prdType'), - prop: 'prdType', - type: 'tag', - columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['value', 'label']); }, - tagType: (row) => { return 'success'; } - }, + // { + // title: this.$t('lesson.prdType'), + // prop: 'prdType', + // type: 'tag', + // columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['value', 'label']); }, + // tagType: (row) => { return 'success'; } + // }, { title: this.$t('lesson.trainingType'), prop: 'type', @@ -132,12 +132,12 @@ export default { }; }, computed:{ - prdTypeList() { - const productTypeList = ConstConfig.ConstSelect.prdType; - return Cookies.get('user_lang') == 'en' - ? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; }) - : productTypeList.map(elem => { return { value: elem.value, label: elem.label }; }); - } + // prdTypeList() { + // const productTypeList = ConstConfig.ConstSelect.prdType; + // return Cookies.get('user_lang') == 'en' + // ? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; }) + // : productTypeList.map(elem => { return { value: elem.value, label: elem.label }; }); + // } }, async created() { await this.loadInitData(); diff --git a/src/views/system/deviceManage/editConfig.vue b/src/views/system/deviceManage/editConfig.vue index 232b56b80..719bafbf7 100644 --- a/src/views/system/deviceManage/editConfig.vue +++ b/src/views/system/deviceManage/editConfig.vue @@ -88,7 +88,7 @@ - + { if (res.data && res.data.length) { this.lwList = res.data; @@ -511,7 +511,7 @@ export default { self.$message.error(this.$t('tip.modifyTheFailure') + error.message); }); }); - } else if (this.data.type === 'PIS' || this.data.type === 'TMS') { + } else if (this.data.type === 'PIS' || this.data.type === 'TMS' || this.data.type === 'PA') { this.$refs.formTms.validate(() => { const data = {id: this.data.id, project: this.data.project, code: this.data.code, type: this.data.type, config: JSON.stringify(this.formTms) }; setDeviceConfig(data).then(response => { diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue index 74a0f5114..88102292a 100644 --- a/src/views/system/deviceManage/index.vue +++ b/src/views/system/deviceManage/index.vue @@ -188,7 +188,7 @@ export default { }, editConfig(index, row) { const configGatewayList = ['SWITCH', 'SIGNAL', 'PSD', 'PSL', 'PSC', 'UDP_LOW', 'SECTION', 'TRAIN', 'UDP_CLIENT', 'PIS_STAND', 'PIS_TRAIN', 'PIS']; - if (['LW', 'VR_IBP', 'ISCS_LW', 'ISCS_CW', 'IM', 'CW', 'DRIVE', 'DEPOT', 'TMS', 'PIS'].includes(row.type)) { + if (['LW', 'VR_IBP', 'ISCS_LW', 'ISCS_CW', 'IM', 'CW', 'DRIVE', 'DEPOT', 'TMS', 'PIS', 'PA'].includes(row.type)) { this.$refs.editConfig.doShow(row); } else if (configGatewayList.includes(row.type)) { this.$refs.editConfigGateway.doShow(row); From f4e0552a61f1ef5942739c528256f4739b011d31 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 11 Mar 2024 16:03:35 +0800 Subject: [PATCH 04/11] =?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 05/11] =?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 06/11] =?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 @@ @@ -52,6 +52,7 @@ export default { } }); this.selectStation = this.$store.state.training.roleDeviceCode; + console.log(this.selectStation, '===='); } this.$store.dispatch('app/animationsClose'); }, From b57ea909b41eb1b9429091a878aa648a6b315071 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 12 Mar 2024 09:18:34 +0800 Subject: [PATCH 09/11] =?UTF-8?q?pa=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iscsSystemNew/config/broadcast/stationHome.vue | 14 +++++++------- src/views/newMap/display/terminals/paScreen.vue | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/views/iscs/iscsSystemNew/config/broadcast/stationHome.vue b/src/views/iscs/iscsSystemNew/config/broadcast/stationHome.vue index 7bb698f4d..afb642f6a 100644 --- a/src/views/iscs/iscsSystemNew/config/broadcast/stationHome.vue +++ b/src/views/iscs/iscsSystemNew/config/broadcast/stationHome.vue @@ -490,13 +490,13 @@ export default { audio.pause(); audio.src = this.$store.state.user.ossUrl + info.url; audio.play(); - const _that = this; - audio.addEventListener('ended', function() { - const device = _that.iscsDeviceMap[info.code]; - const div = document.getElementById(device.position); - _that.$set(_that.deviceMap[device.position], 'state', '0'); - div.style.background = '#CCCCCC'; - }, false); + // const _that = this; + // audio.addEventListener('ended', function() { + // const device = _that.iscsDeviceMap[info.code]; + // const div = document.getElementById(device.position); + // _that.$set(_that.deviceMap[device.position], 'state', '0'); + // div.style.background = '#CCCCCC'; + // }, false); } }, setTimerBroadcast() { diff --git a/src/views/newMap/display/terminals/paScreen.vue b/src/views/newMap/display/terminals/paScreen.vue index a84b64e16..fe4d515a0 100644 --- a/src/views/newMap/display/terminals/paScreen.vue +++ b/src/views/newMap/display/terminals/paScreen.vue @@ -52,7 +52,6 @@ export default { } }); this.selectStation = this.$store.state.training.roleDeviceCode; - console.log(this.selectStation, '===='); } this.$store.dispatch('app/animationsClose'); }, From 0b925110703536111c6f7a32c1ed36b3285aa0d6 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 12 Mar 2024 09:52:57 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contest/contestList.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/contest/contestList.vue b/src/views/contest/contestList.vue index c35f5a690..ef4c4b63f 100644 --- a/src/views/contest/contestList.vue +++ b/src/views/contest/contestList.vue @@ -235,6 +235,14 @@ export default { border: solid 1px #01468B; } /deep/{ + table { + border-collapse: collapse; + border: 2px solid #fff; + } + td, th { + border: 1px solid #fff; + padding: 8px; + } .el-tree-node__content{ background-color: transparent !important; } From 21e5b5b659dc7397f8b47ae55c1a2d68a08a1710 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Tue, 12 Mar 2024 10:31:16 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4&&=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/cmdPlugin/newValidateHandler.js | 6 +-- src/utils/date.js | 41 +++++++++++++++++++ .../newMap/display/terminals/terminalMenu.vue | 8 +++- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/src/scripts/cmdPlugin/newValidateHandler.js b/src/scripts/cmdPlugin/newValidateHandler.js index c4ce288c8..771198b74 100644 --- a/src/scripts/cmdPlugin/newValidateHandler.js +++ b/src/scripts/cmdPlugin/newValidateHandler.js @@ -1,4 +1,4 @@ -import { objectIsEqual } from '@/utils/date'; +import { objectIsEqualSp } from '@/utils/date'; import Handler from './newHandler.js'; import { ScriptMode } from '@/scripts/ConstDic'; import store from '@/store/index'; @@ -50,9 +50,9 @@ class ValidateHandler { } } if (linkDataFlag) { - return objectIsEqual(param1, param2) || objectIsEqual(linkParam, param2); + return objectIsEqualSp(param1, param2) || objectIsEqualSp(linkParam, param2); } else { - return objectIsEqual(param1, param2); + return objectIsEqualSp(param1, param2); } } // 判断实训操作正确性 diff --git a/src/utils/date.js b/src/utils/date.js index 729d7adc9..711ed54af 100644 --- a/src/utils/date.js +++ b/src/utils/date.js @@ -121,3 +121,44 @@ export function objectIsEqual(obj1, obj2) { } return true; } +export function checkUndefinedOrNull(key) { + if (key === '' || key === undefined || key === null) { + return false; + } + return true; +} +export function checkTwo(k1, k2) { + console.log(checkUndefinedOrNull(k1), checkUndefinedOrNull(k2), '----', k1, k2); + return checkUndefinedOrNull(k1) || checkUndefinedOrNull(k2); +} +/* 对象是否相等(undefined和空字符串空对象空数组认为相同) */ +export function objectIsEqualSp(obj1, obj2) { + if (!(obj1 instanceof Object)) { + return false; + } else if (!(obj2 instanceof Object)) { + return false; + } + // 仅过滤值为null的项 + const arr1 = Object.keys(obj1).filter(key => { return obj1[key] != null; }); + const arr2 = Object.keys(obj2).filter(key => { return obj2[key] != null; }); + // if (arr1.length !== arr2.length) { + // return false; + // } + for (const key of arr1) { + const index = arr2.findIndex(item => item === key); + arr2.splice(index, 1); + if (obj1[key] instanceof Object && obj2[key] instanceof Object) { + if (!objectIsEqualSp(obj1[key], obj2[key])) { + return false; + } + } else if (obj1[key] !== obj2[key] && checkTwo(obj1[key], obj2[key])) { + return false; + } + } + for (const key of arr2) { + if (obj1[key] !== obj2[key] && checkTwo(obj1[key], obj2[key])) { + return false; + } + } + return true; +} diff --git a/src/views/newMap/display/terminals/terminalMenu.vue b/src/views/newMap/display/terminals/terminalMenu.vue index 893169003..11c855165 100644 --- a/src/views/newMap/display/terminals/terminalMenu.vue +++ b/src/views/newMap/display/terminals/terminalMenu.vue @@ -69,7 +69,7 @@ export default { } else { this.initPictureShow(); } - } else if (clientIdList.length) { + } else if (clientIdList && clientIdList.length) { this.initTerminalList(clientIdList); if (this.$store.state.trainingNew.trainingDetail && this.$store.state.trainingNew.trainingDetail.client) { const client = this.findTerminalFromMap(this.$store.state.trainingNew.trainingDetail.client); @@ -83,7 +83,11 @@ export default { } } else if (!this.terminalList.length) { this.initTerminalList([]); - this.changeQueryClient(); + if (this.$route.query.client && !this.nowTerminal.id) { + this.changeQueryClient(); + } else { + this.initPictureShow(); + } } } },