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 { |
import { |
||||
getFamilyRelationshipList, getPersonalFeature, |
getPersonalFile, |
||||
getPersonalFile, potentialSatisfactionForResident, queryResidentFollowRecord |
getFamilyRelationshipList, |
||||
} from "../../../../utils/statisticsApi"; |
provincialSatisfactionPageList, |
||||
|
communitySatisfactionPageList, |
||||
|
eventPageList, |
||||
|
recorHistory, |
||||
|
serviceNumber |
||||
|
} from '../../../../utils/api' |
||||
|
var chart; |
||||
|
|
||||
Page({ |
Page({ |
||||
data: { |
data: { |
||||
id: 0, |
ec: { |
||||
|
lazyLoad: true |
||||
|
}, |
||||
|
id: '', |
||||
|
tabList: [{ |
||||
|
label: '12345投诉', |
||||
|
value: '1' |
||||
|
}, { |
||||
|
label: '省满意度调查', |
||||
|
value: '2' |
||||
|
}, { |
||||
|
label: '社区满意度自查', |
||||
|
value: '3' |
||||
|
}], |
||||
userInfo: {}, |
userInfo: {}, |
||||
relationship: {}, |
userList: [], |
||||
unSolvedNum: 0, |
eventList: [], |
||||
unFinishNum: 0, |
provincialList: [], |
||||
noServiceNum: 0, |
communityList: [], |
||||
event12345Num: 0, |
businessIndex: 0, |
||||
provinceSatisfactionNum: 0, |
recorHistoryList: [] |
||||
selfInspectNum: 0, |
|
||||
logList: [], |
|
||||
tags: {} |
|
||||
}, |
}, |
||||
|
|
||||
onLoad(options) { |
onLoad(options) { |
||||
this.setData({ |
this.setData({ |
||||
id: options.id |
id: options.id |
||||
}) |
}) |
||||
this.getUser() |
|
||||
this.getNum() |
this.getPersonal() |
||||
this.getlog() |
this.getFamily() |
||||
|
this.geteventPageList() |
||||
|
|
||||
|
this.getRecorHistory() |
||||
|
|
||||
|
this.getData() |
||||
}, |
}, |
||||
getUser() { |
tabChange(e) { |
||||
getPersonalFile({resid: this.data.id}).then(({data}) => { |
|
||||
this.setData({ |
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({ |
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({ |
this.setData({ |
||||
tags: data |
provincialList: res.data |
||||
}) |
}) |
||||
}) |
}) |
||||
}, |
}, |
||||
getNum() { |
getcommunitySatisfactionPageList() { |
||||
let params = { |
let params = { |
||||
resiId: this.data.id, |
residList: [this.data.id], |
||||
}; |
pageNo: 1, |
||||
potentialSatisfactionForResident(params).then(({data}) => { |
pageSize: 5 |
||||
|
} |
||||
|
communitySatisfactionPageList(params).then(res => { |
||||
this.setData({ |
this.setData({ |
||||
unSolvedNum: data.unSolvedNum, |
communityList: res.data |
||||
unFinishNum: data.unFinishNum, |
}) |
||||
noServiceNum: data.noServiceNum, |
|
||||
event12345Num: data.event12345Num, |
|
||||
provinceSatisfactionNum: data.provinceSatisfactionNum, |
|
||||
selfInspectNum: data.selfInspectNum |
|
||||
}) |
}) |
||||
}); |
|
||||
}, |
}, |
||||
getlog() { |
geteventPageList() { |
||||
let params = { |
let params = { |
||||
resiId: this.data.id, |
residList: [this.data.id], |
||||
}; |
pageNo: 1, |
||||
queryResidentFollowRecord(params).then(({data}) => { |
pageSize: 5 |
||||
|
} |
||||
|
eventPageList({ eventType: "3", ...params }).then(res => { |
||||
this.setData({ |
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": "居民画像", |
"navigationBarTitleText": "居民画像", |
||||
"usingComponents": {} |
"usingComponents": { |
||||
|
"Tabs": "../../../../components/Tabs", |
||||
|
"ec-canvas": "../../../../ec-canvas/ec-canvas" |
||||
|
} |
||||
} |
} |
Loading…
Reference in new issue