教师档案增加“激活账号”:管理员设置初始密码,服务端校验管理权限、学院数据范围、在职状态、工号冲突,并自动关联教师角色与档案。
已发布课表增加“发布后修改”:创建修订草稿,旧课表继续生效;修订版重新发布后再替换旧版本。 修复 390px 窄屏下课表页头按钮溢出。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
|
||||
import { CopyDocument, Plus, Promotion, Refresh, Search, Setting } from '@element-plus/icons-vue'
|
||||
import { CopyDocument, EditPen, Plus, Promotion, Refresh, Search, Setting } from '@element-plus/icons-vue'
|
||||
import http, { apiErrorMessage } from '../api/http'
|
||||
|
||||
const plans = ref<any[]>([])
|
||||
@@ -29,6 +29,7 @@ const keyword = ref('')
|
||||
const termId = ref<string | undefined>()
|
||||
const planForm = reactive<Record<string, any>>({})
|
||||
const cloneForm = reactive<Record<string, any>>({})
|
||||
const revisingPublishedPlan = ref(false)
|
||||
const entryForm = reactive<Record<string, any>>({})
|
||||
const constraintForm = reactive<Record<string, any>>({})
|
||||
const constraintBatchForm = reactive<Record<string, any>>({})
|
||||
@@ -478,8 +479,9 @@ async function savePlan() {
|
||||
}
|
||||
|
||||
function openClone() {
|
||||
revisingPublishedPlan.value = selected.value.status === 'Published'
|
||||
Object.assign(cloneForm, {
|
||||
name: `${selected.value.name}(调整版)`,
|
||||
name: `${selected.value.name}(修订版)`,
|
||||
version: `V${plans.value.length + 1}`,
|
||||
})
|
||||
cloneDialog.value = true
|
||||
@@ -487,10 +489,18 @@ function openClone() {
|
||||
|
||||
async function clonePlan() {
|
||||
try {
|
||||
await http.post(`/schedules/plans/${selected.value.id}/clone`, cloneForm)
|
||||
const { data } = await http.post(
|
||||
`/schedules/plans/${selected.value.id}/clone`,
|
||||
cloneForm,
|
||||
)
|
||||
cloneDialog.value = false
|
||||
ElMessage.success('已复制为可调整的草稿版本')
|
||||
ElMessage.success(
|
||||
revisingPublishedPlan.value
|
||||
? '已建立修订草稿,原已发布课表继续生效'
|
||||
: '已复制为可调整的草稿版本',
|
||||
)
|
||||
await loadPlans(false)
|
||||
if (data.id && selected.value?.id !== data.id) await loadDetail(data.id)
|
||||
} catch (error) {
|
||||
ElMessage.error(apiErrorMessage(error))
|
||||
}
|
||||
@@ -499,7 +509,7 @@ async function clonePlan() {
|
||||
async function publishPlan() {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'系统将再次检查全部教师、行政班和教室冲突;发布后本版本锁定,并归档旧课表。',
|
||||
'系统将再次检查全部教师、行政班和教室冲突;发布后本版本锁定并替换旧课表,后续仍可通过“发布后修改”建立修订版。',
|
||||
'发布课表',
|
||||
{ type: 'warning', confirmButtonText: '检查并发布', cancelButtonText: '取消' },
|
||||
)
|
||||
@@ -631,7 +641,23 @@ onBeforeUnmount(clearAutoSchedulePoll)
|
||||
</div>
|
||||
<div class="plan-actions">
|
||||
<el-button v-if="isDraft" :disabled="autoLoading" @click="openPlan(selected)">编辑版本</el-button>
|
||||
<el-button :icon="CopyDocument" :disabled="autoLoading" @click="openClone">复制调整</el-button>
|
||||
<el-button
|
||||
v-if="selected.status === 'Published'"
|
||||
type="warning"
|
||||
plain
|
||||
:icon="EditPen"
|
||||
@click="openClone"
|
||||
>
|
||||
发布后修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else
|
||||
:icon="CopyDocument"
|
||||
:disabled="autoLoading"
|
||||
@click="openClone"
|
||||
>
|
||||
复制调整
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="isDraft"
|
||||
type="warning"
|
||||
@@ -723,12 +749,28 @@ onBeforeUnmount(clearAutoSchedulePoll)
|
||||
<template #footer><el-button @click="planDialog = false">取消</el-button><el-button type="primary" @click="savePlan">保存</el-button></template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="cloneDialog" title="复制排课版本" width="520px">
|
||||
<el-dialog
|
||||
v-model="cloneDialog"
|
||||
:title="revisingPublishedPlan ? '发布后修改课表' : '复制排课版本'"
|
||||
width="520px"
|
||||
>
|
||||
<el-alert
|
||||
v-if="revisingPublishedPlan"
|
||||
title="系统会建立一份可编辑的修订草稿;原课表在修订版重新发布前继续生效,不会影响教师和学生查课。"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="新版本名称" required><el-input v-model="cloneForm.name" /></el-form-item>
|
||||
<el-form-item label="新版本号" required><el-input v-model="cloneForm.version" /></el-form-item>
|
||||
</el-form>
|
||||
<template #footer><el-button @click="cloneDialog = false">取消</el-button><el-button type="primary" @click="clonePlan">复制</el-button></template>
|
||||
<template #footer>
|
||||
<el-button @click="cloneDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="clonePlan">
|
||||
{{ revisingPublishedPlan ? '建立修订草稿' : '复制' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="entryDialog" :title="editingEntryId ? '调整排课' : '添加排课'" width="680px">
|
||||
|
||||
Reference in New Issue
Block a user