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