This commit is contained in:
fan 2020-08-07 14:09:10 +08:00
commit 521a75df32
14 changed files with 26 additions and 2261 deletions

View File

@ -11,7 +11,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="beijing-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -29,7 +29,7 @@ import MenuStation from './menuStation';
import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {

View File

@ -1,304 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="beijing-01__systerm passive-control"
title="控制模式请求"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" label="操作区域">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" label="当前控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" label="请求控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" label="是否同意" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">距离对话还有{{ count }}请应答</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="beijing-01__systerm" />
</el-dialog>
</template>
<script>
// import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: '调度员1工作站',
controlProps: {
'01': '中控',
'02': '站控'
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return '01';
}
if (this.$store.state.training.prdType == '02') {
return '02';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) {
if (elem.stationControlCode) {
this.doShow(elem);
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(code) {
this.tableData = [];
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).state;
if (control) {
model.control = { status: control.status, name: this.controlProps[control.status] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (station) {
model.operate = station.name || '';
}
}
this.tableData.push(model);
},
doShow(msgHead) {
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead.stationControlCode);
const operate = {
start: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.disabledAgree = false;
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox('请选择一条数据');
}
},
agree() {
const operate = {
send: true,
over: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
val: this.selection[0].code,
prdType: this.$store.state.training.prdType
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
refuse() {
const operate = {
send: true,
over: true,
type: MapDeviceType.StationControl.type,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
val: this.tableData[0].code,
prdType: this.$store.state.training.prdType
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -11,7 +11,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-station-platform ref="menuStationPlatform" :selected="selected" @popMenuStationStand="popMenuStationStand" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="chengdou-01__system" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -28,7 +28,7 @@ import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
import MenuStationPlatform from './menuStationPlatform';

View File

@ -1,305 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-01__system passive-control"
title="控制模式请求"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%; height: 250px"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" label="操作区域">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" label="当前控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" label="请求控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" label="是否同意" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">距离对话还有{{ count }}请应答</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
// import { mapGetters } from 'vuex';
// import { TrainingMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: '调度员1工作站',
controlProps: {
'01': '中控',
'02': '站控'
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return '01';
}
if (this.$store.state.training.prdType == '02') {
return '02';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && !elem.hasOwnProperty('success') && !elem.hasOwnProperty('timeout')) {
if (elem.stationControlCode) {
this.doShow(elem);
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(code) {
this.tableData = [];
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).state;
if (control) {
model.control = { status: control.status, name: this.controlProps[control.status] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (station) {
model.operate = station.name || '';
}
}
this.tableData.push(model);
},
doShow(msgHead) {
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead.stationControlCode);
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.disabledAgree = false;
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::')
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox('请选择一条数据');
}
},
agree() {
const operate = {
send: true,
over: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
val: this.selection[0].code,
prdType: this.$store.state.training.prdType
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
refuse() {
const operate = {
send: true,
over: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
val: this.tableData[0].code,
prdType: this.$store.state.training.prdType
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -10,7 +10,7 @@
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="chengdou-03__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -27,7 +27,7 @@ import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {

View File

@ -1,325 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm passive-control"
title="控制模式请求"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" label="操作区域">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" label="当前控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" label="请求控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" label="是否同意" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">距离对话还有{{ count }}请应答</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: '调度员1工作站',
controlProps: {
'Center': '中控',
'Local': '站控',
'Emergency': '紧急站控'
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0,
targetStatus: '',
sourceMemberId: ''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control')) {
this.doShow(elem);
this.sourceMemberId = elem.sourceMemberId;
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(data) {
this.tableData = [];
this.targetStatus = 'Center';
if (data.operateType == 'CM_Apply_For_Station_Control') {
this.targetStatus = 'Local';
} else if (data.operateType == 'CM_Emergency_Station_Control') {
this.targetStatus = 'Emergency';
}
data.params.stationCodes.forEach(code => {
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const station = this.$store.getters['map/getDeviceByCode'](code);
if (station) {
const control = (station || {}).controlMode;
if (control) {
model.control = { status: control, name: this.controlProps[control] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
if (station) {
model.operate = station.name || '';
}
}
this.tableData.push(model);
});
},
doShow(msgHead) {
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead);
},
doClose() {
this.disabledAgree = false;
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::')
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox('请选择一条数据');
}
},
agree() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
over: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: true
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch((error) => {
console.log(error);
this.$refs.noticeInfo.doShow(operate);
});
},
refuse() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: false
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -13,7 +13,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="foshan-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -33,7 +33,7 @@ import MenuStation from './menuStation';
import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {

View File

@ -1,347 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="foshan-01__systerm passive-control"
:title="$t('menu.passiveDialog.controlModeRequest')"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="foshan-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
controlProps: {
'Center': this.$t('menu.passiveDialog.inTheControl'),
'Local': this.$t('menu.passiveDialog.stationControl')
},
selection: [],
tableData: [],
timer: null,
timeout: 55,
count: 0,
sourceMemberId: ''
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return 'Center';
}
if (this.$store.state.training.prdType == '02') {
return 'Local';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.map.controlTransfer':function (elem) {
if (!this.dialogShow && elem) {
this.doShow(elem);
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
// if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
let result = false;
selection.forEach(select=>{
if (select.control.status != select.target.status) {
result = result || true;
}
});
if (result) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(controlTransfer) {
const code = controlTransfer.code;
const device = this.$store.getters['map/getDeviceByCode'](code);
this.tableData = [];
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: true,
disabled: false
};
if (device) {
const control = (device || {}).controlMode;
if (control) {
model.control = { status: control, name: this.controlProps[control] };
const targetStatus = controlTransfer.apply2TheControlMode;
model.target = { status:targetStatus, name: this.controlProps[targetStatus] };
}
model.operate = device.name || '';
}
this.tableData.push(model);
// this.tableData = [];
// (codes || []).forEach(code=> {
// const model = {
// code: code,
// operate: '',
// control: { code: '', name: '' },
// target: { code: '', name: '' },
// agree: false,
// disabled: false
// };
// const device = this.$store.getters['map/getDeviceByCode'](code);
// if (device) {
// const control = (device || {}).controlMode;
// if (control) {
// model.control = { status: control, name: this.controlProps[control] };
// model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
// }
// model.operate = device.name || '';
// }
// this.tableData.push(model);
// });
},
doShow(controlTransfer) {
const member = this.$store.state.training.memberData[controlTransfer.applicantIdOfControlTransfer];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member && member.userId != this.$store.state.user.id) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(controlTransfer);
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
},
doClose() {
this.disabledAgree = false;
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: codeList.join('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
}
},
agree() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: true
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
refuse() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: false
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -9,7 +9,7 @@
<menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -25,7 +25,7 @@ import MenuTrain from './menuTrain';
import MenuStation from './menuStation';
import MenuBar from './menuBar';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {

View File

@ -1,328 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm passive-control"
:title="$t('menu.passiveDialog.controlModeRequest')"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="fuzhou-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import {SimulationType} from '@/scripts/ConstDic';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
controlProps: {
'Center': this.$t('menu.passiveDialog.inTheControl'),
'Local': this.$t('menu.passiveDialog.stationControl')
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0,
sourceMemberId: ''
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return 'Center';
}
if (this.$store.state.training.prdType == '02') {
return 'Local';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && (elem.operateType == 'CM_Apply_For_Station_Control' || elem.operateType == 'CM_Apply_For_Center_Control' || elem.operateType == 'CM_Force_Station_Control')) {
if (elem.params.stationCodes && elem.params.stationCodes.length) {
this.doShow(elem);
this.sourceMemberId = elem.sourceMemberId;
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(codes) {
this.tableData = [];
(codes || []).forEach(code=> {
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).controlMode;
if (control) {
model.control = { status: control, name: this.controlProps[control] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
model.operate = device.name || '';
}
this.tableData.push(model);
});
},
doShow(msgHead) {
const member = this.$store.state.training.memberData[msgHead.sourceMemberId];
const simulationUserList = this.$store.state.training.simulationUserList;
if (member) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
this.requestInfo = info;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead.params.stationCodes);
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.disabledAgree = false;
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: codeList.join('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
}
},
agree() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: true
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
refuse() {
const stationCodes = [];
this.tableData.forEach(item => {
if (item.agree) {
stationCodes.push(item.code);
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
send: true,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
sourceMemberId: this.sourceMemberId,
stationCodes: stationCodes,
agree: false
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -2,15 +2,15 @@
<div class="menus" :style="{width: width + 'px'}">
<menu-cancel ref="menuCancel" />
<menu-bar v-if="$store.state.training.prdType === '01'" ref="menuBar" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-station-stand ref="menuStationStand" :selected="selected" />
<menu-train ref="menuTrain" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-signal ref="menuSignal" :selected="selected" />
<menu-switch ref="menuSwitch" :selected="selected" />
<menu-section ref="menuSection" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" />
<menu-button v-if="isShowButton" ref="menuButton" :selected="selected" />
<passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="haerbin-01__systerm" />
<passive-Timeout ref="passiveTimeout" />
</div>
</template>
@ -27,7 +27,7 @@ import MenuSection from './menuSection';
import MenuStation from './menuStation';
import MenuStationStand from './menuStationStand';
import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
import PassiveTimeout from './passiveDialog/timeout';
export default {
@ -36,13 +36,13 @@ export default {
MenuBar,
MenuButton,
MenuCancel,
MenuTrain,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStation,
MenuStationStand,
PassiveAlarm,
MenuTrain,
MenuSignal,
MenuSwitch,
MenuSection,
MenuStation,
MenuStationStand,
PassiveAlarm,
PassiveContorl,
PassiveTimeout
},

View File

@ -1,309 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="haerbin-01__systerm passive-control"
:title="$t('menu.passiveDialog.controlModeRequest')"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}${$t('menu.passiveDialog.requestAreaControlMode')}` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" :label="$t('menu.passiveDialog.operatingArea')">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" :label="$t('menu.passiveDialog.currentControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" :label="$t('menu.passiveDialog.requestControlMode')" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" :label="$t('menu.passiveDialog.isAgree')" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">{{ $t('menu.passiveDialog.messageOne') }} {{ count }} {{ $t('menu.passiveDialog.messageTwo') }}</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">{{ $t('menu.passiveDialog.agree') }}
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">{{ $t('menu.passiveDialog.refuse') }}</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="haerbin-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: this.$t('menu.passiveDialog.dispatcherWorkstation'),
controlProps: {
'01': this.$t('menu.passiveDialog.inTheControl'),
'02': this.$t('menu.passiveDialog.stationControl')
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0,
commandId: ''
};
},
computed: {
targetStatus() {
if (this.$store.state.training.prdType == '01') {
return '01';
}
if (this.$store.state.training.prdType == '02') {
return '02';
}
return '';
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.socket.msgHead': function (elem) {
if (elem && elem.type == 'req') {
if (elem.stationControlCode) {
this.doShow(elem);
this.commandId = elem.commandId;
}
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
createTimer() {
this.count = this.timeout;
this.timer = setInterval(() => {
if (this.count <= 0) {
this.doClose();
return;
}
this.count = this.count - 1;
}, 1000);
},
clearTimer() {
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(code) {
this.tableData = [];
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: false,
disabled: false
};
const device = this.$store.getters['map/getDeviceByCode'](code);
if (device) {
const control = (device || {}).state;
if (control) {
model.control = { status: control.status, name: this.controlProps[control.status] };
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
const station = this.$store.getters['map/getDeviceByCode'](device.stationCode);
if (station) {
model.operate = station.name || '';
}
}
this.tableData.push(model);
},
doShow(msgHead) {
this.requestInfo = `${msgHead.fromMember.deviceName}`;
if (msgHead.fromMember.nickName) {
this.requestInfo = `${msgHead.fromMember.deviceName}(${msgHead.fromMember.nickName})`;
}
this.dialogShow = true;
this.disabledAgree = true;
this.createTimer();
this.updateTableData(msgHead.stationControlCode);
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
doClose() {
this.disabledAgree = false;
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.count = 0;
this.dialogShow = false;
this.clearTimer();
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const codeList = selection.map(elem => { return elem.code; });
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: codeList.join('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(this.$t('menu.passiveDialog.selectData'));
}
},
agree() {
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
code: this.tableData[0].code,
val: this.commandId,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: true
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
},
refuse() {
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
code: this.tableData[0].code,
val: this.commandId,
cmdType: this.$store.state.training.prdType == '01' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
ControlMode_Code: this.tableData[0].code,
Reply_Command_Id: this.commandId,
ControlMode_Reply: false
}
};
this.clearTimer();
this.disabledAgree = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow(operate);
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>

View File

@ -14,7 +14,7 @@
<menu-station ref="menuStation" :selected="selected" />
<menu-limit ref="menuLimit" :selected="selected" />
<!--<passive-alarm ref="passiveAlarm" />-->
<passive-contorl ref="passiveControl" />
<passive-contorl ref="passiveControl" pop-class="ningbo-01__systerm" />
<!--<passive-Timeout ref="passiveTimeout" />-->
</div>
</template>
@ -35,7 +35,7 @@ import MenuBar from './menuBar';
import MenuLimit from './menuLimit';
import MenuStationTurnBack from './menuStationTurnBack';
// import PassiveAlarm from './passiveDialog/alarm';
import PassiveContorl from './passiveDialog/control';
import PassiveContorl from '@/jmapNew/theme/components/menus/passiveDialog/control';
// import PassiveTimeout from './passiveDialog/timeout';
export default {

View File

@ -1,317 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm passive-control"
title="控制模式请求"
:visible.sync="show"
width="700px"
:before-close="doClose"
:show-close="true"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<span class="control-label">{{ `${requestInfo}请求如下区域的控制模式` }}</span>
<el-table
ref="multipleTable"
:data="tableData"
border
row-key="code"
style="width: 100%"
height="250"
center
size="mini"
highlight-current-row
>
<el-table-column prop="operate" label="操作区域">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
</template>
</el-table-column>
<el-table-column prop="control" label="当前控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control.name }}</span>
</template>
</el-table-column>
<el-table-column prop="target" label="请求控制模式" width="120">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.target.name }}</span>
</template>
</el-table-column>
<el-table-column prop="agree" label="是否同意" width="140">
<template slot-scope="scope">
<el-checkbox ref="agree" v-model="scope.row.agree" :disabled="scope.row.disabled" />
</template>
</el-table-column>
</el-table>
<span class="control-label">距离对话还有{{ count }}请应答</span>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button :id="domAgree" :disabled="disabledAgree" @click="agree">同意
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdRefuse" :disabled="disabledRefuse" @click="refuse">拒绝</el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import {OperationEvent } from '@/scripts/ConstDic';
import {SimulationType} from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RequestControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
disabledAgree: false,
disabledRefuse: false,
requestInfo: '调度员1工作站',
controlProps: {
'Center': this.$t('menu.passiveDialog.inTheControl'),
'Local': this.$t('menu.passiveDialog.stationControl'),
'Emergency':this.$t('menu.passiveDialog.emergencyControl')
},
selection: [],
tableData: [],
timer: null,
timeout: 61,
count: 0,
targetStatus:''
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdChoose() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.choose.domId : '';
},
domAgree() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.agree.domId : '';
},
domIdRefuse() {
return this.dialogShow ? OperationEvent.StationControl.controlResponse.refuse.domId : '';
}
},
watch: {
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
},
'$store.state.map.controlTransfer':function (elem) {
this.doShow(elem);
},
'$store.state.map.keyboardEnterCount': function (val) {
if (this.show && !this.disabledAgree) {
this.agree();
}
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.agree && !row.disabled) {
selection.push(row);
}
});
}
this.disabledSend = !selection.length;
// JSON.stringify(selection) !== JSON.stringify(this.selection)
let result = false;
selection.forEach(select=>{
if (select.control.status != select.target.status) {
result = result || true;
}
});
if (result) {
this.handleChooseChange(selection);
this.selection = selection;
this.disabledAgree = this.selection.length <= 0;
}
},
updateTableData(controlTransfer) {
const code = controlTransfer.code;
const device = this.$store.getters['map/getDeviceByCode'](code);
this.tableData = [];
const model = {
code: code,
operate: '',
control: { code: '', name: '' },
target: { code: '', name: '' },
agree: true,
disabled: false
};
if (device) {
const control = (device || {}).controlMode;
if (control) {
model.control = { status: control, name: this.controlProps[control] };
this.targetStatus = controlTransfer.apply2TheControlMode;
model.target = { status: this.targetStatus, name: this.controlProps[this.targetStatus] };
}
model.operate = device.name || '';
}
this.tableData.push(model);
},
doShow(controlTransfer) {
if (controlTransfer.applicantIdOfControlTransfer) {
const member = this.$store.state.training.memberData[controlTransfer.applicantIdOfControlTransfer];
const simulationUserList = this.$store.state.training.simulationUserList;
//
if (member && member.userId != this.$store.state.user.id &&
((member.type == 'STATION_SUPERVISOR' && this.$store.state.training.roles == 'DISPATCHER') ||
(member.type == 'DISPATCHER' && this.$store.state.training.roleDeviceCode == controlTransfer.code))) {
if (!this.dialogShow) {
let info = SimulationType[member.type];
if (member.deviceCode) {
const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
info = info + `(${device.name})`;
}
if (member.userId) {
simulationUserList.forEach(item => {
if (item.userId === member.userId) {
info = info + '-' + item.nickName;
}
});
}
//
if (controlTransfer.validDurationOfControlTransferApplication) {
this.count = controlTransfer.validDurationOfControlTransferApplication;
this.dialogShow = true;
this.requestInfo = info;
this.disabledAgree = true;
this.updateTableData(controlTransfer);
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.menu.operation
};
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
}
} else {
//
this.count = controlTransfer.validDurationOfControlTransferApplication;
}
}
} else {
this.doClose();
}
},
doClose() {
this.disabledAgree = false;
this.count = 0;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
// this.$refs.multipleTable.setCurrentRow();
},
serializeCodeListWithSeparator(sep) {
const codeList = [];
if (this.selection && this.selection.length) {
this.selection.forEach(elem => {
codeList.push(elem.code);
});
}
return codeList.join(sep);
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
operation: OperationEvent.StationControl.controlResponse.choose.operation,
val: this.serializeCodeListWithSeparator('::')
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox('请选择一条数据');
}
},
agree() {
const replyVOList = [];
this.tableData.forEach(item => {
if (item.agree) {
replyVOList.push({stationCode:item.code, agree:true });
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.agree.operation,
send: true,
cmdType: this.targetStatus == 'Center' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
replyVOList: replyVOList
}
};
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
},
refuse() {
const replyVOList = [];
this.tableData.forEach(item => {
if (item.agree) {
replyVOList.push({stationCode:item.code, agree:false });
}
});
const operate = {
start: true,
operation: OperationEvent.StationControl.controlResponse.refuse.operation,
send: true,
cmdType: this.targetStatus == 'Center' ? CMD.ControlConvertMenu.CMD_CM_REPLY_CENTER_CONTROL : CMD.ControlConvertMenu.CMD_CM_REPLY_STATION_CONTROL,
param: {
replyVOList: replyVOList
}
};
this.disabledAgree = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.$refs.noticeInfo.doShow();
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.control-label {
line-height: 30px;
font-size: 18px;
}
</style>