fix: update ConfirmRunAssetsDialog to conditionally show buttons based on running status

This commit is contained in:
w940853815 2025-04-15 14:42:01 +08:00
parent 60163a6026
commit 505de3e98e
2 changed files with 12 additions and 4 deletions

View File

@ -16,6 +16,7 @@
/> />
<ConfirmRunAssetsDialog <ConfirmRunAssetsDialog
:visible.sync="showConfirmRunAssetsDialog" :visible.sync="showConfirmRunAssetsDialog"
:is-running="isRunning"
:assets="classifiedAssets" :assets="classifiedAssets"
@submit="onConfirmRunAsset" @submit="onConfirmRunAsset"
/> />
@ -339,6 +340,9 @@ export default {
}, },
ztree() { ztree() {
return this.$refs.TreeTable.$refs.TreeList.$refs.AutoDataZTree.$refs.AutoDataZTree.$refs.dataztree.$refs.ztree return this.$refs.TreeTable.$refs.TreeList.$refs.AutoDataZTree.$refs.AutoDataZTree.$refs.dataztree.$refs.ztree
},
isRunning() {
return this.executionInfo.status.value === 'running'
} }
}, },
watch: { watch: {
@ -552,12 +556,12 @@ export default {
}) })
}, },
setBtn() { setBtn() {
if (this.executionInfo.status.value !== 'running') { if (!this.isRunning) {
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.isVisible = this.executionInfo.status.value === 'running' this.toolbar.left.run.isVisible = this.isRunning
this.toolbar.left.stop.isVisible = this.executionInfo.status.value !== 'running' this.toolbar.left.stop.isVisible = !this.isRunning
}, },
onSubmitVariable(parameters) { onSubmitVariable(parameters) {
this.parameters = parameters this.parameters = parameters

View File

@ -2,7 +2,7 @@
<Dialog <Dialog
:title="$t('ConfirmRunningAssets')" :title="$t('ConfirmRunningAssets')"
:visible.sync="iVisible" :visible.sync="iVisible"
:show-buttons="true" :show-buttons="!isRunning"
:show-confirm="true" :show-confirm="true"
:show-cancel="true" :show-cancel="true"
width="1200px" width="1200px"
@ -70,6 +70,10 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
} }
},
isRunning: {
type: Boolean,
default: false
} }
}, },
data() { data() {