fix: standardize terminology — 排课 (clazz) not 课程 (course)
"排课" = scheduled class instance, "课程" = course content/curriculum. All 21 instances of incorrect usage were in clazz/tongzhi/user-settings contexts where the underlying data is a clazz (clazz_id, clazz_name, is_repeat), not a course. Affected files: clazz/index.vue (10), tongzhi/index.vue (4), tongzhi/detail.vue (3), store/clazz.ts (3), user-settings.vue (1). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+10
-10
@@ -47,8 +47,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<van-form @submit="save">
|
<van-form @submit="save">
|
||||||
<div class="form-content">
|
<div class="form-content">
|
||||||
<van-field label="课程名称" required v-model="store.current.clazz_name" :readonly="state.readonly"/>
|
<van-field label="排课名称" required v-model="store.current.clazz_name" :readonly="state.readonly"/>
|
||||||
<van-field v-model="store.current.clazz_desc" label="课程描述" autosize rows="2" type="textarea" :readonly="state.readonly"/>
|
<van-field v-model="store.current.clazz_desc" label="排课描述" autosize rows="2" type="textarea" :readonly="state.readonly"/>
|
||||||
<template v-if="state.readonly">
|
<template v-if="state.readonly">
|
||||||
<van-field :model-value="dateTimeFormat(store.current.start_from)" readonly label="上课时间" required />
|
<van-field :model-value="dateTimeFormat(store.current.start_from)" readonly label="上课时间" required />
|
||||||
<van-field label="下课时间" readonly required :model-value="dateTimeFormat(store.current.end_by)" />
|
<van-field label="下课时间" readonly required :model-value="dateTimeFormat(store.current.end_by)" />
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="(state.readonly && store.current.is_repeat) || state.is_edit_root || (!store.current.id && !store.current.has_root)">
|
<template v-if="(state.readonly && store.current.is_repeat) || state.is_edit_root || (!store.current.id && !store.current.has_root)">
|
||||||
<van-cell title="重复课程">
|
<van-cell title="重复排课">
|
||||||
<template #right-icon>
|
<template #right-icon>
|
||||||
<van-checkbox v-model="store.current.is_repeat" :disabled="state.readonly"/>
|
<van-checkbox v-model="store.current.is_repeat" :disabled="state.readonly"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -137,10 +137,10 @@
|
|||||||
<template v-if="state.readonly">
|
<template v-if="state.readonly">
|
||||||
<van-button v-if="is_creator && store.current.id && !store.current.is_repeat" size="small" type="primary" plain block @click="openAttendance">点名(消课)</van-button>
|
<van-button v-if="is_creator && store.current.id && !store.current.is_repeat" size="small" type="primary" plain block @click="openAttendance">点名(消课)</van-button>
|
||||||
<div class="footer-actions">
|
<div class="footer-actions">
|
||||||
<van-button size="mini" type="primary" @click="edit(true)" v-if="is_creator && (store.current.instance || store.current.has_root)">编辑重复课程</van-button>
|
<van-button size="mini" type="primary" @click="edit(true)" v-if="is_creator && (store.current.instance || store.current.has_root)">编辑重复排课</van-button>
|
||||||
<van-button size="mini" type="primary" @click="edit(false)">编辑本次课程</van-button>
|
<van-button size="mini" type="primary" @click="edit(false)">编辑本次排课</van-button>
|
||||||
<van-button size="mini" type="danger" @click="remove(true)" v-if="is_creator && (store.current.instance || store.current.has_root)">取消重复课程</van-button>
|
<van-button size="mini" type="danger" @click="remove(true)" v-if="is_creator && (store.current.instance || store.current.has_root)">取消重复排课</van-button>
|
||||||
<van-button size="mini" type="danger" @click="remove(false)">取消本次课程</van-button>
|
<van-button size="mini" type="danger" @click="remove(false)">取消本次排课</van-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -456,7 +456,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
const notify_comment = (comment: Comment) => {
|
const notify_comment = (comment: Comment) => {
|
||||||
let {clazz_name, start_from, end_by} = store.current;
|
let {clazz_name, start_from, end_by} = store.current;
|
||||||
let comment_msg = "新的课程留言(" + clazz_name + " " + usingUser.store.current.real_name + ")"
|
let comment_msg = "新的排课留言(" + clazz_name + " " + usingUser.store.current.real_name + ")"
|
||||||
let payload: NotifyParam = {
|
let payload: NotifyParam = {
|
||||||
clazz_name: clazz_name, start_from, end_by,
|
clazz_name: clazz_name, start_from, end_by,
|
||||||
notify_type: NotifyTypes.TeacherCommentClazz,
|
notify_type: NotifyTypes.TeacherCommentClazz,
|
||||||
@@ -554,7 +554,7 @@ export default defineComponent({
|
|||||||
const view = (id: string) => {
|
const view = (id: string) => {
|
||||||
store.current = find(id);
|
store.current = find(id);
|
||||||
if (!store.current) {
|
if (!store.current) {
|
||||||
showFailToast("找不到对应的课程!")
|
showFailToast("找不到对应的排课!")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.editing = true;
|
state.editing = true;
|
||||||
@@ -735,7 +735,7 @@ export default defineComponent({
|
|||||||
if (await createInstance(store.current)) {
|
if (await createInstance(store.current)) {
|
||||||
await router.push('/daka/add?clazz_id=' + store.current.id + '&clazz_name=' + encodeURIComponent(store.current.clazz_name))
|
await router.push('/daka/add?clazz_id=' + store.current.id + '&clazz_name=' + encodeURIComponent(store.current.clazz_name))
|
||||||
} else {
|
} else {
|
||||||
showFailToast("课程创建失败!")
|
showFailToast("排课创建失败!")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await router.push('/daka/add?clazz_id=' + store.current.id + '&clazz_name=' + encodeURIComponent(store.current.clazz_name))
|
await router.push('/daka/add?clazz_id=' + store.current.id + '&clazz_name=' + encodeURIComponent(store.current.clazz_name))
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="van-cell" @click="onClick">
|
<div class="van-cell" @click="onClick">
|
||||||
<template v-if="entity.push_info?.clazz_id">
|
<template v-if="entity.push_info?.clazz_id">
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<span>课程名称</span>
|
<span>排课名称</span>
|
||||||
<span>{{ entity.push_info.clazz_name }}</span>
|
<span>{{ entity.push_info.clazz_name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
@@ -223,8 +223,8 @@ const onClick = () => {
|
|||||||
const getTongzhiTitle = (tongzhi_type) => {
|
const getTongzhiTitle = (tongzhi_type) => {
|
||||||
return {
|
return {
|
||||||
[NotifyTypes.ClazzCreateOrUpdate]: "上课时间确定通知",
|
[NotifyTypes.ClazzCreateOrUpdate]: "上课时间确定通知",
|
||||||
[NotifyTypes.ClazzDelete]: "课程预约取消通知",
|
[NotifyTypes.ClazzDelete]: "排课预约取消通知",
|
||||||
[NotifyTypes.TeacherCommentClazz]: "课程留言通知",
|
[NotifyTypes.TeacherCommentClazz]: "排课留言通知",
|
||||||
}[tongzhi_type];
|
}[tongzhi_type];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<div class="van-hairline--bottom"></div>
|
<div class="van-hairline--bottom"></div>
|
||||||
<template v-if="item.push_info?.clazz_id">
|
<template v-if="item.push_info?.clazz_id">
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<span>课程名称</span>
|
<span>排课名称</span>
|
||||||
<span>{{item.push_info.clazz_name}}</span>
|
<span>{{item.push_info.clazz_name}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
<div class="van-hairline--bottom"></div>
|
<div class="van-hairline--bottom"></div>
|
||||||
<template v-if="item.push_info?.clazz_id">
|
<template v-if="item.push_info?.clazz_id">
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<span>课程名称</span>
|
<span>排课名称</span>
|
||||||
<span>{{item.push_info.clazz_name}}</span>
|
<span>{{item.push_info.clazz_name}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
@@ -347,8 +347,8 @@ export default defineComponent({
|
|||||||
const getTongzhiTitle = (tongzhi_type) => {
|
const getTongzhiTitle = (tongzhi_type) => {
|
||||||
return {
|
return {
|
||||||
[NotifyTypes.ClazzCreateOrUpdate]: "上课时间确定通知",
|
[NotifyTypes.ClazzCreateOrUpdate]: "上课时间确定通知",
|
||||||
[NotifyTypes.ClazzDelete]: "课程预约取消通知",
|
[NotifyTypes.ClazzDelete]: "排课预约取消通知",
|
||||||
[NotifyTypes.TeacherCommentClazz]: "课程留言通知"
|
[NotifyTypes.TeacherCommentClazz]: "排课留言通知"
|
||||||
}[tongzhi_type]
|
}[tongzhi_type]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
<CellGroup inset>
|
<CellGroup inset>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Checkbox @click="toggle" v-model="receiveCourseNotification" shape="square">接收课程开课通知</Checkbox>
|
<Checkbox @click="toggle" v-model="receiveCourseNotification" shape="square">接收排课开课通知</Checkbox>
|
||||||
</Cell>
|
</Cell>
|
||||||
</CellGroup>
|
</CellGroup>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-3
@@ -234,7 +234,7 @@ export default function useClazz() {
|
|||||||
async function createOrUpdate() {
|
async function createOrUpdate() {
|
||||||
let { clazz_name, students, course_sections, clazz_repeat, start_from, end_by, is_repeat, instance, has_root, repeat_start, repeat_end, teachers, ...rest} = store.current;
|
let { clazz_name, students, course_sections, clazz_repeat, start_from, end_by, is_repeat, instance, has_root, repeat_start, repeat_end, teachers, ...rest} = store.current;
|
||||||
if (!clazz_name) {
|
if (!clazz_name) {
|
||||||
showFailToast("请输入课程名称!")
|
showFailToast("请输入排课名称!")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!students?.val?.users?.vals?.length) {
|
if (!students?.val?.users?.vals?.length) {
|
||||||
@@ -248,7 +248,7 @@ export default function useClazz() {
|
|||||||
}
|
}
|
||||||
if (is_repeat) {
|
if (is_repeat) {
|
||||||
if (!(repeat_start && repeat_end)) {
|
if (!(repeat_start && repeat_end)) {
|
||||||
showFailToast("请为重复课程选择重复时间!")
|
showFailToast("请为重复排课选择重复时间!")
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
clazz_repeat = {
|
clazz_repeat = {
|
||||||
@@ -345,7 +345,7 @@ export default function useClazz() {
|
|||||||
async function createInstance(instance: Clazz, is_delete?: boolean) {
|
async function createInstance(instance: Clazz, is_delete?: boolean) {
|
||||||
let { clazz_name, students, start_from, end_by, has_root, teachers, ...rest} = instance;
|
let { clazz_name, students, start_from, end_by, has_root, teachers, ...rest} = instance;
|
||||||
if (!clazz_name) {
|
if (!clazz_name) {
|
||||||
showFailToast("请输入课程名称!")
|
showFailToast("请输入排课名称!")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (!students?.val?.users?.vals?.length) {
|
if (!students?.val?.users?.vals?.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user