feat(web): 优化样式
This commit is contained in:
@@ -26,16 +26,37 @@ import {useDataStore} from './store/DataStore.ts'
|
|||||||
import {useFlowStore} from './store/FlowStore.ts'
|
import {useFlowStore} from './store/FlowStore.ts'
|
||||||
|
|
||||||
const FlowableDiv = styled.div`
|
const FlowableDiv = styled.div`
|
||||||
height: 92vh;
|
height: 100%;
|
||||||
|
|
||||||
|
.react-flow__node.selectable {
|
||||||
|
&:focus {
|
||||||
|
box-shadow: 0 0 20px 1px #e8e8e8;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.react-flow__handle.connectionindicator {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #000000;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #e8e8e8;
|
||||||
|
border: 1px solid #c6c6c6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.node-card {
|
.node-card {
|
||||||
cursor: grab;
|
cursor: default;
|
||||||
|
|
||||||
.card-container {
|
.card-container {
|
||||||
cursor: default;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
@@ -112,7 +133,7 @@ function FlowEditor() {
|
|||||||
{
|
{
|
||||||
type: 'wrapper',
|
type: 'wrapper',
|
||||||
size: 'none',
|
size: 'none',
|
||||||
className: 'space-x-1 float-right',
|
className: 'space-x-2 text-right',
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
type: 'action',
|
type: 'action',
|
||||||
@@ -258,10 +279,10 @@ function FlowEditor() {
|
|||||||
"data": {
|
"data": {
|
||||||
"BMFP3Eov94": {
|
"BMFP3Eov94": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"文件名": {
|
"name": {
|
||||||
"type": "text"
|
"type": "text"
|
||||||
},
|
},
|
||||||
"文件描述": {
|
"description": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"description": "文件描述"
|
"description": "文件描述"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,13 +69,7 @@ const AmisNode = (
|
|||||||
const nodeName = isEmpty(nodeData?.node?.name) ? defaultNodeName : nodeData.node.name
|
const nodeName = isEmpty(nodeData?.node?.name) ? defaultNodeName : nodeData.node.name
|
||||||
const nodeDescription = isEmpty(nodeData?.node?.description) ? defaultNodeDescription : nodeData.node?.description
|
const nodeDescription = isEmpty(nodeData?.node?.description) ? defaultNodeDescription : nodeData.node?.description
|
||||||
return (
|
return (
|
||||||
<div className="p-1 w-64">
|
<div className="w-64">
|
||||||
<Card
|
|
||||||
className="node-card"
|
|
||||||
title={nodeName}
|
|
||||||
size="small"
|
|
||||||
hoverable
|
|
||||||
>
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
className="card-container"
|
className="card-container"
|
||||||
trigger={['contextMenu']}
|
trigger={['contextMenu']}
|
||||||
@@ -127,13 +121,18 @@ const AmisNode = (
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
<Card
|
||||||
|
className="node-card"
|
||||||
|
title={nodeName}
|
||||||
|
size="small"
|
||||||
>
|
>
|
||||||
<div className="card-description p-2 text-secondary text-sm">
|
<div className="card-description p-2 text-secondary text-sm">
|
||||||
{nodeDescription}
|
{nodeDescription}
|
||||||
{extraNodeDescription?.(nodeData)}
|
{extraNodeDescription?.(nodeData)}
|
||||||
</div>
|
</div>
|
||||||
</Dropdown>
|
|
||||||
</Card>
|
</Card>
|
||||||
|
</Dropdown>
|
||||||
{isEqual(type, 'start') || isEqual(type, 'normal')
|
{isEqual(type, 'start') || isEqual(type, 'normal')
|
||||||
? <Handle type="source" position={Position.Right}/> : undefined}
|
? <Handle type="source" position={Position.Right}/> : undefined}
|
||||||
{isEqual(type, 'end') || isEqual(type, 'normal')
|
{isEqual(type, 'end') || isEqual(type, 'normal')
|
||||||
|
|||||||
Reference in New Issue
Block a user