Initial commit
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user