-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: upload metadata 、ui size settings 276 320 530 、import flow #1956
feat: upload metadata 、ui size settings 276 320 530 、import flow #1956
Conversation
web/components/flow/canvas-node.tsx
Outdated
{ | ||
'w-80':node.tags.ui_size === 'middle' || !node.tags.ui_size, | ||
'w-256':node.tags.ui_size === 'small', | ||
'w-530':node.tags.ui_size === 'large', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里取数据都改成?.吧,防止空数据
如:node?.tags?.ui_size
} | ||
setFileList(urlList) | ||
}).catch((res)=>{ | ||
debugger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里怎么还留一个debugger?一般是message.error 或 console.log(error)
@@ -74,13 +105,13 @@ export const renderUpload = (params: Props) => { | |||
return ( | |||
<div className='p-2 text-sm text-center'> | |||
{data.is_list ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看起来 data.is_list 所在三元表达式区别,只有multiple={true} 和 multiple={false},可以把三元判断放在这里multiple={data.is_list?true:false}
@@ -28,8 +28,9 @@ import 'reactflow/dist/style.css'; | |||
|
|||
const nodeTypes = { customNode: CanvasNode }; | |||
const edgeTypes = { buttonedge: ButtonEdge }; | |||
let importData :any= null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个importData变量可以写到 Canvas 组件里面,类型最好补充一下,不要使用any
@@ -28,8 +28,9 @@ import 'reactflow/dist/style.css'; | |||
|
|||
const nodeTypes = { customNode: CanvasNode }; | |||
const edgeTypes = { buttonedge: ButtonEdge }; | |||
let importData :any= null | |||
const Canvas: React.FC = (props:any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的props类型也补充一下
export default function CanvasWrapper(data:any) { | ||
|
||
importData = data | ||
console.log(importData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除
width: 530px; | ||
} | ||
.w-256{ | ||
width:256px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用补充这个哈,使用w-[530px]和w-[256px]
方括号里可以随便自定义公式,可以全局搜一下类似用法
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Snapshots:
Include snapshots for easier review.
Checklist: