Compare commits
5 Commits
e09641d7a4
...
535042b67b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
535042b67b | ||
![]() |
4c44096f41 | ||
![]() |
611adc0bff | ||
![]() |
ee9c91d653 | ||
![]() |
48c8dd7dc0 |
@ -50,7 +50,7 @@ import axios from 'axios'
|
||||
import { getApiBaseUrl } from './config'
|
||||
|
||||
// 登录状态
|
||||
const isLoggedIn = ref(false)
|
||||
const isLoggedIn = ref(true)
|
||||
|
||||
// 当前显示的页面
|
||||
const currentPage = ref('dashboard')
|
||||
|
@ -22,24 +22,25 @@
|
||||
<div class="panel-header">
|
||||
<h2>科研成果</h2>
|
||||
<button class="panel-link" @click="redirectToResearchEvaluation">进入评估 >></button>
|
||||
<button class="panel-link" @click="redirectToResearchEvaluation2">进入管理端 >></button>
|
||||
</div>
|
||||
|
||||
<div class="research-stats">
|
||||
<div class="stat-card">
|
||||
<h3>论文数量</h3>
|
||||
<h3>论文总数</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h3>专利数量</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">本年</span>0</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h3>高影响力论文</h3>
|
||||
<h3>博士论文</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h3>科研项目数量</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">国家重点</span>0<span>项</span></div>
|
||||
<h3>硕士论文</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<h3>学士论文</h3>
|
||||
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -49,7 +50,7 @@
|
||||
<h2>学术产出</h2>
|
||||
<div class="output-content">
|
||||
<div ref="outputChartRef" class="chart-container-65"></div>
|
||||
<div class="international-impact">
|
||||
<!-- <div class="international-impact">
|
||||
<h3 style="font-size:25px;border-bottom: 5px solid rgb(73,134,255);text-align: left;padding-bottom:5px ">国际影响力</h3>
|
||||
<div class="journal-stat">
|
||||
<span class="journal-name">Nature</span>
|
||||
@ -61,13 +62,13 @@
|
||||
<span class="journal-count">8</span>
|
||||
<span class="journal-name2">篇</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 研究经费 -->
|
||||
<div class="dashboard-panel" style="flex: 1 1 0;">
|
||||
<h2>研究经费: 500万元</h2>
|
||||
<h2>学术详情</h2>
|
||||
<div ref="fundingChartRef" class="chart-container-funding"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -171,6 +172,7 @@ import {
|
||||
import { CanvasRenderer } from 'echarts/renderers'
|
||||
import MarkdownIt from 'markdown-it';
|
||||
const md = new MarkdownIt();
|
||||
|
||||
// 向父组件发送页面切换事件
|
||||
const emit = defineEmits(['navigate', 'logout'])
|
||||
const navigate = (page) => {
|
||||
@ -183,8 +185,54 @@ const handleLogoClick = () => {
|
||||
}
|
||||
|
||||
// 跳转到外部科研成果评估链接
|
||||
const redirectToResearchEvaluation = () => {
|
||||
window.open('http://82.156.236.221:10004/login', '_blank');
|
||||
const redirectToResearchEvaluation = async () => {
|
||||
try {
|
||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/paper/refresh`, {
|
||||
method: 'get',
|
||||
credentials: 'include' // 重要:确保发送和接收cookie
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.code === 0) {
|
||||
// 跳转到目标网站
|
||||
await localStorage.setItem('access_token', result.data.access);
|
||||
await localStorage.setItem('refresh_token', result.data.refresh);
|
||||
await localStorage.setItem('user_info', JSON.stringify({
|
||||
user_id: result.data.user_id,
|
||||
username: result.data.username,
|
||||
permission: '2'
|
||||
}));
|
||||
window.location.href = 'http://82.156.236.221:10004/user/file'
|
||||
} else {
|
||||
console.error('代理登录失败:', result.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求失败:', error);
|
||||
}
|
||||
};
|
||||
const redirectToResearchEvaluation2 = async () => {
|
||||
try {
|
||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/paper/adminLogin`, {
|
||||
method: 'get',
|
||||
credentials: 'include' // 重要:确保发送和接收cookie
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.code === 0) {
|
||||
// 跳转到目标网站
|
||||
await localStorage.setItem('access_token', result.data.access);
|
||||
await localStorage.setItem('refresh_token', result.data.refresh);
|
||||
await localStorage.setItem('user_info', JSON.stringify({
|
||||
user_id: result.data.user_id,
|
||||
username: result.data.username,
|
||||
permission: '1'
|
||||
}))
|
||||
return
|
||||
window.location.href = 'http://82.156.236.221:10004/admin/manage'
|
||||
} else {
|
||||
console.error('代理登录失败:', result.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('请求失败:', error);
|
||||
}
|
||||
};
|
||||
|
||||
// 注册必要的 echarts 组件
|
||||
@ -214,6 +262,7 @@ const assistantPanel = ref(null)
|
||||
const isResizing = ref(false)
|
||||
const startY = ref(0)
|
||||
const startHeight = ref(0)
|
||||
|
||||
// 开始调整大小
|
||||
// 保持原有的resize逻辑不变,但修改触发方式
|
||||
const startResize = (e) => {
|
||||
@ -266,8 +315,6 @@ const stopResize = () => {
|
||||
document.body.style.userSelect = ''
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 教研人才图表数据
|
||||
const researcherData = ref({
|
||||
datax: [],
|
||||
@ -275,33 +322,51 @@ const researcherData = ref({
|
||||
history: [],
|
||||
ishistory: false
|
||||
})
|
||||
|
||||
// 学术奖项图表数据
|
||||
const studyData = ref({
|
||||
datax: [],
|
||||
datay: []
|
||||
})
|
||||
|
||||
// 教师服务与社会贡献项目分布图表数据
|
||||
const teacherServiceData = ref({
|
||||
datax: [],
|
||||
datay: []
|
||||
})
|
||||
|
||||
// 工程研究中心图表数据
|
||||
const labData = ref({
|
||||
datax: [], // 存储 fieldName
|
||||
series: [], // 存储 ECharts series 数组
|
||||
years: [] // 存储年份列表
|
||||
datax: [],
|
||||
series: [],
|
||||
years: []
|
||||
})
|
||||
|
||||
const labLineData = ref({
|
||||
datax: [],
|
||||
datay: []
|
||||
})
|
||||
|
||||
// 学术产出图表数据
|
||||
const outputData = ref({
|
||||
months: [],
|
||||
doctor: [],
|
||||
master: [],
|
||||
bachelor: []
|
||||
})
|
||||
|
||||
// 研究经费图表数据
|
||||
const fundingData = ref({
|
||||
doctor: 0,
|
||||
master: 0,
|
||||
bachelor: 0
|
||||
})
|
||||
|
||||
// DeepSeek 智能助手相关变量
|
||||
const chatMessagesRef = ref(null)
|
||||
const userInput = ref('')
|
||||
const isLoading = ref(false)
|
||||
const chatMessages = ref([
|
||||
])
|
||||
const chatMessages = ref([])
|
||||
|
||||
// DeepSeek API 调用函数
|
||||
const sendMessage = async () => {
|
||||
@ -390,11 +455,12 @@ const scrollToBottom = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 研究经费图例状态
|
||||
const fundingLegendStatus = ref([true, true, true])
|
||||
|
||||
// 学术产出图例状态
|
||||
const outputLegendStatus = ref([true, true])
|
||||
const outputLegendStatus = ref([true, true, true])
|
||||
|
||||
// 切换研究经费图例
|
||||
const toggleFundingLegend = (index) => {
|
||||
@ -416,9 +482,9 @@ const updateFundingChart = () => {
|
||||
fundingChart.setOption({
|
||||
legend: {
|
||||
selected: {
|
||||
'政府 50%': fundingLegendStatus.value[0],
|
||||
'企业 25%': fundingLegendStatus.value[1],
|
||||
'其他 25%': fundingLegendStatus.value[2]
|
||||
'博士': fundingLegendStatus.value[0],
|
||||
'硕士': fundingLegendStatus.value[1],
|
||||
'学士': fundingLegendStatus.value[2]
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -432,8 +498,9 @@ const updateOutputChart = () => {
|
||||
outputChart.setOption({
|
||||
legend: {
|
||||
selected: {
|
||||
'论文总数': outputLegendStatus.value[0],
|
||||
'专利总数': outputLegendStatus.value[1]
|
||||
'博士': outputLegendStatus.value[0],
|
||||
'硕士': outputLegendStatus.value[1],
|
||||
'学士': outputLegendStatus.value[1]
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -451,12 +518,10 @@ import { getApiBaseUrl } from '../config';
|
||||
const fetchDashboardData = async () => {
|
||||
try {
|
||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/J-dashboard/dashboard`);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
console.log("仪表盘数据:", data);
|
||||
dashboardData.value = data.data;
|
||||
// 更新相应的UI数据
|
||||
if (data) {
|
||||
updateChartsWithDashboardData();
|
||||
}
|
||||
@ -469,14 +534,15 @@ const fetchDashboardData = async () => {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchDashboardData2 = async () => {
|
||||
try {
|
||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/intelligent-assistant/get-release`);
|
||||
const data = await response.json();
|
||||
dashboardData2.value = data.data;
|
||||
if (data) {
|
||||
updateChartsWithDashboardData();
|
||||
}
|
||||
if (data) {
|
||||
updateChartsWithDashboardData();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取仪表盘数据出错:', error);
|
||||
} finally {
|
||||
@ -552,6 +618,7 @@ const updateStudyChart = () => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const updateResearcherChart = () => {
|
||||
const researcherChart = echarts.getInstanceByDom(researcherChartRef.value);
|
||||
if (researcherChart) {
|
||||
@ -659,6 +726,59 @@ const initEngineeringKeyFields = (data) => {
|
||||
console.log("Processed labData.value:", labData.value);
|
||||
};
|
||||
|
||||
const fetchPaperData = async () => {
|
||||
try {
|
||||
const res = await fetch('http://82.156.236.221:10005/api/v1/review/show/details/');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
if (data.code === 200) {
|
||||
// 更新论文数量
|
||||
const paperCountEl = document.querySelector('.stat-card:nth-child(1) .stat-value');
|
||||
const paperCountEl2 = document.querySelector('.stat-card:nth-child(2) .stat-value');
|
||||
const paperCountEl3 = document.querySelector('.stat-card:nth-child(3) .stat-value');
|
||||
const paperCountEl4 = document.querySelector('.stat-card:nth-child(4) .stat-value');
|
||||
if (paperCountEl) {
|
||||
paperCountEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${data.data.total.sum || 0}`;
|
||||
paperCountEl2.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${data.data.total.doctor || 0}`;
|
||||
paperCountEl3.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${data.data.total.master || 0}`;
|
||||
paperCountEl4.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${data.data.total.bachelor || 0}`;
|
||||
}
|
||||
|
||||
// 获取当前月份前6个月的月份名称
|
||||
const currentDate = new Date();
|
||||
const monthNames = [];
|
||||
for (let i = 5; i >= 0; i--) {
|
||||
const date = new Date(currentDate.getFullYear(), currentDate.getMonth() - i, 1);
|
||||
monthNames.push(`${date.getMonth() + 1}月`);
|
||||
}
|
||||
|
||||
// 更新学术产出数据
|
||||
outputData.value = {
|
||||
months: monthNames,
|
||||
doctor: data.data.time.map(item => item[0]).reverse(), // 添加reverse()
|
||||
master: data.data.time.map(item => item[1]).reverse(), // 添加reverse()
|
||||
bachelor: data.data.time.map(item => item[2]).reverse() // 添加reverse()
|
||||
};
|
||||
updateOutputChart();
|
||||
|
||||
// 更新研究经费数据
|
||||
fundingData.value = {
|
||||
doctor: data.data.total.doctor,
|
||||
master: data.data.total.master,
|
||||
bachelor: data.data.total.bachelor
|
||||
};
|
||||
updateFundingChart();
|
||||
}
|
||||
} else {
|
||||
console.error('获取论文数据失败:', res.statusText);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取论文数据出错:', error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchLabData = async () => {
|
||||
try {
|
||||
const res = await fetch(`${getApiBaseUrl()}/admin-api/pg/research-data-dashboard/get-release`);
|
||||
@ -732,6 +852,7 @@ const updateLabBarChart = () => {
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
const updateLabLineChart = () => {
|
||||
const labLineChart = echarts.getInstanceByDom(labLineChartRef.value);
|
||||
if (labLineChart) {
|
||||
@ -747,16 +868,16 @@ const updateLabLineChart = () => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 使用仪表盘数据更新图表
|
||||
const updateChartsWithDashboardData = () => {
|
||||
if (!dashboardData.value) return;
|
||||
if (!dashboardData2.value) return;
|
||||
|
||||
};
|
||||
|
||||
// 初始化图表
|
||||
const initCharts = () => {
|
||||
// 研究人员图表 - 横向堆叠柱状图(柱中心显示数字)
|
||||
// 研究人员图表
|
||||
const researcherChart = echarts.init(researcherChartRef.value)
|
||||
researcherChart.setOption({
|
||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
||||
@ -963,26 +1084,27 @@ const initCharts = () => {
|
||||
]
|
||||
})
|
||||
|
||||
// 学术产出图表 - 横向柱状图(柱末端显示数字)
|
||||
// 学术产出图表 - 使用API数据
|
||||
const outputChart = echarts.init(outputChartRef.value)
|
||||
outputChart.setOption({
|
||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
||||
legend: {
|
||||
data: ['论文总数', '专利总数'],
|
||||
data: ['博士', '硕士', '学士'],
|
||||
textStyle: { color: '#fff' },
|
||||
selected: {
|
||||
'论文总数': outputLegendStatus.value[0],
|
||||
'专利总数': outputLegendStatus.value[1]
|
||||
'博士': outputLegendStatus.value[0],
|
||||
'硕士': outputLegendStatus.value[1],
|
||||
'学士': outputLegendStatus.value[1],
|
||||
}
|
||||
},
|
||||
grid: { left: '3%', right: '12%', bottom: '3%', containLabel: true },
|
||||
yAxis: { // 交换了 xAxis 和 yAxis
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: ['1月', '2月', '3月', '4月', '5月'],
|
||||
data: outputData.value.months,
|
||||
axisLine: { lineStyle: { color: '#fff' } },
|
||||
axisLabel: { color: '#fff' }
|
||||
},
|
||||
xAxis: { // 交换了 xAxis 和 yAxis
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
axisLine: { lineStyle: { color: '#fff' } },
|
||||
axisLabel: { color: '#fff' },
|
||||
@ -996,9 +1118,9 @@ const initCharts = () => {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '论文总数',
|
||||
name: '博士',
|
||||
type: 'bar',
|
||||
data: [140, 160, 180, 190, 210],
|
||||
data: outputData.value.doctor,
|
||||
itemStyle: { color: '#4080ff' },
|
||||
barWidth: '20%',
|
||||
barGap: '20%',
|
||||
@ -1010,9 +1132,9 @@ const initCharts = () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '专利总数',
|
||||
name: '硕士',
|
||||
type: 'bar',
|
||||
data: [100, 110, 120, 130, 150],
|
||||
data: outputData.value.master,
|
||||
itemStyle: { color: 'rgb(107,187,196)' },
|
||||
barWidth: '20%',
|
||||
barGap: '20%',
|
||||
@ -1022,6 +1144,20 @@ const initCharts = () => {
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '学士',
|
||||
type: 'bar',
|
||||
data: outputData.value.bachelor,
|
||||
itemStyle: { color: 'rgb(107,187,19)' },
|
||||
barWidth: '20%',
|
||||
barGap: '20%',
|
||||
label: {
|
||||
show: true,
|
||||
position: 'right',
|
||||
color: '#fff',
|
||||
formatter: '{c}'
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
@ -1044,29 +1180,29 @@ const initCharts = () => {
|
||||
{
|
||||
value: studyData.value.datay,
|
||||
name: '奖项分布',
|
||||
areaStyle: { opacity: 0 }, // 移除中间蒙版
|
||||
areaStyle: { opacity: 0 },
|
||||
lineStyle: { color: '#ffd700', width: 2 },
|
||||
itemStyle: { color: '#ffd700' }
|
||||
}
|
||||
],
|
||||
label: {
|
||||
show: true, // 显示标签
|
||||
position: 'top', // 标签位置
|
||||
color: '#fff', // 标签颜色
|
||||
fontSize: 10 // 标签字体大小
|
||||
show: true,
|
||||
position: 'top',
|
||||
color: '#fff',
|
||||
fontSize: 10
|
||||
},
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true, // 鼠标悬停时也显示标签
|
||||
fontSize: 12, // 鼠标悬停时字体变大
|
||||
fontWeight: 'bold' // 鼠标悬停时字体加粗
|
||||
show: true,
|
||||
fontSize: 12,
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
// 研究经费图表 - 玫瑰饼图
|
||||
// 研究经费图表 - 使用API数据
|
||||
const fundingChart = echarts.init(fundingChartRef.value)
|
||||
fundingChart.setOption({
|
||||
tooltip: { trigger: 'item' },
|
||||
@ -1075,26 +1211,25 @@ const initCharts = () => {
|
||||
left: '5%',
|
||||
top: 'center',
|
||||
textStyle: { color: '#fff' },
|
||||
data: ['政府 50%', '企业 25%', '其他 25%'],
|
||||
data: ['博士', '硕士', '学士'],
|
||||
selected: {
|
||||
'政府 50%': fundingLegendStatus.value[0],
|
||||
'企业 25%': fundingLegendStatus.value[1],
|
||||
'其他 25%': fundingLegendStatus.value[2]
|
||||
'博士': fundingLegendStatus.value[0],
|
||||
'硕士': fundingLegendStatus.value[1],
|
||||
'学士': fundingLegendStatus.value[2]
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['30%', '70%'],
|
||||
center: ['60%', '50%'], // 将图表向右移动为图例留出空间
|
||||
center: ['60%', '50%'],
|
||||
roseType: 'area',
|
||||
label: {
|
||||
show: true,
|
||||
formatter: '{b}',
|
||||
formatter: '{b}: {d}%',
|
||||
position: 'outside',
|
||||
color: '#fff',
|
||||
alignTo: 'labelLine',
|
||||
distanceToLabelLine: 5
|
||||
distanceToLabelLine: 1
|
||||
},
|
||||
labelLine: {
|
||||
show: true,
|
||||
@ -1112,9 +1247,21 @@ const initCharts = () => {
|
||||
}
|
||||
},
|
||||
data: [
|
||||
{ value: 50, name: '政府 50%', itemStyle: { color: '#9966ff' } },
|
||||
{ value: 25, name: '企业 25%', itemStyle: { color: '#ff9933' } },
|
||||
{ value: 25, name: '其他 25%', itemStyle: { color: '#3399ff' } }
|
||||
{
|
||||
value: fundingData.value.doctor,
|
||||
name: '博士',
|
||||
itemStyle: { color: '#9966ff' }
|
||||
},
|
||||
{
|
||||
value: fundingData.value.master,
|
||||
name: '硕士',
|
||||
itemStyle: { color: '#ff9933' }
|
||||
},
|
||||
{
|
||||
value: fundingData.value.bachelor,
|
||||
name: '学士',
|
||||
itemStyle: { color: '#3399ff' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -1134,10 +1281,12 @@ const initCharts = () => {
|
||||
|
||||
// 生命周期钩子 - 组件挂载后初始化
|
||||
onMounted(async() => {
|
||||
// 论文数据
|
||||
await fetchPaperData();
|
||||
// 教研人才数据
|
||||
await fetchTeacherbData1();
|
||||
await fetchTeacherbData2();
|
||||
await fetchTeacherbData3(); // 调用新的数据获取函数
|
||||
await fetchTeacherbData3();
|
||||
// 工程研究中心数据
|
||||
await fetchLabData();
|
||||
await fetchLabData2();
|
||||
@ -1157,63 +1306,22 @@ watch(dashboardData, () => {
|
||||
updateChartsWithData();
|
||||
}
|
||||
}, { deep: true });
|
||||
// 更新图表数据
|
||||
const updateChartsWithData = () => {
|
||||
if (!dashboardData.value) return;
|
||||
// 更新论文数量、专利数量、高影响力论文和关键项目数量
|
||||
const paperCountEl = document.querySelector('.stat-card:nth-child(1) .stat-value');
|
||||
const patentCountEl = document.querySelector('.stat-card:nth-child(2) .stat-value');
|
||||
const highImpactPapersEl = document.querySelector('.stat-card:nth-child(3) .stat-value');
|
||||
const keyProjectsEl = document.querySelector('.stat-card:nth-child(4) .stat-value');
|
||||
|
||||
if (paperCountEl) {
|
||||
paperCountEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${dashboardData.value.paperCount || 0}`;
|
||||
}
|
||||
|
||||
if (patentCountEl) {
|
||||
patentCountEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">本年</span>${dashboardData.value.patentCount || 0}`;
|
||||
}
|
||||
|
||||
if (highImpactPapersEl) {
|
||||
highImpactPapersEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">累计</span>${dashboardData.value.highImpactPapers || 0}`;
|
||||
}
|
||||
|
||||
if (keyProjectsEl) {
|
||||
keyProjectsEl.innerHTML = `<span class="stat-prefix" style="font-size: 12px;">国家重点</span>${dashboardData.value.keyProjects || 0}<span>项</span>`;
|
||||
}
|
||||
|
||||
// 更新研究经费
|
||||
const fundingTitle = document.querySelector('.dashboard-panel:nth-child(3) h2');
|
||||
if (fundingTitle && dashboardData.value.fundingAmount) {
|
||||
fundingTitle.textContent = `研究经费: ${dashboardData.value.fundingAmount}`;
|
||||
}
|
||||
};
|
||||
|
||||
// 定义newsData为ref,使其可响应
|
||||
const newsData = ref([]);
|
||||
|
||||
// 新闻滚动
|
||||
let scrollInterval
|
||||
const startNewsScroll = () => {
|
||||
if (!newsListRef.value) return
|
||||
|
||||
scrollInterval = setInterval(() => {
|
||||
if (newsListRef.value.scrollTop + newsListRef.value.clientHeight >= newsListRef.value.scrollHeight) {
|
||||
// 如果已经滚动到底部,重新开始滚动
|
||||
newsListRef.value.scrollTop = 0
|
||||
} else {
|
||||
// 否则继续滚动
|
||||
newsListRef.value.scrollTop += 1
|
||||
}
|
||||
}, 50)
|
||||
}
|
||||
|
||||
// 更新图表数据
|
||||
const updateChartsWithData = () => {
|
||||
if (!dashboardData.value) return;
|
||||
// 更新专利数量、高影响力论文和关键项目数量
|
||||
const patentCountEl = document.querySelector('.stat-card:nth-child(2) .stat-value');
|
||||
const highImpactPapersEl = document.querySelector('.stat-card:nth-child(3) .stat-value');
|
||||
const keyProjectsEl = document.querySelector('.stat-card:nth-child(4) .stat-value');
|
||||
};
|
||||
|
||||
// 定义newsData为ref,使其可响应
|
||||
const newsData = ref([]);
|
||||
|
||||
// 组件卸载时清理定时器
|
||||
onUnmounted(() => {
|
||||
// 移除 resize 事件监听器
|
||||
window.removeEventListener('resize', () => {
|
||||
// 这里可以添加移除所有图表实例的逻辑,或者在需要时手动销毁
|
||||
});
|
||||
window.removeEventListener('resize', () => {});
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -1358,7 +1466,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.chart-container-65 {
|
||||
width: 65%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@
|
||||
<el-dialog
|
||||
v-model="scoreComparisonDialogVisible"
|
||||
title="得分比较"
|
||||
width="70%"
|
||||
width="80%"
|
||||
center
|
||||
:append-to-body="true"
|
||||
class="score-comparison-dialog"
|
||||
@ -158,7 +158,7 @@
|
||||
class="default-table score-comparison-table"
|
||||
:row-class-name="tableRowClassName"
|
||||
>
|
||||
<el-table-column prop="category" label="" width="180"></el-table-column>
|
||||
<el-table-column prop="category" label=""></el-table-column>
|
||||
<el-table-column
|
||||
v-for="(header) in scoreComparisonHeaders"
|
||||
:key="header.prop"
|
||||
@ -175,6 +175,19 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="totalScore"
|
||||
label="总分"
|
||||
align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="{
|
||||
'max-score-in-column': Number(row.totalScore) === columnStats.totalScore?.max,
|
||||
'min-score-in-column': Number(row.totalScore) === columnStats.totalScore?.min
|
||||
}">
|
||||
{{ row.totalScore }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -514,12 +527,23 @@ const scoreComparisonTableData = computed(() => {
|
||||
|
||||
return selectedLabs.value.map(lab => {
|
||||
const row = {
|
||||
category: `${lab.basicInformation.name0}-${lab.basicInformation.name2}` // 纵向表头是年份-中心名称
|
||||
category: `${lab.basicInformation.name0}-${lab.basicInformation.name4}-${lab.basicInformation.name2}`
|
||||
};
|
||||
// 将 radarData 映射到 row 的动态属性上
|
||||
lab.result.forEach((score, index) => {
|
||||
row[`score${index + 1}`] = score;
|
||||
});
|
||||
|
||||
if (Array.isArray(lab.result)) {
|
||||
let total = 0;
|
||||
lab.result.forEach((score, index) => {
|
||||
const numericScore = Number(score) || 0;
|
||||
row[`score${index + 1}`] = numericScore;
|
||||
total += numericScore;
|
||||
});
|
||||
|
||||
// 修改这里:使用Math.round()四舍五入并转换为整数
|
||||
row.totalScore = Math.round(total);
|
||||
} else {
|
||||
row.totalScore = 0; // 设置为整数0
|
||||
}
|
||||
|
||||
return row;
|
||||
});
|
||||
});
|
||||
@ -542,6 +566,14 @@ const columnStats = computed(() => {
|
||||
};
|
||||
}
|
||||
});
|
||||
// 添加总分统计
|
||||
const totalScores = scoreComparisonTableData.value.map(row => Number(row.totalScore));
|
||||
if (totalScores.length > 0) {
|
||||
stats.totalScore = {
|
||||
max: Math.max(...totalScores),
|
||||
min: Math.min(...totalScores)
|
||||
};
|
||||
}
|
||||
// console.log("Calculated columnStats:", stats); // 调试输出
|
||||
return stats;
|
||||
});
|
||||
|
@ -66,7 +66,8 @@
|
||||
<div class="category-content">
|
||||
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
||||
<span class="item-label">{{ item.label }}:</span>
|
||||
<span class="item-score">{{ labData.assessmentScore[item.prop] || '0' }}</span>
|
||||
<span class="item-score">{{ labData.assessmentScore[item.prop] || '0' }} / {{ labData.maximum[item.prop] || '0' }}</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -78,24 +78,35 @@
|
||||
<div class="teacher-info">
|
||||
<div class="info-row">
|
||||
<span class="info-label">姓名:</span>
|
||||
<span class="info-value">{{ teacher.basicInformation.name0 }}</span>
|
||||
<el-tooltip effect="dark" :content="teacher.basicInformation.name0" placement="top">
|
||||
<span class="info-value">{{ teacher.basicInformation.name0 }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">职称 / 职务:</span>
|
||||
<span class="info-value">{{ teacher.basicInformation.name2 }}{{ teacher.basicInformation.name3 ? ' / ' + teacher.basicInformation.name3 : '' }}</span>
|
||||
<el-tooltip effect="dark" :content="teacher.basicInformation.name2 + (teacher.basicInformation.name3 ? ' / ' + teacher.basicInformation.name3 : '')" placement="top">
|
||||
<span class="info-value">
|
||||
{{ teacher.basicInformation.name2 }}{{ teacher.basicInformation.name3 ? ' / ' + teacher.basicInformation.name3 : '' }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">所属学院:</span>
|
||||
|
||||
<span class="info-value">{{ teacher.basicInformation.name4 }}</span>
|
||||
<el-tooltip effect="dark" :content="teacher.basicInformation.name4" placement="top">
|
||||
<span class="info-value">{{ teacher.basicInformation.name4 }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">最高学历:</span>
|
||||
<span class="info-value">{{ teacher.basicInformation.name5 }}</span>
|
||||
<el-tooltip effect="dark" :content="teacher.basicInformation.name5" placement="top">
|
||||
<span class="info-value">{{ teacher.basicInformation.name5 }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<span class="info-label">学科方向:</span>
|
||||
<span class="info-value">{{ teacher.basicInformation.name6 }}</span>
|
||||
<el-tooltip effect="dark" :content="teacher.basicInformation.name6" placement="top">
|
||||
<span class="info-value">{{ teacher.basicInformation.name6 }}</span>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -118,6 +129,7 @@
|
||||
import { ref, onMounted, watch, nextTick } from 'vue';
|
||||
import * as echarts from 'echarts/core';
|
||||
import { RadarChart } from 'echarts/charts';
|
||||
import { ElTooltip } from 'element-plus';
|
||||
// 引入新组件
|
||||
import TalentDrawerDetail from './TalentDrawerDetail.vue';
|
||||
import {
|
||||
|
@ -3,10 +3,10 @@ const env = import.meta.env.MODE || 'development';
|
||||
|
||||
const config = {
|
||||
development: {
|
||||
apiBaseUrl: 'http://192.168.18.9:48080',
|
||||
apiBaseUrl: 'http://192.168.5.49:48080',
|
||||
},
|
||||
production: {
|
||||
apiBaseUrl: 'http://36.103.203.89:48088',
|
||||
apiBaseUrl: 'http://36.103.203.89:48089',
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,7 @@ const config = {
|
||||
const localDir = path.join(__dirname, 'dist');
|
||||
// 服务器目标目录
|
||||
// const remoteDir = process.env.SFTP_REMOTE_DIR; // 如果使用环境变量
|
||||
const remoteDir = '/home/ubuntu/mnt/teacher_test/nginx-1/dist';
|
||||
const remoteDir = '/home/ubuntu/mnt/Teacher_Evaluation/nginx/dist';
|
||||
|
||||
async function uploadToServer() {
|
||||
const sftp = new SftpClient();
|
||||
|
Loading…
x
Reference in New Issue
Block a user