@coding-flow/flow-design 0.0.51 → 0.0.53

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 (38) hide show
  1. package/dist/components/design-editor/node-components/action/presenter.js +1 -3
  2. package/dist/components/design-editor/node-components/condition/index.js +5 -1
  3. package/dist/components/design-editor/node-components/node-order/index.js +5 -2
  4. package/dist/components/design-editor/node-components/strategy/advice.js +9 -2
  5. package/dist/components/design-editor/node-components/strategy/deplay.js +9 -2
  6. package/dist/components/design-editor/node-components/strategy/error-trigger.js +5 -2
  7. package/dist/components/design-editor/node-components/strategy/multi-operator-audit.js +27 -2
  8. package/dist/components/design-editor/node-components/strategy/node-title.js +5 -1
  9. package/dist/components/design-editor/node-components/strategy/operator-load.js +23 -4
  10. package/dist/components/design-editor/node-components/strategy/record-merge.js +5 -1
  11. package/dist/components/design-editor/node-components/strategy/resubmit.js +15 -1
  12. package/dist/components/design-editor/node-components/strategy/revoke.js +19 -2
  13. package/dist/components/design-editor/node-components/strategy/router.js +5 -1
  14. package/dist/components/design-editor/node-components/strategy/same-operator-audit.js +15 -1
  15. package/dist/components/design-editor/node-components/strategy/sub-process.js +9 -2
  16. package/dist/components/design-editor/node-components/strategy/timeout.js +23 -2
  17. package/dist/components/design-editor/node-components/strategy/trigger.js +5 -1
  18. package/dist/components/design-editor/node-components/view/index.js +5 -1
  19. package/dist/components/design-panel/panels/workflow/interfere.js +5 -2
  20. package/dist/components/design-panel/panels/workflow/urge.js +9 -4
  21. package/dist/components/design-panel/tabs/base/index.js +17 -4
  22. package/dist/components/design-panel/tabs/form/attrubute.js +4 -3
  23. package/dist/components/design-panel/tabs/form/form-type.js +5 -1
  24. package/dist/components/design-panel/tabs/form/index.js +9 -4
  25. package/dist/components/design-panel/tabs/form/model.js +34 -9
  26. package/dist/components/design-panel/tabs/form/sub-form.js +9 -2
  27. package/dist/components/field-tip/field-tip.module.js +13 -0
  28. package/dist/components/field-tip/field-tip_module.css +58 -0
  29. package/dist/components/field-tip/index.d.ts +24 -0
  30. package/dist/components/field-tip/index.js +53 -0
  31. package/dist/script-components/components/groovy-script-loader.js +16 -0
  32. package/dist/script-components/components/sub-process/index.js +1 -1
  33. package/dist/script-components/components/sub-process/models/index.d.ts +5 -1
  34. package/dist/script-components/components/sub-process/models/index.js +10 -2
  35. package/dist/script-components/components/sub-process/presenters/target-workflow-presenter.js +2 -2
  36. package/dist/script-components/modal/sub-process-config-modal.js +1 -1
  37. package/dist/script-components/modal/trigger-config-modal.js +1 -1
  38. package/package.json +7 -7
@@ -42,9 +42,7 @@ class FlowActionListPresenter {
42
42
  update(action) {
43
43
  const actionId = action.id;
44
44
  const actionIdList = this.data.map((action)=>action.id);
45
- console.log('actionIdList:', actionIdList);
46
- console.log('action:', action);
47
- if (actionIdList.indexOf(actionId) > 0) {
45
+ if (actionIdList.includes(actionId)) {
48
46
  const data = this.data.map((item)=>{
49
47
  if (item.id === actionId) return {
50
48
  ...item,
@@ -7,6 +7,7 @@ import { EditOutlined } from "@ant-design/icons";
7
7
  import { ConditionConfigModal } from "../../../../script-components/modal/condition-config-modal.js";
8
8
  import { useScriptVariables } from "../../hooks/use-script-variables.js";
9
9
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
10
+ import { FieldTip } from "../../../field-tip/index.js";
10
11
  const ConditionConfigContent = (props)=>{
11
12
  const [visible, setVisible] = react.useState(false);
12
13
  const scriptVariables = useScriptVariables();
@@ -53,7 +54,10 @@ const ConditionScript = ()=>{
53
54
  },
54
55
  layout: "vertical",
55
56
  children: /*#__PURE__*/ jsx(Form.Item, {
56
- label: "条件表达式",
57
+ label: /*#__PURE__*/ jsx(FieldTip, {
58
+ label: "条件表达式",
59
+ description: "条件分支的判断脚本,返回 true 时流程走该分支。"
60
+ }),
57
61
  name: "script",
58
62
  children: /*#__PURE__*/ jsx(Field, {
59
63
  name: "script",
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Field } from "@flowgram.ai/fixed-layout-editor";
4
4
  import { Form, Input } from "antd";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const NodeOrder = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsx(Form, {
@@ -11,9 +12,11 @@ const NodeOrder = ()=>{
11
12
  },
12
13
  layout: "vertical",
13
14
  children: /*#__PURE__*/ jsx(Form.Item, {
14
- label: "优先级",
15
+ label: /*#__PURE__*/ jsx(FieldTip, {
16
+ label: "优先级",
17
+ description: "数字越小优先级越高。当多个分支或节点可同时执行时,按此排序。"
18
+ }),
15
19
  name: "order",
16
- tooltip: "数字越小优先级越高",
17
20
  children: /*#__PURE__*/ jsx(Field, {
18
21
  name: "order",
19
22
  render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(Input, {
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Switch } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const AdviceStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsxs(Form, {
@@ -12,7 +13,10 @@ const AdviceStrategy = ()=>{
12
13
  layout: "vertical",
13
14
  children: [
14
15
  /*#__PURE__*/ jsx(Form.Item, {
15
- label: "审批意见是否必填",
16
+ label: /*#__PURE__*/ jsx(FieldTip, {
17
+ label: "审批意见是否必填",
18
+ description: "开启后,审批人提交审批时必须填写审批意见。"
19
+ }),
16
20
  name: [
17
21
  "AdviceStrategy",
18
22
  "adviceRequired"
@@ -28,7 +32,10 @@ const AdviceStrategy = ()=>{
28
32
  })
29
33
  }),
30
34
  /*#__PURE__*/ jsx(Form.Item, {
31
- label: "审批签名是否必填",
35
+ label: /*#__PURE__*/ jsx(FieldTip, {
36
+ label: "审批签名是否必填",
37
+ description: "开启后,审批人提交审批时必须完成签名。"
38
+ }),
32
39
  name: [
33
40
  "AdviceStrategy",
34
41
  "signRequired"
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Input, Select } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const DelayStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsxs(Form, {
@@ -12,7 +13,10 @@ const DelayStrategy = ()=>{
12
13
  layout: "vertical",
13
14
  children: [
14
15
  /*#__PURE__*/ jsx(Form.Item, {
15
- label: "延迟时间类型",
16
+ label: /*#__PURE__*/ jsx(FieldTip, {
17
+ label: "延迟时间类型",
18
+ description: "延迟时间的计量单位(秒、分、时、天)。"
19
+ }),
16
20
  name: [
17
21
  "DelayStrategy",
18
22
  "type"
@@ -44,7 +48,10 @@ const DelayStrategy = ()=>{
44
48
  })
45
49
  }),
46
50
  /*#__PURE__*/ jsx(Form.Item, {
47
- label: "延迟时间",
51
+ label: /*#__PURE__*/ jsx(FieldTip, {
52
+ label: "延迟时间",
53
+ description: "节点执行的延迟时长,需配合延迟时间类型一起使用。"
54
+ }),
48
55
  name: [
49
56
  "DelayStrategy",
50
57
  "time"
@@ -6,6 +6,7 @@ import { GroovyScriptPreview } from "../../../../script-components/components/gr
6
6
  import { EditOutlined } from "@ant-design/icons";
7
7
  import { ErrorTriggerConfigModal } from "../../../../script-components/modal/error-trigger-config-modal.js";
8
8
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
9
+ import { FieldTip } from "../../../field-tip/index.js";
9
10
  const ErrorTriggerConfigContent = (props)=>{
10
11
  const [visible, setVisible] = react.useState(false);
11
12
  const value = props.value || '';
@@ -51,12 +52,14 @@ const ErrorTriggerStrategy = ()=>{
51
52
  },
52
53
  layout: "vertical",
53
54
  children: /*#__PURE__*/ jsx(Form.Item, {
54
- label: "异常配置",
55
+ label: /*#__PURE__*/ jsx(FieldTip, {
56
+ label: "异常配置",
57
+ description: "当节点未能匹配到任何操作人时触发的脚本配置,可用于兜底处理。"
58
+ }),
55
59
  name: [
56
60
  "ErrorTriggerStrategy",
57
61
  "script"
58
62
  ],
59
- tooltip: "在没有匹配到操作人时触发的脚本配置",
60
63
  children: /*#__PURE__*/ jsx(Field, {
61
64
  name: "ErrorTriggerStrategy.script",
62
65
  render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(GroovyScriptLoader, {
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import react from "react";
3
3
  import { Form, Input, Select } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const MultiOperatorAuditStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  const [percentVisible, setPercentVisible] = react.useState(false);
@@ -13,7 +14,28 @@ const MultiOperatorAuditStrategy = ()=>{
13
14
  layout: "vertical",
14
15
  children: [
15
16
  /*#__PURE__*/ jsx(Form.Item, {
16
- label: "多人审批策略",
17
+ label: /*#__PURE__*/ jsx(FieldTip, {
18
+ label: "多人审批策略",
19
+ description: "当节点有多个审批人时,决定审批结果的判定方式。",
20
+ items: [
21
+ {
22
+ label: "循序提交",
23
+ detail: "多个审批人按顺序依次审批。"
24
+ },
25
+ {
26
+ label: "合并审核",
27
+ detail: "按会签通过百分比合并判定(需设置百分比)。"
28
+ },
29
+ {
30
+ label: "任意审核",
31
+ detail: "任意一位审批人审核后即流转。"
32
+ },
33
+ {
34
+ label: "任意一人",
35
+ detail: "随机指定一位审批人进行审核。"
36
+ }
37
+ ]
38
+ }),
17
39
  name: [
18
40
  "MultiOperatorAuditStrategy",
19
41
  "type"
@@ -48,7 +70,10 @@ const MultiOperatorAuditStrategy = ()=>{
48
70
  })
49
71
  }),
50
72
  percentVisible && /*#__PURE__*/ jsx(Form.Item, {
51
- label: "会签通过百分比",
73
+ label: /*#__PURE__*/ jsx(FieldTip, {
74
+ label: "会签通过比例",
75
+ description: "合并审核时,通过人数达到该比例才视为该节点通过,取值 0~1 的小数(如 0.5 表示半数通过)。"
76
+ }),
52
77
  name: [
53
78
  "MultiOperatorAuditStrategy",
54
79
  "percent"
@@ -7,6 +7,7 @@ import { GroovyScriptPreview } from "../../../../script-components/components/gr
7
7
  import { NodeTitleConfigModal } from "../../../../script-components/modal/node-title-config-modal.js";
8
8
  import { useScriptVariables } from "../../hooks/use-script-variables.js";
9
9
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
10
+ import { FieldTip } from "../../../field-tip/index.js";
10
11
  const NodeTitleConfigContent = (props)=>{
11
12
  const [visible, setVisible] = react.useState(false);
12
13
  const scriptVariables = useScriptVariables();
@@ -49,7 +50,10 @@ const NodeTitleStrategy = ()=>/*#__PURE__*/ jsx(Fragment, {
49
50
  },
50
51
  layout: "vertical",
51
52
  children: /*#__PURE__*/ jsx(Form.Item, {
52
- label: "节点标题",
53
+ label: /*#__PURE__*/ jsx(FieldTip, {
54
+ label: "待办标题",
55
+ description: "通过脚本设置待办消息的展示标题。"
56
+ }),
53
57
  children: /*#__PURE__*/ jsx(Field, {
54
58
  name: "NodeTitleStrategy.script",
55
59
  render: (props)=>{
@@ -6,6 +6,7 @@ import { EditOutlined } from "@ant-design/icons";
6
6
  import { GroovyScriptPreview } from "../../../../script-components/components/groovy-script-preview.js";
7
7
  import { OperatorLoadConfigModal } from "../../../../script-components/modal/operator-load-config-modal.js";
8
8
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
9
+ import { FieldTip } from "../../../field-tip/index.js";
9
10
  const SELECT_TYPE_OPTIONS = [
10
11
  {
11
12
  label: '脚本指定',
@@ -66,12 +67,28 @@ const OperatorLoadStrategy = ()=>{
66
67
  layout: "vertical",
67
68
  children: [
68
69
  /*#__PURE__*/ jsx(Form.Item, {
69
- label: "操作人设定方式",
70
+ label: /*#__PURE__*/ jsx(FieldTip, {
71
+ label: "操作人设定方式",
72
+ description: "选择该节点操作人的指定方式。",
73
+ items: [
74
+ {
75
+ label: "脚本指定",
76
+ detail: "通过脚本计算得出操作人。"
77
+ },
78
+ {
79
+ label: "发起人设定",
80
+ detail: "由发起人在提交时选择操作人。"
81
+ },
82
+ {
83
+ label: "审批人设定",
84
+ detail: "由上一审批人在审批时选择操作人。"
85
+ }
86
+ ]
87
+ }),
70
88
  name: [
71
89
  "OperatorLoadStrategy",
72
90
  "selectType"
73
91
  ],
74
- tooltip: "选择操作人的指定方式",
75
92
  children: /*#__PURE__*/ jsx(Field, {
76
93
  name: "OperatorLoadStrategy.selectType",
77
94
  render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(Select, {
@@ -86,12 +103,14 @@ const OperatorLoadStrategy = ()=>{
86
103
  render: ({ field: { value: selectType } })=>{
87
104
  const isRangeMode = 'INITIATOR_SELECT' === selectType || 'APPROVER_SELECT' === selectType;
88
105
  return /*#__PURE__*/ jsx(Form.Item, {
89
- label: isRangeMode ? "设定人员范围" : "当前操作人",
106
+ label: /*#__PURE__*/ jsx(FieldTip, {
107
+ label: isRangeMode ? "设定人员范围" : "当前操作人",
108
+ description: isRangeMode ? "设定可选人员范围,留空表示不限范围(可选任意人)。" : "通过脚本设定该节点的操作人。"
109
+ }),
90
110
  name: [
91
111
  "OperatorLoadStrategy",
92
112
  "script"
93
113
  ],
94
- tooltip: isRangeMode ? "设定可选人员范围,留空表示不限范围(可选任意人)" : "设定流程的审批人",
95
114
  children: /*#__PURE__*/ jsx(Field, {
96
115
  name: "OperatorLoadStrategy.script",
97
116
  render: ({ field: { value, onChange } })=>/*#__PURE__*/ jsx(GroovyScriptLoader, {
@@ -2,6 +2,7 @@ import { Fragment, jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Switch } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const RecordMergeStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsx(Form, {
@@ -11,7 +12,10 @@ const RecordMergeStrategy = ()=>{
11
12
  },
12
13
  layout: "vertical",
13
14
  children: /*#__PURE__*/ jsx(Form.Item, {
14
- label: "启用记录合并",
15
+ label: /*#__PURE__*/ jsx(FieldTip, {
16
+ label: "启用合并审批",
17
+ description: "开启后,当流程流转到该节点时,同一流程下的多条审批记录将自动合并到一起进行审批。"
18
+ }),
15
19
  name: [
16
20
  "RecordMergeStrategy",
17
21
  "enable"
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Select } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const ResubmitStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsx(Form, {
@@ -11,7 +12,20 @@ const ResubmitStrategy = ()=>{
11
12
  },
12
13
  layout: "vertical",
13
14
  children: /*#__PURE__*/ jsx(Form.Item, {
14
- label: "重新提交配置",
15
+ label: /*#__PURE__*/ jsx(FieldTip, {
16
+ label: "重新提交配置",
17
+ description: "审批被退回后,重新提交时的流转方式。",
18
+ items: [
19
+ {
20
+ label: "跳转到撤回节点",
21
+ detail: "退回后直接跳转到上次撤回的节点继续审批。"
22
+ },
23
+ {
24
+ label: "从头逐级提交",
25
+ detail: "退回后回到流程起点,逐级重新提交审批。"
26
+ }
27
+ ]
28
+ }),
15
29
  name: [
16
30
  "ResubmitStrategy",
17
31
  "type"
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import react from "react";
3
3
  import { Form, Select, Switch } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const RevokeStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  const [enable, setEnable] = react.useState(false);
@@ -13,7 +14,10 @@ const RevokeStrategy = ()=>{
13
14
  layout: "vertical",
14
15
  children: [
15
16
  /*#__PURE__*/ jsx(Form.Item, {
16
- label: "启动撤回功能",
17
+ label: /*#__PURE__*/ jsx(FieldTip, {
18
+ label: "启动撤回功能",
19
+ description: "开启后,审批人在自己审批通过后可发起撤回,撤回时流程回到本节点重新审批。"
20
+ }),
17
21
  name: [
18
22
  "RevokeStrategy",
19
23
  "enable"
@@ -30,7 +34,20 @@ const RevokeStrategy = ()=>{
30
34
  })
31
35
  }),
32
36
  enable && /*#__PURE__*/ jsx(Form.Item, {
33
- label: "撤回方式",
37
+ label: /*#__PURE__*/ jsx(FieldTip, {
38
+ label: "撤回方式",
39
+ description: "审批人在自己审批通过后可发起撤回,撤回后流程回到本节点重新审批。仅“已通过”状态且由原审批人发起时有效。",
40
+ items: [
41
+ {
42
+ label: "撤回到当前节点",
43
+ detail: "无论下级是否已审批,均可撤回,下级记录全部作废。"
44
+ },
45
+ {
46
+ label: "撤回上级节点",
47
+ detail: "仅当下级节点尚未审批时才允许撤回;下级一旦审批完成则无法撤回。"
48
+ }
49
+ ]
50
+ }),
34
51
  name: [
35
52
  "RevokeStrategy",
36
53
  "type"
@@ -6,6 +6,7 @@ import { GroovyScriptPreview } from "../../../../script-components/components/gr
6
6
  import { EditOutlined } from "@ant-design/icons";
7
7
  import { RouterConfigModal } from "../../../../script-components/modal/router-config-modal.js";
8
8
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
9
+ import { FieldTip } from "../../../field-tip/index.js";
9
10
  const RouterConfigContent = (props)=>{
10
11
  const [visible, setVisible] = react.useState(false);
11
12
  const value = props.value || '';
@@ -50,7 +51,10 @@ const RouterStrategy = ()=>{
50
51
  },
51
52
  layout: "vertical",
52
53
  children: /*#__PURE__*/ jsx(Form.Item, {
53
- label: "路由表达式",
54
+ label: /*#__PURE__*/ jsx(FieldTip, {
55
+ label: "路由表达式",
56
+ description: "路由节点的判断脚本,根据返回值决定下一个流转节点。"
57
+ }),
54
58
  name: [
55
59
  "RouterStrategy",
56
60
  "script"
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Select } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const SameOperatorAuditStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsx(Form, {
@@ -11,7 +12,20 @@ const SameOperatorAuditStrategy = ()=>{
11
12
  },
12
13
  layout: "vertical",
13
14
  children: /*#__PURE__*/ jsx(Form.Item, {
14
- label: "相同人员提交配置",
15
+ label: /*#__PURE__*/ jsx(FieldTip, {
16
+ label: "相同人员提交配置",
17
+ description: "当提交人与审批人为同一人时的处理方式。",
18
+ items: [
19
+ {
20
+ label: "自动通过",
21
+ detail: "提交人与审批人为同一人时,自动通过该节点。"
22
+ },
23
+ {
24
+ label: "手动审批",
25
+ detail: "即使提交人与审批人相同,仍需手动审批。"
26
+ }
27
+ ]
28
+ }),
15
29
  name: [
16
30
  "SameOperatorAuditStrategy",
17
31
  "type"
@@ -6,6 +6,7 @@ import { GroovyScriptPreview } from "../../../../script-components/components/gr
6
6
  import { EditOutlined } from "@ant-design/icons";
7
7
  import { SubProcessConfigModal } from "../../../../script-components/modal/sub-process-config-modal.js";
8
8
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
9
+ import { FieldTip } from "../../../field-tip/index.js";
9
10
  const SubProcessScriptContent = (props)=>{
10
11
  const [visible, setVisible] = react.useState(false);
11
12
  const value = props.value || '';
@@ -51,7 +52,10 @@ const SubProcessStrategy = ()=>{
51
52
  layout: "vertical",
52
53
  children: [
53
54
  /*#__PURE__*/ jsx(Form.Item, {
54
- label: "子流程表达式",
55
+ label: /*#__PURE__*/ jsx(FieldTip, {
56
+ label: "子流程表达式",
57
+ description: "子流程触发的脚本,用于构造并在当前流程中发起一个子流程。"
58
+ }),
55
59
  name: [
56
60
  "SubProcessStrategy",
57
61
  "script"
@@ -66,7 +70,10 @@ const SubProcessStrategy = ()=>{
66
70
  })
67
71
  }),
68
72
  /*#__PURE__*/ jsx(Form.Item, {
69
- label: "创建后并提交",
73
+ label: /*#__PURE__*/ jsx(FieldTip, {
74
+ label: "创建后并提交",
75
+ description: "开启后,子流程创建完毕后自动提交;关闭则仅创建不提交。"
76
+ }),
70
77
  name: [
71
78
  "SubProcessStrategy",
72
79
  "submit"
@@ -2,6 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Input, Select } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const TimeoutStrategy = ()=>{
6
7
  const [form] = Form.useForm();
7
8
  return /*#__PURE__*/ jsxs(Form, {
@@ -12,7 +13,24 @@ const TimeoutStrategy = ()=>{
12
13
  layout: "vertical",
13
14
  children: [
14
15
  /*#__PURE__*/ jsx(Form.Item, {
15
- label: "超时类型",
16
+ label: /*#__PURE__*/ jsx(FieldTip, {
17
+ label: "超时类型",
18
+ description: "节点超时后自动执行的动作。",
19
+ items: [
20
+ {
21
+ label: "自动提醒",
22
+ detail: "超时后发送提醒,不改变审批状态。"
23
+ },
24
+ {
25
+ label: "自动同意",
26
+ detail: "超时后自动通过该节点。"
27
+ },
28
+ {
29
+ label: "自动拒绝",
30
+ detail: "超时后自动拒绝该节点。"
31
+ }
32
+ ]
33
+ }),
16
34
  name: [
17
35
  "TimeoutStrategy",
18
36
  "type"
@@ -42,7 +60,10 @@ const TimeoutStrategy = ()=>{
42
60
  })
43
61
  }),
44
62
  /*#__PURE__*/ jsx(Form.Item, {
45
- label: "超时时间(分钟)",
63
+ label: /*#__PURE__*/ jsx(FieldTip, {
64
+ label: "超时时间(分钟)",
65
+ description: "触发超时动作的等待时长,单位为分钟。"
66
+ }),
46
67
  name: [
47
68
  "TimeoutStrategy",
48
69
  "timeoutTime"
@@ -6,6 +6,7 @@ import { GroovyScriptPreview } from "../../../../script-components/components/gr
6
6
  import { EditOutlined } from "@ant-design/icons";
7
7
  import { TriggerConfigModal } from "../../../../script-components/modal/trigger-config-modal.js";
8
8
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
9
+ import { FieldTip } from "../../../field-tip/index.js";
9
10
  const TriggerConfigContent = (props)=>{
10
11
  const [visible, setVisible] = react.useState(false);
11
12
  const value = props.value || '';
@@ -51,7 +52,10 @@ const TriggerStrategy = ()=>{
51
52
  },
52
53
  layout: "vertical",
53
54
  children: /*#__PURE__*/ jsx(Form.Item, {
54
- label: "触发表达式",
55
+ label: /*#__PURE__*/ jsx(FieldTip, {
56
+ label: "触发表达式",
57
+ description: "节点触发时执行的脚本,可用于动态计算或副作用处理。"
58
+ }),
55
59
  name: [
56
60
  "TriggerStrategy",
57
61
  "script"
@@ -4,6 +4,7 @@ import { Button, Form, Input, Space } from "antd";
4
4
  import { Field } from "@flowgram.ai/fixed-layout-editor";
5
5
  import { BugOutlined } from "@ant-design/icons";
6
6
  import { ViewCodeDrawer } from "../../../../script-components/components/view-code-drawer.js";
7
+ import { FieldTip } from "../../../field-tip/index.js";
7
8
  const View = ()=>{
8
9
  const [form] = Form.useForm();
9
10
  const [visible, setVisible] = react.useState(false);
@@ -15,7 +16,10 @@ const View = ()=>{
15
16
  layout: "vertical",
16
17
  children: [
17
18
  /*#__PURE__*/ jsx(Form.Item, {
18
- label: "视图名称",
19
+ label: /*#__PURE__*/ jsx(FieldTip, {
20
+ label: "视图名称",
21
+ description: "节点绑定的展示视图,用于自定义该节点的表单或界面展示。"
22
+ }),
19
23
  name: [
20
24
  "view"
21
25
  ],
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Switch } from "antd";
4
4
  import { CardForm } from "@coding-flow/flow-pc-ui";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const InterferePanel = (props)=>/*#__PURE__*/ jsx(CardForm, {
6
7
  form: props.form,
7
8
  title: "干预配置",
@@ -11,8 +12,10 @@ const InterferePanel = (props)=>/*#__PURE__*/ jsx(CardForm, {
11
12
  "InterfereStrategy",
12
13
  "enable"
13
14
  ],
14
- label: "开启",
15
- tooltip: "开启干预时可允许流程管理员协助用户操作流程。",
15
+ label: /*#__PURE__*/ jsx(FieldTip, {
16
+ label: "开启",
17
+ description: "开启后,允许流程管理员协助用户操作该流程。"
18
+ }),
16
19
  children: /*#__PURE__*/ jsx(Switch, {})
17
20
  })
18
21
  });
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Input, Switch } from "antd";
4
4
  import { CardForm } from "@coding-flow/flow-pc-ui";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const UrgePanel = (props)=>/*#__PURE__*/ jsxs(CardForm, {
6
7
  form: props.form,
7
8
  title: "催办策略",
@@ -12,8 +13,10 @@ const UrgePanel = (props)=>/*#__PURE__*/ jsxs(CardForm, {
12
13
  "UrgeStrategy",
13
14
  "enable"
14
15
  ],
15
- label: "开启",
16
- tooltip: "开启催办允许用户点击催办当前审批人",
16
+ label: /*#__PURE__*/ jsx(FieldTip, {
17
+ label: "开启",
18
+ description: "开启后,允许用户对当前审批人发起催办。"
19
+ }),
17
20
  children: /*#__PURE__*/ jsx(Switch, {})
18
21
  }),
19
22
  /*#__PURE__*/ jsx(CardForm.Item, {
@@ -22,8 +25,10 @@ const UrgePanel = (props)=>/*#__PURE__*/ jsxs(CardForm, {
22
25
  "UrgeStrategy",
23
26
  "interval"
24
27
  ],
25
- label: "催办间隔时间",
26
- tooltip: "每次点击催办的间隔时间,该参数尽在启用时才生效",
28
+ label: /*#__PURE__*/ jsx(FieldTip, {
29
+ label: "催办间隔时间",
30
+ description: "两次催办之间的最小间隔,仅在启用催办时生效。"
31
+ }),
27
32
  children: /*#__PURE__*/ jsx(Input, {
28
33
  addonAfter: "单位:秒"
29
34
  })
@@ -5,6 +5,7 @@ import { CardForm, Panel } from "@coding-flow/flow-pc-ui";
5
5
  import { useDesignContext } from "../../hooks/use-design-context.js";
6
6
  import { FlowCreateOperatorEditor } from "./operator.js";
7
7
  import { GroovyScriptLoader } from "../../../../script-components/components/groovy-script-loader.js";
8
+ import { FieldTip } from "../../../field-tip/index.js";
8
9
  const TabBase = ()=>{
9
10
  const [baseForm] = CardForm.useForm();
10
11
  const [operatorForm] = CardForm.useForm();
@@ -54,7 +55,10 @@ const TabBase = ()=>{
54
55
  children: [
55
56
  /*#__PURE__*/ jsx(CardForm.Item, {
56
57
  name: "title",
57
- label: "流程标题",
58
+ label: /*#__PURE__*/ jsx(FieldTip, {
59
+ label: "流程标题",
60
+ description: "流程的显示名称,便于识别与管理。"
61
+ }),
58
62
  rules: [
59
63
  {
60
64
  required: true,
@@ -67,14 +71,20 @@ const TabBase = ()=>{
67
71
  }),
68
72
  /*#__PURE__*/ jsx(CardForm.Item, {
69
73
  name: "description",
70
- label: "流程备注",
74
+ label: /*#__PURE__*/ jsx(FieldTip, {
75
+ label: "流程备注",
76
+ description: "对流程用途、规则的补充说明,可选填。"
77
+ }),
71
78
  children: /*#__PURE__*/ jsx(Input.TextArea, {
72
79
  placeholder: "请输入流程备注"
73
80
  })
74
81
  }),
75
82
  /*#__PURE__*/ jsx(CardForm.Item, {
76
83
  name: "code",
77
- label: "流程编码",
84
+ label: /*#__PURE__*/ jsx(FieldTip, {
85
+ label: "流程编码",
86
+ description: "流程的唯一编码,用于系统识别与接口调用。"
87
+ }),
78
88
  rules: [
79
89
  {
80
90
  required: true,
@@ -92,7 +102,10 @@ const TabBase = ()=>{
92
102
  title: "发起配置",
93
103
  children: /*#__PURE__*/ jsx(CardForm.Item, {
94
104
  name: "operatorCreateScript",
95
- label: "发起人范围",
105
+ label: /*#__PURE__*/ jsx(FieldTip, {
106
+ label: "发起人范围",
107
+ description: "通过脚本限定有权发起该流程的人员范围。"
108
+ }),
96
109
  rules: [
97
110
  {
98
111
  required: true,
@@ -3,6 +3,7 @@ import { CloseCircleOutlined, PlusCircleOutlined } from "@ant-design/icons";
3
3
  import { Button, Col, Form, Input, Space } from "antd";
4
4
  import react from "react";
5
5
  import { IdUtils } from "../../../../utils/index.js";
6
+ import { FieldTip } from "../../../field-tip/index.js";
6
7
  const FieldAttributeItem = (props)=>{
7
8
  const attribute = props.value;
8
9
  const handleChangeLabel = (label)=>{
@@ -98,11 +99,11 @@ const FieldAttributeForm = ()=>{
98
99
  const actionRef = react.useRef();
99
100
  return /*#__PURE__*/ jsx(Form.Item, {
100
101
  name: "attributes",
101
- help: "附加属性,主要用于一些复杂的表单控制界面",
102
102
  label: /*#__PURE__*/ jsxs(Space, {
103
103
  children: [
104
- /*#__PURE__*/ jsx("span", {
105
- children: "附加属性"
104
+ /*#__PURE__*/ jsx(FieldTip, {
105
+ label: "附加属性",
106
+ description: "附加属性,主要用于一些复杂的表单控制界面。"
106
107
  }),
107
108
  /*#__PURE__*/ jsx(Button, {
108
109
  type: "link",
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { Form, Select } from "antd";
3
3
  import react from "react";
4
4
  import { FormTypeContext } from "@coding-flow/flow-types";
5
+ import { FieldTip } from "../../../field-tip/index.js";
5
6
  const FormTypeItem = (props)=>{
6
7
  const { form } = props;
7
8
  const options = react.useMemo(()=>FormTypeContext.getInstance().getOptions(), []);
@@ -16,7 +17,10 @@ const FormTypeItem = (props)=>{
16
17
  };
17
18
  return /*#__PURE__*/ jsx(Form.Item, {
18
19
  name: "type",
19
- label: "字段类型",
20
+ label: /*#__PURE__*/ jsx(FieldTip, {
21
+ label: "字段类型",
22
+ description: "表单字段的数据类型与展示组件。"
23
+ }),
20
24
  labelCol: labelCol,
21
25
  rules: [
22
26
  {
@@ -7,6 +7,7 @@ import { IMPORT_FORM_VIEW_KEY } from "../../../../plugins/import-form-view-type.
7
7
  import { useDesignContext } from "../../hooks/use-design-context.js";
8
8
  import { FormTable } from "./table.js";
9
9
  import { ImportFormPluginView } from "./import-form-plugin-view.js";
10
+ import { FieldTip } from "../../../field-tip/index.js";
10
11
  const TabForm = ()=>{
11
12
  const { state, context } = useDesignContext();
12
13
  const presenter = context.getPresenter();
@@ -76,8 +77,10 @@ const TabForm = ()=>{
76
77
  "form",
77
78
  "name"
78
79
  ],
79
- label: "表单名称",
80
- tooltip: "表单名称是主表的名称",
80
+ label: /*#__PURE__*/ jsx(FieldTip, {
81
+ label: "表单名称",
82
+ description: "主表的显示名称。"
83
+ }),
81
84
  rules: [
82
85
  {
83
86
  required: true,
@@ -93,8 +96,10 @@ const TabForm = ()=>{
93
96
  "form",
94
97
  "code"
95
98
  ],
96
- label: "表单编码",
97
- tooltip: "表单编码是主表的编码",
99
+ label: /*#__PURE__*/ jsx(FieldTip, {
100
+ label: "表单编码",
101
+ description: "主表的唯一编码,用于系统识别与数据存取。"
102
+ }),
98
103
  rules: [
99
104
  {
100
105
  required: true,
@@ -3,11 +3,12 @@ import "react";
3
3
  import { Col, Form, Input, Modal, Row, Switch } from "antd";
4
4
  import { FieldAttributeForm } from "./attrubute.js";
5
5
  import { FormTypeItem } from "./form-type.js";
6
+ import { FieldTip } from "../../../field-tip/index.js";
6
7
  const FormFieldModal = (props)=>{
7
8
  const form = props.form;
8
9
  const labelCol = {
9
10
  style: {
10
- width: 100
11
+ width: 110
11
12
  }
12
13
  };
13
14
  return /*#__PURE__*/ jsx(Modal, {
@@ -48,7 +49,10 @@ const FormFieldModal = (props)=>{
48
49
  span: 12,
49
50
  children: /*#__PURE__*/ jsx(Form.Item, {
50
51
  name: "name",
51
- label: "字段名称",
52
+ label: /*#__PURE__*/ jsx(FieldTip, {
53
+ label: "字段名称",
54
+ description: "表单字段的显示名称。"
55
+ }),
52
56
  labelCol: labelCol,
53
57
  rules: [
54
58
  {
@@ -65,7 +69,10 @@ const FormFieldModal = (props)=>{
65
69
  span: 12,
66
70
  children: /*#__PURE__*/ jsx(Form.Item, {
67
71
  name: "code",
68
- label: "字段编码",
72
+ label: /*#__PURE__*/ jsx(FieldTip, {
73
+ label: "字段编码",
74
+ description: "表单字段的唯一编码,用于数据存取,建议使用英文。"
75
+ }),
69
76
  labelCol: labelCol,
70
77
  rules: [
71
78
  {
@@ -88,7 +95,10 @@ const FormFieldModal = (props)=>{
88
95
  span: 6,
89
96
  children: /*#__PURE__*/ jsx(Form.Item, {
90
97
  name: "required",
91
- label: "是否必填",
98
+ label: /*#__PURE__*/ jsx(FieldTip, {
99
+ label: "是否必填",
100
+ description: "开启后,该字段为必填项。"
101
+ }),
92
102
  labelCol: labelCol,
93
103
  children: /*#__PURE__*/ jsx(Switch, {})
94
104
  })
@@ -97,7 +107,10 @@ const FormFieldModal = (props)=>{
97
107
  span: 6,
98
108
  children: /*#__PURE__*/ jsx(Form.Item, {
99
109
  name: "hidden",
100
- label: "是否隐藏",
110
+ label: /*#__PURE__*/ jsx(FieldTip, {
111
+ label: "是否隐藏",
112
+ description: "开启后,该字段在表单中不展示(仍可参与逻辑)。"
113
+ }),
101
114
  labelCol: labelCol,
102
115
  children: /*#__PURE__*/ jsx(Switch, {})
103
116
  })
@@ -106,7 +119,10 @@ const FormFieldModal = (props)=>{
106
119
  span: 12,
107
120
  children: /*#__PURE__*/ jsx(Form.Item, {
108
121
  name: "placeholder",
109
- label: "输入提示信息",
122
+ label: /*#__PURE__*/ jsx(FieldTip, {
123
+ label: "输入提示信息",
124
+ description: "字段输入框内的占位提示文字。"
125
+ }),
110
126
  labelCol: labelCol,
111
127
  children: /*#__PURE__*/ jsx(Input, {
112
128
  placeholder: "请输入输入提示信息"
@@ -117,7 +133,10 @@ const FormFieldModal = (props)=>{
117
133
  span: 12,
118
134
  children: /*#__PURE__*/ jsx(Form.Item, {
119
135
  name: "defaultValue",
120
- label: "默认值",
136
+ label: /*#__PURE__*/ jsx(FieldTip, {
137
+ label: "默认值",
138
+ description: "字段新增时的初始默认值。"
139
+ }),
121
140
  labelCol: labelCol,
122
141
  children: /*#__PURE__*/ jsx(Input, {
123
142
  placeholder: "请输入默认值"
@@ -128,7 +147,10 @@ const FormFieldModal = (props)=>{
128
147
  span: 12,
129
148
  children: /*#__PURE__*/ jsx(Form.Item, {
130
149
  name: "tooltip",
131
- label: "提示信息",
150
+ label: /*#__PURE__*/ jsx(FieldTip, {
151
+ label: "提示信息",
152
+ description: "字段标签旁的提示说明,hover 时显示。"
153
+ }),
132
154
  labelCol: labelCol,
133
155
  children: /*#__PURE__*/ jsx(Input, {
134
156
  placeholder: "请输入提示信息"
@@ -139,7 +161,10 @@ const FormFieldModal = (props)=>{
139
161
  span: 12,
140
162
  children: /*#__PURE__*/ jsx(Form.Item, {
141
163
  name: "help",
142
- label: "帮助提示",
164
+ label: /*#__PURE__*/ jsx(FieldTip, {
165
+ label: "帮助提示",
166
+ description: "字段下方的帮助说明文字。"
167
+ }),
143
168
  labelCol: labelCol,
144
169
  children: /*#__PURE__*/ jsx(Input, {
145
170
  placeholder: "请输入帮助提示"
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { Form, Input, Modal } from "antd";
4
+ import { FieldTip } from "../../../field-tip/index.js";
4
5
  const SubFormModal = (props)=>{
5
6
  const form = props.form;
6
7
  return /*#__PURE__*/ jsx(Modal, {
@@ -21,7 +22,10 @@ const SubFormModal = (props)=>{
21
22
  children: [
22
23
  /*#__PURE__*/ jsx(Form.Item, {
23
24
  name: "name",
24
- label: "子表名称",
25
+ label: /*#__PURE__*/ jsx(FieldTip, {
26
+ label: "子表名称",
27
+ description: "子表的显示名称。"
28
+ }),
25
29
  rules: [
26
30
  {
27
31
  required: true,
@@ -34,7 +38,10 @@ const SubFormModal = (props)=>{
34
38
  }),
35
39
  /*#__PURE__*/ jsx(Form.Item, {
36
40
  name: "code",
37
- label: "子表编码",
41
+ label: /*#__PURE__*/ jsx(FieldTip, {
42
+ label: "子表编码",
43
+ description: "子表的唯一编码,用于系统识别与数据存取。"
44
+ }),
38
45
  rules: [
39
46
  {
40
47
  required: true,
@@ -0,0 +1,13 @@
1
+ import "./field-tip_module.css";
2
+ const field_tip_module = {
3
+ wrapper: "wrapper-C3BLIZ",
4
+ label: "label-saB3hr",
5
+ icon: "icon-YplXSW",
6
+ content: "content-YOY3Xd",
7
+ description: "description-DPZ36p",
8
+ items: "items-MbTsm4",
9
+ item: "item-cWrXIT",
10
+ itemLabel: "itemLabel-zzT07g",
11
+ itemDetail: "itemDetail-_c712s"
12
+ };
13
+ export { field_tip_module as default };
@@ -0,0 +1,58 @@
1
+ .wrapper-C3BLIZ {
2
+ white-space: nowrap;
3
+ align-items: center;
4
+ gap: 2px;
5
+ display: inline-flex;
6
+ }
7
+
8
+ .label-saB3hr {
9
+ white-space: nowrap;
10
+ }
11
+
12
+ .icon-YplXSW {
13
+ color: #00000073;
14
+ cursor: help;
15
+ flex-shrink: 0;
16
+ font-size: 12px;
17
+ }
18
+
19
+ .content-YOY3Xd {
20
+ max-width: 320px;
21
+ font-size: 13px;
22
+ line-height: 1.6;
23
+ }
24
+
25
+ .description-DPZ36p {
26
+ color: #000000a6;
27
+ margin: 0 0 8px;
28
+ }
29
+
30
+ .description-DPZ36p:last-child {
31
+ margin-bottom: 0;
32
+ }
33
+
34
+ .items-MbTsm4 {
35
+ margin: 0;
36
+ padding: 0;
37
+ list-style: none;
38
+ }
39
+
40
+ .item-cWrXIT {
41
+ margin-bottom: 6px;
42
+ }
43
+
44
+ .item-cWrXIT:last-child {
45
+ margin-bottom: 0;
46
+ }
47
+
48
+ .itemLabel-zzT07g {
49
+ color: #000000d9;
50
+ font-weight: 500;
51
+ display: block;
52
+ }
53
+
54
+ .itemDetail-_c712s {
55
+ color: #0000008c;
56
+ display: block;
57
+ }
58
+
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ /**
3
+ * 要点项
4
+ */
5
+ export interface FieldTipItem {
6
+ /** 要点标题 */
7
+ label: string;
8
+ /** 要点说明 */
9
+ detail: string;
10
+ }
11
+ export interface FieldTipProps {
12
+ /** 字段名称(显示为 label 文本,同时作为弹层标题) */
13
+ label: string;
14
+ /** 说明正文 */
15
+ description?: string;
16
+ /** 要点列表(用于枚举型字段的各选项说明) */
17
+ items?: FieldTipItem[];
18
+ }
19
+ /**
20
+ * 字段说明组件
21
+ * 在字段 label 右侧显示问号图标,hover 时弹出结构化说明(正文 + 要点列表)。
22
+ * 作为 Form.Item 的 label 使用,简单字段只传 description,复杂字段再传 items。
23
+ */
24
+ export declare const FieldTip: React.FC<FieldTipProps>;
@@ -0,0 +1,53 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import "react";
3
+ import { Popover } from "antd";
4
+ import { QuestionCircleOutlined } from "@ant-design/icons";
5
+ import field_tip_module from "./field-tip.module.js";
6
+ const FieldTip = ({ label, description, items })=>{
7
+ const hasContent = Boolean(description) || items && items.length > 0;
8
+ const content = /*#__PURE__*/ jsxs("div", {
9
+ className: field_tip_module.content,
10
+ children: [
11
+ description && /*#__PURE__*/ jsx("p", {
12
+ className: field_tip_module.description,
13
+ children: description
14
+ }),
15
+ items && items.length > 0 && /*#__PURE__*/ jsx("ul", {
16
+ className: field_tip_module.items,
17
+ children: items.map((item)=>/*#__PURE__*/ jsxs("li", {
18
+ className: field_tip_module.item,
19
+ children: [
20
+ /*#__PURE__*/ jsx("span", {
21
+ className: field_tip_module.itemLabel,
22
+ children: item.label
23
+ }),
24
+ /*#__PURE__*/ jsx("span", {
25
+ className: field_tip_module.itemDetail,
26
+ children: item.detail
27
+ })
28
+ ]
29
+ }, item.label))
30
+ })
31
+ ]
32
+ });
33
+ return /*#__PURE__*/ jsxs("span", {
34
+ className: field_tip_module.wrapper,
35
+ children: [
36
+ /*#__PURE__*/ jsx("span", {
37
+ className: field_tip_module.label,
38
+ children: label
39
+ }),
40
+ hasContent && /*#__PURE__*/ jsx(Popover, {
41
+ content: content,
42
+ title: label,
43
+ trigger: "hover",
44
+ placement: "topLeft",
45
+ overlayClassName: field_tip_module.popover,
46
+ children: /*#__PURE__*/ jsx(QuestionCircleOutlined, {
47
+ className: field_tip_module.icon
48
+ })
49
+ })
50
+ ]
51
+ });
52
+ };
53
+ export { FieldTip };
@@ -1,6 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { getScript, save } from "../../api/script.js";
3
3
  import react from "react";
4
+ import { EventBus } from "@coding-flow/flow-core";
5
+ const SCRIPT_UPDATED_EVENT = "groovy-script-updated";
4
6
  const GroovyScriptLoader = (props)=>{
5
7
  const scriptKey = props.value || '';
6
8
  const [script, setScript] = react.useState('');
@@ -15,6 +17,8 @@ const GroovyScriptLoader = (props)=>{
15
17
  if (script === currentScript) return;
16
18
  console.log("script changed", currentScript);
17
19
  handlerSaveScript(currentScript);
20
+ EventBus.getInstance().emit(SCRIPT_UPDATED_EVENT, scriptKey, currentScript);
21
+ setScript(currentScript);
18
22
  props.onChange?.(scriptKey);
19
23
  };
20
24
  react.useEffect(()=>{
@@ -24,6 +28,18 @@ const GroovyScriptLoader = (props)=>{
24
28
  }, [
25
29
  scriptKey
26
30
  ]);
31
+ react.useEffect(()=>{
32
+ if (!scriptKey) return;
33
+ const handler = (key, content)=>{
34
+ if (key === scriptKey) setScript(content);
35
+ };
36
+ EventBus.getInstance().on(SCRIPT_UPDATED_EVENT, handler);
37
+ return ()=>{
38
+ EventBus.getInstance().off(SCRIPT_UPDATED_EVENT, handler);
39
+ };
40
+ }, [
41
+ scriptKey
42
+ ]);
27
43
  react.useEffect(()=>()=>{
28
44
  setScript('');
29
45
  }, []);
@@ -45,7 +45,7 @@ const SubProcessView = (props)=>{
45
45
  label: "触发动作",
46
46
  children: /*#__PURE__*/ jsx(Select, {
47
47
  placeholder: "请选择触发动作",
48
- options: state.actions.map((item)=>({
48
+ options: (state.actions ?? []).map((item)=>({
49
49
  key: item.actionId,
50
50
  value: item.actionId,
51
51
  label: item.title
@@ -1,5 +1,9 @@
1
1
  import { SubProcessViewApi } from "../typings";
2
2
  export declare class SubProcessViewApiImpl implements SubProcessViewApi {
3
3
  options: () => Promise<any>;
4
- meta: (workId: string) => Promise<any>;
4
+ meta: (workId: string) => Promise<{
5
+ workId: string;
6
+ actions: any;
7
+ form: any;
8
+ }>;
5
9
  }
@@ -7,8 +7,16 @@ class SubProcessViewApiImpl {
7
7
  };
8
8
  meta = async (workId)=>{
9
9
  const res = await meta(workId);
10
- if (res.success) return res.data;
11
- return null;
10
+ if (res.success && res.data) return {
11
+ workId,
12
+ actions: res.data.actions ?? [],
13
+ form: res.data.form
14
+ };
15
+ return {
16
+ workId,
17
+ actions: [],
18
+ form: void 0
19
+ };
12
20
  };
13
21
  }
14
22
  export { SubProcessViewApiImpl };
@@ -23,8 +23,8 @@ class TargetWorkflowPresenter {
23
23
  this.dispatch((prevState)=>({
24
24
  ...prevState,
25
25
  currentWorkId: workId,
26
- actions: meta.actions,
27
- form: meta.form
26
+ actions: meta?.actions ?? [],
27
+ form: meta?.form
28
28
  }));
29
29
  });
30
30
  }
@@ -30,6 +30,6 @@ const SubProcessConfigModal = (props)=>/*#__PURE__*/ jsx(GroovyScriptModal, {
30
30
  onCancel: props.onCancel,
31
31
  title: "子流程配置",
32
32
  content: SubProcessConfigContent,
33
- scriptKey: props.script
33
+ scriptKey: props.scriptKey
34
34
  });
35
35
  export { SubProcessConfigModal };
@@ -30,6 +30,6 @@ const TriggerConfigModal = (props)=>/*#__PURE__*/ jsx(GroovyScriptModal, {
30
30
  onCancel: props.onCancel,
31
31
  title: "触发配置",
32
32
  content: TriggerConfigContent,
33
- scriptKey: props.script
33
+ scriptKey: props.scriptKey
34
34
  });
35
35
  export { TriggerConfigModal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-flow/flow-design",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "flow-engine design components ",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -49,16 +49,16 @@
49
49
  "nanoid": "^5.1.6",
50
50
  "react-redux": "^9.2.0",
51
51
  "styled-components": "^5.3.11",
52
- "@coding-flow/flow-core": "0.0.51",
53
- "@coding-flow/flow-icons": "0.0.51",
54
- "@coding-flow/flow-types": "0.0.51",
55
- "@coding-flow/flow-pc-ui": "0.0.51"
52
+ "@coding-flow/flow-icons": "0.0.53",
53
+ "@coding-flow/flow-core": "0.0.53",
54
+ "@coding-flow/flow-types": "0.0.53",
55
+ "@coding-flow/flow-pc-ui": "0.0.53"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/lodash-es": "^4.17.12",
59
59
  "@types/styled-components": "^5.1.36",
60
- "@coding-flow/flow-core": "0.0.51",
61
- "@coding-flow/flow-types": "0.0.51"
60
+ "@coding-flow/flow-core": "0.0.53",
61
+ "@coding-flow/flow-types": "0.0.53"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "rslib build",