修改样式

This commit is contained in:
zhangxiaohua 2026-01-19 16:09:22 +08:00
parent daaed56dbe
commit 7ec72d865a
3 changed files with 42 additions and 20 deletions

View File

@ -12,8 +12,9 @@
<img v-if="!collapsed" src="../assets/images/logo.png" alt="" />
<h2 v-else class="logo-text">CMS</h2>
</div>
<!-- 3D建模实验室快捷入口 -->
<!-- 3D建模实验室快捷入口仅学生和教师可见 -->
<div
v-if="canAccess3DLab"
class="lab-entry"
:class="{ 'lab-entry-collapsed': collapsed }"
@click="open3DLab"
@ -110,6 +111,11 @@ const hideSidebar = computed(() => {
return route.meta?.hideSidebar === true
})
// 访3D
const canAccess3DLab = computed(() => {
return authStore.hasAnyRole(["student", "teacher"])
})
// 使
const menuItems = computed<MenuProps["items"]>(() => {
if (authStore.menus && authStore.menus.length > 0) {
@ -119,18 +125,22 @@ const menuItems = computed<MenuProps["items"]>(() => {
return []
})
// 3D
// 3D
const filteredMenuItems = computed<MenuProps["items"]>(() => {
const items = menuItems.value || []
return items.filter((item: any) => {
// 3D
const is3DLab =
item?.key?.toLowerCase().includes("3dlab") ||
item?.key?.toLowerCase().includes("3d-lab") ||
item?.label?.includes("3D建模") ||
item?.title?.includes("3D建模")
return !is3DLab
})
// 3D
if (canAccess3DLab.value) {
return items.filter((item: any) => {
// 3D
const is3DLab =
item?.key?.toLowerCase().includes("3dlab") ||
item?.key?.toLowerCase().includes("3d-lab") ||
item?.label?.includes("3D建模") ||
item?.title?.includes("3D建模")
return !is3DLab
})
}
return items
})
// 3D
@ -292,7 +302,7 @@ $primary-light: #40a9ff;
display: flex;
align-items: center;
justify-content: center;
padding: 16px 12px;
padding: 25px 16px 12px;
margin-bottom: 8px;
img {

View File

@ -72,7 +72,7 @@
{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}
</template>
<template v-else-if="column.key === 'workNo'">
<a @click="handleReview(record)">{{ record.workNo || "-" }}</a>
<a @click="handleViewWork(record)">{{ record.workNo || "-" }}</a>
</template>
<template v-else-if="column.key === 'score'">
<span v-if="record.score !== null" class="score">
@ -99,6 +99,12 @@
:work-id="currentWorkId"
@success="handleReviewSuccess"
/>
<!-- 作品详情弹框 -->
<WorkDetailModal
v-model:open="workDetailModalVisible"
:work-id="viewWorkId"
/>
</div>
</template>
@ -110,6 +116,7 @@ import type { TableProps } from "ant-design-vue"
import { SearchOutlined, ReloadOutlined } from "@ant-design/icons-vue"
import { reviewsApi, contestsApi } from "@/api/contests"
import ReviewWorkModal from "./components/ReviewWorkModal.vue"
import WorkDetailModal from "../contests/components/WorkDetailModal.vue"
const route = useRoute()
const tenantCode = route.params.tenantCode as string
@ -184,6 +191,10 @@ const reviewModalVisible = ref(false)
const currentAssignmentId = ref<number | null>(null)
const currentWorkId = ref<number | null>(null)
//
const workDetailModalVisible = ref(false)
const viewWorkId = ref<number | null>(null)
//
const fetchContestInfo = async () => {
try {
@ -236,6 +247,12 @@ const handleTableChange = (pag: any) => {
fetchList()
}
//
const handleViewWork = (record: any) => {
viewWorkId.value = record.workId
workDetailModalVisible.value = true
}
//
const handleReview = (record: any) => {
currentAssignmentId.value = record.id

View File

@ -742,11 +742,6 @@ const switchModel = (direction: number) => {
updateCurrentModelUrl()
//
currentRenderMode.value = "textured"
//
autoRotate.value = false
if (controls) {
controls.autoRotate = false
}
//
loadModel()
}
@ -1302,13 +1297,13 @@ const loadModel = async () => {
const distanceForWidth = size.x / 2 / Math.tan(fovRad / 2) / aspect
const distanceForDepth = size.z / 2 / Math.tan(fovRad / 2)
// 1.8
// 0.9
const baseDistance = Math.max(
distanceForHeight,
distanceForWidth,
distanceForDepth
)
const cameraDistance = Math.max(baseDistance * 1.8, maxDim * 1.8, 5)
const cameraDistance = Math.max(baseDistance * 0.9, maxDim * 0.9, 2)
console.log("模型尺寸:", size)
console.log("计算的相机距离:", cameraDistance)