提交 9e986979 authored 作者: 付康's avatar 付康

合并分支 'zz-dev' 到 'pre'

feat:智库和风险列表加入加载状态,同时修改智库数量变化趋势图表调用 查看合并请求 !339
流水线 #450 已通过 于阶段
in 3 分 26 秒
...@@ -113,7 +113,7 @@ service.interceptors.response.use( ...@@ -113,7 +113,7 @@ service.interceptors.response.use(
} }
// 特殊处理:风险信号管理页面接口偶发 500,不弹出提示 // 特殊处理:风险信号管理页面接口偶发 500,不弹出提示
// 覆盖接口:/api/riskSignal/getCountInfo | /api/riskSignal/getDailyCount | /api/riskSignal/pageQuery // 覆盖接口:/api/riskSignal/baseInfo | /api/riskSignal/pageQuery
try { try {
const errUrl = String(error?.config?.url || '') const errUrl = String(error?.config?.url || '')
if (error?.response?.status === 500 && errUrl.includes('/api/riskSignal/')) { if (error?.response?.status === 500 && errUrl.includes('/api/riskSignal/')) {
......
import request from "@/api/request.js"; import request from "@/api/request.js";
// 基本统计信息 /** 风险信号管理页:统计 + 日历热力数据(原 getCountInfo + getDailyCount) */
export function getCountInfo() { export function getRiskSignalBaseInfo() {
return request({ return request({
method: 'GET', method: "GET",
url: `/api/riskSignal/getCountInfo`, url: `/api/riskSignal/baseInfo`
}) });
}
// 每日统计信息
export function getDailyCount() {
return request({
method: 'GET',
url: `/api/riskSignal/getDailyCount`,
})
} }
// 按条件分页查询风险信号信息 // 按条件分页查询风险信号信息
export function getPageQuery(data) { export function getPageQuery(data) {
return request({ return request({
method: 'POST', method: 'POST',
url: `/api/riskSignal/pageQuery`, url: `/api/riskSignal/PageLimit`,
data: data data: data
}) })
} }
...@@ -53,6 +53,25 @@ export function getThinkTankPolicyIndustryChange(params) { ...@@ -53,6 +53,25 @@ export function getThinkTankPolicyIndustryChange(params) {
}); });
} }
/**
* 智库概览-数量变化趋势(按领域统计)
* GET /thinkTankReport/domainStats
* @param {{ startDate: string, endDate: string }} params
*/
export function getThinkTankReportDomainStats(params) {
return request({
method: "GET",
url: `/api/thinkTankReport/domainStats`,
params: {
startDate: params.startDate,
endDate: params.endDate
},
// 与 policyIndustryChange 一致:无数据年份可能返回 400/500,避免走全局错误提示
validateStatus: (status) =>
(status >= 200 && status < 300) || status === 400 || status === 500
});
}
// 政策建议领域分布 // 政策建议领域分布
export function getThinkTankPolicyIndustry(params) { export function getThinkTankPolicyIndustry(params) {
return request({ return request({
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<span class="tag-text"> {{ tag }} ({{ tagCountMap[tag] || 0 }} 项)</span> <span class="tag-text"> {{ tag }} ({{ tagCountMap[tag] || 0 }} 项)</span>
</span> </span>
</div> </div>
<div class="item-box"> <div class="item-box" v-loading="loading">
<div class="item" v-for="(item, index) in filteredOpinions" :key="item.id || index" <div class="item" v-for="(item, index) in filteredOpinions" :key="item.id || index"
:class="{ 'item-active': index === activeItemIndex }" @click=" :class="{ 'item-active': index === activeItemIndex }" @click="
() => { () => {
...@@ -138,6 +138,7 @@ import { ...@@ -138,6 +138,7 @@ import {
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import DefaultNewsImg from '@/assets/images/default-icon-news.png' import DefaultNewsImg from '@/assets/images/default-icon-news.png'
const router = useRouter(); const router = useRouter();
const loading = ref(false);
const searchOpinions = ref(""); const searchOpinions = ref("");
// 政策建议相关情况(当前页/当前筛选展示的数据) // 政策建议相关情况(当前页/当前筛选展示的数据)
const box1Data = ref([]); const box1Data = ref([]);
...@@ -277,6 +278,7 @@ const updateTagsFromAllData = () => { ...@@ -277,6 +278,7 @@ const updateTagsFromAllData = () => {
const handleGetThinkTankReportPolicyAction = async () => { const handleGetThinkTankReportPolicyAction = async () => {
try { try {
loading.value = true;
const params = { const params = {
reportId: router.currentRoute._value.params.id, reportId: router.currentRoute._value.params.id,
// 这里请求全量数据,前端自行分页 // 这里请求全量数据,前端自行分页
...@@ -312,6 +314,8 @@ const handleGetThinkTankReportPolicyAction = async () => { ...@@ -312,6 +314,8 @@ const handleGetThinkTankReportPolicyAction = async () => {
box1Data.value = []; box1Data.value = [];
allTags.value = []; allTags.value = [];
tagCountMap.value = {}; tagCountMap.value = {};
} finally {
loading.value = false;
} }
}; };
// 按当前标签与页码从全量数据中截取一页 // 按当前标签与页码从全量数据中截取一页
...@@ -765,6 +769,7 @@ onMounted(async () => { ...@@ -765,6 +769,7 @@ onMounted(async () => {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: auto; margin-left: auto;
cursor: pointer;
img { img {
width: 100%; width: 100%;
...@@ -815,6 +820,7 @@ onMounted(async () => { ...@@ -815,6 +820,7 @@ onMounted(async () => {
width: 20px; width: 20px;
height: 20px; height: 20px;
margin-left: auto; margin-left: auto;
cursor: pointer;
img { img {
width: 100%; width: 100%;
......
...@@ -1284,6 +1284,7 @@ onMounted(() => { ...@@ -1284,6 +1284,7 @@ onMounted(() => {
height: 24px; height: 24px;
margin-top: 12px; margin-top: 12px;
margin-left: 18px; margin-left: 18px;
cursor: pointer;
} }
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="right"> <div class="right" v-loading="loading">
<div class="right-main"> <div class="right-main">
<div class="right-main-item" v-for="item in policyList" :key="item.id"> <div class="right-main-item" v-for="item in policyList" :key="item.id">
<div class="item-left"> <div class="item-left">
...@@ -308,6 +308,8 @@ import { useRouter } from "vue-router"; ...@@ -308,6 +308,8 @@ import { useRouter } from "vue-router";
const router = useRouter(); const router = useRouter();
const loading = ref(false);
/** 与 AreaTag 一致的领域色(取 tag 的文字色) */ /** 与 AreaTag 一致的领域色(取 tag 的文字色) */
const AREA_TAG_COLOR_BY_NAME = { const AREA_TAG_COLOR_BY_NAME = {
"人工智能": "rgba(245, 34, 45, 1)", // tag1 "人工智能": "rgba(245, 34, 45, 1)", // tag1
...@@ -1247,6 +1249,7 @@ const handleCurrentChange = page => { ...@@ -1247,6 +1249,7 @@ const handleCurrentChange = page => {
const handleGetThinkPolicy = async () => { const handleGetThinkPolicy = async () => {
try { try {
loading.value = true;
const thinkTankId = router.currentRoute._value.params.id; const thinkTankId = router.currentRoute._value.params.id;
const domainIds = selectedAreaList.value const domainIds = selectedAreaList.value
.filter((id) => id != null && id !== "" && id !== POLICY_FILTER_ALL_AREA) .filter((id) => id != null && id !== "" && id !== POLICY_FILTER_ALL_AREA)
...@@ -1292,6 +1295,8 @@ const handleGetThinkPolicy = async () => { ...@@ -1292,6 +1295,8 @@ const handleGetThinkPolicy = async () => {
console.error("获取智库政策error", error); console.error("获取智库政策error", error);
policyList.value = []; policyList.value = [];
total.value = 0; total.value = 0;
} finally {
loading.value = false;
} }
}; };
......
...@@ -456,7 +456,7 @@ import ThinkTankPolicyAdviceOverview from "./components/ThinkTankPolicyAdviceOve ...@@ -456,7 +456,7 @@ import ThinkTankPolicyAdviceOverview from "./components/ThinkTankPolicyAdviceOve
import { import {
getThinkTankList, getThinkTankList,
getThinkTankRiskSignal, getThinkTankRiskSignal,
getThinkTankPolicyIndustryChange, getThinkTankReportDomainStats,
getThinkTankPolicyIndustry, getThinkTankPolicyIndustry,
getThinkTankDonation, getThinkTankDonation,
getAllThinkTankList, getAllThinkTankList,
...@@ -1003,10 +1003,25 @@ const changeBox5Data = year => { ...@@ -1003,10 +1003,25 @@ const changeBox5Data = year => {
// 政策建议趋势分布 // 政策建议趋势分布
const handleGetThinkTankPolicyIndustryChange = async range => { const handleGetThinkTankPolicyIndustryChange = async range => {
try { try {
const res = await getThinkTankPolicyIndustryChange(range); const res = await getThinkTankReportDomainStats(range);
console.log("政策建议趋势分布", res); console.log("智库报告数量变化趋势(domainStats)", res);
if (res.code === 200 && res.data) { if (res.code === 200 && res.data) {
const originalData = res.data; const rawList = Array.isArray(res.data) ? res.data : [];
// domainStats:季度维度 + areaList;旧逻辑使用 industryList,这里做字段归一(不改图表样式/结构)
const originalData = rawList
.map((item) => {
const industryList = Array.isArray(item?.industryList)
? item.industryList
: Array.isArray(item?.areaList)
? item.areaList
: [];
return {
...item,
year: item?.year,
industryList
};
})
.filter((item) => Array.isArray(item.industryList) && item.industryList.length > 0);
// 提取年份 // 提取年份
const years = originalData.map(item => item.year); const years = originalData.map(item => item.year);
// 提取所有行业名称 // 提取所有行业名称
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论