需求修改1
This commit is contained in:
parent
4c44096f41
commit
535042b67b
@ -22,24 +22,25 @@
|
|||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<h2>科研成果</h2>
|
<h2>科研成果</h2>
|
||||||
<button class="panel-link" @click="redirectToResearchEvaluation">进入评估 >></button>
|
<button class="panel-link" @click="redirectToResearchEvaluation">进入评估 >></button>
|
||||||
|
<button class="panel-link" @click="redirectToResearchEvaluation2">进入管理端 >></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="research-stats">
|
<div class="research-stats">
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<h3>论文数量</h3>
|
<h3>论文总数</h3>
|
||||||
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
<div class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<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 class="stat-value"><span class="stat-prefix">累计</span>0</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-card">
|
<div class="stat-card">
|
||||||
<h3>科研项目数量</h3>
|
<h3>硕士论文</h3>
|
||||||
<div class="stat-value"><span class="stat-prefix">国家重点</span>0<span>项</span></div>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -49,7 +50,7 @@
|
|||||||
<h2>学术产出</h2>
|
<h2>学术产出</h2>
|
||||||
<div class="output-content">
|
<div class="output-content">
|
||||||
<div ref="outputChartRef" class="chart-container-65"></div>
|
<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>
|
<h3 style="font-size:25px;border-bottom: 5px solid rgb(73,134,255);text-align: left;padding-bottom:5px ">国际影响力</h3>
|
||||||
<div class="journal-stat">
|
<div class="journal-stat">
|
||||||
<span class="journal-name">Nature</span>
|
<span class="journal-name">Nature</span>
|
||||||
@ -61,13 +62,13 @@
|
|||||||
<span class="journal-count">8</span>
|
<span class="journal-count">8</span>
|
||||||
<span class="journal-name2">篇</span>
|
<span class="journal-name2">篇</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 研究经费 -->
|
<!-- 研究经费 -->
|
||||||
<div class="dashboard-panel" style="flex: 1 1 0;">
|
<div class="dashboard-panel" style="flex: 1 1 0;">
|
||||||
<h2>研究经费: 500万元</h2>
|
<h2>学术详情</h2>
|
||||||
<div ref="fundingChartRef" class="chart-container-funding"></div>
|
<div ref="fundingChartRef" class="chart-container-funding"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -171,6 +172,7 @@ import {
|
|||||||
import { CanvasRenderer } from 'echarts/renderers'
|
import { CanvasRenderer } from 'echarts/renderers'
|
||||||
import MarkdownIt from 'markdown-it';
|
import MarkdownIt from 'markdown-it';
|
||||||
const md = new MarkdownIt();
|
const md = new MarkdownIt();
|
||||||
|
|
||||||
// 向父组件发送页面切换事件
|
// 向父组件发送页面切换事件
|
||||||
const emit = defineEmits(['navigate', 'logout'])
|
const emit = defineEmits(['navigate', 'logout'])
|
||||||
const navigate = (page) => {
|
const navigate = (page) => {
|
||||||
@ -183,8 +185,54 @@ const handleLogoClick = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到外部科研成果评估链接
|
// 跳转到外部科研成果评估链接
|
||||||
const redirectToResearchEvaluation = () => {
|
const redirectToResearchEvaluation = async () => {
|
||||||
window.open('http://82.156.236.221:10004/login', '_blank');
|
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 组件
|
// 注册必要的 echarts 组件
|
||||||
@ -214,6 +262,7 @@ const assistantPanel = ref(null)
|
|||||||
const isResizing = ref(false)
|
const isResizing = ref(false)
|
||||||
const startY = ref(0)
|
const startY = ref(0)
|
||||||
const startHeight = ref(0)
|
const startHeight = ref(0)
|
||||||
|
|
||||||
// 开始调整大小
|
// 开始调整大小
|
||||||
// 保持原有的resize逻辑不变,但修改触发方式
|
// 保持原有的resize逻辑不变,但修改触发方式
|
||||||
const startResize = (e) => {
|
const startResize = (e) => {
|
||||||
@ -266,8 +315,6 @@ const stopResize = () => {
|
|||||||
document.body.style.userSelect = ''
|
document.body.style.userSelect = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 教研人才图表数据
|
// 教研人才图表数据
|
||||||
const researcherData = ref({
|
const researcherData = ref({
|
||||||
datax: [],
|
datax: [],
|
||||||
@ -275,33 +322,51 @@ const researcherData = ref({
|
|||||||
history: [],
|
history: [],
|
||||||
ishistory: false
|
ishistory: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 学术奖项图表数据
|
// 学术奖项图表数据
|
||||||
const studyData = ref({
|
const studyData = ref({
|
||||||
datax: [],
|
datax: [],
|
||||||
datay: []
|
datay: []
|
||||||
})
|
})
|
||||||
|
|
||||||
// 教师服务与社会贡献项目分布图表数据
|
// 教师服务与社会贡献项目分布图表数据
|
||||||
const teacherServiceData = ref({
|
const teacherServiceData = ref({
|
||||||
datax: [],
|
datax: [],
|
||||||
datay: []
|
datay: []
|
||||||
})
|
})
|
||||||
|
|
||||||
// 工程研究中心图表数据
|
// 工程研究中心图表数据
|
||||||
const labData = ref({
|
const labData = ref({
|
||||||
datax: [], // 存储 fieldName
|
datax: [],
|
||||||
series: [], // 存储 ECharts series 数组
|
series: [],
|
||||||
years: [] // 存储年份列表
|
years: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const labLineData = ref({
|
const labLineData = ref({
|
||||||
datax: [],
|
datax: [],
|
||||||
datay: []
|
datay: []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 学术产出图表数据
|
||||||
|
const outputData = ref({
|
||||||
|
months: [],
|
||||||
|
doctor: [],
|
||||||
|
master: [],
|
||||||
|
bachelor: []
|
||||||
|
})
|
||||||
|
|
||||||
|
// 研究经费图表数据
|
||||||
|
const fundingData = ref({
|
||||||
|
doctor: 0,
|
||||||
|
master: 0,
|
||||||
|
bachelor: 0
|
||||||
|
})
|
||||||
|
|
||||||
// DeepSeek 智能助手相关变量
|
// DeepSeek 智能助手相关变量
|
||||||
const chatMessagesRef = ref(null)
|
const chatMessagesRef = ref(null)
|
||||||
const userInput = ref('')
|
const userInput = ref('')
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const chatMessages = ref([
|
const chatMessages = ref([])
|
||||||
])
|
|
||||||
|
|
||||||
// DeepSeek API 调用函数
|
// DeepSeek API 调用函数
|
||||||
const sendMessage = async () => {
|
const sendMessage = async () => {
|
||||||
@ -390,11 +455,12 @@ const scrollToBottom = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 研究经费图例状态
|
// 研究经费图例状态
|
||||||
const fundingLegendStatus = ref([true, true, true])
|
const fundingLegendStatus = ref([true, true, true])
|
||||||
|
|
||||||
// 学术产出图例状态
|
// 学术产出图例状态
|
||||||
const outputLegendStatus = ref([true, true])
|
const outputLegendStatus = ref([true, true, true])
|
||||||
|
|
||||||
// 切换研究经费图例
|
// 切换研究经费图例
|
||||||
const toggleFundingLegend = (index) => {
|
const toggleFundingLegend = (index) => {
|
||||||
@ -416,9 +482,9 @@ const updateFundingChart = () => {
|
|||||||
fundingChart.setOption({
|
fundingChart.setOption({
|
||||||
legend: {
|
legend: {
|
||||||
selected: {
|
selected: {
|
||||||
'政府 50%': fundingLegendStatus.value[0],
|
'博士': fundingLegendStatus.value[0],
|
||||||
'企业 25%': fundingLegendStatus.value[1],
|
'硕士': fundingLegendStatus.value[1],
|
||||||
'其他 25%': fundingLegendStatus.value[2]
|
'学士': fundingLegendStatus.value[2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -432,8 +498,9 @@ const updateOutputChart = () => {
|
|||||||
outputChart.setOption({
|
outputChart.setOption({
|
||||||
legend: {
|
legend: {
|
||||||
selected: {
|
selected: {
|
||||||
'论文总数': outputLegendStatus.value[0],
|
'博士': outputLegendStatus.value[0],
|
||||||
'专利总数': outputLegendStatus.value[1]
|
'硕士': outputLegendStatus.value[1],
|
||||||
|
'学士': outputLegendStatus.value[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -451,12 +518,10 @@ import { getApiBaseUrl } from '../config';
|
|||||||
const fetchDashboardData = async () => {
|
const fetchDashboardData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/J-dashboard/dashboard`);
|
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/J-dashboard/dashboard`);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log("仪表盘数据:", data);
|
console.log("仪表盘数据:", data);
|
||||||
dashboardData.value = data.data;
|
dashboardData.value = data.data;
|
||||||
// 更新相应的UI数据
|
|
||||||
if (data) {
|
if (data) {
|
||||||
updateChartsWithDashboardData();
|
updateChartsWithDashboardData();
|
||||||
}
|
}
|
||||||
@ -469,14 +534,15 @@ const fetchDashboardData = async () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchDashboardData2 = async () => {
|
const fetchDashboardData2 = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/intelligent-assistant/get-release`);
|
const response = await fetch(`${getApiBaseUrl()}/admin-api/pg/intelligent-assistant/get-release`);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
dashboardData2.value = data.data;
|
dashboardData2.value = data.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
updateChartsWithDashboardData();
|
updateChartsWithDashboardData();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取仪表盘数据出错:', error);
|
console.error('获取仪表盘数据出错:', error);
|
||||||
} finally {
|
} finally {
|
||||||
@ -552,6 +618,7 @@ const updateStudyChart = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateResearcherChart = () => {
|
const updateResearcherChart = () => {
|
||||||
const researcherChart = echarts.getInstanceByDom(researcherChartRef.value);
|
const researcherChart = echarts.getInstanceByDom(researcherChartRef.value);
|
||||||
if (researcherChart) {
|
if (researcherChart) {
|
||||||
@ -659,6 +726,59 @@ const initEngineeringKeyFields = (data) => {
|
|||||||
console.log("Processed labData.value:", labData.value);
|
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 () => {
|
const fetchLabData = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${getApiBaseUrl()}/admin-api/pg/research-data-dashboard/get-release`);
|
const res = await fetch(`${getApiBaseUrl()}/admin-api/pg/research-data-dashboard/get-release`);
|
||||||
@ -732,6 +852,7 @@ const updateLabBarChart = () => {
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateLabLineChart = () => {
|
const updateLabLineChart = () => {
|
||||||
const labLineChart = echarts.getInstanceByDom(labLineChartRef.value);
|
const labLineChart = echarts.getInstanceByDom(labLineChartRef.value);
|
||||||
if (labLineChart) {
|
if (labLineChart) {
|
||||||
@ -747,16 +868,16 @@ const updateLabLineChart = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 使用仪表盘数据更新图表
|
// 使用仪表盘数据更新图表
|
||||||
const updateChartsWithDashboardData = () => {
|
const updateChartsWithDashboardData = () => {
|
||||||
if (!dashboardData.value) return;
|
if (!dashboardData.value) return;
|
||||||
if (!dashboardData2.value) return;
|
if (!dashboardData2.value) return;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 初始化图表
|
// 初始化图表
|
||||||
const initCharts = () => {
|
const initCharts = () => {
|
||||||
// 研究人员图表 - 横向堆叠柱状图(柱中心显示数字)
|
// 研究人员图表
|
||||||
const researcherChart = echarts.init(researcherChartRef.value)
|
const researcherChart = echarts.init(researcherChartRef.value)
|
||||||
researcherChart.setOption({
|
researcherChart.setOption({
|
||||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
||||||
@ -963,26 +1084,27 @@ const initCharts = () => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 学术产出图表 - 横向柱状图(柱末端显示数字)
|
// 学术产出图表 - 使用API数据
|
||||||
const outputChart = echarts.init(outputChartRef.value)
|
const outputChart = echarts.init(outputChartRef.value)
|
||||||
outputChart.setOption({
|
outputChart.setOption({
|
||||||
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
|
||||||
legend: {
|
legend: {
|
||||||
data: ['论文总数', '专利总数'],
|
data: ['博士', '硕士', '学士'],
|
||||||
textStyle: { color: '#fff' },
|
textStyle: { color: '#fff' },
|
||||||
selected: {
|
selected: {
|
||||||
'论文总数': outputLegendStatus.value[0],
|
'博士': outputLegendStatus.value[0],
|
||||||
'专利总数': outputLegendStatus.value[1]
|
'硕士': outputLegendStatus.value[1],
|
||||||
|
'学士': outputLegendStatus.value[1],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
grid: { left: '3%', right: '12%', bottom: '3%', containLabel: true },
|
grid: { left: '3%', right: '12%', bottom: '3%', containLabel: true },
|
||||||
yAxis: { // 交换了 xAxis 和 yAxis
|
yAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['1月', '2月', '3月', '4月', '5月'],
|
data: outputData.value.months,
|
||||||
axisLine: { lineStyle: { color: '#fff' } },
|
axisLine: { lineStyle: { color: '#fff' } },
|
||||||
axisLabel: { color: '#fff' }
|
axisLabel: { color: '#fff' }
|
||||||
},
|
},
|
||||||
xAxis: { // 交换了 xAxis 和 yAxis
|
xAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLine: { lineStyle: { color: '#fff' } },
|
axisLine: { lineStyle: { color: '#fff' } },
|
||||||
axisLabel: { color: '#fff' },
|
axisLabel: { color: '#fff' },
|
||||||
@ -996,9 +1118,9 @@ const initCharts = () => {
|
|||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '论文总数',
|
name: '博士',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: [140, 160, 180, 190, 210],
|
data: outputData.value.doctor,
|
||||||
itemStyle: { color: '#4080ff' },
|
itemStyle: { color: '#4080ff' },
|
||||||
barWidth: '20%',
|
barWidth: '20%',
|
||||||
barGap: '20%',
|
barGap: '20%',
|
||||||
@ -1010,9 +1132,9 @@ const initCharts = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '专利总数',
|
name: '硕士',
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: [100, 110, 120, 130, 150],
|
data: outputData.value.master,
|
||||||
itemStyle: { color: 'rgb(107,187,196)' },
|
itemStyle: { color: 'rgb(107,187,196)' },
|
||||||
barWidth: '20%',
|
barWidth: '20%',
|
||||||
barGap: '20%',
|
barGap: '20%',
|
||||||
@ -1022,6 +1144,20 @@ const initCharts = () => {
|
|||||||
color: '#fff',
|
color: '#fff',
|
||||||
formatter: '{c}'
|
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,
|
value: studyData.value.datay,
|
||||||
name: '奖项分布',
|
name: '奖项分布',
|
||||||
areaStyle: { opacity: 0 }, // 移除中间蒙版
|
areaStyle: { opacity: 0 },
|
||||||
lineStyle: { color: '#ffd700', width: 2 },
|
lineStyle: { color: '#ffd700', width: 2 },
|
||||||
itemStyle: { color: '#ffd700' }
|
itemStyle: { color: '#ffd700' }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
label: {
|
label: {
|
||||||
show: true, // 显示标签
|
show: true,
|
||||||
position: 'top', // 标签位置
|
position: 'top',
|
||||||
color: '#fff', // 标签颜色
|
color: '#fff',
|
||||||
fontSize: 10 // 标签字体大小
|
fontSize: 10
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
label: {
|
label: {
|
||||||
show: true, // 鼠标悬停时也显示标签
|
show: true,
|
||||||
fontSize: 12, // 鼠标悬停时字体变大
|
fontSize: 12,
|
||||||
fontWeight: 'bold' // 鼠标悬停时字体加粗
|
fontWeight: 'bold'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
// 研究经费图表 - 玫瑰饼图
|
// 研究经费图表 - 使用API数据
|
||||||
const fundingChart = echarts.init(fundingChartRef.value)
|
const fundingChart = echarts.init(fundingChartRef.value)
|
||||||
fundingChart.setOption({
|
fundingChart.setOption({
|
||||||
tooltip: { trigger: 'item' },
|
tooltip: { trigger: 'item' },
|
||||||
@ -1075,26 +1211,25 @@ const initCharts = () => {
|
|||||||
left: '5%',
|
left: '5%',
|
||||||
top: 'center',
|
top: 'center',
|
||||||
textStyle: { color: '#fff' },
|
textStyle: { color: '#fff' },
|
||||||
data: ['政府 50%', '企业 25%', '其他 25%'],
|
data: ['博士', '硕士', '学士'],
|
||||||
selected: {
|
selected: {
|
||||||
'政府 50%': fundingLegendStatus.value[0],
|
'博士': fundingLegendStatus.value[0],
|
||||||
'企业 25%': fundingLegendStatus.value[1],
|
'硕士': fundingLegendStatus.value[1],
|
||||||
'其他 25%': fundingLegendStatus.value[2]
|
'学士': fundingLegendStatus.value[2]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: ['30%', '70%'],
|
radius: ['30%', '70%'],
|
||||||
center: ['60%', '50%'], // 将图表向右移动为图例留出空间
|
center: ['60%', '50%'],
|
||||||
roseType: 'area',
|
roseType: 'area',
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
formatter: '{b}',
|
formatter: '{b}: {d}%',
|
||||||
position: 'outside',
|
position: 'outside',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
alignTo: 'labelLine',
|
distanceToLabelLine: 1
|
||||||
distanceToLabelLine: 5
|
|
||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: true,
|
show: true,
|
||||||
@ -1112,9 +1247,21 @@ const initCharts = () => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
{ value: 50, name: '政府 50%', itemStyle: { color: '#9966ff' } },
|
{
|
||||||
{ value: 25, name: '企业 25%', itemStyle: { color: '#ff9933' } },
|
value: fundingData.value.doctor,
|
||||||
{ value: 25, name: '其他 25%', itemStyle: { color: '#3399ff' } }
|
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() => {
|
onMounted(async() => {
|
||||||
|
// 论文数据
|
||||||
|
await fetchPaperData();
|
||||||
// 教研人才数据
|
// 教研人才数据
|
||||||
await fetchTeacherbData1();
|
await fetchTeacherbData1();
|
||||||
await fetchTeacherbData2();
|
await fetchTeacherbData2();
|
||||||
await fetchTeacherbData3(); // 调用新的数据获取函数
|
await fetchTeacherbData3();
|
||||||
// 工程研究中心数据
|
// 工程研究中心数据
|
||||||
await fetchLabData();
|
await fetchLabData();
|
||||||
await fetchLabData2();
|
await fetchLabData2();
|
||||||
@ -1157,63 +1306,22 @@ watch(dashboardData, () => {
|
|||||||
updateChartsWithData();
|
updateChartsWithData();
|
||||||
}
|
}
|
||||||
}, { deep: true });
|
}, { deep: true });
|
||||||
// 更新图表数据
|
|
||||||
const updateChartsWithData = () => {
|
// 更新图表数据
|
||||||
if (!dashboardData.value) return;
|
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 patentCountEl = document.querySelector('.stat-card:nth-child(2) .stat-value');
|
||||||
const highImpactPapersEl = document.querySelector('.stat-card:nth-child(3) .stat-value');
|
const highImpactPapersEl = document.querySelector('.stat-card:nth-child(3) .stat-value');
|
||||||
const keyProjectsEl = document.querySelector('.stat-card:nth-child(4) .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}`;
|
// 定义newsData为ref,使其可响应
|
||||||
}
|
const newsData = ref([]);
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 组件卸载时清理定时器
|
// 组件卸载时清理定时器
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
// 移除 resize 事件监听器
|
window.removeEventListener('resize', () => {});
|
||||||
window.removeEventListener('resize', () => {
|
|
||||||
// 这里可以添加移除所有图表实例的逻辑,或者在需要时手动销毁
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -1358,7 +1466,7 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.chart-container-65 {
|
.chart-container-65 {
|
||||||
width: 65%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="scoreComparisonDialogVisible"
|
v-model="scoreComparisonDialogVisible"
|
||||||
title="得分比较"
|
title="得分比较"
|
||||||
width="70%"
|
width="80%"
|
||||||
center
|
center
|
||||||
:append-to-body="true"
|
:append-to-body="true"
|
||||||
class="score-comparison-dialog"
|
class="score-comparison-dialog"
|
||||||
@ -158,7 +158,7 @@
|
|||||||
class="default-table score-comparison-table"
|
class="default-table score-comparison-table"
|
||||||
:row-class-name="tableRowClassName"
|
: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
|
<el-table-column
|
||||||
v-for="(header) in scoreComparisonHeaders"
|
v-for="(header) in scoreComparisonHeaders"
|
||||||
:key="header.prop"
|
:key="header.prop"
|
||||||
@ -175,6 +175,19 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -514,12 +527,23 @@ const scoreComparisonTableData = computed(() => {
|
|||||||
|
|
||||||
return selectedLabs.value.map(lab => {
|
return selectedLabs.value.map(lab => {
|
||||||
const row = {
|
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) => {
|
if (Array.isArray(lab.result)) {
|
||||||
row[`score${index + 1}`] = score;
|
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;
|
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); // 调试输出
|
// console.log("Calculated columnStats:", stats); // 调试输出
|
||||||
return stats;
|
return stats;
|
||||||
});
|
});
|
||||||
|
@ -66,7 +66,8 @@
|
|||||||
<div class="category-content">
|
<div class="category-content">
|
||||||
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
<div v-for="(item, itemIndex) in categoryItem.result" :key="itemIndex" class="category-item">
|
||||||
<span class="item-label">{{ item.label }}:</span>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@ const env = import.meta.env.MODE || 'development';
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
development: {
|
development: {
|
||||||
apiBaseUrl: 'http://192.168.18.9:48080',
|
apiBaseUrl: 'http://192.168.5.49:48080',
|
||||||
},
|
},
|
||||||
production: {
|
production: {
|
||||||
apiBaseUrl: 'http://36.103.203.89:48089',
|
apiBaseUrl: 'http://36.103.203.89:48089',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user