This commit is contained in:
joylink_cuiweidong 2020-11-06 11:04:56 +08:00
commit 24280abc02
20 changed files with 89 additions and 64 deletions

View File

@ -15,7 +15,7 @@
@disableQuery="disableQuery"
@enableQuery="enableQuery"
/>
<el-card v-loading="loading">
<el-card v-loading="loading" :style="{padding: cardPadding+'px'}">
<el-table
ref="table2"
highlight-current-row
@ -211,7 +211,11 @@ export default {
queryList: {
type: Object,
required: true
}
},
cardPadding: {
type: Number,
default: 0
}
},
data() {
return {

View File

@ -141,6 +141,13 @@ function handle(state, data) {
case 'Simulation_Alarm':
state.simulationAlarmInfo = msg;
break;
case 'Simulation_Scenes_Reload':
if (msg) {
store.dispatch('training/start');
} else {
store.dispatch('training/over');
}
break;
}
}

View File

@ -44,7 +44,8 @@ const training = {
scriptOperationType: '', // 剧本操作类型
triggerFaultCount: 0, // 触发故障计数器
triggerFaultDevice: '', // 触发故障目标设备
trainingStart: false // 实训开始状态
trainingStart: false, // 实训开始状态
notifySelected: null // 场景弹窗内容
},
getters: {
@ -283,6 +284,9 @@ const training = {
},
setTrainingStart: (state, flag) => {
state.trainingStart = flag;
},
setNotifySelected: (state, data) => {
state.notifySelected = data;
}
},

View File

@ -5,7 +5,7 @@
<el-button size="small" type="primary" class="createScript" style="margin-top: 5px" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button>
<el-button size="small" type="primary" class="createScript" @click="createByPublish">发布数据创建</el-button>
</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<QueryListPage ref="queryListPage" :cardPadding="50" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<create-ibp ref="createScript" :title="'创建数据'" @reloadTable="reloadTable" />
<create-ibp ref="modifyScript" :title="'修改数据'" @reloadTable="reloadTable" />
<copy-ibp ref="copyIbp" @reloadTable="reloadTable" />

View File

@ -9,7 +9,7 @@
<el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
</div>
</div>
<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<QueryListPage ref="queryListPage" :cardPadding="50" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<publish-create ref="publishCreate" @refresh="refresh" />
<publish-lesson ref="publishLesson" @refresh="refresh" />
<lesson-detail ref="lessonDetail" />

View File

@ -149,7 +149,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -198,6 +197,9 @@ export default {
},
scriptModeList() {
return ScriptMode;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -236,8 +238,12 @@ export default {
const initTime = new Date(this.$store.state.training.initTime || null);
const model = {initTime:this.formatTime(initTime)};
this.start(model);
} else {
this.isDisable = true;
}
},
isScriptLoad(val) {
if (!val && this.$store.state.training.notifySelected) {
this.$store.state.training.notifySelected.close();
this.$store.commit('training/setNotifySelected', null);
}
}
},
@ -286,9 +292,6 @@ export default {
const ss = prefixIntrger(initTime.getSeconds(), 2);
return `${hh}:${mm}:${ss}`;
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -334,7 +337,6 @@ export default {
});
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -344,7 +346,6 @@ export default {
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -375,7 +376,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -385,7 +385,6 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},

View File

@ -10,7 +10,11 @@
<el-table-column label="操作">
<template slot-scope="scope">
<div v-if="scope.row.result">
<el-button v-for="(each,index) in scope.row.result" :key="index" type="primary" size="small" @click="handleLoad(each)">{{ each.name }}</el-button>
<template v-for="(each,index) in scope.row.result">
<el-tooltip :key="index" class="item" effect="dark" :content="'场景描述: '+ each.description + '\n' + '处置流程: ' +each.disposalProcesses" popper-class="tooltip-box" placement="top">
<el-button type="primary" size="small" @click="handleLoad(each)">{{ each.name }}</el-button>
</el-tooltip>
</template>
</div>
</template>
</el-table-column>
@ -82,17 +86,17 @@ export default {
});
list.forEach(each=>{
if (each.name == '场景1' || each.name == '场景2' || each.name == '场景3' || each.name == '场景7') {
this.mainSceneData[1].result.push({id:each.id, name:each.name});
this.mainSceneData[1].result.push({id:each.id, name:each.name, description: each.description, disposalProcesses: each.disposalProcesses});
} else if (each.name == '场景4') {
this.mainSceneData[0].result.push({id:each.id, name:'场景4'});
this.mainSceneData[0].result.push({id:each.id, name:'场景4', description: each.description, disposalProcesses: each.disposalProcesses});
} else if (each.name == '场景5' || each.name == '场景11') {
this.mainSceneData[4].result.push({id:each.id, name:each.name});
this.mainSceneData[4].result.push({id:each.id, name:each.name, description: each.description, disposalProcesses: each.disposalProcesses});
} else if (each.name == '场景9') {
this.mainSceneData[6].result.push({id:each.id, name:'场景9'});
this.mainSceneData[6].result.push({id:each.id, name:'场景9', description: each.description, disposalProcesses: each.disposalProcesses});
} else if (each.name == '场景8') {
this.mainSceneData[5].result.push({id:each.id, name:'场景8'});
this.mainSceneData[5].result.push({id:each.id, name:'场景8', description: each.description, disposalProcesses: each.disposalProcesses});
} else if (each.name == '场景10') {
this.mainSceneData[7].result.push({id:each.id, name:'场景10'});
this.mainSceneData[7].result.push({id:each.id, name:'场景10', description: each.description, disposalProcesses: each.disposalProcesses});
}
});
}
@ -127,6 +131,15 @@ export default {
const playerList = [];
EventBus.$emit('clearRunSeries');
EventBus.$emit('loadScene');
const notifyData = this.$notify({
title: res.data.name,
message: res.data.description,
customClass: 'notify_box',
showClose: false,
offset: 70,
duration: 0
});
this.$store.commit('training/setNotifySelected', notifyData);
if (res.data.memberList && res.data.memberList.length > 0) {
this.form.type = '';
res.data.memberList.sort((a, b) => {
@ -228,3 +241,16 @@ export default {
}
};
</script>
<style lang="scss">
.tooltip-box {
white-space:pre-wrap;
}
.notify_box{
width: 300px;
&.el-notification.right{
right: 5px;
padding: 6px 0;
}
}
</style>

View File

@ -233,11 +233,8 @@ export default {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`));
this.$store.dispatch('training/countTime');
this.planRunning = resp.data.planRunning;
if (this.isDemon) {
this.$refs.menuDemon.initPlannedDriving(this.planRunning); //
} else if (this.isScript) {
// this.$refs.menuScript.initPlannedDriving(resp.data.planRunning);
if (resp.data.planRunning) {
this.$store.commit('training/start');
}
} else if (resp && resp.code == 200 && resp.data && resp.data.dataError) {
this.dataError = true;

View File

@ -98,7 +98,6 @@ export default {
},
data() {
return {
isDisable: false,
tryTime: 0, //
timeNow: 0, //
time: null, //
@ -140,6 +139,9 @@ export default {
},
projectDevice() {
return this.$route.query.projectDevice;
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -210,9 +212,6 @@ export default {
console.log(error);
}
},
initPlannedDriving(isDisable) {
this.isDisable = isDisable;
},
loadInitData() {
const data = {
mapId: this.$route.query.mapId,
@ -239,7 +238,6 @@ export default {
this.$refs.setTime.doShow();
},
start(model) { // 仿
this.isDisable = true;
const data = {
time: model.initTime
};
@ -249,7 +247,6 @@ export default {
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch(error => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -280,7 +277,6 @@ export default {
this.$refs.demonMenu.hideScheduling(run);
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -290,14 +286,12 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then((res)=>{
this.isDisable = false;
EventBus.$emit('clearRunSeries');
this.quitQuest();
this.initLoadPage();

View File

@ -76,7 +76,7 @@ export const operateEnum = {
// }
},
ControlConvertMenu:{
type:'制模式',
type:'系统/站遥控',
CM_Apply_For_Station_Control:{
code:'stationCodes',
isList:true,

View File

@ -98,7 +98,6 @@ export default {
},
data() {
return {
isDisable: false,
isScriptCommand:false,
isReplaceBg: false,
userRole:''
@ -123,7 +122,10 @@ export default {
},
isStation() {
return this.$store.state.training.prdType == '01';
}
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
'$store.state.scriptRecord.bgSet':function (val) {
@ -161,7 +163,7 @@ export default {
},
'$store.state.scriptRecord.userRole':function (val) {
this.userRole = val;
}
}
},
beforeDestroy() {
// this.clearAutoSave();
@ -182,18 +184,13 @@ export default {
selectBeginTime() {
this.$refs.setTime.doShow();
},
resetBeginTime() {
this.isDisable = false;
},
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
ranAsPlan(data, this.group).then(res => {
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -218,7 +215,6 @@ export default {
});
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(() => {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
@ -228,7 +224,6 @@ export default {
});
});
}).catch(() => {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
},

View File

@ -352,12 +352,12 @@ export default {
}
},
async simulationReset() {
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('map/resetActiveTrainList');
await this.$store.dispatch('socket/setSimulationReset'); //
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');
},
//

View File

@ -109,7 +109,6 @@ export default {
},
data() {
return {
isDisable: false,
backLoading: false,
chatShow: true,
jsStart: true,
@ -161,6 +160,9 @@ export default {
isDeviceLogin() {
const typeList = ['LW', 'CW'];
return typeList.includes(this.$route.query.type);
},
isDisable() {
return this.$store.state.training.started;
}
},
watch: {
@ -172,11 +174,6 @@ export default {
});
}
},
'$store.state.training.started': function (val) {
if (val) {
this.isDisable = true;
}
},
'$store.state.socket.simulationOver':function(val) {
if (val && this.project == 'refereeJsxt') {
this.$router.go(-1);
@ -284,7 +281,6 @@ export default {
},
// 仿
start(model) {
this.isDisable = true;
const data = {
time: model.initTime
};
@ -294,7 +290,6 @@ export default {
}
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
}).catch((error) => {
this.isDisable = false;
if (error.code == '5001') {
this.$messageBox(this.$t('error.mapDataError') + '' + this.$t('error.startSimulationFailed'));
} else if (error.code == '5002') {
@ -319,13 +314,11 @@ export default {
});
},
end() {
this.isDisable = false;
exitRunPlan(this.group).then(()=>{
this.$store.dispatch('map/setTrainWindowShow', false);
this.$store.dispatch('map/resetActiveTrainList', false);
}).catch(() => {
this.$store.dispatch('training/over').then(() => {
this.isDisable = true;
this.$store.dispatch('map/resetActiveTrainList', false);
this.$messageBox(this.$t('error.endSimulationFailed'));
});

View File

@ -1,6 +1,6 @@
<template>
<div v-if="delayShow">
<div v-for="item in stationList">
<div v-for="(item,i) in stationList" :key="i">
<delay-info v-if="item.delayInfo" :delay-info-list="item.delayInfo" position="item.points" />
</div>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div v-show="showDelayBox" class="info_box" :style="{left: tPosition.x+'px', top: tPosition.y+'px' }">
<el-scrollbal>
<div v-for="item in delayInfoList"><span>人解</span><span>信号机名</span><span>时间</span></div>
<div v-for="(item,i) in delayInfoList" :key="i"><span>人解</span><span>信号机名</span><span>时间</span></div>
</el-scrollbal>
</div>
</template>

View File

@ -5,7 +5,7 @@
<el-button v-if="isCreate" size="mini" type="primary" class="createRunPlan" @click="handleCreate">{{ $t('planMonitor.createRunningDiagram') }}</el-button>
</div>
<!--<QueryListPage ref="queryListPage" :query-form="queryForm" :pager-config="pagerConfig" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />-->
<el-card v-loading="loading" style="width: 91%;margin-left:4%;margin-top:20px;">
<el-card v-loading="loading" style="width: 91%;margin-left:4%;margin-top:20px;padding:50px">
<el-table
:data="runPlanList"
highlight-current-row

View File

@ -158,6 +158,7 @@ export default {
},
handleClose() {
this.dialogVisible = false;
this.$emit('clearConditionActionId');
this.initData();
},
getSectionName(code) {
@ -229,7 +230,9 @@ export default {
initData() {
this.update = false;
this.updateIndex = '';
this.field = '';
this.$refs.form && this.$refs.form.resetFields();
this.formModel.stop = '';
},
onCommit() {
this.$refs.form.validate((valid) => {

View File

@ -43,7 +43,7 @@
</span>
</div>
<div class="btnGroup">
<el-button :type="conditionActionId === actionInfo.id? 'danger':'primary'" size="mini" @click="handleCondition(actionInfo)">{{ conditionActionId === actionInfo.id? '关闭条件':'触发条件' }}</el-button>
<el-button :type="conditionActionId === actionInfo.id? 'danger':'primary'" size="mini" @click="handleCondition(actionInfo)">触发条件</el-button>
<el-button v-if="actionInfo.visible && !actionInfo.isModify" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" :loading="modifyTextLoading" type="danger" size="mini" style="margin-left:10px;" @click="confirmModify(actionInfo)">确定</el-button>
<el-button v-if="actionInfo.visible && actionInfo.isModify" type="" size="mini" style="margin-left:10px;" @click="cancleModify(actionInfo)">取消</el-button>

View File

@ -7,7 +7,7 @@
导入剧本
</el-button>
</div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<QueryListPage ref="queryListPage" :cardPadding="50" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
<script-publish ref="publishScript" :title="$t('scriptRecord.publishScript')" @reloadTable="reloadTable" @create="handleConfirmPublish" />
<create-script ref="createScript" :title="$t('scriptRecord.createScript')" @reloadTable="reloadTable" @create="handleConfirmCreate" />
<create-script ref="modifyScript" :title="$t('scriptRecord.modifyScript')" @reloadTable="reloadTable" @create="handleConfirmModify" />

View File

@ -66,7 +66,7 @@
</div>
</div>
<add-script-member ref="addScriptMember" @addScriptMember="addScriptMember" />
<condition-manage ref="conditionManage" />
<condition-manage ref="conditionManage" @clearConditionActionId="clearConditionActionId" />
</div>
</template>
<script>
@ -562,6 +562,9 @@ export default {
},
showConditionManage(actionId) {
this.$refs.conditionManage.doShow(actionId);
},
clearConditionActionId() {
this.$refs.getAction.conditionActionId = '';
}
}
};