();
+
+triggers.register('model', model);
+
export const TriggerConfig = () => {
const { data } = useResourceActionContext();
if (!data) {
return null;
}
const { type, config } = data.data;
- const { title, fieldset, scope } = triggerTypes[type];
+ const { title, fieldset, scope } = triggers.get(type);
return (
{title}
diff --git a/packages/client/src/workflow/triggers/model.tsx b/packages/client/src/workflow/triggers/model.tsx
index a8905362a..8ed33e1c2 100644
--- a/packages/client/src/workflow/triggers/model.tsx
+++ b/packages/client/src/workflow/triggers/model.tsx
@@ -1,9 +1,15 @@
+import React from 'react';
import { action } from '@formily/reactive';
import { t } from 'i18next';
+import { Select } from 'antd';
+
import { useCollectionManager } from '../../collection-manager';
+import { useFlowContext } from '../WorkflowCanvas';
+import { BaseTypeSet } from '../calculators';
export default {
title: '数据表事件',
+ type: 'model',
fieldset: {
collection: {
type: 'string',
@@ -32,5 +38,22 @@ export default {
})(collections);
}
}
+ },
+ getter({ type, options, onChange }) {
+ const { collections = [] } = useCollectionManager();
+ const { workflow } = useFlowContext();
+ const collection = collections.find(item => item.name === workflow.config.collection) ?? { fields: [] };
+
+ return (
+
+ );
}
};