调整宁波三菜单&调整加载动画

This commit is contained in:
fan 2020-09-08 16:41:38 +08:00
parent c432c2f614
commit 9d42aac8fa
4 changed files with 55 additions and 10 deletions

View File

@ -25,7 +25,8 @@ export default {
data() { data() {
return { return {
loadingImg: LoadingImg, loadingImg: LoadingImg,
loading: false loading: false,
loadingStartTime: 0
}; };
}, },
computed: { computed: {
@ -58,10 +59,18 @@ export default {
}, },
'$store.state.app.transitionAnimationsCount': function(val) { '$store.state.app.transitionAnimationsCount': function(val) {
this.loading = true; this.loading = true;
this.loadingStartTime = +new Date();
}, },
'$route' () { '$route' () {
this.$nextTick(function() { this.$nextTick(function() {
this.loading = false; const distance = +new Date() - this.loadingStartTime;
if (distance > 100 && distance < 300 ) {
setTimeout(() => {
this.loading = false;
}, 500);
} else {
this.loading = false;
}
}); });
} }
}, },

View File

@ -294,7 +294,7 @@ export default {
}, },
{ {
title: '复位', title: '复位',
click: this.undeveloped click: this.setTrainReset
}, },
{ {
title: '跳停', title: '跳停',
@ -761,7 +761,7 @@ export default {
}, },
{ {
title: '复位', title: '复位',
click: this.undeveloped click: this.setTrainReset
}, },
{ {
title: '跳停', title: '跳停',
@ -1739,7 +1739,7 @@ export default {
setTrainDepart() { setTrainDepart() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: OperationEvent.Train.setTrainDeparture.menu operation: OperationEvent.Train.setTrainDeparture.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {
@ -1752,7 +1752,20 @@ export default {
breakAway() { breakAway() {
const operate = { const operate = {
type: 'bar', type: 'bar',
operation: OperationEvent.Train.breakAwayPlan.menu operation: OperationEvent.Train.breakAwayPlan.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) {
this.closeMenu(true);
this.$store.dispatch('menuOperation/handleBreakFlag', {break: true});
this.$refs.trainDepart.doShow(operate);
}
});
},
setTrainReset() {
const operate = {
type: 'bar',
operation: OperationEvent.Train.setTrainReset.menu.operation
}; };
this.$store.dispatch('training/nextNew', operate).then(({valid}) => { this.$store.dispatch('training/nextNew', operate).then(({valid}) => {
if (valid) { if (valid) {

View File

@ -4,9 +4,9 @@
<el-table :data="signalList" height="300px"> <el-table :data="signalList" height="300px">
<el-table-column prop="code" label="列车" /> <el-table-column prop="code" label="列车" />
<el-table-column prop="interval" label="班次" /> <el-table-column prop="interval" label="班次" />
<el-table-column prop="interval" label="模式" /> <el-table-column v-if="isDepart" prop="interval" label="模式" />
<el-table-column prop="interval" label="状态" /> <el-table-column v-if="isDepart" prop="interval" label="状态" />
<el-table-column prop="interval" label="运行线" /> <el-table-column v-if="isDepart||isBreakAway" prop="interval" label="运行线" />
</el-table> </el-table>
</el-row> </el-row>
<el-row justify="center" class="button-group"> <el-row justify="center" class="button-group">
@ -60,6 +60,15 @@ export default {
domIdCancel() { domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
}, },
isDepart() {
return this.operate.operation === OperationEvent.Train.setTrainDeparture.menu.operation;
},
isBreakAway() {
return this.operate.operation === OperationEvent.Train.breakAwayPlan.menu.operation;
},
isReset() {
return this.operate.operation === OperationEvent.Train.setTrainReset.menu.operation;
},
domIdChoose() { domIdChoose() {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : '';
}, },
@ -67,7 +76,15 @@ export default {
return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : '';
}, },
title() { title() {
return '列车发车'; if (this.isDepart) {
return '列车发车';
} else if (this.isBreakAway) {
return '列车脱离班次';
} else if (this.isReset) {
return '列车复位';
} else {
return '';
}
} }
}, },
watch: { watch: {

View File

@ -2297,6 +2297,12 @@ export const OperationEvent = {
operation: '70n', operation: '70n',
domId: '_Tips-Train-breakAwayPlan-Menu' domId: '_Tips-Train-breakAwayPlan-Menu'
} }
},
setTrainReset: {
menu: {
operation: '70o',
domId: '_Tips-Train-setTrainReset-Menu'
}
} }
}, },