Browse Source

all

yangrongze
hanyuqing 3 months ago
parent
commit
04bc718b73
  1. 4
      controller/LoginController.py
  2. 0
      python/app.py
  3. 0
      python/config.py
  4. 0
      python/icd10_skipped_records.xlsx
  5. 0
      python/icd10_tree_preserve_order.json
  6. 0
      python/icd10_tree_with_level.json
  7. 0
      python/icd_parse.py
  8. 0
      python/icd_parse_name.py
  9. 0
      python/import.py
  10. 0
      python/parse_data.py
  11. 0
      python/test.py
  12. 8
      python/test1.py
  13. 0
      python/test1222.py
  14. 1
      python/web_main.py
  15. 2
      util/mysql_utils.py
  16. 7
      vue/src/api/graph.js
  17. 6
      vue/src/api/login.js
  18. 6
      vue/src/api/profile.js
  19. 33
      vue/src/system/GraphDemo.vue
  20. 2
      vue/src/system/Login.vue
  21. 40
      vue/vue.config.js

4
controller/LoginController.py

@ -1,10 +1,8 @@
from robyn import jsonify, Response
from app import app
from python.app import app
from datetime import datetime, timedelta
import uuid
import json
import os
import base64
from service.UserService import user_service
# 临时存储token,用于会话管理

0
app.py → python/app.py

0
config.py → python/config.py

0
icd10_skipped_records.xlsx → python/icd10_skipped_records.xlsx

0
icd10_tree_preserve_order.json → python/icd10_tree_preserve_order.json

0
icd10_tree_with_level.json → python/icd10_tree_with_level.json

0
icd_parse.py → python/icd_parse.py

0
icd_parse_name.py → python/icd_parse_name.py

0
import.py → python/import.py

0
parse_data.py → python/parse_data.py

0
test.py → python/test.py

8
test1.py → python/test1.py

@ -1,6 +1,6 @@
from datetime import datetime
from app import app
import robyn
from robyn import Robyn, jsonify, Response
from typing import Optional, List, Any, Dict
from util.neo4j_utils import Neo4jUtil
@ -127,8 +127,8 @@ def build_g6_subgraph_by_props(
relationships = neighbor_list # 结构已兼容
return build_g6_graph_data_from_results(nodes, relationships)
@app.get("/getData")
print("✅ test1 已导入,路由应已注册")
@app.get("/api/getData")
def get_data():
try:
graph_data = build_g6_subgraph_by_props(
@ -148,7 +148,7 @@ def get_data():
return jsonify({"error": str(e)}), 500
@app.post("/getGraph")
@app.post("/api/getGraph")
def get_graph(req):
try:

0
test1222.py → python/test1222.py

1
web_main.py → python/web_main.py

@ -1,5 +1,6 @@
from app import app
import controller.LoginController
import test1 # 👈 关键:导入 test1,触发 @app.get("/getData") 执行
from service.UserService import init_mysql_connection
import os

2
util/mysql_utils.py

@ -1,6 +1,6 @@
import pymysql
from typing import List, Dict, Any
from config import MYSQL_CONFIG
from python.config import MYSQL_CONFIG
class MySQLClient:
"""MySQL客户端类"""

7
vue/src/api/graph.js

@ -8,17 +8,16 @@ import request from '@/utils/request';
*/
export function getTestGraphData() {
return request({
url: '/getData',
url: '/api/getData',
method: 'get'
// 注意:不传 params!因为后端不接收也不需要
});
}
export function getGraph(data) {
return request({
url: '/getGraph',
url: '/api/getGraph',
method: 'post',
data
// 注意:不传 params!因为后端不接收也不需要
});
}

6
vue/src/api/login.js

@ -11,7 +11,7 @@ import request from '@/utils/request';
*/
export function login(data) {
return request({
url: '/login',
url: '/api/login',
method: 'post',
data
});
@ -23,7 +23,7 @@ export function login(data) {
*/
export function logout() {
return request({
url: '/logout',
url: '/api/logout',
method: 'post'
});
}
@ -34,7 +34,7 @@ export function logout() {
*/
export function getUserInfo() {
return request({
url: '/userInfo',
url: '/api/userInfo',
method: 'get'
});
}

6
vue/src/api/profile.js

@ -8,7 +8,7 @@ import request from '@/utils/request';
*/
export function getUserProfile(token) {
return request({
url: '/userInfo',
url: '/api/userInfo',
method: 'get',
params: {
token
@ -23,7 +23,7 @@ export function getUserProfile(token) {
*/
export function updateAvatar(formData) {
return request({
url: '/updateAvatar',
url: '/api/updateAvatar',
method: 'post',
data: formData,
headers: {
@ -39,7 +39,7 @@ export function updateAvatar(formData) {
*/
export function updatePassword(data) {
return request({
url: '/updatePassword',
url: '/api/updatePassword',
method: 'post',
data
});

33
vue/src/system/GraphDemo.vue

@ -152,7 +152,7 @@
<el-radio value="Check">检查</el-radio>
</el-radio-group>
</div>
<div v-if="typeRadio='Disease'">
<div v-if="typeRadio === 'Disease'">
<el-tree
:data="treeData"
:props="treeProps"
@ -170,7 +170,6 @@
</template>
</el-tree>
</div>
</div>
<!-- 图谱容器 -->
<div ref="graphContainer" class="graph-container" id="container"></div>
@ -504,26 +503,26 @@ export default {
},
edge: {
style: {
labelText: (d) => d.data.relationship.type,
labelText: (d) => d.data.relationship.properties.label,
stroke: (d) => {
// target label
const targetLabel = this._nodeLabelMap.get(d.target); // d.target ID
// target
if (targetLabel === 'Disease') return '#f8d2d2';
if (targetLabel === 'Drug') return '#c0efe2';
if (targetLabel === 'Symptom') return '#f5cebf';
return '#c9d3ee'; // default
if (targetLabel === 'Disease') return 'rgba(239,68,68,0.5)';
if (targetLabel === 'Drug') return 'rgba(145,204,117,0.5)';
if (targetLabel === 'Symptom') return 'rgba(250,200,88,0.5)';
return 'rgba(51,110,238,0.5)'; // default
},
labelFill: (d) => {
// target label
const targetLabel = this._nodeLabelMap.get(d.target); // d.target ID
// target
if (targetLabel === 'Disease') return '#ff4444';
if (targetLabel === 'Drug') return '#2f9b70';
if (targetLabel === 'Symptom') return '#f89775';
return '#6b91ff'; // default
}
// labelFill: (d) => {
// // target label
// const targetLabel = this._nodeLabelMap.get(d.target); // d.target ID
// // target
//
// if (targetLabel === 'Disease') return '#ff4444';
// if (targetLabel === 'Drug') return '#2f9b70';
// if (targetLabel === 'Symptom') return '#f89775';
// return '#6b91ff'; // default
// }
},
state: {

2
vue/src/system/Login.vue

@ -141,7 +141,7 @@ const handleLogin = async () => {
}
// index
router.push('/index');
router.push('/kg-display');
} catch (error) {
//

40
vue/vue.config.js

@ -11,44 +11,10 @@ module.exports = defineConfig({
port: 81,
open: true,
proxy: {
'/login': {
target: 'http://localhost:8088', // 更新为8088端口
'/api': {
target: 'http://localhost:8088',
changeOrigin: true,
pathRewrite: {
'^/login': '/api/login'
}
},
'/logout': {
target: 'http://localhost:8088', // 更新为8088端口
changeOrigin: true,
pathRewrite: {
'^/logout': '/api/logout'
}
},
'/userInfo': {
target: 'http://localhost:8088', // 更新为8088端口
changeOrigin: true,
pathRewrite: {
'^/userInfo': '/api/userInfo'
}
},
'/updateAvatar': {
target: 'http://localhost:8088', // 更新为8088端口
changeOrigin: true,
pathRewrite: {
'^/updateAvatar': '/api/updateAvatar'
}
},
'/updatePassword': {
target: 'http://localhost:8088', // 更新为8088端口
changeOrigin: true,
pathRewrite: {
'^/updatePassword': '/api/updatePassword'
}
},
'/resource': {
target: 'http://localhost:8088', // 更新为8088端口
changeOrigin: true
// 不需要 pathRewrite,因为前后都是 /api/xxx
}
},
historyApiFallback: {

Loading…
Cancel
Save