教师模块
This commit is contained in:
parent
6dd6f8ebf1
commit
2d152c5e2d
@ -1048,19 +1048,19 @@ watch(dashboardData, () => {
|
|||||||
const keyProjectsEl = document.querySelector('.stat-card:nth-child(4) .stat-value');
|
const keyProjectsEl = document.querySelector('.stat-card:nth-child(4) .stat-value');
|
||||||
|
|
||||||
if (paperCountEl) {
|
if (paperCountEl) {
|
||||||
paperCountEl.innerHTML = `<span class="stat-prefix">累计</span>${dashboardData.value.paperCount || 0}`;
|
paperCountEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${dashboardData.value.paperCount || 0}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patentCountEl) {
|
if (patentCountEl) {
|
||||||
patentCountEl.innerHTML = `<span class="stat-prefix">本年</span>${dashboardData.value.patentCount || 0}`;
|
patentCountEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">本年</span>${dashboardData.value.patentCount || 0}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highImpactPapersEl) {
|
if (highImpactPapersEl) {
|
||||||
highImpactPapersEl.innerHTML = `<span class="stat-prefix">累计</span>${dashboardData.value.highImpactPapers || 0}`;
|
highImpactPapersEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${dashboardData.value.highImpactPapers || 0}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyProjectsEl) {
|
if (keyProjectsEl) {
|
||||||
keyProjectsEl.innerHTML = `<span class="stat-prefix">国家重点</span>${dashboardData.value.keyProjects || 0}<span>项</span>`;
|
keyProjectsEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">国家重点</span>${dashboardData.value.keyProjects || 0}<span>项</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新研究经费
|
// 更新研究经费
|
||||||
@ -1131,7 +1131,6 @@ onUnmounted(() => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
/* 特定于Dashboard的样式 */
|
/* 特定于Dashboard的样式 */
|
||||||
.dashboard {
|
.dashboard {
|
||||||
background-color: #102048;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1180,7 +1179,7 @@ onUnmounted(() => {
|
|||||||
.chart-container {
|
.chart-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 150px;
|
min-height: 160px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.year-selector {
|
.year-selector {
|
||||||
@ -1213,8 +1212,9 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
.stat-card h3 {
|
.stat-card h3 {
|
||||||
margin: 0 0 10px 0;
|
margin: 0 0 10px 0;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-value {
|
.stat-value {
|
||||||
@ -1226,9 +1226,10 @@ onUnmounted(() => {
|
|||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-prefix {
|
.stat-value .stat-prefix {
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 学术产出布局 */
|
/* 学术产出布局 */
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
<div class="basic-info">
|
<div class="basic-info">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
{{console.log(labData)}}
|
|
||||||
<span class="label">编号:</span>
|
<span class="label">编号:</span>
|
||||||
<span class="display-text">{{ labData.basicInformation.name0 }}</span>
|
<span class="display-text">{{ labData.basicInformation.name0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<input type="text" placeholder="请输入教师姓名或ID" v-model="searchQuery" @input="handleSearch" />
|
<input type="text" placeholder="请输入教师姓名" v-model="searchQuery" @input="handleSearch" />
|
||||||
<button class="search-button">
|
<button class="search-button">
|
||||||
<svg class="search-icon" viewBox="0 0 24 24" width="20" height="20">
|
<svg class="search-icon" viewBox="0 0 24 24" width="20" height="20">
|
||||||
<path fill="white"
|
<path fill="white"
|
||||||
@ -71,28 +71,32 @@
|
|||||||
<div class="card-top">
|
<div class="card-top">
|
||||||
<div class="teacher-left">
|
<div class="teacher-left">
|
||||||
<div class="teacher-photo">
|
<div class="teacher-photo">
|
||||||
<img :src="teacher.photo" alt="教师照片" />
|
<img :src="teacher.basicInformation.name7" alt="教师照片" />
|
||||||
</div>
|
</div>
|
||||||
<div class="teacher-id">ID: {{ teacher.idcode || teacher.id }}</div>
|
<!-- <div class="teacher-id">姓名:{{ teacher.basicInformation.name0 }}</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="teacher-info">
|
<div class="teacher-info">
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">姓名:</span>
|
<span class="info-label">姓名:</span>
|
||||||
<span class="info-value">{{ teacher.name }}</span>
|
<span class="info-value">{{ teacher.basicInformation.name0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">教育背景:</span>
|
<span class="info-label">职称 / 职务:</span>
|
||||||
|
<span class="info-value">{{ teacher.basicInformation.name2 }} / {{ teacher.basicInformation.name3 }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="info-row">
|
||||||
|
<span class="info-label">所属院校:</span>
|
||||||
|
|
||||||
<span class="info-value">{{ teacher.education }}</span>
|
<span class="info-value">{{ teacher.basicInformation.name4 }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">论文:</span>
|
<span class="info-label">最高学历:</span>
|
||||||
<span class="info-value">{{ teacher.papers }}</span>
|
<span class="info-value">{{ teacher.basicInformation.name5 }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<span class="info-label">项目:</span>
|
<span class="info-label">学科方向:</span>
|
||||||
<span class="info-value">{{ teacher.projects }}</span>
|
<span class="info-value">{{ teacher.basicInformation.name6 }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -106,30 +110,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 自定义维度对话框 -->
|
|
||||||
<el-dialog v-model="dimensionDialogVisible" :title="isEditingDimension ? '编辑维度' : '添加维度'" width="30%"
|
|
||||||
custom-class="dimension-dialog">
|
|
||||||
<el-form :model="dimensionForm" :rules="dimensionRules" ref="dimensionFormRef" label-position="top">
|
|
||||||
<el-form-item label="维度名称" prop="name">
|
|
||||||
<el-input v-model="dimensionForm.name" placeholder="请输入维度名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="权重(W)" prop="weight">
|
|
||||||
<el-input-number v-model="dimensionForm.weight" :min="1" :max="100" :step="1" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="dimensionDialogVisible = false">取消</el-button>
|
|
||||||
<el-button type="danger" v-if="isEditingDimension" @click="deleteDimension">删除</el-button>
|
|
||||||
<el-button type="primary" @click="saveDimension">确定</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<TalentDrawerDetail v-model:visible="drawerVisible" :is-edit="isEditMode" :dimensions="dimensions"
|
<TalentDrawerDetail v-model:visible="drawerVisible" :is-edit="isEditMode" :dimensions="dimensions"
|
||||||
:teacher-data="selectedTeacher" @save="handleSaveEvaluation" />
|
:teacher-data="selectedTeacher" @save="handleSaveEvaluation" />
|
||||||
<DimensionDrawer v-model:visible="dimensionDrawerVisible" :dimensions="dimensions" category="talent"
|
|
||||||
@save="handleSaveDimensions" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -137,7 +120,6 @@ import { ref, onMounted, watch, nextTick } from 'vue';
|
|||||||
import * as echarts from 'echarts/core';
|
import * as echarts from 'echarts/core';
|
||||||
import { RadarChart } from 'echarts/charts';
|
import { RadarChart } from 'echarts/charts';
|
||||||
// 引入新组件
|
// 引入新组件
|
||||||
import DimensionDrawer from './DimensionDrawer.vue';
|
|
||||||
import TalentDrawerDetail from './TalentDrawerDetail.vue';
|
import TalentDrawerDetail from './TalentDrawerDetail.vue';
|
||||||
import {
|
import {
|
||||||
TitleComponent,
|
TitleComponent,
|
||||||
@ -226,29 +208,17 @@ const dimensions = ref([]); // 改为空数组,从API获取数据
|
|||||||
|
|
||||||
// 在组件挂载时获取维度数据
|
// 在组件挂载时获取维度数据
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
await teacherLabs();
|
||||||
// 获取教师评估维度数据
|
|
||||||
const response = await axios.get(`${getApiBaseUrl()}/admin-api/pg/J-dimensions/talent`);
|
|
||||||
dimensions.value = response.data.data;
|
|
||||||
// 加载教师数据
|
|
||||||
await loadTeachers();
|
|
||||||
// 初始化雷达图
|
|
||||||
handleSearch();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取维度数据失败:', error);
|
|
||||||
ElMessage.error('获取维度数据失败');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 加载教师数据
|
// 加载教师数据
|
||||||
const loadTeachers = async () => {
|
const teacherLabs = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(`${getApiBaseUrl()}/admin-api/pg/J-talents/talents`);
|
const response = await axios.get(`${getApiBaseUrl()}/admin-api/pg/teacher-evaluation-results/get-release`);
|
||||||
teachers.value = response.data.data;
|
teachers.value = response.data.data;
|
||||||
handleSearch();
|
handleSearch();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取教师数据失败:', error);
|
ElMessage.error('获取工程研究中心数据失败');
|
||||||
ElMessage.error('获取教师数据失败');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -257,8 +227,7 @@ const dimensionDialogVisible = ref(false);
|
|||||||
const isEditingDimension = ref(false);
|
const isEditingDimension = ref(false);
|
||||||
const currentDimensionIndex = ref(-1);
|
const currentDimensionIndex = ref(-1);
|
||||||
const dimensionForm = ref({
|
const dimensionForm = ref({
|
||||||
name: '',
|
name: ''
|
||||||
weight: 10
|
|
||||||
});
|
});
|
||||||
const dimensionFormRef = ref(null);
|
const dimensionFormRef = ref(null);
|
||||||
const dimensionRules = {
|
const dimensionRules = {
|
||||||
@ -331,8 +300,7 @@ const handleSearch = () => {
|
|||||||
filteredTeachers.value = teachers.value;
|
filteredTeachers.value = teachers.value;
|
||||||
} else {
|
} else {
|
||||||
filteredTeachers.value = teachers.value.filter(teacher =>
|
filteredTeachers.value = teachers.value.filter(teacher =>
|
||||||
teacher.name.includes(searchQuery.value) ||
|
teacher.basicInformation.name0.includes(searchQuery.value)
|
||||||
teacher.id.includes(searchQuery.value)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -348,28 +316,10 @@ const initRadarCharts = () => {
|
|||||||
const chart = echarts.init(chartDom);
|
const chart = echarts.init(chartDom);
|
||||||
|
|
||||||
// 生成雷达图所需的指标
|
// 生成雷达图所需的指标
|
||||||
const indicators = dimensions.value.map(dim => ({
|
const indicators = teacher.dimension.map(dim => ({
|
||||||
name: dim.name,
|
name: dim
|
||||||
max: 100
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 为每个教师生成一个基准值,用于增加各教师数据的差异性
|
|
||||||
const baseValue = teacher.id ? parseInt(teacher.id.slice(-2)) : Math.floor(Math.random() * 30);
|
|
||||||
|
|
||||||
// 确保评估数据的长度与维度数量匹配
|
|
||||||
let evaluationData = teacher.evaluationData || [];
|
|
||||||
if (evaluationData.length !== dimensions.value.length) {
|
|
||||||
// 生成更加随机和独特的评估数据
|
|
||||||
evaluationData = dimensions.value.map((_, dimIndex) => {
|
|
||||||
// 使用教师ID、维度索引和基准值来生成差异更大的随机数
|
|
||||||
const offset = (dimIndex * 7 + baseValue) % 35;
|
|
||||||
// 生成20-95之间的随机数,不同教师、不同维度有不同的随机范围
|
|
||||||
return Math.min(95, Math.max(20, Math.floor(Math.random() * 40) + 30 + offset));
|
|
||||||
});
|
|
||||||
// 更新教师的评估数据
|
|
||||||
teacher.evaluationData = evaluationData;
|
|
||||||
}
|
|
||||||
|
|
||||||
chart.setOption({
|
chart.setOption({
|
||||||
radar: {
|
radar: {
|
||||||
indicator: indicators,
|
indicator: indicators,
|
||||||
@ -377,18 +327,31 @@ const initRadarCharts = () => {
|
|||||||
axisLine: { lineStyle: { color: 'rgba(255, 255, 255, 0.2)' } },
|
axisLine: { lineStyle: { color: 'rgba(255, 255, 255, 0.2)' } },
|
||||||
splitLine: { lineStyle: { color: 'rgba(255, 255, 255, 0.2)' } },
|
splitLine: { lineStyle: { color: 'rgba(255, 255, 255, 0.2)' } },
|
||||||
name: { textStyle: { color: '#fff', fontSize: 10 } },
|
name: { textStyle: { color: '#fff', fontSize: 10 } },
|
||||||
radius: '70%'
|
radius: '50%'
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'radar',
|
type: 'radar',
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
value: evaluationData,
|
value: teacher.result,
|
||||||
name: '评估结果',
|
name: '评估结果',
|
||||||
areaStyle: { opacity: 0 }, // 移除半透明的底色
|
areaStyle: { opacity: 0 }, // 移除半透明的底色
|
||||||
lineStyle: { color: 'rgb(63, 196, 15)', width: 2 }, // 设置线段颜色为RGB(63, 196, 15)
|
lineStyle: { color: 'rgb(63, 196, 15)', width: 2 }, // 设置线段颜色为RGB(63, 196, 15)
|
||||||
itemStyle: { color: 'rgb(63, 196, 15)' } // 设置点的颜色
|
itemStyle: { color: 'rgb(63, 196, 15)' }, // 设置点的颜色
|
||||||
|
label: {
|
||||||
|
show: true, // 显示标签
|
||||||
|
position: 'top', // 标签位置
|
||||||
|
color: '#fff', // 标签颜色
|
||||||
|
fontSize: 10 // 标签字体大小
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true, // 鼠标悬停时也显示标签
|
||||||
|
fontSize: 12, // 鼠标悬停时字体变大
|
||||||
|
fontWeight: 'bold' // 鼠标悬停时字体加粗
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -432,6 +395,9 @@ const openTeacherDetail = (teacher) => {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.teacher-info span{
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
.evaluation-page {
|
.evaluation-page {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -692,7 +658,7 @@ const openTeacherDetail = (teacher) => {
|
|||||||
/* 教师卡片网格 */
|
/* 教师卡片网格 */
|
||||||
.teacher-card-grid {
|
.teacher-card-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
/* 允许卡片区域滚动 */
|
/* 允许卡片区域滚动 */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -118,7 +118,9 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
h2{
|
||||||
|
text-align: left!important;
|
||||||
|
}
|
||||||
.panel-header {
|
.panel-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user