在提交列表也使用外窗口打开链接

This commit is contained in:
2024-07-03 08:33:22 +08:00
parent 8a4177cdfc
commit 7d547bfc14
2 changed files with 5 additions and 4 deletions

View File

@@ -26,6 +26,6 @@ const props = defineProps<Props>()
defineEmits(["showCode"]) defineEmits(["showCode"])
function goto() { function goto() {
router.push("/submission/" + props.submission.id) window.open("/submission/" + props.submission.id, "_blank")
} }
</script> </script>

View File

@@ -109,14 +109,15 @@ async function rejudge(submissionID: string) {
function problemClicked(row: Submission) { function problemClicked(row: Submission) {
if (route.name === "contest submissions") { if (route.name === "contest submissions") {
router.push({ const path = router.resolve({
name: "contest problem", name: "contest problem",
params: { params: {
problemID: row.problem, problemID: row.problem,
}, },
}) })
window.open(path.href, "_blank")
} else { } else {
router.push("/problem/" + row.problem) window.open("/problem/" + row.problem, "_blank")
} }
} }
@@ -225,7 +226,7 @@ const columns = computed(() => {
h( h(
ButtonWithSearch, ButtonWithSearch,
{ {
onClick: () => router.push("/user?name=" + row.username), onClick: () => window.open("/user?name=" + row.username, "_blank"),
onSearch: () => (query.username = row.username), onSearch: () => (query.username = row.username),
}, },
() => row.username, () => row.username,