diff --git a/packages/core/client/src/workflow/calculators.tsx b/packages/core/client/src/workflow/calculators.tsx index 348cd8cd4..f0c7ae17d 100644 --- a/packages/core/client/src/workflow/calculators.tsx +++ b/packages/core/client/src/workflow/calculators.tsx @@ -399,7 +399,7 @@ export const CollectionFieldset = observer(({ value, onChange, useProps }: any) : { type: 'constant', value: value[field.name] }; return ( - + {operand.type === 'constant' - ? + ? : null } diff --git a/packages/core/client/src/workflow/schemas/collection.ts b/packages/core/client/src/workflow/schemas/collection.ts index de4602b42..6eb662617 100644 --- a/packages/core/client/src/workflow/schemas/collection.ts +++ b/packages/core/client/src/workflow/schemas/collection.ts @@ -1,5 +1,6 @@ import { css } from "@emotion/css"; import { useForm } from "@formily/react"; +import { useCollectionManager } from "../../collection-manager"; import { useCollectionFilterOptions } from "../../collection-manager/action-hooks"; export const collection = { @@ -26,8 +27,9 @@ export const values = { 'x-component': 'CollectionFieldset', 'x-component-props': { useProps() { + const { getCollectionFields } = useCollectionManager(); const { values: form } = useForm(); - const fields = useCollectionFilterOptions(form.collection); + const fields = getCollectionFields(form.collection); return { fields }; } } diff --git a/packages/plugins/workflow/src/collections/workflows.ts b/packages/plugins/workflow/src/collections/workflows.ts index a6746afb1..c5b198a4f 100644 --- a/packages/plugins/workflow/src/collections/workflows.ts +++ b/packages/plugins/workflow/src/collections/workflows.ts @@ -44,7 +44,7 @@ export default { type: 'boolean', title: '使用事务', name: 'useTransaction', - defaultValue: false + defaultValue: true }, { interface: 'linkTo', diff --git a/packages/plugins/workflow/src/models/Execution.ts b/packages/plugins/workflow/src/models/Execution.ts index fbbd99cc0..55f92f949 100644 --- a/packages/plugins/workflow/src/models/Execution.ts +++ b/packages/plugins/workflow/src/models/Execution.ts @@ -76,7 +76,7 @@ export default class ExecutionModel extends Model { getTransaction() { const { sequelize } = (this.constructor).database; // @ts-ignore - if (!this.useTransaction || sequelize.options.dialect === 'sqlite') { + if (!this.useTransaction) { return undefined; } @@ -172,7 +172,7 @@ export default class ExecutionModel extends Model { // TODO(optimize): many checking of resuming or new could be improved // could be implemented separately in exec() / resume() if (job instanceof Model) { - savedJob = (await job.save({ transaction: this.transaction })) as JobModel; + savedJob = (await job.save({ transaction: this.transaction })) as unknown as JobModel; } else { const upstreamId = prevJob instanceof Model ? prevJob.get('id') : null; savedJob = await this.saveJob({ @@ -238,7 +238,7 @@ export default class ExecutionModel extends Model { executionId: this.id, }, { transaction: this.transaction }, - )) as [JobModel, boolean | null]; + )) as unknown as [JobModel, boolean | null]; this.jobsMap.set(job.id, job); this.jobsMapByNodeId[job.nodeId] = job.result;