|
|
@@ -9,11 +9,6 @@
|
|
|
:current-form-check-items="currentFormCheckItems"
|
|
|
:readonly="readonly"
|
|
|
/>
|
|
|
- <Divider />
|
|
|
- <FlexRow align="flex-end" justify="space-between">
|
|
|
- <H3>自评总分</H3>
|
|
|
- <Text fontSize="50rpx" color="#315816" fontFamily="HUNdin1451" :text="`${totalPoints}分`" />
|
|
|
- </FlexRow>
|
|
|
</FlexCol>
|
|
|
</template>
|
|
|
|
|
|
@@ -23,10 +18,6 @@ import type { CheckItemInfo, SelfAssessmentCheckItemAnswer, SelfAssessmentDetail
|
|
|
import type { IDynamicFormOptions } from '@/components/dynamic';
|
|
|
import EvaluationFormBlock from './EvaluationFormBlock.vue';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
-import Divider from '@/components/display/Divider.vue';
|
|
|
-import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
-import H3 from '@/components/typography/H3.vue';
|
|
|
-import Text from '@/components/basic/Text.vue';
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
currentForm: SelfAssessmentDetail;
|
|
|
@@ -41,29 +32,6 @@ const props = withDefaults(defineProps<{
|
|
|
|
|
|
const blockRef = ref<InstanceType<typeof EvaluationFormBlock> | null>(null);
|
|
|
|
|
|
-const checkItemMap = computed(() => {
|
|
|
- const m = new Map<number, CheckItemInfo>();
|
|
|
- function walk(nodes: CheckItemInfo[]) {
|
|
|
- for (const n of nodes) {
|
|
|
- m.set(n.id, n);
|
|
|
- if (n.children?.length)
|
|
|
- walk(n.children);
|
|
|
- }
|
|
|
- }
|
|
|
- walk(props.checkItemList);
|
|
|
- return m;
|
|
|
-});
|
|
|
-
|
|
|
-const totalPoints = computed(() => {
|
|
|
- return props.currentFormCheckItems
|
|
|
- .filter((item) => {
|
|
|
- const checkItem = checkItemMap.value.get(item.id);
|
|
|
- return checkItem && !checkItem.isTitle;
|
|
|
- })
|
|
|
- .reduce((acc, item) => acc + (item.count * item.points), 0)
|
|
|
- - (props.currentForm.deductPoints ?? 0);
|
|
|
-});
|
|
|
-
|
|
|
defineExpose({
|
|
|
validate: () => blockRef.value?.validate(),
|
|
|
});
|