修改代码

This commit is contained in:
ival 2019-09-23 09:12:36 +08:00
parent 7be7e3eac3
commit 39d3ee757a

View File

@ -1,441 +1,463 @@
<template> <template>
<el-dialog class="fuzhou-01__systerm station-control-convert" :title="$t('menu.menuDialog.controlModeConversion')" :visible.sync="show" width="700px" <el-dialog
:before-close="doClose" :showClose="true" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag
v-dialogDrag> class="fuzhou-01__systerm station-control-convert"
<el-table ref="multipleTable" :data="tableData" border row-key="code" style="width: 100%" height="250" center :title="$t('menu.menuDialog.controlModeConversion')"
size="mini" highlight-current-row> :visible.sync="show"
<el-table-column prop="check" :label="$t('menu.menuDialog.select')" width="60" :id="domIdChoose" style="margin-left:30px"> width="700px"
<template slot-scope="scope"> :before-close="doClose"
<el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled"></el-checkbox> :show-close="true"
</template> :z-index="2000"
</el-table-column> :modal="false"
<el-table-column prop="operate" :label="$t('menu.menuDialog.operatingArea')" width="140"> :close-on-click-modal="false"
<template slot-scope="scope"> >
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.operate}}</span> <el-table
</template> ref="multipleTable"
</el-table-column> :data="tableData"
<el-table-column prop="control" :label="$t('menu.menuDialog.controlMode')" width="80"> border
<template slot-scope="scope"> row-key="code"
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.control}}</span> style="width: 100%"
</template> height="250"
</el-table-column> center
<el-table-column prop="status" :label="$t('menu.menuDialog.centerStationCommunicationStatus')" width="140"> size="mini"
<template slot-scope="scope"> highlight-current-row
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.status}}</span> >
</template> <el-table-column :id="domIdChoose" prop="check" :label="$t('menu.menuDialog.select')" width="60" style="margin-left:30px">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="result" :label="$t('menu.menuDialog.transferExecutionStatus')"> <el-checkbox ref="check" v-model="scope.row.check" :disabled="scope.row.disabled" />
<template slot-scope="scope"> </template>
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{scope.row.result}}</span> </el-table-column>
</template> <el-table-column prop="operate" :label="$t('menu.menuDialog.operatingArea')" width="140">
</el-table-column> <template slot-scope="scope">
</el-table> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.operate }}</span>
<el-row class="button-group"> </template>
<el-col :span="10" :offset="3"> </el-table-column>
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{$t('menu.menuDialog.forcedStationControl')}}</el-button> <el-table-column prop="control" :label="$t('menu.menuDialog.controlMode')" width="80">
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{$t('menu.menuDialog.requestStationControl')}} <template slot-scope="scope">
</el-button> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.control }}</span>
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{$t('menu.menuDialog.requestInTheControl')}} </template>
</el-button> </el-table-column>
</el-col> <el-table-column prop="status" :label="$t('menu.menuDialog.centerStationCommunicationStatus')" width="140">
<el-col :span="6" :offset="4"> <template slot-scope="scope">
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{$t('menu.menuDialog.close')}} <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.status }}</span>
</el-button> </template>
</el-col> </el-table-column>
</el-row> <el-table-column prop="result" :label="$t('menu.menuDialog.transferExecutionStatus')">
<two-confirmation ref="twoConfirmation" @setOperate="getOperate"></two-confirmation> <template slot-scope="scope">
</el-dialog> <span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.result }}</span>
</template>
</el-table-column>
</el-table>
<el-row class="button-group">
<el-col :span="10" :offset="3">
<el-button v-if="isFork" :id="domIdFork" :disabled="disabledCommit" @click="forkCommit">{{ $t('menu.menuDialog.forcedStationControl') }}</el-button>
<el-button v-if="isRequest" :id="domIdRequest" :disabled="disabledCommit" @click="requestCommit">{{ $t('menu.menuDialog.requestStationControl') }}
</el-button>
<el-button v-if="isConter" :id="domIdConter" :disabled="disabledCommit" @click="conterCommit">{{ $t('menu.menuDialog.requestInTheControl') }}
</el-button>
</el-col>
<el-col :span="6" :offset="4">
<el-button :id="domIdCancel" :disabled="disabledClose" @click="cancel">{{ $t('menu.menuDialog.close') }}
</el-button>
</el-col>
</el-row>
<two-confirmation ref="twoConfirmation" @setOperate="getOperate" />
</el-dialog>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { MapDeviceType, TrainingMode, OperationEvent, getDomIdByOperation, checkOperationIsCurrentOperate } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, checkOperationIsCurrentOperate } from '@/scripts/ConstDic';
import TwoConfirmation from './childDialog/twoConfirmation'; import TwoConfirmation from './childDialog/twoConfirmation';
export default {
name: 'StationControlConvert',
data() {
return {
operate: null,
dialogShow: false,
disabledSend: false,
disabledSure: false,
disabledClose: false,
operation: '',
controlProps: {
'01': this.$t('menu.menuDialog.inTheControl'),
'02': this.$t('menu.menuDialog.stationControl')
},
selection: [],
tableData: [],
timer: null,
count: 0,
flagListBit: [],
backOperate: '',
timeout: 61,
counts: 0,
}
},
components: {
TwoConfirmation
},
computed: {
...mapGetters('map', [
'stationList',
'stationControlList',
]),
...mapGetters('training', [
'mode',
'started'
]),
disabledCommit() {
return this.disabledSend || this.disabledSure;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
isFork() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)
}
},
isRequest() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)
}
},
isConter() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)
}
},
domIdChoose() {
if (this.dialogShow) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
return OperationEvent.StationControl.forcedStationControl.choose.domId
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
return OperationEvent.StationControl.requestStationControl.choose.domId
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
return OperationEvent.StationControl.requestCentralControl.choose.domId
}
}
},
domIdConter() {
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
},
domIdFork() {
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
},
domIdRequest() {
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
watch: {
'$store.state.socket.msgHead': function (elem) {
if (elem) {
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code })] = false;
if (elem.hasOwnProperty('timeout')) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
} else if (elem.hasOwnProperty('agree')) {
if (elem.agree) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
} else {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
}
}
this.disabledClose = false;
this.disabledSure = false;
}
},
backOperate: function (operate) {
if (this.dialogShow && operate) {
if (operate.selection && operate.selection.length) {
operate.selection.forEach(elem => {
if (operate.commit) {
this.updateTableValue(elem.code, { result: `${$t('menu.menuDialog.senedMessageOne')} ,${this.timeout} ${$t('menu.menuDialog.senedMessageTwo')}` }, false);
} else if (operate.cancel) {
this.updateTableValue(elem.code, { result: '' }, false);
}
})
}
}
},
//
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.loadTableData();
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
updateTableValue(code, result, success) {
this.tableData.forEach((row, index) => {
if (row.code == code) {
for (let prop in result) {
row[prop] = result[prop];
}
if (success) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
row.control = this.controlProps['02']; //01: 02:
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
row.control = this.controlProps['01']; //01: 02:
}
row.disabled = true;
row.check = false;
}
}
});
},
checkTableDataSelction(data) {
let selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
})
}
this.disabledSend = selection.length ? false : true; export default {
if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { name: 'StationControlConvert',
this.handleChooseChange(selection); components: {
this.selection = selection; TwoConfirmation
} },
}, data() {
checkBoxDisabled(row) { return {
let control = (this.$store.getters['map/getDeviceByCode'](row.code) || {}); operate: null,
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) { dialogShow: false,
if (control && control.status == '02') { //01: 02: disabledSend: false,
return true; disabledSure: false,
} disabledClose: false,
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) { operation: '',
if (control && control.status == '01') { //01: 02: controlProps: {
return true; '01': this.$t('menu.menuDialog.inTheControl'),
} '02': this.$t('menu.menuDialog.stationControl')
} },
selection: [],
tableData: [],
timer: null,
count: 0,
flagListBit: [],
backOperate: '',
timeout: 61,
counts: 0
};
},
computed: {
...mapGetters('map', [
'stationList',
'stationControlList'
]),
...mapGetters('training', [
'mode',
'started'
]),
disabledCommit() {
return this.disabledSend || this.disabledSure;
},
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
isFork() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl);
}
return false;
},
isRequest() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl);
}
return false;
},
isConter() {
if (this.dialogShow) {
return checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl);
}
return false;
},
domIdChoose() {
if (this.dialogShow) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
return OperationEvent.StationControl.forcedStationControl.choose.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
return OperationEvent.StationControl.requestStationControl.choose.domId;
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
return OperationEvent.StationControl.requestCentralControl.choose.domId;
}
}
return false;
},
domIdConter() {
return this.dialogShow ? OperationEvent.StationControl.requestCentralControl.menu.domId : '';
},
domIdFork() {
return this.dialogShow ? OperationEvent.StationControl.forcedStationControl.menu.domId : '';
},
domIdRequest() {
return this.dialogShow ? OperationEvent.StationControl.requestStationControl.menu.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}
},
watch: {
'$store.state.socket.msgHead': function (elem) {
if (elem) {
this.flagListBit[this.selection.forEach(elem => { return elem.stationControlCode == elem.code; })] = false;
if (elem.hasOwnProperty('timeout')) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.acceptConversionResponseTimeout') }, false);
} else if (elem.hasOwnProperty('agree')) {
if (elem.agree) {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransfersuccees') }, true);
} else {
this.updateTableValue(elem.stationControlCode, { result: this.$t('menu.menuDialog.controlModeTransferFailed') }, false);
}
}
this.disabledClose = false;
this.disabledSure = false;
}
},
backOperate: function (operate) {
if (this.dialogShow && operate) {
if (operate.selection && operate.selection.length) {
operate.selection.forEach(elem => {
if (operate.commit) {
this.updateTableValue(elem.code, { result: `${this.$t('menu.menuDialog.senedMessageOne')} ,${this.timeout} ${this.$t('menu.menuDialog.senedMessageTwo')}` }, false);
} else if (operate.cancel) {
this.updateTableValue(elem.code, { result: '' }, false);
}
});
}
}
},
//
tableData: {
handler(val, oldVal) {
this.checkTableDataSelction(val);
},
deep: true
}
},
mounted() {
this.loadTableData();
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
updateTableValue(code, result, success) {
this.tableData.forEach((row, index) => {
if (row.code == code) {
for (const prop in result) {
row[prop] = result[prop];
}
if (success) {
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
row.control = this.controlProps['02']; // 01: 02:
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
row.control = this.controlProps['01']; // 01: 02:
}
row.disabled = true;
row.check = false;
}
}
});
},
checkTableDataSelction(data) {
const selection = [];
if (data && data.length > 0) {
data.forEach(row => {
if (row.check && !row.disabled) {
selection.push(row);
}
});
}
}, this.disabledSend = !selection.length;
loadTableData() { if (JSON.stringify(selection) !== JSON.stringify(this.selection)) {
this.tableData = []; this.handleChooseChange(selection);
this.stationControlList.forEach(control => { this.selection = selection;
let station = this.$store.getters['map/getDeviceByCode'](control.stationCode); }
this.tableData.push({ },
code: control.code, checkBoxDisabled(row) {
operate: station.name || '', const control = (this.$store.getters['map/getDeviceByCode'](row.code) || {});
control: '', if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl) || checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
check: false, if (control && control.status == '02') { // 01: 02:
disabled: false, return true;
status: this.$t('menu.menuDialog.normal'), }
result: '', } else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
}); if (control && control.status == '01') { // 01: 02:
}) return true;
}, }
initTableDataStatus() { }
this.tableData.forEach(row => {
row.disabled = this.checkBoxDisabled(row);
row.check = false;
row.result = '';
let control = this.$store.getters['map/getDeviceByCode'](row.code);
if (control) {
row.control = this.controlProps[control.status];
}
})
},
doShow(operate) {
if (!this.dialogShow) {
this.operate = operate || {};
this.operation = operate.operation;
this.disabledSure = false;
this.initTableDataStatus();
}
this.dialogShow = true;
this.$store.dispatch('training/emitTipFresh');
},
doClose() {
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
cancel() {
let operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation,
}
this.$store.dispatch('training/next', operate).then(({ valid }) => { },
if (valid) { loadTableData() {
this.doClose(); this.tableData = [];
} this.stationControlList.forEach(control => {
}) const station = this.$store.getters['map/getDeviceByCode'](control.stationCode);
}, this.tableData.push({
setTimer() { code: control.code,
this.clearTimer(); operate: station.name || '',
this.flagListBit = new Array(this.selection.length).fill(true); control: '',
this.timer = setInterval(() => { check: false,
(this.selection || []).forEach((elem, index) => { disabled: false,
if (this.flagListBit[index]) { status: this.$t('menu.menuDialog.normal'),
elem['count'] = (elem['count'] || 0) + 1; result: ''
elem['count'] > this.timeout && ( });
this.flagListBit[index] = false, });
this.setRequestTimeout(elem) },
) initTableDataStatus() {
} this.tableData.forEach(row => {
}) row.disabled = this.checkBoxDisabled(row);
row.check = false;
row.result = '';
const control = this.$store.getters['map/getDeviceByCode'](row.code);
if (control) {
row.control = this.controlProps[control.status];
}
});
},
doShow(operate) {
if (!this.dialogShow) {
this.operate = operate || {};
this.operation = operate.operation;
this.disabledSure = false;
this.initTableDataStatus();
}
this.dialogShow = true;
this.$store.dispatch('training/emitTipFresh');
},
doClose() {
if (this.dialogShow) {
this.$store.dispatch('socket/shiftMsgQueue');
}
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$refs.multipleTable.setCurrentRow();
},
cancel() {
const operate = {
type: 'bar',
operation: OperationEvent.Command.cancel.menu.operation
};
this.flagListBit.findIndex(elem => { return elem; }) < 0 && this.clearTimer(); this.$store.dispatch('training/next', operate).then(({ valid }) => {
}, 1000); if (valid) {
}, this.doClose();
clearTimer() { }
this.count = 0; });
if (this.timer) { },
clearInterval(this.timer); setTimer() {
this.timer = null; this.clearTimer();
} this.flagListBit = new Array(this.selection.length).fill(true);
}, this.timer = setInterval(() => {
setRequestTimeout(elem) { (this.selection || []).forEach((elem, index) => {
elem['count'] = 0; if (this.flagListBit[index]) {
this.$store.dispatch('socket/pushMsgQueue', elem['count'] = (elem['count'] || 0) + 1;
{ type: "resp", timeout: "true", stationControlCode: elem.code } elem['count'] > this.timeout && (
); this.flagListBit[index] = false,
}, this.setRequestTimeout(elem)
serializeCodeListWithSeparator(sep) { );
let 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) {
let operate = {
type: MapDeviceType.StationControl.type,
operation: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
}
if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) { this.flagListBit.findIndex(elem => { return elem; }) < 0 && this.clearTimer();
operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation }, 1000);
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) { },
operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation clearTimer() {
} else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) { this.count = 0;
operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation if (this.timer) {
} clearInterval(this.timer);
this.timer = null;
}
},
setRequestTimeout(elem) {
elem['count'] = 0;
this.$store.dispatch('socket/pushMsgQueue',
{ type: 'resp', timeout: 'true', stationControlCode: elem.code }
);
},
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: '',
val: this.serializeCodeListWithSeparator('::'),
selection: selection
};
this.disabledSure = true; if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.forcedStationControl)) {
this.$store.dispatch('training/next', operate).then(({ valid }) => { operate.operation = OperationEvent.StationControl.forcedStationControl.choose.operation;
if (valid) { } else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestStationControl)) {
this.disabledSure = false; operate.operation = OperationEvent.StationControl.requestStationControl.choose.operation;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else if (checkOperationIsCurrentOperate(this.operation, OperationEvent.StationControl.requestCentralControl)) {
} operate.operation = OperationEvent.StationControl.requestCentralControl.choose.operation;
}) }
} else if (!selection) {
this.$messageBox(this.$t('menu.menuDialog.selectData'));
}
},
requestCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
this.selection.forEach((elem, index) => { this.disabledSure = true;
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); this.$store.dispatch('training/next', operate).then(({ valid }) => {
}); if (valid) {
this.disabledSure = false;
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(this.$t('menu.menuDialog.selectData'));
}
},
requestCommit() {
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmStationControlTip')],
operation: OperationEvent.StationControl.requestStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
};
this.disabledSure = true; this.selection.forEach((elem, index) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => { operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
if (valid) { });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch((error) => {
this.disabledSure = false;
})
},
forkCommit() {
let operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
this.selection.forEach((elem, index) => { this.disabledSure = true;
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); this.$store.dispatch('training/next', operate).then(({ valid }) => {
}); if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
this.disabledSure = false;
});
},
forkCommit() {
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.forcedStationControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
};
this.disabledSure = true; this.selection.forEach((elem, index) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => { operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
if (valid) { });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
this.disabledSure = false;
})
},
conterCommit() { //
let operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
}
this.selection.forEach((elem, index) => { this.disabledSure = true;
operate.messages.push(`${$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`); this.$store.dispatch('training/next', operate).then(({ valid }) => {
}); if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate);
} else {
this.disabledSure = false;
}
}).catch(() => {
this.disabledSure = false;
});
},
conterCommit() { //
const operate = {
type: MapDeviceType.StationControl.type,
messages: [this.$t('menu.menuDialog.confirmInTheControlTip')],
operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
val: this.serializeCodeListWithSeparator('::'),
selection: this.selection
};
this.disabledSure = true; this.selection.forEach((elem, index) => {
this.$store.dispatch('training/next', operate).then(({ valid }) => { operate.messages.push(`${this.$t('menu.menuDialog.operatingArea')} ${index + 1}:${elem.operate}`);
if (valid) { });
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.twoConfirmation.doShow(operate); this.disabledSure = true;
} else { this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.disabledSure = false; if (valid) {
} this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}).catch(() => { this.$refs.twoConfirmation.doShow(operate);
this.disabledSure = false; } else {
}) this.disabledSure = false;
}, }
getOperate(operate) { }).catch(() => {
this.backOperate = operate; this.disabledSure = false;
if (operate.cancel) { });
this.disabledSure = this.disabledSend = false; },
} getOperate(operate) {
if (operate.commit || operate.timeout) { this.backOperate = operate;
this.disabledSend = this.disabledSure = true; if (operate.cancel) {
} this.disabledSure = this.disabledSend = false;
this.setTimer(); }
this.disabledClose = true; if (operate.commit || operate.timeout) {
this.counts = 1; this.disabledSend = this.disabledSure = true;
} }
} this.setTimer();
} this.disabledClose = true;
this.counts = 1;
}
}
};
</script> </script>