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

This commit is contained in:
fan 2023-02-13 14:09:04 +08:00
commit f4180c579c
12 changed files with 505 additions and 113 deletions

View File

@ -63,7 +63,7 @@
</el-row>
<notice-info ref="noticeInfo" :pop-class="popClass" />
<password-box ref="passwordBox" :pop-class="popClass" @checkOver="passWordCommit" />
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose"/>
<ning-bo-confirm-tip ref="ningBoConfirmTip" @close="doClose" />
</el-dialog>
</template>
@ -158,7 +158,7 @@ export default {
},
methods: {
doShow(operate, selected) {
this.$root.$emit('dialogOpen', selected);
this.$root.$emit('dialogOpen', selected);
this.selected = selected;
if (!this.dialogShow) {
this.switchName = '';
@ -198,7 +198,7 @@ export default {
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
mouseCancelState(this.selected);
},

View File

@ -2,18 +2,21 @@
<div>
<pop-menu ref="popMenu" :menu="menu" />
<set-fault ref="setFault" pop-class="fuzhou-01__systerm" />
<set-train-operation ref="setTrainOperation" pop-class="fuzhou-01__systerm" />
</div>
</template>
<script>
import PopMenu from '@/components/PopMenu';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import SetTrainOperation from '@/jmapNew/theme/components/menus/dialog/setTrainOperation';
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
import { DeviceMenu } from '@/scripts/ConstDic';
export default {
name: 'MenuTrain',
components: {
PopMenu,
SetFault
SetFault,
SetTrainOperation
},
props: {
selected: {
@ -33,6 +36,39 @@ export default {
return {
menu:[],
menuNormal: [
{
label: '切换驾驶模式',
children: [
{
label: '转AM-C模式',
handler: this.handlerApplyAmcMode
},
{
label: '转SM-C模式',
handler: this.handlerApplySmcMode
},
{
label: '转AM-I模式',
handler: this.handlerApplyAmiMode
},
{
label: '转SM-I模式',
handler: this.handlerApplySmiMode
},
{
label: '转RM模式',
handler: this.handlerApplyRmMode
}
]
},
{
label: '转NRM模式',
handler: this.handlerApplyNrmMode
},
{
label: '开关门',
handler: this.handleOpenOrCloseDoor
},
{
label: '换端',
handler: this.handleTurnDirection
@ -41,6 +77,10 @@ export default {
label: '驾驶',
handler: this.handleDriveTo
},
{
label: '连挂',
handler: this.setLink
},
{
label: '回库',
handler: this.setInbound
@ -86,6 +126,68 @@ export default {
}
});
},
// NRM
handlerApplyNrmMode() {
commitOperate(menuOperate.Driver.applyNrm, { groupNumber: this.selected.code }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
handleOpenOrCloseDoor() {
commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// AM-C
handlerApplyAmcMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// SM-C
handlerApplySmcMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
// AM-I
handlerApplyAmiMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handlerApplySmiMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
handlerApplyRmMode() {
commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 3).then(({ valid, operate }) => {
}).catch((error) => {
console.error(error);
this.$refs.noticeInfo.doShow();
});
},
//
setLink() {
commitOperate(menuOperate.Common.setLink, { code: this.selected.code }, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.setTrainOperation.doShow(menuOperate.Common.setLink, this.selected, true);
}
});
},
doShow(point) {
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {

View File

@ -250,6 +250,16 @@ export const menuOperate = {
// 取消分路不良
operation: OperationEvent.Switch.cancelDefectiveShunting.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CANCEL_DEFECTIVE_SHUNTING
},
beforeForkDirective:{
// 岔前分路不良
operation: OperationEvent.Switch.defectiveShunting.before.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT
},
locateForkDirective:{
// 定位分路不良
operation: OperationEvent.Switch.defectiveShunting.locate.operation,
cmdType: CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED
}
},
StationStand:{
@ -916,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

@ -0,0 +1,112 @@
<template>
<el-dialog
v-dialogDrag
class="switch-control chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row justify="center" style="text-align: center;margin-bottom: 10px;">
分路不良请输入第1重密码
</el-row>
<el-row justify="center" style="text-align:center;">
<el-input v-model="passwordCheck" placeholder="" size="medium" type="password" style="width: 180px;display: inline-block;margin-bottom: 10px;" />
</el-row>
<el-row v-if="showMistake" style="margin-bottom: 10px;text-align: center;">
<el-col :span="22" :offset="1">
<span class="password-error">*密码输入错误请重新输入*</span>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="3">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {
name: 'DefectivePasswordBox',
components: {
},
data() {
return {
/* 写死的初始密码*/
correctPassword: '123',
/* 输入值*/
passwordCheck: '',
dialogShow: false,
loading: false,
title:'铅封按钮,请输入密码',
selected: null,
showMistake: false,
operation: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.defectiveShunting.twoConfirm.domId : '';
}
},
methods:{
doShow(operate) {
this.operation = operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
commit() {
if (this.passwordCheck === this.correctPassword) {
this.$emit('checkOver', this.operation);
this.doClose();
this.inputClear();
} else {
this.showMistake = true;
}
},
inputClear() {
this.showMistake = false;
this.passwordCheck = '';
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
}
}
};
//
</script>
<style lang="scss">
.password-error {
color: red;
}
</style>

View File

@ -0,0 +1,146 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="switch-control chengdou-03__systerm"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row justify="center" class="ForkDirectiveTips">
下发 "分路不良" 命令吗
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="3">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
</el-dialog>
<defective-password-box ref="defectivePasswordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</div>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import DefectivePasswordBox from './childDialog/defectivePasswordBox';
import { UserOperationType } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'ForkDirective',
components: {
DefectivePasswordBox,
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
title:'分路不良',
selected: null,
operation: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Switch.defectiveShunting.confirm.domId : '';
}
},
methods: {
doShow(operate, selected) {
this.selected = selected;
this.operation = operate.operation;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
commit() {
this.openPasswordBox(OperationEvent.Switch.defectiveShunting);
},
//
openPasswordBox(operator) {
const operate = {
operation: operator.confirm.operation
};
this.loading = true;
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.defectivePasswordBox.doShow({operation:this.operation});
}
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
passWordCommit(data) {
const operate = {
over: true,
operation: data,
userOperationType: UserOperationType.LEFTCLICK
};
switch (data) {
case OperationEvent.Switch.defectiveShunting.before.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT;
break;
}
case OperationEvent.Switch.defectiveShunting.locate.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED;
break;
}
case OperationEvent.Switch.defectiveShunting.reverse.operation: {
operate.cmdType = CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE;
break;
}
}
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
}).catch(() => {
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$root.$emit('dialogClose', this.selected);
this.$store.dispatch('training/emitTipFresh');
}
}
};
</script>
<style lang="scss">
.ForkDirectiveTips{
margin-bottom: 16px;
text-align: center;
font-size: 15px;
font-weight: bold;
}
</style>

View File

@ -8,6 +8,7 @@
<set-fault ref="setFault" pop-class="datie-02__systerm" />
<draw-select ref="drawSelect" />
<route-cancel ref="routeCancel" />
<fork-directive ref="forkDirective" />
</div>
</template>
@ -27,6 +28,7 @@ import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuO
import RouteCancel from './menuDialog/routeCancel';
import { UserOperationType } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ForkDirective from './dialog/forkDirective';
export default {
name: 'SwitchMenu',
@ -38,7 +40,8 @@ export default {
SetFault,
SwitchHookLock,
DrawSelect,
RouteCancel
RouteCancel,
ForkDirective
},
mixins: [
CancelMouseState
@ -338,50 +341,26 @@ export default {
},
//
beforeForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FRONT,
operation: OperationEvent.Switch.defectiveShunting.before.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.beforeForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
locateForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_FIXED,
operation: OperationEvent.Switch.defectiveShunting.locate.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.locateForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//
reverseForkDirective() {
const operate = {
over: true,
cmdType:CMD.Section.CMD_SECTION_DEFECTIVE_SHUNTING_REVERSE,
operation: OperationEvent.Switch.defectiveShunting.reverse.operation,
userOperationType: UserOperationType.RIGHTCLICK,
param:{
sectionCode:this.selected.sectionACode
commitOperate(menuOperate.Switch.locateForkDirective, {sectionCode:this.selected.sectionACode}, 0).then(({valid, operate})=>{
if (valid) {
this.$refs.forkDirective.doShow(operate, this.selected);
}
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
// if (valid) {
// }
});
},
//

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

@ -1309,6 +1309,18 @@ export const OperationEvent = {
before:{
operation: '11g',
domId: '_Tips-Switch-DefectiveShunting-Before{TOP}'
},
confirm:{
operation: '11h',
domId: '_Tips-Switch-DefectiveShunting-confirm{TOP}'
},
password:{
operation: '11i',
domId: '_Tips-Switch-DefectiveShunting-password{TOP}'
},
twoConfirm:{
operation: '11j',
domId: '_Tips-Switch-DefectiveShunting-twoConfirm{TOP}'
}
},

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, 3).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, 3).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, 3).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, 3).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, 3).then(({valid, operate})=>{
this.queryData();
this.$message.success('保存成功!');
}).catch(()=>{
this.$message.error('保存簿册失败!');
});
},
add() {