Add deep links for pending approval notifications
This commit is contained in:
1 parent
ce8982dba9
commit
4c95edb678
9 files changed
+191
-34
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Check, Plus, Refresh } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
@@ -35,6 +35,10 @@ const mineTotal = ref(0)
|
||||
const reviewPage = ref(1)
|
||||
const reviewTotal = ref(0)
|
||||
const pageSize = 20
|
||||
const targetAdjustmentId = computed(() => {
|
||||
const value = route.query.adjustmentId
|
||||
return typeof value === 'string' ? value : undefined
|
||||
})
|
||||
|
||||
const form = reactive({
|
||||
teachingTaskId: undefined as string | undefined,
|
||||
@@ -104,7 +108,12 @@ async function load(resetPages = false) {
|
||||
}
|
||||
if (isManager.value) {
|
||||
const response = await http.get('/course-adjustments/pending-reviews', {
|
||||
params: { academicTermId: termId.value, page: reviewPage.value, pageSize },
|
||||
params: {
|
||||
academicTermId: targetAdjustmentId.value ? undefined : termId.value,
|
||||
adjustmentId: targetAdjustmentId.value,
|
||||
page: reviewPage.value,
|
||||
pageSize,
|
||||
},
|
||||
})
|
||||
pendingReviews.value = response.data.items
|
||||
reviewTotal.value = response.data.total
|
||||
@@ -249,12 +258,21 @@ onMounted(async () => {
|
||||
ElMessage.error(apiErrorMessage(error))
|
||||
}
|
||||
await load()
|
||||
if (isManager.value && targetAdjustmentId.value) tab.value = 'reviews'
|
||||
if (isTeacher.value && route.query.create === '1') {
|
||||
openCreate()
|
||||
await router.replace({ path: '/course-adjustments' })
|
||||
}
|
||||
})
|
||||
|
||||
watch(targetAdjustmentId, async () => {
|
||||
if (isManager.value) {
|
||||
tab.value = 'reviews'
|
||||
reviewPage.value = 1
|
||||
await load()
|
||||
}
|
||||
})
|
||||
|
||||
function changeType() {
|
||||
form.targetDate = ''
|
||||
form.startPeriod = undefined
|
||||
|
||||
Reference in new issue
Block a user