Initial commit

This commit is contained in:
Nvex
2025-10-24 12:53:22 +08:00
parent fb98a84ea5
commit fe802b9f34
7 changed files with 158 additions and 66 deletions

View File

@@ -1,6 +1,6 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import axios from 'axios';
import { useSettingsStore } from '../../store/settings';
const file = ref(null);
const previewData = ref([]);
@@ -8,6 +8,7 @@ const isParsing = ref(false);
const isWithdrawing = ref(false);
const fileInput = ref(null);
const schoolName = ref('');
const schoolNameError = ref('');
const showFailedOnly = ref(false);
const withdrawalResults = ref(null);
@@ -119,12 +120,19 @@ function clearPreview() {
}
}
const settingsStore = useSettingsStore();
onMounted(async () => {
try {
const response = await axios.get('http://127.0.0.1:5001/api/school-name');
schoolName.value = response.data.school_name;
} catch (error) {
console.error('Error fetching school name:', error);
if (settingsStore.authorization) {
schoolNameError.value = '令牌失效,请检查您的 Authorization';
} else {
schoolNameError.value = '请先在设置页面填写配置信息';
}
}
});
function getResultItemClass(studentId) {
@@ -146,6 +154,9 @@ function getResultIcon(studentId) {
<div v-if="schoolName" class="school-info-tag">
正在给 {{ schoolName }} 学校退课
</div>
<div v-if="schoolNameError" class="school-info-tag school-info-error">
{{ schoolNameError }}
</div>
<div class="step-section">
<div class="step-header">
@@ -391,6 +402,12 @@ function getResultIcon(studentId) {
display: inline-block;
}
.school-info-error {
background-color: #fff1f0;
border-color: #ffa39e;
color: #cf1322;
}
.admin-classes-grid {
grid-template-columns: repeat(3, 1fr);
gap: 4px;