feat: Add ReadOnlyTokenWarning component and implement student name management dialog

- Introduced ReadOnlyTokenWarning.vue to alert users when using a read-only token.
- Added StudentNameManager.vue for managing student names with a dialog interface.
- Implemented AlternativeCodeDialog.vue for entering alternative codes (functionality pending).
- Created DeviceAuthDialog.vue for device authentication using namespace and password.
- Developed FirstTimeGuide.vue to guide users through the initial setup of Classworks KV.
- Added TokenInputDialog.vue for manual input of KV authorization tokens.
- Updated settings.vue to include a button for opening Classworks KV.
- Enhanced error handling and user feedback across components.
This commit is contained in:
SunWuyuan
2025-11-01 19:31:41 +08:00
parent a2b0cc9e08
commit df3c8e5a12
12 changed files with 2003 additions and 154 deletions
@@ -0,0 +1,68 @@
<template>
<v-card>
<v-card-title>输入替代代码</v-card-title>
<v-card-text>
<v-textarea
v-model="code"
label="替代代码"
placeholder="请输入替代代码"
variant="outlined"
density="comfortable"
rows="5"
hide-details="auto"
/>
<v-alert
type="info"
variant="tonal"
class="mt-3"
>
替代代码功能暂未实现,敬请期待
</v-alert>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
v-if="showCancel"
variant="text"
@click="$emit('cancel')"
>
取消
</v-btn>
<v-btn
:disabled="!code"
color="primary"
@click="submit"
>
提交
</v-btn>
</v-card-actions>
</v-card>
</template>
<script setup>
import { ref } from 'vue'
defineProps({
showCancel: {
type: Boolean,
default: false
}
})
const emit = defineEmits(['submit', 'cancel'])
const code = ref('')
const submit = () => {
if (!code.value) return
// TODO: 实现替代代码逻辑
emit('submit', code.value)
}
// 暴露清空表单的方法
defineExpose({
reset: () => {
code.value = ''
}
})
</script>