1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-02-04 07:53:11 +00:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Sunwuyuan
24524c91ec
Merge pull request #32 from user111192/feat-late-students-are-present
feat(settings): 添加迟到学生是否计入出勤人数的显示设置
2026-01-13 18:52:08 +08:00
user111192
65f73ada7d
Merge branch 'ZeroCatDev:main' into feat-late-students-are-present 2026-01-11 08:02:32 +08:00
chenziang
fca33c1b95
feat(settings): 添加迟到学生是否计入出勤人数的显示设置
- 在设置工具中新增 display.lateStudentsArePresent 配置项
- 修改考勤侧边栏计算逻辑以支持迟到人数统计选项
- 更新作业网格组件中的出勤人数计算方式
- 添加设置导入功能到相关组件中
- 在显示设置卡片中增加新的配置选项界面
2026-01-11 07:34:34 +08:00
4 changed files with 21 additions and 2 deletions

View File

@ -28,7 +28,7 @@
{{ {{
studentList.length - studentList.length -
attendance.absent.length - attendance.absent.length -
attendance.late.length - (!getSetting("display.lateStudentsArePresent")) * attendance.late.length -
attendance.exclude.length attendance.exclude.length
}} }}
</span> </span>
@ -83,6 +83,7 @@
<script> <script>
import { useDisplay } from "vuetify"; import { useDisplay } from "vuetify";
import {getSetting} from "@/utils/settings.js";
export default { export default {
name: "AttendanceSidebar", name: "AttendanceSidebar",
@ -106,6 +107,7 @@ export default {
return { display }; return { display };
}, },
methods: { methods: {
getSetting,
handleClick() { handleClick() {
if (this.isEditingDisabled) { if (this.isEditingDisabled) {
this.$emit('disabled-click'); this.$emit('disabled-click');

View File

@ -47,7 +47,7 @@
{{ item.data.total - item.data.exclude.length }}/{{ {{ item.data.total - item.data.exclude.length }}/{{
item.data.total - item.data.total -
item.data.absent.length - item.data.absent.length -
item.data.late.length - (!getSetting("display.lateStudentsArePresent")) * item.data.late.length -
item.data.exclude.length item.data.exclude.length
}} }}
</span> </span>
@ -205,9 +205,15 @@
<script> <script>
import HitokotoCard from "@/components/HitokotoCard.vue"; import HitokotoCard from "@/components/HitokotoCard.vue";
import ConciseExamCard from "@/components/home/ConciseExamCard.vue"; import ConciseExamCard from "@/components/home/ConciseExamCard.vue";
import {getSetting} from "@/utils/settings.js";
export default { export default {
name: "HomeworkGrid", name: "HomeworkGrid",
computed: {
settings() {
return settings
}
},
components: { components: {
HitokotoCard, HitokotoCard,
ConciseExamCard, ConciseExamCard,
@ -296,6 +302,7 @@ export default {
} }
}, },
methods: { methods: {
getSetting,
async checkReadOnlyStatus() { async checkReadOnlyStatus() {
// StudentNameManager // StudentNameManager
try { try {

View File

@ -31,6 +31,9 @@
<v-divider class="my-2"/> <v-divider class="my-2"/>
<setting-item :setting-key="'display.forceDesktopMode'"/> <setting-item :setting-key="'display.forceDesktopMode'"/>
<v-divider class="my-2"/>
<setting-item :setting-key="'display.lateStudentsArePresent'"/>
</v-list> </v-list>
</settings-card> </settings-card>
</template> </template>

View File

@ -179,6 +179,13 @@ const settingsDefinitions = {
icon: "mdi-monitor", icon: "mdi-monitor",
// 启用后将不判断屏幕大小强制使用一体机桌面端UI布局 // 启用后将不判断屏幕大小强制使用一体机桌面端UI布局
}, },
"display.lateStudentsArePresent": {
type: "boolean",
default: false,
description: "将迟到人数算入出勤人数",
icon: "mdi-clock-fast",
// 启用后,迟到的人数也会计入出勤人数
},
// 服务器设置(合并了数据提供者设置) // 服务器设置(合并了数据提供者设置)
"server.domain": { "server.domain": {
type: "string", type: "string",