Compare commits

...

5 Commits

@ -26,8 +26,9 @@ export class TopBar extends React.Component {
date: moment(new Date()).format('YYYY-MM-DD'), date: moment(new Date()).format('YYYY-MM-DD'),
fclass: '0', fclass: '0',
root: '0', root: '0',
level: '3', level: props.type == 'company' ? '0' : '3',
fisvitual: '0', fisvitual: '0',
outkey: '0',
}, },
}; };
} }
@ -78,6 +79,7 @@ export class TopBar extends React.Component {
); );
render() { render() {
const { type, disabled } = this.props;
return ( return (
<div className={style.topbarWrapper}> <div className={style.topbarWrapper}>
<Row> <Row>
@ -138,11 +140,11 @@ export class TopBar extends React.Component {
<Col span={6}> <Col span={6}>
显示层级 显示层级
<Select <Select
defaultValue="3" defaultValue={type == 'company' ? '0' : '3'}
style={{ width: 120 }} style={{ width: 120 }}
value={this.state.requestData.level}
onChange={(value) => this.handleFormChange({ level: value })} onChange={(value) => this.handleFormChange({ level: value })}
> >
{type == 'company' && <Option value="0">全部</Option>}
<Option value="1">一级</Option> <Option value="1">一级</Option>
<Option value="2">二级</Option> <Option value="2">二级</Option>
<Option value="3">三级</Option> <Option value="3">三级</Option>
@ -162,10 +164,23 @@ export class TopBar extends React.Component {
显示虚拟组织 显示虚拟组织
</Checkbox> </Checkbox>
</Col> </Col>
<Col span={6}>
<Checkbox
style={{ marginTop: '5px' }}
onChange={(e) =>
this.handleFormChange({
outkey: e.target.checked ? '1' : '0',
})
}
>
显示外部用户组织
</Checkbox>
</Col>
<Col span={6}> <Col span={6}>
<Button <Button
type="primary" type="primary"
style={{ marginRight: '10px' }} style={{ marginRight: '10px' }}
disabled={disabled}
onClick={() => { onClick={() => {
this.props.onSynchronous(this.state.requestData); this.props.onSynchronous(this.state.requestData);
}} }}

@ -15,6 +15,7 @@ export default function companyPage() {
const [sliderProgress, setSliderProgress] = useState(50); const [sliderProgress, setSliderProgress] = useState(50);
let addNodeChildFunc = null; let addNodeChildFunc = null;
let orgChart = null; let orgChart = null;
const [disabled, setDisabled] = useState(false);
let topBarSearchRequest = null; let topBarSearchRequest = null;
const [hasRight, setHasRight] = useState(''); const [hasRight, setHasRight] = useState('');
@ -72,7 +73,7 @@ export default function companyPage() {
function getDepartmentImage() { function getDepartmentImage() {
let index = Math.floor(Math.random() * 8) + 1; let index = Math.floor(Math.random() * 8) + 1;
// return `./img/department/${index}.png`; // return `./img/department/${index}.png`;
return `./img/department/1.png`; return `./img/department/2.png`;
} }
// //
@ -110,7 +111,7 @@ export default function companyPage() {
} else if (d.data.ftype == 1) { } else if (d.data.ftype == 1) {
return 160; return 160;
} else if (d.data.ftype == 2) { } else if (d.data.ftype == 2) {
return 144; return 164;
} }
return 200; return 200;
}; };
@ -121,7 +122,7 @@ export default function companyPage() {
} else if (d.data.ftype == 1) { } else if (d.data.ftype == 1) {
return 160; return 160;
} else if (d.data.ftype == 2) { } else if (d.data.ftype == 2) {
return 56; return 106;
} }
return 120; return 120;
}; };
@ -153,39 +154,42 @@ export default function companyPage() {
</div> </div>
</div>`; </div>`;
} else if (d.data.ftype == 1) { } else if (d.data.ftype == 1) {
return `<div onclick="if(${ return `<div>
d.data.fisvitual
}==1) return;window.open('${subcompanyUrl}', '_blank')">
<div style="width: 85px; height: 85px; border: 1px solid #66BAF5; border-radius: 50%;text-align: center; line-height: 85px; margin: 0 auto;display:flex;justify-content:center;align-items:center"> <div style="width: 85px; height: 85px; border: 1px solid #66BAF5; border-radius: 50%;text-align: center; line-height: 85px; margin: 0 auto;display:flex;justify-content:center;align-items:center">
<img src="${getSubcompanyImage()}" /> <img src="./img/company.png" />
</div> </div>
<div style="width: 136px; border: 1px solid #66BAF5; margin: 10px auto 0px; border-radius: 23px; text-align: center; <div style="text-align: center;width: 180px; border: 1px solid #66BAF5; margin: 10px auto 0px; border-radius: 23px; padding: 15px 10px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;">
font-size: 14px; <span onclick="if(${d.data.fisvitual}==1) return;window.open('${subcompanyUrl}', '_blank')" style="font-size: 14px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-weight: 400; font-weight: 400;
color: #333333; color: blue;;
line-height: 18px; line-height: 18px;">${d.data.fname}</span>
padding: 15px 10px; <div style="font-weight: 400;margin-top: 3px;">
"> <span>负责人: ${d.data.fleadername}</span>
${d.data.fname} <span>在岗: ${d.data.empNum}</span>
</div>
</div> </div>
</div>`; </div>`;
} else if (d.data.ftype == 2) { } else if (d.data.ftype == 2) {
return ` return `
<div style="width: 100%; height: 100%; background-size: 100% 100%;" onclick="if(${ <div style="width: 100%; height: 100%; background-size: 100% 100%;" onclick="if(${
d.data.fisvitual d.data.fisvitual
}==1) return;window.open('${departmentUrl}')"> }==1) return;window.open('${departmentUrl}')">
<div style='position:absolute'> <div style='position:absolute;height: 106px;'>
<img src='./img/company_job_label.png'/></div> <img style='height: 106px;width: 164px;' src='./img/company_job_label.png'/></div>
<div style="padding-left: 8px; padding-top: 23px;display:flex;align-items:center"> <div style="padding-left: 8px; padding-top: 43px;display:flex;align-items:center">
<img src="${getDepartmentImage()}"/> <img src="${getDepartmentImage()}"/>
<span style=" <div style="
margin-left: 3px; margin-left: 3px;
font-size: 12px; font-size: 12px;
font-family: Microsoft YaHei-Regular, Microsoft YaHei; font-family: Microsoft YaHei-Regular, Microsoft YaHei;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
">${d.data.fname}</span> ">${d.data.fname}</div>
</div>
<div style="font-weight: 400;margin-top: 3px;padding-left: 8px;">
<span>负责人: ${d.data.fleadername}</span>
<span>在岗: ${d.data.empNum}</span>
</div> </div>
</div> </div>
`; `;
@ -297,6 +301,7 @@ export default function companyPage() {
}; };
const handleSynchronous = (requestData) => { const handleSynchronous = (requestData) => {
setDisabled(true);
let api = '/api/bs/hrmorganization/orgchart/synchronousData'; let api = '/api/bs/hrmorganization/orgchart/synchronousData';
fetch(api) fetch(api)
.then((res) => res.json()) .then((res) => res.json())
@ -306,6 +311,7 @@ export default function companyPage() {
} else { } else {
message.error('数据同步失败'); message.error('数据同步失败');
} }
setDisabled(false);
//this.handleSearch(requestData); //this.handleSearch(requestData);
}); });
}; };
@ -354,6 +360,7 @@ export default function companyPage() {
handleSynchronous(requestData); handleSynchronous(requestData);
}} }}
type="company" type="company"
disabled={disabled}
url="/api/bs/hrmorganization/orgchart/getCondition?type=company" url="/api/bs/hrmorganization/orgchart/getCondition?type=company"
/> />
<ToolBar <ToolBar

@ -25,6 +25,7 @@ export default function userPage() {
let progressBtnRef = null; let progressBtnRef = null;
const [hasRight, setHasRight] = useState(''); const [hasRight, setHasRight] = useState('');
const [disabled, setDisabled] = useState(false);
// //
function onNodeClick(nodeId) { function onNodeClick(nodeId) {
@ -87,7 +88,7 @@ export default function userPage() {
// //
useEffect(() => { useEffect(() => {
document.cookie = document.cookie =
'Webstorm-3d4d3ad4=b8ca5bef-a131-4c2b-81da-6f8595481dc2; ecology_JSessionid=aaad2HRSW843U9BJFcUuy; JSESSIONID=aaad2HRSW843U9BJFcUuy; loginidweaver=1; languageidweaver=7; loginuuids=1; __randcode__=47f1e1cc-51de-48b3-af04-3875b717805f'; 'Webstorm-3d4d3ad4=b8ca5bef-a131-4c2b-81da-6f8595481dc2; ecology_JSessionid=aaa8t8NhMwvKIfAj0k2xy; JSESSIONID=aaa8t8NhMwvKIfAj0k2xy; loginidweaver=1; languageidweaver=7; loginuuids=1; __randcode__=f106a64a-ffa9-4ef0-853c-7e4b8ab47601';
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=' +
@ -216,6 +217,7 @@ export default function userPage() {
}; };
const handleSynchronous = (requestData) => { const handleSynchronous = (requestData) => {
setDisabled(true);
let api = '/api/bs/hrmorganization/orgchart/synchronousData'; let api = '/api/bs/hrmorganization/orgchart/synchronousData';
fetch(api) fetch(api)
.then((res) => res.json()) .then((res) => res.json())
@ -225,6 +227,7 @@ export default function userPage() {
} else { } else {
message.error('数据同步失败'); message.error('数据同步失败');
} }
setDisabled(false);
//this.handleSearch(requestData); //this.handleSearch(requestData);
}); });
}; };
@ -514,6 +517,7 @@ export default function userPage() {
onSynchronous={(requestData) => { onSynchronous={(requestData) => {
handleSynchronous(requestData); handleSynchronous(requestData);
}} }}
disabled={disabled}
type="user" type="user"
url="/api/bs/hrmorganization/orgchart/getCondition?type=user" url="/api/bs/hrmorganization/orgchart/getCondition?type=user"
/> />

Loading…
Cancel
Save