Skip to content

Commit

Permalink
解决部署管理和数据库管理,选择记录不能启用自定义按钮的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhy6599 committed May 8, 2020
1 parent 4ef60b1 commit 8393f74
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
15 changes: 11 additions & 4 deletions src/views/mnt/database/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="handleCurrentChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="name" width="130px" label="数据库名称" />
<el-table-column prop="jdbcUrl" label="连接地址" />
Expand Down Expand Up @@ -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 = ''
}
}
}
}
Expand Down
23 changes: 15 additions & 8 deletions src/views/mnt/deploy/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<fForm ref="sysRestore" :key="times" :app-name="appName" />
<dForm ref="deploy" />
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="handleCurrentChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="app.name" label="应用名称" />
<el-table-column prop="servers" label="服务器列表" />
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 8393f74

Please sign in to comment.