|
|
@ -93,12 +93,12 @@ |
|
|
|
<el-button v-if="step === 2 || step === 3" |
|
|
|
<el-button v-if="step === 2 || step === 3" |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="prev">上一步</el-button> |
|
|
|
@click="prev">上一步</el-button> |
|
|
|
<el-button v-if="releaseType == 0" |
|
|
|
<el-button v-if="releaseType == 0 || (releaseType && step === 3)" |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="save(1)">发布</el-button> |
|
|
|
@click="save(1)">发布</el-button> |
|
|
|
<el-button v-else |
|
|
|
<el-button v-else |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="save(id ? 1 : 0, 2)">保存并下一步</el-button> |
|
|
|
@click="save(0, 2)">保存并下一步</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-button type="danger" |
|
|
|
<el-button type="danger" |
|
|
|
@click="preview" |
|
|
|
@click="preview" |
|
|
@ -155,20 +155,22 @@ export default { |
|
|
|
step4 |
|
|
|
step4 |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 离开的时候判断是否有保存更改的信息,没有则拦截并提示 |
|
|
|
// 离开的时候判断是否有保存更改的信息,没有则拦截并提示 |
|
|
|
beforeRouteLeave (to, from, next) { |
|
|
|
// beforeRouteLeave (to, from, next) { |
|
|
|
const { updateTime } = this.$refs['step' + this.step] |
|
|
|
// const { updateTime } = this.$refs['step' + this.step] |
|
|
|
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { |
|
|
|
// // debugger |
|
|
|
this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { |
|
|
|
// console.log('out', updateTime, this.step) |
|
|
|
type: 'warning' |
|
|
|
// if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { |
|
|
|
}).then(() => { |
|
|
|
// this.$confirm(`您所更改的内容未更新,是否更新?`, '提示', { |
|
|
|
this.save(this.step, to.path, next) |
|
|
|
// type: 'warning' |
|
|
|
}).catch(() => { |
|
|
|
// }).then(() => { |
|
|
|
next() |
|
|
|
// this.save(this.step, to.path, next) |
|
|
|
}) |
|
|
|
// }).catch(() => { |
|
|
|
} else { |
|
|
|
// next() |
|
|
|
next() |
|
|
|
// }) |
|
|
|
} |
|
|
|
// } else { |
|
|
|
}, |
|
|
|
// next() |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
this.getPer() |
|
|
|
this.getPer() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -198,9 +200,6 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
save (status, next = 0, cb) { |
|
|
|
save (status, next = 0, cb) { |
|
|
|
console.log('status=>', status) |
|
|
|
|
|
|
|
console.log('cb=>', cb) |
|
|
|
|
|
|
|
console.log('this.step=>', this.step) |
|
|
|
|
|
|
|
this.$refs['step' + this.step].save(status, next, this.releaseType, cb) |
|
|
|
this.$refs['step' + this.step].save(status, next, this.releaseType, cb) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 上一步 |
|
|
|
// 上一步 |
|
|
@ -234,7 +233,6 @@ export default { |
|
|
|
} else if (next === 1) { |
|
|
|
} else if (next === 1) { |
|
|
|
this.step-- |
|
|
|
this.step-- |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.log(99999999) |
|
|
|
|
|
|
|
if (typeof setupId === 'function') { |
|
|
|
if (typeof setupId === 'function') { |
|
|
|
setupId() |
|
|
|
setupId() |
|
|
|
} else if (typeof type === 'function') { |
|
|
|
} else if (typeof type === 'function') { |
|
|
@ -275,7 +273,6 @@ export default { |
|
|
|
back () { |
|
|
|
back () { |
|
|
|
// 更改了信息才需要提示 |
|
|
|
// 更改了信息才需要提示 |
|
|
|
const { updateTime } = this.$refs['step' + this.step] |
|
|
|
const { updateTime } = this.$refs['step' + this.step] |
|
|
|
console.log("🚀 ~ file: index.vue:278 ~ back ~ updateTime:", updateTime) |
|
|
|
|
|
|
|
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { |
|
|
|
if (this.step < 4 && this.$refs['step' + this.step] && updateTime) { |
|
|
|
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
|
|
|
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|