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

1204

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