--fix bug

This commit is contained in:
yuping
2023-03-22 14:55:37 +08:00
parent 5faf76f439
commit 98d97f0c27

View File

@@ -132,7 +132,7 @@
</template> </template>
<script setup> <script setup>
import {computed, defineEmits, ref, watch} from "vue"; import {computed, defineEmits, nextTick, ref, watch} from "vue";
import * as api from "@/api/index1"; import * as api from "@/api/index1";
import BaseTable from "@/components/common/BaseTable"; import BaseTable from "@/components/common/BaseTable";
import {message} from "ant-design-vue"; import {message} from "ant-design-vue";
@@ -287,7 +287,8 @@ const columns = ref([
]); ]);
const { data = [], loading, fetchData } = useRequest(COURSE_PLAN_LIST, planParams, false); const { data = [], loading, fetchData } = useRequest(COURSE_PLAN_LIST, planParams, false);
watch(() => data.value.length, () => { watch(() => data.value, () => {
coursePlanIndex.value = 0
params.value.pid = data.value[coursePlanIndex.value]?.id || 0; params.value.pid = data.value[coursePlanIndex.value]?.id || 0;
tableRef.value.fetch(); tableRef.value.fetch();
}); });
@@ -359,7 +360,7 @@ function exportTaskStu() {
} }
function afterVisibleChange(bool) { function afterVisibleChange(bool) {
bool && fetchData(); bool && fetchData()
} }
function resetStudentPage() { function resetStudentPage() {