This commit is contained in:
fan 2020-10-16 19:08:01 +08:00
commit 528fda2c15
9 changed files with 150 additions and 60 deletions

View File

@ -130,7 +130,7 @@ export const DeviceMenu = {
IscsSystem: '108',
IscsInterface: '109',
planJustArrival: '200',
planJustRunning: '200',
planJustDeparture: '201'
};

View File

@ -170,7 +170,6 @@ export default {
scriptMode: ScriptMode.TEACH,
mapLocation:{},
playerList:[],
actionList:[],
currentPlayList:[],
// formatUsedTime:'',
formatScore:0,
@ -454,12 +453,11 @@ export default {
// this.$refs.menuScript.initLoadPage();
// }
},
selectScript({playerList, mapLocation, actionList}) {
selectScript({playerList, mapLocation}) {
this.changeScriptMode(this.scriptMode);
this.isScriptLoad = true;
this.playerList = playerList;
this.mapLocation = mapLocation;
this.actionList = actionList;
this.userRole = 'AUDIENCE';
this.$store.dispatch('training/setRoles', 'AUDIENCE');
},
@ -474,7 +472,7 @@ export default {
this.showResultData(data);
},
showResultData(data) {
this.$refs.testResult.doShow({data:data, actionList:this.actionList});
this.$refs.testResult.doShow({data:data});
},
endTraining() {
competitionPracticalSceneFinish(this.group, {operationStatisticVO:{}}).then(res=>{

View File

@ -120,7 +120,6 @@ export default {
const playerList = [];
EventBus.$emit('clearRunSeries');
EventBus.$emit('loadScene');
const actionList = {};
if (res.data.memberList && res.data.memberList.length > 0) {
this.form.type = '';
res.data.memberList.sort((a, b) => {
@ -129,7 +128,6 @@ export default {
this.$store.dispatch('training/setMemberList', {memberList:res.data.memberList, userId:this.$store.state.user.id});
const activeMemberList = [];
res.data.actionList.forEach((activeMember)=>{
actionList[activeMember.id] = activeMember;
if (!(activeMemberList.length > 0 && activeMemberList.includes(activeMember.memberId))) {
activeMemberList.push(activeMember.memberId);
}
@ -179,14 +177,14 @@ export default {
if (res.data.mapLocation) {
this.mapLocation = res.data.mapLocation;
}
this.confirm(playerList, actionList);
this.confirm(playerList);
}
}
},
confirm(playerList, actionList) {
confirm(playerList) {
// this.$store.dispatch('training/setScriptOperationType', this.operationType);
// operationType:ScriptMode[this.operationType]
this.$emit('selectScript', {playerList:playerList, mapLocation:this.mapLocation, actionList:actionList});
this.$emit('selectScript', {playerList:playerList, mapLocation:this.mapLocation});
this.doClose();
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {

View File

@ -20,7 +20,7 @@
<!-- height="400" -->
<el-table-column prop="actionId" label="步骤描述" width="230">
<template slot-scope="scope">
{{ covert(scope.row.actionId) }}
{{ covert(scope.row.actionVO) }}
</template>
</el-table-column>
<el-table-column prop="keyWords" label="关键字" width="200">
@ -64,6 +64,11 @@
<div class="OSTSignInfoTips">
<span class="el-icon-info" style="font-size: 16px;" /> 若竞赛未完成运营指标不得分
</div>
<div class="OSTSignInfoTips">停运列车信息</div>
<el-table :data="finalStoppedRunningStatistics" border class="OSTTable4">
<el-table-column prop="groupNumber" label="车组号" width="400" />
<el-table-column prop="finalPointsDeducted" label="扣分" width="430" />
</el-table>
<div class="OSTSignInfoTips">晚点列车信息</div>
<el-table :data="finalLateStatistics" border class="OSTTable1">
<el-table-column prop="groupNumber" label="车组号" width="300" />
@ -84,11 +89,6 @@
</el-table-column>
<el-table-column prop="finalPointsDeducted" label="扣分" width="230" />
</el-table>
<div class="OSTSignInfoTips">停运列车信息</div>
<el-table :data="finalStoppedRunningStatistics" border class="OSTTable4">
<el-table-column prop="groupNumber" label="车组号" width="400" />
<el-table-column prop="finalPointsDeducted" label="扣分" width="430" />
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doClose">{{ $t('global.confirm') }}</el-button>
@ -110,7 +110,7 @@ export default {
completed:false, //
fullScore:'', //
userScore:'', //
actionList:[], //
// actionList:[], //
fullScoreOfCommand:0, //
userScoreOfCommand:0, //
fullScoreOfOperationStatistic:0, //
@ -120,7 +120,7 @@ export default {
};
},
methods:{
doShow({data, actionList}) {
doShow({data}) {
this.dialogShow = true;
this.completed = data.completed;
this.operationStaticItemVOs = data.operationStatisticVO.itemVOS;
@ -128,7 +128,7 @@ export default {
this.finalStopInSectionStatistics = data.operationIndexStatisticVO.finalStopInSectionStatistics;
this.finalStoppedRunningStatistics = data.operationIndexStatisticVO.finalStoppedRunningStatistics;
this.commandPublishStatisticVO = data.commandPublishStatisticVO;
this.actionList = actionList;
// this.actionList = actionList;
this.fullScore = data.fullScore;
this.userScore = data.userScore;
this.fullScoreOfCommand = data.fullScoreOfCommand;
@ -142,12 +142,9 @@ export default {
this.dialogShow = false;
},
covertTime(time) {
return time.slice(0, time.length - 3);
return time ? time.slice(0, time.length - 3) : '';
},
covert(actionId) {
// return actionId;
const element = this.actionList[actionId];
// this.$store.state.training.memberData[memberId]
covert(element) {
const member = this.$store.state.training.memberData[element.memberId];
let resultData = '';
if (element.type == 'Accept_Conversation_Invitation') {

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag append-to-body title="Modify run time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
<el-form-item label="Running time" prop="time">
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
<el-input-number v-model="formModel.time" controls-position="right" :min="0" />
<span style="padding-left: 10px">s</span>
</el-form-item>
</el-form>
@ -23,22 +23,53 @@ export default {
default() {
return null
}
},
stations: {
type: Array,
default() {
return []
}
}
},
data() {
var validator = (rule, value, callback) => {
const stations = this.stations;
const offset = Math.abs(
this.stations[this.selected.dataIndex].kmRange -
this.stations[this.selected.dataIndex+1].kmRange
)
const min = Math.floor(offset / 19.4);
const max = Math.floor(offset / 8.3);
if (value < min) {
callback(new Error('Below minimum run time.'));
} else if (value > max) {
callback(new Error('Run time above maximum.'));
} else {
callback()
}
}
return {
dialogShow: false,
formModel: {
time: 0,
},
rules: {
time: { required: true, message: 'Please select the arrival time.', trigger: 'change' },
time: [
{
type: 'number', min: 0, message: 'Please select the arrival time.', trigger: 'blur'
},
{
validator: validator, trigger: 'blur'
}
],
}
};
},
watch: {
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustArrival)) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustRunning)) {
this.doShow(this.$store.state.menuOperation.menuPosition);
} else {
this.doClose();
@ -57,8 +88,10 @@ export default {
},
doConfirm() {
this.$refs.form.validate((valid) => {
if(valid) {
this.$emit('justRunning', this.formModel.time);
this.doClose();
}
});
}
}

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag append-to-body title="Modify stop time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
<el-form-item label="Stop time" prop="time">
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="12*3600" />
<span style="padding-left: 10px">s</span>
</el-form-item>
</el-form>
@ -23,16 +23,37 @@ export default {
default() {
return null
}
},
stations: {
type: Array,
default() {
return []
}
}
},
data() {
var validator = (rule, value, callback) => {
if (value > 0 && value <= 15) {
callback(new Error('Stop time cannot be within 0-15 seconds.'));
} else {
callback()
}
}
return {
dialogShow: false,
formModel: {
time: 0
},
rules: {
time: { required: true, message: 'Please select the stop time.', trigger: 'change' },
time: [
{
type: 'number', min: 0, max: 12*3600, message: 'Please select the stop time.', trigger: 'blur'
},
{
validator: validator, trigger: 'blur'
}
],
}
};
},
@ -57,8 +78,10 @@ export default {
},
doConfirm() {
this.$refs.form.validate((valid) => {
if(valid) {
this.$emit('justStop', this.formModel.time);
this.doClose();
}
});
}
}

View File

@ -34,7 +34,12 @@ export default {
}
},
created() {
document.title = '运行图编辑工具'
this.PlanConvert = this.$theme.loadPlanConvert(this.lineCode);
// const project = getSessionStorage('project');
// if (project) {
// document.querySelector("link[rel*='icon']").href =;
// }
},
methods: {
setPosition() {

View File

@ -75,10 +75,11 @@ export default {
if (this.myChart) {
const zr = this.myChart.getZr();
zr.on('click', this.onClick, this)
zr.on('mousedown', this.onZrMouseDown, this);
zr.on('mouseup', this.onZrMouseUp, this);
this.myChart.on('mousedown', this.onMouseDown);
this.myChart.on('mouseover', this.onMouseOver);
this.myChart.on('mouseout', this.onMouseOver);
this.myChart.on('mouseout', this.onMouseOut);
this.myChart.on('mouseup', this.onMouseUP);
this.myChart.on('datazoom', this.onUpdatePosition);
window.addEventListener('resize', this.onUpdatePosition);
@ -88,10 +89,11 @@ export default {
if (this.myChart) {
const zr = this.myChart.getZr();
zr.off('click', this.onClick);
zr.off('mousedown', this.onZrMouseDown);
zr.off('mouseup', this.onZrMouseUp, this);
this.myChart.off('mousedown', this.onMouseDown);
this.myChart.off('mouseover', this.onMouseOver);
this.myChart.off('mouseout', this.onMouseOver);
this.myChart.off('mouseout', this.onMouseOut);
this.myChart.off('mouseup', this.onMouseUP);
this.myChart.off('datazoom', this.onUpdatePosition);
window.removeEventListener('resize', this.onUpdatePosition);
@ -106,13 +108,23 @@ export default {
})
this.myChart.setOption({graphic});
},
onClick(e) {
onZrMouseDown(e) {
switch(this.action) {
case 'Add':
this.pixelExecCb(e, this.handleCreateMark);
break;
}
},
onZrMouseUp(e) {
switch(this.action) {
case 'Translate':
if (this.dragging) {
this.dragging = false;
this.handleTranslate(this.createModel)
}
break;
}
},
onMouseDown(e) {
switch(this.action) {
case 'Edit':
@ -122,28 +134,48 @@ export default {
},
onMouseOver(e) {
this.pixelExecCb(e, this.handleSelectLine);
if (this.action == 'Translate') {
setTimeout(() => {
this.onShapeMouseOver(e);
}, 200);
}
},
onMouseOut(e) {
this.pixelExecCb(e, this.handleSelectLine);
if (this.action == 'Translate') {
this.onShapeMouseOver(e);
}
},
onMouseUP(e) {
switch(this.action) {
case 'Translate':
if (this.dragging) {
this.dragging = false;
this.handleTranslate(this.createModel)
}
break;
}
// switch(this.action) {
// case 'Translate':
// if (this.dragging) {
// this.dragging = false;
// this.handleTranslate(this.createModel)
// }
// break;
// }
},
onShapePointDragging(e) {
if (this.selected) {
this.dragging = true;
this.pixelExecCb(e, this.handleDragging);
}
},
onShapeMouseOver() {
if (this.selected) {
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: this.selected.seriesIndex,
dataIndex: this.selected.dataIndex
});
this.pixelExecCb(e, this.handleDragging);
}
},
onShapeMouseOut() {
if (this.selected) {
this.myChart.dispatchAction({
type: 'hideTip',
});
}
},
setLineLight() {
@ -193,11 +225,11 @@ export default {
cy: 0,
r: 10
},
style: {
fill: 'rgba(0,0,0,0.0)'
},
invisible: true,
draggable: 'horizontal',
ondrag: echarts.util.curry(this.onShapePointDragging),
onmouseover: echarts.util.curry(this.onShapeMouseOver),
onmouseout: echarts.util.curry(this.onShapeMouseOut),
z: 100
}
},
@ -246,12 +278,10 @@ export default {
time: 0
}
if (e.dataIndex == length - 1 ||
e.dataIndex < length - 1 && value[1] == nxt[1]) {
if (e.dataIndex < length - 1 && value[2] == nxt[2]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustDeparture });
} else if (e.dataIndex == 0 ||
e.dataIndex > 0 && value[1] == pre[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustArrival });
} else if (e.dataIndex == 0 || e.dataIndex > 0 && value[1] == pre[1]) {
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustRunning });
}
}
},
@ -301,6 +331,12 @@ export default {
option.graphic[0].elements = filters;
this.myChart.setOption(option, {notMerge: true});
this.myChart.dispatchAction({
type: 'showTip',
seriesIndex: this.selected.seriesIndex,
dataIndex: this.selected.dataIndex
});
},
handleCreateMark({pointInPixel, yObj, xVal}) {
const myChart = this.myChart;

View File

@ -19,8 +19,8 @@
</div>
<div :id="runPlanId" />
</el-card>
<plan-just-running :selected="selected" @justRunning="handleJustRunning" />
<plan-just-stop :selected="selected" @justStop="handleJustStop"/>
<plan-just-running :selected="selected" :stations="stations" @justRunning="handleJustRunning" />
<plan-just-stop :selected="selected" :stations="stations" @justStop="handleJustStop"/>
</div>
</template>