mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 06:35:20 +00:00
Merge branch 'main' into next
This commit is contained in:
commit
7cb923f7bd
@ -451,23 +451,30 @@ function useSubmit() {
|
||||
const api = useAPIClient();
|
||||
const { setVisible } = useActionContext();
|
||||
const { values, submit } = useForm();
|
||||
const field = useField();
|
||||
const buttonSchema = useFieldSchema();
|
||||
const { service } = useTableBlockContext();
|
||||
const { userJob, execution } = useFlowContext();
|
||||
const { name: actionKey } = buttonSchema;
|
||||
const { name: formKey } = buttonSchema.parent.parent;
|
||||
const { assignedValues = {} } = buttonSchema?.['x-action-settings'] ?? {};
|
||||
return {
|
||||
async run() {
|
||||
if (execution.status || userJob.status) {
|
||||
return;
|
||||
}
|
||||
await submit();
|
||||
field.data = field.data || {};
|
||||
field.data.loading = true;
|
||||
|
||||
await api.resource('users_jobs').submit({
|
||||
filterByTk: userJob.id,
|
||||
values: {
|
||||
result: { [formKey]: values, _: actionKey },
|
||||
result: { [formKey]: { ...values, ...assignedValues.values }, _: actionKey },
|
||||
},
|
||||
});
|
||||
|
||||
field.data.loading = false;
|
||||
setVisible(false);
|
||||
service.refresh();
|
||||
},
|
||||
|
@ -39,6 +39,7 @@ import {
|
||||
useSchemaInitializer,
|
||||
useSchemaInitializerItem,
|
||||
useSchemaOptionsContext,
|
||||
useVariableScope,
|
||||
} from '@nocobase/client';
|
||||
import WorkflowPlugin, {
|
||||
DetailsBlockProvider,
|
||||
@ -358,7 +359,7 @@ function ActionInitializer() {
|
||||
...actionProps,
|
||||
useAction: '{{ useSubmit }}',
|
||||
},
|
||||
'x-designer': 'Action.Designer',
|
||||
'x-designer': 'ManualActionDesigner',
|
||||
'x-action': `${action}`,
|
||||
}}
|
||||
type="x-action"
|
||||
|
@ -70,6 +70,7 @@ function UpdateFormDesigner() {
|
||||
});
|
||||
dn.refresh();
|
||||
}}
|
||||
width="60%"
|
||||
/>
|
||||
<SchemaSettingsLinkageRules collectionName={name} />
|
||||
<SchemaSettingsDivider />
|
||||
|
Loading…
Reference in New Issue
Block a user