Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tech_typer_v2
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
tech_typer_v2
Commits
3df44f93
提交
3df44f93
authored
9月 05, 2025
作者:
caijian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first commit
上级
a7a092f6
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
373 行增加
和
50 行删除
+373
-50
jsconfig.json
jsconfig.json
+15
-0
graphApi.js
src/api/graphApi.js
+54
-0
request.js
src/api/request.js
+8
-1
DataList.vue
src/views/mechanism/component/DataList.vue
+4
-1
DataListChart.vue
src/views/mechanism/component/DataListChart.vue
+2
-2
MechanismAnalysis.vue
src/views/mechanism/component/MechanismAnalysis.vue
+0
-0
RagDialog.vue
src/views/mechanism/component/RagDialog.vue
+169
-0
ThemeManagement.vue
src/views/themeList/ThemeManagement.vue
+1
-0
addEdge.vue
src/views/themeList/components/G6/addEdge.vue
+29
-4
HullGraphTimeBar.vue
src/views/themeList/components/HullGraphTimeBar.vue
+91
-42
没有找到文件。
jsconfig.json
0 → 100644
浏览文件 @
3df44f93
{
"compilerOptions"
:
{
"baseUrl"
:
"src"
,
"paths"
:
{
"@/*"
:
[
"*"
]
},
"target"
:
"esnext"
,
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
"allowJs"
:
true
,
},
"include"
:
[
"src/**/*"
],
"exclude"
:
[
"node_modules"
,
"dist"
]
}
\ No newline at end of file
src/api/graphApi.js
浏览文件 @
3df44f93
...
...
@@ -199,6 +199,60 @@ export const saveEventsTable = async (params) => {
return
data
}
//获取chart prompt
export
const
getChartPrompt
=
async
(
params
,
type
)
=>
{
let
data
=
await
request
.
get
(
`/api/analysis/
${
type
}
?hyper_id=`
+
params
.
hyper_id
)
return
data
}
//保存chart prompt
export
const
saveChartPrompt
=
async
(
params
,
type
)
=>
{
let
data
=
await
request
({
method
:
"post"
,
headers
:
{
'Content-Type'
:
'application/json'
},
url
:
"/api/analysis/"
+
type
,
data
:
params
})
return
data
}
export
const
getChartNewsList
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/get_chart_news_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
export
const
getChartData
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/analysis_chart_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
// http://8.140.26.4:10006/tech_hyper/api/analysis/get_matrix_news_in_rag?hyper_id=1
export
const
getMatrixNewsList
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/get_matrix_news_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
// http://8.140.26.4:10006/tech_hyper/api/analysis/analysis_matrix_in_rag?hyper_id=1
export
const
getMatrixData
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/analysis_matrix_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
// http://8.140.26.4:10006/tech_hyper/api/analysis/get_event_relation_news_in_rag?hyper_id=1
export
const
getEventNewsList
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/get_event_relation_news_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
// http://8.140.26.4:10006/tech_hyper/api/analysis/analysis_event_relations_in_rag?hyper_id=1
export
const
getEventData
=
async
(
params
)
=>
{
let
data
=
await
request
.
get
(
'/api/analysis/analysis_event_relations_in_rag?hyper_id='
+
params
.
hyper_id
)
return
data
}
/**
* 上传文件,后端解析Excel文件
* @param file 文件,表单数据
...
...
src/api/request.js
浏览文件 @
3df44f93
...
...
@@ -9,7 +9,7 @@ const BASE_API = "/"
// 创建axios实例
const
service
=
axios
.
create
({
baseURL
:
BASE_API
,
//所有的后端接口请求地址前缀部分(没有后端请求不用写)
timeout
:
15
000
// 请求超时时间,这里15秒
timeout
:
50
000
// 请求超时时间,这里15秒
//withCredentials: true,// 异步请求携带cookie,true为携带,false为不携带
//请求头里面设置通用传参类型
/*headers: {
...
...
@@ -35,6 +35,13 @@ service.interceptors.request.use(config => {
service
.
interceptors
.
response
.
use
(
response
=>
{
//对数据返回做什么
if
(
response
.
data
.
code
==
0
)
{
ElMessage
({
message
:
response
.
data
.
message
,
type
:
'error'
,
duration
:
3
*
1000
})
}
return
response
.
data
},
error
=>
{
...
...
src/views/mechanism/component/DataList.vue
浏览文件 @
3df44f93
...
...
@@ -17,11 +17,14 @@
</div>
</div>
<div
class=
"extra-container"
>
<div
class=
"location-text text-ellipsis"
>
<
!--
<
div
class=
"location-text text-ellipsis"
>
<span
:title=
"item.country"
>
{{
item
.
country
}}
</span>
</div>
<div
class=
"date-text text-ellipsis"
>
<span
:title=
"item.date"
>
{{
item
.
date
||
'-'
}}
</span>
</div>
-->
<div
class=
"date-text text-ellipsis"
>
<span
:title=
"item.content"
v-if=
"item.content"
>
{{
item
.
content
.
join
(
','
)
||
'-'
}}
</span>
</div>
</div>
</div>
...
...
src/views/mechanism/component/DataListChart.vue
浏览文件 @
3df44f93
...
...
@@ -13,13 +13,13 @@
<span>
{{
index
+
1
}}
</span>
</div>
<div
class=
"name-text text-ellipsis"
>
<
span
:title=
"item.date + item.country"
style=
"color: #AFD4F5;"
>
{{
"("
+
item
.
date
+
"-"
+
item
.
country
+
") "
}}
</span
>
<
!--
<span
:title=
"item.date + item.country"
style=
"color: #AFD4F5;"
>
{{
"("
+
item
.
date
+
"-"
+
item
.
country
+
") "
}}
</span>
--
>
<span
:title=
"item.title"
>
{{
item
.
title
||
'-'
}}
</span>
</div>
</div>
<div
class=
"extra-container"
>
<div
class=
"location-text text-ellipsis"
>
<span
:title=
"item.
achievement"
>
{{
item
.
achievement
}}
</span>
<span
:title=
"item.
content"
>
{{
item
.
content
.
join
(
','
)
}}
</span>
</div>
</div>
</div>
...
...
src/views/mechanism/component/MechanismAnalysis.vue
浏览文件 @
3df44f93
差异被折叠。
点击展开。
src/views/mechanism/component/RagDialog.vue
0 → 100644
浏览文件 @
3df44f93
<
template
>
<el-dialog
title=
"RAG 分析"
v-model=
"visible"
width=
"60%"
:close-on-click-modal=
"false"
@
close=
"handleClose"
>
<el-form
:model=
"form"
label-width=
"80px"
label-position=
"top"
>
<el-form-item
label=
"Prompt"
>
<el-input
v-model=
"form.prompt"
type=
"textarea"
:rows=
"6"
placeholder=
"请输入prompt内容"
/>
</el-form-item>
</el-form>
<template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
</el-button>
</span>
</
template
>
</el-dialog>
</template>
<
script
setup
>
import
{
ref
,
watch
,
getCurrentInstance
,
onMounted
}
from
'vue'
import
{
getChartPrompt
,
saveChartPrompt
}
from
'@/api/graphApi'
const
{
appContext
}
=
getCurrentInstance
();
const
globalProxy
=
appContext
.
config
.
globalProperties
;
const
props
=
defineProps
({
modelValue
:
{
type
:
Boolean
,
default
:
false
},
prompt
:
{
type
:
String
,
default
:
''
},
hyperId
:
{
type
:
Number
,
default
:
1
},
focusButton
:
{
type
:
Number
,
default
:
false
}
})
const
getUrlMap
=
{
0
:
'get_chart_prompt'
,
1
:
'get_matrix_prompt'
,
2
:
'get_event_relation_prompt'
}
const
saveUrlMap
=
{
0
:
'save_chart_prompt'
,
1
:
'save_matrix_prompt'
,
2
:
'save_event_relation_prompt'
}
const
emit
=
defineEmits
([
'update:modelValue'
,
'submit'
])
const
visible
=
ref
(
false
)
const
form
=
ref
({
prompt
:
''
})
// 监听props变化
watch
(()
=>
props
.
modelValue
,
async
(
newVal
)
=>
{
visible
.
value
=
newVal
if
(
newVal
)
{
// 当对话框打开时,获取prompt数据
await
fetchPromptData
()
}
})
// 移除对props.prompt的监听,现在直接从接口获取数据
// 监听visible变化,同步到父组件
watch
(
visible
,
(
newVal
)
=>
{
emit
(
'update:modelValue'
,
newVal
)
})
function
handleClose
()
{
visible
.
value
=
false
}
// 获取prompt数据
async
function
fetchPromptData
()
{
try
{
const
params
=
{
hyper_id
:
props
.
hyperId
}
const
response
=
await
getChartPrompt
(
params
,
getUrlMap
[
props
.
focusButton
])
if
(
response
.
code
===
1
&&
response
.
data
)
{
form
.
value
.
prompt
=
response
.
data
}
}
catch
(
error
)
{
console
.
error
(
'获取prompt失败:'
,
error
)
globalProxy
.
$message
({
message
:
'获取prompt数据失败'
,
type
:
'error'
})
}
}
// 保存prompt数据
async
function
savePromptData
()
{
try
{
const
params
=
{
hyper_id
:
props
.
hyperId
,
prompt
:
form
.
value
.
prompt
}
const
response
=
await
saveChartPrompt
(
params
,
saveUrlMap
[
props
.
focusButton
])
return
response
}
catch
(
error
)
{
console
.
error
(
'保存prompt失败:'
,
error
)
throw
error
}
}
async
function
handleSubmit
()
{
console
.
log
(
'RAG请求参数:'
,
form
.
value
.
prompt
)
if
(
!
form
.
value
.
prompt
.
trim
())
{
globalProxy
.
$message
({
message
:
'请输入prompt内容'
,
type
:
'warning'
})
return
}
try
{
globalProxy
.
$message
({
message
:
'正在保存prompt...'
,
type
:
'info'
})
await
savePromptData
()
globalProxy
.
$message
({
message
:
'Prompt保存成功!'
,
type
:
'success'
})
visible
.
value
=
false
emit
(
'submit'
,
form
.
value
.
prompt
)
}
catch
(
error
)
{
globalProxy
.
$message
({
message
:
'保存prompt失败'
,
type
:
'error'
})
}
}
// 组件挂载时获取数据
onMounted
(()
=>
{
if
(
visible
.
value
)
{
fetchPromptData
()
}
})
</
script
>
<
style
scoped
>
.dialog-footer
{
display
:
flex
;
justify-content
:
flex-end
;
gap
:
10px
;
}
</
style
>
\ No newline at end of file
src/views/themeList/ThemeManagement.vue
浏览文件 @
3df44f93
...
...
@@ -232,6 +232,7 @@ function getEventGraphData(id) {
let
paramsObj
=
{
id
:
id
}
if
(
!
paramsObj
.
id
)
return
getHypermapById
(
paramsObj
).
then
((
res
)
=>
{
let
leftTopLon
=
res
.
data
.
bounds
.
leftTop
.
lon
;
let
leftTopLat
=
res
.
data
.
bounds
.
leftTop
.
lat
;
...
...
src/views/themeList/components/G6/addEdge.vue
浏览文件 @
3df44f93
...
...
@@ -185,11 +185,36 @@ function handleConfirmRelation() {
to
,
relation_name
}
=
relationFormState
.
value
;
if
(
from
&&
to
&&
relation_name
)
{
emit
(
"handleConfirmRelation"
,
relationFormState
.
value
);
}
else
{
globalProxy
.
$message
.
error
(
"有未选择项"
);
// 详细的表单验证
if
(
!
from
)
{
globalProxy
.
$message
.
error
(
"请选择起始节点"
);
return
;
}
if
(
!
to
)
{
globalProxy
.
$message
.
error
(
"请选择目标节点"
);
return
;
}
if
(
!
relation_name
||
relation_name
.
trim
()
===
''
)
{
globalProxy
.
$message
.
error
(
"请输入关系名称"
);
return
;
}
if
(
from
===
to
)
{
globalProxy
.
$message
.
error
(
"起始节点和目标节点不能相同"
);
return
;
}
// 验证关系名称长度
if
(
relation_name
.
trim
().
length
>
50
)
{
globalProxy
.
$message
.
error
(
"关系名称不能超过50个字符"
);
return
;
}
// 发送确认事件
emit
(
"handleConfirmRelation"
,
{
...
relationFormState
.
value
,
relation_name
:
relation_name
.
trim
()
// 去除首尾空格
});
}
function
handleExchange
()
{
...
...
src/views/themeList/components/HullGraphTimeBar.vue
浏览文件 @
3df44f93
...
...
@@ -1198,58 +1198,107 @@ const handleQuery = (e) => {
// 建立节点与节点之间的关系
function
handleConfirmRelation
(
e
)
{
console
.
log
(
"
e
"
,
e
);
console
.
log
(
"
graph_data
"
,
graph_data
.
value
);
console
.
log
(
"
新增关系参数:
"
,
e
);
console
.
log
(
"
当前图数据:
"
,
graph_data
.
value
);
let
savedGraph
=
_
.
cloneDeep
(
graph_data
.
value
);
let
graph
=
simplifyData
(
savedGraph
);
let
id
=
props
.
eventGraphId
;
try
{
// 验证必要参数
if
(
!
e
.
from
||
!
e
.
to
||
!
e
.
relation_name
)
{
globalProxy
.
$message
.
error
(
"关系参数不完整,请检查起始节点、目标节点和关系名称"
);
return
;
}
console
.
log
(
"graph"
,
graph
);
let
savedGraph
=
_
.
cloneDeep
(
graph_data
.
value
);
let
graph
=
simplifyData
(
savedGraph
);
let
id
=
props
.
eventGraphId
;
const
newEdge
=
{
date
:
null
,
label
:
e
.
relation_name
,
source
:
graph
.
nodes
.
filter
((
item
)
=>
{
return
item
.
label
===
e
.
from
;
})[
0
].
id
,
target
:
graph
.
nodes
.
filter
((
item
)
=>
{
return
item
.
label
===
e
.
to
;
})[
0
].
id
,
};
// 查找源节点和目标节点
const
sourceNode
=
graph
.
nodes
.
find
((
item
)
=>
item
.
label
===
e
.
from
);
const
targetNode
=
graph
.
nodes
.
find
((
item
)
=>
item
.
label
===
e
.
to
);
graph
.
edges
=
[...
graph
.
edges
,
newEdge
];
if
(
!
sourceNode
||
!
targetNode
)
{
globalProxy
.
$message
.
error
(
"未找到对应的节点,请确认节点是否存在"
);
return
;
}
let
zoom_center
=
{};
emit
(
"saveMap"
,
(
val
)
=>
{
zoom_center
=
val
;
});
// 检查是否已存在相同的关系
const
existingEdge
=
graph
.
edges
.
find
((
edge
)
=>
edge
.
source
===
sourceNode
.
id
&&
edge
.
target
===
targetNode
.
id
&&
edge
.
label
===
e
.
relation_name
);
if
(
existingEdge
)
{
globalProxy
.
$message
.
warning
(
"该关系已存在,无需重复添加"
);
handleCloseAddRelation
();
return
;
}
let
params
=
{
hyper_id
:
id
,
graph
:
{
data
:
graph
,
zoom_center
:
zoom_center
,
},
};
saveHypergraph
(
params
)
.
then
((
res
)
=>
{
if
(
res
.
code
===
1
)
{
// 创建新的关系边
const
newEdge
=
{
id
:
`edge_
${
Date
.
now
()}
_
${
Math
.
random
().
toString
(
36
).
substr
(
2
,
9
)}
`
,
// 生成唯一ID
date
:
null
,
label
:
e
.
relation_name
,
source
:
sourceNode
.
id
,
target
:
targetNode
.
id
,
};
// 添加新关系到图数据
graph
.
edges
=
[...
graph
.
edges
,
newEdge
];
console
.
log
(
"更新后的图数据:"
,
graph
);
// 获取当前视图中心点
let
zoom_center
=
{};
emit
(
"saveMap"
,
(
val
)
=>
{
zoom_center
=
val
;
});
// 构建保存参数
let
params
=
{
hyper_id
:
id
,
graph
:
{
data
:
graph
,
zoom_center
:
zoom_center
,
},
};
console
.
log
(
"保存超图参数:"
,
params
);
// 调用保存接口
saveHypergraph
(
params
)
.
then
((
res
)
=>
{
console
.
log
(
"保存超图响应:"
,
res
);
if
(
res
.
code
===
1
)
{
globalProxy
.
$message
({
type
:
"success"
,
message
:
"新增关系成功"
,
});
// 刷新图谱数据
emit
(
"refreshGraph"
);
handleCloseAddRelation
();
}
else
{
globalProxy
.
$message
({
type
:
"error"
,
message
:
res
.
message
||
"新增关系失败"
,
});
}
})
.
catch
((
error
)
=>
{
console
.
error
(
"保存超图失败:"
,
error
);
globalProxy
.
$message
({
type
:
"
success
"
,
message
:
"
保存成功
"
,
type
:
"
error
"
,
message
:
"
网络错误,新增关系失败,请稍后重试
"
,
});
emit
(
"refreshGraph"
);
}
})
.
catch
(()
=>
{
globalProxy
.
$message
({
type
:
"error"
,
message
:
"保存失败"
,
});
}
catch
(
error
)
{
console
.
error
(
"新增关系处理异常:"
,
error
);
globalProxy
.
$message
({
type
:
"error"
,
message
:
"处理新增关系时发生异常,请稍后重试"
,
});
handleCloseAddRelation
();
handleCloseAddRelation
();
}
}
// 融合图谱数据
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论