修改样式
This commit is contained in:
parent
daaed56dbe
commit
7ec72d865a
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user