fix: 换账号报错
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7089fe521f
commit
3534feff4b
|
|
@ -4,6 +4,7 @@ import type * as API from '@/service/types'
|
|||
import { useQuery } from '@tanstack/vue-query'
|
||||
import UniEcharts from 'uni-echarts'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { teacherAnalysisTrendUsingPost } from '@/service/laoshichengjifenxi'
|
||||
import { useHomeStore } from '@/store/home'
|
||||
|
||||
|
|
@ -74,15 +75,16 @@ const {
|
|||
isLoading: loading,
|
||||
refetch: refetchData,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'class-trend',
|
||||
useUserId(),
|
||||
homeStore.selectedClassId,
|
||||
homeStore.selectedGradeKey,
|
||||
compareClassId.value,
|
||||
compareClassGradeKey.value,
|
||||
compareClassId,
|
||||
compareClassGradeKey,
|
||||
props.selectedSubjectId,
|
||||
topN.value,
|
||||
]),
|
||||
topN,
|
||||
],
|
||||
queryFn: async () => {
|
||||
const response = await teacherAnalysisTrendUsingPost({
|
||||
body: {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useQuery, useQueryClient } from '@tanstack/vue-query'
|
|||
import { useDebounceFn, useThrottleFn } from '@vueuse/core'
|
||||
import { computed, inject, provide, readonly, ref, watch } from 'vue'
|
||||
import { examMarkingTaskApi } from '@/api'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
|
||||
export interface MarkingSubmitData {
|
||||
score: number
|
||||
|
|
@ -62,7 +63,7 @@ function createMarkingData(options: UseMarkingDataOptions) {
|
|||
error: questionError,
|
||||
refetch: refetchQuestion,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => ['marking-question', taskId.value]),
|
||||
queryKey: ['marking-question', taskId, useUserId()],
|
||||
queryFn: async () => examMarkingTaskApi.questionDetail(taskId.value),
|
||||
enabled: computed(() => !!taskId.value),
|
||||
gcTime: 0,
|
||||
|
|
@ -73,7 +74,7 @@ function createMarkingData(options: UseMarkingDataOptions) {
|
|||
data: questionsListData,
|
||||
refetch: refetchQuestionsList,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => ['marking-questions-list', examId?.value, subjectId?.value]),
|
||||
queryKey: ['marking-questions-list', examId, subjectId, useUserId()],
|
||||
queryFn: async () => examMarkingTaskApi.byQuestionList({
|
||||
exam_id: examId!.value!,
|
||||
exam_subject_id: subjectId!.value!,
|
||||
|
|
@ -87,7 +88,7 @@ function createMarkingData(options: UseMarkingDataOptions) {
|
|||
data: avgScoreData,
|
||||
refetch: refetchAvgScore,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => ['marking-avg-score', questionId.value, taskId.value]),
|
||||
queryKey: ['marking-avg-score', questionId, taskId, useUserId()],
|
||||
queryFn: async () => examMarkingTaskApi.questionTaskAverageScoreComparisonDetail(
|
||||
questionId.value,
|
||||
taskId.value,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import type { DictionaryItem } from '@/service/types'
|
|||
import { useQuery, useQueryClient } from '@tanstack/vue-query'
|
||||
import { computed, readonly } from 'vue'
|
||||
import { dictionaryItemsUsingGet } from '@/service'
|
||||
import { useUserId } from './useUserId'
|
||||
|
||||
export type DictOptions = Array<{ label: string, value: string }>
|
||||
|
||||
|
|
@ -29,7 +30,7 @@ export function useDict() {
|
|||
*/
|
||||
const useDictOptionsQuery = (dictCode: string) => {
|
||||
return useQuery({
|
||||
queryKey: ['dict', dictCode],
|
||||
queryKey: ['dict', dictCode, useUserId()],
|
||||
queryFn: async (): Promise<DictOptions> => {
|
||||
try {
|
||||
const response = await dictionaryItemsUsingGet({
|
||||
|
|
@ -71,7 +72,7 @@ export function useDict() {
|
|||
|
||||
// 通过query获取数据
|
||||
return queryClient.fetchQuery({
|
||||
queryKey: ['dict', dictCode],
|
||||
queryKey: ['dict', dictCode, useUserId()],
|
||||
queryFn: async (): Promise<DictOptions> => {
|
||||
try {
|
||||
const response = await dictionaryItemsUsingGet({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import { useUserStore } from '@/store'
|
||||
|
||||
export function useUserId() {
|
||||
const userStore = useUserStore()
|
||||
const userId = computed(() => userStore.info.id)
|
||||
return userId
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import { useQuery } from '@tanstack/vue-query'
|
|||
import { computed, onMounted, ref } from 'vue'
|
||||
import QuestionDetailPopup from '@/components/class-analysis/QuestionDetailPopup.vue'
|
||||
import QuestionDetailTable from '@/components/class-analysis/QuestionDetailTable.vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { teacherAnalysisQuestionDetailUsingPost, teacherAnalysisQuestionScoreDetailUsingPost } from '@/service/laoshixiaotichengjifenxi'
|
||||
import { useHomeStore } from '@/store/home'
|
||||
|
||||
|
|
@ -34,13 +35,14 @@ const {
|
|||
data: questionDetailData,
|
||||
isLoading: loading,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'question-detail',
|
||||
selectedExamId.value,
|
||||
useUserId(),
|
||||
selectedExamId,
|
||||
homeStore.selectedGradeKey,
|
||||
homeStore.selectedClassId,
|
||||
homeStore.selectedSubjectId,
|
||||
]),
|
||||
],
|
||||
queryFn: async () => {
|
||||
const response = await teacherAnalysisQuestionDetailUsingPost({
|
||||
body: {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { teacherAnalysisQuestionScoreDetailUsingPost } from '@/service/laoshixiaotichengjifenxi'
|
||||
|
||||
defineOptions({
|
||||
|
|
@ -36,13 +37,14 @@ const {
|
|||
data: questionListData,
|
||||
isLoading: loading,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'question-score-detail',
|
||||
useUserId(),
|
||||
params.value.exam_id,
|
||||
params.value.grade_key,
|
||||
params.value.class_key,
|
||||
params.value.subject_id,
|
||||
]),
|
||||
],
|
||||
queryFn: async () => {
|
||||
const response = await teacherAnalysisQuestionScoreDetailUsingPost({
|
||||
body: {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { whenever } from '@vueuse/core'
|
|||
import { computed, ref } from 'vue'
|
||||
import OverviewSettingsDialog from '@/components/score/OverviewSettingsDialog.vue'
|
||||
import RankSettingsDialog from '@/components/score/RankSettingsDialog.vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import {
|
||||
teacherAnalysisClassExamComparisonHorizontalUsingPost,
|
||||
teacherAnalysisClassExamComparisonUsingPost,
|
||||
|
|
@ -137,17 +138,18 @@ const {
|
|||
isLoading: isLoadingStats,
|
||||
refetch: refetchStats,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'overview-stats',
|
||||
useUserId(),
|
||||
homeStore.selectedClassId,
|
||||
homeStore.selectedExamId,
|
||||
homeStore.selectedGradeKey,
|
||||
selectedSubjectId.value,
|
||||
selectedSubjectId,
|
||||
scoreSettings.value.excellent_scoring_rate,
|
||||
scoreSettings.value.good_scoring_rate,
|
||||
scoreSettings.value.pass_scoring_rate,
|
||||
scoreSettings.value.top_n,
|
||||
]),
|
||||
],
|
||||
queryFn: async () => {
|
||||
return await teacherAnalysisRecentExamStatsUsingPost({
|
||||
body: {
|
||||
|
|
@ -172,14 +174,15 @@ const {
|
|||
data: comparisonData,
|
||||
isLoading: isLoadingComparison,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'comparison-data',
|
||||
comparisonMode.value,
|
||||
useUserId(),
|
||||
comparisonMode,
|
||||
homeStore.selectedClassId,
|
||||
homeStore.selectedExamId,
|
||||
homeStore.selectedGradeKey,
|
||||
selectedSubjectId.value,
|
||||
]),
|
||||
],
|
||||
queryFn: async () => {
|
||||
if (comparisonMode.value === 'horizontal') {
|
||||
return (await teacherAnalysisClassExamComparisonHorizontalUsingPost({
|
||||
|
|
@ -210,16 +213,17 @@ const {
|
|||
data: rankStatsData,
|
||||
isLoading: isLoadingRank,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => [
|
||||
queryKey: [
|
||||
'rank-statistics',
|
||||
selectedClassIds.value,
|
||||
useUserId(),
|
||||
selectedClassIds,
|
||||
homeStore.selectedClassId,
|
||||
homeStore.selectedExamId,
|
||||
selectedSubjectId.value,
|
||||
selectedSubjectId,
|
||||
scoreSettings.value.rank_top_1,
|
||||
scoreSettings.value.rank_top_2,
|
||||
scoreSettings.value.rank_top_3,
|
||||
]),
|
||||
],
|
||||
queryFn: async () => {
|
||||
const classIds = selectedClassIds.value.length > 0
|
||||
? selectedClassIds.value
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { useQuery } from '@tanstack/vue-query'
|
|||
import { computed, ref } from 'vue'
|
||||
import { examMarkingTaskApi } from '@/api'
|
||||
import { DictCode, useDict } from '@/composables/useDict'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { markingTasksTaskIdStartUsingPost } from '@/service'
|
||||
|
||||
defineOptions({
|
||||
|
|
@ -41,7 +42,7 @@ const {
|
|||
error,
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ['marking-questions', examId, subjectId],
|
||||
queryKey: ['marking-questions', examId, subjectId, useUserId()],
|
||||
queryFn: () => examMarkingTaskApi.byQuestionList(
|
||||
{
|
||||
exam_id: examId.value!,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import type { TeacherMarkingTasksResponse } from '@/service/types'
|
|||
import { useQuery } from '@tanstack/vue-query'
|
||||
import { computed, ref } from 'vue'
|
||||
import TaskCard from '@/components/marking/TaskCard.vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { markingTasksUsingGet } from '@/service'
|
||||
|
||||
defineOptions({
|
||||
|
|
@ -31,7 +32,7 @@ const {
|
|||
error,
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ['marking-tasks'],
|
||||
queryKey: ['marking-tasks', useUserId()],
|
||||
queryFn: () => markingTasksUsingGet({
|
||||
params: {
|
||||
page: 1,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { useQuery } from '@tanstack/vue-query'
|
|||
import { computed, ref, watch } from 'vue'
|
||||
import QuestionTabs from '@/components/marking/QuestionTabs.vue'
|
||||
import { DictCode, useDict } from '@/composables/useDict'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { markingProgressQuestionUsingGet, markingProgressUsingGet } from '@/service/yuejuanjindu'
|
||||
|
||||
defineOptions({
|
||||
|
|
@ -44,7 +45,7 @@ const {
|
|||
error: errorAll,
|
||||
refetch: refetchAll,
|
||||
} = useQuery({
|
||||
queryKey: ['marking-progress', examSubjectId],
|
||||
queryKey: ['marking-progress', examSubjectId, useUserId()],
|
||||
queryFn: () => markingProgressUsingGet({
|
||||
params: {
|
||||
exam_subject_id: examSubjectId.value!,
|
||||
|
|
@ -86,7 +87,7 @@ const {
|
|||
error: errorQuestion,
|
||||
refetch: refetchQuestion,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => ['question-marking-progress', questionId.value]),
|
||||
queryKey: ['question-marking-progress', questionId, useUserId()],
|
||||
queryFn: () => markingProgressQuestionUsingGet({
|
||||
params: {
|
||||
question_id: questionId.value!,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
|||
import { useQuery } from '@tanstack/vue-query'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import QuestionTabs from '@/components/marking/QuestionTabs.vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
import { markingQualityQuestionUsingGet, markingQualityUsingGet } from '@/service/yuejuanzhiliang'
|
||||
|
||||
defineOptions({
|
||||
|
|
@ -43,7 +44,7 @@ const {
|
|||
error: errorAll,
|
||||
refetch: refetchAll,
|
||||
} = useQuery({
|
||||
queryKey: ['marking-quality', examSubjectId],
|
||||
queryKey: ['marking-quality', examSubjectId, useUserId()],
|
||||
queryFn: () => markingQualityUsingGet({
|
||||
params: {
|
||||
exam_subject_id: examSubjectId.value!,
|
||||
|
|
@ -87,7 +88,7 @@ const {
|
|||
error: errorQuestion,
|
||||
refetch: refetchQuestion,
|
||||
} = useQuery({
|
||||
queryKey: computed(() => ['question-marking-quality', questionId.value]),
|
||||
queryKey: ['question-marking-quality', questionId, useUserId()],
|
||||
queryFn: () => markingQualityQuestionUsingGet({
|
||||
params: {
|
||||
question_id: questionId.value!,
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { examMarkingTaskApi } from '@/api'
|
|||
import ReviewHeader from '@/components/marking/review/ReviewHeader.vue'
|
||||
import ReviewImageRenderer from '@/components/marking/review/ReviewImageRenderer.vue'
|
||||
import ScoreEditDialog from '@/components/marking/review/ScoreEditDialog.vue'
|
||||
import { useUserId } from '@/composables/useUserId'
|
||||
|
||||
defineOptions({
|
||||
name: 'MarkingReviewPage',
|
||||
|
|
@ -46,7 +47,7 @@ const {
|
|||
data: historyScoreOptions,
|
||||
isLoading: isLoadingScoreOptions,
|
||||
} = useQuery({
|
||||
queryKey: ['review-history-score', taskId],
|
||||
queryKey: ['review-history-score', taskId, useUserId()],
|
||||
queryFn: () => examMarkingTaskApi.reviewHistoryScoreCreate({
|
||||
task_id: taskId.value!,
|
||||
}),
|
||||
|
|
@ -64,7 +65,7 @@ const {
|
|||
error: historyError,
|
||||
refetch: refetchHistory,
|
||||
} = useQuery({
|
||||
queryKey: ['review-history', taskId, currentPage, selectedScore, selectedOrderBy],
|
||||
queryKey: ['review-history', taskId, currentPage, selectedScore, selectedOrderBy, useUserId()],
|
||||
queryFn: () => examMarkingTaskApi.historyDetail(
|
||||
taskId.value!,
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue