|
@@ -70,29 +70,45 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-show="store.status.totalCount" class="tw-flex tw-gap-2">
|
|
<div v-show="store.status.totalCount" class="tw-flex tw-gap-2">
|
|
- <span>
|
|
|
|
|
|
+ <span style="display: inline-flex; height: 16px">
|
|
<span class="header-small-text">已评</span>
|
|
<span class="header-small-text">已评</span>
|
|
- <span
|
|
|
|
- class="highlight-text"
|
|
|
|
- :class="markCountChanged && 'markcount-animation'"
|
|
|
|
- >{{ personCountAnimated }}</span
|
|
|
|
- >
|
|
|
|
|
|
+ <transition-group name="count-animation" tag="span">
|
|
|
|
+ <span
|
|
|
|
+ class="highlight-text"
|
|
|
|
+ style="display: block"
|
|
|
|
+ :key="store.status.personCount || 0"
|
|
|
|
+ >
|
|
|
|
+ {{ store.status.personCount }}
|
|
|
|
+ </span>
|
|
|
|
+ </transition-group>
|
|
</span>
|
|
</span>
|
|
<span v-if="store.setting.topCount">
|
|
<span v-if="store.setting.topCount">
|
|
<span class="header-small-text">分配</span>
|
|
<span class="header-small-text">分配</span>
|
|
<span class="highlight-text">{{ store.setting.topCount ?? "-" }}</span>
|
|
<span class="highlight-text">{{ store.setting.topCount ?? "-" }}</span>
|
|
</span>
|
|
</span>
|
|
- <span>
|
|
|
|
|
|
+ <span style="display: inline-flex; height: 16px">
|
|
<span class="header-small-text">未评</span>
|
|
<span class="header-small-text">未评</span>
|
|
- <span
|
|
|
|
- class="highlight-text"
|
|
|
|
- :class="markCountChanged && 'markcount-animation'"
|
|
|
|
- >{{ todoMarkCountAnimated }}</span
|
|
|
|
- >
|
|
|
|
|
|
+ <transition-group name="count-animation" tag="span">
|
|
|
|
+ <span
|
|
|
|
+ class="highlight-text"
|
|
|
|
+ style="display: block"
|
|
|
|
+ :key="todoCount || 0"
|
|
|
|
+ >
|
|
|
|
+ {{ todoCount }}
|
|
|
|
+ </span>
|
|
|
|
+ </transition-group>
|
|
</span>
|
|
</span>
|
|
- <span>
|
|
|
|
|
|
+ <span style="display: inline-flex; height: 16px">
|
|
<span class="header-small-text">进度</span>
|
|
<span class="header-small-text">进度</span>
|
|
- <span class="highlight-text">{{ progress ?? "-" }}%</span>
|
|
|
|
|
|
+ <transition-group name="count-animation" tag="span">
|
|
|
|
+ <span
|
|
|
|
+ class="highlight-text"
|
|
|
|
+ style="display: block"
|
|
|
|
+ :key="progress || '-'"
|
|
|
|
+ >
|
|
|
|
+ {{ progress }}%
|
|
|
|
+ </span>
|
|
|
|
+ </transition-group>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="tw-flex tw-place-items-center">
|
|
<div class="tw-flex tw-place-items-center">
|
|
@@ -331,7 +347,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { doLogout, updateUISetting } from "@/api/markPage";
|
|
import { doLogout, updateUISetting } from "@/api/markPage";
|
|
-import { watch, watchEffect } from "vue";
|
|
|
|
|
|
+import { watchEffect } from "vue";
|
|
import { store } from "@/store/store";
|
|
import { store } from "@/store/store";
|
|
import { ModeEnum } from "@/types";
|
|
import { ModeEnum } from "@/types";
|
|
import MarkChangeProfile from "./MarkChangeProfile.vue";
|
|
import MarkChangeProfile from "./MarkChangeProfile.vue";
|
|
@@ -339,7 +355,6 @@ import MarkSwitchGroupDialog from "./MarkSwitchGroupDialog.vue";
|
|
import MarkProblemDialog from "./MarkProblemDialog.vue";
|
|
import MarkProblemDialog from "./MarkProblemDialog.vue";
|
|
import { isNumber } from "lodash";
|
|
import { isNumber } from "lodash";
|
|
import { Modal } from "ant-design-vue";
|
|
import { Modal } from "ant-design-vue";
|
|
-import gsap from "gsap";
|
|
|
|
|
|
|
|
let modeName = $computed(() =>
|
|
let modeName = $computed(() =>
|
|
store.setting.mode === ModeEnum.TRACK ? "轨迹模式" : "普通模式"
|
|
store.setting.mode === ModeEnum.TRACK ? "轨迹模式" : "普通模式"
|
|
@@ -366,7 +381,7 @@ async function toggleSettingMode() {
|
|
|
|
|
|
let progress = $computed(() => {
|
|
let progress = $computed(() => {
|
|
const { totalCount, markedCount } = store.status;
|
|
const { totalCount, markedCount } = store.status;
|
|
- if (totalCount <= 0) return 0;
|
|
|
|
|
|
+ if (typeof totalCount !== "number" || totalCount === 0) return 0;
|
|
let p = markedCount / totalCount;
|
|
let p = markedCount / totalCount;
|
|
if (p < 0.01 && markedCount >= 1) p = 0.01;
|
|
if (p < 0.01 && markedCount >= 1) p = 0.01;
|
|
p = Math.floor(p * 100);
|
|
p = Math.floor(p * 100);
|
|
@@ -420,34 +435,10 @@ watchEffect(() => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-let personCountAnimated = $computed(() => {
|
|
|
|
- if (store.status.personCountTweenedNumber === undefined) return "-";
|
|
|
|
- return Number(store.status.personCountTweenedNumber).toFixed(0);
|
|
|
|
-});
|
|
|
|
-let todoMarkCountAnimated = $computed(() => {
|
|
|
|
- if (store.status.totalCount === undefined) return "-";
|
|
|
|
- return Number(store.status.todoMarkCountTweenedNumber).toFixed(0);
|
|
|
|
-});
|
|
|
|
-let markCountChanged = $ref(false);
|
|
|
|
-watch(
|
|
|
|
- () => [
|
|
|
|
- store.status.personCount,
|
|
|
|
- store.status.totalCount,
|
|
|
|
- store.status.markedCount,
|
|
|
|
- ],
|
|
|
|
- ([personCount, totalCount, markedCount]) => {
|
|
|
|
- if (store.status.personCountTweenedNumber === undefined) {
|
|
|
|
- store.status.personCountTweenedNumber = 0;
|
|
|
|
- store.status.todoMarkCountTweenedNumber = 0;
|
|
|
|
- }
|
|
|
|
- markCountChanged = true;
|
|
|
|
- setTimeout(() => (markCountChanged = false), 3000);
|
|
|
|
- gsap.to(store.status, {
|
|
|
|
- duration: 1.5,
|
|
|
|
- personCountTweenedNumber: personCount,
|
|
|
|
- todoMarkCountTweenedNumber: totalCount - markedCount,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+let todoCount = $computed(() =>
|
|
|
|
+ typeof store.status.totalCount === "number"
|
|
|
|
+ ? store.status.totalCount - store.status.markedCount
|
|
|
|
+ : "-"
|
|
);
|
|
);
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -525,15 +516,14 @@ watch(
|
|
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
margin-left: 4px;
|
|
margin-left: 4px;
|
|
}
|
|
}
|
|
-.markcount-animation {
|
|
|
|
- animation: change-color 3s ease-in-out;
|
|
|
|
|
|
+
|
|
|
|
+.count-animation-enter-active,
|
|
|
|
+.count-animation-leave-active {
|
|
|
|
+ transition: all 1s ease;
|
|
}
|
|
}
|
|
-@keyframes change-color {
|
|
|
|
- 0% {
|
|
|
|
- color: red;
|
|
|
|
- }
|
|
|
|
- 100% {
|
|
|
|
- color: white;
|
|
|
|
- }
|
|
|
|
|
|
+.count-animation-enter-from,
|
|
|
|
+.count-animation-leave-to {
|
|
|
|
+ opacity: 0;
|
|
|
|
+ transform: translateY(30px);
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|