修改判定是否有记录被选定的方法,更严谨一些

This commit is contained in:
zhanghouying
2019-11-26 17:56:40 +08:00
parent 0351b72735
commit ad9cd8594e

View File

@@ -178,6 +178,7 @@ export default {
methods: { methods: {
beforeInit() { beforeInit() {
this.url = 'api/deploy' this.url = 'api/deploy'
this.selectIndex = ''
return true return true
}, },
// 打开新增弹窗前做的操作 // 打开新增弹窗前做的操作
@@ -204,7 +205,7 @@ export default {
return true return true
}, },
deploy() { deploy() {
if (this.selectIndex === '') { if (!this.selectIndex) {
this.$message.error('请先选择服务') this.$message.error('请先选择服务')
} else { } else {
this.$refs.deploy.dialog = true this.$refs.deploy.dialog = true
@@ -212,7 +213,7 @@ export default {
} }
}, },
sysRestore() { sysRestore() {
if (this.selectIndex === '') { if (!this.selectIndex) {
this.$message.error('请先选择服务') this.$message.error('请先选择服务')
} else { } else {
this.$refs.sysRestore.dialog = true this.$refs.sysRestore.dialog = true
@@ -227,7 +228,7 @@ export default {
this.deployId = !row ? null : row.id this.deployId = !row ? null : row.id
}, },
startServer() { startServer() {
if (this.selectIndex === '') { if (!this.selectIndex) {
this.$message.error('请先选择服务') this.$message.error('请先选择服务')
} else { } else {
this.crudMethod.startServer(JSON.stringify(this.currentRow)) this.crudMethod.startServer(JSON.stringify(this.currentRow))
@@ -239,7 +240,7 @@ export default {
} }
}, },
stopServer() { stopServer() {
if (this.selectIndex === '') { if (!this.selectIndex) {
this.$message.error('请先选择服务') this.$message.error('请先选择服务')
} else { } else {
this.crudMethod.stopServer(JSON.stringify(this.currentRow)) this.crudMethod.stopServer(JSON.stringify(this.currentRow))
@@ -251,7 +252,7 @@ export default {
} }
}, },
serverStatus() { serverStatus() {
if (this.selectIndex === '') { if (!this.selectIndex) {
this.$message.error('请先选择服务') this.$message.error('请先选择服务')
} else { } else {
this.crudMethod.serverStatus(JSON.stringify(this.currentRow)) this.crudMethod.serverStatus(JSON.stringify(this.currentRow))