同步按钮限制
This commit is contained in:
parent
9448bf416c
commit
052d5bb0d8
|
|
@ -79,7 +79,7 @@ export class TopBar extends React.Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { type } = this.props;
|
const { type, disabled } = this.props;
|
||||||
return (
|
return (
|
||||||
<div className={style.topbarWrapper}>
|
<div className={style.topbarWrapper}>
|
||||||
<Row>
|
<Row>
|
||||||
|
|
@ -180,6 +180,7 @@ export class TopBar extends React.Component {
|
||||||
<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('');
|
||||||
|
|
@ -300,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())
|
||||||
|
|
@ -309,6 +311,7 @@ export default function companyPage() {
|
||||||
} else {
|
} else {
|
||||||
message.error('数据同步失败');
|
message.error('数据同步失败');
|
||||||
}
|
}
|
||||||
|
setDisabled(false);
|
||||||
//this.handleSearch(requestData);
|
//this.handleSearch(requestData);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -357,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=aaa8t8NhMwvKIfAj0k2xy; JSESSIONID=aaa8t8NhMwvKIfAj0k2xy; loginidweaver=1; languageidweaver=7; loginuuids=1; __randcode__=6e66db16-76ba-4330-b36b-bba1d5cd0039';
|
'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…
Reference in New Issue