Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
63fa7533
提交
63fa7533
authored
4月 03, 2026
作者:
朱政
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:资助体系图表切换时间或经费项目时,重新调用ai
上级
cb0a0e8a
流水线
#330
已通过 于阶段
in 1 分 32 秒
变更
2
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
40 行增加
和
9 行删除
+40
-9
index.vue
src/views/scientificFunding/components/dataSub/index.vue
+36
-9
index.vue
src/views/scientificFunding/components/resLib/index.vue
+4
-0
没有找到文件。
src/views/scientificFunding/components/dataSub/index.vue
浏览文件 @
63fa7533
...
@@ -243,6 +243,7 @@ const handleLeft1YearChange = () => {
...
@@ -243,6 +243,7 @@ const handleLeft1YearChange = () => {
};
};
// 资助体系v2.0:资助领域分布情况:资助经费
// 资助体系v2.0:资助领域分布情况:资助经费
const
handleGetFundField
=
async
()
=>
{
const
handleGetFundField
=
async
()
=>
{
invalidateAiContent
(
aiContentLeft1
,
isAiLoadingLeft1
,
left1AiSeq
);
const
seq
=
++
left1FundReqSeq
;
const
seq
=
++
left1FundReqSeq
;
left1FundLoading
.
value
=
true
;
left1FundLoading
.
value
=
true
;
try
{
try
{
...
@@ -286,6 +287,7 @@ const handleGetFundField = async () => {
...
@@ -286,6 +287,7 @@ const handleGetFundField = async () => {
//资助体系v2.0:资助领域分布情况:资助项目
//资助体系v2.0:资助领域分布情况:资助项目
const
handleFindCountryProjectAreaList
=
async
()
=>
{
const
handleFindCountryProjectAreaList
=
async
()
=>
{
invalidateAiContent
(
aiContentLeft1
,
isAiLoadingLeft1
,
left1AiSeq
);
const
seq
=
++
left1ProjReqSeq
;
const
seq
=
++
left1ProjReqSeq
;
left1ProjLoading
.
value
=
true
;
left1ProjLoading
.
value
=
true
;
try
{
try
{
...
@@ -444,6 +446,7 @@ const setRadio2 = (val) => {
...
@@ -444,6 +446,7 @@ const setRadio2 = (val) => {
};
};
// 资助体系v2.0:资助经费变化情况:资助经费
// 资助体系v2.0:资助经费变化情况:资助经费
const
handlegetCountryFundingChange
=
async
()
=>
{
const
handlegetCountryFundingChange
=
async
()
=>
{
invalidateAiContent
(
aiContentRight1
,
isAiLoadingRight1
,
right1AiSeq
);
try
{
try
{
right1FundLoading
.
value
=
true
;
right1FundLoading
.
value
=
true
;
let
params
=
{
let
params
=
{
...
@@ -481,6 +484,7 @@ const handlegetCountryFundingChange = async () => {
...
@@ -481,6 +484,7 @@ const handlegetCountryFundingChange = async () => {
};
};
//资助体系v2.0:资助经费变化情况:资助项目
//资助体系v2.0:资助经费变化情况:资助项目
const
handlegetCountryFundProjectChange
=
async
()
=>
{
const
handlegetCountryFundProjectChange
=
async
()
=>
{
invalidateAiContent
(
aiContentRight1
,
isAiLoadingRight1
,
right1AiSeq
);
try
{
try
{
right1ProjLoading
.
value
=
true
;
right1ProjLoading
.
value
=
true
;
let
params
=
{
let
params
=
{
...
@@ -526,6 +530,7 @@ const handleRight2YearChange = () => {
...
@@ -526,6 +530,7 @@ const handleRight2YearChange = () => {
handlegetOrgFundStrength
();
handlegetOrgFundStrength
();
};
};
const
handlegetOrgFundStrength
=
async
()
=>
{
const
handlegetOrgFundStrength
=
async
()
=>
{
invalidateAiContent
(
aiContentRight2
,
isAiLoadingRight2
,
right2AiSeq
);
try
{
try
{
let
params
=
{
let
params
=
{
year
:
normalizeYearParam
(
value3
.
value
)
year
:
normalizeYearParam
(
value3
.
value
)
...
@@ -727,6 +732,19 @@ const isAiLoadingLeft2 = ref(false);
...
@@ -727,6 +732,19 @@ const isAiLoadingLeft2 = ref(false);
const
isAiLoadingRight1
=
ref
(
false
);
const
isAiLoadingRight1
=
ref
(
false
);
const
isAiLoadingRight2
=
ref
(
false
);
const
isAiLoadingRight2
=
ref
(
false
);
const
AI_LOADING_TEXT
=
"解读生成中…"
;
// 用于保证“切换筛选后只写入最新一次解读结果”
const
left1AiSeq
=
ref
(
0
);
const
left2AiSeq
=
ref
(
0
);
const
right1AiSeq
=
ref
(
0
);
const
right2AiSeq
=
ref
(
0
);
const
invalidateAiContent
=
(
targetRef
,
loadingRef
,
aiSeqRef
)
=>
{
aiSeqRef
.
value
+=
1
;
loadingRef
.
value
=
false
;
targetRef
.
value
=
AI_LOADING_TEXT
;
};
const
appendAiInterpretationChunk
=
(
targetRef
,
chunk
,
loadingText
=
"解读生成中…"
)
=>
{
const
appendAiInterpretationChunk
=
(
targetRef
,
chunk
,
loadingText
=
"解读生成中…"
)
=>
{
if
(
!
chunk
)
return
;
if
(
!
chunk
)
return
;
const
current
=
String
(
targetRef
.
value
||
""
);
const
current
=
String
(
targetRef
.
value
||
""
);
...
@@ -746,31 +764,39 @@ const getInterpretationTextFromChartResponse = (res) => {
...
@@ -746,31 +764,39 @@ const getInterpretationTextFromChartResponse = (res) => {
);
);
};
};
const
fetchChartInterpretationOnce
=
async
(
payload
,
targetRef
,
loadingRef
)
=>
{
const
fetchChartInterpretationOnce
=
async
(
payload
,
targetRef
,
loadingRef
,
aiSeqRef
)
=>
{
if
(
loadingRef
.
value
)
return
;
if
(
loadingRef
.
value
)
return
;
const
hasValidContent
=
const
hasValidContent
=
targetRef
.
value
&&
targetRef
.
value
&&
targetRef
.
value
!==
"解读生成中…"
&&
targetRef
.
value
!==
AI_LOADING_TEXT
&&
targetRef
.
value
!==
"解读加载失败"
&&
targetRef
.
value
!==
"解读加载失败"
&&
targetRef
.
value
!==
"暂无图表数据"
;
targetRef
.
value
!==
"暂无图表数据"
;
if
(
hasValidContent
)
return
;
if
(
hasValidContent
)
return
;
const
localSeq
=
aiSeqRef
.
value
;
loadingRef
.
value
=
true
;
loadingRef
.
value
=
true
;
targetRef
.
value
=
"解读生成中…"
;
targetRef
.
value
=
AI_LOADING_TEXT
;
try
{
try
{
const
res
=
await
getChartAnalysis
(
const
res
=
await
getChartAnalysis
(
{
text
:
JSON
.
stringify
(
payload
)
},
{
text
:
JSON
.
stringify
(
payload
)
},
{
{
onChunk
:
(
chunk
)
=>
appendAiInterpretationChunk
(
targetRef
,
chunk
)
onChunk
:
(
chunk
)
=>
{
if
(
aiSeqRef
.
value
!==
localSeq
)
return
;
appendAiInterpretationChunk
(
targetRef
,
chunk
,
AI_LOADING_TEXT
);
}
}
}
);
);
if
(
aiSeqRef
.
value
!==
localSeq
)
return
;
const
text
=
getInterpretationTextFromChartResponse
(
res
);
const
text
=
getInterpretationTextFromChartResponse
(
res
);
targetRef
.
value
=
text
||
targetRef
.
value
||
"未返回有效解读内容"
;
targetRef
.
value
=
text
||
targetRef
.
value
||
"未返回有效解读内容"
;
}
catch
(
e
)
{
}
catch
(
e
)
{
if
(
aiSeqRef
.
value
!==
localSeq
)
return
;
console
.
error
(
"图表解读请求失败"
,
e
);
console
.
error
(
"图表解读请求失败"
,
e
);
targetRef
.
value
=
"解读加载失败"
;
targetRef
.
value
=
"解读加载失败"
;
}
finally
{
}
finally
{
loadingRef
.
value
=
false
;
if
(
aiSeqRef
.
value
===
localSeq
)
loadingRef
.
value
=
false
;
}
}
};
};
...
@@ -819,7 +845,7 @@ const handleSwitchAiLeft1 = async (val) => {
...
@@ -819,7 +845,7 @@ const handleSwitchAiLeft1 = async (val) => {
aiContentLeft1
.
value
=
"暂无图表数据"
;
aiContentLeft1
.
value
=
"暂无图表数据"
;
return
;
return
;
}
}
await
fetchChartInterpretationOnce
(
payload
,
aiContentLeft1
,
isAiLoadingLeft1
);
await
fetchChartInterpretationOnce
(
payload
,
aiContentLeft1
,
isAiLoadingLeft1
,
left1AiSeq
);
};
};
const
handleSwitchAiLeft2
=
async
(
val
)
=>
{
const
handleSwitchAiLeft2
=
async
(
val
)
=>
{
isShowAiContentLeft2
.
value
=
val
;
isShowAiContentLeft2
.
value
=
val
;
...
@@ -829,7 +855,7 @@ const handleSwitchAiLeft2 = async (val) => {
...
@@ -829,7 +855,7 @@ const handleSwitchAiLeft2 = async (val) => {
aiContentLeft2
.
value
=
"暂无图表数据"
;
aiContentLeft2
.
value
=
"暂无图表数据"
;
return
;
return
;
}
}
await
fetchChartInterpretationOnce
(
payload
,
aiContentLeft2
,
isAiLoadingLeft2
);
await
fetchChartInterpretationOnce
(
payload
,
aiContentLeft2
,
isAiLoadingLeft2
,
left2AiSeq
);
};
};
const
handleSwitchAiRight1
=
async
(
val
)
=>
{
const
handleSwitchAiRight1
=
async
(
val
)
=>
{
isShowAiContentRight1
.
value
=
val
;
isShowAiContentRight1
.
value
=
val
;
...
@@ -839,7 +865,7 @@ const handleSwitchAiRight1 = async (val) => {
...
@@ -839,7 +865,7 @@ const handleSwitchAiRight1 = async (val) => {
aiContentRight1
.
value
=
"暂无图表数据"
;
aiContentRight1
.
value
=
"暂无图表数据"
;
return
;
return
;
}
}
await
fetchChartInterpretationOnce
(
payload
,
aiContentRight1
,
isAiLoadingRight1
);
await
fetchChartInterpretationOnce
(
payload
,
aiContentRight1
,
isAiLoadingRight1
,
right1AiSeq
);
};
};
const
handleSwitchAiRight2
=
async
(
val
)
=>
{
const
handleSwitchAiRight2
=
async
(
val
)
=>
{
isShowAiContentRight2
.
value
=
val
;
isShowAiContentRight2
.
value
=
val
;
...
@@ -849,7 +875,7 @@ const handleSwitchAiRight2 = async (val) => {
...
@@ -849,7 +875,7 @@ const handleSwitchAiRight2 = async (val) => {
aiContentRight2
.
value
=
"暂无图表数据"
;
aiContentRight2
.
value
=
"暂无图表数据"
;
return
;
return
;
}
}
await
fetchChartInterpretationOnce
(
payload
,
aiContentRight2
,
isAiLoadingRight2
);
await
fetchChartInterpretationOnce
(
payload
,
aiContentRight2
,
isAiLoadingRight2
,
right2AiSeq
);
};
};
...
@@ -970,6 +996,7 @@ const left2RawSankey = ref([]);
...
@@ -970,6 +996,7 @@ const left2RawSankey = ref([]);
const
hasLeft2ChartData
=
computed
(()
=>
isNonEmptyArray
(
left2RawSankey
.
value
));
const
hasLeft2ChartData
=
computed
(()
=>
isNonEmptyArray
(
left2RawSankey
.
value
));
// 机构资助领域情况
// 机构资助领域情况
const
handleGetOrgFundsArea
=
async
()
=>
{
const
handleGetOrgFundsArea
=
async
()
=>
{
invalidateAiContent
(
aiContentLeft2
,
isAiLoadingLeft2
,
left2AiSeq
);
try
{
try
{
let
params
=
{
let
params
=
{
year
:
normalizeYearParam
(
value2
.
value
)
year
:
normalizeYearParam
(
value2
.
value
)
...
...
src/views/scientificFunding/components/resLib/index.vue
浏览文件 @
63fa7533
...
@@ -459,6 +459,10 @@ onMounted(async () => {
...
@@ -459,6 +459,10 @@ onMounted(async () => {
height
:
24px
;
height
:
24px
;
margin-right
:
0
!
important
;
margin-right
:
0
!
important
;
}
}
:deep
(
.el-checkbox__label
)
{
font-size
:
16px
;
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论