feat: localize shared business labels across 33 views
This commit is contained in:
1 parent
17f7ac3e00
commit
ed1f861708
35 files changed
+567
-499
No files matched your search
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { t } = useI18n()
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { Calendar, Check, Plus, Refresh, User } from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -838,7 +840,7 @@ onMounted(async () => {
|
||||
<el-button v-if="!isStudent" type="primary" :icon="Plus" @click="openCreateProject">
|
||||
批量设置实验任务
|
||||
</el-button>
|
||||
<el-button :icon="Refresh" @click="load">刷新</el-button>
|
||||
<el-button :icon="Refresh" @click="load">{{ t('businessLabels.refresh') }}</el-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -857,7 +859,7 @@ onMounted(async () => {
|
||||
</section>
|
||||
|
||||
<section class="experiment-toolbar">
|
||||
<el-select v-model="termId" clearable placeholder="全部学期" @change="changeTerm">
|
||||
<el-select v-model="termId" clearable :placeholder="t('businessLabels.allTerms')" @change="changeTerm">
|
||||
<el-option
|
||||
v-for="term in terms"
|
||||
:key="term.id"
|
||||
@@ -878,8 +880,8 @@ onMounted(async () => {
|
||||
<el-option label="集中安排" value="Centralized" />
|
||||
<el-option label="自行安排" value="SelfScheduled" />
|
||||
</el-select>
|
||||
<el-select v-model="statusFilter" clearable placeholder="全部状态" @change="load">
|
||||
<el-option label="草稿" value="Draft" />
|
||||
<el-select v-model="statusFilter" clearable :placeholder="t('businessLabels.allStatus')" @change="load">
|
||||
<el-option :label="t('businessLabels.draft')" value="Draft" />
|
||||
<el-option label="进行中" value="Published" />
|
||||
<el-option label="已关闭" value="Closed" />
|
||||
</el-select>
|
||||
@@ -955,20 +957,20 @@ onMounted(async () => {
|
||||
<el-table-column label="方式" width="100" align="center">
|
||||
<template #default="{ row }"><el-tag :type="row.arrangementMode === 'Centralized' ? 'primary' : 'success'" effect="plain">{{ modeMeta[row.arrangementMode].label }}</el-tag></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="88" align="center">
|
||||
<el-table-column :label="t('businessLabels.status')" width="88" align="center">
|
||||
<template #default="{ row }"><el-tag :type="row.status === 'Published' ? 'success' : row.status === 'Closed' ? 'info' : 'warning'">{{ statusLabels[row.status] }}</el-tag></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="244" fixed="right" align="right">
|
||||
<el-table-column :label="t('businessLabels.actions')" width="244" fixed="right" align="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.status === 'Draft'">
|
||||
<el-button size="small" text :disabled="row.teachingTaskStatus !== 'Published'" @click="openEditProject(row)">编辑</el-button>
|
||||
<el-button size="small" text type="danger" :disabled="row.teachingTaskStatus !== 'Published'" @click="deleteProject(row)">删除</el-button>
|
||||
<el-button size="small" text :disabled="row.teachingTaskStatus !== 'Published'" @click="openEditProject(row)">{{ t('businessLabels.edit') }}</el-button>
|
||||
<el-button size="small" text type="danger" :disabled="row.teachingTaskStatus !== 'Published'" @click="deleteProject(row)">{{ t('businessLabels.delete') }}</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:disabled="row.teachingTaskStatus !== 'Published' || (row.arrangementMode === 'Centralized' ? !row.scheduleEntry : !row.sessions.some((item: any) => item.status !== 'Cancelled'))"
|
||||
@click="publishProject(row)"
|
||||
>发布</el-button>
|
||||
>{{ t('businessLabels.publish') }}</el-button>
|
||||
</template>
|
||||
<template v-else-if="row.status === 'Published'">
|
||||
<el-button size="small" text :disabled="row.teachingTaskStatus !== 'Published'" @click="openCorrectPublishedProject(row)">修正内容</el-button>
|
||||
@@ -1023,7 +1025,7 @@ onMounted(async () => {
|
||||
<el-table-column label="方式" width="100" align="center">
|
||||
<template #default="{ row }"><el-tag :type="row.arrangementMode === 'Centralized' ? 'primary' : 'success'" effect="plain" size="small">{{ modeMeta[row.arrangementMode].label }}</el-tag></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="88" align="center">
|
||||
<el-table-column :label="t('businessLabels.status')" width="88" align="center">
|
||||
<template #default="{ row }"><el-tag :type="row.status === 'Published' ? 'success' : 'info'" size="small">{{ statusLabels[row.status] }}</el-tag></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预约操作" width="190" fixed="right" align="right">
|
||||
@@ -1049,7 +1051,7 @@ onMounted(async () => {
|
||||
<el-empty v-if="!row.sessions.length" :image-size="42" description="暂无有效实验场次" />
|
||||
</div>
|
||||
</el-popover>
|
||||
<el-button v-if="row.myBooking && row.status === 'Published' && row.teachingTaskStatus === 'Published'" size="small" text type="danger" @click="cancelBooking(row)">取消</el-button>
|
||||
<el-button v-if="row.myBooking && row.status === 'Published' && row.teachingTaskStatus === 'Published'" size="small" text type="danger" @click="cancelBooking(row)">{{ t('businessLabels.cancel') }}</el-button>
|
||||
</template>
|
||||
<span v-else class="table-muted">无需预约</span>
|
||||
</template>
|
||||
@@ -1172,7 +1174,7 @@ onMounted(async () => {
|
||||
<el-option v-for="college in options.colleges" :key="college.collegeId" :label="college.collegeName" :value="college.collegeId" />
|
||||
</el-select>
|
||||
<el-input v-model="courseKeyword" clearable placeholder="课程名称或代码" @keyup.enter="searchTaskOptions" />
|
||||
<el-button @click="searchTaskOptions">查询</el-button>
|
||||
<el-button @click="searchTaskOptions">{{ t('businessLabels.search') }}</el-button>
|
||||
</div>
|
||||
<section v-for="group in taskGroups" :key="group.key" class="task-picker-course">
|
||||
<header>
|
||||
@@ -1252,8 +1254,8 @@ onMounted(async () => {
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:start-placeholder="t('businessLabels.startDate')"
|
||||
:end-placeholder="t('businessLabels.endDate')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="projectForm.arrangementMode === 'SelfScheduled'" label="学生选课时间" required>
|
||||
@@ -1294,7 +1296,7 @@ onMounted(async () => {
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="projectDialog = false">取消</el-button>
|
||||
<el-button @click="projectDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="saveProject">
|
||||
{{ correctingPublishedProject
|
||||
? '保存修正'
|
||||
@@ -1319,7 +1321,7 @@ onMounted(async () => {
|
||||
</ol>
|
||||
<el-input v-model="batchRenameNames" type="textarea" :rows="Math.min(12, Math.max(5, batchRenameProjects.length))" maxlength="12000" placeholder="每行一个实验项目名称" />
|
||||
<template #footer>
|
||||
<el-button @click="batchRenameDialog = false">取消</el-button>
|
||||
<el-button @click="batchRenameDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="saveBatchRename">保存名称</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -1395,7 +1397,7 @@ onMounted(async () => {
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="sessionDialog = false">取消</el-button>
|
||||
<el-button @click="sessionDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="saveSession">保存场次</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -1478,14 +1480,14 @@ onMounted(async () => {
|
||||
<el-input-number v-model="row.capacity" :min="1" :max="10000" controls-position="right" />
|
||||
<span class="batch-session-actions">
|
||||
<el-button size="small" text type="primary" @click="addBatchSessionRow(row.projectId, row)">追加时段</el-button>
|
||||
<el-button size="small" text type="danger" @click="removeBatchSessionRow(row)">移除</el-button>
|
||||
<el-button size="small" text type="danger" @click="removeBatchSessionRow(row)">{{ t('businessLabels.remove') }}</el-button>
|
||||
</span>
|
||||
</article>
|
||||
</div>
|
||||
<el-empty v-if="!batchSessionRows.length" :image-size="60" description="选择实验项目后,在同一张表中完成排课" />
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="batchSessionDialog = false">取消</el-button>
|
||||
<el-button @click="batchSessionDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
||||
<el-button type="primary" :disabled="!batchSessionRows.length" @click="saveBatchSessions">
|
||||
提交整批排课
|
||||
</el-button>
|
||||
@@ -1498,9 +1500,9 @@ onMounted(async () => {
|
||||
width="680px"
|
||||
>
|
||||
<el-table v-loading="participantsLoading" :data="participants" max-height="480">
|
||||
<el-table-column prop="studentNumber" label="学号" min-width="130" />
|
||||
<el-table-column prop="name" label="姓名" min-width="100" />
|
||||
<el-table-column prop="className" label="行政班" min-width="160" />
|
||||
<el-table-column prop="studentNumber" :label="t('businessLabels.studentNumber')" min-width="130" />
|
||||
<el-table-column prop="name" :label="t('businessLabels.name')" min-width="100" />
|
||||
<el-table-column prop="className" :label="t('businessLabels.administrativeClass')" min-width="160" />
|
||||
<el-table-column label="参与方式" width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
@@ -1520,7 +1522,7 @@ onMounted(async () => {
|
||||
type="primary"
|
||||
@click="openProxyBooking"
|
||||
>教师代选</el-button>
|
||||
<el-button @click="participantsDialog = false">关闭</el-button>
|
||||
<el-button @click="participantsDialog = false">{{ t('businessLabels.close') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
@@ -1533,7 +1535,7 @@ onMounted(async () => {
|
||||
/>
|
||||
<div class="proxy-booking-search">
|
||||
<el-input v-model="proxyBookingKeyword" clearable placeholder="输入学号、姓名或行政班" @keyup.enter="loadProxyBookingStudents(1)" />
|
||||
<el-button @click="loadProxyBookingStudents(1)">查询</el-button>
|
||||
<el-button @click="loadProxyBookingStudents(1)">{{ t('businessLabels.search') }}</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="proxyBookingLoading"
|
||||
@@ -1542,14 +1544,14 @@ onMounted(async () => {
|
||||
@selection-change="(rows) => proxyBookingStudentIds = rows.map((row) => row.studentId)"
|
||||
>
|
||||
<el-table-column type="selection" width="54" />
|
||||
<el-table-column prop="studentNumber" label="学号" min-width="130" />
|
||||
<el-table-column prop="name" label="姓名" min-width="100" />
|
||||
<el-table-column prop="className" label="行政班" min-width="180" />
|
||||
<el-table-column prop="studentNumber" :label="t('businessLabels.studentNumber')" min-width="130" />
|
||||
<el-table-column prop="name" :label="t('businessLabels.name')" min-width="100" />
|
||||
<el-table-column prop="className" :label="t('businessLabels.administrativeClass')" min-width="180" />
|
||||
</el-table>
|
||||
<el-pagination v-if="proxyBookingTotal > proxyBookingPageSize" background :current-page="proxyBookingPage" :page-size="proxyBookingPageSize" :total="proxyBookingTotal" layout="total, prev, pager, next" @current-change="loadProxyBookingStudents" />
|
||||
<el-empty v-if="!proxyBookingLoading && !proxyBookingStudents.length" description="没有可代选的学生" />
|
||||
<template #footer>
|
||||
<el-button @click="proxyBookingDialog = false">取消</el-button>
|
||||
<el-button @click="proxyBookingDialog = false">{{ t('businessLabels.cancel') }}</el-button>
|
||||
<el-button type="primary" :disabled="!proxyBookingStudentIds.length" @click="saveProxyBooking">
|
||||
确认代选({{ proxyBookingStudentIds.length }})
|
||||
</el-button>
|
||||
|
||||
Reference in new issue
Block a user