Browse Source

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

jw-featrue-zhanlibiao
战立标 2 years ago
parent
commit
68c87ee78c
  1. 19
      pages/statistics/modules/HotlineComplaints/HotlineComplaints.js
  2. 28
      pages/statistics/modules/SmyddcSqmydzc/SmyddcSqmydzc.js
  3. 16
      pages/statistics/modules/Trend/Trend.js
  4. 22
      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;
});
}
}
});

28
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,
@ -195,7 +213,9 @@ Component({
},
series
};
chart.setOption(option,true);
chart.setOption(option, true);
})
return chart;
})
}
}

16
pages/statistics/modules/Trend/Trend.js

@ -18,7 +18,8 @@ Component({
properties: {},
data: {
ec: {
onInit: initChart
lazyLoad: true
// onInit: initChart
}
},
lifetimes: {
@ -28,13 +29,20 @@ 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 = []
let color = ['#3A80E7', '#EB8E16', '#10B2A5',]
data.series.forEach((item,index) => {
data.series.forEach((item, index) => {
series.push({
name:item.name,
name: item.name,
type: 'line',
showAllSymbol: true,
symbol: 'circle',
@ -141,6 +149,8 @@ Component({
chart.setOption(option);
})
return chart
})
}
}
});

22
subpages/statistics/pages/qzbmy/qzbmy.js

@ -1,4 +1,4 @@
import {getPotentialDissatisfiedCountDetail, maporg} from "../../../../utils/statisticsApi";
import { getPotentialDissatisfiedCountDetail, maporg } from "../../../../utils/statisticsApi";
Page({
data: {
@ -17,8 +17,8 @@ Page({
},
getOrg() {
maporg().then(async ({data}) => {
let parent = {value: data.id, label: data.name}
maporg().then(async ({ data }) => {
let parent = { value: data.id, label: data.name }
this.setData({
orgList: [
parent, ...data.children.map(item => {
@ -33,15 +33,23 @@ Page({
})
},
gotopage({currentTarget: {dataset}}) {
const {url} = dataset;
wx.navigateTo({url})
gotopage({ currentTarget: { dataset } }) {
const { url } = dataset;
wx.navigateTo({ url })
},
setVal(e) {
this.setData({
[e.currentTarget.dataset.key]: e.detail.value
})
},
search() {
this.setData({
pageNo: 1,
list: [],
total: 0,
})
this.getList()
},
getList() {
getPotentialDissatisfiedCountDetail({
pageNo: this.data.pageNo,
@ -49,7 +57,7 @@ Page({
agencyId: this.data.orgList[this.data.orgIndex].value,
name: this.data.name,
mobile: this.data.mobile,
}).then(({data}) => {
}).then(({ data }) => {
this.setData({
list: this.data.list.concat(data.list),
total: data.total

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