mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2026-02-03 23:23:09 +00:00
feat: 添加强制桌面模式设置,优化移动端显示逻辑
This commit is contained in:
parent
0d91c8844a
commit
4244f84b34
@ -215,6 +215,10 @@ export default {
|
||||
type: String,
|
||||
default: "button",
|
||||
},
|
||||
isMobile: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isEditingDisabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
@ -229,11 +233,6 @@ export default {
|
||||
},
|
||||
},
|
||||
emits: ["open-dialog", "open-attendance", "disabled-click"],
|
||||
computed: {
|
||||
isMobile() {
|
||||
return this.$vuetify.display.mobile;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.resizeObserver = new ResizeObserver(() => {
|
||||
this.resizeAllGridItems();
|
||||
|
||||
@ -28,6 +28,9 @@
|
||||
<v-divider class="my-2"/>
|
||||
<setting-item :setting-key="'display.showExamScheduleButton'"/>
|
||||
|
||||
<v-divider class="my-2"/>
|
||||
<setting-item :setting-key="'display.forceDesktopMode'"/>
|
||||
|
||||
</v-list>
|
||||
</settings-card>
|
||||
</template>
|
||||
|
||||
@ -141,6 +141,7 @@
|
||||
:sorted-items="sortedItems"
|
||||
:unused-subjects="unusedSubjects"
|
||||
:empty-subject-display="emptySubjectDisplay"
|
||||
:is-mobile="isMobile"
|
||||
:is-editing-disabled="isEditingDisabled"
|
||||
:content-style="state.contentStyle"
|
||||
:highlighted-cards="highlightedCards"
|
||||
@ -204,7 +205,7 @@
|
||||
|
||||
<!-- 出勤统计区域 -->
|
||||
<attendance-sidebar
|
||||
v-if="!mobile"
|
||||
v-if="!isMobile"
|
||||
:student-list="state.studentList"
|
||||
:attendance="state.boardData.attendance"
|
||||
:is-editing-disabled="isEditingDisabled"
|
||||
@ -622,6 +623,11 @@ export default {
|
||||
|
||||
computed: {
|
||||
isMobile() {
|
||||
// 如果启用了强制一体机UI模式,返回false(使用桌面UI)
|
||||
const forceDesktopMode = getSetting('display.forceDesktopMode');
|
||||
if (forceDesktopMode) {
|
||||
return false;
|
||||
}
|
||||
return this.mobile;
|
||||
},
|
||||
titleText() {
|
||||
@ -651,7 +657,7 @@ export default {
|
||||
const items = [];
|
||||
|
||||
// 如果是移动端,添加出勤卡片
|
||||
if (this.mobile) {
|
||||
if (this.isMobile) {
|
||||
items.push({
|
||||
key: 'attendance-card',
|
||||
name: '出勤统计',
|
||||
|
||||
@ -175,6 +175,13 @@ const settingsDefinitions = {
|
||||
description: "是否显示快捷键盘",
|
||||
icon: "mdi-dialpad",
|
||||
},
|
||||
"display.forceDesktopMode": {
|
||||
type: "boolean",
|
||||
default: false,
|
||||
description: "强制使用一体机UI模式",
|
||||
icon: "mdi-monitor",
|
||||
// 启用后将不判断屏幕大小,强制使用一体机(桌面端)UI布局
|
||||
},
|
||||
// 服务器设置(合并了数据提供者设置)
|
||||
"server.domain": {
|
||||
type: "string",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user