-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: 工作流画布支持一键展开,一件收起节点 #1644
Merged
Merged
feat: 工作流画布支持一键展开,一件收起节点 #1644
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,24 @@ | |
<el-button link @click="zoomIn"> | ||
<el-icon :size="16" title="放大"><ZoomIn /></el-icon> | ||
</el-button> | ||
|
||
<el-divider direction="vertical" /> | ||
<el-button link @click="fitView"> | ||
<AppIcon iconName="app-fitview" title="适应"></AppIcon> | ||
</el-button> | ||
<el-divider direction="vertical" /> | ||
<el-button link @click="retract"> | ||
<el-tooltip class="box-item" effect="dark" content="收起全部节点" placement="top"> | ||
<AppIcon iconName="app-retract" title="收起全部节点"></AppIcon> | ||
</el-tooltip> | ||
</el-button> | ||
<el-button link @click="extend"> | ||
<el-tooltip class="box-item" effect="dark" content="展开全部节点" placement="top"> | ||
<AppIcon iconName="app-extend" title="展开全部节点"></AppIcon> | ||
</el-tooltip> | ||
</el-button> | ||
<el-button link @click="layout"> | ||
<AppIcon iconName="app-beautify" title="美化"></AppIcon> | ||
<el-tooltip class="box-item" effect="dark" content="一键美化" placement="top"> | ||
<AppIcon iconName="app-beautify" title="一键美化"></AppIcon> | ||
</el-tooltip> | ||
</el-button> | ||
</el-card> | ||
</template> | ||
|
@@ -36,5 +47,15 @@ function fitView() { | |
const layout = () => { | ||
props.lf?.extension.dagre.layout() | ||
} | ||
const retract = () => { | ||
props.lf?.graphModel.nodes.forEach((element: any) => { | ||
element.properties.showNode = false | ||
}) | ||
} | ||
const extend = () => { | ||
props.lf?.graphModel.nodes.forEach((element: any) => { | ||
element.properties.showNode = true | ||
}) | ||
} | ||
</script> | ||
<style scoped></style> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这段CSS样式存在一些问题和可以进行改进的地方。首先,我们对代码稍作调整如下: .el-button.link {
text-decoration: none;
}
.app-icon--inner-container::after {
border-right-color: var(--el-primary-color-light);
} 在上述修改后:
这些更改不会显著影响当前代码的功能性,但会使用户界面更加一致并且更具吸引力。你可以选择将此样本来替换原始样式,并确保与你的应用整体风格保持一致。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
此代码包含了一些不标准的地方和可复用性的问题。
iconReader
应该返回 JSX 元素,并在渲染时调用。例如,将两个不同的图标组合在一起并按顺序分组到一个数组中:export default class App extends React.Component {}
下部应该使用 ES6 类声明语法。