| name | wps-schedule |
| description | 课程表/日程表。快速生成格式漂亮的课程表、周工作计划、会议日程表,
按时间×日期的矩阵布局,不同类别自动用不同颜色区分。
用于帮助用户制作时间安排表。当用户提到课程表、日程表、时间安排、周计划时触发。
Schedule/timetable generator - class schedules, weekly plans, event agendas.
|
| license | MIT |
| user-invocable | true |
| argument-hint | [日程类型/内容] |
| allowed-tools | Read, Grep, Glob, Bash, Write, Edit |
| metadata | {"author":"BWKYD","title":"课程表/日程表","description_zh":"生成课程表、周工作计划表、会议日程安排表","tags":["日程","课程表","时间表","计划","WPS"],"version":"1.0.1","license":"MIT"} |
日程/时间表生成器
快速生成格式化的课程表、周计划、活动日程。
When to Use
- 制作课程表
- 周/月工作计划表
- 会议/活动日程安排
- 用户说"做个课程表""周计划表"
When NOT to Use
- 排班值班 → 使用
wps-cn-calendar
- 项目甘特图 → 使用
wps-gantt
模板类型
[1] 课程表 → 周一~周五 × 时间段
[2] 周计划 → 周一~周日 × 时间
[3] 会议日程 → 时间 × 议程
[4] 活动安排 → 多日活动详细时间表
工作流程
Step 1: 确认日程信息
- 类型(课程表/周计划/会议日程)
- 时间范围和时间段划分
- 内容项
Step 2: 生成时间表
from openpyxl import Workbook
from openpyxl.styles import Font, Alignment, PatternFill, Border, Side
import os
def create_timetable(schedule_type, data, output_path=None):
"""生成时间表"""
wb = Workbook()
ws = wb.active
header_fill = PatternFill('solid', fgColor='2C3E50')
header_font = Font(name='微软雅黑', size=11, bold=True, color='FFFFFF')
body_font = Font(name='微软雅黑', size=10)
thin = Side(style='thin')
border = Border(left=thin, right=thin, top=thin, bottom=thin)
colors = {
'语文': 'FADBD8', '数学': 'AED6F1', '英语': 'A9DFBF',
'物理': 'F9E79F', '化学': 'D7BDE2', '体育': 'ABEBC6',
'会议': 'AED6F1', '工作': 'A9DFBF', '学习': 'F9E79F',
}
if schedule_type == '课程表':
ws.title = "课程表"
days = ['时间', '周一', '周二', '周三', '周四', '周五']
time_slots = data.get('time_slots', [
'08:00-08:45', , , ,
, , ,
])
ws.merge_cells(start_row=, start_column=,
end_row=, end_column=(days))
ws[] = data.get(, )
ws[].font = Font(name=, size=, bold=)
ws[].alignment = Alignment(horizontal=)
col, day (days, ):
cell = ws.cell(row=, column=col, value=day)
cell.font = header_font
cell.fill = header_fill
cell.alignment = Alignment(horizontal=)
cell.border = border
ws.column_dimensions[].width =
col (, (days) + ):
ws.column_dimensions[( + col)].width =
courses = data.get(, {})
row, time_slot (time_slots, ):
ws.cell(row=row, column=, value=time_slot).font = body_font
ws.cell(row=row, column=).alignment = Alignment(horizontal=)
ws.cell(row=row, column=).border = border
ws.row_dimensions[row].height =
col (, (days) + ):
cell = ws.cell(row=row, column=col)
key =
course = courses.get(key, )
cell.value = course
cell.font = body_font
cell.alignment = Alignment(horizontal=,
vertical=)
cell.border = border
subject, color colors.items():
subject (course):
cell.fill = PatternFill(, fgColor=color)
row == :
r = row +
ws.merge_cells(start_row=r, start_column=,
end_row=r, end_column=(days))
ws.cell(row=r, column=, value=).font = Font(
name=, size=, bold=, color=)
ws.cell(row=r, column=).alignment = Alignment(
horizontal=)
output_path:
output_path =
wb.save(output_path)
os.path.abspath(output_path)
Step 3: 交付
- 生成格式化时间表Excel
- 颜色区分不同类别
- 可直接打印
示例
/wps-schedule 帮我做个课程表,周一到周五,每天7节课
/wps-schedule 做一个下周的工作计划表
/wps-schedule 明天全天会议的日程安排表