@nocobase/client 0.7.0-alpha.2 → 0.7.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/esm/acl/Configuration/RoleConfigure.js +4 -4
  2. package/esm/acl/Configuration/RoleConfigure.js.map +1 -1
  3. package/esm/acl/Configuration/schemas/roles.js +1 -1
  4. package/esm/acl/Configuration/schemas/roles.js.map +1 -1
  5. package/esm/locale/index.d.ts +5 -0
  6. package/esm/locale/zh_CN.d.ts +5 -0
  7. package/esm/locale/zh_CN.js +5 -0
  8. package/esm/locale/zh_CN.js.map +1 -1
  9. package/esm/schema-component/antd/menu/Menu.js +1 -1
  10. package/esm/schema-component/antd/menu/Menu.js.map +1 -1
  11. package/esm/schema-initializer/buttons/BlockInitializers.d.ts +2 -11
  12. package/esm/schema-initializer/buttons/BlockInitializers.js +2 -0
  13. package/esm/schema-initializer/buttons/BlockInitializers.js.map +1 -1
  14. package/esm/workflow/calculators.js +2 -4
  15. package/esm/workflow/calculators.js.map +1 -1
  16. package/esm/workflow/nodes/calculation.d.ts +1 -1
  17. package/esm/workflow/nodes/calculation.js +9 -3
  18. package/esm/workflow/nodes/calculation.js.map +1 -1
  19. package/esm/workflow/nodes/condition.d.ts +3 -3
  20. package/esm/workflow/nodes/condition.js +15 -9
  21. package/esm/workflow/nodes/condition.js.map +1 -1
  22. package/esm/workflow/nodes/create.d.ts +3 -3
  23. package/esm/workflow/nodes/create.js +5 -5
  24. package/esm/workflow/nodes/create.js.map +1 -1
  25. package/esm/workflow/nodes/destroy.d.ts +2 -2
  26. package/esm/workflow/nodes/destroy.js +3 -3
  27. package/esm/workflow/nodes/destroy.js.map +1 -1
  28. package/esm/workflow/nodes/index.d.ts +1 -1
  29. package/esm/workflow/nodes/index.js +75 -56
  30. package/esm/workflow/nodes/index.js.map +1 -1
  31. package/esm/workflow/nodes/parallel.d.ts +2 -2
  32. package/esm/workflow/nodes/parallel.js +11 -5
  33. package/esm/workflow/nodes/parallel.js.map +1 -1
  34. package/esm/workflow/nodes/query.d.ts +3 -3
  35. package/esm/workflow/nodes/query.js +5 -5
  36. package/esm/workflow/nodes/query.js.map +1 -1
  37. package/esm/workflow/nodes/update.d.ts +2 -2
  38. package/esm/workflow/nodes/update.js +3 -3
  39. package/esm/workflow/nodes/update.js.map +1 -1
  40. package/esm/workflow/schemas/collection.js +10 -6
  41. package/esm/workflow/schemas/collection.js.map +1 -1
  42. package/esm/workflow/schemas/workflows.js +20 -12
  43. package/esm/workflow/schemas/workflows.js.map +1 -1
  44. package/esm/workflow/triggers/index.js +19 -9
  45. package/esm/workflow/triggers/index.js.map +1 -1
  46. package/esm/workflow/triggers/model.d.ts +18 -4
  47. package/esm/workflow/triggers/model.js +47 -9
  48. package/esm/workflow/triggers/model.js.map +1 -1
  49. package/lib/acl/Configuration/RoleConfigure.js +4 -4
  50. package/lib/acl/Configuration/RoleConfigure.js.map +1 -1
  51. package/lib/acl/Configuration/schemas/roles.js +1 -1
  52. package/lib/acl/Configuration/schemas/roles.js.map +1 -1
  53. package/lib/locale/index.d.ts +5 -0
  54. package/lib/locale/zh_CN.d.ts +5 -0
  55. package/lib/locale/zh_CN.js +5 -0
  56. package/lib/locale/zh_CN.js.map +1 -1
  57. package/lib/schema-component/antd/menu/Menu.js +1 -1
  58. package/lib/schema-component/antd/menu/Menu.js.map +1 -1
  59. package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -11
  60. package/lib/schema-initializer/buttons/BlockInitializers.js +2 -0
  61. package/lib/schema-initializer/buttons/BlockInitializers.js.map +1 -1
  62. package/lib/workflow/calculators.js +2 -4
  63. package/lib/workflow/calculators.js.map +1 -1
  64. package/lib/workflow/nodes/calculation.d.ts +1 -1
  65. package/lib/workflow/nodes/calculation.js +9 -3
  66. package/lib/workflow/nodes/calculation.js.map +1 -1
  67. package/lib/workflow/nodes/condition.d.ts +3 -3
  68. package/lib/workflow/nodes/condition.js +13 -7
  69. package/lib/workflow/nodes/condition.js.map +1 -1
  70. package/lib/workflow/nodes/create.d.ts +3 -3
  71. package/lib/workflow/nodes/create.js +5 -5
  72. package/lib/workflow/nodes/create.js.map +1 -1
  73. package/lib/workflow/nodes/destroy.d.ts +2 -2
  74. package/lib/workflow/nodes/destroy.js +3 -3
  75. package/lib/workflow/nodes/destroy.js.map +1 -1
  76. package/lib/workflow/nodes/index.d.ts +1 -1
  77. package/lib/workflow/nodes/index.js +79 -60
  78. package/lib/workflow/nodes/index.js.map +1 -1
  79. package/lib/workflow/nodes/parallel.d.ts +2 -2
  80. package/lib/workflow/nodes/parallel.js +10 -4
  81. package/lib/workflow/nodes/parallel.js.map +1 -1
  82. package/lib/workflow/nodes/query.d.ts +3 -3
  83. package/lib/workflow/nodes/query.js +5 -5
  84. package/lib/workflow/nodes/query.js.map +1 -1
  85. package/lib/workflow/nodes/update.d.ts +2 -2
  86. package/lib/workflow/nodes/update.js +3 -3
  87. package/lib/workflow/nodes/update.js.map +1 -1
  88. package/lib/workflow/schemas/collection.js +10 -6
  89. package/lib/workflow/schemas/collection.js.map +1 -1
  90. package/lib/workflow/schemas/workflows.js +20 -12
  91. package/lib/workflow/schemas/workflows.js.map +1 -1
  92. package/lib/workflow/triggers/index.js +19 -9
  93. package/lib/workflow/triggers/index.js.map +1 -1
  94. package/lib/workflow/triggers/model.d.ts +18 -4
  95. package/lib/workflow/triggers/model.js +47 -9
  96. package/lib/workflow/triggers/model.js.map +1 -1
  97. package/package.json +4 -4
  98. package/src/acl/Configuration/RoleConfigure.tsx +4 -4
  99. package/src/acl/Configuration/schemas/roles.ts +1 -1
  100. package/src/locale/zh_CN.ts +5 -1
  101. package/src/schema-component/antd/menu/Menu.tsx +2 -1
  102. package/src/schema-initializer/buttons/BlockInitializers.tsx +2 -0
  103. package/src/workflow/calculators.tsx +2 -4
  104. package/src/workflow/nodes/calculation.tsx +4 -3
  105. package/src/workflow/nodes/condition.tsx +35 -12
  106. package/src/workflow/nodes/create.tsx +10 -7
  107. package/src/workflow/nodes/destroy.tsx +3 -3
  108. package/src/workflow/nodes/index.tsx +64 -59
  109. package/src/workflow/nodes/parallel.tsx +25 -5
  110. package/src/workflow/nodes/query.tsx +5 -5
  111. package/src/workflow/nodes/update.tsx +3 -3
  112. package/src/workflow/schemas/collection.ts +9 -7
  113. package/src/workflow/schemas/workflows.ts +20 -12
  114. package/src/workflow/triggers/index.tsx +11 -9
  115. package/src/workflow/triggers/model.tsx +48 -9
@@ -32,7 +32,7 @@ export const calculators = [
32
32
  children: [
33
33
  { value: 'add', name: '+' },
34
34
  { value: 'minus', name: '-' },
35
- { value: 'multipe', name: '*' },
35
+ { value: 'multiple', name: '*' },
36
36
  { value: 'divide', name: '/' },
37
37
  { value: 'mod', name: '%' },
38
38
  ]
@@ -395,9 +395,7 @@ export const CollectionFieldset = observer(({ value, onChange, useProps }: any)
395
395
  }
396
396
  `}>
397
397
  {fields.length
398
- ? fields
399
- .filter(field => !field.hidden)
400
- .map(field => {
398
+ ? fields.map(field => {
401
399
  const operand = typeof value[field.name] === 'string'
402
400
  ? parseStringValue(value[field.name], VTypes)
403
401
  : { type: 'constant', value: value[field.name] };
@@ -1,3 +1,4 @@
1
+ import { css } from '@emotion/css';
1
2
  import React from 'react';
2
3
  import { Calculation } from '../calculators';
3
4
 
@@ -6,10 +7,10 @@ export default {
6
7
  type: 'calculation',
7
8
  group: 'control',
8
9
  fieldset: {
9
- calculation: {
10
+ 'config.calculation': {
10
11
  type: 'object',
11
12
  title: '配置计算',
12
- name: 'calculation',
13
+ name: 'config.calculation',
13
14
  required: true,
14
15
  'x-decorator': 'FormItem',
15
16
  'x-component': 'CalculationConfig',
@@ -26,6 +27,6 @@ export default {
26
27
  }
27
28
  },
28
29
  getter() {
29
- return <div>计算值</div>;
30
+ return <div className={css`flex-shrink: 0`}>计算值</div>;
30
31
  }
31
32
  };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { css, cx } from "@emotion/css";
3
- import { Button, Select } from "antd";
4
- import { CloseCircleOutlined } from '@ant-design/icons';
3
+ import { Button, Select, Tooltip } from "antd";
4
+ import { CloseCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
5
5
  import { Trans } from "react-i18next";
6
6
 
7
7
  import { NodeDefaultView } from ".";
@@ -66,17 +66,20 @@ function CalculationGroup({ value, onChange }) {
66
66
  }
67
67
 
68
68
  return (
69
- <div className={css`
69
+ <div className={cx('node-type-condition-group', css`
70
70
  position: relative;
71
71
  width: 100%;
72
- padding: .5em 1em;
73
- border: 1px dashed #ddd;
72
+
73
+ .node-type-condition-group{
74
+ padding: .5em 1em;
75
+ border: 1px dashed #ddd;
76
+ }
74
77
 
75
78
  + button{
76
79
  position: absolute;
77
80
  right: 0;
78
81
  }
79
- `}>
82
+ `)}>
80
83
  <div className={css`
81
84
  display: flex;
82
85
  align-items: center;
@@ -131,9 +134,9 @@ export default {
131
134
  type: 'condition',
132
135
  group: 'control',
133
136
  fieldset: {
134
- rejectOnFalse: {
137
+ 'config.rejectOnFalse': {
135
138
  type: 'boolean',
136
- name: 'rejectOnFalse',
139
+ name: 'config.rejectOnFalse',
137
140
  title: '模式',
138
141
  'x-decorator': 'FormItem',
139
142
  'x-component': 'Radio.Group',
@@ -141,13 +144,33 @@ export default {
141
144
  disabled: true,
142
145
  },
143
146
  enum: [
144
- { value: true, label: '通行模式' },
145
- { value: false, label: '分支模式' },
147
+ {
148
+ value: true,
149
+ label: (
150
+ <Tooltip
151
+ title="判断为“是”时继续"
152
+ placement="bottom"
153
+ >
154
+ 通行模式 <QuestionCircleOutlined style={{ color: '#999' }} />
155
+ </Tooltip>
156
+ )
157
+ },
158
+ {
159
+ value: false,
160
+ label: (
161
+ <Tooltip
162
+ title="判断结果分为“是”和“否”两个分支,分别继续"
163
+ placement="bottom"
164
+ >
165
+ 分支模式 <QuestionCircleOutlined style={{ color: '#999' }} />
166
+ </Tooltip>
167
+ )
168
+ }
146
169
  ],
147
170
  },
148
- calculation: {
171
+ 'config.calculation': {
149
172
  type: 'string',
150
- name: 'calculation',
173
+ name: 'config.calculation',
151
174
  title: '条件配置',
152
175
  'x-decorator': 'FormItem',
153
176
  'x-component': 'CalculationConfig',
@@ -1,17 +1,20 @@
1
- import React from 'react';
2
1
  import { Select } from 'antd';
3
-
2
+ import React from 'react';
4
3
  import { useCollectionDataSource, useCollectionManager, useCompile } from '../..';
5
- import { useFlowContext } from '../WorkflowCanvas';
6
- import { collection, values } from '../schemas/collection';
7
4
  import { BaseTypeSet, CollectionFieldset } from '../calculators';
5
+ import { collection, values } from '../schemas/collection';
6
+ import { useFlowContext } from '../WorkflowCanvas';
7
+
8
8
 
9
9
  export default {
10
10
  title: '新增数据',
11
11
  type: 'create',
12
12
  group: 'model',
13
13
  fieldset: {
14
- collection,
14
+ 'config.collection': {
15
+ ...collection,
16
+ name: 'config.collection'
17
+ },
15
18
  // multiple: {
16
19
  // type: 'boolean',
17
20
  // title: '多条数据',
@@ -22,9 +25,9 @@ export default {
22
25
  // disabled: true
23
26
  // }
24
27
  // },
25
- params: {
28
+ 'config.params': {
26
29
  type: 'object',
27
- name: 'params',
30
+ name: 'config.params',
28
31
  title: '',
29
32
  'x-decorator': 'FormItem',
30
33
  properties: {
@@ -8,10 +8,10 @@ export default {
8
8
  type: 'destroy',
9
9
  group: 'model',
10
10
  fieldset: {
11
- collection,
12
- params: {
11
+ 'config.collection': collection,
12
+ 'config.params': {
13
13
  type: 'object',
14
- name: 'params',
14
+ name: 'config.params',
15
15
  title: '',
16
16
  'x-decorator': 'FormItem',
17
17
  properties: {
@@ -1,23 +1,20 @@
1
- import React, { useContext } from 'react';
1
+ import { CloseOutlined, DeleteOutlined } from '@ant-design/icons';
2
2
  import { css, cx } from '@emotion/css';
3
- import { Button, Modal, Tag } from 'antd';
4
- import { DeleteOutlined, CloseOutlined } from '@ant-design/icons';
5
3
  import { ISchema, useForm } from '@formily/react';
6
-
7
4
  import { Registry } from '@nocobase/utils';
8
-
5
+ import { Button, Modal, Tag } from 'antd';
6
+ import React, { useContext } from 'react';
9
7
  import { SchemaComponent, useActionContext, useAPIClient, useCollection, useRequest, useResourceActionContext } from '../..';
8
+ import { nodeBlockClass, nodeCardClass, nodeClass, nodeHeaderClass, nodeTitleClass } from '../style';
10
9
  import { AddButton, useFlowContext } from '../WorkflowCanvas';
11
10
 
12
- import { nodeClass, nodeCardClass, nodeHeaderClass, nodeTitleClass, nodeBlockClass } from '../style';
13
-
14
- import query from './query';
11
+ import calculation from './calculation';
12
+ import condition from './condition';
15
13
  import create from './create';
16
- import update from './update';
17
14
  import destroy from './destroy';
18
- import condition from './condition';
19
15
  import parallel from './parallel';
20
- import calculation from './calculation';
16
+ import query from './query';
17
+ import update from './update';
21
18
 
22
19
 
23
20
 
@@ -45,7 +42,7 @@ instructions.register('condition', condition);
45
42
  instructions.register('parallel', parallel);
46
43
  instructions.register('calculation', calculation);
47
44
 
48
- function useUpdateConfigAction() {
45
+ function useUpdateAction() {
49
46
  const form = useForm();
50
47
  const api = useAPIClient();
51
48
  const ctx = useActionContext();
@@ -53,14 +50,13 @@ function useUpdateConfigAction() {
53
50
  const data = useNodeContext();
54
51
  return {
55
52
  async run() {
53
+ await form.submit();
56
54
  await api.resource('flow_nodes', data.id).update({
57
55
  filterByTk: data.id,
58
56
  values: {
59
- config: {
60
- ...data.config,
61
- ...form.values
62
- }
63
- },
57
+ title: form.values.title,
58
+ config: form.values.config
59
+ }
64
60
  });
65
61
  ctx.setVisible(false);
66
62
  refresh();
@@ -171,58 +167,67 @@ export function NodeDefaultView(props) {
171
167
  type: 'void',
172
168
  properties: {
173
169
  view: instruction.view,
174
- ...(Object.keys(instruction.fieldset).length
175
- ? {
176
- config: {
170
+ config: {
171
+ type: 'void',
172
+ title: '配置节点',
173
+ 'x-component': 'Action.Link',
174
+ 'x-component-props': {
175
+ type: 'primary',
176
+ },
177
+ properties: {
178
+ drawer: {
177
179
  type: 'void',
178
180
  title: '配置节点',
179
- 'x-component': 'Action.Link',
180
- 'x-component-props': {
181
- type: 'primary',
181
+ 'x-component': 'Action.Drawer',
182
+ 'x-decorator': 'Form',
183
+ 'x-decorator-props': {
184
+ useValues(options) {
185
+ const d = useNodeContext();
186
+ return useRequest(() => {
187
+ return Promise.resolve({ data: d });
188
+ }, options);
189
+ }
182
190
  },
183
191
  properties: {
184
- drawer: {
192
+ title: {
193
+ type: 'string',
194
+ name: 'title',
195
+ title: '节点名称',
196
+ 'x-decorator': 'FormItem',
197
+ 'x-component': 'Input',
198
+ },
199
+ config: {
185
200
  type: 'void',
186
- title: '配置节点',
187
- 'x-component': 'Action.Drawer',
188
- 'x-decorator': 'Form',
189
- 'x-decorator-props': {
190
- useValues(options) {
191
- const node = useNodeContext();
192
- return useRequest(() => {
193
- return Promise.resolve({ data: node.config });
194
- }, options);
195
- }
196
- },
201
+ name: 'config',
202
+ 'x-component': 'fieldset',
203
+ 'x-component-props': {},
204
+ properties: instruction.fieldset
205
+ },
206
+ actions: {
207
+ type: 'void',
208
+ 'x-component': 'Action.Drawer.Footer',
197
209
  properties: {
198
- ...instruction.fieldset,
199
- actions: {
200
- type: 'void',
201
- 'x-component': 'Action.Drawer.Footer',
202
- properties: {
203
- cancel: {
204
- title: '{{t("Cancel")}}',
205
- 'x-component': 'Action',
206
- 'x-component-props': {
207
- useAction: '{{ cm.useCancelAction }}',
208
- },
209
- },
210
- submit: {
211
- title: '{{t("Submit")}}',
212
- 'x-component': 'Action',
213
- 'x-component-props': {
214
- type: 'primary',
215
- useAction: useUpdateConfigAction,
216
- },
217
- },
210
+ cancel: {
211
+ title: '{{t("Cancel")}}',
212
+ 'x-component': 'Action',
213
+ 'x-component-props': {
214
+ useAction: '{{ cm.useCancelAction }}',
218
215
  },
219
- } as ISchema
220
- }
221
- }
216
+ },
217
+ submit: {
218
+ title: '{{t("Submit")}}',
219
+ 'x-component': 'Action',
220
+ 'x-component-props': {
221
+ type: 'primary',
222
+ useAction: useUpdateAction,
223
+ },
224
+ },
225
+ },
226
+ } as ISchema
222
227
  }
223
228
  }
224
229
  }
225
- : {})
230
+ }
226
231
  }
227
232
  }}
228
233
  />
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { css, cx } from "@emotion/css";
3
- import { PlusOutlined } from '@ant-design/icons';
3
+ import { PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
4
4
 
5
5
  import { NodeDefaultView } from ".";
6
6
  import { Branch, useFlowContext } from "../WorkflowCanvas";
@@ -13,17 +13,37 @@ export default {
13
13
  type: 'parallel',
14
14
  group: 'control',
15
15
  fieldset: {
16
- mode: {
16
+ 'config.mode': {
17
17
  type: 'string',
18
- name: 'mode',
18
+ name: 'config.mode',
19
19
  title: '模式',
20
20
  'x-decorator': 'FormItem',
21
21
  'x-component': 'Radio.Group',
22
22
  'x-component-props': {
23
23
  },
24
24
  enum: [
25
- { value: 'all', label: '全部成功' },
26
- { value: 'any', label: '任意成功' },
25
+ {
26
+ value: 'all',
27
+ label: (
28
+ <Tooltip
29
+ title="全部分支都成功后才能继续"
30
+ placement="bottom"
31
+ >
32
+ 全部成功 <QuestionCircleOutlined style={{ color: '#999' }} />
33
+ </Tooltip>
34
+ )
35
+ },
36
+ {
37
+ value: 'any',
38
+ label: (
39
+ <Tooltip
40
+ title="任意分支成功后就继续"
41
+ placement="bottom"
42
+ >
43
+ 任意成功 <QuestionCircleOutlined style={{ color: '#999' }} />
44
+ </Tooltip>
45
+ )
46
+ },
27
47
  // { value: 'race', label: '任意退出' },
28
48
  ],
29
49
  default: 'all'
@@ -12,20 +12,20 @@ export default {
12
12
  type: 'query',
13
13
  group: 'model',
14
14
  fieldset: {
15
- collection,
16
- multiple: {
15
+ 'config.collection': collection,
16
+ 'config.multiple': {
17
17
  type: 'boolean',
18
18
  title: '多条数据',
19
- name: 'multiple',
19
+ name: 'config.multiple',
20
20
  'x-decorator': 'FormItem',
21
21
  'x-component': 'Checkbox',
22
22
  'x-component-props': {
23
23
  disabled: true
24
24
  }
25
25
  },
26
- params: {
26
+ 'config.params': {
27
27
  type: 'object',
28
- name: 'params',
28
+ name: 'config.params',
29
29
  title: '',
30
30
  'x-decorator': 'FormItem',
31
31
  properties: {
@@ -7,10 +7,10 @@ export default {
7
7
  type: 'update',
8
8
  group: 'model',
9
9
  fieldset: {
10
- collection,
11
- params: {
10
+ 'config.collection': collection,
11
+ 'config.params': {
12
12
  type: 'object',
13
- name: 'params',
13
+ name: 'config.params',
14
14
  title: '',
15
15
  'x-decorator': 'FormItem',
16
16
  properties: {
@@ -6,7 +6,7 @@ import { useCollectionFilterOptions } from "../../collection-manager/action-hook
6
6
  export const collection = {
7
7
  type: 'string',
8
8
  title: '数据表',
9
- name: 'collection',
9
+ name: 'config.collection',
10
10
  required: true,
11
11
  'x-reactions': ['{{useCollectionDataSource()}}'],
12
12
  'x-decorator': 'FormItem',
@@ -16,7 +16,7 @@ export const collection = {
16
16
  export const values = {
17
17
  type: 'object',
18
18
  title: '数据内容',
19
- name: 'values',
19
+ name: 'config.params.values',
20
20
  'x-decorator': 'FormItem',
21
21
  'x-decorator-props': {
22
22
  labelAlign: 'left',
@@ -29,7 +29,11 @@ export const values = {
29
29
  useProps() {
30
30
  const { getCollectionFields } = useCollectionManager();
31
31
  const { values: form } = useForm();
32
- const fields = getCollectionFields(form.collection);
32
+ const fields = getCollectionFields(form?.config?.collection)
33
+ .filter(field => (
34
+ !field.hidden
35
+ && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false)
36
+ ));
33
37
  return { fields };
34
38
  }
35
39
  }
@@ -38,7 +42,7 @@ export const values = {
38
42
  export const filter = {
39
43
  type: 'object',
40
44
  title: '筛选条件',
41
- name: 'filter',
45
+ name: 'config.params.filter',
42
46
  'x-decorator': 'FormItem',
43
47
  'x-decorator-props': {
44
48
  labelAlign: 'left',
@@ -50,14 +54,12 @@ export const filter = {
50
54
  'x-component-props': {
51
55
  useProps() {
52
56
  const { values } = useForm();
53
- const options = useCollectionFilterOptions(values.collection);
57
+ const options = useCollectionFilterOptions(values.config?.collection);
54
58
  return {
55
59
  options,
56
60
  className: css`
57
61
  position: relative;
58
62
  width: 100%;
59
- padding: .5em 1em;
60
- border: 1px dashed #ddd;
61
63
  `
62
64
  };
63
65
  },
@@ -15,16 +15,6 @@ const collection = {
15
15
  required: true,
16
16
  } as ISchema,
17
17
  },
18
- // {
19
- // type: 'string',
20
- // name: 'description',
21
- // interface: 'textarea',
22
- // uiSchema: {
23
- // title: '描述',
24
- // type: 'string',
25
- // 'x-component': 'TextArea',
26
- // } as ISchema,
27
- // },
28
18
  {
29
19
  type: 'string',
30
20
  name: 'type',
@@ -37,6 +27,17 @@ const collection = {
37
27
  enum: [
38
28
  { value: 'model', label: '数据变动' }
39
29
  ],
30
+ required: true,
31
+ } as ISchema,
32
+ },
33
+ {
34
+ type: 'string',
35
+ name: 'description',
36
+ interface: 'textarea',
37
+ uiSchema: {
38
+ title: '描述',
39
+ type: 'string',
40
+ 'x-component': 'Input.TextArea',
40
41
  } as ISchema,
41
42
  },
42
43
  {
@@ -95,6 +96,13 @@ export const workflowSchema: ISchema = {
95
96
  type: 'void',
96
97
  title: '删除',
97
98
  'x-component': 'Action',
99
+ 'x-component-props': {
100
+ useAction: '{{ cm.useBulkDestroyAction }}',
101
+ confirm: {
102
+ title: "{{t('Delete record')}}",
103
+ content: "{{t('Are you sure you want to delete it?')}}",
104
+ },
105
+ },
98
106
  },
99
107
  create: {
100
108
  type: 'void',
@@ -114,11 +122,11 @@ export const workflowSchema: ISchema = {
114
122
  'x-component': 'CollectionField',
115
123
  'x-decorator': 'FormItem',
116
124
  },
117
- description: {
125
+ type: {
118
126
  'x-component': 'CollectionField',
119
127
  'x-decorator': 'FormItem',
120
128
  },
121
- type: {
129
+ description: {
122
130
  'x-component': 'CollectionField',
123
131
  'x-decorator': 'FormItem',
124
132
  },
@@ -3,7 +3,7 @@ import { ISchema, useForm } from "@formily/react";
3
3
  import { cx } from "@emotion/css";
4
4
  import { Registry } from "@nocobase/utils";
5
5
 
6
- import { SchemaComponent, useActionContext, useAPIClient, useRecord, useResourceActionContext } from '../../';
6
+ import { SchemaComponent, useActionContext, useAPIClient, useRecord, useRequest, useResourceActionContext } from '../../';
7
7
  import model from './model';
8
8
  import { nodeCardClass } from "../style";
9
9
 
@@ -16,14 +16,10 @@ function useUpdateConfigAction() {
16
16
  const { refresh } = useResourceActionContext();
17
17
  return {
18
18
  async run() {
19
+ await form.submit();
19
20
  await api.resource('workflows', record.id).update({
20
21
  filterByTk: record.id,
21
- values: {
22
- config: {
23
- ...record.config,
24
- ...form.values
25
- }
26
- },
22
+ values: form.values
27
23
  });
28
24
  ctx.setVisible(false);
29
25
  refresh();
@@ -71,10 +67,16 @@ export const TriggerConfig = () => {
71
67
  'x-component': 'Action.Drawer',
72
68
  'x-decorator': 'Form',
73
69
  'x-decorator-props': {
74
- initialValue: config
70
+ initialValue: { config }
75
71
  },
76
72
  properties: {
77
- ...fieldset,
73
+ config: {
74
+ type: 'void',
75
+ name: 'config',
76
+ 'x-component': 'fieldset',
77
+ 'x-component-props': {},
78
+ properties: fieldset
79
+ },
78
80
  actions: {
79
81
  type: 'void',
80
82
  'x-component': 'Action.Drawer.Footer',