Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
joylink_cuiweidong 2023-02-13 15:56:59 +08:00
commit ffbc056569
10 changed files with 147 additions and 99 deletions

View File

@ -926,6 +926,21 @@ export const menuOperate = {
equipmentConstructionQuery:{
operation: OperationEvent.RailCommand.equipmentConstructionQuery.menu.operation,
cmdType: CMD.RAIL.CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY
},
// 防洪安全上岗签到表 提交
floodControlSafetyTableSave:{
operation: OperationEvent.FloodSafetyRegister.formInput.submit.operation,
cmdType: CMD.RAIL.CMD_RAIL_FLOOD_CONTROL_SAFETY_SUBMIT
},
// 防洪安全上岗签到表 更新
floodControlSafetyTableUpdate:{
operation: OperationEvent.FloodSafetyRegister.formInput.update.operation,
cmdType: CMD.RAIL.CMD_RAIL_FLOOD_CONTROL_SAFETY_UPDATE
},
// 非正常情况接发列车关键环节控制表 提交
abnormalTrainTableSave:{
operation: OperationEvent.AbnormalTrainRegister.formInput.submit.operation,
cmdType: CMD.RAIL.CMD_RAIL_ABNORMAL_TRAIN_SAVE
}
},
Conversation: {

View File

@ -41,7 +41,7 @@ class TransformHandle {
// const scale = parseFloat((20 / this.scaleIndex).toFixed(2));
const scaleRate = this.$painter.$jmap.$options.getScaleRate();
if (scaleRate < 1) {
view.trainB.mouseEvent.arrowText.setStyle({ textFont: (10 / scaleRate).ceil() + 'px consolas' });
view.trainB.mouseEvent.arrowText.setStyle({ textFont: Math.ceil(10 / scaleRate) + 'px consolas' });
}
}

View File

@ -501,7 +501,10 @@ export default {
CMD_RAIL_QUERY_REGISTER: {value: 'RAIL_QUERY_REGISTER', label: '查询行车簿册'},
CMD_RAIL_GIVE_TICKET_TO: {value: 'RAIL_GIVE_TICKET_TO', label: '给出票据'},
CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_SAVE:{value: 'EQUIPMENT_CONSTRUCTION_INFO_SAVE', label: '填写施工登记簿册'},
CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY:{value: 'EQUIPMENT_CONSTRUCTION_INFO_QUERY', label: '查询施工登记簿册'}
CMD_RAIL_EQUIPMENT_CONSTRUCTION_INFO_QUERY:{value: 'EQUIPMENT_CONSTRUCTION_INFO_QUERY', label: '查询施工登记簿册'},
CMD_RAIL_FLOOD_CONTROL_SAFETY_SUBMIT:{value: 'CONTROL_FLOOD_SIGN_SAVE', label: '填写防洪安全上岗签到表'},
CMD_RAIL_FLOOD_CONTROL_SAFETY_UPDATE:{value: 'CONTROL_FLOOD_SIGN_UPDATE', label: '更新防洪安全上岗签到表'},
CMD_RAIL_ABNORMAL_TRAIN_SAVE:{value: 'KEY_LINK_CONTROL_INFO_SAVE', label: '填写非正常情况接发列车关键环节控制表'}
},
Conversation: {
CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'},

View File

@ -22,22 +22,34 @@ class ValidateHandler {
valid = false;
} return valid;
}
checkDeviceCodeConsistent(deviceCode1, deviceCode2) {
const linkDeviceCode1 = store.state.map.linkSwitchMap[deviceCode1];
console.log(deviceCode1, deviceCode2, linkDeviceCode1, linkDeviceCode1 === deviceCode2);
isNeedCheckLinkSwitch(operation) {
// 道岔单锁/单解 单操到定位/反位
const needCheckLinkSwitchOperation = [OperationEvent.Switch.lock.menu.operation, OperationEvent.Switch.unlock.menu.operation,
OperationEvent.Switch.locate.menu.operation, OperationEvent.Switch.reverse.menu.operation, OperationEvent.Switch.lock.button.operation,
OperationEvent.Switch.unlock.button.operation, OperationEvent.Switch.locate.button.operation, OperationEvent.Switch.reverse.button.operation,
OperationEvent.Switch.turnout.menu.operation, OperationEvent.Switch.turnout.menuButton.operation, OperationEvent.Switch.lock.menuButton.operation,
OperationEvent.Switch.unlock.menuButton.operation, OperationEvent.Switch.locate.menuButton.operation, OperationEvent.Switch.reverse.menuButton.operation];
return needCheckLinkSwitchOperation.includes(operation);
}
checkDeviceCodeConsistent(deviceCode1, deviceCode2, operation) {
let linkDeviceCode1 = '';
if (this.isNeedCheckLinkSwitch(operation)) {
linkDeviceCode1 = store.state.map.linkSwitchMap[deviceCode1];
}
return deviceCode1 === deviceCode2 || linkDeviceCode1 === deviceCode2;
}
checkParamConsistent(param1, param2) {
checkParamConsistent(param1, param2, operation) {
const linkParam = {};
let linkDataFlag = false;
for (const key in param1) {
linkParam[key] = param1[key];
if (store.state.map.linkSwitchMap[param1[key]]) {
linkDataFlag = true;
linkParam[key] = store.state.map.linkSwitchMap[param1[key]];
if (this.isNeedCheckLinkSwitch(operation)) {
for (const key in param1) {
linkParam[key] = param1[key];
if (store.state.map.linkSwitchMap[param1[key]]) {
linkDataFlag = true;
linkParam[key] = store.state.map.linkSwitchMap[param1[key]];
}
}
}
console.log(linkDataFlag, linkParam, param2, objectIsEqual(linkParam, param2));
if (linkDataFlag) {
return objectIsEqual(param1, param2) || objectIsEqual(linkParam, param2);
} else {
@ -58,7 +70,7 @@ class ValidateHandler {
valid = (cmd === stepOperation.operationType) && valid;
}
if (operate.code || stepOperation.deviceCode) {
valid = this.checkDeviceCodeConsistent(operate.code, stepOperation.deviceCode) && valid;
valid = this.checkDeviceCodeConsistent(operate.code, stepOperation.deviceCode, operate.operation) && valid;
}
if (stepOperation.subType) {
valid = (operate.subType === stepOperation.subType) && valid;
@ -70,29 +82,26 @@ class ValidateHandler {
valid = (operate.userOperationType === stepOperation.userOperationType) && valid;
}
if (stepOperation.val) {
// || operate.val
valid = ((operate.val).toString() === stepOperation.val.toString()) && valid;
}
const opParam = operate.param === undefined ? {} : operate.param;
if ((opParam || stepOperation.params) && !opParam.hasOwnProperty('fileBase64Str')) {
valid = this.checkParamConsistent(opParam, stepOperation.params) && valid;
valid = this.checkParamConsistent(opParam, stepOperation.params, operate.operation) && valid;
}
if (valid && store.state.trainingNew.voiceStepIndex > -1) {
!Handler.isLastVoiceStep() && store.dispatch('trainingNew/voiceStepIndexIncrease');
} else if (valid && Handler.isLastOperation()) {
store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation, operate });
store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation });
Handler.nextStep();
} else if (valid) {
store.dispatch('trainingNew/operateOrderIncrease');
store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation, operate });
store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation });
Handler.judgeIsTextSendOperation();
} else {
console.log(operate, stepOperation, '----------');
if (store.state.trainingNew.voiceStepIndex < 0) {
store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation, operate });
}
store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation });
console.error('校验失败;');
}
return valid;

View File

@ -103,7 +103,6 @@ const training = {
setVoiceStepList: (state, voiceStepList) => {
state.voiceStepIndex = 0;
state.voiceStepList = voiceStepList;
console.log(voiceStepList, state.voiceStepIndex);
},
voiceStepIndexIncrease: (state) => {
state.voiceStepIndex++;
@ -115,7 +114,10 @@ const training = {
setExamSwitch: (state, flag) => {
state.examSwitch = flag;
},
handleStepRecord: (state, { type, stepOperation, operate }) => {
handleStepRecord: (state, { type, stepOperation }) => {
if (!state.stepRecord.length) {
return;
}
const step = state.stepRecord[state.stepRecord.length - 1];
if (!step.clientOperations.length || step.clientOperations[step.clientOperations.length - 1].id !== stepOperation.id) {
step.clientOperations.push({ id: stepOperation.id });
@ -198,19 +200,23 @@ const training = {
commit('clearVoiceStepList');
},
handleMatchVoice: ({ commit }, info) => {
const stepOperation = Handler.getTrainingOperation();
if (info && info.content === 'true') {
const rightMsg = {errMsg: LangStorage.getLang() === 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green'};
commit('setOperateErrMsg', rightMsg);
if (Handler.isLastOperation()) {
store.dispatch('trainingNew/handleStepRecord', { type:'OVER', stepOperation });
Handler.nextStep();
commit('clearVoiceStepList');
} else {
store.dispatch('trainingNew/handleStepRecord', { type:'CONTINUE', stepOperation });
commit('clearVoiceStepList');
commit('operateOrderIncrease');
Handler.judgeIsTextSendOperation();
}
} else if (info && info.content === 'false') {
const errorMsg = {errMsg: LangStorage.getLang() === 'en' ? 'operation mistake!' : '操作错误!', color: 'red'};
store.dispatch('trainingNew/handleStepRecord', { type:'ERROR', stepOperation });
commit('setOperateErrMsg', errorMsg);
Handler.handleVoiceStepList();
}
@ -218,8 +224,8 @@ const training = {
setExamSwitch: ({ commit }, flag) => {
commit('setExamSwitch', flag);
},
handleStepRecord: ({ commit }, { type, stepOperation, operate }) => {
commit('handleStepRecord', { type, stepOperation, operate });
handleStepRecord: ({ commit }, { type, stepOperation }) => {
commit('handleStepRecord', { type, stepOperation });
}
}
};

View File

@ -147,7 +147,9 @@ export default {
}
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
await loadPublishTraining(this.$route.query.group, training.questionId, {mode: ''});
await assignUsersPlayRoles([{userId: this.$store.state.user.id, memberId: this.examSceneRuleMap[training.questionId]}], this.$route.query.group);
if (detailResp.data.type === 'SCENE') {
await assignUsersPlayRoles([{userId: this.$store.state.user.id, memberId: this.examSceneRuleMap[training.questionId]}], this.$route.query.group);
}
this.$message.success('加载实训成功!');
} catch (e) {
this.$message.error('加载实训失败!');

View File

@ -158,7 +158,8 @@
<script>
import { deepAssign } from '@/utils/index';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { sendCommandNew } from '@/api/jmap/training';
// import { sendCommandNew } from '@/api/jmap/training';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'ControlTable',
props: {
@ -268,20 +269,26 @@ export default {
// }
// });
// obj.registerInfoList = list;
const operate = {
operation: this.formInput.submit.operation,
param: obj
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => {
console.log(res, '---res');
this.$message.success('提交成功!');
this.initFormData();
}).catch(error => {
this.$messageBox('提交失败:' + error.message);
});
}
// const operate = {
// operation: this.formInput.submit.operation,
// param: obj
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_SAVE', obj).then((res) => {
// console.log(res, '---res');
// this.$message.success('');
// this.initFormData();
// }).catch(error => {
// this.$messageBox('' + error.message);
// });
// }
// });
commitOperate(menuOperate.Rail.abnormalTrainTableSave, obj, 2).then(({valid, operate})=>{
this.$message.success('提交成功!');
this.initFormData();
}).catch((error)=>{
this.$messageBox('提交失败:' + error.message);
});
},
initFormData() {

View File

@ -89,6 +89,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { sendCommandNew } from '@/api/jmap/training';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name:'EquipmentConstructionTable',
data() {
@ -229,21 +230,13 @@ export default {
saveData(data, index) {
// if (this.isAdd) {
const params = Object.assign({stationCode:this.$store.state.training.roleDeviceCode}, data);
const operate = {
operation: this.constructionFillIn.operation,
param: params
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'EQUIPMENT_CONSTRUCTION_INFO_SAVE', params).then((res) => {
this.$message.success('保存成功!');
this.queryData();
this.isEditing = false;
this.isAdd = false;
}).catch(() => {
this.$message.error('保存行车设备施工登记簿失败!');
});
}
commitOperate(menuOperate.Rail.equipmentConstructionFill, params, 2).then(({valid, operate})=>{
this.queryData();
this.isEditing = false;
this.isAdd = false;
this.$message.success('保存成功!');
}).catch(()=>{
this.$message.error('保存行车设备施工登记簿失败!');
});
// }
// }else{

View File

@ -132,7 +132,8 @@
<script>
import { deepAssign } from '@/utils/index';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { sendCommandNew } from '@/api/jmap/training';
// import { sendCommandNew } from '@/api/jmap/training';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'ControlTable',
props: {
@ -183,6 +184,13 @@ export default {
return sList;
}
},
watch: {
info() {
if (this.active == 'search') {
this.getInfoData();
}
}
},
created() {
if (this.active == 'write') {
this.initFormData();
@ -266,38 +274,50 @@ export default {
submit() {
const obj = deepAssign({}, this.form);
delete obj.id;
const operate = {
operation: this.formInput.submit.operation,
param: obj
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_SAVE', obj).then((res) => {
console.log(res, '---res');
this.$message.success('提交成功!');
this.initFormData();
}).catch(error => {
this.$messageBox('提交失败:' + error.message);
});
}
// const operate = {
// operation: this.formInput.submit.operation,
// param: obj
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_SAVE', obj).then((res) => {
// console.log(res, '---res');
// this.$message.success('');
// this.initFormData();
// }).catch(error => {
// this.$messageBox('' + error.message);
// });
// }
// });
commitOperate(menuOperate.Rail.floodControlSafetyTableSave, obj, 2).then(({valid, operate})=>{
this.$message.success('提交成功!');
this.initFormData();
}).catch((error)=>{
this.$messageBox('提交失败:' + error.message);
});
},
update() {
const obj = deepAssign({}, this.form);
const operate = {
operation: this.formInput.update.operation,
param: obj
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_UPDATE', obj).then((res) => {
console.log(res, '---res');
this.$message.success('更新成功!');
this.isEdit = false;
}).catch(error => {
this.$messageBox('更新失败:' + error.message);
});
}
// const operate = {
// operation: this.formInput.update.operation,
// param: obj
// };
// this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
// if (valid) {
// sendCommandNew(this.group, 'CONTROL_FLOOD_SIGN_UPDATE', obj).then((res) => {
// console.log(res, '---res');
// this.$message.success('');
// this.isEdit = false;
// }).catch(error => {
// this.$messageBox('' + error.message);
// });
// }
// });
commitOperate(menuOperate.Rail.floodControlSafetyTableUpdate, obj, 2).then(({valid, operate})=>{
this.$message.success('更新成功!');
this.isEdit = false;
}).catch((error)=>{
this.$messageBox('更新失败:' + error.message);
});
},
changeEdit() {

View File

@ -110,10 +110,12 @@
</template>
<script>
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import FloodControlSafetyTable from './floodControlSafetyTable/index';
import EquipmentConstructionTable from './equipmentConstructionTable';
import AbnormalTrain from './abnormalTrain/index';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { sendCommandNew } from '@/api/jmap/training';
// key-link-control-table
@ -168,8 +170,7 @@ export default {
this.queryData();
},
queryData() {
const params = { stationCode: this.$store.state.training.roleDeviceCode};
sendCommandNew(this.group, 'RAIL_QUERY_REGISTER', params).then((response) => {
sendCommandNew(this.group, CMD.RAIL.CMD_RAIL_QUERY_REGISTER.value, { stationCode: this.$store.state.training.roleDeviceCode}).then(response => {
this.tableData = response.data ? response.data.lines : [];
this.dataIndex = null;
}).catch(() => {
@ -178,19 +179,11 @@ export default {
},
saveData(data) {
const params = { stationCode: this.$store.state.training.roleDeviceCode, line: data };
const operate = {
operation: this.railFillInRegister.operation,
param: params
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
sendCommandNew(this.group, 'RAIL_FILL_IN_REGISTER', params).then((res) => {
this.$message.success('保存成功!');
this.queryData();
}).catch(() => {
this.$message.error('保存簿册失败!');
});
}
commitOperate(menuOperate.Rail.railFillInRegister, params, 2).then(({valid, operate})=>{
this.queryData();
this.$message.success('保存成功!');
}).catch(()=>{
this.$message.error('保存簿册失败!');
});
},
add() {