diff --git a/src/components/Dashboard.vue b/src/components/Dashboard.vue index 42b4ec0..4e87b28 100644 --- a/src/components/Dashboard.vue +++ b/src/components/Dashboard.vue @@ -4,28 +4,13 @@
- +

+ 智慧科研评估系统 +

+
@@ -126,10 +111,21 @@ - -
-

智能助手

+
+
+
+ + + + + + + + +
+

智能助手

+
@@ -141,7 +137,7 @@
+ :class="['message', message.role === 'user' ? 'user-message' : 'assistant-message']">
@@ -213,6 +209,65 @@ const awardsChartRef = ref(null) const fundingChartRef = ref(null) const teacherServiceChartRef = ref(null) // 新增教师服务图表DOM引用 +// 添加ref和响应式数据 +const assistantPanel = ref(null) +const isResizing = ref(false) +const startY = ref(0) +const startHeight = ref(0) +// 开始调整大小 +// 保持原有的resize逻辑不变,但修改触发方式 +const startResize = (e) => { + // 阻止事件冒泡,避免与面板内部交互冲突 + e.stopPropagation() + + isResizing.value = true + startY.value = e.clientY + startHeight.value = parseInt(document.defaultView.getComputedStyle(assistantPanel.value).height, 10) + + // 添加鼠标移动和释放事件监听 + document.addEventListener('mousemove', handleResize) + document.addEventListener('mouseup', stopResize) + + // 设置光标样式 + document.body.style.cursor = 'row-resize' + document.body.style.userSelect = 'none' +} + +// 其他resize相关函数保持不变 +const handleResize = (e) => { + if (!isResizing.value) return + + const dy = e.clientY - startY.value + const newHeight = startHeight.value - dy + + // 限制最小和最大高度 + const minHeight = 200 // 最小高度 + const maxHeight = window.innerHeight - 100 // 最大高度 + + if (newHeight > minHeight && newHeight < maxHeight) { + assistantPanel.value.style.flex = 'none' + assistantPanel.value.style.height = `${newHeight}px` + + // 调整后立即重新计算工程研究中心图表 + nextTick(() => { + const labBarChart = echarts.getInstanceByDom(labBarChartRef.value) + const labLineChart = echarts.getInstanceByDom(labLineChartRef.value) + if (labBarChart) labBarChart.resize() + if (labLineChart) labLineChart.resize() + }) + } +} + +const stopResize = () => { + isResizing.value = false + document.removeEventListener('mousemove', handleResize) + document.removeEventListener('mouseup', stopResize) + document.body.style.cursor = '' + document.body.style.userSelect = '' +} + + + // 教研人才图表数据 const researcherData = ref({ datax: [], @@ -1583,4 +1638,35 @@ onUnmounted(() => { padding: 15px 0; } } + + \ No newline at end of file diff --git a/src/components/LabDetail.vue b/src/components/LabDetail.vue index d7305e2..8fdd2f3 100644 --- a/src/components/LabDetail.vue +++ b/src/components/LabDetail.vue @@ -3,14 +3,13 @@
+

+ 智慧科研评估系统 +

+
@@ -664,7 +663,7 @@ watch(filteredLabs, () => { border: 2px solid rgba(38,47,80,0.3); } -.dashboard-header { +/* .dashboard-header { height: 60px; padding: 0 20px; display: flex; @@ -702,7 +701,7 @@ watch(filteredLabs, () => { .title-text { margin: 0 30px; -} +} */ .content-container { display: flex; diff --git a/src/components/TalentDetail.vue b/src/components/TalentDetail.vue index 3381b3c..21f2dbb 100644 --- a/src/components/TalentDetail.vue +++ b/src/components/TalentDetail.vue @@ -3,14 +3,13 @@
+

+ 智慧科研评估系统 +

+
@@ -418,7 +417,7 @@ const openTeacherDetail = (teacher) => { /* 防止页面整体出现滚动条 */ } -.dashboard-header { +/* .dashboard-header { height: 60px; padding: 0 20px; display: flex; @@ -456,7 +455,7 @@ const openTeacherDetail = (teacher) => { .title-text { margin: 0 30px; -} +} */ .content-container { display: flex; diff --git a/src/components/common.css b/src/components/common.css index 3fbeca2..4052199 100644 --- a/src/components/common.css +++ b/src/components/common.css @@ -306,4 +306,109 @@ h2{ .teacher-card { min-height: 400px; } +} + + +.dashboard-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; + height: 80px; + background-color: rgba(12, 22, 51, 0.8); + position: relative; +} + +.logo { + display: flex; + align-items: center; + gap: 10px; + flex: 1; /* 占据可用空间 */ +} + +.logo img { + height: 40px; + object-fit: contain; + cursor: pointer; +} + +.main-title { + position: absolute; + left: 50%; + transform: translateX(-50%); + margin: 0; + font-size: 32px; + font-weight: bold; + color: white; + white-space: nowrap; + /* background: linear-gradient(90deg, transparent, rgba(73, 134, 255, 0.3), transparent); */ + padding: 0 200px; +} + +.main-title::before, +.main-title::after { + content: ""; + position: absolute; + top: 50%; + width: 200px; + height: 4px; + background: linear-gradient(90deg, transparent, rgba(73, 134, 255, 0.8)); +} + +.main-title::before { + left: 0; +} + +.main-title::after { + right: 0; + transform: scaleX(-1); +} + +.header-placeholder { + flex: 1; /* 与logo对称的占位元素 */ +} + +/* 响应式调整 */ +@media (max-width: 1200px) { + .dashboard-header { + height: 60px; + padding: 0 10px; + } + + .logo img { + height: 30px; + } + + .main-title { + font-size: 28px; + padding: 0 150px; + } + + .main-title::before, + .main-title::after { + width: 150px; + height: 3px; + } +} +/* 响应式调整 */ +@media (max-width: 768px) { + .dashboard-header { + height: 60px; + padding: 0 10px; + } + + .logo img { + height: 30px; + } + + .main-title { + font-size: 24px; + padding: 0 30px; + } + + .main-title::before, + .main-title::after { + width: 30px; + height: 2px; + } } \ No newline at end of file