Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
1ad256dd
提交
1ad256dd
authored
3月 21, 2026
作者:
张烨
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:政令增加AI智能报告
上级
3def5f9f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
60 行增加
和
45 行删除
+60
-45
introduction.js
src/api/decree/introduction.js
+10
-1
index.vue
src/views/decree/decreeHome/index.vue
+35
-32
index.vue
...views/decree/decreeLayout/overview/introduction/index.vue
+12
-10
vite.config.js
vite.config.js
+3
-2
没有找到文件。
src/api/decree/introduction.js
浏览文件 @
1ad256dd
...
...
@@ -83,6 +83,14 @@ export function getDecreeReport(params) {
export
function
getKeyWordUp
()
{
return
request
({
method
:
'GET'
,
url
:
`/api/element//getKeyWordUp/2025-01-01`
,
url
:
`/api/element/getKeyWordUp/2025-01-01`
,
})
}
// 报告内容摘要
export
function
getOverview
(
params
)
{
return
request
({
method
:
'GET'
,
url
:
`/api/administrativeOrderInfo/overview/
${
params
.
id
}
`
,
})
}
\ No newline at end of file
src/views/decree/decreeHome/index.vue
浏览文件 @
1ad256dd
...
...
@@ -205,7 +205,7 @@
</div>
<div
class=
"ai-pane"
>
<AiButton
/>
<AiPane
aiContent=
"假数据假数据假数据假数据假数据假数据假数据假数据假数据假数据假数据
"
/>
<AiPane
:aiContent=
"summarize1
"
/>
</div>
</div>
...
...
@@ -238,7 +238,7 @@
</div>
<div
class=
"ai-pane"
>
<AiButton
/>
<AiPane
aiContent=
"假数据假数据假数据假数据假数据假数据假数据假数据假数据假数据假数据
"
/>
<AiPane
:aiContent=
"summarize2
"
/>
</div>
</div>
</div>
...
...
@@ -471,7 +471,6 @@ import {
getDecreehylyList
,
getDecreeTypeList
,
getKeyOrganization
,
getChartInterpretation
,
}
from
"@/api/decree/home"
;
import
{
getPersonSummaryInfo
}
from
"@/api/common/index"
;
import
{
getNews
,
getSocialMedia
}
from
"@/api/general/index"
;
...
...
@@ -801,6 +800,7 @@ const box5Params = reactive({
domainId
:
''
,
proposeName
:
''
,
})
const
summarize1
=
ref
()
const
handleGetDecreeYearOrder
=
async
()
=>
{
try
{
let
{
year
,
domainId
,
proposeName
}
=
box5Params
;
...
...
@@ -817,7 +817,7 @@ const handleGetDecreeYearOrder = async () => {
chart1Data
.
value
.
dataY
=
res
.
data
.
map
(
item
=>
{
return
item
.
count
;
});
onChartInterpretation
({
type
:
"柱状图"
,
name
:
"数量变化趋势"
,
data
:
res
.
data
})
summarize1
.
value
=
await
onChartInterpretation
({
type
:
"柱状图"
,
name
:
"数量变化趋势"
,
data
:
res
.
data
})
}
}
catch
(
error
)
{
console
.
error
(
"行政令发布频度error"
,
error
);
...
...
@@ -825,36 +825,37 @@ const handleGetDecreeYearOrder = async () => {
};
// AI智能总结
const
onChartInterpretation
=
async
(
text
)
=>
{
try
{
const
res
=
await
getChartInterpretation
({
text
});
console
.
log
(
"AI智能总结"
,
res
);
const
reader
=
res
.
getReader
();
const
decoder
=
new
TextDecoder
();
let
fullText
=
''
;
while
(
true
)
{
const
{
done
,
value
}
=
await
reader
.
read
();
if
(
done
)
break
;
const
chunk
=
decoder
.
decode
(
value
);
// 解析 chunk 中的 message 片段
const
messages
=
chunk
.
split
(
'
\
n
\
n'
).
filter
(
Boolean
);
for
(
const
msg
of
messages
)
{
if
(
msg
.
startsWith
(
'data: '
))
{
const
data
=
JSON
.
parse
(
msg
.
slice
(
6
));
if
(
data
.
text
)
fullText
+=
data
.
text
;
try
{
const
result
=
JSON
.
parse
(
fullText
);
renderToPage
(
result
);
}
catch
(
e
)
{}
}
}
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
();
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
()
||
''
;
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
];
}
console
.
log
(
"fullText"
,
fullText
);
}
catch
(
error
)
{
console
.
error
(
"AI智能总结error"
,
error
);
}
}
return
summarize
}
const
handleBox5
=
async
()
=>
{
...
...
@@ -882,6 +883,7 @@ const box6Params = reactive({
year
:
yearList
[
0
].
value
,
proposeName
:
''
,
});
const
summarize2
=
ref
()
const
handleGetDecreeArea
=
async
()
=>
{
try
{
let
{
year
,
proposeName
}
=
box6Params
;
...
...
@@ -897,6 +899,7 @@ const handleGetDecreeArea = async () => {
value
:
item
.
count
};
});
summarize2
.
value
=
await
onChartInterpretation
({
type
:
"环形图"
,
name
:
"领域分布情况"
,
data
:
res
.
data
})
}
}
catch
(
error
)
{
console
.
error
(
"政令科技领域error"
,
error
);
...
...
src/views/decree/decreeLayout/overview/introduction/index.vue
浏览文件 @
1ad256dd
...
...
@@ -168,6 +168,7 @@ import {
getDecreeRiskSignal
,
getDecreeIssueOrganization
,
getKeyWordUp
,
getOverview
,
}
from
"@/api/decree/introduction"
;
import
{
getDecreeRelatedEvent
}
from
"@/api/decree/background"
;
import
AiSummary
from
'@/components/base/Ai/AiSummary/index.vue'
...
...
@@ -243,16 +244,16 @@ const onKeyWordUp = async () => {
};
// 报告内容摘要
const
box1Data
=
ref
(
`包括经济竞争在内的美中竞争自2017年以来一直在定义美国外交政策。这两个经济体是世界上第一和第二大国家经济体,并且深深交织在一起。改变关系,无论多么必要,可能是昂贵的。因此,美国面临着一项挑战,确保其经济在耦合的战略竞争条件下满足国家的需求。为了应对这一挑战,兰德大学的研究人员对美中竞争进行了经济和制度分析,进行了参与式的远见练习,以了解确保美国经济健康的长期路径,并创建了两个经济竞争游戏,探索多个国家在相互交流的同时确保经济健康的动态...`
);
// const handleGetDecreeKeyInstruction
= async () => {
//
try {
// const res = await getDecreeKeyInstruction(
);
//
console.log("报告内容摘要", res);
//
box1Data.value = res.data;
//
} catch (error) {
//
console.error("获取报告内容摘要数据失败", error);
//
}
//
};
const
box1Data
=
ref
(
''
);
const
onOverview
=
async
()
=>
{
try
{
const
res
=
await
getOverview
({
id
:
decreeId
.
value
}
);
console
.
log
(
"报告内容摘要"
,
res
);
box1Data
.
value
=
res
.
data
;
}
catch
(
error
)
{
console
.
error
(
"获取报告内容摘要数据失败"
,
error
);
}
};
// 相关事件
const
relatedData
=
ref
([]);
...
...
@@ -342,6 +343,7 @@ const handleClickUser = item => {
};
onMounted
(()
=>
{
onOverview
()
onKeyWordUp
()
onRiskSignalData
()
handleGetRelateEvents
();
...
...
vite.config.js
浏览文件 @
1ad256dd
...
...
@@ -53,8 +53,9 @@ export default defineConfig({
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
reportData/
,
''
)
},
'/api'
:
{
// target: 'http://8.140.26.4:9085/',
target
:
'http://192.168.0.4:28080/'
,
target
:
'http://8.140.26.4:9085/'
,
// target: 'http://192.168.0.4:28080/',
// target: 'http://172.20.10.3:28080/',
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论