fix
This commit is contained in:
@@ -14,5 +14,7 @@ export function toProblemListItem(result: AdminProblem) {
|
|||||||
has_ast_rules: result.has_ast_rules,
|
has_ast_rules: result.has_ast_rules,
|
||||||
allow_flowchart: result.allow_flowchart,
|
allow_flowchart: result.allow_flowchart,
|
||||||
show_flowchart: result.show_flowchart,
|
show_flowchart: result.show_flowchart,
|
||||||
|
// 比赛题目列表接口不返回这个字段
|
||||||
|
top_reaction: result.top_reaction ?? null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-alert v-if="!userStore.isAuthed" type="error" title="请先登录" />
|
<n-alert v-if="!userStore.isAuthed" type="error" title="请先登录" />
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<n-flex class="reactions">
|
<n-flex>
|
||||||
<n-tooltip
|
<n-tooltip
|
||||||
v-for="item in REACTIONS"
|
v-for="item in REACTIONS"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<n-button
|
<n-button
|
||||||
:type="mine === item.key ? 'primary' : 'tertiary'"
|
:type="mine === item.key ? 'primary' : 'tertiary'"
|
||||||
:secondary="mine === item.key"
|
:secondary="mine === item.key"
|
||||||
:disabled="!solved || locked || submitting"
|
:disabled="!solved || locked || !!submitting"
|
||||||
:loading="submitting === item.key"
|
:loading="submitting === item.key"
|
||||||
@click="pick(item.key)"
|
@click="pick(item.key)"
|
||||||
>
|
>
|
||||||
@@ -20,15 +20,15 @@
|
|||||||
<Icon :icon="item.icon" :width="20" />
|
<Icon :icon="item.icon" :width="20" />
|
||||||
</template>
|
</template>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
<span v-if="counts" class="count">{{ counts[item.key] }}</span>
|
<span v-if="counts">{{ counts[item.key] }}</span>
|
||||||
</n-button>
|
</n-button>
|
||||||
</template>
|
</template>
|
||||||
完成本题后可以评价
|
完成本题后可以评价
|
||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
</n-flex>
|
</n-flex>
|
||||||
<div v-if="solved" class="hint">
|
<n-text v-if="solved">
|
||||||
{{ locked ? "已评价,不能修改" : "选一个,点了直接提交,不能修改" }}
|
{{ locked ? "已评价,不能修改" : "选一个,点了直接提交,不能修改" }}
|
||||||
</div>
|
</n-text>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -83,27 +83,3 @@ onMounted(() => {
|
|||||||
if (userStore.isAuthed) load()
|
if (userStore.isAuthed) load()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
/* 七个按钮一行放不下就换行,不做横向滚动免得按钮被藏起来 */
|
|
||||||
.reactions {
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
/* 锁定后选中的那颗仍要看得清,不然自己评过什么都糊成一片 */
|
|
||||||
.reactions :deep(.n-button.n-button--disabled) {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
.reactions :deep(.n-button--primary-type.n-button--disabled) {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
.count {
|
|
||||||
margin-left: 6px;
|
|
||||||
opacity: 0.7;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
.hint {
|
|
||||||
margin-top: 12px;
|
|
||||||
font-size: 13px;
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -177,7 +177,11 @@ export interface Problem {
|
|||||||
sql_display?: SQLDisplay | null
|
sql_display?: SQLDisplay | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AdminProblem = Problem & AlterProblem
|
export type AdminProblem = Problem &
|
||||||
|
AlterProblem & {
|
||||||
|
// 后台题目列表接口附带的最高票评价,比赛题目列表不返回
|
||||||
|
top_reaction?: { type: ReactionKey; count: number } | null
|
||||||
|
}
|
||||||
|
|
||||||
interface AlterProblem {
|
interface AlterProblem {
|
||||||
test_case_id: string
|
test_case_id: string
|
||||||
|
|||||||
Reference in New Issue
Block a user