Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
2
合并请求
2
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
80811a1a
提交
80811a1a
authored
3月 31, 2026
作者:
张烨
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:政令-修复数量变化趋势和领域分布情况加载异常问题
上级
0c40bb2d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
34 行删除
+65
-34
index.vue
src/components/base/TimeTabPane/index.vue
+12
-1
index.vue
src/views/decree/decreeHome/index.vue
+49
-31
index.vue
src/views/decree/decreeLayout/influence/index.vue
+4
-2
没有找到文件。
src/components/base/TimeTabPane/index.vue
浏览文件 @
80811a1a
...
...
@@ -17,7 +17,14 @@
</
template
>
<
script
setup
>
import
{
ref
}
from
'vue'
import
{
onMounted
,
ref
}
from
'vue'
const
props
=
defineProps
({
activeTime
:
{
typeof
:
String
,
default
:
'近一周'
}
})
const
timeList
=
ref
([
{
...
...
@@ -34,6 +41,10 @@ const timeList = ref([
},
])
onMounted
(()
=>
{
timeList
.
value
.
forEach
(
item
=>
{
item
.
active
=
item
.
time
===
props
.
activeTime
})
})
const
handleTimeClick
=
(
item
,
index
)
=>
{
timeList
.
value
.
forEach
(
time
=>
{
time
.
active
=
false
...
...
src/views/decree/decreeHome/index.vue
浏览文件 @
80811a1a
...
...
@@ -34,7 +34,7 @@
<img
:src=
"tipsTcon"
alt=
""
>
</div>
<div
class=
"date-text"
>
近期美国各联邦政府机构发布涉华政令数量汇总
</div>
<TimeTabPane
@
time-click=
"onKeyOrganization"
/>
<TimeTabPane
@
time-click=
"onKeyOrganization"
activeTime=
"近一年"
/>
</div>
<div
class=
"home-main-header-item-box"
v-if=
"keyOrganizationList.length"
>
<div
class=
"organization-item"
v-for=
"(item, index) in keyOrganizationList"
:key=
"index"
@
click=
"handleToInstitution(item)"
>
...
...
@@ -767,7 +767,7 @@ const handleGetDecreeYearOrder = async () => {
chart1Data
.
value
.
dataY
=
res
.
data
.
map
(
item
=>
{
return
item
.
count
;
});
summarize1
.
value
=
await
onChartInterpretation
({
type
:
"柱状图"
,
name
:
"数量变化趋势"
,
data
:
res
.
data
}
)
onChartInterpretation
({
type
:
"柱状图"
,
name
:
"数量变化趋势"
,
data
:
res
.
data
},
summarize1
)
}
}
catch
(
error
)
{
console
.
error
(
"行政令发布频度error"
,
error
);
...
...
@@ -775,38 +775,56 @@ const handleGetDecreeYearOrder = async () => {
box5Params
.
loading
=
false
};
// AI智能总结
const
onChartInterpretation
=
async
(
text
)
=>
{
const
response
=
await
fetch
(
'/aiAnalysis/chart_interpretation'
,
{
method
:
'POST'
,
headers
:
{
"X-API-Key"
:
"aircasKEY19491001"
,
'Content-Type'
:
'application/json'
,
},
body
:
JSON
.
stringify
({
text
})
// 把参数转为JSON字符串
});
const
reader
=
response
.
body
.
getReader
();
const
decoder
=
new
TextDecoder
();
const
onChartInterpretation
=
async
(
text
,
param
)
=>
{
param
.
value
=
"正在生成..."
let
buffer
=
''
;
let
summarize
=
''
;
while
(
true
)
{
const
{
done
,
value
}
=
await
reader
.
read
();
if
(
done
)
break
;
buffer
+=
decoder
.
decode
(
value
,
{
stream
:
true
});
const
lines
=
buffer
.
split
(
'
\
n'
);
buffer
=
lines
.
pop
()
||
''
;
// 👇 新增:超时 + 终止请求(只加这一段)
const
controller
=
new
AbortController
();
const
timeout
=
setTimeout
(()
=>
controller
.
abort
(),
10000
);
// 10秒超时
try
{
const
response
=
await
fetch
(
'/aiAnalysis/chart_interpretation'
,
{
method
:
'POST'
,
headers
:
{
"X-API-Key"
:
"aircasKEY19491001"
,
'Content-Type'
:
'application/json'
,
},
body
:
JSON
.
stringify
({
text
}),
signal
:
controller
.
signal
// 👇 新增:绑定中断信号
});
clearTimeout
(
timeout
);
// 👇 新增:请求成功清除定时器
const
reader
=
response
.
body
.
getReader
();
const
decoder
=
new
TextDecoder
();
let
buffer
=
''
;
let
summarize
=
''
;
for
(
const
line
of
lines
)
{
if
(
line
.
startsWith
(
'data: '
))
{
const
content
=
line
.
substring
(
6
);
const
textMatch
=
content
.
match
(
/"解读":
\s
*"
([^
"
]
*
)
"/
);
if
(
textMatch
&&
textMatch
[
1
])
summarize
=
textMatch
[
1
];
while
(
true
)
{
const
{
done
,
value
}
=
await
reader
.
read
();
if
(
done
)
break
;
buffer
+=
decoder
.
decode
(
value
,
{
stream
:
true
});
const
lines
=
buffer
.
split
(
'
\
n'
);
buffer
=
lines
.
pop
()
||
''
;
for
(
const
line
of
lines
)
{
if
(
line
.
startsWith
(
'data: '
))
{
const
content
=
line
.
substring
(
6
);
const
textMatch
=
content
.
match
(
/"解读":
\s
*"
([^
"
]
*
)
"/
);
if
(
textMatch
&&
textMatch
[
1
])
summarize
=
textMatch
[
1
];
}
}
}
param
.
value
=
summarize
}
catch
(
err
)
{
// 👇 新增:超时处理
if
(
err
.
name
===
'AbortError'
)
{
param
.
value
=
"请求超时,请重试"
;
}
else
{
param
.
value
=
"生成失败,请重试"
;
}
}
return
summarize
}
const
handleBox5
=
async
()
=>
{
...
...
@@ -870,7 +888,7 @@ const handleGetDecreeArea = async () => {
value
:
item
.
count
};
});
summarize2
.
value
=
await
onChartInterpretation
({
type
:
"环形图"
,
name
:
"领域分布情况"
,
data
:
res
.
data
}
)
onChartInterpretation
({
type
:
"环形图"
,
name
:
"领域分布情况"
,
data
:
res
.
data
},
summarize2
)
}
}
catch
(
error
)
{
console
.
error
(
"政令科技领域error"
,
error
);
...
...
@@ -1194,7 +1212,7 @@ const handleSearch = () => {
// 关键机构
const
keyOrganizationList
=
ref
([]);
const
onKeyOrganization
=
async
(
event
)
=>
{
let
day
=
7
let
day
=
365
if
(
event
?.
time
===
'近一周'
)
day
=
7
if
(
event
?.
time
===
'近一月'
)
day
=
30
if
(
event
?.
time
===
'近一年'
)
day
=
365
...
...
src/views/decree/decreeLayout/influence/index.vue
浏览文件 @
80811a1a
...
...
@@ -79,8 +79,9 @@
<
div
class
=
"graph-box"
v
-
if
=
"contentType==1"
>
<
ChartChain
:
listData
=
"fishbone.list"
:
baseData
=
"fishbone.base"
/>
<
/div
>
<
div
class
=
"graph-box"
v
-
if
=
"contentType==2 && graphInfo.nodes.length"
>
<
GraphChart
:
nodes
=
"graphInfo.nodes"
:
links
=
"graphInfo.links"
layoutType
=
"force"
/>
<
div
class
=
"graph-box"
v
-
if
=
"contentType==2"
>
<
GraphChart
v
-
if
=
"graphInfo.nodes?.length"
:
nodes
=
"graphInfo.nodes"
:
links
=
"graphInfo.links"
layoutType
=
"force"
/>
<
el
-
empty
v
-
else
style
=
"padding: 60px 0"
description
=
"暂无数据"
:
image
-
size
=
"100"
/>
<
/div
>
<
/div
>
<
/AnalysisBox
>
...
...
@@ -168,6 +169,7 @@ const onDecreeEntities = async (page=1) => {
const
contentType
=
ref
(
1
);
const
headerContentType
=
(
type
)
=>
{
contentType
.
value
=
type
;
if
(
!
entityInfo
.
total
)
return
;
headerChartData
(
entityInfo
.
node
)
}
;
const
headerChartData
=
(
row
)
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论