姜玉琦 2024-07-12 02:23:40 +08:00
commit 0ba5405ef4
2 changed files with 30 additions and 2 deletions

View File

@ -59,4 +59,7 @@ const fontColor = computed(() => {
background-color: rgb(1, 169, 255);
border-radius: 4px;
}
.lf-ai-node,.lf-element-text{
cursor:pointer !important;
}
</style>

View File

@ -161,8 +161,16 @@ class RedNode extends RectNode {
getShape() {
const { text, x, y, width, height, radius } = this.props.model;
const style = this.props.model.getNodeStyle();
const node = this.props.model.properties?.data?.parameters;
console.log("+++", x, y, width, height);
let subText=(this.props.model.properties?.data?.oper_sub_type_name||"");
let subType = (this.props.model.properties?.data?.oper_sub_type_name||"").split("").filter(t=>t.length>0).map((t,idx)=>{
return h("text",{
x:x-width/2+8,
y:y+idx*13-(subText.length==3?8:14),
style: "text-anchor:left;fill:#FFCDD2;font-size:12px;",
},t)
});
const node = this.props.model.properties?.data?.parameters;
let inputs = makeX(node?.inputs || []).map((d, idx) =>
h(
"svg",
@ -231,6 +239,23 @@ class RedNode extends RectNode {
rx: radius,
ry: radius,
}),
h("rect",{
fill: "#C62828",
x: x - width / 2,
y: y - height / 2,
width:30,
height,
rx: radius,
ry: radius,
}),
h("rect",{
fill: "#C62828",
x: x - width / 2+20,
y: y - height / 2,
width:10,
height,
}),
...subType,
...inputs,
...outputs,
]