提交 9b1df1dd authored 作者: 王腾飞's avatar 王腾飞

1204

上级 1caebe17
...@@ -144,3 +144,11 @@ export function updateDateAttrAPI(data) { //修改(新增)实体自定义属 ...@@ -144,3 +144,11 @@ export function updateDateAttrAPI(data) { //修改(新增)实体自定义属
data data
}) })
} }
export function deleteEchartsEntityAPI(data) { //实体关系图中删除(批量删除)实体
return request({
url: `${requestPath.common}/relation/batch/delete`,
method: 'post',
data
})
}
...@@ -179,6 +179,7 @@ ...@@ -179,6 +179,7 @@
<h2 v-else-if="entityTypeFlag == 3">>地点实体关系</h2> <h2 v-else-if="entityTypeFlag == 3">>地点实体关系</h2>
<h2 v-else-if="entityTypeFlag == 2">>组织机构实体关系</h2> <h2 v-else-if="entityTypeFlag == 2">>组织机构实体关系</h2>
<h2 v-else>>时间实体关系</h2> <h2 v-else>>时间实体关系</h2>
<el-button @click="showDelEntityMark" icon="el-icon-delete" size="mini" type="primary" style="position:absolute; right:0; top:71px">删除实体</el-button>
<div> <div>
<div id="relationChart" style="width:100%; height:100%;"></div> <div id="relationChart" style="width:100%; height:100%;"></div>
</div> </div>
...@@ -193,6 +194,21 @@ ...@@ -193,6 +194,21 @@
</div> </div>
</section> </section>
</div> </div>
<el-dialog title="删除实体" :visible.sync="dialogFormVisible3" @close="closeDiaThr">
<template>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
<el-checkbox v-for="(item, key) in cities" :label="item.id" :key="key">
{{ item.brelationword }}
</el-checkbox>
</el-checkbox-group>
</template>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3 = false">取 消</el-button>
<el-button type="primary" @click="deleteItems">确 定</el-button>
</div>
</el-dialog>
<h2 id="moduleId6">>相关人物</h2> <h2 id="moduleId6">>相关人物</h2>
<div class="relateCharacer"> <div class="relateCharacer">
<section v-for="(item, key) in relatePeopleData" :key="key"> <section v-for="(item, key) in relatePeopleData" :key="key">
...@@ -352,6 +368,7 @@ ...@@ -352,6 +368,7 @@
<script> <script>
import { debounce } from '@/utils' import { debounce } from '@/utils'
import echarts from 'echarts' import echarts from 'echarts'
import { operationMsg, confirm } from '@/utils/publicFunctions'
import { import {
characterDetailAPI, characterDetailAPI,
relateCharacterAPI, relateCharacterAPI,
...@@ -364,6 +381,7 @@ import { ...@@ -364,6 +381,7 @@ import {
organDetailAPI, organDetailAPI,
timerDetailAPI, timerDetailAPI,
updateDateAttrAPI, updateDateAttrAPI,
deleteEchartsEntityAPI
} from '@/api/storagemodule' } from '@/api/storagemodule'
var size = 50; //节点大小 var size = 50; //节点大小
// var listdata = []; //节点数组 // var listdata = []; //节点数组
...@@ -371,35 +389,35 @@ var size = 50; //节点大小 ...@@ -371,35 +389,35 @@ var size = 50; //节点大小
//1 :为人物 2:组织机构 3: 地址 4:时间 //1 :为人物 2:组织机构 3: 地址 4:时间
// var legendes = ["人物", "组织机构",'地址','时间', "对象"]; // var legendes = ["人物", "组织机构",'地址','时间', "对象"];
let relateOptaion={ let relateOptaion={
title: { title: {//标题
text: "", text: "",
top: "top", top: "top",
left: "left", left: "left",
textStyle: { textStyle: {
color: '#000000' color: '#000000'
} }
}, },
tooltip: { tooltip: {
}, },
animationDuration: 1500, animationDuration: 1500,
animationEasingUpdate: 'quinticInOut', animationEasingUpdate: 'quinticInOut',
toolbox: { toolbox: {//还原和下载
show: false, show: false,
feature: { feature: {
restore: { restore: {
show: true show: true
}, },
magicType: { magicType: {
show: true, show: true,
type: ['force', 'chord'] type: ['force', 'chord']
}, },
saveAsImage: { saveAsImage: {
show: true show: true
} }
} }
}, },
backgroundColor: '#fff', backgroundColor: '#fff',
legend: { legend: {//图例
data: [ "对象","人物", "组织机构",'地址','时间',], data: [ "对象","人物", "组织机构",'地址','时间',],
textStyle: { textStyle: {
color: '#000000' color: '#000000'
...@@ -440,9 +458,9 @@ let relateOptaion={ ...@@ -440,9 +458,9 @@ let relateOptaion={
focusNodeAdjacency: true, //是否在鼠标移到节点上的时候突出显示节点以及节点的边和邻接节点。 focusNodeAdjacency: true, //是否在鼠标移到节点上的时候突出显示节点以及节点的边和邻接节点。
lineStyle: { lineStyle: {
normal: { normal: {
// text: relarr[i], // text: relarr[i],
//color: 'source' //color: 'source'
color:'#DCDFE6' color:'#DCDFE6'
} }
}, },
label: { label: {
...@@ -450,9 +468,9 @@ let relateOptaion={ ...@@ -450,9 +468,9 @@ let relateOptaion={
show: true, show: true,
position: 'inside', position: 'inside',
textStyle: { //标签的字体样式 textStyle: { //标签的字体样式
color: '#fff', //字体颜色 color: '#fff', //字体颜色
fontWeight: 'normal', //'normal'标准'bold'粗的'bolder'更粗的'lighter'更细的或100 | 200 | 300 | 400... fontWeight: 'normal', //'normal'标准'bold'粗的'bolder'更粗的'lighter'更细的或100 | 200 | 300 | 400...
fontSize: "12" //字体大小 fontSize: "12" //字体大小
}, },
formatter: function(params) { formatter: function(params) {
return params.data.showName //此处为label转换 并转换颜色 return params.data.showName //此处为label转换 并转换颜色
...@@ -462,22 +480,30 @@ let relateOptaion={ ...@@ -462,22 +480,30 @@ let relateOptaion={
} }
}, },
edgeLabel: { edgeLabel: {
normal: { normal: {
show: true, show: true,
textStyle: { textStyle: {
fontSize: 12 fontSize: 12
}, },
formatter: "{c}" formatter: "{c}"
} }
} }
}], }],
//#c23531#91c7ae#4592ff //#c23531#91c7ae#4592ff
color: ['#c23531', '#91c7ae', '#4592ff','#f8b829','#26f0a5'] //自定义调色板 color: ['#c23531', '#91c7ae', '#4592ff','#f8b829','#26f0a5'] //自定义调色板
}; };
//const cityOptions = ['上海', '北京', '广州', '深圳'];
export default { export default {
name: 'character', name: 'character',
data() { data() {
return { return {
checkAll: false,
checkedCities: [],
cities: [],
isIndeterminate: true,
deleteEntityform: {
id: []
},
options1: [{ options1: [{
value: '选项1', value: '选项1',
label: '黄金糕1' label: '黄金糕1'
...@@ -520,6 +546,7 @@ export default { ...@@ -520,6 +546,7 @@ export default {
dialogFormVisible: false, dialogFormVisible: false,
dialogFormVisible1: false, dialogFormVisible1: false,
dialogFormVisible2: false, dialogFormVisible2: false,
dialogFormVisible3: false,
formLabelWidth: '82px', formLabelWidth: '82px',
dynamicValidateForm: { dynamicValidateForm: {
domains: [{ domains: [{
...@@ -637,6 +664,7 @@ export default { ...@@ -637,6 +664,7 @@ export default {
localtionDetailAPI(this.entityId) localtionDetailAPI(this.entityId)
.then(res => { .then(res => {
if (res.data.code === 0) { if (res.data.code === 0) {
console.log(this.entityId, '12311')
_this.characterDetailData = res.data.data; _this.characterDetailData = res.data.data;
_this.filedJosnArr = JSON.parse(res.data.data.fieldJson) || []; _this.filedJosnArr = JSON.parse(res.data.data.fieldJson) || [];
_this.peopleName = res.data.data.keyword; _this.peopleName = res.data.data.keyword;
...@@ -858,6 +886,7 @@ export default { ...@@ -858,6 +886,7 @@ export default {
//{name: "工程建设情况", showName: "工程建设情况", symbolSize: 50, category: 0}, //{name: "工程建设情况", showName: "工程建设情况", symbolSize: 50, category: 0},
if(res.data.code===0){ if(res.data.code===0){
let resData=res.data.data; let resData=res.data.data;
this.cities = res.data.data;
if (resData.length != 0) { if (resData.length != 0) {
let data=[ let data=[
{ {
...@@ -865,7 +894,8 @@ export default { ...@@ -865,7 +894,8 @@ export default {
showName: resData[0]['relationword'], showName: resData[0]['relationword'],
category: 0, category: 0,
entityTypeFlag: resData[0].state, entityTypeFlag: resData[0].state,
entityId: resData[0].bripid entityId: resData[0].rtpid,
dataType: 'node'
} }
]; ];
let links=[]; let links=[];
...@@ -876,9 +906,10 @@ export default { ...@@ -876,9 +906,10 @@ export default {
showName:list.brelationword , showName:list.brelationword ,
category: state, category: state,
entityTypeFlag: list.state, entityTypeFlag: list.state,
entityId: list.bripid entityId: list.bripid,
dataType: 'node'
}) })
links.push({source:resData[0]['relationword'], target: list.brelationword, value: list.relation}) links.push({source:resData[0]['relationword'], target: list.brelationword, value: list.relation, dataType: 'link'})
}) })
relateOptaion.series[0]['data']=data; relateOptaion.series[0]['data']=data;
relateOptaion.series[0]['links']=links; relateOptaion.series[0]['links']=links;
...@@ -914,18 +945,27 @@ export default { ...@@ -914,18 +945,27 @@ export default {
var _this = this; var _this = this;
this.relationChart.on('click', function (params) { this.relationChart.on('click', function (params) {
console.log(params.data, "小红真美")//获取点击的头像的数据信息 console.log(params.data, "小红真美")//获取点击的头像的数据信息
window.scrollTo(0, 0) if (params.data.dataType == 'node') {
_this.entityTypeFlag = params.data.entityTypeFlag; window.scrollTo(0, 0)
_this.entityId = params.data.entityId; _this.entityTypeFlag = params.data.entityTypeFlag;
_this.peopleName = params.data.name; _this.entityId = params.data.entityId;
_this.getDetailAPI(); _this.peopleName = params.data.name;
_this.getRelateCharacterAPI(); console.log(_this.entityId, '6666')
_this.getRelateOrganAPI(); _this.getDetailAPI();
_this.getRelateAreaAPI(); _this.getRelateCharacterAPI();
_this.getRelateResourceListAPI(); _this.getRelateOrganAPI();
_this.getKeyWordsRelation(); _this.getRelateAreaAPI();
_this.drawLine(); _this.getRelateResourceListAPI();
_this.getKeyWordsRelation();
_this.drawLine();
} else {
_this.dialogFormVisible2 = true;
}
}); });
// document.oncontextmenu = function () { return false; };
// this.relationChart.on('contextmenu', function(params) {
// alert(11111)
// })
}, },
addNewDataAttr() { addNewDataAttr() {
this.dialogFormVisible = true; this.dialogFormVisible = true;
...@@ -986,6 +1026,54 @@ export default { ...@@ -986,6 +1026,54 @@ export default {
sureSetting() { sureSetting() {
this.dialogFormVisible1 = false this.dialogFormVisible1 = false
this.dialogFormVisible2 = true this.dialogFormVisible2 = true
},
showDelEntityMark() {
this.dialogFormVisible3 = true
},
handleCheckAllChange(val) {
var _this = this;
if (val === true) {
this.cities.map((item, index) => {
_this.checkedCities.push(item.id);
_this.deleteEntityform.id.push(item.id)
console.log(_this.checkedCities, '我是所有id')
this.isIndeterminate = false;
})
} else {
this.checkedCities = []
this.isIndeterminate = true;
}
//this.checkedCities = val ? this.cities : [];
},
handleCheckedCitiesChange(value) {
console.log(value, '666')
this.deleteEntityform.id = value;
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
},
deleteItems() {
//this.dialogFormVisible3 = false
confirm.apply(this, ['确认删除当前选中的实体吗?'])
.then(() => {
deleteEchartsEntityAPI(this.deleteEntityform)
.then(res => {
console.log(res)
if (res.data.code === 0) {
this.$message.success('删除成功');
this.getKeyWordsRelation();
this.dialogFormVisible3 = false;
} else {
this.$message.error('删除失败');
}
})
})
},
closeDiaThr() {
this.checkedCities = [];
//this.isIndeterminate = true;//true 没有√,false有√
} }
} }
} }
...@@ -1104,6 +1192,7 @@ export default { ...@@ -1104,6 +1192,7 @@ export default {
flex:1; flex:1;
&:nth-of-type(1) { &:nth-of-type(1) {
margin-right:24px; margin-right:24px;
position:relative;
} }
&:nth-of-type(2) { &:nth-of-type(2) {
margin-left:24px; margin-left:24px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论