perf: Workbench shortcut command execution and stop buttons switch each other

This commit is contained in:
feng
2024-05-09 15:50:42 +08:00
parent 8a6459e828
commit 77be9ddf8d
2 changed files with 6 additions and 7 deletions

View File

@@ -8,8 +8,7 @@
>
<el-tooltip :content="item.tip" :disabled="!item.tip" placement="top">
<el-button
v-if="item.type ==='button'"
:disabled="item.disabled"
v-if="item.type ==='button' && !item.isVisible"
:type="item.el&&item.el.type"
size="mini"
@click="item.callback()"

View File

@@ -102,7 +102,7 @@ export default {
align: 'left',
icon: 'fa fa-play',
tip: this.$t('RunCommand'),
disabled: this.$store.getters.currentOrgIsRoot,
isVisible: this.$store.getters.currentOrgIsRoot,
el: {
type: 'primary'
},
@@ -116,7 +116,7 @@ export default {
align: 'left',
icon: 'fa fa-stop',
tip: this.$t('StopJob'),
disabled: true,
isVisible: true,
el: {
type: 'danger'
},
@@ -391,7 +391,7 @@ export default {
setCostTimeInterval() {
this.toolbar.left.run.icon = 'fa fa-spinner fa-spin'
this.toolbar.left.run.disabled = true
this.toolbar.left.run.isVisible = true
this.executionInfo.cancel = setInterval(() => {
this.executionInfo.timeCost += 0.1
}, 100)
@@ -469,8 +469,8 @@ export default {
clearInterval(this.executionInfo.cancel)
this.toolbar.left.run.icon = 'fa fa-play'
}
this.toolbar.left.run.disabled = this.executionInfo.status === 'running'
this.toolbar.left.stop.disabled = this.executionInfo.status !== 'running'
this.toolbar.left.run.isVisible = this.executionInfo.status === 'running'
this.toolbar.left.stop.isVisible = this.executionInfo.status !== 'running'
}
}
}