fix
This commit is contained in:
parent
d8a09595f3
commit
0c391f326a
@ -29,11 +29,11 @@ type Parent = 'n' | 'p' | 'f'
|
|||||||
|
|
||||||
type MethodStatus = 'ok' | 'weight-fail'
|
type MethodStatus = 'ok' | 'weight-fail'
|
||||||
|
|
||||||
const props = defineProps<{
|
// const props = defineProps<{
|
||||||
assessment: IAssessment
|
// assessment: IAssessment
|
||||||
parent: Parent
|
// parent: Parent
|
||||||
title: string
|
// title: string
|
||||||
}>()
|
// }>()
|
||||||
|
|
||||||
const emits = defineEmits<{
|
const emits = defineEmits<{
|
||||||
(e: 'edit', parent: Parent): void
|
(e: 'edit', parent: Parent): void
|
||||||
@ -58,11 +58,11 @@ const stage = ref<{ title: string; assessment: IAssessment }[]>([
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const isShowStageEditor = ref(false)
|
// const isShowStageEditor = ref(false)
|
||||||
const isShowMethodEditor = ref(false)
|
// const isShowMethodEditor = ref(false)
|
||||||
|
|
||||||
const tempAssessmentMethod = ref<IAssessmentMethod>(AssessmentMethod.factoryToImpl())
|
// const tempAssessmentMethod = ref<IAssessmentMethod>(AssessmentMethod.factoryToImpl())
|
||||||
const tempStage = ref<IAssessment>(AssessmentData.factoryToImpl())
|
// const tempStage = ref<IAssessment>(AssessmentData.factoryToImpl())
|
||||||
|
|
||||||
const status = computed((): MethodStatus => {
|
const status = computed((): MethodStatus => {
|
||||||
let total = 0
|
let total = 0
|
||||||
@ -76,22 +76,22 @@ const status = computed((): MethodStatus => {
|
|||||||
return 'ok'
|
return 'ok'
|
||||||
})
|
})
|
||||||
|
|
||||||
const addAssessmentMethodSubmit = computed(
|
// const addAssessmentMethodSubmit = computed(
|
||||||
() => !Object.values(tempAssessmentMethod.value).every((v) => v)
|
// () => !Object.values(tempAssessmentMethod.value).every((v) => v)
|
||||||
)
|
// )
|
||||||
|
|
||||||
const checkAllStageWeightSum = computed(() => {
|
// const checkAllStageWeightSum = computed(() => {
|
||||||
return normalStage.value.weight + processStage.value.weight + finalStage.value.weight === 100
|
// return normalStage.value.weight + processStage.value.weight + finalStage.value.weight === 100
|
||||||
})
|
// })
|
||||||
|
|
||||||
const handleShow
|
// const handleShow
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="pb-4">
|
<div class="pb-4">
|
||||||
<el-alert v-show="!checkAllStageWeightSum" type="warning" show-icon :closable="false"
|
<!-- <el-alert v-show="!checkAllStageWeightSum" type="warning" show-icon :closable="false"
|
||||||
>所有考核占比之和不是100%</el-alert
|
>所有考核占比之和不是100%</el-alert
|
||||||
>
|
> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-descriptions
|
<el-descriptions
|
||||||
@ -132,7 +132,7 @@ const handleShow
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
<el-dialog
|
<!-- <el-dialog
|
||||||
v-model="isShowMethodEditor"
|
v-model="isShowMethodEditor"
|
||||||
title="添加考核方式"
|
title="添加考核方式"
|
||||||
:show-close="false"
|
:show-close="false"
|
||||||
@ -179,7 +179,7 @@ const handleShow
|
|||||||
取消
|
取消
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useGlobalStore } from '@renderer/store'
|
import { useGlobalStore } from '@renderer/store'
|
||||||
import { storeToRefs } from 'pinia'
|
// import { storeToRefs } from 'pinia'
|
||||||
import { computed, onMounted, Ref, ref } from 'vue'
|
import { computed, onMounted, ref } from 'vue'
|
||||||
import { IAssessmentMethod, IAssessment, IGoalRef } from '@renderer/types'
|
import { IGoalRef } from '@renderer/types'
|
||||||
import { InfoFilled, Plus } from '@element-plus/icons-vue'
|
import { InfoFilled, Plus } from '@element-plus/icons-vue'
|
||||||
import AssessmentStage from '@renderer/components/assessment/AssessmentStage.vue'
|
import AssessmentStage from '@renderer/components/assessment/AssessmentStage.vue'
|
||||||
import CourseInfoDisplay from '@renderer/components/assessment/CourseInfoDisplay.vue'
|
import CourseInfoDisplay from '@renderer/components/assessment/CourseInfoDisplay.vue'
|
||||||
@ -34,42 +34,42 @@ type CourseInfoDisplayExposed = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const store = useGlobalStore()
|
const store = useGlobalStore()
|
||||||
const { normalStage, processStage, finalStage } = storeToRefs(store)
|
// const { normalStage, processStage, finalStage } = storeToRefs(store)
|
||||||
|
|
||||||
const course = ref(store.doc.course)
|
const course = ref(store.doc.course)
|
||||||
const courseInfoDisplay = ref<CourseInfoDisplayExposed | null>(null)
|
const courseInfoDisplay = ref<CourseInfoDisplayExposed | null>(null)
|
||||||
const tempGoal = ref<IGoalRef>(store.goalFactory())
|
const tempGoal = ref<IGoalRef>(store.goalFactory())
|
||||||
const tempGoalList = ref<IGoalRef[]>(store.goals)
|
const tempGoalList = ref<IGoalRef[]>(store.goals)
|
||||||
const tempAssessmentMethod = ref<IAssessmentMethod>({ method: '', weight: 0 })
|
// const tempAssessmentMethod = ref<IAssessmentMethod>({ method: '', weight: 0 })
|
||||||
const tempAssessment = ref<IAssessment>({ method: [], stage: '', weight: 0 })
|
// const tempAssessment = ref<IAssessment>({ method: [], stage: '', weight: 0 })
|
||||||
const showAddGoal = ref(false)
|
const showAddGoal = ref(false)
|
||||||
const showEditCourse = ref(false)
|
// const showEditCourse = ref(false)
|
||||||
const showEditStage = ref(false)
|
// const showEditStage = ref(false)
|
||||||
const showAddAssessmentMethod = ref(false)
|
// const showAddAssessmentMethod = ref(false)
|
||||||
const assessmentStageList = ref<{ title: string; parent: Parent; assessment: Ref<IAssessment> }[]>([
|
// const assessmentStageList = ref<{ title: string; parent: Parent; assessment: Ref<IAssessment> }[]>([
|
||||||
{
|
// {
|
||||||
title: '平时考核',
|
// title: '平时考核',
|
||||||
parent: 'n',
|
// parent: 'n',
|
||||||
assessment: ref(store.doc.assessment.daily)
|
// assessment: ref(store.doc.assessment.daily)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '过程考核',
|
// title: '过程考核',
|
||||||
parent: 'p',
|
// parent: 'p',
|
||||||
assessment: ref(store.doc.assessment.progress)
|
// assessment: ref(store.doc.assessment.progress)
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '期末考核',
|
// title: '期末考核',
|
||||||
parent: 'f',
|
// parent: 'f',
|
||||||
assessment: finalStage
|
// assessment: finalStage
|
||||||
}
|
// }
|
||||||
])
|
// ])
|
||||||
|
|
||||||
let assessmentParent: Parent | null = null
|
// let assessmentParent: Parent | null = null
|
||||||
|
|
||||||
const addGoalSubmit = computed(() => !Object.values(tempGoal.value).every((v) => v))
|
const addGoalSubmit = computed(() => !Object.values(tempGoal.value).every((v) => v))
|
||||||
const checkAllStageWeightSum = computed(() => {
|
// const checkAllStageWeightSum = computed(() => {
|
||||||
return normalStage.value.weight + processStage.value.weight + finalStage.value.weight === 100
|
// return normalStage.value.weight + processStage.value.weight + finalStage.value.weight === 100
|
||||||
})
|
// })
|
||||||
|
|
||||||
const handleEditCourse = () => {
|
const handleEditCourse = () => {
|
||||||
if (courseInfoDisplay.value === null) {
|
if (courseInfoDisplay.value === null) {
|
||||||
@ -107,39 +107,39 @@ const handleDeleteGoal = (idx: number) => {
|
|||||||
tempGoalList.value.splice(idx, 1)
|
tempGoalList.value.splice(idx, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleShowAddAssessmentMethodDialog = (parent: Parent) => {
|
// const handleShowAddAssessmentMethodDialog = (parent: Parent) => {
|
||||||
assessmentParent = parent
|
// assessmentParent = parent
|
||||||
showAddAssessmentMethod.value = true
|
// showAddAssessmentMethod.value = true
|
||||||
}
|
// }
|
||||||
|
|
||||||
const handleEditAssessmentMethod = (item: IAssessmentMethod, parent: Parent) => {
|
// const handleEditAssessmentMethod = (item: IAssessmentMethod, parent: Parent) => {
|
||||||
tempAssessmentMethod.value = item
|
// tempAssessmentMethod.value = item
|
||||||
assessmentParent = parent
|
// assessmentParent = parent
|
||||||
showAddAssessmentMethod.value = true
|
// showAddAssessmentMethod.value = true
|
||||||
}
|
// }
|
||||||
|
|
||||||
const handleEditAssessment = (stage: Parent) => {
|
// const handleEditAssessment = (stage: Parent) => {
|
||||||
showEditStage.value = true
|
// showEditStage.value = true
|
||||||
if (stage === 'n') {
|
// if (stage === 'n') {
|
||||||
tempAssessment.value = { ...store.normalStage }
|
// tempAssessment.value = { ...store.normalStage }
|
||||||
assessmentParent = 'n'
|
// assessmentParent = 'n'
|
||||||
} else if (stage === 'p') {
|
// } else if (stage === 'p') {
|
||||||
tempAssessment.value = { ...store.processStage }
|
// tempAssessment.value = { ...store.processStage }
|
||||||
assessmentParent = 'p'
|
// assessmentParent = 'p'
|
||||||
} else if (stage === 'f') {
|
// } else if (stage === 'f') {
|
||||||
tempAssessment.value = { ...store.finalStage }
|
// tempAssessment.value = { ...store.finalStage }
|
||||||
assessmentParent = 'f'
|
// assessmentParent = 'f'
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
const handleEditAssessmentSubmit = (action: 'save' | 'cancel', stage: 'n' | 'p' | 'f') => {
|
// const handleEditAssessmentSubmit = (action: 'save' | 'cancel', stage: 'n' | 'p' | 'f') => {
|
||||||
if (action === 'save') {
|
// if (action === 'save') {
|
||||||
store.saveStage(tempAssessment.value, stage)
|
// store.saveStage(tempAssessment.value, stage)
|
||||||
}
|
// }
|
||||||
|
|
||||||
tempAssessment.value = { method: [], weight: 0, stage: '' }
|
// tempAssessment.value = { method: [], weight: 0, stage: '' }
|
||||||
showEditStage.value = false
|
// showEditStage.value = false
|
||||||
}
|
// }
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
if (store.doc.course.isEmpty()) {
|
if (store.doc.course.isEmpty()) {
|
||||||
@ -164,7 +164,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<course-info-display ref="courseInfoDisplay" />
|
<course-info-display ref="courseInfoDisplay" />
|
||||||
|
|
||||||
<assessment-stage />
|
<!-- <assessment-stage /> -->
|
||||||
|
|
||||||
<el-divider content-position="left">课程目标</el-divider>
|
<el-divider content-position="left">课程目标</el-divider>
|
||||||
<div class="mx-auto w-full max-w-lg">
|
<div class="mx-auto w-full max-w-lg">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user