feat: 组织架构图新增虚拟组织

feature/orgChart
fanjie 3 years ago
parent 6a6bb51ea1
commit 1955d81162

@ -28,7 +28,9 @@ export class TopBar extends React.Component {
root: '0', root: '0',
level: '3', level: '3',
fisvitual: '0', fisvitual: '0',
isvitual: '0',
}, },
colSpan: props.type == 'user' ? 5 : 4,
}; };
} }
@ -81,7 +83,7 @@ export class TopBar extends React.Component {
return ( return (
<div className={style.topbarWrapper}> <div className={style.topbarWrapper}>
<Row> <Row>
<Col span={5}> <Col span={this.state.colSpan}>
数据日期 数据日期
<DatePicker <DatePicker
placeholder="请选择日期" placeholder="请选择日期"
@ -103,7 +105,7 @@ export class TopBar extends React.Component {
/> />
</Col> </Col>
<Col span={5}> <Col span={this.state.colSpan}>
维度 维度
<Select <Select
defaultValue="0" defaultValue="0"
@ -117,7 +119,7 @@ export class TopBar extends React.Component {
</Select> </Select>
</Col> </Col>
<Col span={5}> <Col span={this.state.colSpan}>
根节点 根节点
<Select <Select
showSearch showSearch
@ -135,7 +137,7 @@ export class TopBar extends React.Component {
</Select> </Select>
</Col> </Col>
<Col span={5}> <Col span={this.state.colSpan}>
显示层级 显示层级
<Select <Select
defaultValue="3" defaultValue="3"
@ -149,6 +151,21 @@ export class TopBar extends React.Component {
</Select> </Select>
</Col> </Col>
{this.props.type == 'company' && (
<Col span={this.state.colSpan}>
组织
<Select
defaultValue="0"
style={{ width: 120 }}
value={this.state.requestData.isvitual}
onChange={(value) => this.handleFormChange({ isvitual: value })}
>
<Option value="0">实体组织</Option>
<Option value="1">虚拟组织</Option>
</Select>
</Col>
)}
{/* <Col span={4}> {/* <Col span={4}>
<Checkbox style={{ marginTop: "5px" }} onChange={(e) => this.handleFormChange({fisvitual: e.target.checked ? "1": "0"})}>显示虚拟组织</Checkbox> <Checkbox style={{ marginTop: "5px" }} onChange={(e) => this.handleFormChange({fisvitual: e.target.checked ? "1": "0"})}>显示虚拟组织</Checkbox>
</Col> */} </Col> */}

@ -86,11 +86,11 @@ export default function companyPage() {
useEffect(() => { useEffect(() => {
d3.json( d3.json(
// "/company/data" // "/company/data"
'/api/bs/hrmorganization/orgchart/companyData?fclass=0&root=0&date=' + '/api/bs/hrmorganization/orgchart/companyData?fclass=0&isvitual=0&root=0&date=' +
moment(new Date()).format('YYYY-MM-DD'), moment(new Date()).format('YYYY-MM-DD'),
).then((data) => { ).then((data) => {
setData(data.data); setData(data.data);
setHasRight(data.hasRight); setHasRight(data?.hasRight);
}); });
}, [true]); }, [true]);
@ -331,6 +331,7 @@ export default function companyPage() {
onSearch={(requestData) => { onSearch={(requestData) => {
handleSearch(requestData); handleSearch(requestData);
}} }}
type="company"
url="/api/bs/hrmorganization/orgchart/getCondition?type=company" url="/api/bs/hrmorganization/orgchart/getCondition?type=company"
/> />
<ToolBar <ToolBar

@ -88,7 +88,7 @@ export default function userPage() {
// //
useEffect(() => { useEffect(() => {
document.cookie = document.cookie =
'ecology_JSessionId=abcs4Umove2Bhcz57t6oy; JSESSIONID=abcs4Umove2Bhcz57t6oy; ecology_JSessionid=abcs4Umove2Bhcz57t6oy; languageidweaver=7; loginuuids=1; i_like_gitea=6a881aa47092d822; lang=zh-CN; loginidweaver=1; __randcode__=0ee558a3-ceee-4a97-bea3-00f47801e62a'; 'ecology_JSessionid=aaa1QNMWge48Bh-3oq6oy; JSESSIONID=aaa1QNMWge48Bh-3oq6oy; loginidweaver=1; languageidweaver=7; loginuuids=1; __randcode__=f7afbede-58e5-484e-bd5e-cc38d51ea68c';
d3.json( d3.json(
// "/user/data" // "/user/data"
'/api/bs/hrmorganization/orgchart/userData?fclass=0&root=0&date=' + '/api/bs/hrmorganization/orgchart/userData?fclass=0&root=0&date=' +
@ -474,6 +474,7 @@ export default function userPage() {
setRequestRes(requestData); setRequestRes(requestData);
handleSearch(requestData); handleSearch(requestData);
}} }}
type="user"
url="/api/bs/hrmorganization/orgchart/getCondition?type=user" url="/api/bs/hrmorganization/orgchart/getCondition?type=user"
/> />
<ToolBar <ToolBar

Loading…
Cancel
Save