|
@@ -1,24 +1,47 @@
|
|
<template>
|
|
<template>
|
|
<h1>展示新前端获取status的结果</h1>
|
|
<h1>展示新前端获取status的结果</h1>
|
|
- <div>totalCount: {{ count }}</div>
|
|
|
|
|
|
+ <div>valid: {{ valid }}</div>
|
|
|
|
+ <div>totalCount: {{ totalCount }}</div>
|
|
|
|
+ <div>personCount: {{ personCount }}</div>
|
|
|
|
+ <div>markedCount: {{ markedCount }}</div>
|
|
|
|
+ <div>problemCount: {{ problemCount }}</div>
|
|
|
|
+ <div>arbitrateCount: {{ arbitrateCount }}</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
-import { ref, defineComponent, onMounted } from "vue";
|
|
|
|
|
|
+import { reactive, defineComponent, onMounted, toRefs } from "vue";
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: "TestStatus",
|
|
name: "TestStatus",
|
|
setup: () => {
|
|
setup: () => {
|
|
- const count = ref(0);
|
|
|
|
|
|
+ const state = reactive({
|
|
|
|
+ valid: false,
|
|
|
|
+ totalCount: 0,
|
|
|
|
+ personCount: 0,
|
|
|
|
+ markedCount: 0,
|
|
|
|
+ problemCount: 0,
|
|
|
|
+ arbitrateCount: 0,
|
|
|
|
+ });
|
|
|
|
|
|
async function updateCount() {
|
|
async function updateCount() {
|
|
- const statusRes = await (await fetch("/mark/status")).json();
|
|
|
|
|
|
+ const statusRes = await (
|
|
|
|
+ await fetch("/mark/getStatus", { method: "POST" })
|
|
|
|
+ ).json();
|
|
|
|
+ const groupStatus = await (
|
|
|
|
+ await fetch("/mark/getGroup", { method: "POST" })
|
|
|
|
+ ).json();
|
|
|
|
+ console.log(groupStatus);
|
|
console.log(statusRes, statusRes.totalCount);
|
|
console.log(statusRes, statusRes.totalCount);
|
|
- count.value = statusRes.totalCount;
|
|
|
|
|
|
+ state.valid = statusRes.valid;
|
|
|
|
+ state.totalCount = statusRes.totalCount;
|
|
|
|
+ state.personCount = statusRes.personCount;
|
|
|
|
+ state.markedCount = statusRes.markedCount;
|
|
|
|
+ state.problemCount = statusRes.problemCount;
|
|
|
|
+ state.arbitrateCount = statusRes.arbitrateCount;
|
|
}
|
|
}
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
updateCount();
|
|
updateCount();
|
|
});
|
|
});
|
|
- return { count };
|
|
|
|
|
|
+ return toRefs(state);
|
|
},
|
|
},
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|