Merge pull request 'fix' (#231) from annzee/JCC-RIP:cetc into master

This commit is contained in:
annzee 2024-09-13 15:33:46 +08:00
commit 823a5bb048
1 changed files with 68 additions and 20 deletions

View File

@ -286,32 +286,80 @@ export default {
dangerouslyUseHTMLString: true,
confirmButtonText: '确认',
center: true,
cancelButtonText: '取消'
}).then(() => {
type === 1 ? startDeployInstance(data).then(e => {
this.$message.success(this.$t('message.success'))
this.freshAllList()
})
: startAllInstance(allId).then(e => {
this.$message.success(this.$t('message.success'))
this.freshAllList()
})
cancelButtonText: '取消',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
instance.showCancelButton = false
instance.confirmButtonLoading = true
instance.confirmButtonText = '执行中...'
type === 1 ? startDeployInstance(data).then(e => {
this.$message.success(this.$t('message.success'))
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
done()
this.freshAllList()
}).catch(e => {
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
})
: startAllInstance(allId).then(e => {
this.$message.success(this.$t('message.success'))
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
done()
this.freshAllList()
}).catch(e => {
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
})
} else {
done()
}
}
})
} else {
this.$confirm('<p>确定要停止么?</p>', '温馨提示', {
dangerouslyUseHTMLString: true,
confirmButtonText: '确认',
center: true,
cancelButtonText: '取消'
}).then(() => {
type === 2 ? stopDeployInstance(data).then(e => {
this.$message.success(this.$t('message.success'))
this.freshAllList()
})
: stopAllInstance(allId).then(e => {
this.$message.success(this.$t('message.success'))
this.freshAllList()
})
cancelButtonText: '取消',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
instance.showCancelButton = false
instance.confirmButtonLoading = true
instance.confirmButtonText = '执行中...'
type === 2 ? stopDeployInstance(data).then(e => {
this.$message.success(this.$t('message.success'))
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
done()
this.freshAllList()
}).catch(e => {
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
})
: stopAllInstance(allId).then(e => {
this.$message.success(this.$t('message.success'))
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
done()
this.freshAllList()
}).catch(e => {
instance.confirmButtonLoading = false
instance.confirmButtonText = '确认'
instance.showCancelButton = true
})
} else {
done()
}
}
})
}
}