diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..ce358e4
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..6560a98
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..cf64fc2
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e674d91
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/org-chart-frant.iml b/.idea/org-chart-frant.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/org-chart-frant.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..198aa37
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,535 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ DEFINITION_ORDER
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionScript specificJavaScript
+
+
+ Android
+
+
+ Ant
+
+
+ Batch Applications
+
+
+ CFML
+
+
+ CSS
+
+
+ Class structureJava
+
+
+ Code quality toolsCSS
+
+
+ Code quality toolsJavaScript
+
+
+ Code style issuesJava
+
+
+ CoffeeScript
+
+
+ CorrectnessLintAndroid
+
+
+ Cucumber
+
+
+ Error handlingJava
+
+
+ Faces Model
+
+
+ Flow type checkerJavaScript
+
+
+ FreeMarker
+
+
+ General
+
+
+ GeneralCoffeeScript
+
+
+ GeneralJavaScript
+
+
+ Google Web Toolkit
+
+
+ GrailsGroovy
+
+
+ Groovy
+
+
+ HTML
+
+
+ Hibernate
+
+
+ IconsUsabilityLintAndroid
+
+
+ ImportsJava
+
+
+ Inheritance issuesJava
+
+
+ Internationalization
+
+
+ InternationalizationJava
+
+
+ InternationalizationLintAndroid
+
+
+ Invalid elementsCSS
+
+
+ J2ME issuesJava
+
+
+ JSON and JSON5
+
+
+ JSP
+
+
+ Java
+
+
+ Java 8Java language level migration aidsJava
+
+
+ Java interop issuesKotlin
+
+
+ Java language level migration aidsJava
+
+
+ JavaFX
+
+
+ JavaScript
+
+
+ JavadocJava
+
+
+ Kotlin
+
+
+ LintAndroid
+
+
+ LintLintAndroid
+
+
+ Manifest
+
+
+ Markdown
+
+
+ MessagesCorrectnessLintAndroid
+
+
+ Node.jsJavaScript
+
+
+ OSGi
+
+
+ OtherGroovy
+
+
+ Pages Navigation Model
+
+
+ Plugin DevKit
+
+
+ PortabilityJava
+
+
+ Potentially confusing code constructsGroovy
+
+
+ Probable bugsJava
+
+
+ Properties Files
+
+
+ Properties FilesJava
+
+
+ RELAX NG
+
+
+ RESTful Web Service
+
+
+ Resource managementJava
+
+
+ SQL
+
+
+ Sass/SCSS
+
+
+ SecurityLintAndroid
+
+
+ SetupSpring CoreSpring
+
+
+ Spring
+
+
+ Spring BootSpring
+
+
+ Spring CoreSpring
+
+
+ Struts
+
+
+ Struts 1Struts
+
+
+ Struts 2Struts
+
+
+ Style issuesKotlin
+
+
+ TestNGJava
+
+
+ Threading issuesJava
+
+
+ TypeScript
+
+
+ UI Form
+
+
+ UsabilityLintAndroid
+
+
+ Validity issuesGroovy
+
+
+ Velocity
+
+
+ Verbose or redundant code constructsJava
+
+
+ VisibilityJava
+
+
+ Vue
+
+
+ Web Services
+
+
+ XML
+
+
+ XMLSpring CoreSpring
+
+
+ XPath
+
+
+ YAML
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1689842546961
+
+
+ 1689842546961
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fastdfs-client-java-1.27-RELEASE
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/toolBar/img/compact.png b/src/components/toolBar/img/compact.png
new file mode 100644
index 0000000..5233876
Binary files /dev/null and b/src/components/toolBar/img/compact.png differ
diff --git a/src/components/toolBar/img/expandAll.png b/src/components/toolBar/img/expandAll.png
new file mode 100644
index 0000000..38eaea2
Binary files /dev/null and b/src/components/toolBar/img/expandAll.png differ
diff --git a/src/components/toolBar/img/fit.png b/src/components/toolBar/img/fit.png
new file mode 100644
index 0000000..cd8ee5b
Binary files /dev/null and b/src/components/toolBar/img/fit.png differ
diff --git a/src/components/toolBar/img/fullscreen.png b/src/components/toolBar/img/fullscreen.png
new file mode 100644
index 0000000..ee9d692
Binary files /dev/null and b/src/components/toolBar/img/fullscreen.png differ
diff --git a/src/components/toolBar/index.jsx b/src/components/toolBar/index.jsx
index 1cbe424..7b8a09f 100644
--- a/src/components/toolBar/index.jsx
+++ b/src/components/toolBar/index.jsx
@@ -6,6 +6,10 @@ import top from './img/top.png';
import left from './img/left.png';
import topActive from './img/top_active.png';
import leftActive from './img/left_active.png';
+import fullscreen from './img/fullscreen.png';
+import fit from './img/fit.png';
+import compact from './img/compact.png';
+import expandAll from './img/expandAll.png';
export default class ToolBar extends React.Component {
progressBtn = React.createRef();
@@ -97,6 +101,34 @@ export default class ToolBar extends React.Component {
this.props.onLeftLayoutClick(this.progressBtn);
}}
/>
+
{
+ this.props.onFullscreen(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onFit(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onCompact(this.progressBtn);
+ }}
+ />
+
{
+ this.props.onExpandAll(this.progressBtn);
+ }}
+ />
);
}
diff --git a/src/components/toolBar/index.less b/src/components/toolBar/index.less
index ffe10d8..305d10f 100644
--- a/src/components/toolBar/index.less
+++ b/src/components/toolBar/index.less
@@ -1,38 +1,39 @@
.toolbarWrapper {
- width: 68px;
- position: fixed;
- right: 10px;
- z-index: 100;
- background: #fff;
- border-radius: 20px;
- padding-top: 20px;
- padding-bottom: 20px;
- text-align: center;
- .progressWrapper {
- position: relative;
- padding-top: 5px;
- padding-bottom: 5px;
- margin-left: 20px;
- .progressLine {
- height: 100px;
- width: 0px;
- border-left: 2px solid #C9C9C9;
- margin-left: 12px;
- }
- .progressBtn {
- width: 16px;
- height: 9px;
- background-color: #C9C9C9;
- position: absolute;
- left: 5px;
- top: 0px;
- }
+ width: 68px;
+ position: fixed;
+ right: 10px;
+ z-index: 100;
+ background: #fff;
+ border-radius: 20px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ text-align: center;
+ .progressWrapper {
+ position: relative;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin-left: 20px;
+ .progressLine {
+ height: 100px;
+ width: 0px;
+ border-left: 2px solid #c9c9c9;
+ margin-left: 12px;
}
- .toolBarItem {
- display: block;
- margin-top: 20px;
- margin-bottom: 20px;
- margin-left: 20px;
- cursor: pointer;
+ .progressBtn {
+ width: 16px;
+ height: 9px;
+ background-color: #c9c9c9;
+ position: absolute;
+ left: 5px;
+ top: 0px;
}
-}
\ No newline at end of file
+ }
+ .toolBarItem {
+ display: block;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ margin-left: 26px;
+ cursor: pointer;
+ width: 20px;
+ }
+}
diff --git a/src/pages/company.jsx b/src/pages/company.jsx
index 3e51d47..832c039 100644
--- a/src/pages/company.jsx
+++ b/src/pages/company.jsx
@@ -19,9 +19,11 @@ let topbar = null;
export default function companyPage() {
const [data, setData] = useState(null);
+ let compact = 0;
+ let expandAll = 0;
+
const [sliderProgress, setSliderProgress] = useState(50);
let addNodeChildFunc = null;
-
let topBarSearchRequest = null;
const [hasRight, setHasRight] = useState('');
const [timelineId, setTimelineId] = useState(0);
@@ -205,6 +207,30 @@ export default function companyPage() {
active = 'left';
};
+ const handleFullscreen = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && orgChart.fullscreen('body');
+ };
+
+ const handleFit = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && orgChart.fit();
+ };
+
+ const handleCompact = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart &&
+ orgChart
+ .compact(!!(compact++ % 2))
+ .render()
+ .fit();
+ };
+
+ const handleExpandAll = (progressBtn) => {
+ progressBtn.current.style.top = 50 + 'px';
+ orgChart && expandAll++ % 2 ? orgChart.collapseAll() : orgChart.expandAll();
+ };
+
const handleZoomIn = (progressBtn) => {
if (progressBtn) {
let top = parseInt(progressBtn.current.style.top) - 10;
@@ -309,7 +335,9 @@ export default function companyPage() {
setData(data?.data);
}
}
- setSpinning(false);
+ setTimeout(function () {
+ setSpinning(false);
+ }, 200);
});
};
@@ -376,6 +404,10 @@ export default function companyPage() {
onLeftLayoutClick={(progressBtn) =>
handleLeftLayoutClick(progressBtn)
}
+ onFullscreen={(progressBtn) => handleFullscreen(progressBtn)}
+ onFit={(progressBtn) => handleFit(progressBtn)}
+ onCompact={(progressBtn) => handleCompact(progressBtn)}
+ onExpandAll={(progressBtn) => handleExpandAll(progressBtn)}
onZoomOut={(progressBtn) => handleZoomOut(progressBtn)}
onZoomIn={(progressBtn) => handleZoomIn(progressBtn)}
onZoomBehavior={(value) => handleZoomBehavior(value)}