增加联锁关系生成过渡和结果展示

This commit is contained in:
fan 2020-05-11 15:47:56 +08:00
parent ac1d5bfdff
commit 6d38dd5ba3

View File

@ -197,14 +197,33 @@ export default {
this.$confirm('生成联锁关系会删除旧的联锁关系,是否继续生成', {
confirmButtonText: '继续',
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
type: 'warning',
beforeClose: (action, instance, done) => {
if (action === 'confirm' && instance.confirmButtonText === '继续') {
instance.confirmButtonLoading = true;
instance.confirmButtonText = '生成中...';
generateCI(this.$route.params.mapId).then(resp => {
this.$message.success('生成并保存联锁关系成功!');
}).catch(()=> {
instance.confirmButtonLoading = false;
instance.confirmButtonText = '确定';
instance.dangerouslyUseHTMLString = true;
instance.message = `<strong>生成并保存联锁关系成功!</strong><br/><span>生成自动信号数据${resp.data.autoSignalCount}条;</span>
<br/><span>生成进路数据${resp.data.routeCount}</span><br/><span>生成延续保护数据${resp.data.overlapCount}</span><br/>
<span>生成自动折返数据${resp.data.cycleCount}</span>`;
instance.type = 'success';
}).catch((error)=> {
if (error.code === 500045) {
this.$message.error('生成并保存联锁关系失败:地图基础信息有误');
} else {
this.$message.error('生成并保存联锁关系失败!');
}
instance.confirmButtonLoading = false;
done();
});
});
} else {
done();
}
}
}).then(() => {});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('map.updateFailed'));