diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js
index e8961c27d..9ba06b287 100644
--- a/src/scripts/cmdPlugin/CommandHandler.js
+++ b/src/scripts/cmdPlugin/CommandHandler.js
@@ -164,21 +164,55 @@ class CommandHandle {
return new Promise((resolve, reject) => {
const group = router.currentRoute.query.group;
const newApi = router.currentRoute.query.newApi + '';
- if (newApi === 'true') {
- const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
- sendSimulationCommand(group, userInfo.memberId, id, command).then((response) => {
- resolve(response);
- }).catch(error => {
- reject(error);
- });
- } else {
- sendCommandNew(group, id, command).then((response) => {
- resolve(response);
- }).catch(error => {
- reject(error);
- });
+ if (router.currentRoute.path.includes('trainingDesign')) {
+ store.dispatch('trainingNew/setSceneOperate', {id, command});
+ }
+ if (store.state.trainingNew.trainingSwitch) {
+ const stepList = JSON.parse(store.state.trainingNew.trainingDetail.stepJson);
+ const step = stepList.find(item => item.id == store.state.trainingNew.stepOrder );
+ const operateIndex = step.operations.findIndex(item => item.id == store.state.trainingNew.operateOrder);
+ const stepOperation = step.operations[operateIndex];
+ let flag = true;
+ if (stepOperation.operationType !== id) {
+ flag = false;
+ }
+ for (const item in stepOperation.params) {
+ flag = command[item] === stepOperation.params[item] && flag;
+ }
+ if (flag) {
+ if (newApi === 'true') {
+ const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
+ sendSimulationCommand(group, userInfo.memberId, id, command).then((response) => {
+ resolve(response);
+ }).catch(error => {
+ reject(error);
+ });
+ } else {
+ sendCommandNew(group, id, command).then((response) => {
+ resolve(response);
+ }).catch(error => {
+ reject(error);
+ });
+ }
+ } else {
+ store.dispatch('setOperateErrMsg');
+ }
+ } else {
+ if (newApi === 'true') {
+ const userInfo = store.state.training.simulationUserList.find(el => el.id == store.state.user.id);
+ sendSimulationCommand(group, userInfo.memberId, id, command).then((response) => {
+ resolve(response);
+ }).catch(error => {
+ reject(error);
+ });
+ } else {
+ sendCommandNew(group, id, command).then((response) => {
+ resolve(response);
+ }).catch(error => {
+ reject(error);
+ });
+ }
}
-
});
}
diff --git a/src/store/modules/training.js b/src/store/modules/training.js
index a88f80426..a1c7a2ec7 100644
--- a/src/store/modules/training.js
+++ b/src/store/modules/training.js
@@ -442,7 +442,7 @@ const training = {
// 处理operation
Handler.handle(operate).then(rtn => {
- if (store.state.trainingNew.trainingSwitch) {
+ if (store.state.trainingNew.trainingSwitch && store.state.trainingNew.trainingDetail.type === 'SINGLE') {
store.dispatch('trainingNew/checkTrainingOperate', operate).then(res => {
commit('setOperateErrMsg', { errMsg: LangStorage.getLang() == 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green' });
resolve(rtn);
@@ -677,6 +677,9 @@ const training = {
},
setUserRole: ({ commit }, userRole) => {
commit('setUserRole', userRole);
+ },
+ setOperateErrMsg: ({ commit }) => {
+ commit('setOperateErrMsg', { errMsg: '操作错误!', color: 'red' });
}
}
};
diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js
index eb137e555..c4c70b3f6 100644
--- a/src/store/modules/trainingNew.js
+++ b/src/store/modules/trainingNew.js
@@ -6,6 +6,7 @@ const training = {
trainingSwitch: false, // 实训开始结束标志
trainingOperate: null,
simulationPause: false, // 实训 暂停判断
+ sceneOperate: null,
stepOrder: 0,
operateOrder: 0,
stepOverCount: 0,
@@ -32,6 +33,9 @@ const training = {
},
trainingScore: (state) => {
return state.trainingScore;
+ },
+ sceneOperate: (state) => {
+ return state.sceneOperate;
}
},
mutations: {
@@ -70,6 +74,9 @@ const training = {
},
setTrainingScore: (state, score) => {
state.trainingScore = score;
+ },
+ setSceneOperate: (state, sceneOperate) => {
+ state.sceneOperate = sceneOperate;
}
},
actions: {
@@ -109,6 +116,9 @@ const training = {
setTrainingScore: ({commit}, score) => {
commit('setTrainingScore', score);
},
+ setSceneOperate: ({commit}, sceneOperate) => {
+ commit('setSceneOperate', sceneOperate);
+ },
checkTrainingOperate:({commit, state}, trainingOperate) => {
return new Promise((resolve, reject) => {
const stepList = JSON.parse(state.trainingDetail.stepJson);
diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js
index 8eced22fe..a1a9e525a 100644
--- a/src/utils/baseUrl.js
+++ b/src/utils/baseUrl.js
@@ -25,13 +25,13 @@ export function handlerUrl(data) {
// const data = null;
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
- BASE_API = 'http://192.168.3.233/rtss-server';
+ // BASE_API = 'http://192.168.3.233/rtss-server';
// BASE_API = 'http://114.116.51.125/jlcloud';
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪
// BASE_API = 'http://192.168.3.94:9000'; // 旭强
// BASE_API = 'http://192.168.3.15:9000'; // 张赛
// BASE_API = 'http://192.168.3.5:9000'; // 夏增彬
- // BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
+ BASE_API = 'http://192.168.3.37:9000'; // 卫志宏
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛
diff --git a/src/views/designPlatform/trainingPositionTip.vue b/src/views/designPlatform/trainingPositionTip.vue
index 1ffd7bf4e..714cbae83 100644
--- a/src/views/designPlatform/trainingPositionTip.vue
+++ b/src/views/designPlatform/trainingPositionTip.vue
@@ -29,15 +29,21 @@ export default {
...mapGetters([
'canvasWidth',
'canvasHeight'
- ])
+ ]),
+ trainingDetail() {
+ return this.$store.state.trainingNew.trainingDetail;
+ }
},
watch: {
'$store.state.socket.trainingStepTip': function(val) {
- if (val) {
+ if (val && this.trainingDetail.type === 'SINGLE') {
+ const member = this.$store.state.training.memberData[val.memberId];
this.$nextTick(function() {
this.$store.dispatch('trainingNew/clearOperateOrder');
this.$store.dispatch('trainingNew/stepOrderIncrease');
- this.tipInit();
+ if (member.userId == this.$store.state.user.id) {
+ this.tipInit();
+ }
});
}
},
@@ -65,7 +71,7 @@ export default {
if (steps && steps.length) {
const step = steps[stepOrder - 1];
const distance = 5;
- this.tip = this.$store.state.socket.trainingStepTip;
+ this.tip = this.$store.state.socket.trainingStepTip.content;
if (step && step.tipPosition && step.tipPosition.deviceCode) {
const position = this.getShapeTipPoint(step.tipPosition);
if (position) {
@@ -77,7 +83,6 @@ export default {
}
} else if (step && step.tipPosition && step.tipPosition.domId) {
const position = this.getOtherTipPoint(step.tipPosition);
- console.log(position, '**********', step);
if (position) {
this.position = position;
this.position.y -= distance;
diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue
index b6a6a29fb..0d251ef63 100644
--- a/src/views/designPlatform/trainingPreview.vue
+++ b/src/views/designPlatform/trainingPreview.vue
@@ -4,7 +4,7 @@