From 8393f7404697d7c8ea4fb314f7659b5926631f37 Mon Sep 17 00:00:00 2001 From: zhanghouying Date: Fri, 8 May 2020 16:28:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=83=A8=E7=BD=B2=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E6=95=B0=E6=8D=AE=E5=BA=93=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E9=80=89=E6=8B=A9=E8=AE=B0=E5=BD=95=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mnt/database/index.vue | 15 +++++++++++---- src/views/mnt/deploy/index.vue | 23 +++++++++++++++-------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/views/mnt/database/index.vue b/src/views/mnt/database/index.vue index fb31149..b61d08b 100644 --- a/src/views/mnt/database/index.vue +++ b/src/views/mnt/database/index.vue @@ -56,7 +56,7 @@ - + @@ -142,9 +142,16 @@ export default { execute() { this.$refs.execute.dialog = true }, - handleCurrentChange(row) { - this.currentRow = row - this.selectIndex = !row ? null : row.id + handleCurrentChange(selection) { + this.crud.selections = selection + if (selection.length === 1) { + const row = selection[0] + this.selectIndex = row.id + this.currentRow = row + } else { + this.currentRow = {} + this.selectIndex = '' + } } } } diff --git a/src/views/mnt/deploy/index.vue b/src/views/mnt/deploy/index.vue index c57a0e8..ff1cd69 100644 --- a/src/views/mnt/deploy/index.vue +++ b/src/views/mnt/deploy/index.vue @@ -96,7 +96,7 @@ - + @@ -187,13 +187,20 @@ export default { sysRestore() { this.$refs.sysRestore.dialog = true }, - handleCurrentChange(row) { - this.currentRow = row - this.selectIndex = !row ? null : row.id - this.appName = !row ? null : row.app.name - this.times = this.times + !row ? 0 : 1 - this.appId = !row ? null : row.appId - this.deployId = !row ? null : row.id + handleCurrentChange(selection) { + this.crud.selections = selection + if (selection.length === 1) { + const row = selection[0] + this.selectIndex = row.id + this.currentRow = row + this.appName = row.app.name + this.times = this.times + 1 + this.appId = row.appId + this.deployId = row.id + } else { + this.currentRow = {} + this.selectIndex = '' + } }, startServer() { crudDeploy.startServer(JSON.stringify(this.currentRow))