Browse Source

居民图谱

work_tab_bar
mk 2 years ago
parent
commit
7a89db08ad
  1. BIN
      images/mine/avater.png
  2. BIN
      images/work/card.png
  3. BIN
      images/work/center.png
  4. BIN
      images/work/sqmp.png
  5. 6
      pages/work/work.wxml
  6. 83
      subpages/searchResult/pages/resiInfo/component/graph/graph.js
  7. 13
      subpages/searchResult/pages/resiInfo/component/graph/graph.wxss

BIN
images/mine/avater.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/work/card.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

BIN
images/work/center.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

BIN
images/work/sqmp.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

6
pages/work/work.wxml

@ -15,7 +15,7 @@
<view class="btn_box" bind:tap="handelClickSearch"><text>搜索</text></view>
</view>
<view class="jump" wx:if="{{setlectVal == 'resi'}}" bind:tap="toOCRCard">
<image style="height: 50rpx;width: 50rpx; margin-right: 11rpx;" src="../../images/work/card.png" mode=""/>
<!-- <image style="height: 50rpx;width: 50rpx; margin-right: 11rpx;" src="../../images/work/card.png" mode=""/> -->
<view>识别身份证查询</view>
<image style="height: 32rpx;width: 32rpx;" src="../../images/work/right.png" mode=""/>
</view>
@ -56,10 +56,10 @@
<view><text class="green font_size_44">{{collectedPopulationCount?collectedPopulationCount:'--'}}</text><text class="font_size_26">采集人口数</text></view>
</view>
</view>
<image src="../../images/work/center.png" mode="" class="center_image"/>
<!-- <image src="../../images/work/center.png" mode="" class="center_image"/> -->
</view>
</view>
<image src="../../images/work/sqmp.png" bind:tap="toDemandCheck" class="center_img" mode=""/>
<!-- <image src="../../images/work/sqmp.png" bind:tap="toDemandCheck" class="center_img" mode=""/> -->
<view class="bto" wx:if="{{agencyLevel!=='street'}}">
<view class="title">
<view style="font-size: 34rpx; font-weight: 500;">满意度自查</view>

83
subpages/searchResult/pages/resiInfo/component/graph/graph.js

@ -52,29 +52,60 @@ Component({
getFamilyRelationshipList(params).then(({
data
}) => {
let resiName = data.filter(item=>item.id === this.data.resiId)[0].name
let nodeList = data.map((item, index) => ({
let index = data.findIndex(item => item.id == this.data.resiId);
if (index !== -1) {
const [item] = data.splice(index, 1);
data.unshift(item);
}
let nodeList = data.map((item, index) => {
let symbolUrl = '';
if (item.type === 1) {
symbolUrl = 'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/a6cdfe6f699040f58fd8b2c10486b41d.png';
} else {
// 如果 type 不等于 1,则根据 gender 进行判断
if (item.gender === '1') {
// 如果 gender 等于 1,则根据 age 进行进一步的判断
symbolUrl = item.age > 18 && item.age < 60 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/1e21790833b04e9abe61e2a8f40446cb.png' :
item.age < 18 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/62c2b6a1ce834f8dae081b562b2579b9.png' :
item.age > 60 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/bd586a4e7d0f4b3aa68c79067dfe1428.png' :
'';
} else if (item.gender === '2') {
// 如果 gender 等于 2,则根据 age 进行进一步的判断
symbolUrl = item.age > 18 && item.age < 60 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/3b44e3495dcd4d96a3c07baad1bd7c5e.png' :
item.age < 18 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/0c38251bba644a6b8e4a925aea74c9a7.png' :
item.age > 60 ?
'image://https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/internal/20240402/2465ff7633a94413bf4ed2aa778c2765.png' :
'';
}
}
return {
'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
// },
}))
'symbol': symbolUrl,
label: {
"position": "bottom"
}
};
});
let links = data.map((item, index) => ({
"source": 0,
"target": index+1,
"name": item.houseHolderRel||'暂不清楚',
"label": {
"align": "center",
"fontSize": 12
"fontSize": 12,
"color":"#9cbbf9"
},
"lineStyle": {
"color": "#ff7d18"
"color": "#9cbbf9"
}
}))
links.splice(links.length-1,1)
@ -82,16 +113,11 @@ Component({
"name":item.houseHolderRel||'暂不清楚',
"id":index+1,
"itemStyle": {
"color": 'red'
"color": '#9cbbf9'
},
"lineStyle": {
"color": "#ff7d18"
}
}))
console.log(nodeList,links,categories);
console.log(JSON.stringify(nodeList));
console.log(JSON.stringify(links));
console.log(JSON.stringify(categories));
var option = {
@ -103,10 +129,24 @@ Component({
series: [{
type: 'graph',
layout: 'force',
symbolSize: 10,
// symbolSize: 10,
force: {
repulsion: 80,
gravity: 0,
edgeLength: 100,//线条长度
layoutAnimation: true,
},
draggable: true,
roam: false,
nodeScaleRatio: 0,
focusNodeAdjacency: false,
lineStyle: {
normal: {
opacity: 0.5,
width: 1.5,
curveness: 0
}
},
categories: categories,
edgeSymbol: ['', 'arrow'],
// edgeSymbolSize: [80, 10],
@ -124,10 +164,7 @@ Component({
label: {
show: true
},
force: {
repulsion: 2000,
edgeLength: 120
},
data: nodeList,
links: links
}]

13
subpages/searchResult/pages/resiInfo/component/graph/graph.wxss

@ -5,5 +5,16 @@ ec-canvas {
}
.hotlineComplaints {
width: 100%;
height: 318rpx;
height: 618rpx;
position: relative;
}
.hotlineComplaints image{
position: absolute;
width: 100%;
height: 100%;
z-index: 2;
top: 0;
left: 50%;
transform: translate(-50%);
}
Loading…
Cancel
Save