From 74f7785663edfc9c4a456501e52622dd12de4608 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Fri, 9 Aug 2019 15:52:55 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E9=99=90?=
=?UTF-8?q?=E5=88=B6=E4=BB=BF=E7=9C=9F=E5=A4=9A=E6=AC=A1=E5=8A=A0=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/demonstration/detail/index.vue | 11 ++++++++---
src/views/exam/detail/examDetail.vue | 16 +++++++++++++---
src/views/lesson/trainingmanage/index.vue | 9 ++++++++-
src/views/teach/practical/index.vue | 11 +++++++++--
4 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue
index 47a7737ea..9862f6739 100644
--- a/src/views/demonstration/detail/index.vue
+++ b/src/views/demonstration/detail/index.vue
@@ -24,7 +24,7 @@
购买
权限分发
权限转赠
- 开始仿真
+ 开始仿真
创建房间
进入房间
@@ -78,6 +78,7 @@
EffectiveTypeList: [],
jointShow: false,
jointGroup: '',
+ fullscreenLoading: false
}
},
filters: {
@@ -255,6 +256,7 @@
}
};
} else {
+ this.fullscreenLoading = true;
if (this.courseModel.pmsList.length) {
this.jump();
} else {
@@ -265,7 +267,7 @@
type: 'warning'
}).then(() => {
this.buy();
- }).catch(() => { })
+ }).catch(() => { this.fullscreenLoading = false; })
} else {
this.jump();
}
@@ -279,8 +281,10 @@
let query = { skinStyle: this.courseModel.skinStyle, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
launchFullscreen();
+ this.fullscreenLoading = false;
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
+ this.fullscreenLoading = false;
})
},
buy() {
@@ -288,6 +292,7 @@
path: `${UrlConfig.demonstration.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
});
+ this.fullscreenLoading = false;
},
transfer() {
if (this.$refs) {
@@ -355,4 +360,4 @@
.el-tabs--border-card>.el-tabs__header .el-tabs__item {
font-weight: bold !important;
}
-
\ No newline at end of file
+
diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue
index 78a1503c3..9586b74ca 100644
--- a/src/views/exam/detail/examDetail.vue
+++ b/src/views/exam/detail/examDetail.vue
@@ -190,16 +190,24 @@
center: true
}).then(() => {
this.buy();
- }).catch(() => { });
+ this.loading.close();
+ }).catch(() => { this.loading.close();});
} else if (error.code === 500005) {
this.$messageBox('不在考试范围之内');
+ this.loading.close();
} else {
this.$messageBox(`${error.message}`);
-
+ this.loading.close();
}
}
},
exmaStart() {
+ const loading = this.$loading({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
this.examDetail();
if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => {
@@ -212,8 +220,10 @@
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen();
+ this.loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
+ this.loading.close();
})
}
}
@@ -291,4 +301,4 @@
justify-content: center;
transform: translateY(-20px);
}
-
\ No newline at end of file
+
diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue
index f76525aaa..bba02cb75 100644
--- a/src/views/lesson/trainingmanage/index.vue
+++ b/src/views/lesson/trainingmanage/index.vue
@@ -271,14 +271,21 @@ export default {
this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' });
},
demoDisplay(index, node) {
+ const loading = this.$loading({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
trainingNotify({ trainingId: node.id }).then(resp => {
/** 区分演示和正式,需要在演示时设置lessonId为0*/
const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
-
launchFullscreen();
+ this.loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
+ this.loading.close();
});
},
diff --git a/src/views/teach/practical/index.vue b/src/views/teach/practical/index.vue
index 7d8be1d9e..c5d6e1b42 100644
--- a/src/views/teach/practical/index.vue
+++ b/src/views/teach/practical/index.vue
@@ -88,15 +88,22 @@
}
},
start() {
+ const loading = this.$loading({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
trainingNotify({ trainingId: this.$route.params.trainingId }).then(resp => {
let query = {
group: resp.data, trainingId: this.$route.params.trainingId, lessonId: this.$route.params.lessonId
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
-
+ loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
+ loading.close();
});
}
}
@@ -126,4 +133,4 @@
justify-content: center;
transform: translateY(-20px);
}
-
\ No newline at end of file
+
From 367edf0118d035332be3c51e0669e89803fa7ed6 Mon Sep 17 00:00:00 2001
From: fan <18706759286@163.com>
Date: Fri, 9 Aug 2019 17:38:20 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/jmap/theme/beijing_01/menus/menuBar.vue | 4 +-
.../theme/beijing_01/menus/menuCancel.vue | 56 +++++++++----------
src/views/demonstration/detail/index.vue | 16 +++---
src/views/display/index.vue | 7 +++
src/views/exam/detail/examDetail.vue | 10 +---
src/views/lesson/trainingmanage/index.vue | 1 -
src/views/teach/practical/index.vue | 1 -
7 files changed, 50 insertions(+), 45 deletions(-)
diff --git a/src/jmap/theme/beijing_01/menus/menuBar.vue b/src/jmap/theme/beijing_01/menus/menuBar.vue
index 35503f55f..b7f71d2eb 100644
--- a/src/jmap/theme/beijing_01/menus/menuBar.vue
+++ b/src/jmap/theme/beijing_01/menus/menuBar.vue
@@ -750,7 +750,9 @@ export default {
},
initMenu(menu) {
this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode);
- this.menu[2].children = this.initStationList();
+ if (this.menu[2]){
+ this.menu[2].children = this.initStationList();
+ }
this.clickEvent();
this.closeMenu(true);
},
diff --git a/src/jmap/theme/beijing_01/menus/menuCancel.vue b/src/jmap/theme/beijing_01/menus/menuCancel.vue
index 5c03e47ef..97809c807 100644
--- a/src/jmap/theme/beijing_01/menus/menuCancel.vue
+++ b/src/jmap/theme/beijing_01/menus/menuCancel.vue
@@ -74,41 +74,41 @@ export default {
};
},
initMenu() {
- // this.menuNormal = [];
- // this.stationList.forEach(station => {
- // if (station.code === station.concentrateStationCode) {
- // let node = {
- // label: station.name,
- // children: []
- // }
+ this.menuNormal = [];
+ this.stationList.forEach(station => {
+ if (station.code === station.concentrateStationCode) {
+ let node = {
+ label: station.name,
+ children: []
+ }
- // this.stationList.forEach(elem => {
- // if (elem.visible) {
- // let next = elem;
- // while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
- // next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
- // }
+ this.stationList.forEach(elem => {
+ if (elem.visible) {
+ let next = elem;
+ while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
+ next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
+ }
- // if (station.code == next.code) {
- // node.children.push({
- // code: elem.code,
- // label: elem.name,
- // handler: this.mapLocation,
- // });
- // }
- // }
- // })
+ if (station.code == next.code) {
+ node.children.push({
+ code: elem.code,
+ label: elem.name,
+ handler: this.mapLocation,
+ });
+ }
+ }
+ })
- // this.menuNormal.push(node);
- // }
- // });
+ this.menuNormal.push(node);
+ }
+ });
if (this.isScreen) {
this.menu = [...this.menuScreen];
}
- // else {
- // this.menu = [...this.menuNormal];
- // }
+ else {
+ this.menu = [...this.menuNormal];
+ }
},
doShow(point) {
this.clickEvent();
diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue
index 9862f6739..f6e790700 100644
--- a/src/views/demonstration/detail/index.vue
+++ b/src/views/demonstration/detail/index.vue
@@ -24,7 +24,7 @@
购买
权限分发
权限转赠
- 开始仿真
+ 开始仿真
创建房间
进入房间
@@ -78,7 +78,6 @@
EffectiveTypeList: [],
jointShow: false,
jointGroup: '',
- fullscreenLoading: false
}
},
filters: {
@@ -256,18 +255,24 @@
}
};
} else {
- this.fullscreenLoading = true;
+ const loading = this.$loading({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
if (this.courseModel.pmsList.length) {
this.jump();
} else {
if (this.tryTime <= 1) {
+ this.loading.close();
this.$confirm('您没有权限,请前往购买产品', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.buy();
- }).catch(() => { this.fullscreenLoading = false; })
+ }).catch(() => { })
} else {
this.jump();
}
@@ -281,10 +286,8 @@
let query = { skinStyle: this.courseModel.skinStyle, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
launchFullscreen();
- this.fullscreenLoading = false;
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
- this.fullscreenLoading = false;
})
},
buy() {
@@ -292,7 +295,6 @@
path: `${UrlConfig.demonstration.pay}/${this.courseModel.id}`,
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
});
- this.fullscreenLoading = false;
},
transfer() {
if (this.$refs) {
diff --git a/src/views/display/index.vue b/src/views/display/index.vue
index 162334653..acc787826 100644
--- a/src/views/display/index.vue
+++ b/src/views/display/index.vue
@@ -196,6 +196,13 @@ export default {
},
async created() {
this.group = this.$route.query.group || '';
+ const loading = this.$loading({
+ lock: true ,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
+ loading.close();
},
async mounted() {
this.mode = this.$route.params.mode;
diff --git a/src/views/exam/detail/examDetail.vue b/src/views/exam/detail/examDetail.vue
index 9586b74ca..1cf53289f 100644
--- a/src/views/exam/detail/examDetail.vue
+++ b/src/views/exam/detail/examDetail.vue
@@ -181,6 +181,7 @@
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
await this.$store.dispatch('trainingList/setTrainingList', list);
} catch (error) {
+ this.loading.close();
//判断是否有考试权限,如果没有权限则跳到购买页面,否则报错
if (error.code === 500004) {
this.$confirm('无此课程的考试权限,请前往购买!', '提示', {
@@ -190,14 +191,11 @@
center: true
}).then(() => {
this.buy();
- this.loading.close();
- }).catch(() => { this.loading.close();});
+ }).catch(() => { });
} else if (error.code === 500005) {
this.$messageBox('不在考试范围之内');
- this.loading.close();
} else {
this.$messageBox(`${error.message}`);
- this.loading.close();
}
}
},
@@ -216,11 +214,9 @@
trainingId: this.examList[0].trainingId,
userExamId: this.userExam.id,
examQuestionId: this.examList[0].id
- }
-
+ };
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
launchFullscreen();
- this.loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.loading.close();
diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue
index bba02cb75..f61a82be8 100644
--- a/src/views/lesson/trainingmanage/index.vue
+++ b/src/views/lesson/trainingmanage/index.vue
@@ -282,7 +282,6 @@ export default {
const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
launchFullscreen();
- this.loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
this.loading.close();
diff --git a/src/views/teach/practical/index.vue b/src/views/teach/practical/index.vue
index c5d6e1b42..15c3c6957 100644
--- a/src/views/teach/practical/index.vue
+++ b/src/views/teach/practical/index.vue
@@ -100,7 +100,6 @@
};
this.$router.push({ path: `${UrlConfig.display}/teach`, query: query });
launchFullscreen();
- loading.close();
}).catch(error => {
this.$messageBox(`创建仿真失败: ${error.message}`);
loading.close();