diff --git a/src/pages/project/add/index.vue b/src/pages/project/add/index.vue index 784f057..b50d047 100644 --- a/src/pages/project/add/index.vue +++ b/src/pages/project/add/index.vue @@ -232,7 +232,8 @@ export default { listLoading:false,// 列表加载 submiting: false, // 新增编辑员工防抖标识 updateTime: 0, - next: null + next: null, + backType: false }; }, computed: { @@ -275,14 +276,19 @@ export default { beforeRouteLeave(to, from, next) { console.log(44, this.updateTime) if(this.updateTime){ - this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { - type: 'warning' - }).then(() => { - this.next = next - this.save(this.projectManage.state) - }).catch(() => { + if(!this.backType) { + this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { + type: 'warning' + }).then(() => { + this.next = next + this.save(this.projectManage.state) + }).catch(() => { + next() + }) + }else { next() - }) + } + }else{ next() } @@ -697,6 +703,7 @@ export default { }, // 返回 back() { + this.backType = true // 更改了信息才需要提示 if(this.updateTime){ this.$confirm('编辑的内容未保存,是否保存?', "提示", { @@ -704,10 +711,10 @@ export default { }).then(() => { this.save(this.projectManage.state) }).catch(() => { - this.$router.back() + this.$router.push('/project/list') }) } else { - this.$router.back() + this.$router.push('/project/list') } } } diff --git a/src/setting.js b/src/setting.js index 41f846d..0fbbd78 100644 --- a/src/setting.js +++ b/src/setting.js @@ -26,7 +26,7 @@ if (isPro) { uploadURL = `http://121.37.12.51/` host = "http://121.37.12.51/"; // 中台测试服 // host = 'https://www.occupationlab.com/' // 正式服 - host = "http://192.168.31.151:9000/"; // 榕 + // host = "http://192.168.31.151:9000/"; // 榕 // host = 'http://192.168.31.116:9000/'; // 赓 }