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">
|
<div className="flex items-center gap-2">
|
||||||
{/* 左侧变量选择器 */}
|
{/* 左侧变量选择器 */}
|
||||||
<Form.Item {...restField} name={[name, "leftSelector"]} className="mb-0 flex-1" rules={[{ required: true, message: "请选择变量" }]}>
|
<Form.Item {...restField} name={[name, "leftSelector"]} className="mb-0 flex-1" rules={[{ required: true, message: "请选择变量" }]}>
|
||||||
<Select placeholder="选择变量">
|
<Select
|
||||||
{previousNodes.map((selector) => (
|
placeholder="选择变量"
|
||||||
<Select.Option key={selector.id} value={selector.name}>
|
options={previousNodes.map((item) => {
|
||||||
{selector.name}
|
return {
|
||||||
</Select.Option>
|
label: item.name,
|
||||||
))}
|
options: item.outputs?.map((output) => {
|
||||||
</Select>
|
return {
|
||||||
|
label: `${item.name} - ${output.label}`,
|
||||||
|
value: `${item.id}#${output.name}`,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
})}
|
||||||
|
></Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
{/* 操作符 */}
|
{/* 操作符 */}
|
||||||
|
@ -187,6 +187,29 @@ export type WorkflowNodeIOValueSelector = {
|
|||||||
name: string;
|
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
|
// #endregion
|
||||||
|
|
||||||
// #region Condition expression
|
// #region Condition expression
|
||||||
|
Loading…
x
Reference in New Issue
Block a user