提交 4d76d831 authored 作者: caijian's avatar caijian

生成结论&创建超图..

上级 3df44f93
...@@ -2,10 +2,8 @@ import request from './request' ...@@ -2,10 +2,8 @@ import request from './request'
//创建超图 //创建超图
export const createGraph = async (params) => { export const createGraph = async (params) => {
let { let res = await request.post('/api/hypergraph/create', params)
data return res
} = await request.post('/api/hypergraph/create')
return data
} }
//超图列表 //超图列表
...@@ -42,9 +40,13 @@ export const insertEntityIntoHypergraph = async (params) => { ...@@ -42,9 +40,13 @@ export const insertEntityIntoHypergraph = async (params) => {
//实体列表 //实体列表
export const getEntityList = async (params) => { export const getEntityList = async (params) => {
let url = `/api/entity/search_pagination?page=${params.page}`
if (params.query) {
url += `&query=${params.query}`
}
let { let {
data data
} = await request.get('/api/entity/get_list') } = await request.get(url)
return data return data
} }
...@@ -66,9 +68,13 @@ export const createItem = async (params) => { ...@@ -66,9 +68,13 @@ export const createItem = async (params) => {
//新闻列表 //新闻列表
export const getItemList = async (params) => { export const getItemList = async (params) => {
let url = `/api/news/search_pagination?page=${params.page}`
if (params.query) {
url += `&query=${params.query}`
}
let { let {
data data
} = await request.get('/api/news/get_list') } = await request.get(url)
return data return data
} }
...@@ -253,6 +259,24 @@ export const getEventData = async (params) => { ...@@ -253,6 +259,24 @@ export const getEventData = async (params) => {
return data return data
} }
// http://8.140.26.4:10006/tech_hyper/api/analysis/conclude_chart_in_rag?hyper_id=1
export const getChartConclusion = async (params) => {
let data = await request.get('/api/analysis/conclude_chart_in_rag?hyper_id=' + params.hyper_id)
return data
}
//
// http://8.140.26.4:10006/tech_hyper/api/analysis/conclude_event_relation_in_rag?hyper_id=1
export const getEventRelationConclusion = async (params) => {
let data = await request.get('/api/analysis/conclude_event_relation_in_rag?hyper_id=' + params.hyper_id)
return data
}
// http://8.140.26.4:10006/tech_hyper/api/analysis/conclude_matrix_in_rag?hyper_id=1
export const getMatrixConclusion = async (params) => {
let data = await request.get('/api/analysis/conclude_matrix_in_rag?hyper_id=' + params.hyper_id)
return data
}
/** /**
* 上传文件,后端解析Excel文件 * 上传文件,后端解析Excel文件
* @param file 文件,表单数据 * @param file 文件,表单数据
......
...@@ -9,7 +9,7 @@ const BASE_API = "/" ...@@ -9,7 +9,7 @@ const BASE_API = "/"
// 创建axios实例 // 创建axios实例
const service = axios.create({ const service = axios.create({
baseURL: BASE_API, //所有的后端接口请求地址前缀部分(没有后端请求不用写) baseURL: BASE_API, //所有的后端接口请求地址前缀部分(没有后端请求不用写)
timeout: 50000 // 请求超时时间,这里15秒 timeout: 60000*5 // 请求超时时间,这里15秒
//withCredentials: true,// 异步请求携带cookie,true为携带,false为不携带 //withCredentials: true,// 异步请求携带cookie,true为携带,false为不携带
//请求头里面设置通用传参类型 //请求头里面设置通用传参类型
/*headers: { /*headers: {
......
...@@ -2,7 +2,7 @@ const state = { ...@@ -2,7 +2,7 @@ const state = {
// 专题生成--步骤数据 // 专题生成--步骤数据
create_graph_form: {}, create_graph_form: {},
activeSteps: 0, // 当前 activeSteps: 0, // 当前
stepList: ["创建专题", "数据导入", "定义关系", "专题生成"], stepList: ["创建专题", "数据导入", /*"定义关系",*/ "专题生成"],
graph_name: "", graph_name: "",
graph_id: "", graph_id: "",
maxStepsTotal: 3, // 步骤总条数 maxStepsTotal: 3, // 步骤总条数
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted, getCurrentInstance } from "vue";
import router from "@/router/index.js"; import router from "@/router/index.js";
import { getGraphList } from "@/api/graphApi"; import { getGraphList } from "@/api/graphApi";
...@@ -62,6 +62,9 @@ import logo3 from "./assets/images/icon3.svg"; ...@@ -62,6 +62,9 @@ import logo3 from "./assets/images/icon3.svg";
import logo4 from "./assets/images/icon4.svg"; import logo4 from "./assets/images/icon4.svg";
import logo5 from "./assets/images/icon5.svg"; import logo5 from "./assets/images/icon5.svg";
const { appContext } = getCurrentInstance();
const globalProxy = appContext.config.globalProperties;
const largeModelList = ref([ const largeModelList = ref([
// { // {
// logo: logo1, // logo: logo1,
...@@ -121,10 +124,11 @@ const handleDelte = (id) => { ...@@ -121,10 +124,11 @@ const handleDelte = (id) => {
// 确认删除 // 确认删除
const handleConfirm = () => { const handleConfirm = () => {
if (id == event_graph_id.value) { // 弹窗提示 暂未支持删除接口
event_graph_id.value = null; globalProxy.$message.warning("暂未支持删除接口");
event_graph_name.value = null; return
} const deleteIndex = largeModelList.value.findIndex(item => item.id == activeModelId.value);
largeModelList.value.splice(deleteIndex, 1);
// requestDeleteEntityById({ // requestDeleteEntityById({
// entity_id: id // entity_id: id
// }).then((res) => { // }).then((res) => {
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<div class="conclusions-main-right-content"> <div class="conclusions-main-right-content">
<div class="conclusions-main-right-content-title"> <div class="conclusions-main-right-content-title">
<div style="display: flex"> <div style="display: flex">
<div class="conclusions-main-right-content-title-span">{{item.title}}</div> <div class="conclusions-main-right-content-title-span" v-if="item.title">{{item.title}}</div>
</div> </div>
<div class="conclusions-main-right-content-text" :title="item.content"> <div class="conclusions-main-right-content-text" :title="item.content" v-if="item.content || item">
{{item.content}} {{item.content || item}}
</div> </div>
</div> </div>
</div> </div>
...@@ -33,7 +33,7 @@ let props = defineProps({ ...@@ -33,7 +33,7 @@ let props = defineProps({
<style lang="scss" scoped> <style lang="scss" scoped>
.conclusions-main-right-content-panel { .conclusions-main-right-content-panel {
height: 100%; height: 95%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="conclusionlist-title"> <div class="conclusionlist-title">
<span>结论</span> <span>结论</span>
</div> </div>
<ConclusionList :conclusionsArr="conclusionsList" class="conclusion-list"></ConclusionList> <ConclusionList :conclusionsArr="conclusionsList" class="conclusion-list" v-loading="conclusionLoading" element-loading-background="rgba(0, 0, 0, 0.2)"></ConclusionList>
</div> </div>
<el-button type="primary" class="edit-button" @click="editDataFun()">编辑</el-button> <el-button type="primary" class="edit-button" @click="editDataFun()">编辑</el-button>
</div> </div>
...@@ -60,11 +60,12 @@ ...@@ -60,11 +60,12 @@
<DataList :list="newsListChartBubble" class="bubble-datalist"></DataList> <DataList :list="newsListChartBubble" class="bubble-datalist"></DataList>
<div class="bottom-button-group"> <div class="bottom-button-group">
<el-button type="primary" @click="bubbleDrawing()">气泡图绘制</el-button> <el-button type="primary" @click="bubbleDrawing()">气泡图绘制</el-button>
<el-button type="primary" @click="modelScaleAnalysis()">模型规模分析</el-button> <el-button type="primary" @click="generateConclusionBubble()">生成结论</el-button>
<el-button type="primary" @click="lagAnalysis()">滞后性分析</el-button> <!-- <el-button type="primary" @click="modelScaleAnalysis()">模型规模分析</el-button>
<el-button type="primary" @click="lagAnalysis()">滞后性分析</el-button> -->
</div> </div>
</div> </div>
<div class="bubble-box"> <div class="bubble-box" v-loading="graphMatrixLoading" element-loading-background="rgba(0, 0, 0, 0.2)">
<div class="bubble-item" v-for="(item,index) in targetList" :key="index"> <div class="bubble-item" v-for="(item,index) in targetList" :key="index">
<div class="info"> <div class="info">
<div style="display: flex;flex-direction: column;justify-content: center;height: 10%;"> <div style="display: flex;flex-direction: column;justify-content: center;height: 10%;">
...@@ -96,11 +97,11 @@ ...@@ -96,11 +97,11 @@
<div class="conclusionlist-title"> <div class="conclusionlist-title">
<span>模型规模分析结论</span> <span>模型规模分析结论</span>
</div> </div>
<ConclusionList :conclusionsArr="conListBubble" class="conclusion-list"></ConclusionList> <ConclusionList :conclusionsArr="conListBubble" class="conclusion-list" v-loading="conclusionBubbleLoading" element-loading-background="rgba(0, 0, 0, 0.2)"></ConclusionList>
<div class="conclusionlist-title-bottom"> <!-- <div class="conclusionlist-title-bottom">
<span>滞后性分析结论</span> <span>滞后性分析结论</span>
</div> </div>
<ConclusionList :conclusionsArr="conListBubbleBottom" class="conclusion-list-bottom"></ConclusionList> <ConclusionList :conclusionsArr="conListBubbleBottom" class="conclusion-list-bottom"></ConclusionList> -->
</div> </div>
</div> </div>
...@@ -226,7 +227,10 @@ import { ...@@ -226,7 +227,10 @@ import {
getMatrixNewsList, getMatrixNewsList,
getMatrixData, getMatrixData,
getEventNewsList, getEventNewsList,
getEventData getEventData,
getChartConclusion,
getEventRelationConclusion,
getMatrixConclusion
} from "@/api/graphApi"; } from "@/api/graphApi";
const { const {
...@@ -1082,22 +1086,48 @@ function curvatureAnalysis(){ ...@@ -1082,22 +1086,48 @@ function curvatureAnalysis(){
} }
} }
const conclusionLoading = ref(false)
function generateConclusion(){ function generateConclusion(){
conclusionsList.value = [{ conclusionLoading.value = true;
title: "结论一", getChartConclusion({
content: "2017年与2023年,国外AI的技术性能均有大幅度提升,2017年全年处于急速上升的状态,但2023年前半年提升较慢,下半年飞速提升,创建了第二次飞速发展的阶段" hyper_id: hyperId.value
},{ }).then((res) => {
title: "结论二", if (res.code === 1) {
content: "我国的AI技术,在2018年得到了很大的提升,缩短了与国外AI技术的差距,在2024年我国再一次大幅度提升AI技术,并最终非常拉近了与国外的距离" conclusionsList.value = res.data;
},{ }
title: "结论三", conclusionLoading.value = false;
content: "我国的两次AI技术提升,均晚于国外,说明AI技术提升,我国还是受国外影响较多,但近十年我国整体提升幅度相交国外更明显,处于追赶与拉近距离的地位" }).catch((err) => {
}] conclusionLoading.value = false;
})
// conclusionsList.value = [{
// title: "结论一",
// content: "2017年与2023年,国外AI的技术性能均有大幅度提升,2017年全年处于急速上升的状态,但2023年前半年提升较慢,下半年飞速提升,创建了第二次飞速发展的阶段"
// },{
// title: "结论二",
// content: "我国的AI技术,在2018年得到了很大的提升,缩短了与国外AI技术的差距,在2024年我国再一次大幅度提升AI技术,并最终非常拉近了与国外的距离"
// },{
// title: "结论三",
// content: "我国的两次AI技术提升,均晚于国外,说明AI技术提升,我国还是受国外影响较多,但近十年我国整体提升幅度相交国外更明显,处于追赶与拉近距离的地位"
// }]
} }
function bubbleDrawing(){ function bubbleDrawing(){
initMatrix(); initMatrix();
} }
const conclusionBubbleLoading = ref(false);
function generateConclusionBubble(){
conclusionBubbleLoading.value = true;
getMatrixConclusion({
hyper_id: hyperId.value
}).then((res) => {
if (res.code === 1) {
conListBubble.value = res.data;
}
conclusionBubbleLoading.value = false;
}).catch((err) => {
conclusionBubbleLoading.value = false;
})
}
function modelScaleAnalysis(){ function modelScaleAnalysis(){
conListBubble.value = [{ conListBubble.value = [{
...@@ -1134,19 +1164,31 @@ function createGraphA(){ ...@@ -1134,19 +1164,31 @@ function createGraphA(){
} }
function generateConclusionG6(){ function generateConclusionG6(){
conListG6.value = [{ conclusionLoading.value = true;
title: "结论一", getEventRelationConclusion({
content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能" hyper_id: hyperId.value
},{ }).then((res) => {
title: "结论二", if (res.code === 1) {
content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能" conListG6.value = res.data;
},{ }
title: "结论三", conclusionLoading.value = false;
content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能" }).catch((err) => {
}] conclusionLoading.value = false;
})
// conListG6.value = [{
// title: "结论一",
// content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能"
// },{
// title: "结论二",
// content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能"
// },{
// title: "结论三",
// content: "人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能人工智能"
// }]
} }
const graphMatrixLoading = ref(false);
function initMatrix() { function initMatrix() {
graphMatrixLoading.value = true;
getMatrixData({ hyper_id: hyperId.value }).then((res) => { getMatrixData({ hyper_id: hyperId.value }).then((res) => {
if (res.code === 1 && res.data && res.data.length > 0) { if (res.code === 1 && res.data && res.data.length > 0) {
// 更新数据结构,将title改为event_title以匹配模板 // 更新数据结构,将title改为event_title以匹配模板
...@@ -1155,7 +1197,9 @@ function initMatrix() { ...@@ -1155,7 +1197,9 @@ function initMatrix() {
event_title: item.title event_title: item.title
})); }));
} }
graphMatrixLoading.value = false;
}).catch((error) => { }).catch((error) => {
graphMatrixLoading.value = false;
console.error('获取矩阵数据失败:', error); console.error('获取矩阵数据失败:', error);
globalProxy.$message({ globalProxy.$message({
type: "error", type: "error",
...@@ -1234,6 +1278,17 @@ function openRagDialog(tabType) { ...@@ -1234,6 +1278,17 @@ function openRagDialog(tabType) {
function handleRagSubmit(prompt) { function handleRagSubmit(prompt) {
console.log('RAG请求提交:', prompt); console.log('RAG请求提交:', prompt);
// 这里可以添加额外的处理逻辑 // 这里可以添加额外的处理逻辑
switch(focusBotton.value) {
case "0":
getNewsList();
break;
case "1":
getMatrixNews();
break;
case "2":
getEventNews();
break;
}
} }
function superLongTextHandle(str, maxWidth, fontSize) { function superLongTextHandle(str, maxWidth, fontSize) {
...@@ -2011,7 +2066,6 @@ function addArrow(rectCenterX, rectBottomY, minY, arrowEndY, arrowWidth, labelOf ...@@ -2011,7 +2066,6 @@ function addArrow(rectCenterX, rectBottomY, minY, arrowEndY, arrowWidth, labelOf
} }
.conclusion-list { .conclusion-list {
height: calc(50% - 60px);
margin-top: 10px; margin-top: 10px;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="handleClose">取消</el-button> <el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button> <el-button type="primary" @click="handleSubmit" :loading="loading">确定</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
...@@ -58,6 +58,7 @@ const saveUrlMap = { ...@@ -58,6 +58,7 @@ const saveUrlMap = {
} }
const emit = defineEmits(['update:modelValue', 'submit']) const emit = defineEmits(['update:modelValue', 'submit'])
const loading = ref(false)
const visible = ref(false) const visible = ref(false)
const form = ref({ const form = ref({
prompt: '' prompt: ''
...@@ -86,6 +87,7 @@ function handleClose() { ...@@ -86,6 +87,7 @@ function handleClose() {
// 获取prompt数据 // 获取prompt数据
async function fetchPromptData() { async function fetchPromptData() {
try { try {
loading.value = true
const params = { const params = {
hyper_id: props.hyperId hyper_id: props.hyperId
} }
...@@ -99,6 +101,8 @@ async function fetchPromptData() { ...@@ -99,6 +101,8 @@ async function fetchPromptData() {
message: '获取prompt数据失败', message: '获取prompt数据失败',
type: 'error' type: 'error'
}) })
} finally {
loading.value = false
} }
} }
...@@ -117,9 +121,10 @@ async function savePromptData() { ...@@ -117,9 +121,10 @@ async function savePromptData() {
} }
} }
async function handleSubmit() { async function handleSubmit() {
console.log('RAG请求参数:', form.value.prompt) console.log('RAG请求参数:', form.value.prompt)
loading.value = true
if (!form.value.prompt.trim()) { if (!form.value.prompt.trim()) {
globalProxy.$message({ globalProxy.$message({
message: '请输入prompt内容', message: '请输入prompt内容',
...@@ -129,6 +134,7 @@ async function handleSubmit() { ...@@ -129,6 +134,7 @@ async function handleSubmit() {
} }
try { try {
loading.value = true
globalProxy.$message({ globalProxy.$message({
message: '正在保存prompt...', message: '正在保存prompt...',
type: 'info' type: 'info'
...@@ -148,6 +154,8 @@ async function handleSubmit() { ...@@ -148,6 +154,8 @@ async function handleSubmit() {
message: '保存prompt失败', message: '保存prompt失败',
type: 'error' type: 'error'
}) })
} finally {
loading.value = false
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="operationLabel" :width="operationMinWidth" :align="operationAlign" v-if="operationLabelShow"> <el-table-column :label="operationLabel" :width="operationMinWidth" :align="operationAlign" v-if="operationLabelShow">
<template v-slot="scope"> <template v-slot="scope">
<slot></slot> <slot :row="scope.row" :column="scope.column" :$index="scope.$index"></slot>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<!-- 数据导入 --> <!-- 数据导入 -->
<ImportDataStep ref="importDataStepRef" :currentStep="activeSteps" v-if="activeSteps == 1" @handleCancelCreate="handleCancelCreate"></ImportDataStep> <ImportDataStep ref="importDataStepRef" :currentStep="activeSteps" v-if="activeSteps == 1" @handleCancelCreate="handleCancelCreate"></ImportDataStep>
<!-- 定义关系 --> <!-- 定义关系 -->
<DefineRelationsStep ref="importDataStepRef" :currentStep="activeSteps" v-if="activeSteps == 2" @handleCancelCreate="handleCancelCreate"></DefineRelationsStep> <!-- <DefineRelationsStep ref="importDataStepRef" :currentStep="activeSteps" v-if="activeSteps == 2" @handleCancelCreate="handleCancelCreate"></DefineRelationsStep> -->
<!-- 专题生成 --> <!-- 专题生成 -->
<div v-if="activeSteps == 3" class="graph-generation"> <div v-if="activeSteps == 2" class="graph-generation">
<div class="icon-success"> <div class="icon-success">
<span class="icon el-icon-success"></span> <span class="icon el-icon-success"></span>
<div class="success-tips">创建成功!</div> <div class="success-tips">创建成功!</div>
...@@ -79,7 +79,7 @@ function toViewGraph() { ...@@ -79,7 +79,7 @@ function toViewGraph() {
// 删除主题 // 删除主题
function handleCancelCreate(type) { function handleCancelCreate(type) {
// 图谱未创建完成离开删除创建的主题 // 图谱未创建完成离开删除创建的主题
if (activeSteps.value !== 3) { if (activeSteps.value !== 2) {
clearCache(); clearCache();
if (type !== "destroy") { if (type !== "destroy") {
toViewGraph(); toViewGraph();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论