新增关联页面

This commit is contained in:
2023-07-13 10:12:31 +08:00
parent ee0013fc18
commit 8cd092c4fd
13 changed files with 324 additions and 157 deletions

View File

@@ -20,13 +20,13 @@
<label>查询中</label>
</div>
<el-form-item :label="item.comment" v-for="item in infoList" :key="item.field">
<el-input v-model="item.value"></el-input>
<el-input v-model="item.value" disabled></el-input>
</el-form-item>
</el-form>
<div class="btn-box">
<el-button type="danger" @click="removeItem" v-show="editFlag"> </el-button>
<el-button type="primary" @click="submitUpdate"> </el-button>
</div>
<!-- <div class="btn-box">-->
<!-- <el-button type="danger" @click="removeItem" v-show="editFlag"> </el-button>-->
<!-- <el-button type="primary" @click="submitUpdate"> </el-button>-->
<!-- </div>-->
</div>
</template>
@@ -96,7 +96,9 @@ export default {
method: 'get',
data: {}
}).then(res => {
vm.form[comment] = getFirstStringProperty(res.data.properties);
// vm.form[comment] = getFirstStringProperty(res.data.properties);
vm.form[comment] = vid;
});
},
queryEdgeDetail(edgeType, srcVid, dstVid) {
@@ -141,7 +143,8 @@ export default {
let _infoList = [];
Reflect.ownKeys(properties).forEach(key => {
_infoList.push({
comment: map[key],
// comment: map[key],
comment: key,
field: key,
value: properties[key]
});

View File

@@ -258,7 +258,7 @@ var _ = require('lodash');
var nodeProps = {
id: 'vid',
label: 'properties.label',
name: 'properties.tagName',
name: 'vid',
labelName: 'properties.label'
};
var edgeProps = {
@@ -873,6 +873,7 @@ function resolveGraphData(data) {
Reflect.ownKeys(nodeProps).forEach(key => {
node[key] = _.get(node, nodeProps[key], '');
});
console.log(node);
});
data.relations.forEach(edge => {
Reflect.ownKeys(edgeProps).forEach(key => {

View File

@@ -5,7 +5,7 @@
<div class="graph-info-child">
<div class="info-item" style="margin-bottom: 15px">
<div class="info-item-title">
<label>{{comment}}</label>
<label>{{ comment }}</label>
<!--<div class="add-attribute-box" style="float: right" @click="showAddGraphSpaceDialog({Name:''})">新建-->
<!--</div>-->
<!--<div class="add-attribute-box" style="float: right;margin-right: 10px" @click="removeGraphSpace()">-->
@@ -20,7 +20,7 @@
<!--:value="item.name">-->
<!--</el-option>-->
<!--</el-select>-->
<div style="margin-top: 20px;font-size: 14px;color: #606266">本体名称:{{ontologyName}}</div>
<div style="margin-top: 20px;font-size: 14px;color: #606266">本体名称:{{ ontologyName }}</div>
</div>
</div>
<el-tabs v-model="activeTab" class="el-tabs-item">
@@ -36,7 +36,7 @@
<template slot-scope="scope">
<div :style="scope.row.Name === activeSelectType ? 'color: #409EFF':''">
<label>{{ scope.row.comment }}</label>
<label>({{ scope.row.count }})</label>
<!-- <label>({{ scope.row.count }})</label>-->
</div>
</template>
</el-table-column>
@@ -55,7 +55,7 @@
<template slot-scope="scope">
<div :style="scope.row.Name === activeSelectType ? 'color: #409EFF':''">
<label>{{ scope.row.comment }}</label>
<label>({{ scope.row.count }})</label>
<!-- <label>({{ scope.row.count }})</label>-->
</div>
</template>
</el-table-column>
@@ -79,6 +79,9 @@
<div v-show="tabModifyCmdType === 'nodeDetail'">
<node-detail ref="nodeDetail"></node-detail>
</div>
<div v-show="tabModifyCmdType === 'edgeDetail'">
<edge-detail ref="edgeDetail"></edge-detail>
</div>
<div v-show="tabModifyCmdType === 'edgeAdd'">
<edge-add ref="edgeAdd"></edge-add>
</div>
@@ -92,7 +95,8 @@
<div v-if="showFlag" style="display: inline-block;margin-right: 50px">
<el-input placeholder="请输入关键词" v-model="keyword" style="width: 550px">
<el-select v-model="searchTag" slot="prepend" placeholder="请选择概念" style="width: 150px" filterable>
<el-option :label="item.comment" :value="item.Name" v-for="(item,index) in tagList" v-if="index != 0"></el-option>
<el-option :label="item.comment" :value="item.Name" v-for="(item,index) in tagList"
v-if="index != 0"></el-option>
</el-select>
<el-button slot="append" icon="el-icon-search" @click="searchBtn()"></el-button>
</el-input>
@@ -212,7 +216,7 @@ export default {
'node-detail': nodeDetail,
'edge-detail': edgeDetail,
'graph-space-add': graphSpaceAdd,
'edge-add':edgeAdd
'edge-add': edgeAdd
},
data() {
return {
@@ -233,15 +237,15 @@ export default {
},
tagMap: {},
edgeMap: {},
ontologyName:"",
showFlag:false,
keyword:"",
searchTag:"",
ontologyId:"",
comment:"",
qo:{
pageNo:"",
name:""
ontologyName: "",
showFlag: false,
keyword: "",
searchTag: "",
ontologyId: "",
comment: "",
qo: {
pageNo: "",
name: ""
}
}
},
@@ -271,7 +275,7 @@ export default {
if (res.data.length > 0) {
vm.space = res.data[0].name;
vm.handleSpaceChange();
}else{
} else {
vm.space = "";
vm.tagMap = {};
vm.edgeMap = {};
@@ -282,7 +286,7 @@ export default {
}
});
},
queryOntologyDetail(){
queryOntologyDetail() {
var id = vm.ontologyId;
// vm.spaceList.forEach(item => {
// if(item.name == vm.space){
@@ -290,11 +294,11 @@ export default {
// }
// })
if(id){
if (id) {
request({
url: `/ontology/getone/`+id,
url: `/ontology/getone/` + id,
method: 'post',
data: {id:id}
data: {id: id}
}).then(res => {
vm.ontologyName = res.data.name;
})
@@ -342,10 +346,10 @@ export default {
method: 'get',
data: {}
}).then(res => {
res.data.unshift({
Name: `All`,
comment: '实体数'
});
// res.data.unshift({
// Name: `All`,
// comment: '实体数'
// });
res.data.forEach(row => {
row.count = vm.tagMap[row.Name] ? vm.tagMap[row.Name] : 0;
});
@@ -359,10 +363,10 @@ export default {
method: 'get',
data: {}
}).then(res => {
res.data.unshift({
Name: `All`,
comment: '三元组数'
});
// res.data.unshift({
// Name: `All`,
// comment: '三元组数'
// });
res.data.forEach(row => {
row.count = vm.edgeMap[row.Name] ? vm.edgeMap[row.Name] : 0;
});
@@ -405,6 +409,7 @@ export default {
queryDetail(type, obj) { // type : node/edge
vm.tabModifyCmdType = type + 'Detail';
vm.propsInfoVisible = true;
console.log(type);
vm.$nextTick(() => {
vm.$refs[type + 'Detail'].queryDetail(vm.space, obj);
});
@@ -478,8 +483,17 @@ export default {
});
if (node.properties) {
node.label = node.name = getFirstStringProperty(node.properties);
// node.label = node.name = getFirstStringProperty(node.properties);
node.label = node.name = node.vid;
}
if(node.labels === 'tag_1412011336') {
node.style = {
fill: '#8fe8e8'
}
}
});
}
@@ -603,7 +617,7 @@ export default {
vm.$refs['nodeDetail'].createItem(vm.space);
});
},
showAddEdgeDialog(){
showAddEdgeDialog() {
vm.tabModifyCmdType = 'edgeAdd';
vm.propsInfoVisible = true;
vm.$nextTick(() => {
@@ -611,12 +625,12 @@ export default {
});
},
//搜索
searchBtn(){
if(!vm.searchTag){
searchBtn() {
if (!vm.searchTag) {
vm.$message.warning("请选择概念");
return false;
}
if(!vm.keyword){
if (!vm.keyword) {
vm.$message.warning("请输入关键字");
return false;
}
@@ -624,7 +638,7 @@ export default {
request({
url: `/nebula_operate/findnodebykeyword/${vm.space}/${vm.searchTag}`,
method: 'post',
data: {keyword:vm.keyword}
data: {keyword: vm.keyword}
}).then(res => {
if (res.data) {
res.data.forEach(node => {
@@ -649,7 +663,7 @@ export default {
vm.graphLoading = false;
});
},
findOnePathBySrcidAndDctid(srcId, dstId){
findOnePathBySrcidAndDctid(srcId, dstId) {
request({
url: `/nebula_operate/findonepathbysrcidanddctid/${vm.space}/${srcId}/${dstId}`,
method: 'get',
@@ -658,7 +672,7 @@ export default {
vm.resolveGraphData(res);
});
},
findNodeById(tag,vid){
findNodeById(tag, vid) {
request({
url: `/nebula_operate/findnodebyid/${vm.space}/${tag}/${vid}`,
method: 'get',

View File

@@ -7,10 +7,10 @@
<div>
<el-form :inline="true" :model="qo" class="demo-form-inline">
<el-form-item>
<el-input v-model="qo.LIKES_categories" placeholder="请输入种类"></el-input>
<el-input v-model="qo.LIKES_categories" placeholder="请输入种类" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="qo.LIKES_labels" placeholder="请输入标签"></el-input>
<el-input v-model="qo.LIKES_labels" placeholder="请输入标签" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qo.pageNo=1;queryData()"> </el-button>

View File

@@ -7,7 +7,7 @@
<div>
<el-form :inline="true" :model="qo" class="demo-form-inline">
<el-form-item>
<el-input v-model="qo.LIKES_name" placeholder="请输入名称"></el-input>
<el-input v-model="qo.LIKES_name" placeholder="请输入名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qo.pageNo=1;queryData()"> </el-button>

View File

@@ -7,7 +7,7 @@
<div>
<el-form :inline="true" :model="qo" class="demo-form-inline">
<el-form-item>
<el-input v-model="qo.LIKES_fid" placeholder="请输入Fid"></el-input>
<el-input v-model="qo.LIKES_fid" placeholder="请输入Fid" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="qo.pageNo=1;queryData()"> </el-button>
@@ -29,8 +29,11 @@
<el-tag v-if="scope.row.labelsArr.length > 5">...</el-tag>
</div>
</el-table-column>
<el-table-column label="操作" width="180">
<el-table-column label="操作" width="240">
<template slot-scope="scope">
<el-button @click.native.prevent="linkUser(scope.row)" type="text" size="small">
关联
</el-button>
<el-button @click.native.prevent="similarUser(scope.row)" type="text" size="small">
相似
</el-button>
@@ -127,6 +130,14 @@ export default {
_this.qo.pageNo = val;
_this.queryData();
},
linkUser(item) {
_this.$router.push({
path: "linkUser", query: {
userId: item.fid,
qo: JSON.stringify(_this.qo)
}
});
},
similarUser(item) {
_this.$router.push({
path: "similarUser", query: {

View File

@@ -105,11 +105,7 @@ export default {
});
},
backBtn() {
this.$router.push({
path: "userManage", query: {
qo: _this.qo
}
});
_this.$router.back();
},
}
}

View File

@@ -0,0 +1,122 @@
<template>
<div>
<div class="menu-title">
关联用户{{ userId }}
<div class="icon icon-back" @click="backBtn">
<i title="返回"></i>
</div>
</div>
<div class="block_box" style="margin-top: 0">
<div class="title">信息</div>
<div>
<el-form label-width="100px">
<el-form-item label="标签">
<template v-for="(tag,index) in user.labelsArr">
<el-tag :key="index">{{ tag }}</el-tag>
</template>
</el-form-item>
</el-form>
</div>
</div>
<div class="block_box">
<div class="title">Association Items</div>
<div>
<el-table :data="list" style="width: 100%">
<el-table-column type="index" label="行号" width="60"></el-table-column>
<el-table-column prop="vid" label="UserId"></el-table-column>
<el-table-column label="操作" width="210">
<template slot-scope="scope">
<el-button @click.native.prevent="recommendItem(scope.row)" type="text" size="small">
洞悉
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import request from '@/utils/request';
var _this;
export default {
name: "linkUser",
data() {
return {
qo: "",
userId: '',
user: {},
list: []
}
},
mounted() {
_this = this;
_this.qo = _this.$route.query.qo;
_this.userId = _this.$route.query.userId;
_this.queryUser();
_this.getLinkUser();
},
methods: {
queryUser() {
request({
url: '/risk-user/query_unique',
method: 'post',
data: {
EQS_fid: _this.userId
}
}).then(res => {
res.data.labelsArr = res.data.labels ? res.data.labels.split(',') : [];
_this.user = res.data;
});
},
getLinkUser() {
let space = 'recom_gorse';
request({
url: `/nebula_operate/findonepathbyidwithrelation/${space}/${_this.userId}`,
method: 'post',
data: {
relations: ['edge_6253525352']
}
}).then(res => {
_this.list = res.data.nodes;
});
},
recommendItem(item) {
_this.$router.push({
path: "recommendItem", query: {
userId: item.vid,
qo: JSON.stringify(_this.qo)
}
});
},
backBtn() {
this.$router.push({
path: "userManage", query: {
qo: _this.qo
}
});
},
}
}
</script>
<style src="../../../css/back.css" scoped></style>
<style scoped lang="scss">
.block_box {
margin: 25px;
background: #FFFFFF;
border-radius: 3px;
.title {
border-bottom: 1px solid #ccc;
padding: 15px 25px;
}
>div {
padding: 25px;
}
}
</style>

View File

@@ -37,6 +37,13 @@
{{scope.row.Score.toFixed(5)}}
</template>
</el-table-column>
<el-table-column label="操作" width="210">
<template slot-scope="scope">
<el-button @click.native.prevent="recommendItem(scope.row)" type="text" size="small">
洞悉
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
@@ -91,6 +98,14 @@ export default {
_this.list = res.data;
});
},
recommendItem(item) {
_this.$router.push({
path: "recommendItem", query: {
userId: item.UserId,
qo: JSON.stringify(_this.qo)
}
});
},
backBtn() {
this.$router.push({
path: "userManage", query: {

View File

@@ -10,6 +10,7 @@ div.icon {
line-height: 50px;
margin-right: 80px;
margin-top: 9px;
padding: 0;
}
div.icon i {

View File

@@ -67,6 +67,10 @@ export default new Router({
path: 'similarUser',
component: () => import('@/components/menus/user/SimilarUser')
},
{
path: 'linkUser',
component: () => import('@/components/menus/user/LinkUser')
},
{
path: 'recommendItem',
component: () => import('@/components/menus/item/RecommendItem')

View File

@@ -5,7 +5,7 @@ import {getToken} from '@/utils/auth'
// var _baseURL = "http://localhost:4026";
var _baseURL = "http://139.9.106.207:4026";
var _fileURL = "http://118.31.22.243:80/web/";
var _fileURL = "http://139.9.106.207:4026/web/";
// create an axios instance
const service = axios.create({
baseURL: _baseURL, // url = base url + request url