|
@@ -2,7 +2,7 @@
|
|
<div class="my-container">
|
|
<div class="my-container">
|
|
<mark-header />
|
|
<mark-header />
|
|
<div class="tw-flex tw-gap-1">
|
|
<div class="tw-flex tw-gap-1">
|
|
- <mark-history />
|
|
|
|
|
|
+ <mark-history :should-reload="shouldReloadHistory" />
|
|
<mark-body @error="updateTask" />
|
|
<mark-body @error="updateTask" />
|
|
<mark-board-track v-if="showMarkBoardTrack" @submit="saveTaskToServer" />
|
|
<mark-board-track v-if="showMarkBoardTrack" @submit="saveTaskToServer" />
|
|
<mark-board-key-board
|
|
<mark-board-key-board
|
|
@@ -15,7 +15,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import { computed, defineComponent, onMounted, watch } from "vue";
|
|
|
|
|
|
+import { computed, defineComponent, onMounted, ref, watch } from "vue";
|
|
import {
|
|
import {
|
|
clearMarkTask,
|
|
clearMarkTask,
|
|
getGroup,
|
|
getGroup,
|
|
@@ -157,6 +157,8 @@ export default defineComponent({
|
|
);
|
|
);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ const shouldReloadHistory = ref(0);
|
|
|
|
+
|
|
const saveTaskToServer = async () => {
|
|
const saveTaskToServer = async () => {
|
|
const markResult = findCurrentTaskMarkResult();
|
|
const markResult = findCurrentTaskMarkResult();
|
|
if (!markResult) return;
|
|
if (!markResult) return;
|
|
@@ -174,9 +176,13 @@ export default defineComponent({
|
|
updateStatus();
|
|
updateStatus();
|
|
if (res.data.success && store.currentTask) {
|
|
if (res.data.success && store.currentTask) {
|
|
message.success({ content: "保存成功", key: mkey, duration: 2 });
|
|
message.success({ content: "保存成功", key: mkey, duration: 2 });
|
|
- removeCurrentMarkResult();
|
|
|
|
- store.currentTask = undefined;
|
|
|
|
- store.tasks.shift();
|
|
|
|
|
|
+ if (!store.historyOpen) {
|
|
|
|
+ removeCurrentMarkResult();
|
|
|
|
+ store.currentTask = undefined;
|
|
|
|
+ store.tasks.shift();
|
|
|
|
+ } else {
|
|
|
|
+ shouldReloadHistory.value = Date.now();
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
if (markResult) {
|
|
if (markResult) {
|
|
markResult.spent = Date.now() - markResult.spent;
|
|
markResult.spent = Date.now() - markResult.spent;
|
|
@@ -193,6 +199,7 @@ export default defineComponent({
|
|
showMarkBoardTrack,
|
|
showMarkBoardTrack,
|
|
showMarkBoardKeyBoard,
|
|
showMarkBoardKeyBoard,
|
|
showMarkBoardMouse,
|
|
showMarkBoardMouse,
|
|
|
|
+ shouldReloadHistory,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|