提交 e0cf9513 authored 作者: huhuiqing's avatar huhuiqing

科研实力接口对接

上级 dceaf44c
......@@ -94,6 +94,14 @@ export function getResearchFieldSubjectType(params) {
params
})
}
// 获取行业领域列表
export function getAreaType() {
return request({
method: 'GET',
url: `/api/commonDict/areaType`,
})
}
/***********详情页 */
//创新主体详情:基本信息
export function getInfo(params) {
......@@ -150,6 +158,14 @@ export function getPaperList(params) {
})
}
//创新主体科研实力:领域实力分布
export function getStudyFieldList(params) {
return request({
method: 'GET',
url: `/api/innovateSubject/studyFieldList/${params.id}`,
})
}
//创新主体科研实力:经费增长情况
export function getFundGrowth(params) {
return request({
......
......@@ -360,8 +360,9 @@
</div>
</div>
<div class="select-box">
<el-select v-model="value" placeholder="全部领域" style="width: 120px">
<el-option v-for="item in areaList" :key="item.value" :label="item.label" :value="item.value" />
<el-select v-model="areaSelect" placeholder="全部领域" style="width: 120px"
@change="handleFindListBySubjectTypeId">
<el-option v-for="item in areaList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</div>
</div>
......@@ -412,6 +413,7 @@ import getCalendarHeatChart from "./utils/cleandarHeat";
import EChart from "@/components/Chart/index.vue";
import { pieOption, raderOption } from "./utils/charts";
import {
getAreaType,
getNews,
getSocialMediaInfo,
getBillRiskSignal,
......@@ -970,6 +972,19 @@ const areaList = ref([
value: "全部领域"
}
]);
const areaSelect = ref([])
//获取行业领域列表
const handleGetAreaType = async () => {
try {
const res = await getAreaType();
console.log("行业领域列表 ", res);
if (res.code === 200 && res.data) {
areaList.value = res.data
}
} catch (error) {
console.error("获取行业领域列表 error", error);
}
};
const categoryList1 = ref(["研究型大学", "国家实验室", "科技企业", "国防承包商"]);
const activeCate1 = ref('');
......@@ -1002,7 +1017,7 @@ const handleFindListBySubjectTypeId = async () => {
try {
let params = {
subjectTypeId: activeCate1.value,
// arealist:
arealist: areaSelect.value,
currentPage: currentPage.value,
pageSize: 16,
......@@ -1037,6 +1052,7 @@ const handleToPosi = id => {
};
onMounted(async () => {
handleGetAreaType()
handleGetNews()
handleGetSocialMediaInfo()
handleGetBillRiskSignal()
......
......@@ -65,8 +65,8 @@
</div>
</div>
</div>
<div class="statisticsChart">
<Echarts :option="raderOption1" height="100%"></Echarts>
<div class="statisticsChart" v-if="studyFieldList.length > 0">
<Echarts :option="raderOption1(studyFieldList)" height="100%"></Echarts>
</div>
<div class="statisticsAI">
<div class="AIbox">
......@@ -167,7 +167,7 @@ import Echarts from "@/components/Chart/index.vue";
import { barOption, lineChart, raderOption1, lineChart1, pieOption1, horizontalBaroption } from "../../utils/charts.js";
import {
getPatentList,
getPaperList, getFundGrowth, getFundFromList, getFundToList
getPaperList, getFundGrowth, getFundFromList, getFundToList, getStudyFieldList
} from "@/api/innovationSubject/overview.js";
import { useRouter } from "vue-router";
const router = useRouter();
......@@ -221,6 +221,22 @@ const handleGetFundGrowth = async () => {
}
};
//创新主体科研实力:领域实力分布
const studyFieldList = ref([])
const handleGetStudyFieldList = async () => {
try {
let params = {
id: router.currentRoute._value.params.id
}
const res = await getStudyFieldList(params);
console.log("领域实力分布", res);
if (res.code === 200 && res.data) {
studyFieldList.value = res.data
}
} catch (error) {
console.error("获取领域实力分布error", error);
}
};
//经费来源
const fundFromList = ref([])
const handleGetFundFromList = async () => {
......@@ -256,9 +272,11 @@ const handlegGetFundToList = async () => {
};
onMounted(async () => {
handleGetFundGrowth()
handleGetPatentList()
handleGetPaperList()
handleGetFundGrowth()
handleGetStudyFieldList()
handleGetFundFromList()
handlegGetFundToList()
});
......
......@@ -223,45 +223,8 @@ export const raderOption = (data) => {
return option;
}
export const raderOption1 = {
grid: {
top: '3%',
right: '3%',
bottom: '1%',
left: '1%',
containLabel: true
},
radar: {
radius: '60%', // 关键:缩小整个雷达
indicator: [
{ name: '能源领域', max: 6500 },
{ name: '集成电路', max: 16000 },
{ name: '人工智能', max: 30000 },
{ name: '通信网络', max: 38000 },
{ name: '量子科技', max: 52000 },
{ name: '生物科技', max: 25000 }
],
axisName: {
formatter: '{value}',
color: 'rgba(59, 65, 75, 1)',
fontSize: 16,
fontWeight: 700
}
},
series: [
{
name: 'Budget vs spending',
type: 'radar',
data: [
{
value: [4200, 3000, 20000, 35000, 50000, 18000],
name: '哈佛大学',
areaStyle: { color: 'rgba(179, 127, 235, 0.1)' }
}
]
}
]
};
export const barOption = (data) => {
// 提取年份和对应的专利数量
const years = data.map(item => item.year.toString());
......@@ -344,7 +307,6 @@ export const barOption = (data) => {
]
};
return option;
}
export const lineChart = (data) => {
// 提取年份和对应的专利数量
......@@ -548,4 +510,58 @@ export const horizontalBaroption = (data) => {
}]
};
return option;
}
\ No newline at end of file
}
export const raderOption1 = (data) => {
// 提取指标名称和对应的值
const indicatorNames = data.map(item => item.areaName);
const indicatorValues = data.map(item => item.areaValue);
// 动态生成雷达图的 indicator 配置
const indicators = indicatorNames.map((name, index) => ({
name,
max: Math.max(...indicatorValues) * 1.2 // 设置最大值为所有值的最大值的1.2倍
}));
let radarData = {
color:
"rgba(215, 27, 56, 0.2)",
name: '',
value: indicatorValues
}
console.log(indicators, 'indicators', radarData, 'radarDataradarData')
// 雷达图配置
const option = {
title: { text: '' },
legend: {
icon: 'circle',
orient: 'vertical',
right: 50,
top: 'center',
align: 'left',
textStyle: {
color: "rgba(59, 65, 75, 1)",
fontSize: "16px"
}
},
radar: {
radius: '60%',
indicator: indicators,
axisName: {
formatter: '{value}',
color: 'rgba(59, 65, 75, 1)',
fontSize: 16,
fontWeight: 700
}
},
series: [
{
name: 'Budget vs spending',
type: 'radar',
data: [radarData]
}
]
};
return option;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论