Skip to content

Commit

Permalink
fix(StageButton): Add disabled and change apiName #150536
Browse files Browse the repository at this point in the history
  • Loading branch information
StormKennen committed Dec 4, 2023
1 parent 4aa33f7 commit fc423f0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/MetadataInstances.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default class MetadataInstances extends Http {
checkTableExist(params) {
return this.axios.get(this.url + '/check/table/exist', { params })
}
logicSchema(taskId, params) {
deleteLogicSchema(taskId, params) {
return this.axios.delete(this.url + '/logic/schema/' + taskId, { params })
}
pageTables(params) {
Expand Down
10 changes: 8 additions & 2 deletions packages/business/src/components/StageButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ElButton type="text" :loading="loading" @click="loadSchema">
<ElButton type="text" :loading="loading" :disabled="disabled" @click="loadSchema">
<template v-if="loading">
<span>{{ progress }}</span>
</template>
Expand Down Expand Up @@ -31,6 +31,10 @@ export default {
default: () => {
return i18n.t('public_button_reload')
}
},
disabled: {
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -66,6 +70,7 @@ export default {
},
loadSchema() {
if (this.disabled) return
connectionsApi
.updateById(this.connectionId, {
loadCount: 0,
Expand All @@ -80,6 +85,7 @@ export default {
},
getProgress(check = false) {
if (this.disabled) return
if (this.destroyStatus) return
if (!this.connectionId) return
if (!check) {
Expand All @@ -95,7 +101,7 @@ export default {
const { taskId, nodeId } = this
if (!check && taskId && nodeId) {
metadataInstancesApi
.logicSchema(taskId, {
.deleteLogicSchema(taskId, {
nodeId
})
.then(this.updateDag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const StageButtonLabel = observer(
connection-id={props.connectionId}
task-id={taskId}
node-id={activeNodeId}
disabled={formRef.value.disabled}
on={{ complete: trigger }}
></StageButton>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ export default {
const { taskId, activeNodeId } = this.$store.state?.dataflow || {}
if (!check && taskId && activeNodeId) {
metadataInstancesApi
.logicSchema(taskId, {
.deleteLogicSchema(taskId, {
nodeId: activeNodeId
})
.then(() => {
Expand Down

0 comments on commit fc423f0

Please sign in to comment.