|
|
@ -1,41 +1,36 @@ |
|
|
|
import * as echarts from '../../../../../../ec-canvas/ec-canvas'; |
|
|
|
import api from "../../../../../../utils/api"; |
|
|
|
import * as echarts from '../../../../../../ec-canvas/echarts'; |
|
|
|
import { |
|
|
|
getFamilyRelationshipList |
|
|
|
} from "../../../../../../utils/api"; |
|
|
|
var chart; |
|
|
|
var listdata = []; |
|
|
|
var links = []; |
|
|
|
var legendes = ["手机IMSI", "人脸ID", "车牌号码", "人脸ID"]; |
|
|
|
var texts = []; |
|
|
|
// function initChart(canvas, width, height, dpr) {
|
|
|
|
// chart = echarts.init(canvas, null, {
|
|
|
|
// width: width,
|
|
|
|
// height: height,
|
|
|
|
// devicePixelRatio: dpr // 像素比
|
|
|
|
// });
|
|
|
|
// canvas.setChart(chart);
|
|
|
|
|
|
|
|
|
|
|
|
// return chart;
|
|
|
|
// }
|
|
|
|
|
|
|
|
const formatNumber = n => { |
|
|
|
n = n.toString() |
|
|
|
return n[1] ? n : '0' + n |
|
|
|
} |
|
|
|
Component({ |
|
|
|
properties: { |
|
|
|
resid: { |
|
|
|
resiId: { |
|
|
|
type: String, |
|
|
|
value: '', |
|
|
|
observer(val) { |
|
|
|
this.getData() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
data: { |
|
|
|
ec: { |
|
|
|
lazyLoad: true |
|
|
|
// onInit: initChart
|
|
|
|
}, |
|
|
|
tabList: [{ |
|
|
|
label: "问题突出类别", |
|
|
|
value: 1 |
|
|
|
}, { |
|
|
|
label: '行业领域分析', |
|
|
|
value: 2 |
|
|
|
}], |
|
|
|
tabValue: 1 |
|
|
|
}, |
|
|
|
|
|
|
|
lifetimes: { |
|
|
|
ready() { |
|
|
|
console.log(this.data.resid); |
|
|
|
this.getData() |
|
|
|
} |
|
|
|
}, |
|
|
@ -43,217 +38,104 @@ Component({ |
|
|
|
|
|
|
|
getData() { |
|
|
|
this.selectComponent('#hotlineComplaints').init((canvas, width, height, dpr) => { |
|
|
|
// chart = echarts.init(canvas, null, {
|
|
|
|
// width: width,
|
|
|
|
// height: height,
|
|
|
|
// devicePixelRatio: dpr // 像素比
|
|
|
|
// });
|
|
|
|
// canvas.setChart(chart);
|
|
|
|
chart = echarts.init(canvas, null, { |
|
|
|
width: width, |
|
|
|
height: height, |
|
|
|
devicePixelRatio: dpr // 像素比
|
|
|
|
}); |
|
|
|
canvas.setChart(chart); |
|
|
|
let params = { |
|
|
|
type: 0, |
|
|
|
resid: this.data.resiId |
|
|
|
type: "0", |
|
|
|
id: this.data.resiId |
|
|
|
} |
|
|
|
api.getFamilyRelationshipList(params).then(({ |
|
|
|
|
|
|
|
getFamilyRelationshipList(params).then(({ |
|
|
|
data |
|
|
|
}) => { |
|
|
|
console.log(data); |
|
|
|
var phoneNum = { |
|
|
|
"手机号:13856978256": "13856978256", |
|
|
|
"手机号:13998745632": "13998745632", |
|
|
|
"手机号:18812345678": "18812345678", |
|
|
|
"手机号:16812345678": "16812345678", |
|
|
|
"手机号:13856971111": "13856978256", |
|
|
|
"手机号:13998742222": "13998745632", |
|
|
|
"手机号:18812344444": "18812345678", |
|
|
|
"手机号:16812343333": "16812345678", |
|
|
|
"手机号:13878978256": "13856978256", |
|
|
|
"手机号:137895632": "13998745632", |
|
|
|
}; |
|
|
|
|
|
|
|
var phoneIMSI = ["次数:1,匹配度:6%", "次数:3,匹配度:30%", "次数:2,匹配度:26%", |
|
|
|
"次数:2,匹配度:26%", "次数:2,匹配度:26%", "次数:2,匹配度:26%", |
|
|
|
"匹配手机号码", "匹配手机号码", "匹配手机号码", "匹配手机号码" |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
var carNum = { |
|
|
|
"车牌号码:豫AJ9685": "豫AJ9685", |
|
|
|
"车牌号码:豫AG5123": "豫AG5123", |
|
|
|
"车牌号码:豫AG6822": "豫AG6822", |
|
|
|
"车牌号码:豫CJ9685": "豫AJ9685", |
|
|
|
"车牌号码:豫AD5123": "豫AG5123", |
|
|
|
"车牌号码:豫AT6822": "豫AG6822", |
|
|
|
"车牌号码:豫AG6622": "豫AG6822", |
|
|
|
"车牌号码:豫CJ9885": "豫AJ9685", |
|
|
|
} |
|
|
|
const relationShipCar = ["匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码", "匹配车牌号码"] |
|
|
|
this.setDataPhone(phoneNum, 0); |
|
|
|
this.setDataCar(carNum, 2); |
|
|
|
this.setDataPerson(mainRelationShip, 3); |
|
|
|
this.setLinkData(phoneNum, phoneIMSI, legendes[3]); |
|
|
|
this.setLinkData(carNum, relationShipCar, legendes[3]); |
|
|
|
let option = { |
|
|
|
title: { |
|
|
|
text: "关系图绑定点击事件", |
|
|
|
top: "top", |
|
|
|
left: "left", |
|
|
|
textStyle: { |
|
|
|
color: '#000000' |
|
|
|
} |
|
|
|
let resiName = data.filter(item=>item.id === this.data.resiId)[0].name |
|
|
|
let nodeList = data.map((item, index) => ({ |
|
|
|
'name': item.name, |
|
|
|
'id':index+1, |
|
|
|
'category':0, |
|
|
|
'symbolSize': item.id == this.data.resiId ? 50 : 30, |
|
|
|
'symbol':item.type == 1?'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/a6cdfe6f699040f58fd8b2c10486b41d.png': item.houseHolderRel == '丈夫' ? 'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/1e21790833b04e9abe61e2a8f40446cb.png' : 'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/1e21790833b04e9abe61e2a8f40446cb.png', |
|
|
|
// 'data': {
|
|
|
|
// id: item.id,
|
|
|
|
// type: item.type,
|
|
|
|
// name: item.name
|
|
|
|
// },
|
|
|
|
})) |
|
|
|
let links = data.map((item, index) => ({ |
|
|
|
"source": 0, |
|
|
|
"target": index+1, |
|
|
|
"name": item.houseHolderRel||'暂不清楚', |
|
|
|
"label": { |
|
|
|
"align": "center", |
|
|
|
"fontSize": 12 |
|
|
|
}, |
|
|
|
tooltip: { |
|
|
|
formatter: '{b}' |
|
|
|
"lineStyle": { |
|
|
|
"color": "#ff7d18" |
|
|
|
} |
|
|
|
})) |
|
|
|
links.splice(links.length-1,1) |
|
|
|
let categories = data.map((item, index) => ({ |
|
|
|
"name":item.houseHolderRel||'暂不清楚', |
|
|
|
"id":index+1, |
|
|
|
"itemStyle": { |
|
|
|
"color": 'red' |
|
|
|
}, |
|
|
|
"lineStyle": { |
|
|
|
"color": "#ff7d18" |
|
|
|
} |
|
|
|
})) |
|
|
|
console.log(nodeList,links,categories); |
|
|
|
console.log(JSON.stringify(nodeList)); |
|
|
|
console.log(JSON.stringify(links)); |
|
|
|
console.log(JSON.stringify(categories)); |
|
|
|
|
|
|
|
backgroundColor: '#f7f7f7', |
|
|
|
legend: { |
|
|
|
data: legendes, |
|
|
|
textStyle: { |
|
|
|
color: '#000000' |
|
|
|
}, |
|
|
|
icon: 'circle', |
|
|
|
type: 'scroll', |
|
|
|
orient: 'vertical', |
|
|
|
left: 10, |
|
|
|
top: 20, |
|
|
|
bottom: 20, |
|
|
|
itemWidth: 10, |
|
|
|
itemHeight: 10 |
|
|
|
}, |
|
|
|
animationDuration: 1000, |
|
|
|
animationEasingUpdate: 'quinticInOut', |
|
|
|
var option = { |
|
|
|
|
|
|
|
legend: [{ |
|
|
|
// selectedMode: 'single',
|
|
|
|
// icon: 'circle'
|
|
|
|
show: false |
|
|
|
}], |
|
|
|
series: [{ |
|
|
|
type: 'graph', |
|
|
|
layout: 'force', |
|
|
|
force: { |
|
|
|
repulsion: 80, |
|
|
|
gravity: 0, |
|
|
|
edgeLength: 150, |
|
|
|
layoutAnimation: true, |
|
|
|
}, |
|
|
|
data: listdata, |
|
|
|
links: links, |
|
|
|
categories: texts, |
|
|
|
symbolSize: 10, |
|
|
|
draggable: true, |
|
|
|
roam: false, |
|
|
|
nodeScaleRatio: 0, |
|
|
|
focusNodeAdjacency: false, |
|
|
|
lineStyle: { |
|
|
|
normal: { |
|
|
|
opacity: 0.5, |
|
|
|
width: 1.5, |
|
|
|
curveness: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
label: { |
|
|
|
normal: { |
|
|
|
show: true, |
|
|
|
position: 'inside', |
|
|
|
textStyle: { |
|
|
|
color: '#000000', |
|
|
|
fontWeight: 'normal', |
|
|
|
fontSize: "12" //字体大小
|
|
|
|
}, |
|
|
|
formatter: function (params) { |
|
|
|
return params.data.showName |
|
|
|
}, |
|
|
|
fontSize: 18, |
|
|
|
fontStyle: '600', |
|
|
|
} |
|
|
|
}, |
|
|
|
categories: categories, |
|
|
|
edgeSymbol: ['', 'arrow'], |
|
|
|
// edgeSymbolSize: [80, 10],
|
|
|
|
edgeLabel: { |
|
|
|
normal: { |
|
|
|
show: true, |
|
|
|
textStyle: { |
|
|
|
fontSize: 12 |
|
|
|
fontSize: 20 |
|
|
|
}, |
|
|
|
formatter: "{c}" |
|
|
|
formatter(x) { |
|
|
|
return x.data.name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}], |
|
|
|
color: ['#e8b842', '#41b1ef', '#667aed', '#347fbb', '#772cdc', |
|
|
|
'#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0' |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
label: { |
|
|
|
show: true |
|
|
|
}, |
|
|
|
force: { |
|
|
|
repulsion: 2000, |
|
|
|
edgeLength: 120 |
|
|
|
}, |
|
|
|
data: nodeList, |
|
|
|
links: links |
|
|
|
}] |
|
|
|
}; |
|
|
|
chart.setOption(option); |
|
|
|
}) |
|
|
|
return chart; |
|
|
|
}); |
|
|
|
}, |
|
|
|
setDataPhone(json, n) { |
|
|
|
var i = 0; |
|
|
|
for (var p in json) { |
|
|
|
listdata.push({ |
|
|
|
x: i * 50, |
|
|
|
y: size + i * 10, |
|
|
|
"name": p, |
|
|
|
"showName": json[p], |
|
|
|
"symbol": 'image://' + "/asset/get/s/data-1561621386236-0IGCc48l6.png", |
|
|
|
"symbolSize": size, |
|
|
|
"category": n, |
|
|
|
"draggable": "false", |
|
|
|
formatter: function (params) { |
|
|
|
return params.data.showName |
|
|
|
}, |
|
|
|
label: { |
|
|
|
position: 'bottom' |
|
|
|
} |
|
|
|
}); |
|
|
|
i++; |
|
|
|
} |
|
|
|
}, |
|
|
|
setDataCar(json, n) { |
|
|
|
var i = 0; |
|
|
|
for (var p in json) { |
|
|
|
listdata.push({ |
|
|
|
x: i * 50, |
|
|
|
y: size + i * 10, |
|
|
|
"name": p, |
|
|
|
"showName": json[p], |
|
|
|
"symbol": 'image://' + "/asset/get/s/data-1561621379686-rZHoryrBV.png", |
|
|
|
"symbolSize": size, |
|
|
|
"category": n, |
|
|
|
"draggable": "false", |
|
|
|
formatter: function (params) { |
|
|
|
return params.data.showName |
|
|
|
}, |
|
|
|
label: { |
|
|
|
position: 'bottom' |
|
|
|
} |
|
|
|
}); |
|
|
|
i++; |
|
|
|
} |
|
|
|
}, |
|
|
|
setLinkData(json, relarr, title) { |
|
|
|
if (relarr !== "") { |
|
|
|
var i = 0; |
|
|
|
for (var p in json) { |
|
|
|
links.push({ |
|
|
|
"source": p, |
|
|
|
"target": title, |
|
|
|
"value": relarr[i], |
|
|
|
lineStyle: { |
|
|
|
normal: { |
|
|
|
// text: relarr[i],
|
|
|
|
color: 'source' |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
i++; |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (var p2 in json) { |
|
|
|
links.push({ |
|
|
|
"source": p2, |
|
|
|
"target": title, |
|
|
|
"value": "", |
|
|
|
lineStyle: { |
|
|
|
normal: { |
|
|
|
color: 'source' |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |