From 8856586404489f03aaefc9dfdd9ef80e97e1def5 Mon Sep 17 00:00:00 2001 From: fan Date: Wed, 7 Dec 2022 09:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=88=97=E8=A1=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../display/trainingList/trainingLeftSlider.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/views/newMap/display/trainingList/trainingLeftSlider.vue b/src/views/newMap/display/trainingList/trainingLeftSlider.vue index 1fc4cf167..0362d817d 100644 --- a/src/views/newMap/display/trainingList/trainingLeftSlider.vue +++ b/src/views/newMap/display/trainingList/trainingLeftSlider.vue @@ -36,23 +36,30 @@ export default { return this.$route.query.mapId; }, trainingDetail() { - console.log(this.$store.state.trainingNew.trainingDetail, '****'); return this.$store.state.trainingNew.trainingDetail; }, group () { return this.$route.query.group; + }, + trainingSwitch() { + return this.$store.state.trainingNew.trainingSwitch; } }, mounted() { EventBus.$on('handleSliderShow', () => { + if (!this.trainingList || !this.trainingList.length) { + this.initLoadPage(); + } this.handleSliderShow(true); }); - this.initLoadPage(); }, methods: { initLoadPage() { - getPublishTrainingListInOrg({mapId: this.mapId}).then(response => { + const trainingType = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingType : ''; + console.log(trainingType, this.$store.state.training.domConfig); + getPublishTrainingListInOrg({mapId: this.mapId, type: trainingType.toLowerCase() + 's'}).then(response => { this.trainingList = response.data; + // EventBus.$emit('setTrainingList', this.trainingList); }).catch(error => { this.$message.error(this.$t('tip.failedCourse') + ':' + error.message); });