Commit ad9cd859 by zhanghouying

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

parent 0351b727
...@@ -178,6 +178,7 @@ export default { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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 { ...@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment