@nocobase/client 0.7.0-alpha.25 → 0.7.0-alpha.26

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 (92) hide show
  1. package/esm/locale/index.d.ts +48 -0
  2. package/esm/locale/zh_CN.d.ts +48 -0
  3. package/esm/locale/zh_CN.js +51 -2
  4. package/esm/locale/zh_CN.js.map +1 -1
  5. package/esm/workflow/WorkflowCanvas.js +11 -8
  6. package/esm/workflow/WorkflowCanvas.js.map +1 -1
  7. package/esm/workflow/WorkflowLink.js +3 -1
  8. package/esm/workflow/WorkflowLink.js.map +1 -1
  9. package/esm/workflow/WorkflowPage.js +3 -3
  10. package/esm/workflow/WorkflowPage.js.map +1 -1
  11. package/esm/workflow/WorkflowShortcut.js +4 -2
  12. package/esm/workflow/WorkflowShortcut.js.map +1 -1
  13. package/esm/workflow/calculators.js +26 -22
  14. package/esm/workflow/calculators.js.map +1 -1
  15. package/esm/workflow/nodes/calculation.js +5 -3
  16. package/esm/workflow/nodes/calculation.js.map +1 -1
  17. package/esm/workflow/nodes/create.js +5 -3
  18. package/esm/workflow/nodes/create.js.map +1 -1
  19. package/esm/workflow/nodes/destroy.js +2 -2
  20. package/esm/workflow/nodes/destroy.js.map +1 -1
  21. package/esm/workflow/nodes/index.js +11 -8
  22. package/esm/workflow/nodes/index.js.map +1 -1
  23. package/esm/workflow/nodes/query.js +5 -3
  24. package/esm/workflow/nodes/query.js.map +1 -1
  25. package/esm/workflow/nodes/update.js +2 -2
  26. package/esm/workflow/nodes/update.js.map +1 -1
  27. package/esm/workflow/schemas/collection.js +3 -3
  28. package/esm/workflow/schemas/collection.js.map +1 -1
  29. package/esm/workflow/schemas/executions.d.ts +4 -25
  30. package/esm/workflow/schemas/executions.js +38 -34
  31. package/esm/workflow/schemas/executions.js.map +1 -1
  32. package/esm/workflow/schemas/workflows.js +51 -30
  33. package/esm/workflow/schemas/workflows.js.map +1 -1
  34. package/esm/workflow/triggers/index.js +6 -5
  35. package/esm/workflow/triggers/index.js.map +1 -1
  36. package/esm/workflow/triggers/model.js +12 -10
  37. package/esm/workflow/triggers/model.js.map +1 -1
  38. package/lib/locale/index.d.ts +48 -0
  39. package/lib/locale/zh_CN.d.ts +48 -0
  40. package/lib/locale/zh_CN.js +51 -2
  41. package/lib/locale/zh_CN.js.map +1 -1
  42. package/lib/workflow/WorkflowCanvas.js +10 -7
  43. package/lib/workflow/WorkflowCanvas.js.map +1 -1
  44. package/lib/workflow/WorkflowLink.js +3 -1
  45. package/lib/workflow/WorkflowLink.js.map +1 -1
  46. package/lib/workflow/WorkflowPage.js +3 -3
  47. package/lib/workflow/WorkflowPage.js.map +1 -1
  48. package/lib/workflow/WorkflowShortcut.js +4 -2
  49. package/lib/workflow/WorkflowShortcut.js.map +1 -1
  50. package/lib/workflow/calculators.js +26 -22
  51. package/lib/workflow/calculators.js.map +1 -1
  52. package/lib/workflow/nodes/calculation.js +5 -3
  53. package/lib/workflow/nodes/calculation.js.map +1 -1
  54. package/lib/workflow/nodes/create.js +5 -3
  55. package/lib/workflow/nodes/create.js.map +1 -1
  56. package/lib/workflow/nodes/destroy.js +2 -2
  57. package/lib/workflow/nodes/destroy.js.map +1 -1
  58. package/lib/workflow/nodes/index.js +10 -7
  59. package/lib/workflow/nodes/index.js.map +1 -1
  60. package/lib/workflow/nodes/query.js +5 -3
  61. package/lib/workflow/nodes/query.js.map +1 -1
  62. package/lib/workflow/nodes/update.js +2 -2
  63. package/lib/workflow/nodes/update.js.map +1 -1
  64. package/lib/workflow/schemas/collection.js +3 -3
  65. package/lib/workflow/schemas/collection.js.map +1 -1
  66. package/lib/workflow/schemas/executions.d.ts +4 -25
  67. package/lib/workflow/schemas/executions.js +38 -34
  68. package/lib/workflow/schemas/executions.js.map +1 -1
  69. package/lib/workflow/schemas/workflows.js +51 -30
  70. package/lib/workflow/schemas/workflows.js.map +1 -1
  71. package/lib/workflow/triggers/index.js +5 -4
  72. package/lib/workflow/triggers/index.js.map +1 -1
  73. package/lib/workflow/triggers/model.js +12 -10
  74. package/lib/workflow/triggers/model.js.map +1 -1
  75. package/package.json +3 -3
  76. package/src/locale/zh_CN.ts +63 -2
  77. package/src/workflow/WorkflowCanvas.tsx +13 -8
  78. package/src/workflow/WorkflowLink.tsx +3 -1
  79. package/src/workflow/WorkflowPage.tsx +3 -3
  80. package/src/workflow/WorkflowShortcut.tsx +4 -2
  81. package/src/workflow/calculators.tsx +27 -23
  82. package/src/workflow/nodes/calculation.tsx +5 -3
  83. package/src/workflow/nodes/create.tsx +5 -3
  84. package/src/workflow/nodes/destroy.tsx +2 -2
  85. package/src/workflow/nodes/index.tsx +11 -8
  86. package/src/workflow/nodes/query.tsx +5 -3
  87. package/src/workflow/nodes/update.tsx +2 -2
  88. package/src/workflow/schemas/collection.ts +3 -3
  89. package/src/workflow/schemas/executions.ts +38 -34
  90. package/src/workflow/schemas/workflows.ts +31 -30
  91. package/src/workflow/triggers/index.tsx +6 -5
  92. package/src/workflow/triggers/model.tsx +12 -10
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/workflow/nodes/query.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,eAAe;IACb,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;QAC/B,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAA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AAC,gBACE,UAAU,CAAC,MAAM;iBACf,MAAM,CAAC,UAAA,KAAK,YAAI,OAAA,WAAW,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAA,EAAA,CAAC;iBACtD,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CACd,KAAC,MAAM,CAAC,MAAM,aAAkB,KAAK,EAAE,KAAK,CAAC,IAAI,gBAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAA7D,KAAK,CAAC,IAAI,CAAoE,CACnG,EAFe,CAEf,CAAC,YACK,CACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import React from 'react';\nimport { Select } from 'antd';\n\nimport { useCollectionDataSource, useCollectionManager, useCompile } from '../..';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet, VariableComponent } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\n\nexport default {\n title: '查询数据',\n type: 'query',\n group: 'model',\n fieldset: {\n 'config.collection': collection,\n 'config.multiple': {\n type: 'boolean',\n title: '多条数据',\n name: 'config.multiple',\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-component-props': {\n disabled: true\n }\n },\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent\n },\n getter({ type, options, onChange }) {\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { nodes } = useFlowContext();\n const { config } = nodes.find(n => n.id == options.nodeId);\n const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };\n\n return (\n <Select value={options.path} placeholder=\"选择字段\" onChange={path => {\n onChange({ type, options: { ...options, path } });\n }}>\n {collection.fields\n .filter(field => BaseTypeSet.has(field.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/workflow/nodes/query.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAe;IACb,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;QAC/B,iBAAiB,EAAE;YACjB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,iBAAiB;YACvB,aAAa,EAAE,UAAU;YACzB,aAAa,EAAE,UAAU;YACzB,mBAAmB,EAAE;gBACnB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,QAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,yBAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,mBAAA;KAClB;IACD,MAAM,YAAC,EAA2B;;YAAzB,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA;QACtB,IAAA,CAAC,GAAK,cAAc,EAAE,EAArB,CAAsB;QAC/B,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;QACrB,IAAA,KAAqB,oBAAoB,EAAE,YAA3B,EAAhB,WAAW,mBAAG,EAAE,KAAA,CAA4B;QAC5C,IAAA,KAAK,GAAK,cAAc,EAAE,MAArB,CAAsB;QAC3B,IAAA,MAAM,GAAK,KAAK,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,IAAI,OAAO,CAAC,MAAM,EAAtB,CAAsB,CAAC,OAA5C,CAA6C;QAC3D,IAAM,UAAU,GAAG,MAAA,WAAW,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,UAAU,EAA/B,CAA+B,CAAC,mCAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAE/F,OAAO,CACL,KAAC,MAAM,aAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,UAAA,IAAI;gBACnE,QAAQ,CAAC,EAAE,IAAI,MAAA,EAAE,OAAO,wBAAO,OAAO,KAAE,IAAI,MAAA,GAAE,EAAE,CAAC,CAAC;YACpD,CAAC,gBACE,UAAU,CAAC,MAAM;iBACf,MAAM,CAAC,UAAA,KAAK,YAAI,OAAA,WAAW,CAAC,GAAG,CAAC,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAA,EAAA,CAAC;iBACtD,GAAG,CAAC,UAAA,KAAK,IAAI,OAAA,CACd,KAAC,MAAM,CAAC,MAAM,aAAkB,KAAK,EAAE,KAAK,CAAC,IAAI,gBAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAA7D,KAAK,CAAC,IAAI,CAAoE,CACnG,EAFe,CAEf,CAAC,YACK,CACV,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import React from 'react';\nimport { Select } from 'antd';\n\nimport { useCollectionDataSource, useCollectionManager, useCompile } from '../..';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet, VariableComponent } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\nimport { useTranslation } from 'react-i18next';\n\nexport default {\n title: '{{t(\"Query record\")}}',\n type: 'query',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.multiple': {\n type: 'boolean',\n title: '多条数据',\n name: 'config.multiple',\n 'x-decorator': 'FormItem',\n 'x-component': 'Checkbox',\n 'x-component-props': {\n disabled: true\n }\n },\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent\n },\n getter({ type, options, onChange }) {\n const { t } = useTranslation();\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { nodes } = useFlowContext();\n const { config } = nodes.find(n => n.id == options.nodeId);\n const collection = collections.find(item => item.name === config.collection) ?? { fields: [] };\n\n return (\n <Select value={options.path} placeholder={t('Fields')} onChange={path => {\n onChange({ type, options: { ...options, path } });\n }}>\n {collection.fields\n .filter(field => BaseTypeSet.has(field.uiSchema?.type))\n .map(field => (\n <Select.Option key={field.name} value={field.name}>{compile(field.uiSchema.title)}</Select.Option>\n ))}\n </Select>\n );\n }\n};\n"]}
@@ -2,9 +2,9 @@ import { useCollectionDataSource } from '../..';
2
2
  import { CollectionFieldset, VariableComponent } from '../calculators';
3
3
  import { collection, filter, values } from '../schemas/collection';
4
4
  export default {
5
- title: '更新数据',
5
+ title: '{{t("Update record")}}',
6
6
  type: 'update',
7
- group: 'model',
7
+ group: 'collection',
8
8
  fieldset: {
9
9
  'config.collection': collection,
10
10
  'config.params': {
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;QAC/B,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,QAAA;gBACN,MAAM,QAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,yBAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,mBAAA;QACjB,kBAAkB,oBAAA;KACnB;CACF,CAAC","sourcesContent":["import { useCollectionDataSource } from '../..';\nimport { CollectionFieldset, VariableComponent } from '../calculators';\nimport { collection, filter, values } from '../schemas/collection';\n\nexport default {\n title: '更新数据',\n type: 'update',\n group: 'model',\n fieldset: {\n 'config.collection': collection,\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter,\n values\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent,\n CollectionFieldset\n }\n};\n"]}
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/workflow/nodes/update.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE;QACR,mBAAmB,EAAE,UAAU;QAC/B,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,UAAU;YACzB,UAAU,EAAE;gBACV,MAAM,QAAA;gBACN,MAAM,QAAA;aACP;SACF;KACF;IACD,IAAI,EAAE,EAEL;IACD,KAAK,EAAE;QACL,uBAAuB,yBAAA;KACxB;IACD,UAAU,EAAE;QACV,iBAAiB,mBAAA;QACjB,kBAAkB,oBAAA;KACnB;CACF,CAAC","sourcesContent":["import { useCollectionDataSource } from '../..';\nimport { CollectionFieldset, VariableComponent } from '../calculators';\nimport { collection, filter, values } from '../schemas/collection';\n\nexport default {\n title: '{{t(\"Update record\")}}',\n type: 'update',\n group: 'collection',\n fieldset: {\n 'config.collection': collection,\n 'config.params': {\n type: 'object',\n name: 'config.params',\n title: '',\n 'x-decorator': 'FormItem',\n properties: {\n filter,\n values\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n VariableComponent,\n CollectionFieldset\n }\n};\n"]}
@@ -7,7 +7,7 @@ import { useForm } from "@formily/react";
7
7
  import { useCollectionFilterOptions } from "../../collection-manager/action-hooks";
8
8
  export var collection = {
9
9
  type: 'string',
10
- title: '数据表',
10
+ title: '{{t("Collection")}}',
11
11
  name: 'config.collection',
12
12
  required: true,
13
13
  'x-reactions': ['{{useCollectionDataSource()}}'],
@@ -16,7 +16,7 @@ export var collection = {
16
16
  };
17
17
  export var values = {
18
18
  type: 'object',
19
- title: '数据内容',
19
+ title: '{{t("Form values")}}',
20
20
  name: 'config.params.values',
21
21
  'x-decorator': 'FormItem',
22
22
  'x-decorator-props': {
@@ -27,7 +27,7 @@ export var values = {
27
27
  };
28
28
  export var filter = {
29
29
  type: 'object',
30
- title: '筛选条件',
30
+ title: '{{t("Filter")}}',
31
31
  name: 'config.params.filter',
32
32
  'x-decorator': 'FormItem',
33
33
  'x-decorator-props': {
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,MAAM,CAAC,IAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,CAAC,+BAA+B,CAAC;IAChD,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,QAAQ;CACxB,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,oBAAoB;CACpC,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,QAAQ;IACvB,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,MAAM,GAAK,OAAO,EAAE,OAAd,CAAe;YAC7B,IAAM,OAAO,GAAG,0BAA0B,CAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,SAAA;gBACP,SAAS,EAAE,GAAG,sIAAA,mEAGb,IAAA;aACF,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,mBAAmB;KACtC;CACF,CAAC","sourcesContent":["import { css } from \"@emotion/css\";\nimport { useForm } from \"@formily/react\";\nimport { useCollectionManager } from \"../../collection-manager\";\nimport { useCollectionFilterOptions } from \"../../collection-manager/action-hooks\";\n\nexport const collection = {\n type: 'string',\n title: '数据表',\n name: 'config.collection',\n required: true,\n 'x-reactions': ['{{useCollectionDataSource()}}'],\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n};\n\nexport const values = {\n type: 'object',\n title: '数据内容',\n name: 'config.params.values',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'CollectionFieldset'\n};\n\nexport const filter = {\n type: 'object',\n title: '筛选条件',\n name: 'config.params.filter',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'Filter',\n 'x-component-props': {\n useProps() {\n const { values } = useForm();\n const options = useCollectionFilterOptions(values.config?.collection);\n return {\n options,\n className: css`\n position: relative;\n width: 100%;\n `\n };\n },\n dynamicComponent: 'VariableComponent'\n }\n};\n"]}
1
+ {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/workflow/schemas/collection.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,MAAM,CAAC,IAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,IAAI;IACd,aAAa,EAAE,CAAC,+BAA+B,CAAC;IAChD,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,QAAQ;CACxB,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,sBAAsB;IAC7B,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,oBAAoB;CACpC,CAAC;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,sBAAsB;IAC5B,aAAa,EAAE,UAAU;IACzB,mBAAmB,EAAE;QACnB,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,GAAG,0GAAA,uCAEb,IAAA;KACF;IACD,aAAa,EAAE,QAAQ;IACvB,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,MAAM,GAAK,OAAO,EAAE,OAAd,CAAe;YAC7B,IAAM,OAAO,GAAG,0BAA0B,CAAC,MAAA,MAAM,CAAC,MAAM,0CAAE,UAAU,CAAC,CAAC;YACtE,OAAO;gBACL,OAAO,SAAA;gBACP,SAAS,EAAE,GAAG,sIAAA,mEAGb,IAAA;aACF,CAAC;QACJ,CAAC;QACD,gBAAgB,EAAE,mBAAmB;KACtC;CACF,CAAC","sourcesContent":["import { css } from \"@emotion/css\";\nimport { useForm } from \"@formily/react\";\nimport { useCollectionManager } from \"../../collection-manager\";\nimport { useCollectionFilterOptions } from \"../../collection-manager/action-hooks\";\n\nexport const collection = {\n type: 'string',\n title: '{{t(\"Collection\")}}',\n name: 'config.collection',\n required: true,\n 'x-reactions': ['{{useCollectionDataSource()}}'],\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n};\n\nexport const values = {\n type: 'object',\n title: '{{t(\"Form values\")}}',\n name: 'config.params.values',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'CollectionFieldset'\n};\n\nexport const filter = {\n type: 'object',\n title: '{{t(\"Filter\")}}',\n name: 'config.params.filter',\n 'x-decorator': 'FormItem',\n 'x-decorator-props': {\n labelAlign: 'left',\n className: css`\n flex-direction: column;\n `\n },\n 'x-component': 'Filter',\n 'x-component-props': {\n useProps() {\n const { values } = useForm();\n const options = useCollectionFilterOptions(values.config?.collection);\n return {\n options,\n className: css`\n position: relative;\n width: 100%;\n `\n };\n },\n dynamicComponent: 'VariableComponent'\n }\n};\n"]}
@@ -6,9 +6,9 @@ export declare const executionSchema: {
6
6
  collection: {
7
7
  name: string;
8
8
  fields: {
9
+ interface: string;
9
10
  type: string;
10
11
  name: string;
11
- interface: string;
12
12
  uiSchema: import("@formily/react").Stringify<{
13
13
  [key: symbol]: any;
14
14
  [key: `x-${string}`]: any;
@@ -82,9 +82,9 @@ export declare const executionSchema: {
82
82
  collection: {
83
83
  name: string;
84
84
  fields: {
85
+ interface: string;
85
86
  type: string;
86
87
  name: string;
87
- interface: string;
88
88
  uiSchema: import("@formily/react").Stringify<{
89
89
  [key: symbol]: any;
90
90
  [key: `x-${string}`]: any;
@@ -163,12 +163,12 @@ export declare const executionSchema: {
163
163
  useDataSource: string;
164
164
  };
165
165
  properties: {
166
- workflow: {
166
+ createdAt: {
167
167
  type: string;
168
168
  'x-decorator': string;
169
169
  'x-component': string;
170
170
  properties: {
171
- workflow: {
171
+ createdAt: {
172
172
  type: string;
173
173
  'x-component': string;
174
174
  'x-read-pretty': boolean;
@@ -187,27 +187,6 @@ export declare const executionSchema: {
187
187
  };
188
188
  };
189
189
  };
190
- actions: {
191
- type: string;
192
- title: string;
193
- 'x-component': string;
194
- properties: {
195
- actions: {
196
- type: string;
197
- 'x-component': string;
198
- 'x-component-props': {
199
- split: string;
200
- };
201
- properties: {
202
- config: {
203
- type: string;
204
- title: string;
205
- 'x-component': string;
206
- };
207
- };
208
- };
209
- };
210
- };
211
190
  };
212
191
  };
213
192
  };
@@ -2,12 +2,16 @@ var collection = {
2
2
  name: 'executions',
3
3
  fields: [
4
4
  {
5
- type: 'number',
6
- name: 'workflow',
7
- interface: 'linkTo',
5
+ interface: 'createdAt',
6
+ type: 'datetime',
7
+ // field: 'createdAt',
8
+ name: 'createdAt',
8
9
  uiSchema: {
9
- title: '所属工作流',
10
- type: 'string',
10
+ type: 'datetime',
11
+ title: '{{t("Created at")}}',
12
+ 'x-component': 'DatePicker',
13
+ 'x-component-props': {},
14
+ 'x-read-pretty': true,
11
15
  },
12
16
  },
13
17
  {
@@ -15,15 +19,15 @@ var collection = {
15
19
  name: 'status',
16
20
  interface: 'select',
17
21
  uiSchema: {
18
- title: '执行状态',
22
+ title: '{{t("Status")}}',
19
23
  type: 'string',
20
24
  'x-component': 'Select',
21
25
  'x-decorator': 'FormItem',
22
26
  enum: [
23
- { value: 0, label: '进行中' },
24
- { value: 1, label: '已完成' },
25
- { value: -1, label: '已失败' },
26
- { value: -2, label: '已取消' },
27
+ { value: 0, label: '{{t("On going")}}' },
28
+ { value: 1, label: '{{t("Success")}}' },
29
+ { value: -1, label: '{{t("Failed")}}' },
30
+ { value: -2, label: '{{t("Canceled")}}' },
27
31
  ],
28
32
  },
29
33
  }
@@ -73,13 +77,13 @@ export var executionSchema = {
73
77
  useDataSource: '{{ cm.useDataSourceFromRAC }}',
74
78
  },
75
79
  properties: {
76
- workflow: {
80
+ createdAt: {
77
81
  type: 'void',
78
82
  'x-decorator': 'Table.Column.Decorator',
79
83
  'x-component': 'Table.Column',
80
84
  properties: {
81
- workflow: {
82
- type: 'string',
85
+ createdAt: {
86
+ type: 'datetime',
83
87
  'x-component': 'CollectionField',
84
88
  'x-read-pretty': true,
85
89
  },
@@ -97,27 +101,27 @@ export var executionSchema = {
97
101
  },
98
102
  }
99
103
  },
100
- actions: {
101
- type: 'void',
102
- title: '{{ t("Actions") }}',
103
- 'x-component': 'Table.Column',
104
- properties: {
105
- actions: {
106
- type: 'void',
107
- 'x-component': 'Space',
108
- 'x-component-props': {
109
- split: '|',
110
- },
111
- properties: {
112
- config: {
113
- type: 'void',
114
- title: '查看',
115
- 'x-component': 'ExecutionLink'
116
- },
117
- }
118
- }
119
- }
120
- }
104
+ // actions: {
105
+ // type: 'void',
106
+ // title: '{{ t("Actions") }}',
107
+ // 'x-component': 'Table.Column',
108
+ // properties: {
109
+ // actions: {
110
+ // type: 'void',
111
+ // 'x-component': 'Space',
112
+ // 'x-component-props': {
113
+ // split: '|',
114
+ // },
115
+ // properties: {
116
+ // config: {
117
+ // type: 'void',
118
+ // title: '查看',
119
+ // 'x-component': 'ExecutionLink'
120
+ // },
121
+ // }
122
+ // }
123
+ // }
124
+ // }
121
125
  }
122
126
  }
123
127
  }
@@ -1 +1 @@
1
- {"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/workflow/schemas/executions.ts"],"names":[],"mappings":"AAEA,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,OAAO;gBACd,IAAI,EAAE,QAAQ;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EAAE;oBACJ,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC1B,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC1B,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC3B,EAAE,KAAK,EAA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7B,UAAU,EAAE;4BACV,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,aAAa,EAAE,iBAAiB;gCAChC,eAAe,EAAE,IAAI;6BACtB;yBACF;qBACF;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,oBAAoB;wBAC3B,aAAa,EAAE,cAAc;wBAC7B,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,MAAM;gCACZ,aAAa,EAAE,OAAO;gCACtB,mBAAmB,EAAE;oCACnB,KAAK,EAAE,GAAG;iCACX;gCACD,UAAU,EAAE;oCACV,MAAM,EAAE;wCACN,IAAI,EAAE,MAAM;wCACZ,KAAK,EAAE,IAAI;wCACX,aAAa,EAAE,eAAe;qCAC/B;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\n\nconst collection = {\n name: 'executions',\n fields: [\n {\n type: 'number',\n name: 'workflow',\n interface: 'linkTo',\n uiSchema: {\n title: '所属工作流',\n type: 'string',\n } as ISchema,\n },\n {\n type: 'number',\n name: 'status',\n interface: 'select',\n uiSchema: {\n title: '执行状态',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: [\n { value: 0, label: '进行中' },\n { value: 1, label: '已完成' },\n { value: -1, label: '已失败' },\n { value: -2, label: '已取消' },\n ],\n } as ISchema,\n }\n ],\n};\n\nexport const executionSchema = {\n provider: {\n type: 'void',\n 'x-decorator': 'ExecutionResourceProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'executions',\n request: {\n resource: 'executions',\n action: 'list',\n params: {\n pageSize: 50,\n sort: ['-createdAt'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n // filter: {\n // type: 'object',\n // 'x-component': 'Filter',\n // }\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n workflow: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n workflow: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n status: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n status: {\n type: 'number',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n title: '查看',\n 'x-component': 'ExecutionLink'\n },\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
1
+ {"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/workflow/schemas/executions.ts"],"names":[],"mappings":"AAEA,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE;QACN;YACE,SAAS,EAAE,WAAW;YACtB,IAAI,EAAE,UAAU;YAChB,sBAAsB;YACtB,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,qBAAqB;gBAC5B,aAAa,EAAE,YAAY;gBAC3B,mBAAmB,EAAE,EAAE;gBACvB,eAAe,EAAE,IAAI;aACX;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE,UAAU;gBACzB,IAAI,EA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AU,EAAE;4BACV,SAAS,EAAE;gCACT,IAAI,EAAE,UAAU;gCAChB,aAAa,EAAE,iBAAiB;gCAChC,eAAe,EAAE,IAAI;6BACtB;yBACF;qBACF;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,MAAM;wBACZ,aAAa,EAAE,wBAAwB;wBACvC,aAAa,EAAE,cAAc;wBAC7B,UAAU,EAAE;4BACV,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,aAAa,EAAE,iBAAiB;gCAChC,eAAe,EAAE,IAAI;6BACtB;yBACF;qBACF;oBACD,aAAa;oBACb,kBAAkB;oBAClB,iCAAiC;oBACjC,mCAAmC;oBACnC,kBAAkB;oBAClB,iBAAiB;oBACjB,sBAAsB;oBACtB,gCAAgC;oBAChC,+BAA+B;oBAC/B,sBAAsB;oBACtB,WAAW;oBACX,sBAAsB;oBACtB,oBAAoB;oBACpB,0BAA0B;oBAC1B,yBAAyB;oBACzB,2CAA2C;oBAC3C,aAAa;oBACb,UAAU;oBACV,QAAQ;oBACR,MAAM;oBACN,IAAI;iBACL;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\n\nconst collection = {\n name: 'executions',\n fields: [\n {\n interface: 'createdAt',\n type: 'datetime',\n // field: 'createdAt',\n name: 'createdAt',\n uiSchema: {\n type: 'datetime',\n title: '{{t(\"Created at\")}}',\n 'x-component': 'DatePicker',\n 'x-component-props': {},\n 'x-read-pretty': true,\n } as ISchema,\n },\n {\n type: 'number',\n name: 'status',\n interface: 'select',\n uiSchema: {\n title: '{{t(\"Status\")}}',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: [\n { value: 0, label: '{{t(\"On going\")}}' },\n { value: 1, label: '{{t(\"Success\")}}' },\n { value: -1, label: '{{t(\"Failed\")}}' },\n { value: -2, label: '{{t(\"Canceled\")}}' },\n ],\n } as ISchema,\n }\n ],\n};\n\nexport const executionSchema = {\n provider: {\n type: 'void',\n 'x-decorator': 'ExecutionResourceProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'executions',\n request: {\n resource: 'executions',\n action: 'list',\n params: {\n pageSize: 50,\n sort: ['-createdAt'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n // filter: {\n // type: 'object',\n // 'x-component': 'Filter',\n // }\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n createdAt: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n createdAt: {\n type: 'datetime',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n status: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n status: {\n type: 'number',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n // actions: {\n // type: 'void',\n // title: '{{ t(\"Actions\") }}',\n // 'x-component': 'Table.Column',\n // properties: {\n // actions: {\n // type: 'void',\n // 'x-component': 'Space',\n // 'x-component-props': {\n // split: '|',\n // },\n // properties: {\n // config: {\n // type: 'void',\n // title: '查看',\n // 'x-component': 'ExecutionLink'\n // },\n // }\n // }\n // }\n // }\n }\n }\n }\n }\n};\n"]}
@@ -1,3 +1,21 @@
1
+ var __read = (this && this.__read) || function (o, n) {
2
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3
+ if (!m) return o;
4
+ var i = m.call(o), r, ar = [], e;
5
+ try {
6
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
+ }
8
+ catch (error) { e = { error: error }; }
9
+ finally {
10
+ try {
11
+ if (r && !r.done && (m = i["return"])) m.call(i);
12
+ }
13
+ finally { if (e) throw e.error; }
14
+ }
15
+ return ar;
16
+ };
17
+ import { triggers } from '../triggers';
18
+ import { executionSchema } from './executions';
1
19
  var collection = {
2
20
  name: 'workflows',
3
21
  fields: [
@@ -6,7 +24,7 @@ var collection = {
6
24
  name: 'title',
7
25
  interface: 'input',
8
26
  uiSchema: {
9
- title: '流程名称',
27
+ title: '{{t("Name")}}',
10
28
  type: 'string',
11
29
  'x-component': 'Input',
12
30
  required: true,
@@ -17,13 +35,17 @@ var collection = {
17
35
  name: 'type',
18
36
  interface: 'select',
19
37
  uiSchema: {
20
- title: '触发方式',
38
+ title: '{{t("Trigger type")}}',
21
39
  type: 'string',
22
40
  'x-component': 'Select',
23
41
  'x-decorator': 'FormItem',
24
- enum: [
25
- { value: 'model', label: '数据变动' }
26
- ],
42
+ enum: Array.from(triggers.getEntities()).map(function (_a) {
43
+ var _b = __read(_a, 2), value = _b[0], title = _b[1].title;
44
+ return ({
45
+ value: value,
46
+ label: title,
47
+ });
48
+ }),
27
49
  required: true,
28
50
  },
29
51
  },
@@ -32,7 +54,7 @@ var collection = {
32
54
  name: 'description',
33
55
  interface: 'textarea',
34
56
  uiSchema: {
35
- title: '描述',
57
+ title: '{{t("Description")}}',
36
58
  type: 'string',
37
59
  'x-component': 'Input.TextArea',
38
60
  },
@@ -42,11 +64,11 @@ var collection = {
42
64
  name: 'enabled',
43
65
  interface: 'radio',
44
66
  uiSchema: {
45
- title: '状态',
67
+ title: '{{t("Status")}}',
46
68
  type: 'string',
47
69
  enum: [
48
- { label: '启用', value: true },
49
- { label: '禁用', value: false },
70
+ { label: '{{t("Enabled")}}', value: true },
71
+ { label: '{{t("Disabled")}}', value: false },
50
72
  ],
51
73
  'x-component': 'Radio.Group',
52
74
  'x-decorator': 'FormItem',
@@ -90,7 +112,7 @@ export var workflowSchema = {
90
112
  properties: {
91
113
  delete: {
92
114
  type: 'void',
93
- title: '删除',
115
+ title: '{{t("Delete")}}',
94
116
  'x-component': 'Action',
95
117
  'x-component-props': {
96
118
  useAction: '{{ cm.useBulkDestroyAction }}',
@@ -102,7 +124,7 @@ export var workflowSchema = {
102
124
  },
103
125
  create: {
104
126
  type: 'void',
105
- title: '添加工作流',
127
+ title: '{{t("Add new")}}',
106
128
  'x-component': 'Action',
107
129
  'x-component-props': {
108
130
  type: 'primary',
@@ -112,7 +134,7 @@ export var workflowSchema = {
112
134
  type: 'void',
113
135
  'x-component': 'Action.Drawer',
114
136
  'x-decorator': 'Form',
115
- title: '添加工作流',
137
+ title: '{{t("Add new")}}',
116
138
  properties: {
117
139
  title: {
118
140
  'x-component': 'CollectionField',
@@ -215,25 +237,24 @@ export var workflowSchema = {
215
237
  properties: {
216
238
  config: {
217
239
  type: 'void',
218
- title: '配置流程',
219
240
  'x-component': 'WorkflowLink'
220
241
  },
221
- // executions: {
222
- // type: 'void',
223
- // title: '执行历史',
224
- // 'x-component': 'Action.Link',
225
- // 'x-component-props': {
226
- // type: 'primary',
227
- // },
228
- // properties: {
229
- // drawer: {
230
- // type: 'void',
231
- // title: '执行历史',
232
- // 'x-component': 'Action.Drawer',
233
- // properties: executionSchema
234
- // }
235
- // }
236
- // },
242
+ executions: {
243
+ type: 'void',
244
+ title: '{{t("Executions")}}',
245
+ 'x-component': 'Action.Link',
246
+ 'x-component-props': {
247
+ type: 'primary',
248
+ },
249
+ properties: {
250
+ drawer: {
251
+ type: 'void',
252
+ title: '{{t("Executions")}}',
253
+ 'x-component': 'Action.Drawer',
254
+ properties: executionSchema
255
+ }
256
+ }
257
+ },
237
258
  update: {
238
259
  type: 'void',
239
260
  title: '{{ t("Edit") }}',
@@ -249,7 +270,7 @@ export var workflowSchema = {
249
270
  'x-decorator-props': {
250
271
  useValues: '{{ cm.useValuesFromRecord }}',
251
272
  },
252
- title: '编辑工作流',
273
+ title: '{{ t("Edit") }}',
253
274
  properties: {
254
275
  title: {
255
276
  'x-component': 'CollectionField',
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/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O;oDACd,UAAU,EAAE;wDACV,KAAK,EAAE;4DACL,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,OAAO,EAAE;4DACP,aAAa,EAAE,iBAAiB;4DAChC,aAAa,EAAE,UAAU;yDAC1B;wDACD,MAAM,EAAE;4DACN,IAAI,EAAE,MAAM;4DACZ,aAAa,EAAE,qBAAqB;4DACpC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,YAAY;wCACZ,kBAAkB;wCAClB,gCAAgC;wCAChC,kCAAkC;wCAClC,2BAA2B;wCAC3B,iBAAiB;wCACjB,yCAAyC;wCACzC,iEAAiE;wCACjE,SAAS;wCACT,0DAA0D;wCAC1D,OAAO;wCACP,KAAK;qCACN;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '流程名称',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '触发方式',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: [\n { value: 'model', label: '数据变动' }\n ],\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'description',\n interface: 'textarea',\n uiSchema: {\n title: '描述',\n type: 'string',\n 'x-component': 'Input.TextArea',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '状态',\n type: 'string',\n enum: [\n { label: '启用', value: true },\n { label: '禁用', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '删除',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete record')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '添加工作流',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '添加工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n title: '配置流程',\n 'x-component': 'WorkflowLink'\n },\n // executions: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // type: 'primary',\n // },\n // properties: {\n // drawer: {\n // type: 'void',\n // title: '执行历史',\n // 'x-component': 'Action.Drawer',\n // properties: executionSchema\n // }\n // }\n // },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '编辑工作流',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../src/workflow/schemas/workflows.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,OAAO;gBACtB,QAAQ,EAAE,IAAI;aACJ;SACb;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,QAAQ;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,QAAQ;gBACd,aAAa,EAAE,QAAQ;gBACvB,aAAa,EAAE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AE,qBAAqB;4DACpC,UAAU,EAAE;gEACV,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,SAAS,EAAE,0BAA0B;qEACtC;iEACF;gEACD,MAAM,EAAE;oEACN,KAAK,EAAE,mBAAmB;oEAC1B,aAAa,EAAE,QAAQ;oEACvB,mBAAmB,EAAE;wEACnB,IAAI,EAAE,SAAS;wEACf,SAAS,EAAE,0BAA0B;qEACtC;iEACF;6DACF;yDACF;qDACF;iDACF;6CACF;yCACF;wCACD,YAAY;wCACZ,kBAAkB;wCAClB,gCAAgC;wCAChC,kCAAkC;wCAClC,2BAA2B;wCAC3B,iBAAiB;wCACjB,yCAAyC;wCACzC,iEAAiE;wCACjE,SAAS;wCACT,0DAA0D;wCAC1D,OAAO;wCACP,KAAK;qCACN;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC","sourcesContent":["import { ISchema } from '@formily/react';\nimport { triggers } from '../triggers';\nimport { executionSchema } from './executions';\n\nconst collection = {\n name: 'workflows',\n fields: [\n {\n type: 'string',\n name: 'title',\n interface: 'input',\n uiSchema: {\n title: '{{t(\"Name\")}}',\n type: 'string',\n 'x-component': 'Input',\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'type',\n interface: 'select',\n uiSchema: {\n title: '{{t(\"Trigger type\")}}',\n type: 'string',\n 'x-component': 'Select',\n 'x-decorator': 'FormItem',\n enum: Array.from(triggers.getEntities()).map(([value, { title }]) => ({\n value,\n label: title,\n })),\n required: true,\n } as ISchema,\n },\n {\n type: 'string',\n name: 'description',\n interface: 'textarea',\n uiSchema: {\n title: '{{t(\"Description\")}}',\n type: 'string',\n 'x-component': 'Input.TextArea',\n } as ISchema,\n },\n {\n type: 'boolean',\n name: 'enabled',\n interface: 'radio',\n uiSchema: {\n title: '{{t(\"Status\")}}',\n type: 'string',\n enum: [\n { label: '{{t(\"Enabled\")}}', value: true },\n { label: '{{t(\"Disabled\")}}', value: false },\n ],\n 'x-component': 'Radio.Group',\n 'x-decorator': 'FormItem',\n } as ISchema\n }\n ],\n};\n\nexport const workflowSchema: ISchema = {\n type: 'object',\n properties: {\n provider: {\n type: 'void',\n 'x-decorator': 'ResourceActionProvider',\n 'x-decorator-props': {\n collection,\n resourceName: 'workflows',\n request: {\n resource: 'workflows',\n action: 'list',\n params: {\n pageSize: 50,\n filter: {},\n sort: ['createdAt'],\n except: ['config'],\n },\n },\n },\n 'x-component': 'CollectionProvider',\n 'x-component-props': {\n collection,\n },\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'ActionBar',\n 'x-component-props': {\n style: {\n marginBottom: 16,\n },\n },\n properties: {\n delete: {\n type: 'void',\n title: '{{t(\"Delete\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useBulkDestroyAction }}',\n confirm: {\n title: \"{{t('Delete record')}}\",\n content: \"{{t('Are you sure you want to delete it?')}}\",\n },\n },\n },\n create: {\n type: 'void',\n title: '{{t(\"Add new\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n title: '{{t(\"Add new\")}}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n type: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n description: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: 'Cancel',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: 'Submit',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useCreateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n }\n },\n table: {\n type: 'void',\n 'x-component': 'Table.Void',\n 'x-component-props': {\n rowKey: 'id',\n rowSelection: {\n type: 'checkbox',\n },\n useDataSource: '{{ cm.useDataSourceFromRAC }}',\n },\n properties: {\n title: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n title: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n type: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n type: {\n type: 'string',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n },\n }\n },\n enabled: {\n type: 'void',\n 'x-decorator': 'Table.Column.Decorator',\n 'x-component': 'Table.Column',\n properties: {\n enabled: {\n type: 'boolean',\n 'x-component': 'CollectionField',\n 'x-read-pretty': true,\n default: false\n },\n }\n },\n actions: {\n type: 'void',\n title: '{{ t(\"Actions\") }}',\n 'x-component': 'Table.Column',\n properties: {\n actions: {\n type: 'void',\n 'x-component': 'Space',\n 'x-component-props': {\n split: '|',\n },\n properties: {\n config: {\n type: 'void',\n 'x-component': 'WorkflowLink'\n },\n executions: {\n type: 'void',\n title: '{{t(\"Executions\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Executions\")}}',\n 'x-component': 'Action.Drawer',\n properties: executionSchema\n }\n }\n },\n update: {\n type: 'void',\n title: '{{ t(\"Edit\") }}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n modal: {\n type: 'void',\n 'x-component': 'Action.Modal',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues: '{{ cm.useValuesFromRecord }}',\n },\n title: '{{ t(\"Edit\") }}',\n properties: {\n title: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n enabled: {\n 'x-component': 'CollectionField',\n 'x-decorator': 'FormItem',\n },\n footer: {\n type: 'void',\n 'x-component': 'Action.Modal.Footer',\n properties: {\n cancel: {\n title: '{{ t(\"Cancel\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{ t(\"Submit\") }}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: '{{ cm.useUpdateAction }}',\n },\n },\n },\n },\n },\n },\n },\n },\n // delete: {\n // type: 'void',\n // title: '{{ t(\"Delete\") }}',\n // 'x-component': 'Action.Link',\n // 'x-component-props': {\n // confirm: {\n // title: \"{{t('Delete record')}}\",\n // content: \"{{t('Are you sure you want to delete it?')}}\",\n // },\n // useAction: '{{ cm.useDestroyActionAndRefreshCM }}',\n // },\n // },\n }\n }\n }\n }\n }\n }\n }\n }\n }\n};\n"]}
@@ -49,7 +49,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
49
  import { useForm } from "@formily/react";
50
50
  import { cx } from "@emotion/css";
51
51
  import { Registry } from "@nocobase/utils";
52
- import { SchemaComponent, useActionContext, useAPIClient, useRecord, useResourceActionContext } from '../../';
52
+ import { SchemaComponent, useActionContext, useAPIClient, useCompile, useRecord, useResourceActionContext } from '../../';
53
53
  import model from './model';
54
54
  import { nodeCardClass } from "../style";
55
55
  function useUpdateConfigAction() {
@@ -84,23 +84,24 @@ function useUpdateConfigAction() {
84
84
  ;
85
85
  ;
86
86
  export var triggers = new Registry();
87
- triggers.register('model', model);
87
+ triggers.register(model.type, model);
88
88
  export var TriggerConfig = function () {
89
+ var compile = useCompile();
89
90
  var data = useResourceActionContext().data;
90
91
  if (!data) {
91
92
  return null;
92
93
  }
93
94
  var _a = data.data, type = _a.type, config = _a.config;
94
95
  var _b = triggers.get(type), title = _b.title, fieldset = _b.fieldset, scope = _b.scope;
95
- return (_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsx("h4", { children: title }, void 0), _jsx(SchemaComponent, { schema: {
96
+ return (_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsx("h4", { children: compile(title) }, void 0), _jsx(SchemaComponent, { schema: {
96
97
  type: 'void',
97
- title: '触发器配置',
98
+ title: '{{t("Trigger configuration")}}',
98
99
  'x-component': 'Action.Link',
99
100
  name: 'drawer',
100
101
  properties: {
101
102
  drawer: {
102
103
  type: 'void',
103
- title: '触发器配置',
104
+ title: '{{t("Trigger configuration")}}',
104
105
  'x-component': 'Action.Drawer',
105
106
  'x-decorator': 'Form',
106
107
  'x-decorator-props': {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAc,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAC1H,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,SAAS,qBAAqB;IAC5B,IAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAC3B,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IACvB,IAAA,OAAO,GAAK,wBAAwB,EAAE,QAA/B,CAAgC;IAC/C,OAAO;QACC,GAAG;;;;gCACP,qBAAM,IAAI,CAAC,MAAM,EAAE,EAAA;;4BAAnB,SAAmB,CAAC;4BACpB,qBAAM,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC;oCAChD,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CACd,aAAa,EAAE,UAAU;oCACzB,mBAAmB,EAAE,EAAE;oCACvB,UAAU,EAAE,QAAQ;iCACrB;gCACD,OAAO,EAAE;oCACP,IAAI,EAAE,MAAM;oCACZ,aAAa,EAAE,sBAAsB;oCACrC,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,SAAS,EAAE,0BAA0B;6CACtC;yCACF;wCACD,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,IAAI,EAAE,SAAS;gDACf,SAAS,EAAE,qBAAqB;6CACjC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF,EACD,KAAK,EAAE,KAAK,WACZ,aACE,CACP,CAAC;AACJ,CAAC,CAAA","sourcesContent":["import React from \"react\";\nimport { ISchema, useForm } from \"@formily/react\";\nimport { cx } from \"@emotion/css\";\nimport { Registry } from \"@nocobase/utils\";\n\nimport { SchemaComponent, useActionContext, useAPIClient, useRecord, useRequest, useResourceActionContext } from '../../';\nimport model from './model';\nimport { nodeCardClass } from \"../style\";\n\n\nfunction useUpdateConfigAction() {\n const form = useForm();\n const api = useAPIClient();\n const record = useRecord();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n return {\n async run() {\n await form.submit();\n await api.resource('workflows', record.id).update({\n filterByTk: record.id,\n values: form.values\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nexport interface Trigger {\n title: string;\n type: string;\n // group: string;\n options?: { label: string; value: any; key: string }[];\n fieldset: { [key: string]: ISchema };\n view?: ISchema;\n scope?: { [key: string]: any };\n components?: { [key: string]: any };\n render?(props): React.ReactElement;\n getter?(node: any): React.ReactElement;\n};\n\nexport const triggers = new Registry<Trigger>();\n\ntriggers.register('model', model);\n\nexport const TriggerConfig = () => {\n const { data } = useResourceActionContext();\n if (!data) {\n return null;\n }\n const { type, config } = data.data;\n const { title, fieldset, scope } = triggers.get(type);\n return (\n <div className={cx(nodeCardClass)}>\n <h4>{title}</h4>\n <SchemaComponent\n schema={{\n type: 'void',\n title: '触发器配置',\n 'x-component': 'Action.Link',\n name: 'drawer',\n properties: {\n drawer: {\n type: 'void',\n title: '触发器配置',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n initialValue: { config }\n },\n properties: {\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: fieldset\n },\n actions: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: useUpdateConfigAction\n }\n }\n }\n }\n }\n }\n }\n }}\n scope={scope}\n />\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/triggers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAc,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AACtI,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,SAAS,qBAAqB;IAC5B,IAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAM,GAAG,GAAG,YAAY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AC,eAAe,IACd,MAAM,EAAE;oBACN,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,gCAAgC;oBACvC,aAAa,EAAE,aAAa;oBAC5B,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,gCAAgC;4BACvC,aAAa,EAAE,eAAe;4BAC9B,aAAa,EAAE,MAAM;4BACrB,mBAAmB,EAAE;gCACnB,YAAY,EAAE,EAAE,MAAM,QAAA,EAAE;6BACzB;4BACD,UAAU,EAAE;gCACV,MAAM,EAAE;oCACN,IAAI,EAAE,MAAM;oCACZ,IAAI,EAAE,QAAQ;oCACd,aAAa,EAAE,UAAU;oCACzB,mBAAmB,EAAE,EAAE;oCACvB,UAAU,EAAE,QAAQ;iCACrB;gCACD,OAAO,EAAE;oCACP,IAAI,EAAE,MAAM;oCACZ,aAAa,EAAE,sBAAsB;oCACrC,UAAU,EAAE;wCACV,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,SAAS,EAAE,0BAA0B;6CACtC;yCACF;wCACD,MAAM,EAAE;4CACN,KAAK,EAAE,iBAAiB;4CACxB,aAAa,EAAE,QAAQ;4CACvB,mBAAmB,EAAE;gDACnB,IAAI,EAAE,SAAS;gDACf,SAAS,EAAE,qBAAqB;6CACjC;yCACF;qCACF;iCACF;6BACF;yBACF;qBACF;iBACF,EACD,KAAK,EAAE,KAAK,WACZ,aACE,CACP,CAAC;AACJ,CAAC,CAAA","sourcesContent":["import React from \"react\";\nimport { ISchema, useForm } from \"@formily/react\";\nimport { cx } from \"@emotion/css\";\nimport { Registry } from \"@nocobase/utils\";\n\nimport { SchemaComponent, useActionContext, useAPIClient, useCompile, useRecord, useRequest, useResourceActionContext } from '../../';\nimport model from './model';\nimport { nodeCardClass } from \"../style\";\n\n\nfunction useUpdateConfigAction() {\n const form = useForm();\n const api = useAPIClient();\n const record = useRecord();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n return {\n async run() {\n await form.submit();\n await api.resource('workflows', record.id).update({\n filterByTk: record.id,\n values: form.values\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nexport interface Trigger {\n title: string;\n type: string;\n // group: string;\n options?: { label: string; value: any; key: string }[];\n fieldset: { [key: string]: ISchema };\n view?: ISchema;\n scope?: { [key: string]: any };\n components?: { [key: string]: any };\n render?(props): React.ReactElement;\n getter?(node: any): React.ReactElement;\n};\n\nexport const triggers = new Registry<Trigger>();\n\ntriggers.register(model.type, model);\n\nexport const TriggerConfig = () => {\n const compile = useCompile();\n const { data } = useResourceActionContext();\n if (!data) {\n return null;\n }\n const { type, config } = data.data;\n const { title, fieldset, scope } = triggers.get(type);\n return (\n <div className={cx(nodeCardClass)}>\n <h4>{compile(title)}</h4>\n <SchemaComponent\n schema={{\n type: 'void',\n title: '{{t(\"Trigger configuration\")}}',\n 'x-component': 'Action.Link',\n name: 'drawer',\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Trigger configuration\")}}',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n initialValue: { config }\n },\n properties: {\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: fieldset\n },\n actions: {\n type: 'void',\n 'x-component': 'Action.Drawer.Footer',\n properties: {\n cancel: {\n title: '{{t(\"Cancel\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n useAction: '{{ cm.useCancelAction }}',\n },\n },\n submit: {\n title: '{{t(\"Submit\")}}',\n 'x-component': 'Action',\n 'x-component-props': {\n type: 'primary',\n useAction: useUpdateConfigAction\n }\n }\n }\n }\n }\n }\n }\n }}\n scope={scope}\n />\n </div>\n );\n}\n"]}