feat:change ui

This commit is contained in:
Zyronon
2025-09-30 01:48:34 +08:00
parent 85c7dff4fd
commit b8d14fdc1a
4 changed files with 128 additions and 31 deletions

View File

@@ -1,15 +1,20 @@
<script setup lang="ts">
import {Dict} from "@/types/types.ts";
import { Dict } from "@/types/types.ts";
import Progress from '@/components/base/Progress.vue'
import Checkbox from "@/components/base/checkbox/Checkbox.vue";
const props = defineProps<{
interface IProps {
item?: Partial<Dict>;
quantifier?: string
isAdd: boolean
showCheckbox?: boolean
checked?: boolean
}>()
showProgress?: boolean
}
const props = withDefaults(defineProps<IProps>(), {
showProgress: true
})
defineEmits<{
check: []
@@ -21,6 +26,7 @@ const progress = $computed(() => {
})
const studyProgress = $computed(() => {
if (!props.showProgress) return
if (props.item.complete) return props.item?.length + '/'
return props.item?.lastLearnIndex ? props.item?.lastLearnIndex + '/' : ''
})
@@ -37,7 +43,7 @@ const studyProgress = $computed(() => {
<div>{{ studyProgress }}{{ item?.length }}{{ quantifier }}</div>
</div>
<div class="absolute bottom-2 left-3 right-3">
<Progress v-if="item?.lastLearnIndex || item.complete" class="mt-1"
<Progress v-if="(item?.lastLearnIndex || item.complete) && showProgress" class="mt-1"
:percentage="progress"
:show-text="false"></Progress>
</div>