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