修改样式

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

View File

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

View File

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