Compare commits
5 Commits
master
...
feature/mogen
| Author | SHA1 | Date |
|---|---|---|
|
|
052d5bb0d8 | |
|
|
9448bf416c | |
|
|
106b09a320 | |
|
|
83cee06fd8 | |
|
|
8afd0357ce |
|
|
@ -26,8 +26,9 @@ export class TopBar extends React.Component {
|
|||
date: moment(new Date()).format('YYYY-MM-DD'),
|
||||
fclass: '0',
|
||||
root: '0',
|
||||
level: '3',
|
||||
level: props.type == 'company' ? '0' : '3',
|
||||
fisvitual: '0',
|
||||
outkey: '0',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -78,6 +79,7 @@ export class TopBar extends React.Component {
|
|||
);
|
||||
|
||||
render() {
|
||||
const { type, disabled } = this.props;
|
||||
return (
|
||||
<div className={style.topbarWrapper}>
|
||||
<Row>
|
||||
|
|
@ -138,11 +140,11 @@ export class TopBar extends React.Component {
|
|||
<Col span={6}>
|
||||
显示层级:
|
||||
<Select
|
||||
defaultValue="3"
|
||||
defaultValue={type == 'company' ? '0' : '3'}
|
||||
style={{ width: 120 }}
|
||||
value={this.state.requestData.level}
|
||||
onChange={(value) => this.handleFormChange({ level: value })}
|
||||
>
|
||||
{type == 'company' && <Option value="0">全部</Option>}
|
||||
<Option value="1">一级</Option>
|
||||
<Option value="2">二级</Option>
|
||||
<Option value="3">三级</Option>
|
||||
|
|
@ -162,10 +164,23 @@ export class TopBar extends React.Component {
|
|||
显示虚拟组织
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Checkbox
|
||||
style={{ marginTop: '5px' }}
|
||||
onChange={(e) =>
|
||||
this.handleFormChange({
|
||||
outkey: e.target.checked ? '1' : '0',
|
||||
})
|
||||
}
|
||||
>
|
||||
显示外部用户组织
|
||||
</Checkbox>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{ marginRight: '10px' }}
|
||||
disabled={disabled}
|
||||
onClick={() => {
|
||||
this.props.onSynchronous(this.state.requestData);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default function companyPage() {
|
|||
const [sliderProgress, setSliderProgress] = useState(50);
|
||||
let addNodeChildFunc = null;
|
||||
let orgChart = null;
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
|
||||
let topBarSearchRequest = null;
|
||||
const [hasRight, setHasRight] = useState('');
|
||||
|
|
@ -72,7 +73,7 @@ export default function companyPage() {
|
|||
function getDepartmentImage() {
|
||||
let index = Math.floor(Math.random() * 8) + 1;
|
||||
// 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) {
|
||||
return 160;
|
||||
} else if (d.data.ftype == 2) {
|
||||
return 144;
|
||||
return 164;
|
||||
}
|
||||
return 200;
|
||||
};
|
||||
|
|
@ -121,7 +122,7 @@ export default function companyPage() {
|
|||
} else if (d.data.ftype == 1) {
|
||||
return 160;
|
||||
} else if (d.data.ftype == 2) {
|
||||
return 56;
|
||||
return 106;
|
||||
}
|
||||
return 120;
|
||||
};
|
||||
|
|
@ -153,41 +154,44 @@ export default function companyPage() {
|
|||
</div>
|
||||
</div>`;
|
||||
} else if (d.data.ftype == 1) {
|
||||
return `<div onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${subcompanyUrl}', '_blank')">
|
||||
return `<div>
|
||||
<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 style="width: 136px; border: 1px solid #66BAF5; margin: 10px auto 0px; border-radius: 23px; text-align: center;
|
||||
font-size: 14px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 18px;
|
||||
padding: 15px 10px;
|
||||
">
|
||||
${d.data.fname}
|
||||
<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;">
|
||||
<span onclick="if(${d.data.fisvitual}==1) return;window.open('${subcompanyUrl}', '_blank')" style="font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: blue;;
|
||||
line-height: 18px;">${d.data.fname}</span>
|
||||
<div style="font-weight: 400;margin-top: 3px;">
|
||||
<span>负责人: ${d.data.fleadername}</span>
|
||||
<span>在岗: ${d.data.empNum}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
} else if (d.data.ftype == 2) {
|
||||
return `
|
||||
<div style="width: 100%; height: 100%; background-size: 100% 100%;" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${departmentUrl}')">
|
||||
<div style='position:absolute'>
|
||||
<img src='./img/company_job_label.png'/></div>
|
||||
<div style="padding-left: 8px; padding-top: 23px;display:flex;align-items:center">
|
||||
<img src="${getDepartmentImage()}"/>
|
||||
<span style="
|
||||
margin-left: 3px;
|
||||
font-size: 12px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
">${d.data.fname}</span>
|
||||
</div>
|
||||
<div style="width: 100%; height: 100%; background-size: 100% 100%;" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${departmentUrl}')">
|
||||
<div style='position:absolute;height: 106px;'>
|
||||
<img style='height: 106px;width: 164px;' src='./img/company_job_label.png'/></div>
|
||||
<div style="padding-left: 8px; padding-top: 43px;display:flex;align-items:center">
|
||||
<img src="${getDepartmentImage()}"/>
|
||||
<div style="
|
||||
margin-left: 3px;
|
||||
font-size: 12px;
|
||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
">${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>
|
||||
`;
|
||||
}
|
||||
return `<div>${d.data.fname}</div>`;
|
||||
|
|
@ -297,6 +301,7 @@ export default function companyPage() {
|
|||
};
|
||||
|
||||
const handleSynchronous = (requestData) => {
|
||||
setDisabled(true);
|
||||
let api = '/api/bs/hrmorganization/orgchart/synchronousData';
|
||||
fetch(api)
|
||||
.then((res) => res.json())
|
||||
|
|
@ -306,6 +311,7 @@ export default function companyPage() {
|
|||
} else {
|
||||
message.error('数据同步失败');
|
||||
}
|
||||
setDisabled(false);
|
||||
//this.handleSearch(requestData);
|
||||
});
|
||||
};
|
||||
|
|
@ -354,6 +360,7 @@ export default function companyPage() {
|
|||
handleSynchronous(requestData);
|
||||
}}
|
||||
type="company"
|
||||
disabled={disabled}
|
||||
url="/api/bs/hrmorganization/orgchart/getCondition?type=company"
|
||||
/>
|
||||
<ToolBar
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ export default function userPage() {
|
|||
let progressBtnRef = null;
|
||||
|
||||
const [hasRight, setHasRight] = useState('');
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
|
||||
// 点击节点
|
||||
function onNodeClick(nodeId) {
|
||||
|
|
@ -87,7 +88,7 @@ export default function userPage() {
|
|||
// 获取数据
|
||||
useEffect(() => {
|
||||
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(
|
||||
// "/user/data"
|
||||
'/api/bs/hrmorganization/orgchart/userData?fclass=0&root=0&date=' +
|
||||
|
|
@ -216,6 +217,7 @@ export default function userPage() {
|
|||
};
|
||||
|
||||
const handleSynchronous = (requestData) => {
|
||||
setDisabled(true);
|
||||
let api = '/api/bs/hrmorganization/orgchart/synchronousData';
|
||||
fetch(api)
|
||||
.then((res) => res.json())
|
||||
|
|
@ -225,6 +227,7 @@ export default function userPage() {
|
|||
} else {
|
||||
message.error('数据同步失败');
|
||||
}
|
||||
setDisabled(false);
|
||||
//this.handleSearch(requestData);
|
||||
});
|
||||
};
|
||||
|
|
@ -514,6 +517,7 @@ export default function userPage() {
|
|||
onSynchronous={(requestData) => {
|
||||
handleSynchronous(requestData);
|
||||
}}
|
||||
disabled={disabled}
|
||||
type="user"
|
||||
url="/api/bs/hrmorganization/orgchart/getCondition?type=user"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue