Skip to content
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

Conversation

yunfeng1993
Copy link
Collaborator

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:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the enhancement New feature or request label Sep 3, 2024
{
'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',
Copy link
Collaborator

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
Copy link
Collaborator

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 ? (
Copy link
Collaborator

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
Copy link
Collaborator

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) => {
Copy link
Collaborator

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);
Copy link
Collaborator

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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用补充这个哈,使用w-[530px]和w-[256px]
方括号里可以随便自定义公式,可以全局搜一下类似用法

@yunfeng1993 yunfeng1993 closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants