diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..7397789 Binary files /dev/null and b/dist.zip differ diff --git a/public/img/company/level1.png b/public/img/company/level1.png new file mode 100644 index 0000000..2c33e84 Binary files /dev/null and b/public/img/company/level1.png differ diff --git a/public/img/company/level2.png b/public/img/company/level2.png new file mode 100644 index 0000000..d89175a Binary files /dev/null and b/public/img/company/level2.png differ diff --git a/public/img/company/level3.png b/public/img/company/level3.png new file mode 100644 index 0000000..2e37486 Binary files /dev/null and b/public/img/company/level3.png differ diff --git a/public/img/company/level4.png b/public/img/company/level4.png new file mode 100644 index 0000000..e249512 Binary files /dev/null and b/public/img/company/level4.png differ diff --git a/public/img/company/level5.png b/public/img/company/level5.png new file mode 100644 index 0000000..c93f9e1 Binary files /dev/null and b/public/img/company/level5.png differ diff --git a/public/img/company/level6.png b/public/img/company/level6.png new file mode 100644 index 0000000..e910445 Binary files /dev/null and b/public/img/company/level6.png differ diff --git a/public/img/company/level7.png b/public/img/company/level7.png new file mode 100644 index 0000000..5b2def4 Binary files /dev/null and b/public/img/company/level7.png differ diff --git a/public/img/company/level8.png b/public/img/company/level8.png new file mode 100644 index 0000000..2a7ca55 Binary files /dev/null and b/public/img/company/level8.png differ diff --git a/src/components/toolBar/index.less b/src/components/toolBar/index.less index ffe10d8..355cd4b 100644 --- a/src/components/toolBar/index.less +++ b/src/components/toolBar/index.less @@ -1,38 +1,38 @@ .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: 20px; + // cursor: pointer; + } +} diff --git a/src/components/topBar/index.jsx b/src/components/topBar/index.jsx index f4b0904..d0aab66 100644 --- a/src/components/topBar/index.jsx +++ b/src/components/topBar/index.jsx @@ -25,8 +25,8 @@ export class TopBar extends React.Component { levelOptions: [], //层级数据,hrm中层级字段 requestData: { date: moment(new Date()).format('YYYY-MM-DD'), //日期 - department: [], - level: '2', //显示层级 + department: undefined, + level: '0', //显示层级 }, }; } @@ -46,36 +46,17 @@ export class TopBar extends React.Component { * @returns */ getDepartmentTreeNode = (parentId) => { - // let api = - // '/api/bs/hrmorganization/jclorgchart/getDepartmentTree?department=' + - // parentId; - // fetch(api) - // .then((res) => res.json()) - // .then((data) => { - // if (data.code == 200) { - // let arr = [...this.state.deptartmentTreeData, ...data.data]; - // this.setState({ - // deptartmentTreeData: arr, - // }); - // } - // }); - let treeData = []; - if (parentId === null) { - treeData = [ - { id: 1, pId: 0, value: '1', title: 'Expand to load' }, - { id: 2, pId: 0, value: '2', title: 'Expand to load' }, - { id: 3, pId: 0, value: '3', title: 'Tree Node', isLeaf: true }, - ]; - } else { - treeData = [ - { id: 6, pId: 1, value: '3', title: 'Tree Node', isLeaf: true }, - ]; - } - - let arr = [...this.state.deptartmentTreeData, ...treeData]; - this.setState({ - deptartmentTreeData: arr, - }); + let api = '/api/ais/orgChart/getDepartmentTree?department=' + parentId; + fetch(api) + .then((res) => res.json()) + .then((data) => { + if (data.status) { + let arr = [...this.state.deptartmentTreeData, ...data.data.deptTree]; + this.setState({ + deptartmentTreeData: arr, + }); + } + }); }; /** @@ -88,13 +69,12 @@ export class TopBar extends React.Component { const { id } = treeNode.props; setTimeout(() => { this.getDepartmentTreeNode(id); - resolve(); - }, 300); + resolve(undefined); + }, 1000); }); onDepartmentChange = (value) => { - let department = value.length > 0 ? this.paramsUtil(value) : undefined; - let requestData = { ...this.state.requestData, department: department }; + let requestData = { ...this.state.requestData, department: value }; this.setState({ departmentData: value, requestData }); }; @@ -112,28 +92,16 @@ export class TopBar extends React.Component { }; componentDidMount() { - // fetch(this.props.url) - // .then((res) => res.json()) - // .then((data) => { - // this.setState({ - // levelOptions: data.levelOptions - // }); - // }); - - const options = [ - { value: '1', label: '一级' }, - { value: '2', label: '二级' }, - { value: '3', label: '三级' }, - ]; - const treeData = [ - { id: 1, pId: 0, value: '1', title: 'Expand to load' }, - { id: 2, pId: 0, value: '2', title: 'Expand to load' }, - { id: 3, pId: 0, value: '3', title: 'Tree Node', isLeaf: true }, - ]; - this.setState({ - levelOptions: options, - }); - this.getDepartmentTreeNode(null); + fetch(this.props.url) + .then((res) => res.json()) + .then((data) => { + if (data.status) { + this.setState({ + levelOptions: data.data.deptLevel, + deptartmentTreeData: data.data.deptTree, + }); + } + }); } /** @@ -155,15 +123,15 @@ export class TopBar extends React.Component { ); render() { - const { deptartmentTreeData, treeExpandedKeys } = this.state; + const { deptartmentTreeData } = this.state; return (
- + 日期追溯: 部门: - 显示层级: + 部门层级: