@nocobase/client 0.7.0-alpha.18 → 0.7.0-alpha.21
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.
- package/esm/workflow/calculators.js +1 -4
- package/esm/workflow/calculators.js.map +1 -1
- package/esm/workflow/nodes/create.d.ts +1 -1
- package/esm/workflow/nodes/create.js +1 -1
- package/esm/workflow/nodes/create.js.map +1 -1
- package/esm/workflow/nodes/index.js +4 -9
- package/esm/workflow/nodes/index.js.map +1 -1
- package/esm/workflow/schemas/collection.js +5 -2
- package/esm/workflow/schemas/collection.js.map +1 -1
- package/esm/workflow/triggers/index.js +13 -6
- package/esm/workflow/triggers/index.js.map +1 -1
- package/esm/workflow/triggers/model.d.ts +18 -4
- package/esm/workflow/triggers/model.js +43 -5
- package/esm/workflow/triggers/model.js.map +1 -1
- package/lib/workflow/calculators.js +1 -4
- package/lib/workflow/calculators.js.map +1 -1
- package/lib/workflow/nodes/create.d.ts +1 -1
- package/lib/workflow/nodes/create.js +1 -1
- package/lib/workflow/nodes/create.js.map +1 -1
- package/lib/workflow/nodes/index.js +3 -8
- package/lib/workflow/nodes/index.js.map +1 -1
- package/lib/workflow/schemas/collection.js +5 -2
- package/lib/workflow/schemas/collection.js.map +1 -1
- package/lib/workflow/triggers/index.js +13 -6
- package/lib/workflow/triggers/index.js.map +1 -1
- package/lib/workflow/triggers/model.d.ts +18 -4
- package/lib/workflow/triggers/model.js +43 -5
- package/lib/workflow/triggers/model.js.map +1 -1
- package/package.json +3 -3
- package/src/workflow/calculators.tsx +1 -6
- package/src/workflow/nodes/create.tsx +1 -1
- package/src/workflow/nodes/index.tsx +5 -20
- package/src/workflow/schemas/collection.ts +6 -2
- package/src/workflow/triggers/index.tsx +10 -9
- package/src/workflow/triggers/model.tsx +44 -5
|
@@ -331,10 +331,7 @@ export var CollectionFieldset = observer(function (_a) {
|
|
|
331
331
|
options: undefined
|
|
332
332
|
} });
|
|
333
333
|
return (_jsx("fieldset", __assign({ className: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n "], ["\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n "]))) }, { children: fields.length
|
|
334
|
-
? fields
|
|
335
|
-
.filter(function (field) { return (!field.hidden
|
|
336
|
-
&& (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)); })
|
|
337
|
-
.map(function (field) {
|
|
334
|
+
? fields.map(function (field) {
|
|
338
335
|
var _a, _b;
|
|
339
336
|
var operand = typeof value[field.name] === 'string'
|
|
340
337
|
? parseStringValue(value[field.name], VTypes)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculators.js","sourceRoot":"","sources":["../../src/workflow/calculators.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAc,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEjD,SAAS,UAAU;IACjB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,IAAM,WAAW,GAAG;IACzB;QACE,KAAK,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I,CAAC,EAAE,UAAU,EAAC,MAAM,gBAC9E,KAAC,oBAAoB,CAAC,QAAQ,aAAC,KAAK,EAAE,MAAM,gBAC1C,KAAC,OAAO,aACN,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,UAAC,IAAI;;gCACb,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;oCAC1D,QAAQ,uBAAM,KAAK,gBAAG,KAAK,CAAC,IAAI,IAAG,IAAI,OAAG,CAAC;iCAC5C;qCAAM;oCACG,IAAA,SAAS,GAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAtB,CAAuB;oCACxC,QAAQ,uBAAM,KAAK,gBAAG,KAAK,CAAC,IAAI,IAAG,SAAS,CAAC,IAAI,CAAC,OAAG,CAAC;iCACvD;4BACH,CAAC,gBAEA,OAAO,CAAC,IAAI,KAAK,UAAU;gCAC1B,CAAC,CAAC,KAAC,eAAe,IAAC,MAAM,wBAAO,KAAK,CAAC,QAAQ,KAAE,IAAI,EAAE,KAAK,CAAC,IAAI,cAAM;gCACtE,CAAC,CAAC,IAAI,YAEA,YACoB,YACvB,CACZ,CAAC;YACJ,CAAC,CAAC;YACJ,CAAC,CAAC,6EAAc,YAET,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { observer } from \"@formily/react\";\nimport { FormItem } from \"@formily/antd\";\nimport { Cascader, DatePicker, Input, InputNumber, Select } from \"antd\";\nimport { css } from \"@emotion/css\";\n\nimport { instructions, useNodeContext } from \"./nodes\";\nimport { useFlowContext } from \"./WorkflowCanvas\";\nimport { triggers } from \"./triggers\";\nimport { SchemaComponent, useCompile } from \"..\";\n\nfunction NullRender() {\n return null;\n}\n\nexport const calculators = [\n {\n value: 'boolean',\n title: '值比较',\n children: [\n { value: 'equal', name: '=' },\n { value: 'notEqual', name: '≠' },\n { value: 'gt', name: '>' },\n { value: 'gte', name: '≥' },\n { value: 'lt', name: '<' },\n { value: 'lte', name: '≤' }\n ]\n },\n {\n value: 'number',\n title: '算术运算',\n children: [\n { value: 'add', name: '+' },\n { value: 'minus', name: '-' },\n { value: 'multiple', name: '*' },\n { value: 'divide', name: '/' },\n { value: 'mod', name: '%' },\n ]\n },\n {\n value: 'string',\n title: '字符串',\n children: [\n { value: 'includes', name: '包含' },\n { value: 'notIncludes', name: '不包含' },\n { value: 'startsWith', name: '开头是' },\n { value: 'notStartsWith', name: '开头不是' },\n { value: 'endsWith', name: '结尾是' },\n { value: 'notEndsWith', name: '结尾不是' }\n ]\n },\n {\n value: 'date',\n title: '日期',\n children: []\n }\n];\n\nconst JT_VALUE_RE = /^\\s*\\{\\{([\\s\\S]*)\\}\\}\\s*$/;\n\nexport function parseStringValue(value: string, Types) {\n const matcher = value.match(JT_VALUE_RE);\n if (!matcher) {\n return { type: 'constant', value, options: { type: 'string' } };\n }\n\n const [type, ...paths] = matcher[1].split('.');\n\n return {\n type,\n options: paths.length ? (Types || VariableTypes)[type]?.parse(paths) : {}\n };\n}\n\nexport const BaseTypeSet = new Set(['boolean', 'number', 'string', 'date']);\n\nconst ConstantTypes = {\n string: {\n title: '字符串',\n value: 'string',\n component({ onChange, type, options, value }) {\n return (\n <Input\n value={value}\n onChange={ev => onChange({ value: ev.target.value, type, options })}\n />\n );\n },\n default: ''\n },\n number: {\n title: '数字',\n value: 'number',\n component({ onChange, type, options, value }) {\n return (\n <InputNumber\n value={value}\n onChange={v => onChange({ value: v, type, options })}\n />\n );\n },\n default: 0\n },\n boolean: {\n title: '逻辑值',\n value: 'boolean',\n component({ onChange, type, options, value }) {\n return (\n <Select value={value} onChange={v => onChange({ value: v, type, options })}>\n <Select.Option value={true}>真</Select.Option>\n <Select.Option value={false}>假</Select.Option>\n </Select>\n );\n },\n default: false\n },\n // date: {\n // title: '日期',\n // value: 'date',\n // component({ onChange, type, options, value }) {\n // return <DatePicker value={value} onChange={v => onChange({ value: v, type, options })}/>;\n // },\n // default: new Date()\n // }\n};\n\nexport const VariableTypes = {\n constant: {\n title: '常量',\n value: 'constant',\n options: Object.values(ConstantTypes).map(item => ({\n value: item.value,\n label: item.title\n })),\n component({ options = { type: 'string' } }) {\n return ConstantTypes[options.type]?.component ?? NullRender;\n },\n appendTypeValue({ options = { type: 'string' } }) {\n return options?.type ? [options.type] : [];\n },\n onTypeChange(old, [type, optionsType], onChange) {\n if (old?.options?.type === optionsType) {\n return;\n }\n const { default: value } = ConstantTypes[optionsType];\n onChange({\n value,\n type,\n options: { ...old.options, type: optionsType }\n });\n },\n parse(path) {\n return { path };\n }\n },\n $jobsMapByNodeId: {\n title: '节点数据',\n value: '$jobsMapByNodeId',\n options() {\n const node = useNodeContext();\n const stack = [];\n for (let current = node.upstream; current; current = current.upstream) {\n const { getter } = instructions.get(current.type);\n // Note: consider `getter` as the key of a value available node\n if (getter) {\n stack.push({\n value: current.id,\n label: current.title ?? `#${current.id}`\n });\n }\n }\n\n return stack;\n },\n component({ options }) {\n const { nodes } = useFlowContext();\n if (!options?.nodeId) {\n return NullRender;\n }\n const node = nodes.find(n => n.id == options.nodeId);\n if (!node) {\n return NullRender;\n }\n const instruction = instructions.get(node.type);\n return instruction?.getter ?? NullRender;\n },\n appendTypeValue({ options = {} }: { type: string, options: any }) {\n return options.nodeId ? [Number.parseInt(options.nodeId, 10)] : [];\n },\n onTypeChange(old, [type, nodeId], onChange) {\n onChange({\n // ...old,\n type,\n options: { nodeId }\n });\n },\n parse([nodeId, ...path]) {\n return { nodeId, path: path.join('.') };\n },\n stringify({ options }) {\n const stack = ['$jobsMapByNodeId'];\n if (options.nodeId) {\n stack.push(options.nodeId);\n if (options.path) {\n stack.push(options.path);\n }\n }\n return `{{${stack.join('.')}}}`;\n }\n },\n $context: {\n title: '触发数据',\n value: '$context',\n component() {\n const { workflow } = useFlowContext();\n const trigger = triggers.get(workflow.type);\n return trigger?.getter ?? NullRender;\n },\n parse([prefix, ...path]) {\n return { path: path.join('.') };\n },\n stringify({ options }) {\n const stack = ['$context'];\n if (options?.path) {\n stack.push(options.path);\n }\n return `{{${stack.join('.')}}}`;\n }\n },\n // calculation: Calculation\n};\n\nexport const VariableTypesContext = React.createContext(null);\n\nexport function useVariableTypes() {\n return React.useContext(VariableTypesContext);\n}\n\ninterface OperandProps {\n value: {\n type: string;\n value?: any;\n options?: any;\n };\n onChange(v: any): void;\n children?: React.ReactNode;\n}\n\nexport function Operand({\n value: operand = { type: 'constant', value: '', options: { type: 'string' } },\n onChange,\n children\n}: OperandProps) {\n const Types = useVariableTypes();\n\n const { type } = operand;\n\n const { component, appendTypeValue } = Types[type] || {};\n const VariableComponent = typeof component === 'function' ? component(operand) : NullRender;\n\n return (\n <div className={css`\n display: flex;\n gap: .5em;\n align-items: center;\n\n .ant-select,\n .ant-cascader-picker,\n .ant-picker,\n .ant-input-number,\n .ant-input-affix-wrapper{\n width: auto;\n }\n `}>\n <Cascader\n allowClear={false}\n value={[type, ...(appendTypeValue ? appendTypeValue(operand) : [])]}\n options={Object.values(Types).map((item: any) => {\n const options = typeof item.options === 'function' ? item.options() : item.options;\n return {\n label: item.title,\n value: item.value,\n children: options,\n disabled: options && !options.length,\n isLeaf: !options\n };\n })}\n onChange={(next: Array<string | number>) => {\n const { onTypeChange } = Types[next[0]];\n if (typeof onTypeChange === 'function') {\n onTypeChange(operand, next, onChange);\n } else {\n if (next[0] !== type) {\n onChange({ type: next[0], value: null });\n }\n }\n }}\n />\n {children ?? <VariableComponent {...operand} onChange={op => onChange({ ...op })} />}\n </div>\n );\n}\n\nexport function Calculation({ calculator, operands = [], onChange }) {\n return (\n <VariableTypesContext.Provider value={VariableTypes}>\n <div className={css`\n display: flex;\n gap: .5em;\n align-items: center;\n\n .ant-select{\n width: auto;\n min-width: 6em;\n }\n `}>\n <Operand value={operands[0]} onChange={(v => onChange({ calculator, operands: [v, operands[1]] }))} />\n {operands[0]\n ? (\n <>\n <Select value={calculator} onChange={v => onChange({ operands, calculator: v })}>\n {calculators.map(group => (\n <Select.OptGroup key={group.value} label={group.title}>\n {group.children.map(item => (\n <Select.Option key={item.value} value={item.value}>{item.name}</Select.Option>\n ))}\n </Select.OptGroup>\n ))}\n </Select>\n <Operand value={operands[1]} onChange={(v => onChange({ calculator, operands: [operands[0], v] }))} />\n </>\n )\n : null\n }\n </div>\n </VariableTypesContext.Provider>\n );\n}\n\nexport function VariableComponent({ value, onChange, renderSchemaComponent }) {\n const VTypes = { ...VariableTypes,\n constant: {\n title: '常量',\n value: 'constant',\n options: undefined\n }\n };\n\n const operand = typeof value === 'string'\n ? parseStringValue(value, VTypes)\n : { type: 'constant', value };\n\n return (\n <VariableTypesContext.Provider value={VTypes}>\n <Operand\n value={operand}\n onChange={(next) => {\n if (next.type !== operand.type && next.type === 'constant') {\n onChange(null);\n } else {\n const { stringify } = VTypes[next.type];\n onChange(stringify(next));\n }\n }}\n >\n {operand.type === 'constant' ? renderSchemaComponent() : null}\n </Operand>\n </VariableTypesContext.Provider>\n );\n}\n\n// NOTE: observer for watching useProps\nexport const CollectionFieldset = observer(({ value, onChange, useProps }: any) => {\n const { fields } = useProps();\n const compile = useCompile();\n\n const VTypes = { ...VariableTypes,\n constant: {\n title: '常量',\n value: 'constant',\n options: undefined\n }\n };\n\n return (\n <fieldset className={css`\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n `}>\n {fields.length\n ? fields\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)\n ))\n .map(field => {\n const operand = typeof value[field.name] === 'string'\n ? parseStringValue(value[field.name], VTypes)\n : { type: 'constant', value: value[field.name] };\n\n return (\n <FormItem label={compile(field.uiSchema?.title ?? field.name)} labelAlign=\"left\">\n <VariableTypesContext.Provider value={VTypes}>\n <Operand\n value={operand}\n onChange={(next) => {\n if (next.type !== operand.type && next.type === 'constant') {\n onChange({ ...value, [field.name]: null });\n } else {\n const { stringify } = VTypes[next.type];\n onChange({ ...value, [field.name]: stringify(next) });\n }\n }}\n >\n {operand.type === 'constant'\n ? <SchemaComponent schema={{ ...field.uiSchema, name: field.name }} />\n : null\n }\n </Operand>\n </VariableTypesContext.Provider>\n </FormItem>\n );\n })\n : <p>请先选择数据表</p>\n }\n </fieldset>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"file":"calculators.js","sourceRoot":"","sources":["../../src/workflow/calculators.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAc,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEjD,SAAS,UAAU;IACjB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,IAAM,WAAW,GAAG;IACzB;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE;YACR,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE;YAC7B,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE;YAChC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE;YAC3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AC;iCACvD;4BACH,CAAC,gBAEA,OAAO,CAAC,IAAI,KAAK,UAAU;gCAC1B,CAAC,CAAC,KAAC,eAAe,IAAC,MAAM,wBAAO,KAAK,CAAC,QAAQ,KAAE,IAAI,EAAE,KAAK,CAAC,IAAI,cAAM;gCACtE,CAAC,CAAC,IAAI,YAEA,YACoB,YACvB,CACZ,CAAC;YACJ,CAAC,CAAC;YACJ,CAAC,CAAC,6EAAc,YAET,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { observer } from \"@formily/react\";\nimport { FormItem } from \"@formily/antd\";\nimport { Cascader, DatePicker, Input, InputNumber, Select } from \"antd\";\nimport { css } from \"@emotion/css\";\n\nimport { instructions, useNodeContext } from \"./nodes\";\nimport { useFlowContext } from \"./WorkflowCanvas\";\nimport { triggers } from \"./triggers\";\nimport { SchemaComponent, useCompile } from \"..\";\n\nfunction NullRender() {\n return null;\n}\n\nexport const calculators = [\n {\n value: 'boolean',\n title: '值比较',\n children: [\n { value: 'equal', name: '=' },\n { value: 'notEqual', name: '≠' },\n { value: 'gt', name: '>' },\n { value: 'gte', name: '≥' },\n { value: 'lt', name: '<' },\n { value: 'lte', name: '≤' }\n ]\n },\n {\n value: 'number',\n title: '算术运算',\n children: [\n { value: 'add', name: '+' },\n { value: 'minus', name: '-' },\n { value: 'multiple', name: '*' },\n { value: 'divide', name: '/' },\n { value: 'mod', name: '%' },\n ]\n },\n {\n value: 'string',\n title: '字符串',\n children: [\n { value: 'includes', name: '包含' },\n { value: 'notIncludes', name: '不包含' },\n { value: 'startsWith', name: '开头是' },\n { value: 'notStartsWith', name: '开头不是' },\n { value: 'endsWith', name: '结尾是' },\n { value: 'notEndsWith', name: '结尾不是' }\n ]\n },\n {\n value: 'date',\n title: '日期',\n children: []\n }\n];\n\nconst JT_VALUE_RE = /^\\s*\\{\\{([\\s\\S]*)\\}\\}\\s*$/;\n\nexport function parseStringValue(value: string, Types) {\n const matcher = value.match(JT_VALUE_RE);\n if (!matcher) {\n return { type: 'constant', value, options: { type: 'string' } };\n }\n\n const [type, ...paths] = matcher[1].split('.');\n\n return {\n type,\n options: paths.length ? (Types || VariableTypes)[type]?.parse(paths) : {}\n };\n}\n\nexport const BaseTypeSet = new Set(['boolean', 'number', 'string', 'date']);\n\nconst ConstantTypes = {\n string: {\n title: '字符串',\n value: 'string',\n component({ onChange, type, options, value }) {\n return (\n <Input\n value={value}\n onChange={ev => onChange({ value: ev.target.value, type, options })}\n />\n );\n },\n default: ''\n },\n number: {\n title: '数字',\n value: 'number',\n component({ onChange, type, options, value }) {\n return (\n <InputNumber\n value={value}\n onChange={v => onChange({ value: v, type, options })}\n />\n );\n },\n default: 0\n },\n boolean: {\n title: '逻辑值',\n value: 'boolean',\n component({ onChange, type, options, value }) {\n return (\n <Select value={value} onChange={v => onChange({ value: v, type, options })}>\n <Select.Option value={true}>真</Select.Option>\n <Select.Option value={false}>假</Select.Option>\n </Select>\n );\n },\n default: false\n },\n // date: {\n // title: '日期',\n // value: 'date',\n // component({ onChange, type, options, value }) {\n // return <DatePicker value={value} onChange={v => onChange({ value: v, type, options })}/>;\n // },\n // default: new Date()\n // }\n};\n\nexport const VariableTypes = {\n constant: {\n title: '常量',\n value: 'constant',\n options: Object.values(ConstantTypes).map(item => ({\n value: item.value,\n label: item.title\n })),\n component({ options = { type: 'string' } }) {\n return ConstantTypes[options.type]?.component ?? NullRender;\n },\n appendTypeValue({ options = { type: 'string' } }) {\n return options?.type ? [options.type] : [];\n },\n onTypeChange(old, [type, optionsType], onChange) {\n if (old?.options?.type === optionsType) {\n return;\n }\n const { default: value } = ConstantTypes[optionsType];\n onChange({\n value,\n type,\n options: { ...old.options, type: optionsType }\n });\n },\n parse(path) {\n return { path };\n }\n },\n $jobsMapByNodeId: {\n title: '节点数据',\n value: '$jobsMapByNodeId',\n options() {\n const node = useNodeContext();\n const stack = [];\n for (let current = node.upstream; current; current = current.upstream) {\n const { getter } = instructions.get(current.type);\n // Note: consider `getter` as the key of a value available node\n if (getter) {\n stack.push({\n value: current.id,\n label: current.title ?? `#${current.id}`\n });\n }\n }\n\n return stack;\n },\n component({ options }) {\n const { nodes } = useFlowContext();\n if (!options?.nodeId) {\n return NullRender;\n }\n const node = nodes.find(n => n.id == options.nodeId);\n if (!node) {\n return NullRender;\n }\n const instruction = instructions.get(node.type);\n return instruction?.getter ?? NullRender;\n },\n appendTypeValue({ options = {} }: { type: string, options: any }) {\n return options.nodeId ? [Number.parseInt(options.nodeId, 10)] : [];\n },\n onTypeChange(old, [type, nodeId], onChange) {\n onChange({\n // ...old,\n type,\n options: { nodeId }\n });\n },\n parse([nodeId, ...path]) {\n return { nodeId, path: path.join('.') };\n },\n stringify({ options }) {\n const stack = ['$jobsMapByNodeId'];\n if (options.nodeId) {\n stack.push(options.nodeId);\n if (options.path) {\n stack.push(options.path);\n }\n }\n return `{{${stack.join('.')}}}`;\n }\n },\n $context: {\n title: '触发数据',\n value: '$context',\n component() {\n const { workflow } = useFlowContext();\n const trigger = triggers.get(workflow.type);\n return trigger?.getter ?? NullRender;\n },\n parse([prefix, ...path]) {\n return { path: path.join('.') };\n },\n stringify({ options }) {\n const stack = ['$context'];\n if (options?.path) {\n stack.push(options.path);\n }\n return `{{${stack.join('.')}}}`;\n }\n },\n // calculation: Calculation\n};\n\nexport const VariableTypesContext = React.createContext(null);\n\nexport function useVariableTypes() {\n return React.useContext(VariableTypesContext);\n}\n\ninterface OperandProps {\n value: {\n type: string;\n value?: any;\n options?: any;\n };\n onChange(v: any): void;\n children?: React.ReactNode;\n}\n\nexport function Operand({\n value: operand = { type: 'constant', value: '', options: { type: 'string' } },\n onChange,\n children\n}: OperandProps) {\n const Types = useVariableTypes();\n\n const { type } = operand;\n\n const { component, appendTypeValue } = Types[type] || {};\n const VariableComponent = typeof component === 'function' ? component(operand) : NullRender;\n\n return (\n <div className={css`\n display: flex;\n gap: .5em;\n align-items: center;\n\n .ant-select,\n .ant-cascader-picker,\n .ant-picker,\n .ant-input-number,\n .ant-input-affix-wrapper{\n width: auto;\n }\n `}>\n <Cascader\n allowClear={false}\n value={[type, ...(appendTypeValue ? appendTypeValue(operand) : [])]}\n options={Object.values(Types).map((item: any) => {\n const options = typeof item.options === 'function' ? item.options() : item.options;\n return {\n label: item.title,\n value: item.value,\n children: options,\n disabled: options && !options.length,\n isLeaf: !options\n };\n })}\n onChange={(next: Array<string | number>) => {\n const { onTypeChange } = Types[next[0]];\n if (typeof onTypeChange === 'function') {\n onTypeChange(operand, next, onChange);\n } else {\n if (next[0] !== type) {\n onChange({ type: next[0], value: null });\n }\n }\n }}\n />\n {children ?? <VariableComponent {...operand} onChange={op => onChange({ ...op })} />}\n </div>\n );\n}\n\nexport function Calculation({ calculator, operands = [], onChange }) {\n return (\n <VariableTypesContext.Provider value={VariableTypes}>\n <div className={css`\n display: flex;\n gap: .5em;\n align-items: center;\n\n .ant-select{\n width: auto;\n min-width: 6em;\n }\n `}>\n <Operand value={operands[0]} onChange={(v => onChange({ calculator, operands: [v, operands[1]] }))} />\n {operands[0]\n ? (\n <>\n <Select value={calculator} onChange={v => onChange({ operands, calculator: v })}>\n {calculators.map(group => (\n <Select.OptGroup key={group.value} label={group.title}>\n {group.children.map(item => (\n <Select.Option key={item.value} value={item.value}>{item.name}</Select.Option>\n ))}\n </Select.OptGroup>\n ))}\n </Select>\n <Operand value={operands[1]} onChange={(v => onChange({ calculator, operands: [operands[0], v] }))} />\n </>\n )\n : null\n }\n </div>\n </VariableTypesContext.Provider>\n );\n}\n\nexport function VariableComponent({ value, onChange, renderSchemaComponent }) {\n const VTypes = { ...VariableTypes,\n constant: {\n title: '常量',\n value: 'constant',\n options: undefined\n }\n };\n\n const operand = typeof value === 'string'\n ? parseStringValue(value, VTypes)\n : { type: 'constant', value };\n\n return (\n <VariableTypesContext.Provider value={VTypes}>\n <Operand\n value={operand}\n onChange={(next) => {\n if (next.type !== operand.type && next.type === 'constant') {\n onChange(null);\n } else {\n const { stringify } = VTypes[next.type];\n onChange(stringify(next));\n }\n }}\n >\n {operand.type === 'constant' ? renderSchemaComponent() : null}\n </Operand>\n </VariableTypesContext.Provider>\n );\n}\n\n// NOTE: observer for watching useProps\nexport const CollectionFieldset = observer(({ value, onChange, useProps }: any) => {\n const { fields } = useProps();\n const compile = useCompile();\n\n const VTypes = { ...VariableTypes,\n constant: {\n title: '常量',\n value: 'constant',\n options: undefined\n }\n };\n\n return (\n <fieldset className={css`\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n `}>\n {fields.length\n ? fields.map(field => {\n const operand = typeof value[field.name] === 'string'\n ? parseStringValue(value[field.name], VTypes)\n : { type: 'constant', value: value[field.name] };\n\n return (\n <FormItem label={compile(field.uiSchema?.title ?? field.name)} labelAlign=\"left\">\n <VariableTypesContext.Provider value={VTypes}>\n <Operand\n value={operand}\n onChange={(next) => {\n if (next.type !== operand.type && next.type === 'constant') {\n onChange({ ...value, [field.name]: null });\n } else {\n const { stringify } = VTypes[next.type];\n onChange({ ...value, [field.name]: stringify(next) });\n }\n }}\n >\n {operand.type === 'constant'\n ? <SchemaComponent schema={{ ...field.uiSchema, name: field.name }} />\n : null\n }\n </Operand>\n </VariableTypesContext.Provider>\n </FormItem>\n );\n })\n : <p>请先选择数据表</p>\n }\n </fieldset>\n );\n});\n"]}
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
type: 'create',
|
|
21
21
|
group: 'model',
|
|
22
22
|
fieldset: {
|
|
23
|
-
'config.collection': __assign({ name: 'config.collection' }
|
|
23
|
+
'config.collection': __assign(__assign({}, collection), { name: 'config.collection' }),
|
|
24
24
|
// multiple: {
|
|
25
25
|
// type: 'boolean',
|
|
26
26
|
// title: '多条数据',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/workflow/nodes/create.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,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AO,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 { Select } from 'antd';\nimport React from 'react';\nimport { useCollectionDataSource, useCollectionManager, useCompile } from '../..';\nimport { BaseTypeSet, CollectionFieldset } from '../calculators';\nimport { collection, values } from '../schemas/collection';\nimport { useFlowContext } from '../WorkflowCanvas';\n\n\nexport default {\n title: '新增数据',\n type: 'create',\n group: 'model',\n fieldset: {\n 'config.collection': {\n ...collection,\n name: 'config.collection'\n },\n // multiple: {\n // type: 'boolean',\n // title: '多条数据',\n // name: '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 values\n }\n }\n },\n view: {\n\n },\n scope: {\n useCollectionDataSource\n },\n components: {\n CollectionFieldset\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"]}
|
|
@@ -52,7 +52,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
53
53
|
import { CloseOutlined, DeleteOutlined } from '@ant-design/icons';
|
|
54
54
|
import { css, cx } from '@emotion/css';
|
|
55
|
-
import {
|
|
55
|
+
import { useForm } from '@formily/react';
|
|
56
56
|
import { Registry } from '@nocobase/utils';
|
|
57
57
|
import { Button, Modal, Tag } from 'antd';
|
|
58
58
|
import React, { useContext } from 'react';
|
|
@@ -160,15 +160,10 @@ export function RemoveButton() {
|
|
|
160
160
|
}
|
|
161
161
|
return (_jsx(Button, { type: "text", shape: "circle", icon: _jsx(DeleteOutlined, {}, void 0), onClick: onRemove, className: "workflow-node-remove-button" }, void 0));
|
|
162
162
|
}
|
|
163
|
-
function Fieldset(_a) {
|
|
164
|
-
var schema = _a.schema;
|
|
165
|
-
var field = useField();
|
|
166
|
-
return (_jsx(RecursionField, { basePath: field.address, schema: schema }, void 0));
|
|
167
|
-
}
|
|
168
163
|
export function NodeDefaultView(props) {
|
|
169
164
|
var data = props.data, children = props.children;
|
|
170
165
|
var instruction = instructions.get(data.type);
|
|
171
|
-
return (_jsx(NodeContext.Provider, __assign({ value: data }, { children: _jsxs("div", __assign({ className: cx(nodeClass, "workflow-node-type-" + data.type) }, { children: [_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsxs("div", __assign({ className: cx(nodeHeaderClass) }, { children: [_jsxs("h4", __assign({ className: cx(nodeTitleClass) }, { children: [_jsx(Tag, { children: instruction.title }, void 0), _jsx("strong", { children: data.title }, void 0), _jsxs("span", __assign({ className: "workflow-node-id" }, { children: ["#", data.id] }), void 0)] }), void 0), _jsx(RemoveButton, {}, void 0)] }), void 0), _jsx(SchemaComponent, { scope: instruction.scope, components:
|
|
166
|
+
return (_jsx(NodeContext.Provider, __assign({ value: data }, { children: _jsxs("div", __assign({ className: cx(nodeClass, "workflow-node-type-" + data.type) }, { children: [_jsxs("div", __assign({ className: cx(nodeCardClass) }, { children: [_jsxs("div", __assign({ className: cx(nodeHeaderClass) }, { children: [_jsxs("h4", __assign({ className: cx(nodeTitleClass) }, { children: [_jsx(Tag, { children: instruction.title }, void 0), _jsx("strong", { children: data.title }, void 0), _jsxs("span", __assign({ className: "workflow-node-id" }, { children: ["#", data.id] }), void 0)] }), void 0), _jsx(RemoveButton, {}, void 0)] }), void 0), _jsx(SchemaComponent, { scope: instruction.scope, components: instruction.components, schema: {
|
|
172
167
|
type: 'void',
|
|
173
168
|
properties: {
|
|
174
169
|
view: instruction.view,
|
|
@@ -187,9 +182,9 @@ export function NodeDefaultView(props) {
|
|
|
187
182
|
'x-decorator': 'Form',
|
|
188
183
|
'x-decorator-props': {
|
|
189
184
|
useValues: function (options) {
|
|
190
|
-
var
|
|
185
|
+
var d = useNodeContext();
|
|
191
186
|
return useRequest(function () {
|
|
192
|
-
return Promise.resolve({ data:
|
|
187
|
+
return Promise.resolve({ data: d });
|
|
193
188
|
}, options);
|
|
194
189
|
}
|
|
195
190
|
},
|
|
@@ -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;AAEvC,OAAO,EAAW,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC5E,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,EA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KAAK,EAAE;wDACL,IAAI,EAAE,QAAQ;wDACd,IAAI,EAAE,OAAO;wDACb,KAAK,EAAE,MAAM;wDACb,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 { Field } from '@formily/core';\nimport { ISchema, RecursionField, useField, 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';\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\n\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\nfunction Fieldset({ schema }) {\n const field = useField<Field>();\n\n return (\n <RecursionField basePath={field.address} schema={schema} />\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={{\n ...instruction.components,\n Fieldset\n }}\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 data = useNodeContext();\n return useRequest(() => {\n return Promise.resolve({ data });\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,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,MAAM,UAAU,CAAC;AAgB7B,CAAC;AAEF,MAAM,C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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"]}
|
|
@@ -30,7 +30,9 @@ export var values = {
|
|
|
30
30
|
var _a;
|
|
31
31
|
var getCollectionFields = useCollectionManager().getCollectionFields;
|
|
32
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)
|
|
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)); });
|
|
34
36
|
return { fields: fields };
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -47,8 +49,9 @@ export var filter = {
|
|
|
47
49
|
'x-component': 'Filter',
|
|
48
50
|
'x-component-props': {
|
|
49
51
|
useProps: function () {
|
|
52
|
+
var _a;
|
|
50
53
|
var values = useForm().values;
|
|
51
|
-
var options = useCollectionFilterOptions(values.config.collection);
|
|
54
|
+
var options = useCollectionFilterOptions((_a = values.config) === null || _a === void 0 ? void 0 : _a.collection);
|
|
52
55
|
return {
|
|
53
56
|
options: options,
|
|
54
57
|
className: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n "], ["\n position: relative;\n width: 100%;\n "])))
|
|
@@ -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,C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AAC,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"]}
|
|
@@ -68,9 +68,7 @@ function useUpdateConfigAction() {
|
|
|
68
68
|
_a.sent();
|
|
69
69
|
return [4 /*yield*/, api.resource('workflows', record.id).update({
|
|
70
70
|
filterByTk: record.id,
|
|
71
|
-
values:
|
|
72
|
-
config: __assign(__assign({}, record.config), form.values)
|
|
73
|
-
},
|
|
71
|
+
values: form.values
|
|
74
72
|
})];
|
|
75
73
|
case 2:
|
|
76
74
|
_a.sent();
|
|
@@ -106,9 +104,17 @@ export var TriggerConfig = function () {
|
|
|
106
104
|
'x-component': 'Action.Drawer',
|
|
107
105
|
'x-decorator': 'Form',
|
|
108
106
|
'x-decorator-props': {
|
|
109
|
-
initialValue: config
|
|
107
|
+
initialValue: { config: config }
|
|
110
108
|
},
|
|
111
|
-
properties:
|
|
109
|
+
properties: {
|
|
110
|
+
config: {
|
|
111
|
+
type: 'void',
|
|
112
|
+
name: 'config',
|
|
113
|
+
'x-component': 'fieldset',
|
|
114
|
+
'x-component-props': {},
|
|
115
|
+
properties: fieldset
|
|
116
|
+
},
|
|
117
|
+
actions: {
|
|
112
118
|
type: 'void',
|
|
113
119
|
'x-component': 'Action.Drawer.Footer',
|
|
114
120
|
properties: {
|
|
@@ -128,7 +134,8 @@ export var TriggerConfig = function () {
|
|
|
128
134
|
}
|
|
129
135
|
}
|
|
130
136
|
}
|
|
131
|
-
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
}, scope: scope }, void 0)] }), void 0));
|
|
@@ -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,
|
|
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;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9B,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, 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,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { useCollectionDataSource } from '../../collection-manager';
|
|
3
|
+
declare function useCollectionFieldsDataSource(): (field: any) => void;
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
6
|
type: string;
|
|
6
7
|
fieldset: {
|
|
7
|
-
collection: {
|
|
8
|
+
'config.collection': {
|
|
8
9
|
type: string;
|
|
9
10
|
title: string;
|
|
10
11
|
name: string;
|
|
@@ -13,7 +14,7 @@ declare const _default: {
|
|
|
13
14
|
'x-decorator': string;
|
|
14
15
|
'x-component': string;
|
|
15
16
|
};
|
|
16
|
-
mode: {
|
|
17
|
+
'config.mode': {
|
|
17
18
|
type: string;
|
|
18
19
|
title: string;
|
|
19
20
|
name: string;
|
|
@@ -26,10 +27,22 @@ declare const _default: {
|
|
|
26
27
|
}[];
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
-
title: string;
|
|
30
|
+
'config.changed': {
|
|
31
31
|
type: string;
|
|
32
32
|
name: string;
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
'x-decorator': string;
|
|
36
|
+
'x-component': string;
|
|
37
|
+
'x-component-props': {
|
|
38
|
+
mode: string;
|
|
39
|
+
};
|
|
40
|
+
'x-reactions': string[];
|
|
41
|
+
};
|
|
42
|
+
'config.condition': {
|
|
43
|
+
name: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: string;
|
|
33
46
|
'x-decorator': string;
|
|
34
47
|
'x-decorator-props': {
|
|
35
48
|
labelAlign: string;
|
|
@@ -47,6 +60,7 @@ declare const _default: {
|
|
|
47
60
|
};
|
|
48
61
|
scope: {
|
|
49
62
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
63
|
+
useCollectionFieldsDataSource: typeof useCollectionFieldsDataSource;
|
|
50
64
|
};
|
|
51
65
|
getter({ type, options, onChange }: {
|
|
52
66
|
type: any;
|
|
@@ -11,20 +11,43 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Select } from 'antd';
|
|
14
|
+
import { action } from '@formily/reactive';
|
|
15
|
+
import { useForm } from '@formily/react';
|
|
14
16
|
import { useCollectionDataSource, useCollectionManager } from '../../collection-manager';
|
|
15
17
|
import { useCompile } from '../../schema-component';
|
|
16
18
|
import { useFlowContext } from '../WorkflowCanvas';
|
|
17
19
|
import { BaseTypeSet } from '../calculators';
|
|
18
20
|
import { collection, filter } from '../schemas/collection';
|
|
21
|
+
function useCollectionFieldsDataSource() {
|
|
22
|
+
var _a;
|
|
23
|
+
var compile = useCompile();
|
|
24
|
+
var getCollectionFields = useCollectionManager().getCollectionFields;
|
|
25
|
+
var values = useForm().values;
|
|
26
|
+
var fields = getCollectionFields((_a = values === null || values === void 0 ? void 0 : values.config) === null || _a === void 0 ? void 0 : _a.collection);
|
|
27
|
+
return function (field) {
|
|
28
|
+
action.bound(function (data) {
|
|
29
|
+
field.dataSource = data
|
|
30
|
+
.filter(function (field) { return (!field.hidden
|
|
31
|
+
&& (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)); })
|
|
32
|
+
.map(function (field) {
|
|
33
|
+
var _a;
|
|
34
|
+
return ({
|
|
35
|
+
label: compile((_a = field.uiSchema) === null || _a === void 0 ? void 0 : _a.title),
|
|
36
|
+
value: field.name
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
})(fields);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
19
42
|
export default {
|
|
20
43
|
title: '数据表事件',
|
|
21
44
|
type: 'model',
|
|
22
45
|
fieldset: {
|
|
23
|
-
collection: collection,
|
|
24
|
-
mode: {
|
|
46
|
+
'config.collection': collection,
|
|
47
|
+
'config.mode': {
|
|
25
48
|
type: 'number',
|
|
26
49
|
title: '触发时机',
|
|
27
|
-
name: 'mode',
|
|
50
|
+
name: 'config.mode',
|
|
28
51
|
'x-decorator': 'FormItem',
|
|
29
52
|
'x-component': 'Select',
|
|
30
53
|
'x-component-props': {
|
|
@@ -36,10 +59,25 @@ export default {
|
|
|
36
59
|
]
|
|
37
60
|
}
|
|
38
61
|
},
|
|
39
|
-
|
|
62
|
+
'config.changed': {
|
|
63
|
+
type: 'array',
|
|
64
|
+
name: 'changed',
|
|
65
|
+
title: '发生变动的字段',
|
|
66
|
+
description: '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',
|
|
67
|
+
'x-decorator': 'FormItem',
|
|
68
|
+
'x-component': 'Select',
|
|
69
|
+
'x-component-props': {
|
|
70
|
+
mode: 'multiple',
|
|
71
|
+
},
|
|
72
|
+
'x-reactions': [
|
|
73
|
+
'{{useCollectionFieldsDataSource()}}'
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
'config.condition': __assign(__assign({}, filter), { name: 'config.condition', title: '满足条件' })
|
|
40
77
|
},
|
|
41
78
|
scope: {
|
|
42
|
-
useCollectionDataSource: useCollectionDataSource
|
|
79
|
+
useCollectionDataSource: useCollectionDataSource,
|
|
80
|
+
useCollectionFieldsDataSource: useCollectionFieldsDataSource
|
|
43
81
|
},
|
|
44
82
|
getter: function (_a) {
|
|
45
83
|
var _b, _c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/workflow/triggers/model.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/workflow/triggers/model.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,SAAS,6BAA6B;;IACpC,IAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IACrB,IAAA,mBAAmB,GAAK,oBAAoB,EAAE,oBAA3B,CAA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AE,EAAE,CAAC,CAAC;YACpE,CAAC,gBAEA,UAAU,CAAC,MAAM;iBACf,MAAM,CAAC,UAAA,KAAK,YAAI,OAAA,WAAW,CAAC,GAAG,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,0CAAE,IAAI,CAAC,CAAA,EAAA,CAAC;iBACvD,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';\nimport { action } from '@formily/reactive';\nimport { useForm } from '@formily/react';\n\nimport { useCollectionDataSource, useCollectionManager } from '../../collection-manager';\nimport { useCompile } from '../../schema-component';\n\nimport { useFlowContext } from '../WorkflowCanvas';\nimport { BaseTypeSet } from '../calculators';\nimport { collection, filter } from '../schemas/collection';\n\nfunction useCollectionFieldsDataSource() {\n const compile = useCompile();\n const { getCollectionFields } = useCollectionManager();\n const { values } = useForm();\n const fields = getCollectionFields(values?.config?.collection);\n\n return (field: any) => {\n action.bound((data: any) => {\n field.dataSource = data\n .filter(field => (\n !field.hidden\n && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)\n ))\n .map(field => ({\n label: compile(field.uiSchema?.title),\n value: field.name\n }));\n })(fields);\n };\n}\n\nexport default {\n title: '数据表事件',\n type: 'model',\n fieldset: {\n 'config.collection': collection,\n 'config.mode': {\n type: 'number',\n title: '触发时机',\n name: 'config.mode',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n options: [\n { value: 1, label: '新增数据后' },\n { value: 2, label: '更新数据后' },\n { value: 3, label: '新增或更新数据后' },\n { value: 4, label: '删除数据后' }\n ]\n }\n },\n 'config.changed': {\n type: 'array',\n name: 'changed',\n title: '发生变动的字段',\n description: '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',\n 'x-decorator': 'FormItem',\n 'x-component': 'Select',\n 'x-component-props': {\n mode: 'multiple',\n },\n 'x-reactions': [\n '{{useCollectionFieldsDataSource()}}'\n ]\n },\n 'config.condition': {\n ...filter,\n name: 'config.condition',\n title: '满足条件'\n }\n },\n scope: {\n useCollectionDataSource,\n useCollectionFieldsDataSource\n },\n getter({ type, options, onChange }) {\n const compile = useCompile();\n const { collections = [] } = useCollectionManager();\n const { workflow } = useFlowContext();\n const collection = collections.find(item => item.name === workflow.config.collection) ?? { fields: [] };\n\n return (\n <Select\n placeholder=\"选择字段\"\n value={options?.path?.replace(/^data\\./, '')}\n onChange={(path) => {\n onChange({ type, options: { ...options, path: `data.${path}` } });\n }}\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"]}
|
|
@@ -342,10 +342,7 @@ exports.CollectionFieldset = (0, react_2.observer)(function (_a) {
|
|
|
342
342
|
options: undefined
|
|
343
343
|
} });
|
|
344
344
|
return ((0, jsx_runtime_1.jsx)("fieldset", __assign({ className: (0, css_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n "], ["\n margin-top: .5em;\n\n > .ant-formily-item{\n flex-direction: column;\n\n > .ant-formily-item-label{\n line-height: 32px;\n }\n }\n "]))) }, { children: fields.length
|
|
345
|
-
? fields
|
|
346
|
-
.filter(function (field) { return (!field.hidden
|
|
347
|
-
&& (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true)); })
|
|
348
|
-
.map(function (field) {
|
|
345
|
+
? fields.map(function (field) {
|
|
349
346
|
var _a, _b;
|
|
350
347
|
var operand = typeof value[field.name] === 'string'
|
|
351
348
|
? parseStringValue(value[field.name], VTypes)
|