13 changed files with 584 additions and 487 deletions
File diff suppressed because one or more lines are too long
@ -1,71 +1,234 @@ |
|||
import * as echarts from '../../../../ec-canvas/echarts'; |
|||
import { |
|||
getFamilyRelationshipList, getPersonalFeature, |
|||
getPersonalFile, potentialSatisfactionForResident, queryResidentFollowRecord |
|||
} from "../../../../utils/statisticsApi"; |
|||
getPersonalFile, |
|||
getFamilyRelationshipList, |
|||
provincialSatisfactionPageList, |
|||
communitySatisfactionPageList, |
|||
eventPageList, |
|||
recorHistory, |
|||
serviceNumber |
|||
} from '../../../../utils/api' |
|||
var chart; |
|||
|
|||
Page({ |
|||
data: { |
|||
id: 0, |
|||
ec: { |
|||
lazyLoad: true |
|||
}, |
|||
id: '', |
|||
tabList: [{ |
|||
label: '12345投诉', |
|||
value: '1' |
|||
}, { |
|||
label: '省满意度调查', |
|||
value: '2' |
|||
}, { |
|||
label: '社区满意度自查', |
|||
value: '3' |
|||
}], |
|||
userInfo: {}, |
|||
relationship: {}, |
|||
unSolvedNum: 0, |
|||
unFinishNum: 0, |
|||
noServiceNum: 0, |
|||
event12345Num: 0, |
|||
provinceSatisfactionNum: 0, |
|||
selfInspectNum: 0, |
|||
logList: [], |
|||
tags: {} |
|||
userList: [], |
|||
eventList: [], |
|||
provincialList: [], |
|||
communityList: [], |
|||
businessIndex: 0, |
|||
recorHistoryList: [] |
|||
}, |
|||
|
|||
onLoad(options) { |
|||
this.setData({ |
|||
id: options.id |
|||
}) |
|||
this.getUser() |
|||
this.getNum() |
|||
this.getlog() |
|||
|
|||
this.getPersonal() |
|||
this.getFamily() |
|||
this.geteventPageList() |
|||
|
|||
this.getRecorHistory() |
|||
|
|||
this.getData() |
|||
}, |
|||
getUser() { |
|||
getPersonalFile({resid: this.data.id}).then(({data}) => { |
|||
tabChange(e) { |
|||
this.setData({ |
|||
userInfo: data |
|||
businessIndex: e.detail |
|||
}) |
|||
console.log(e.detail) |
|||
if (e.detail == '0') { |
|||
this.geteventPageList() |
|||
} |
|||
if (e.detail == '1') { |
|||
this.getprovincialSatisfactionPageList() |
|||
} |
|||
if (e.detail == '2') { |
|||
this.getcommunitySatisfactionPageList() |
|||
} |
|||
}, |
|||
getPersonal() { |
|||
getPersonalFile({ resid: this.data.id }).then(res => { |
|||
this.setData({ |
|||
userInfo: res.data |
|||
}) |
|||
getFamilyRelationshipList({resid: this.data.id, type: 0}).then(({data}) => { |
|||
}) |
|||
}, |
|||
getFamily() { |
|||
getFamilyRelationshipList({ |
|||
id: this.data.id, |
|||
type: '0' |
|||
}).then(res => { |
|||
this.setData({ |
|||
relationship: data |
|||
userList: res.data |
|||
}) |
|||
}) |
|||
getPersonalFeature({resid: this.data.id}).then(({data}) => { |
|||
}, |
|||
getprovincialSatisfactionPageList() { |
|||
let params = { |
|||
residList: [this.data.id], |
|||
pageNo: 1, |
|||
pageSize: 5 |
|||
} |
|||
provincialSatisfactionPageList(params).then(res => { |
|||
this.setData({ |
|||
tags: data |
|||
provincialList: res.data |
|||
}) |
|||
}) |
|||
}, |
|||
getNum() { |
|||
getcommunitySatisfactionPageList() { |
|||
let params = { |
|||
resiId: this.data.id, |
|||
}; |
|||
potentialSatisfactionForResident(params).then(({data}) => { |
|||
residList: [this.data.id], |
|||
pageNo: 1, |
|||
pageSize: 5 |
|||
} |
|||
communitySatisfactionPageList(params).then(res => { |
|||
this.setData({ |
|||
unSolvedNum: data.unSolvedNum, |
|||
unFinishNum: data.unFinishNum, |
|||
noServiceNum: data.noServiceNum, |
|||
event12345Num: data.event12345Num, |
|||
provinceSatisfactionNum: data.provinceSatisfactionNum, |
|||
selfInspectNum: data.selfInspectNum |
|||
communityList: res.data |
|||
}) |
|||
}) |
|||
}); |
|||
}, |
|||
getlog() { |
|||
geteventPageList() { |
|||
let params = { |
|||
resiId: this.data.id, |
|||
}; |
|||
queryResidentFollowRecord(params).then(({data}) => { |
|||
residList: [this.data.id], |
|||
pageNo: 1, |
|||
pageSize: 5 |
|||
} |
|||
eventPageList({ eventType: "3", ...params }).then(res => { |
|||
this.setData({ |
|||
logList: data |
|||
eventList: res.data.list |
|||
}) |
|||
}) |
|||
}, |
|||
eventView(e) { |
|||
wx.navigateTo({ |
|||
url: '/subpages/statistics/pages/event/detail/detail?id='+e.currentTarget.dataset.id, |
|||
}) |
|||
}, |
|||
provincialView(e) { |
|||
console.log(e.currentTarget.dataset.id); |
|||
wx.navigateTo({ |
|||
url: '/subpages/statistics/pages/dissatisfied/detial/detail?id='+JSON.stringify(e.currentTarget.dataset.id), |
|||
}) |
|||
}, |
|||
communityView(e) { |
|||
console.log(e.currentTarget.dataset.id); |
|||
wx.navigateTo({ |
|||
url: '/subpages/statistics/pages/dissatisfied/detial/detail?id='+JSON.stringify(e.currentTarget.dataset.id), |
|||
}) |
|||
}, |
|||
getRecorHistory() { |
|||
recorHistory().then(res => { |
|||
this.setData({ |
|||
recorHistoryList: res.data |
|||
}) |
|||
}) |
|||
}, |
|||
getData() { |
|||
this.selectComponent('#enjoyService').init((canvas, width, height, dpr) => { |
|||
chart = echarts.init(canvas, null, { |
|||
width: width, |
|||
height: height, |
|||
devicePixelRatio: dpr // 像素比
|
|||
}); |
|||
canvas.setChart(chart); |
|||
console.log(this.data.id) |
|||
serviceNumber({ resid: this.data.id }).then(res => { |
|||
|
|||
const barData = res.data.map(item => { |
|||
return { |
|||
name: item.classification, |
|||
value: item.classificationNum |
|||
} |
|||
}) |
|||
var option = { |
|||
tooltip: { |
|||
trigger: 'axis', |
|||
axisPointer: { |
|||
type: 'shadow' |
|||
} |
|||
}, |
|||
grid: { |
|||
top: '0%', |
|||
left: '0%', |
|||
right: '0%', |
|||
bottom: '30', |
|||
}, |
|||
xAxis: { |
|||
type: 'category', |
|||
data: barData.map(item => item.name), |
|||
axisLabel: { |
|||
textStyle: { |
|||
fontSize: '12', |
|||
color: '#999999' |
|||
} |
|||
}, |
|||
axisLine: { |
|||
show: true, |
|||
lineStyle: { |
|||
color: '#EAEAEA', |
|||
}, |
|||
}, |
|||
axisTick: { |
|||
show: false |
|||
} |
|||
}, |
|||
yAxis: { |
|||
type: 'value', |
|||
splitLine: { |
|||
show: true, |
|||
color: '#EAEAEA' |
|||
}, |
|||
axisLabel: { |
|||
show: false |
|||
} |
|||
}, |
|||
series: [{ |
|||
type: 'bar', |
|||
barWidth: 16, |
|||
data: barData.map(item => item.value), |
|||
itemStyle: { |
|||
normal: { |
|||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ |
|||
offset: 0, |
|||
color: "#3A80E7" |
|||
}, { |
|||
offset: 1, |
|||
color: "#88B8FF" |
|||
}]), |
|||
label: { |
|||
show: true, |
|||
formatter: `{c}`, |
|||
position: 'top', |
|||
textStyle: { |
|||
fontSize: '13', |
|||
color: '#333333' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
}] |
|||
}; |
|||
chart.setOption(option); |
|||
|
|||
}) |
|||
|
|||
return chart; |
|||
}); |
|||
} |
|||
}) |
@ -1,4 +1,7 @@ |
|||
{ |
|||
"navigationBarTitleText": "居民画像", |
|||
"usingComponents": {} |
|||
"usingComponents": { |
|||
"Tabs": "../../../../components/Tabs", |
|||
"ec-canvas": "../../../../ec-canvas/ec-canvas" |
|||
} |
|||
} |
Loading…
Reference in new issue