Commit 7deb0218 by zhangleyuan

feat:处理培训计划的防重

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