diff --git a/dist.zip b/dist.zip
new file mode 100644
index 0000000..88723e5
Binary files /dev/null and b/dist.zip differ
diff --git a/public/img/back/level1.png b/public/img/back/level1.png
new file mode 100644
index 0000000..4d2a63d
Binary files /dev/null and b/public/img/back/level1.png differ
diff --git a/public/img/back/level2.png b/public/img/back/level2.png
new file mode 100644
index 0000000..2ab4d3c
Binary files /dev/null and b/public/img/back/level2.png differ
diff --git a/public/img/back/level3.png b/public/img/back/level3.png
new file mode 100644
index 0000000..e655097
Binary files /dev/null and b/public/img/back/level3.png differ
diff --git a/public/img/back/level4.png b/public/img/back/level4.png
new file mode 100644
index 0000000..06947e4
Binary files /dev/null and b/public/img/back/level4.png differ
diff --git a/public/img/back/level5.png b/public/img/back/level5.png
new file mode 100644
index 0000000..e77017a
Binary files /dev/null and b/public/img/back/level5.png differ
diff --git a/public/img/back/level6.png b/public/img/back/level6.png
new file mode 100644
index 0000000..6be044f
Binary files /dev/null and b/public/img/back/level6.png differ
diff --git a/public/img/back/level7.png b/public/img/back/level7.png
new file mode 100644
index 0000000..0d164b5
Binary files /dev/null and b/public/img/back/level7.png differ
diff --git a/public/img/back/level8.png b/public/img/back/level8.png
new file mode 100644
index 0000000..e2041c7
Binary files /dev/null and b/public/img/back/level8.png differ
diff --git a/src/components/timeline/index.jsx b/src/components/timeline/index.jsx
index df82985..ae5fc01 100644
--- a/src/components/timeline/index.jsx
+++ b/src/components/timeline/index.jsx
@@ -2,7 +2,7 @@
* @Author: Chengliang 1546584672@qq.com
* @Date: 2023-06-25 16:33:21
* @LastEditors: Chengliang 1546584672@qq.com
- * @LastEditTime: 2023-06-25 18:15:45
+ * @LastEditTime: 2023-06-27 10:51:02
* @FilePath: /org-chart-frant/src/components/timeline/index.jsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -18,8 +18,18 @@ export default class TimeLine extends React.Component {
};
}
- handleLineClick(item) {
- debugger;
+ handleLineClick(data) {
+ let newList = this.state.timelineList.map((item) => {
+ item.color = 'grey';
+ if (item.key == data.key) {
+ item.color = 'blue';
+ }
+ return item;
+ });
+ this.setState({
+ timelineList: newList,
+ });
+ this.props.onClick(data);
}
componentDidMount() {
@@ -31,17 +41,17 @@ export default class TimeLine extends React.Component {
// });
// });
const datas = [
- { key: '0', title: '当前版本', color: 'blue', time: '2022-01-09' },
- { key: '1', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '2', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '3', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '4', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '5', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '6', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '7', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '8', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '9', title: '测试', color: 'grey', time: '2022-01-09' },
- { key: '10', title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 0, title: '当前版本', color: 'blue', time: '2022-01-09' },
+ { key: 1, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 2, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 3, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 4, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 5, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 6, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 7, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 8, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 9, title: '测试', color: 'grey', time: '2022-01-09' },
+ { key: 10, title: '测试', color: 'grey', time: '2022-01-09' },
];
this.setState({
timelineList: datas,
@@ -55,11 +65,13 @@ export default class TimeLine extends React.Component {
{this.state.timelineList.map((item) => {
return (
- {item.title}
{' '}
+ {item.title}
{item.time}
);
diff --git a/src/components/timeline/index.less b/src/components/timeline/index.less
index 7ece1ab..55d216d 100644
--- a/src/components/timeline/index.less
+++ b/src/components/timeline/index.less
@@ -1,14 +1,16 @@
.lineWrapper {
width: 208px;
- height: 480px;
+ height: calc(~'100% - 200px');
overflow-y: scroll;
position: fixed;
left: 10px;
z-index: 100;
background: #fff;
border-radius: 20px;
- padding-top: 10px;
- padding-bottom: 10px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ padding-left: 20px;
+
.timeline {
cursor: pointer;
}
@@ -21,3 +23,33 @@
color: dimgray;
}
}
+
+.lineWrapper::-webkit-scrollbar {
+ /*滚动条整体样式*/
+ width: 10px;
+ /*高宽分别对应横竖滚动条的尺寸*/
+ height: 1px;
+}
+
+.lineWrapper::-webkit-scrollbar-thumb {
+ /*滚动条里面小方块*/
+ border-radius: 10px;
+ background-color: skyblue;
+ background-image: -webkit-linear-gradient(
+ 45deg,
+ rgba(255, 255, 255, 0.2) 25%,
+ transparent 25%,
+ transparent 50%,
+ rgba(255, 255, 255, 0.2) 50%,
+ rgba(255, 255, 255, 0.2) 75%,
+ transparent 75%,
+ transparent
+ );
+}
+
+.lineWrapper::-webkit-scrollbar-track {
+ /*滚动条里面轨道*/
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+ background: #ededed;
+ border-radius: 10px;
+}
diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx
index bdc5853..5dba488 100644
--- a/src/components/topBar/index.jsx
+++ b/src/components/topBar/index.jsx
@@ -9,6 +9,7 @@ import {
Col,
Dropdown,
Menu,
+ TreeSelect,
} from 'antd';
const { Option } = Select;
import moment from 'moment';
@@ -21,26 +22,33 @@ export class TopBar extends React.Component {
super(props);
this.state = {
fclasslist: [],
- companylist: [],
+ rootTreeData: [], //根节点异步树
+ treeExpandedKeys: [],
requestData: {
- date: moment(new Date()).format('YYYY-MM-DD'),
fclass: '0',
- root: '0',
+ root: undefined,
level: '3',
fisvitual: '0',
},
};
}
+ /**
+ * 表单值改变
+ * @param {*} payload
+ */
handleFormChange(payload) {
let requestData = { ...this.state.requestData, ...payload };
this.setState({ requestData });
}
- //日期可选择未来
- // disabledDate (current) {
- // // return current && current >moment().subtract(1, "days");
- // return current && current > moment().endOf("day");
- // }
+
+ /**
+ * 组织维度改变
+ */
+ changeFclass() {
+ debugger;
+ this.getSeatchCondition(this.props.url);
+ }
handleExportMenuClick(e) {
this.props.onExport(e.key == '1' ? 'png' : 'pdf');
@@ -50,16 +58,70 @@ export class TopBar extends React.Component {
this.props.onExport('png');
}
+ /**
+ * 根节点树数据
+ * @param {} parentId
+ * @returns
+ */
+ getNodeTreeNode = (parentId) => {
+ const { fclass } = this.state.requestData;
+ let api =
+ '/api/bs/hrmorganization/orgchart/getSubCompanyTree?subcompany=' +
+ parentId +
+ '&fclass=' +
+ fclass;
+ fetch(api)
+ .then((res) => res.json())
+ .then((data) => {
+ if (data.api_status) {
+ let arr = [...this.state.rootTreeData, ...data.companyTree];
+ this.setState({
+ rootTreeData: arr,
+ });
+ }
+ });
+ };
+
+ /**
+ * 根节点树异步加载
+ * @param {} parentId
+ * @returns
+ */
+ onRootLoadData = (treeNode) =>
+ new Promise((resolve) => {
+ const { id } = treeNode.props;
+ setTimeout(() => {
+ this.getNodeTreeNode(id);
+ resolve(undefined);
+ }, 1000);
+ });
+
+ onRootChange = (value) => {
+ debugger;
+ let requestData = { ...this.state.requestData, root: value };
+ this.setState({ requestData });
+ };
+
+ onTreeExpand = (expandedKeys) => {
+ this.setState({
+ treeExpandedKeys: expandedKeys,
+ });
+ };
+
componentDidMount() {
- fetch(this.props.url)
+ this.getSeatchCondition(this.props.url);
+ }
+
+ getSeatchCondition = (url) => {
+ fetch(url)
.then((res) => res.json())
.then((data) => {
this.setState({
fclasslist: data.fclasslist,
- companylist: data.companylist,
+ rootTreeData: data.companyTree,
});
});
- }
+ };
menu = (