Browse Source

修改统计页面图表加载方式

jw-featrue-zhanlibiao
战立标 2 years ago
parent
commit
68c87ee78c
  1. 19
      pages/statistics/modules/HotlineComplaints/HotlineComplaints.js
  2. 26
      pages/statistics/modules/SmyddcSqmydzc/SmyddcSqmydzc.js
  3. 12
      pages/statistics/modules/Trend/Trend.js
  4. 8
      subpages/statistics/pages/qzbmy/qzbmy.js
  5. 2
      subpages/statistics/pages/qzbmy/qzbmy.wxml
  6. 6
      subpages/statistics/pages/qzbmy/qzbmy.wxss

19
pages/statistics/modules/HotlineComplaints/HotlineComplaints.js

@ -38,7 +38,8 @@ Component({
},
data: {
ec: {
onInit: initChart
lazyLoad: true
// onInit: initChart
},
tabList: [{
label: "问题突出类别",
@ -55,13 +56,21 @@ Component({
}
},
methods: {
tabChange(index) {
tabChange({detail}) {
this.setData({
tabValue: this.tabList[index].value
tabValue: this.data.tabList[detail].value
})
this.getData()
},
getData() {
this.selectComponent('#hotlineComplaints').init((canvas, width, height, dpr) => {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // 像素比
});
canvas.setChart(chart);
let params = {
startTime: '',
endTime: ''
@ -105,7 +114,6 @@ Component({
color: '#fff',
fontSize: 14
},
backgroundColor: "#04229a",
formatter(params) {
// console.log(params)
if (params.name === '') {
@ -150,7 +158,8 @@ Component({
};
chart.setOption(option);
})
return chart;
});
}
}
});

26
pages/statistics/modules/SmyddcSqmydzc/SmyddcSqmydzc.js

@ -35,7 +35,8 @@ Component({
},
data: {
ec: {
onInit: initChart
lazyLoad: true
// onInit: initChart
}
},
lifetimes: {
@ -45,6 +46,13 @@ Component({
},
methods: {
getData() {
this.selectComponent('#smyddcSqmydzc').init((canvas, width, height, dpr) => {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // 像素比
});
canvas.setChart(chart);
let params = {
startTime: '',
endTime: ''
@ -135,8 +143,18 @@ Component({
}]
var option = {
tooltip: {
show: false,
trigger: "item",
show: true,
textStyle: {
color: '#fff',
fontSize: 14
},
formatter(params) {
// console.log(params)
if (params.name === '') {
return '';
}
return `${params.name} : ${params.percent}%`;
},
},
legend: {
show: true,
@ -197,6 +215,8 @@ Component({
};
chart.setOption(option, true);
})
return chart;
})
}
}
});

12
pages/statistics/modules/Trend/Trend.js

@ -18,7 +18,8 @@ Component({
properties: {},
data: {
ec: {
onInit: initChart
lazyLoad: true
// onInit: initChart
}
},
lifetimes: {
@ -28,6 +29,13 @@ Component({
},
methods: {
getData() {
this.selectComponent('#Trend').init((canvas, width, height, dpr) => {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: dpr // 像素比
});
canvas.setChart(chart);
notSatisfactionTrend().then(({data}) => {
let xData = data.monthTimes.map(item => (item.split('-')[1] - 0) + '月');
let series = []
@ -141,6 +149,8 @@ Component({
chart.setOption(option);
})
return chart
})
}
}
});

8
subpages/statistics/pages/qzbmy/qzbmy.js

@ -42,6 +42,14 @@ Page({
[e.currentTarget.dataset.key]: e.detail.value
})
},
search() {
this.setData({
pageNo: 1,
list: [],
total: 0,
})
this.getList()
},
getList() {
getPotentialDissatisfiedCountDetail({
pageNo: this.data.pageNo,

2
subpages/statistics/pages/qzbmy/qzbmy.wxml

@ -14,7 +14,7 @@
</picker>
<input placeholder="按姓名" bind:input="setVal" data-key="name" class="picker-type"/>
<input placeholder="按电话" bind:input="setVal" data-key="mobile" class="picker-type"/>
<view class="btn">筛选</view>
<view class="btn" bind:tap="search">筛选</view>
</view>
<view class="qz-container">

6
subpages/statistics/pages/qzbmy/qzbmy.wxss

@ -28,6 +28,12 @@ page {
justify-content: space-between;
padding: 0 30rpx;
box-sizing: border-box;
}
.picker text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.picker-type image,

Loading…
Cancel
Save