mirror of
https://github.com/woodchen-ink/certimate.git
synced 2025-07-18 09:21:56 +08:00
improve previous variables
This commit is contained in:
parent
b8ab077b57
commit
05d43f38ce
@ -183,13 +183,20 @@ const ConditionNodeConfigForm = forwardRef<ConditionNodeConfigFormInstance, Cond
|
||||
<div className="flex items-center gap-2">
|
||||
{/* 左侧变量选择器 */}
|
||||
<Form.Item {...restField} name={[name, "leftSelector"]} className="mb-0 flex-1" rules={[{ required: true, message: "请选择变量" }]}>
|
||||
<Select placeholder="选择变量">
|
||||
{previousNodes.map((selector) => (
|
||||
<Select.Option key={selector.id} value={selector.name}>
|
||||
{selector.name}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
<Select
|
||||
placeholder="选择变量"
|
||||
options={previousNodes.map((item) => {
|
||||
return {
|
||||
label: item.name,
|
||||
options: item.outputs?.map((output) => {
|
||||
return {
|
||||
label: `${item.name} - ${output.label}`,
|
||||
value: `${item.id}#${output.name}`,
|
||||
};
|
||||
}),
|
||||
};
|
||||
})}
|
||||
></Select>
|
||||
</Form.Item>
|
||||
|
||||
{/* 操作符 */}
|
||||
|
@ -187,6 +187,29 @@ export type WorkflowNodeIOValueSelector = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
export const workflowNodeIOOptions = (node: WorkflowNode, io: WorkflowNodeIO) => {
|
||||
switch (io.type) {
|
||||
case "certificate":
|
||||
return [
|
||||
{
|
||||
label: "是否有效",
|
||||
value: "valid",
|
||||
},
|
||||
{
|
||||
label: "剩余有效天数",
|
||||
value: "valid",
|
||||
},
|
||||
];
|
||||
default:
|
||||
return [
|
||||
{
|
||||
label: `${node.name} - ${io.label}`,
|
||||
value: `${node.id}#${io.name}`,
|
||||
},
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
// #endregion
|
||||
|
||||
// #region Condition expression
|
||||
|
Loading…
x
Reference in New Issue
Block a user