+
+
-
+
+ 疾病信息
+ 药品信息
+ 检查信息
+
-
- {{diseaseCount.toLocaleString()}}种
+ {{ drugCount.toLocaleString() }}种
+ {{checkCount.toLocaleString()}}种
-
-
-
- 疾病信息
- 药品信息
- 检查信息
-
-
- {{diseaseCount.toLocaleString()}}种
- {{ drugCount.toLocaleString() }}种
- {{checkCount.toLocaleString()}}种
-
-
-
@@ -79,21 +73,21 @@
\ No newline at end of file
-
-
@@ -162,17 +155,14 @@ import {
import {Graph, Tooltip} from '@antv/g6';
import Menu from "@/components/Menu.vue";
import {a} from "vue-router/dist/devtools-EWN81iOl.mjs";
-import GraphToolbar from "@/components/GraphToolbar.vue";
import Fuse from 'fuse.js';
-import {ElMessage} from "element-plus";
import {getGraphStyleActive} from "@/api/style";
export default {
name: 'Display',
- components: {Menu,GraphToolbar},
+ components: {Menu},
data() {
return {
- _graph: null,
G6: null, // 添加这个
// 节点样式
nodeShowLabel: true,
@@ -1174,18 +1164,18 @@ export default {
label:node.name,
type:node.label
}
- getGraph(data).then(response => {
+ getGraph(data).then(response=>{
console.log(response)
this.formatData(response)
}); // 等待 Promise 解析
});
graph.once('afterlayout', () => {
if (!graph.destroyed) {
- graph.fitCenter({padding: 40, duration: 1000});
+ graph.fitCenter({ padding: 40, duration: 1000 });
}
});
this._graph = graph
- this._graph.setPlugins([{
+ this._graph.setPlugins([ {
type: 'tooltip',
// 只对节点启用,边不显示tooltip
enable: (e) => e.targetType === 'edge',
@@ -1194,7 +1184,7 @@ export default {
console.log(e)
const edge = items[0]; // 当前悬停的边
if (!edge) return '';
- const data = items[0].data
+ const data=items[0].data
const sourceId = edge.source;
const targetId = edge.target;
@@ -1211,72 +1201,10 @@ export default {
${sourceName} — ${rel} —> ${targetName}
`;
},
- },
- {
- type: 'toolbar',
- onClick: (id) =>
- {
- if (id === 'reset') {
- // 1. 如果是重置,直接在本地执行方法
- this.localResetGraph();
- }
- else if (this.$refs.toolbarRef) {
- // 2. 其他功能(放大、导出等)继续交给组件处理
- this.$refs.toolbarRef.handleToolbarAction(id);
- }
- },
- getItems: () => {
- return [
- { id: 'zoom-in', value: 'zoom-in', title: '放大' },
- { id: 'zoom-out', value: 'zoom-out', title: '缩小' },
- { id: 'undo', value: 'undo', title: '撤销' },
- { id: 'redo', value: 'redo', title: '重做' },
- { id: 'auto-fit', value: 'auto-fit', title: '聚焦' },
- { id: 'reset', value: 'reset', title: '重置' },
- { id: 'export', value: 'export', title: '导出图谱' },
- ];
- },
- },
- // 如果需要撤销重做功能,必须加上 history 插件
- { type: 'history', key: 'history' }])
+ },])
}
- },
- localResetGraph() {
- // 1. 检查图表实例和数据是否存在
- if (!this._graph) return;
-
- if (!this.defaultData || !this.defaultData.nodes) {
- this.$message.warning("未找到可重置的数据源");
- return;
- }
-
- try {
- // 2. 彻底清理鼠标指针状态
- const canvas = this._graph.getCanvas();
- if (canvas && typeof canvas.setCursor === 'function') {
- canvas.setCursor('default');
- }
-
- // 3. 彻底销毁当前图谱实例
- // 销毁会移除所有 DOM 节点和事件监听,彻底解决 EventBoundary 问题
- this._graph.destroy();
- this._graph = null;
- // 4. 重新初始化
- this.$nextTick(() => {
- // initGraph 内部会自动读取 this.defaultData
- this.initGraph();
-
- // 5. 重新构建分类索引(因为 destroy 也会清空之前的交互索引)
- this.buildCategoryIndex();
- this.$message.success("图谱已重置");
- });
- } catch (err) {
- console.error('重置图谱失败:', err);
- // 降级处理:如果销毁失败,尝试刷新页面(可选)
- // location.reload();
- }
},
updateGraph(data) {
@@ -1313,7 +1241,7 @@ export default {
if (!this._graph) return
const updatedEdges = this.defaultData.edges.map(edge => ({
...edge,
- type: this.edgeType,
+ type:this.edgeType,
style: {
endArrow: this.edgeEndArrow,
stroke: this.edgeStroke,
@@ -1596,14 +1524,12 @@ button:hover {
padding: 0 2px 0px 15px;
justify-content: space-between;
}
-
-.d-title {
+.d-title{
display: flex;
align-items: center;
font-size: 13px;
}
-
-.d-count {
+.d-count{
font-size: 9px;
background-color: #5989F0;
border-radius: 7px;
@@ -1650,21 +1576,19 @@ button:hover {
text-align: left;
font-size: 12px;
}
-
-.disease-body {
+.disease-body{
width: 360px;
overflow: scroll;
height: 74vh;
}
-
/* 隐藏滚动条,但允许滚动 */
.disease-body {
/* Firefox */
scrollbar-width: none; /* 'auto' | 'thin' | 'none' */
/* Webkit (Chrome, Safari, Edge) */
- -ms-overflow-style: none; /* IE and Edge */
- scrollbar-width: none; /* Firefox */
+ -ms-overflow-style: none; /* IE and Edge */
+ scrollbar-width: none; /* Firefox */
padding-bottom: 9px;
}
@@ -1682,12 +1606,12 @@ button:hover {
/deep/ .radio-drug .el-radio__input.is-checked .el-radio__inner {
background: #52c41a; /* 检查的颜色 */
- border-color: #52c41a;
+ border-color:#52c41a;
}
/deep/ .radio-check .el-radio__input.is-checked .el-radio__inner {
background: #1890ff; /* 药品的颜色 */
- border-color: #1890ff;
+ border-color:#1890ff;
}
@@ -1700,26 +1624,25 @@ button:hover {
/deep/ .radio-drug .el-radio__input.is-checked .el-radio__inner:hover {
background: #52c41a; /* 检查的颜色 */
- border-color: #52c41a;
+ border-color:#52c41a;
}
/deep/ .radio-check .el-radio__input.is-checked .el-radio__inner:hover {
background: #1890ff; /* 药品的颜色 */
- border-color: #1890ff;
+ border-color:#1890ff;
}
/* 自定义选中后的样式 */
-/deep/ .radio-disease .el-radio__input.is-checked + .el-radio__label {
+/deep/ .radio-disease .el-radio__input.is-checked+.el-radio__label {
color: rgb(153, 10, 0);
}
-/deep/ .radio-drug .el-radio__input.is-checked + .el-radio__label {
+/deep/ .radio-drug .el-radio__input.is-checked+.el-radio__label {
color: #52c41a;
}
-
-/deep/ .radio-check .el-radio__input.is-checked + .el-radio__label {
+/deep/ .radio-check .el-radio__input.is-checked+.el-radio__label {
color: #1890ff;
}
/* 自定义下拉样式 */
diff --git a/vue/src/system/GraphQA.vue b/vue/src/system/GraphQA.vue
index 5c1860f..badd374 100644
--- a/vue/src/system/GraphQA.vue
+++ b/vue/src/system/GraphQA.vue
@@ -33,7 +33,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
{{ currentTypeLabel }}
-
-
-
-
-
-
-
+
- {{ item.label }}
-
-
+
+
+ {{ item.label }}
-
-
- ICD10
- 科室
- 首字母
-
+
+
+
+
+ ICD10
+ 科室
+ 首字母
+
-
-
-
- 药物分类
- 首字母
-
+
+
+
+ 药物分类
+ 首字母
+
-
-
+
+
-{{queryRecord}}
+ {{queryRecord}}
问答结果
@@ -63,12 +63,6 @@
-
-
-