From 6d38dd5ba375ba936f0bf47d6547ea01c49b9cc8 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 11 May 2020 15:47:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=81=94=E9=94=81=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E7=94=9F=E6=88=90=E8=BF=87=E6=B8=A1=E5=92=8C=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/newMapdraft/ciConfig.vue | 35 +++++++++++++++++------ 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/views/newMap/newMapdraft/ciConfig.vue b/src/views/newMap/newMapdraft/ciConfig.vue index fd5316846..f038fcabf 100644 --- a/src/views/newMap/newMapdraft/ciConfig.vue +++ b/src/views/newMap/newMapdraft/ciConfig.vue @@ -197,14 +197,33 @@ export default { this.$confirm('生成联锁关系会删除旧的联锁关系,是否继续生成', { confirmButtonText: '继续', cancelButtonText: this.$t('tip.cancel'), - type: 'warning' - }).then(() => { - generateCI(this.$route.params.mapId).then(resp => { - this.$message.success('生成并保存联锁关系成功!'); - }).catch(()=> { - this.$message.error('生成并保存联锁关系失败!'); - }); - }); + type: 'warning', + beforeClose: (action, instance, done) => { + if (action === 'confirm' && instance.confirmButtonText === '继续') { + instance.confirmButtonLoading = true; + instance.confirmButtonText = '生成中...'; + generateCI(this.$route.params.mapId).then(resp => { + instance.confirmButtonLoading = false; + instance.confirmButtonText = '确定'; + instance.dangerouslyUseHTMLString = true; + instance.message = `生成并保存联锁关系成功!
生成自动信号数据${resp.data.autoSignalCount}条; +
生成进路数据${resp.data.routeCount}条;
生成延续保护数据${resp.data.overlapCount}条;
+生成自动折返数据${resp.data.cycleCount}条;`; + 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'));