作业设计:课程选择过快请求添加防抖

This commit is contained in:
白了个白 2024-11-11 10:02:23 +08:00
parent 96c074d396
commit 2929997d17
1 changed files with 15 additions and 8 deletions

View File

@ -287,6 +287,7 @@ import prevReadMsgDialog from '@/views/classTask/container/newTask/prevReadMsg-D
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue' import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo" import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuestion/jyeoo"
import {debounce } from '@/utils/comm'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user const userStore = useUserStore().user
@ -955,14 +956,8 @@ onMounted(async() => {
}) })
watch(() => props.propsformobj.uniquekey, (newVal) => { const debounceQueryData = debounce(() => {
console.log(props.propsformobj,'propsformobj') console.log("防抖 加载数据中...")
if(props.propsformobj.uniquekey){
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
}
})
watch(() => props.bookobj.levelSecondId, (newVal) => {
console.log(props.bookobj,'课程选择')
// //
initPageParams(); initPageParams();
// //
@ -971,6 +966,18 @@ watch(() => props.bookobj.levelSecondId, (newVal) => {
getQueryFromEvaluationclue(); getQueryFromEvaluationclue();
// //
getEntpCourseWorkPointList(); getEntpCourseWorkPointList();
}, 1000);
watch(() => props.propsformobj.uniquekey, (newVal) => {
console.log(props.propsformobj,'propsformobj')
if(props.propsformobj.uniquekey){
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; //
}
})
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
console.log(props.bookobj,'课程选择')
debounceQueryData();
}) })
</script> </script>