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

View File

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