Commit 7deb0218 by zhangleyuan

feat:处理培训计划的防重

parent 9db4a7ae
......@@ -2,7 +2,7 @@
* @Author: zhangleyuan
* @Date: 2021-02-20 16:13:39
* @LastEditors: zhangleyuan
* @LastEditTime: 2021-03-13 14:58:38
* @LastEditTime: 2021-03-15 10:33:56
* @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -39,6 +39,7 @@ function AddPlan() {
const [taskList,setTaskList] = useState(defaultTaskList);
const [expiredCourseList,setExpiredCourseList] = useState([]);
const [hasGetDetail,setHasGetDetail]= useState(false);
const [submitDisabled,setSubmitDisabled] = useState(false);
useEffect(()=>{
if(type==='edit'){
getPlanDetail();
......@@ -192,6 +193,7 @@ function AddPlan() {
PlanService.createTrainingPlan(params).then((res) => {
if (res.success){
message.success("新建成功");
setSubmitDisabled(true);
window.RCHistory.goBack();
}
});
......@@ -280,7 +282,7 @@ function AddPlan() {
</div>
<div className="footer">
<Button onClick={handleGoBack}>取消</Button>
<Button type="primary" onClick={submitInfo}>保存</Button>
<Button type="primary" onClick={submitInfo} disabled={submitDisabled}>保存</Button>
</div>
</div>
)
......
......@@ -39,7 +39,7 @@ function PlanFilter(props) {
useEffect(() => {
getCreatorList();
}, [creatorQuery]);
}, []);
// 改变搜索条件
function handleChangeQuery(field, value){
......@@ -98,6 +98,9 @@ function PlanFilter(props) {
const container = e.target;
const scrollToBottom = container && container.scrollHeight <= container.clientHeight + container.scrollTop;
if (scrollToBottom && hasNext) {
const _creatorQuery = {...creatorQuery};
_creatorQuery.current = creatorQuery.current + 1;
setCreatorQuery(_creatorQuery);
getCreatorList(creatorQuery.current + 1);
}
}
......
......@@ -44,7 +44,7 @@ function UserLearningDataFilter(props) {
}, []);
useEffect(() => {
getCreatorList();
}, [creatorQuery]);
}, []);
function handleChangeCreatorQuery (value){
const _creatorQuery = {...creatorQuery};
......@@ -108,6 +108,9 @@ function UserLearningDataFilter(props) {
const container = e.target;
const scrollToBottom = container && container.scrollHeight <= container.clientHeight + container.scrollTop;
if (scrollToBottom && hasNext) {
const _creatorQuery = {...creatorQuery};
_creatorQuery.current = creatorQuery.current + 1;
setCreatorQuery(_creatorQuery);
getCreatorList(creatorQuery.current + 1);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment