forked from liweijie/education
前端代码
This commit is contained in:
@@ -0,0 +1,654 @@
|
||||
<template>
|
||||
<div class="app-container timetable-page">
|
||||
<el-tabs v-model="activeTab" class="timetable-tabs">
|
||||
<!-- 今日 -->
|
||||
<el-tab-pane label="今日" name="today">
|
||||
<div class="tab-body">
|
||||
<!-- 日期导航 -->
|
||||
<div class="nav-header">
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handlePrevDay">前一天</el-link>
|
||||
<div class="nav-title">{{ todayTitle }}</div>
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handleNextDay">后一天</el-link>
|
||||
</div>
|
||||
|
||||
<!-- 批量操作栏 -->
|
||||
<div class="toolbar-card">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button type="primary" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量设置备注信息</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量变更时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量平移时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量变更授课教员</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量变更授课场地</el-button>
|
||||
<el-button type="danger" size="mini" :disabled="!todaySelected.length" @click="handleComing">批量删除</el-button>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button type="primary" size="mini" @click="handleComing">自定义格式下载</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleComing">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 今日表格 -->
|
||||
<div class="table-card">
|
||||
<el-table :data="todayList" v-loading="loading" stripe border @selection-change="todaySelected = $event">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column label="上课时间" width="130" align="center">
|
||||
<template slot-scope="scope">{{ formatTime(scope.row.jc) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kcmc" label="课程" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="zrdw" label="责任单位" width="110" align="center" />
|
||||
<el-table-column prop="bc" label="班次" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="skjy" label="教员" width="90" align="center" />
|
||||
<el-table-column label="场地" width="140" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jxcd || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="教学内容方法" min-width="160" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row._jxnrff || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jybz" label="备注" width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jybz || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划变更明细" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openDetail(scope.row)">变更明细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openRemark(scope.row)">编辑备注</el-button>
|
||||
<el-button type="text" size="mini" class="danger-text" @click="handleComing">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-show="!loading && !todayList.length" description="当日暂无教学计划数据" />
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 本周 -->
|
||||
<el-tab-pane label="本周" name="week">
|
||||
<div class="tab-body">
|
||||
<!-- 周次导航 -->
|
||||
<div class="nav-header">
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handlePrevWeek">上一周</el-link>
|
||||
<div class="nav-title">{{ weekTitle }}</div>
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handleNextWeek">下一周</el-link>
|
||||
</div>
|
||||
|
||||
<!-- 批量操作栏 -->
|
||||
<div class="toolbar-card">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button type="primary" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量设置备注信息</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量变更时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量平移时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量变更授课教员</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量变更授课场地</el-button>
|
||||
<el-button type="danger" size="mini" :disabled="!weekSelected.length" @click="handleComing">批量删除</el-button>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button type="primary" size="mini" @click="handleComing">报批下载</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleComing">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 本周表格 -->
|
||||
<div class="table-card">
|
||||
<el-table :data="weekList" v-loading="loading" stripe border @selection-change="weekSelected = $event">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column label="上课时间" width="170" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row._sjsj || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kcmc" label="课程" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="zrdw" label="责任单位" width="100" align="center" />
|
||||
<el-table-column prop="bc" label="班次" width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="skjy" label="教员" width="90" align="center" />
|
||||
<el-table-column label="场地" width="140" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jxcd || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="教学内容方法" min-width="150" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row._jxnrff || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jybz" label="备注" width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jybz || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划变更明细" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openDetail(scope.row)">计划变更明细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openRemark(scope.row)">编辑备注</el-button>
|
||||
<el-button type="text" size="mini" class="danger-text" @click="handleComing">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-show="!loading && !weekList.length" description="本周暂无教学计划数据" />
|
||||
<pagination
|
||||
v-show="weekTotal > 0"
|
||||
:total="weekTotal"
|
||||
:page.sync="weekQuery.pageNum"
|
||||
:limit.sync="weekQuery.pageSize"
|
||||
@pagination="getWeekList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 三实 -->
|
||||
<el-tab-pane label="三实" name="practice">
|
||||
<div class="tab-body">
|
||||
<!-- 周次导航 -->
|
||||
<div class="nav-header">
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handlePrevWeek3">上一周</el-link>
|
||||
<div class="nav-title">{{ practiceTitle }}</div>
|
||||
<el-link type="primary" :underline="false" class="nav-link" @click="handleNextWeek3">下一周</el-link>
|
||||
</div>
|
||||
|
||||
<!-- 批量操作栏 -->
|
||||
<div class="toolbar-card">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button type="primary" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量设置备注信息</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量变更时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量平移时间</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量变更授课教员</el-button>
|
||||
<el-button type="primary" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量变更授课场地</el-button>
|
||||
<el-button type="danger" size="mini" :disabled="!practiceSelected.length" @click="handleComing">批量删除</el-button>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button type="primary" size="mini" @click="handleComing">报批下载</el-button>
|
||||
<el-button type="primary" size="mini" @click="handleComing">下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 三实表格 -->
|
||||
<div class="table-card">
|
||||
<el-table :data="practiceList" v-loading="loading" stripe border @selection-change="practiceSelected = $event">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column label="上课时间" width="170" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row._sjsj || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="kcmc" label="课程" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="zrdw" label="责任单位" width="100" align="center" />
|
||||
<el-table-column prop="bc" label="班次" width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="skjy" label="教员" width="90" align="center" />
|
||||
<el-table-column label="场地" width="140" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jxcd || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="教学内容方法" min-width="150" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row._jxnrff || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="jybz" label="备注" width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">{{ scope.row.jybz || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划变更明细" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openDetail(scope.row)">计划变更明细</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini" @click="openRemark(scope.row)">编辑备注</el-button>
|
||||
<el-button type="text" size="mini" class="danger-text" @click="handleComing">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-show="!loading && !practiceList.length" description="本周暂无三实教学计划数据" />
|
||||
<pagination
|
||||
v-show="practiceTotal > 0"
|
||||
:total="practiceTotal"
|
||||
:page.sync="practiceQuery.pageNum"
|
||||
:limit.sync="practiceQuery.pageSize"
|
||||
@pagination="getPracticeList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- 班次 -->
|
||||
<el-tab-pane label="班次" name="shift">
|
||||
<div class="tab-body">
|
||||
<!-- 查询条件 -->
|
||||
<el-form :inline="true" class="shift-search">
|
||||
<el-form-item label="队别班次">
|
||||
<el-select v-model="shiftTeamClass" placeholder="请选择队别班次" clearable class="shift-select">
|
||||
<el-option label="一班" value="一班" />
|
||||
<el-option label="二班" value="二班" />
|
||||
<el-option label="三班" value="三班" />
|
||||
<el-option label="四班" value="四班" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleComing">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="shift-title">2026年秋季学期{{ shiftTeamClass || '' }}课程表</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期教学实施计划</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期课程表(周次星期)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期课程表(班次视图)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期课程表(排课周)含选修</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期教学实施计划(含选修)</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期课程表(周次星期)详细</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-download" size="mini" @click="handleComing">学期成绩表</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-download" size="mini" @click="handleComing">课程列表另存Excel</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 班次课程表 -->
|
||||
<el-table v-loading="loading" :data="shiftList" border stripe>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column label="课程名称/课时系数" min-width="220">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.row.kcmc }}</div>
|
||||
<div class="sub-text">{{ scope.row.kssk }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zrjs" label="责任教员/课次" min-width="150" />
|
||||
<el-table-column prop="bc" label="班次" min-width="120" />
|
||||
<el-table-column prop="nj" label="年级" width="80" align="center" />
|
||||
<el-table-column prop="zy" label="专业" min-width="120" />
|
||||
<el-table-column prop="jhxs" label="计划学时" width="90" align="center" />
|
||||
<el-table-column prop="yxxs" label="运行学时" width="90" align="center" />
|
||||
<el-table-column prop="khlxfs" label="考核类型方式" min-width="140" />
|
||||
<el-table-column prop="ssjs" label="实施教员" min-width="120" />
|
||||
<el-table-column prop="rscd" label="人数/场地" min-width="140" />
|
||||
<el-table-column prop="kcjd" label="课程进度" width="120" align="center" />
|
||||
<el-table-column prop="ssjhbg" label="实施计划变更" min-width="120" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 编辑备注弹窗 -->
|
||||
<el-dialog title="编辑备注" :visible.sync="remarkVisible" width="500px" append-to-body>
|
||||
<el-form label-width="80px">
|
||||
<el-form-item label="课程">
|
||||
<span>{{ remarkTarget.kcmc || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注内容">
|
||||
<el-input v-model="remarkText" type="textarea" :rows="4" placeholder="请输入备注内容" maxlength="500" show-word-limit />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirmRemark">确定</el-button>
|
||||
<el-button @click="remarkVisible = false">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 计划变更明细弹窗 -->
|
||||
<el-dialog title="计划变更明细" :visible.sync="detailVisible" width="560px" append-to-body>
|
||||
<el-descriptions :column="2" border size="small" v-if="detailTarget">
|
||||
<el-descriptions-item label="课程">{{ detailTarget.kcmc }}</el-descriptions-item>
|
||||
<el-descriptions-item label="班次">{{ detailTarget.bc }}</el-descriptions-item>
|
||||
<el-descriptions-item label="责任单位">{{ detailTarget.zrdw }}</el-descriptions-item>
|
||||
<el-descriptions-item label="上课时间">{{ detailTarget._sjsj || formatTime(detailTarget.jc) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="原节次">{{ detailTarget.yjc || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="授课教员">{{ detailTarget.skjy }}</el-descriptions-item>
|
||||
<el-descriptions-item label="教学场地">{{ detailTarget.jxcd || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="检查结果">{{ detailTarget.jcjg || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="已通过检查" :span="2">
|
||||
<el-tag :type="detailTarget.ytgjc ? 'success' : 'info'" size="mini">{{ detailTarget.ytgjc ? '是' : '否' }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 节次 -> 时间映射
|
||||
const JC_TIME = {
|
||||
1: '08:00-08:45',
|
||||
2: '08:55-09:40',
|
||||
3: '10:00-10:45',
|
||||
4: '10:55-11:40',
|
||||
5: '14:30-15:15',
|
||||
6: '15:25-16:10',
|
||||
7: '16:20-17:05',
|
||||
8: '19:00-19:45',
|
||||
9: '19:55-20:40'
|
||||
}
|
||||
// 节次 -> 节次区间映射
|
||||
const JC_SECTION = {
|
||||
1: '1-2节', 2: '3-4节', 3: '5-6节', 4: '7-8节', 5: '9-10节', 6: '11-12节'
|
||||
}
|
||||
|
||||
const WEEK_DAY_NAMES = ['日', '一', '二', '三', '四', '五', '六']
|
||||
|
||||
function pad2(n) {
|
||||
return n < 10 ? '0' + n : '' + n
|
||||
}
|
||||
|
||||
function formatDate(d) {
|
||||
return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate())
|
||||
}
|
||||
|
||||
function getMonday(d) {
|
||||
const day = d.getDay() || 7
|
||||
const monday = new Date(d)
|
||||
monday.setDate(d.getDate() - day + 1)
|
||||
return monday
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Timetable',
|
||||
data() {
|
||||
return {
|
||||
activeTab: 'today',
|
||||
loading: false,
|
||||
// 今日
|
||||
todayDate: new Date(),
|
||||
todayList: [],
|
||||
todaySelected: [],
|
||||
// 本周
|
||||
weekStart: getMonday(new Date()),
|
||||
weekList: [],
|
||||
weekSelected: [],
|
||||
weekTotal: 0,
|
||||
weekQuery: { pageNum: 1, pageSize: 20 },
|
||||
// 三实
|
||||
practiceStart: getMonday(new Date()),
|
||||
practiceList: [],
|
||||
practiceSelected: [],
|
||||
practiceTotal: 0,
|
||||
practiceQuery: { pageNum: 1, pageSize: 20 },
|
||||
// 班次(仅占位数据,待对接接口)
|
||||
shiftTeamClass: '',
|
||||
shiftList: [],
|
||||
// 弹窗
|
||||
remarkVisible: false,
|
||||
remarkTarget: {},
|
||||
remarkText: '',
|
||||
detailVisible: false,
|
||||
detailTarget: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
todayTitle() {
|
||||
return '当前日期:' + formatDate(this.todayDate) + '时间顺序教学实施计划'
|
||||
},
|
||||
weekTitle() {
|
||||
const end = new Date(this.weekStart)
|
||||
end.setDate(end.getDate() + 6)
|
||||
return formatDate(this.weekStart) + '(' + this.weekDayName(this.weekStart) + ') 至 ' +
|
||||
formatDate(end) + '(' + this.weekDayName(end) + ') 教学实施计划'
|
||||
},
|
||||
practiceTitle() {
|
||||
const end = new Date(this.practiceStart)
|
||||
end.setDate(end.getDate() + 6)
|
||||
return formatDate(this.practiceStart) + '(' + this.weekDayName(this.practiceStart) + ') 至 ' +
|
||||
formatDate(end) + '(' + this.weekDayName(end) + ') 三实教学实施计划'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTodayList()
|
||||
this.getWeekList()
|
||||
this.getPracticeList()
|
||||
},
|
||||
methods: {
|
||||
weekDayName(d) {
|
||||
return WEEK_DAY_NAMES[d.getDay()]
|
||||
},
|
||||
formatTime(jc) {
|
||||
if (!jc) return '-'
|
||||
return JC_TIME[jc] || ('第' + jc + '节')
|
||||
},
|
||||
formatSection(jc) {
|
||||
if (!jc) return ''
|
||||
return JC_SECTION[jc] || ('第' + jc + '节')
|
||||
},
|
||||
buildSjsj(rq, jc) {
|
||||
const date = (rq || '').substring(0, 10)
|
||||
if (!date) return '-'
|
||||
const d = new Date(date.replace(/-/g, '/'))
|
||||
const wn = WEEK_DAY_NAMES[d.getDay()]
|
||||
const section = this.formatSection(jc)
|
||||
return (date + ' 周' + wn + ' ' + section).trim()
|
||||
},
|
||||
/* ---------- 今日 ---------- */
|
||||
handlePrevDay() {
|
||||
const d = new Date(this.todayDate)
|
||||
d.setDate(d.getDate() - 1)
|
||||
this.todayDate = d
|
||||
this.getTodayList()
|
||||
},
|
||||
handleNextDay() {
|
||||
const d = new Date(this.todayDate)
|
||||
d.setDate(d.getDate() + 1)
|
||||
this.todayDate = d
|
||||
this.getTodayList()
|
||||
},
|
||||
getTodayList() {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.todayList = this.buildMockList(this.todayDate)
|
||||
this.loading = false
|
||||
}, 200)
|
||||
},
|
||||
/* ---------- 本周 ---------- */
|
||||
handlePrevWeek() {
|
||||
const d = new Date(this.weekStart)
|
||||
d.setDate(d.getDate() - 7)
|
||||
this.weekStart = d
|
||||
this.getWeekList()
|
||||
},
|
||||
handleNextWeek() {
|
||||
const d = new Date(this.weekStart)
|
||||
d.setDate(d.getDate() + 7)
|
||||
this.weekStart = d
|
||||
this.getWeekList()
|
||||
},
|
||||
getWeekList() {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.weekList = this.buildMockWeekList(this.weekStart)
|
||||
this.weekTotal = this.weekList.length
|
||||
this.loading = false
|
||||
}, 200)
|
||||
},
|
||||
/* ---------- 三实 ---------- */
|
||||
handlePrevWeek3() {
|
||||
const d = new Date(this.practiceStart)
|
||||
d.setDate(d.getDate() - 7)
|
||||
this.practiceStart = d
|
||||
this.getPracticeList()
|
||||
},
|
||||
handleNextWeek3() {
|
||||
const d = new Date(this.practiceStart)
|
||||
d.setDate(d.getDate() + 7)
|
||||
this.practiceStart = d
|
||||
this.getPracticeList()
|
||||
},
|
||||
getPracticeList() {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.practiceList = this.buildMockWeekList(this.practiceStart)
|
||||
this.practiceTotal = this.practiceList.length
|
||||
this.loading = false
|
||||
}, 200)
|
||||
},
|
||||
/* ---------- 静态示例数据(待对接接口) ---------- */
|
||||
buildMockList(date) {
|
||||
const dateStr = formatDate(date)
|
||||
const samples = [
|
||||
{ jc: 1, kcmc: '高等数学', zrdw: '基础部', bc: '一班', skjy: '张教员', jxcd: '1号教学楼-101', jxnr: '函数与极限', jxff: '讲授', jybz: '携带教材' },
|
||||
{ jc: 3, kcmc: '大学英语', zrdw: '基础部', bc: '二班', skjy: '李教员', jxcd: '2号教学楼-205', jxnr: 'Unit 3 课文精读', jxff: '讲授/讨论', jybz: '' },
|
||||
{ jc: 5, kcmc: '计算机基础', zrdw: '信息工程系', bc: '三班', skjy: '王教员', jxcd: '实验楼-303', jxnr: 'Word 文档排版', jxff: '实操', jybz: '机房上课' }
|
||||
]
|
||||
return samples.map((item, index) => ({
|
||||
...item,
|
||||
xh: index + 1,
|
||||
rq: dateStr,
|
||||
_jxnrff: [item.jxnr, item.jxff].filter(Boolean).join(' / ')
|
||||
}))
|
||||
},
|
||||
buildMockWeekList(weekStart) {
|
||||
const list = []
|
||||
const dates = []
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const d = new Date(weekStart)
|
||||
d.setDate(d.getDate() + i)
|
||||
dates.push(formatDate(d))
|
||||
}
|
||||
const courses = [
|
||||
{ jc: 1, kcmc: '高等数学', zrdw: '基础部', bc: '一班', skjy: '张教员', jxcd: '1号教学楼-101', jxnr: '函数与极限', jxff: '讲授', jybz: '携带教材' },
|
||||
{ jc: 2, kcmc: '大学英语', zrdw: '基础部', bc: '二班', skjy: '李教员', jxcd: '2号教学楼-205', jxnr: 'Unit 3 课文精读', jxff: '讲授/讨论', jybz: '' },
|
||||
{ jc: 3, kcmc: '计算机基础', zrdw: '信息工程系', bc: '三班', skjy: '王教员', jxcd: '实验楼-303', jxnr: 'Word 文档排版', jxff: '实操', jybz: '机房上课' },
|
||||
{ jc: 4, kcmc: '军事理论', zrdw: '政工系', bc: '一班', skjy: '赵教员', jxcd: '3号教学楼-110', jxnr: '国防动员概述', jxff: '讲授', jybz: '' }
|
||||
]
|
||||
dates.forEach((dateStr, i) => {
|
||||
courses.forEach((item, idx) => {
|
||||
// 隔天轮换部分课程,保证每周有内容且不重复
|
||||
if ((i + idx) % 2 === 0) {
|
||||
list.push({
|
||||
...item,
|
||||
xh: list.length + 1,
|
||||
rq: dateStr,
|
||||
_sjsj: this.buildSjsj(dateStr, item.jc),
|
||||
_jxnrff: [item.jxnr, item.jxff].filter(Boolean).join(' / ')
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
return list
|
||||
},
|
||||
/* ---------- 弹窗 ---------- */
|
||||
openRemark(row) {
|
||||
this.remarkTarget = row
|
||||
this.remarkText = row.jybz || ''
|
||||
this.remarkVisible = true
|
||||
},
|
||||
confirmRemark() {
|
||||
this.$message.success('备注已更新')
|
||||
this.remarkVisible = false
|
||||
},
|
||||
openDetail(row) {
|
||||
this.detailTarget = row
|
||||
this.detailVisible = true
|
||||
},
|
||||
handleComing() {
|
||||
this.$message.info('功能建设中,敬请期待')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.timetable-page {
|
||||
.timetable-tabs {
|
||||
background: #fff;
|
||||
padding: 0 16px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.tab-body {
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
/* 日期/周次导航 */
|
||||
.nav-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 24px;
|
||||
margin-bottom: 12px;
|
||||
padding: 14px 16px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
|
||||
.nav-link {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
|
||||
/* 批量操作栏 */
|
||||
.toolbar-card {
|
||||
margin-bottom: 12px;
|
||||
padding: 10px 14px;
|
||||
background: #fff;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
|
||||
.toolbar-left,
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 表格区 */
|
||||
.table-card {
|
||||
.danger-text {
|
||||
color: #f56c6c;
|
||||
}
|
||||
}
|
||||
|
||||
/* 班次 */
|
||||
.shift-search {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.shift-select {
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
.shift-title {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
text-align: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.sub-text {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user