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