feat(web): 替换amis渲染,amis渲染太慢,导致卡顿

This commit is contained in:
v-zhangjc9
2025-06-21 00:08:38 +08:00
committed by lanyuanxiaoyao
parent b916acb1c3
commit b53ee57dc3

View File

@@ -1,4 +1,4 @@
import {PlusCircleFilled, SaveFilled} from '@ant-design/icons'
import {DeleteFilled, EditFilled, PlusCircleFilled, SaveFilled} from '@ant-design/icons'
import {
addEdge,
applyEdgeChanges,
@@ -19,13 +19,12 @@ import {
} from '@xyflow/react'
import {useMount} from 'ahooks'
import type {Schema} from 'amis'
import {Button, Dropdown, message} from 'antd'
import {arrToMap, contain, find, isEqual, isNil, randomId} from 'licia'
import {Button, Card, Dropdown, message, Popover} from 'antd'
import {arrToMap, contain, find, isEqual, randomId} from 'licia'
import {type JSX, useState} from 'react'
import styled from 'styled-components'
import '@xyflow/react/dist/style.css'
import {create} from 'zustand/react'
import {amisRender, commonInfo} from '../util/amis.tsx'
const FlowableDiv = styled.div`
height: 93vh;
@@ -48,8 +47,8 @@ const AmisNode = (
const {id, data} = props
const {setDataById} = data
return (
<div className="p-1 w-80">
{amisRender(
<div className="p-1 w-72">
{/*{amisRender(
{
type: 'card',
header: {
@@ -87,7 +86,23 @@ const AmisNode = (
],
},
},
)}
)}*/}
<Popover
content={
<EditFilled/>
}
>
<Card
size="small"
actions={[
<EditFilled key="edit"/>,
<DeleteFilled key="remove"/>,
]}
hoverable
>
<Card.Meta title={name} description={description}/>
</Card>
</Popover>
{isEqual(type, 'start') || isEqual(type, 'normal')
? <Handle type="source" position={Position.Right}/> : undefined}
{isEqual(type, 'end') || isEqual(type, 'normal')