update
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<n-flex align="center" class="corner">
|
||||
<n-button secondary v-if="!show" @click="showTutorial">教程</n-button>
|
||||
<n-button quaternary v-if="!show" @click="showTutorial">教程</n-button>
|
||||
<template v-if="user.loaded && authed">
|
||||
<n-button
|
||||
quaternary
|
||||
@click="$router.push({ name: 'submissions', params: { page: 1 } })"
|
||||
>
|
||||
所有提交
|
||||
</n-button>
|
||||
<n-button
|
||||
type="primary"
|
||||
secondary
|
||||
@@ -9,7 +15,7 @@
|
||||
:loading="submitLoading"
|
||||
@click="submit"
|
||||
>
|
||||
提交
|
||||
提交代码
|
||||
</n-button>
|
||||
<n-dropdown :options="menu" @select="clickMenu">
|
||||
<n-button>{{ user.username }}</n-button>
|
||||
@@ -67,7 +73,7 @@ const menu = computed(() => [
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "提交列表",
|
||||
label: "我的提交",
|
||||
key: "submissions",
|
||||
icon: () =>
|
||||
h(Icon, {
|
||||
@@ -98,7 +104,11 @@ function clickMenu(name: string) {
|
||||
window.open(ADMIN_URL)
|
||||
break
|
||||
case "submissions":
|
||||
router.push({ name: "submissions", params: { page: 1 } })
|
||||
router.push({
|
||||
name: "submissions",
|
||||
params: { page: 1 },
|
||||
query: { username: user.username },
|
||||
})
|
||||
break
|
||||
case "logout":
|
||||
handleLogout()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</n-form-item>
|
||||
<n-alert
|
||||
type="error"
|
||||
v-if="showMeesage"
|
||||
v-if="showMessage"
|
||||
class="message"
|
||||
title="登录失败,请检查用户名和密码"
|
||||
></n-alert>
|
||||
@@ -39,7 +39,7 @@ import { user } from "../store/user"
|
||||
const name = ref("")
|
||||
const password = ref("")
|
||||
const loading = ref(false)
|
||||
const showMeesage = ref(false)
|
||||
const showMessage = ref(false)
|
||||
|
||||
async function submit() {
|
||||
loading.value = true
|
||||
@@ -51,7 +51,7 @@ async function submit() {
|
||||
loginModal.value = false
|
||||
loading.value = false
|
||||
} catch (err) {
|
||||
showMeesage.value = true
|
||||
showMessage.value = true
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<template>
|
||||
<n-flex align="center" justify="space-between" class="title">
|
||||
<n-flex align="center">
|
||||
<Icon icon="noto:eyes" :width="20"></Icon>
|
||||
<n-text class="titleText">预览</n-text>
|
||||
</n-flex>
|
||||
<n-text class="titleText">预览</n-text>
|
||||
<n-flex>
|
||||
<n-button quaternary @click="download" :disabled="!showDL">下载</n-button>
|
||||
<n-button quaternary @click="open">展示</n-button>
|
||||
<n-button quaternary @click="open">全屏</n-button>
|
||||
<n-flex v-if="!!submission.id">
|
||||
<n-button quaternary @click="emits('showCode')">查看代码</n-button>
|
||||
<n-popover v-if="submission.my_score === 0">
|
||||
|
||||
@@ -3,23 +3,30 @@
|
||||
<n-flex align="center" justify="space-between" class="title">
|
||||
<n-flex align="center">
|
||||
<Icon icon="twemoji:open-book" :width="20"></Icon>
|
||||
<n-text class="preview">教程(测试版)</n-text>
|
||||
<n-button text @click="prev" v-if="!hideNav" :disabled="prevDisabled">
|
||||
<Icon :width="24" icon="pepicons-pencil:arrow-left"></Icon>
|
||||
</n-button>
|
||||
<n-button text @click="next" v-if="!hideNav" :disabled="nextDisabled">
|
||||
<Icon :width="24" icon="pepicons-pencil:arrow-right"></Icon>
|
||||
</n-button>
|
||||
<n-tabs style="width: 140px" type="segment" animated>
|
||||
<n-tab name="tutorial" tab="教程"></n-tab>
|
||||
<n-tab name="challenge" tab="挑战"></n-tab>
|
||||
</n-tabs>
|
||||
<template v-if="!hideNav">
|
||||
<n-button text @click="prev" :disabled="prevDisabled">
|
||||
<Icon :width="24" icon="pepicons-pencil:arrow-left"></Icon>
|
||||
</n-button>
|
||||
<n-button text @click="next" :disabled="nextDisabled">
|
||||
<Icon :width="24" icon="pepicons-pencil:arrow-right"></Icon>
|
||||
</n-button>
|
||||
</template>
|
||||
</n-flex>
|
||||
<n-flex>
|
||||
<n-button
|
||||
text
|
||||
v-if="authed && roleSuper"
|
||||
quaternary
|
||||
@click="$router.push({ name: 'tutorial', params: { display: step } })"
|
||||
>
|
||||
编辑
|
||||
<Icon :width="16" icon="lucide:edit"></Icon>
|
||||
</n-button>
|
||||
<n-button text @click="$emit('hide')">
|
||||
<Icon :width="24" icon="material-symbols:close-rounded"></Icon>
|
||||
</n-button>
|
||||
<n-button quaternary @click="$emit('hide')">隐藏</n-button>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
<div class="markdown-body" v-html="content" ref="$content"></div>
|
||||
@@ -153,10 +160,6 @@ watch(step, render)
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.preview {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown-body {
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -27,6 +27,7 @@ const menu = [
|
||||
route: { name: "tutorial", params: { display: step.value } },
|
||||
},
|
||||
{ label: "用户", route: { name: "user-manage", params: { page: 1 } } },
|
||||
{ label: "提交", route: { name: "submissions", params: { page: 1 } } },
|
||||
]
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@@ -75,7 +75,7 @@ const data = ref<SubmissionOut[]>([])
|
||||
const count = ref(0)
|
||||
const query = reactive({
|
||||
page: Number(route.params.page),
|
||||
username: "",
|
||||
username: route.query.username ?? "",
|
||||
})
|
||||
|
||||
const html = computed(() => submission.value.html)
|
||||
|
||||
Reference in New Issue
Block a user