@nocobase/client 0.7.0-alpha.23 → 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 (113) hide show
  1. package/esm/collection-manager/interfaces/attachment.js +1 -1
  2. package/esm/collection-manager/interfaces/attachment.js.map +1 -1
  3. package/esm/locale/index.d.ts +48 -0
  4. package/esm/locale/zh_CN.d.ts +48 -0
  5. package/esm/locale/zh_CN.js +51 -2
  6. package/esm/locale/zh_CN.js.map +1 -1
  7. package/esm/schema-component/antd/kanban-v2/Kanban.Card.Designer.js +1 -2
  8. package/esm/schema-component/antd/kanban-v2/Kanban.Card.Designer.js.map +1 -1
  9. package/esm/schema-initializer/utils.js +2 -2
  10. package/esm/schema-initializer/utils.js.map +1 -1
  11. package/esm/workflow/WorkflowCanvas.js +11 -8
  12. package/esm/workflow/WorkflowCanvas.js.map +1 -1
  13. package/esm/workflow/WorkflowLink.js +3 -1
  14. package/esm/workflow/WorkflowLink.js.map +1 -1
  15. package/esm/workflow/WorkflowPage.js +3 -3
  16. package/esm/workflow/WorkflowPage.js.map +1 -1
  17. package/esm/workflow/WorkflowShortcut.js +4 -2
  18. package/esm/workflow/WorkflowShortcut.js.map +1 -1
  19. package/esm/workflow/calculators.js +82 -45
  20. package/esm/workflow/calculators.js.map +1 -1
  21. package/esm/workflow/nodes/calculation.js +5 -3
  22. package/esm/workflow/nodes/calculation.js.map +1 -1
  23. package/esm/workflow/nodes/create.d.ts +0 -5
  24. package/esm/workflow/nodes/create.js +5 -3
  25. package/esm/workflow/nodes/create.js.map +1 -1
  26. package/esm/workflow/nodes/destroy.js +2 -2
  27. package/esm/workflow/nodes/destroy.js.map +1 -1
  28. package/esm/workflow/nodes/index.js +11 -8
  29. package/esm/workflow/nodes/index.js.map +1 -1
  30. package/esm/workflow/nodes/query.js +5 -3
  31. package/esm/workflow/nodes/query.js.map +1 -1
  32. package/esm/workflow/nodes/update.d.ts +0 -5
  33. package/esm/workflow/nodes/update.js +2 -2
  34. package/esm/workflow/nodes/update.js.map +1 -1
  35. package/esm/workflow/schemas/collection.d.ts +0 -5
  36. package/esm/workflow/schemas/collection.js +4 -16
  37. package/esm/workflow/schemas/collection.js.map +1 -1
  38. package/esm/workflow/schemas/executions.d.ts +4 -25
  39. package/esm/workflow/schemas/executions.js +38 -34
  40. package/esm/workflow/schemas/executions.js.map +1 -1
  41. package/esm/workflow/schemas/workflows.js +51 -30
  42. package/esm/workflow/schemas/workflows.js.map +1 -1
  43. package/esm/workflow/triggers/index.js +6 -5
  44. package/esm/workflow/triggers/index.js.map +1 -1
  45. package/esm/workflow/triggers/model.js +12 -10
  46. package/esm/workflow/triggers/model.js.map +1 -1
  47. package/lib/collection-manager/interfaces/attachment.js +1 -1
  48. package/lib/collection-manager/interfaces/attachment.js.map +1 -1
  49. package/lib/locale/index.d.ts +48 -0
  50. package/lib/locale/zh_CN.d.ts +48 -0
  51. package/lib/locale/zh_CN.js +51 -2
  52. package/lib/locale/zh_CN.js.map +1 -1
  53. package/lib/schema-component/antd/kanban-v2/Kanban.Card.Designer.js +1 -2
  54. package/lib/schema-component/antd/kanban-v2/Kanban.Card.Designer.js.map +1 -1
  55. package/lib/schema-initializer/utils.js +2 -2
  56. package/lib/schema-initializer/utils.js.map +1 -1
  57. package/lib/workflow/WorkflowCanvas.js +10 -7
  58. package/lib/workflow/WorkflowCanvas.js.map +1 -1
  59. package/lib/workflow/WorkflowLink.js +3 -1
  60. package/lib/workflow/WorkflowLink.js.map +1 -1
  61. package/lib/workflow/WorkflowPage.js +3 -3
  62. package/lib/workflow/WorkflowPage.js.map +1 -1
  63. package/lib/workflow/WorkflowShortcut.js +4 -2
  64. package/lib/workflow/WorkflowShortcut.js.map +1 -1
  65. package/lib/workflow/calculators.js +79 -42
  66. package/lib/workflow/calculators.js.map +1 -1
  67. package/lib/workflow/nodes/calculation.js +5 -3
  68. package/lib/workflow/nodes/calculation.js.map +1 -1
  69. package/lib/workflow/nodes/create.d.ts +0 -5
  70. package/lib/workflow/nodes/create.js +5 -3
  71. package/lib/workflow/nodes/create.js.map +1 -1
  72. package/lib/workflow/nodes/destroy.js +2 -2
  73. package/lib/workflow/nodes/destroy.js.map +1 -1
  74. package/lib/workflow/nodes/index.js +10 -7
  75. package/lib/workflow/nodes/index.js.map +1 -1
  76. package/lib/workflow/nodes/query.js +5 -3
  77. package/lib/workflow/nodes/query.js.map +1 -1
  78. package/lib/workflow/nodes/update.d.ts +0 -5
  79. package/lib/workflow/nodes/update.js +2 -2
  80. package/lib/workflow/nodes/update.js.map +1 -1
  81. package/lib/workflow/schemas/collection.d.ts +0 -5
  82. package/lib/workflow/schemas/collection.js +4 -16
  83. package/lib/workflow/schemas/collection.js.map +1 -1
  84. package/lib/workflow/schemas/executions.d.ts +4 -25
  85. package/lib/workflow/schemas/executions.js +38 -34
  86. package/lib/workflow/schemas/executions.js.map +1 -1
  87. package/lib/workflow/schemas/workflows.js +51 -30
  88. package/lib/workflow/schemas/workflows.js.map +1 -1
  89. package/lib/workflow/triggers/index.js +5 -4
  90. package/lib/workflow/triggers/index.js.map +1 -1
  91. package/lib/workflow/triggers/model.js +12 -10
  92. package/lib/workflow/triggers/model.js.map +1 -1
  93. package/package.json +3 -3
  94. package/src/collection-manager/interfaces/attachment.ts +1 -1
  95. package/src/locale/zh_CN.ts +63 -2
  96. package/src/schema-component/antd/kanban-v2/Kanban.Card.Designer.tsx +1 -2
  97. package/src/schema-initializer/utils.ts +2 -2
  98. package/src/workflow/WorkflowCanvas.tsx +13 -8
  99. package/src/workflow/WorkflowLink.tsx +3 -1
  100. package/src/workflow/WorkflowPage.tsx +3 -3
  101. package/src/workflow/WorkflowShortcut.tsx +4 -2
  102. package/src/workflow/calculators.tsx +100 -54
  103. package/src/workflow/nodes/calculation.tsx +5 -3
  104. package/src/workflow/nodes/create.tsx +5 -3
  105. package/src/workflow/nodes/destroy.tsx +2 -2
  106. package/src/workflow/nodes/index.tsx +11 -8
  107. package/src/workflow/nodes/query.tsx +5 -3
  108. package/src/workflow/nodes/update.tsx +2 -2
  109. package/src/workflow/schemas/collection.ts +4 -16
  110. package/src/workflow/schemas/executions.ts +38 -34
  111. package/src/workflow/schemas/workflows.ts +31 -30
  112. package/src/workflow/triggers/index.tsx +6 -5
  113. package/src/workflow/triggers/model.tsx +12 -10
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/nodes/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAC7H,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,MAAM,M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;iEACtC;6DACF;4DACD,MAAM,EAAE;gEACN,KAAK,EAAE,iBAAiB;gEACxB,aAAa,EAAE,QAAQ;gEACvB,mBAAmB,EAAE;oEACnB,IAAI,EAAE,SAAS;oEACf,SAAS,EAAE,eAAe;iEAC3B;6DACF;yDACF;qDACS;iDACb;6CACF;yCACF;qCACF;iCACF;6BACF,WACD,aACE,EACL,QAAQ,aACL,YACe,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { CloseOutlined, DeleteOutlined } from '@ant-design/icons';\nimport { css, cx } from '@emotion/css';\nimport { ISchema, useForm } from '@formily/react';\nimport { Registry } from '@nocobase/utils';\nimport { Button, Modal, Tag } from 'antd';\nimport React, { useContext } from 'react';\nimport { SchemaComponent, useActionContext, useAPIClient, useCollection, useRequest, useResourceActionContext } from '../..';\nimport { nodeBlockClass, nodeCardClass, nodeClass, nodeHeaderClass, nodeTitleClass } from '../style';\nimport { AddButton, useFlowContext } from '../WorkflowCanvas';\n\nimport calculation from './calculation';\nimport condition from './condition';\nimport create from './create';\nimport destroy from './destroy';\nimport parallel from './parallel';\nimport query from './query';\nimport update from './update';\n\n\n\nexport interface Instruction {\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 endding?: boolean;\n getter?(node: any): React.ReactElement;\n};\n\nexport const instructions = new Registry<Instruction>();\n\ninstructions.register('query', query);\ninstructions.register('create', create);\ninstructions.register('update', update);\ninstructions.register('destroy', destroy);\ninstructions.register('condition', condition);\ninstructions.register('parallel', parallel);\ninstructions.register('calculation', calculation);\n\nfunction useUpdateAction() {\n const form = useForm();\n const api = useAPIClient();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n const data = useNodeContext();\n return {\n async run() {\n await form.submit();\n await api.resource('flow_nodes', data.id).update({\n filterByTk: data.id,\n values: {\n title: form.values.title,\n config: form.values.config\n }\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nconst NodeContext = React.createContext(null);\n\nexport function useNodeContext() {\n return useContext(NodeContext);\n}\n\nexport function Node({ data }) {\n const instruction = instructions.get(data.type);\n\n return (\n <div className={cx(nodeBlockClass)}>\n {instruction.render\n ? instruction.render(data)\n : <NodeDefaultView data={data} />\n }\n {!instruction.endding\n ? <AddButton upstream={data} />\n : (\n <div\n className={css`\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 1px;\n height: 6em;\n padding: 2em 0;\n background-color: #f0f2f5;\n\n .anticon{\n font-size: 1.5em;\n line-height: 100%;\n }\n `}\n >\n <CloseOutlined />\n </div>\n )\n }\n </div>\n );\n}\n\nexport function RemoveButton() {\n const { resource } = useCollection();\n const current = useNodeContext();\n const { nodes, onNodeRemoved } = useFlowContext();\n\n async function onRemove() {\n async function onOk() {\n const { data: { data: node } } = await resource.destroy({\n filterByTk: current.id\n });\n onNodeRemoved(node);\n }\n\n const hasBranches = !nodes.find(item => item.upstream === current && item.branchIndex != null);\n const message = hasBranches\n ? '确定删除该节点吗?'\n : '节点包含分支,将同时删除其所有分支下的子节点,确定继续?';\n\n Modal.confirm({\n title: '删除节点',\n content: message,\n onOk\n });\n }\n\n return (\n <Button\n type=\"text\"\n shape=\"circle\"\n icon={<DeleteOutlined />}\n onClick={onRemove}\n className=\"workflow-node-remove-button\"\n />\n );\n}\n\nexport function NodeDefaultView(props) {\n const { data, children } = props;\n const instruction = instructions.get(data.type);\n\n return (\n <NodeContext.Provider value={data}>\n <div className={cx(nodeClass, `workflow-node-type-${data.type}`)}>\n <div className={cx(nodeCardClass)}>\n <div className={cx(nodeHeaderClass)}>\n <h4 className={cx(nodeTitleClass)}>\n <Tag>{instruction.title}</Tag>\n <strong>{data.title}</strong>\n <span className=\"workflow-node-id\">#{data.id}</span>\n </h4>\n <RemoveButton />\n </div>\n <SchemaComponent\n scope={instruction.scope}\n components={instruction.components}\n schema={{\n type: 'void',\n properties: {\n view: instruction.view,\n config: {\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 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues(options) {\n const d = useNodeContext();\n return useRequest(() => {\n return Promise.resolve({ data: d });\n }, options);\n }\n },\n properties: {\n title: {\n type: 'string',\n name: 'title',\n title: '节点名称',\n 'x-decorator': 'FormItem',\n 'x-component': 'Input',\n },\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: instruction.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: useUpdateAction,\n },\n },\n },\n } as ISchema\n }\n }\n }\n }\n }\n }}\n />\n </div>\n {children}\n </div>\n </NodeContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workflow/nodes/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAW,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MA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oDACnB,SAAS,YAAC,OAAO;wDACf,IAAM,CAAC,GAAG,cAAc,EAAE,CAAC;wDAC3B,OAAO,UAAU,CAAC;4DAChB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;wDACtC,CAAC,EAAE,OAAO,CAAC,CAAC;oDACd,CAAC;iDACF;gDACD,UAAU,EAAE;oDACV,KAAK,EAAE;wDACL,IAAI,EAAE,QAAQ;wDACd,IAAI,EAAE,OAAO;wDACb,KAAK,EAAE,eAAe;wDACtB,aAAa,EAAE,UAAU;wDACzB,aAAa,EAAE,OAAO;qDACvB;oDACD,MAAM,EAAE;wDACN,IAAI,EAAE,MAAM;wDACZ,IAAI,EAAE,QAAQ;wDACd,aAAa,EAAE,UAAU;wDACzB,mBAAmB,EAAE,EAAE;wDACvB,UAAU,EAAE,WAAW,CAAC,QAAQ;qDACjC;oDACD,OAAO,EAAE;wDACP,IAAI,EAAE,MAAM;wDACZ,aAAa,EAAE,sBAAsB;wDACrC,UAAU,EAAE;4DACV,MAAM,EAAE;gEACN,KAAK,EAAE,iBAAiB;gEACxB,aAAa,EAAE,QAAQ;gEACvB,mBAAmB,EAAE;oEACnB,SAAS,EAAE,0BAA0B;iEACtC;6DACF;4DACD,MAAM,EAAE;gEACN,KAAK,EAAE,iBAAiB;gEACxB,aAAa,EAAE,QAAQ;gEACvB,mBAAmB,EAAE;oEACnB,IAAI,EAAE,SAAS;oEACf,SAAS,EAAE,eAAe;iEAC3B;6DACF;yDACF;qDACS;iDACb;6CACF;yCACF;qCACF;iCACF;6BACF,WACD,aACE,EACL,QAAQ,aACL,YACe,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { CloseOutlined, DeleteOutlined } from '@ant-design/icons';\nimport { css, cx } from '@emotion/css';\nimport { ISchema, useForm } from '@formily/react';\nimport { Registry } from '@nocobase/utils';\nimport { Button, Modal, Tag } from 'antd';\nimport React, { useContext } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { SchemaComponent, useActionContext, useAPIClient, useCollection, useCompile, useRequest, useResourceActionContext } from '../..';\nimport { nodeBlockClass, nodeCardClass, nodeClass, nodeHeaderClass, nodeTitleClass } from '../style';\nimport { AddButton, useFlowContext } from '../WorkflowCanvas';\n\nimport calculation from './calculation';\nimport condition from './condition';\nimport create from './create';\nimport destroy from './destroy';\nimport parallel from './parallel';\nimport query from './query';\nimport update from './update';\n\n\n\nexport interface Instruction {\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 endding?: boolean;\n getter?(node: any): React.ReactElement;\n};\n\nexport const instructions = new Registry<Instruction>();\n\ninstructions.register('query', query);\ninstructions.register('create', create);\ninstructions.register('update', update);\ninstructions.register('destroy', destroy);\ninstructions.register('condition', condition);\ninstructions.register('parallel', parallel);\ninstructions.register('calculation', calculation);\n\nfunction useUpdateAction() {\n const form = useForm();\n const api = useAPIClient();\n const ctx = useActionContext();\n const { refresh } = useResourceActionContext();\n const data = useNodeContext();\n return {\n async run() {\n await form.submit();\n await api.resource('flow_nodes', data.id).update({\n filterByTk: data.id,\n values: {\n title: form.values.title,\n config: form.values.config\n }\n });\n ctx.setVisible(false);\n refresh();\n },\n };\n};\n\nconst NodeContext = React.createContext(null);\n\nexport function useNodeContext() {\n return useContext(NodeContext);\n}\n\nexport function Node({ data }) {\n const instruction = instructions.get(data.type);\n\n return (\n <div className={cx(nodeBlockClass)}>\n {instruction.render\n ? instruction.render(data)\n : <NodeDefaultView data={data} />\n }\n {!instruction.endding\n ? <AddButton upstream={data} />\n : (\n <div\n className={css`\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 1px;\n height: 6em;\n padding: 2em 0;\n background-color: #f0f2f5;\n\n .anticon{\n font-size: 1.5em;\n line-height: 100%;\n }\n `}\n >\n <CloseOutlined />\n </div>\n )\n }\n </div>\n );\n}\n\nexport function RemoveButton() {\n const { t } = useTranslation();\n const { resource } = useCollection();\n const current = useNodeContext();\n const { nodes, onNodeRemoved } = useFlowContext();\n\n async function onRemove() {\n async function onOk() {\n const { data: { data: node } } = await resource.destroy({\n filterByTk: current.id\n });\n onNodeRemoved(node);\n }\n\n const hasBranches = !nodes.find(item => item.upstream === current && item.branchIndex != null);\n const message = hasBranches\n ? t('Are you sure you want to delete it?')\n : t('This node contains branches, deleting will also be preformed to them, are you sure?');\n\n Modal.confirm({\n title: t('Delete'),\n content: message,\n onOk\n });\n }\n\n return (\n <Button\n type=\"text\"\n shape=\"circle\"\n icon={<DeleteOutlined />}\n onClick={onRemove}\n className=\"workflow-node-remove-button\"\n />\n );\n}\n\nexport function NodeDefaultView(props) {\n const { data, children } = props;\n const compile = useCompile();\n const instruction = instructions.get(data.type);\n\n return (\n <NodeContext.Provider value={data}>\n <div className={cx(nodeClass, `workflow-node-type-${data.type}`)}>\n <div className={cx(nodeCardClass)}>\n <div className={cx(nodeHeaderClass)}>\n <h4 className={cx(nodeTitleClass)}>\n <Tag>{compile(instruction.title)}</Tag>\n <strong>{data.title}</strong>\n <span className=\"workflow-node-id\">#{data.id}</span>\n </h4>\n <RemoveButton />\n </div>\n <SchemaComponent\n scope={instruction.scope}\n components={instruction.components}\n schema={{\n type: 'void',\n properties: {\n view: instruction.view,\n config: {\n type: 'void',\n title: '{{t(\"Node configuration\")}}',\n 'x-component': 'Action.Link',\n 'x-component-props': {\n type: 'primary',\n },\n properties: {\n drawer: {\n type: 'void',\n title: '{{t(\"Node configuration\")}}',\n 'x-component': 'Action.Drawer',\n 'x-decorator': 'Form',\n 'x-decorator-props': {\n useValues(options) {\n const d = useNodeContext();\n return useRequest(() => {\n return Promise.resolve({ data: d });\n }, options);\n }\n },\n properties: {\n title: {\n type: 'string',\n name: 'title',\n title: '{{t(\"Name\")}}',\n 'x-decorator': 'FormItem',\n 'x-component': 'Input',\n },\n config: {\n type: 'void',\n name: 'config',\n 'x-component': 'fieldset',\n 'x-component-props': {},\n properties: instruction.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: useUpdateAction,\n },\n },\n },\n } as ISchema\n }\n }\n }\n }\n }\n }}\n />\n </div>\n {children}\n </div>\n </NodeContext.Provider>\n );\n}\n"]}
@@ -15,10 +15,11 @@ import { useCollectionDataSource, useCollectionManager, useCompile } from '../..
15
15
  import { useFlowContext } from '../WorkflowCanvas';
16
16
  import { BaseTypeSet, VariableComponent } from '../calculators';
17
17
  import { collection, filter } from '../schemas/collection';
18
+ import { useTranslation } from 'react-i18next';
18
19
  export default {
19
- title: '查询数据',
20
+ title: '{{t("Query record")}}',
20
21
  type: 'query',
21
- group: 'model',
22
+ group: 'collection',
22
23
  fieldset: {
23
24
  'config.collection': collection,
24
25
  'config.multiple': {
@@ -51,12 +52,13 @@ export default {
51
52
  getter: function (_a) {
52
53
  var _b;
53
54
  var type = _a.type, options = _a.options, onChange = _a.onChange;
55
+ var t = useTranslation().t;
54
56
  var compile = useCompile();
55
57
  var _c = useCollectionManager().collections, collections = _c === void 0 ? [] : _c;
56
58
  var nodes = useFlowContext().nodes;
57
59
  var config = nodes.find(function (n) { return n.id == options.nodeId; }).config;
58
60
  var collection = (_b = collections.find(function (item) { return item.name === config.collection; })) !== null && _b !== void 0 ? _b : { fields: [] };
59
- return (_jsx(Select, __assign({ value: options.path, placeholder: "\u9009\u62E9\u5B57\u6BB5", onChange: function (path) {
61
+ return (_jsx(Select, __assign({ value: options.path, placeholder: t('Fields'), onChange: function (path) {
60
62
  onChange({ type: type, options: __assign(__assign({}, options), { path: path }) });
61
63
  } }, { children: collection.fields
62
64
  .filter(function (field) { var _a; return BaseTypeSet.has((_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.type); })
@@ -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,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;QAC9B,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,EAAC,0BAAM,EAAC,QAAQ,EAAE,UAAA,IAAI;gBAC5D,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';\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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E,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"]}
@@ -49,11 +49,6 @@ declare const _default: {
49
49
  className: string;
50
50
  };
51
51
  'x-component': string;
52
- 'x-component-props': {
53
- useProps(): {
54
- fields: any;
55
- };
56
- };
57
52
  };
58
53
  };
59
54
  };
@@ -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"]}
@@ -17,11 +17,6 @@ export declare const values: {
17
17
  className: string;
18
18
  };
19
19
  'x-component': string;
20
- 'x-component-props': {
21
- useProps(): {
22
- fields: any;
23
- };
24
- };
25
20
  };
26
21
  export declare const filter: {
27
22
  type: string;
@@ -4,11 +4,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  };
5
5
  import { css } from "@emotion/css";
6
6
  import { useForm } from "@formily/react";
7
- import { useCollectionManager } from "../../collection-manager";
8
7
  import { useCollectionFilterOptions } from "../../collection-manager/action-hooks";
9
8
  export var collection = {
10
9
  type: 'string',
11
- title: '数据表',
10
+ title: '{{t("Collection")}}',
12
11
  name: 'config.collection',
13
12
  required: true,
14
13
  'x-reactions': ['{{useCollectionDataSource()}}'],
@@ -17,29 +16,18 @@ export var collection = {
17
16
  };
18
17
  export var values = {
19
18
  type: 'object',
20
- title: '数据内容',
19
+ title: '{{t("Form values")}}',
21
20
  name: 'config.params.values',
22
21
  'x-decorator': 'FormItem',
23
22
  'x-decorator-props': {
24
23
  labelAlign: 'left',
25
24
  className: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n "], ["\n flex-direction: column;\n "])))
26
25
  },
27
- 'x-component': 'CollectionFieldset',
28
- 'x-component-props': {
29
- useProps: function () {
30
- var _a;
31
- var getCollectionFields = useCollectionManager().getCollectionFields;
32
- var form = useForm().values;
33
- var fields = getCollectionFields((_a = form === null || form === void 0 ? void 0 : form.config) === null || _a === void 0 ? void 0 : _a.collection)
34
- .filter(function (field) { return (!field.hidden
35
- && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false)); });
36
- return { fields: fields };
37
- }
38
- }
26
+ 'x-component': 'CollectionFieldset'
39
27
  };
40
28
  export var filter = {
41
29
  type: 'object',
42
- title: '筛选条件',
30
+ title: '{{t("Filter")}}',
43
31
  name: 'config.params.filter',
44
32
  'x-decorator': 'FormItem',
45
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;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,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;IACnC,mBAAmB,EAAE;QACnB,QAAQ;;YACE,IAAA,mBAAmB,GAAK,oBAAoB,EAAE,oBAA3B,CAA4B;YAC/C,IAAQ,IAAI,GAAK,OAAO,EAAE,OAAd,CAAe;YACnC,IAAM,MAAM,GAAG,mBAAmB,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,0CAAE,UAAU,CAAC;iBACzD,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,CACf,CAAC,KAAK,CAAC,MAAM;mBACV,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAC/D,EAHgB,CAGhB,CAAC,CAAC;YACL,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;QACpB,CAAC;KACF;CACF,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 'x-component-props': {\n useProps() {\n const { getCollectionFields } = useCollectionManager();\n const { values: form } = useForm();\n const fields = getCollectionFields(form?.config?.collection)\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false)\n ));\n return { fields };\n }\n }\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,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC5B;aACS;SACb;KACF;CACF,CAAC;AAEF,MAAM,CAAC,IAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,2BAA2B;QAC1C,mBAAmB,EAAE;YACnB,UAAU,YAAA;YACV,YAAY,EAAE,YA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AE;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,EAAE;oBACJ,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE;oBACxC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE;oBACvC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACvC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE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V,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',