|
|
@@ -103,6 +103,8 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ that.getStatisticsInfo();
|
|
|
+ that.qiehuan(that.data.type);
|
|
|
let userArray = that.data.userArray;
|
|
|
userArray[1] = arrayDept
|
|
|
that.setData({
|
|
|
@@ -121,11 +123,18 @@ Page({
|
|
|
columnChange: function(e) {
|
|
|
const that = this;
|
|
|
let value = that.data.value
|
|
|
+ if (e.detail.column == 0) {
|
|
|
+ value[1] = 0
|
|
|
+ }
|
|
|
value[e.detail.column] = e.detail.value
|
|
|
that.setData({
|
|
|
value: value
|
|
|
})
|
|
|
if (e.detail.column == 0) {
|
|
|
+ that.setData({
|
|
|
+ listDept: '',
|
|
|
+ list: ''
|
|
|
+ })
|
|
|
that.getDeptInfo()
|
|
|
} else if (e.detail.column == 1) {
|
|
|
that.getStatisticsInfo();
|
|
|
@@ -135,71 +144,114 @@ Page({
|
|
|
|
|
|
getChart: function(e) {
|
|
|
const that = this;
|
|
|
- ringChart = new wxCharts({
|
|
|
- animation: true,
|
|
|
- canvasId: 'ringCanvas',
|
|
|
- type: 'ring',
|
|
|
- extra: {
|
|
|
- ringWidth: 10,
|
|
|
- pie: {
|
|
|
- offsetAngle: -40
|
|
|
- }
|
|
|
- },
|
|
|
- title: {
|
|
|
- name: '归勤率',
|
|
|
- color: '#333',
|
|
|
- fontSize: 15
|
|
|
- },
|
|
|
- subtitle: {
|
|
|
- name: that.data.totalInfo.attendance * 100 + '%',
|
|
|
- color: '#6282f4',
|
|
|
- fontSize: 18
|
|
|
- },
|
|
|
- series: [{
|
|
|
- name: '无进出记录人员',
|
|
|
- data: that.data.totalInfo.unAccessCount / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#ed5c68'
|
|
|
- }, {
|
|
|
- name: '已出宿舍人员',
|
|
|
- data: that.data.totalInfo.out / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#f5a786'
|
|
|
- }, {
|
|
|
- name: '已归宿舍人员',
|
|
|
- data: that.data.totalInfo.in / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#7792f5'
|
|
|
- }, {
|
|
|
- name: '晚归宿舍人员',
|
|
|
- data: that.data.totalInfo.laterIn / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#79bef4'
|
|
|
- }, {
|
|
|
- name: '未归宿舍人员',
|
|
|
- data: that.data.totalInfo.unIn / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#5be0c1'
|
|
|
- }, {
|
|
|
- name: '未出宿舍人员',
|
|
|
- data: that.data.totalInfo.unOut / that.data.totalInfo.total,
|
|
|
- stroke: false,
|
|
|
- color: '#ac91f7'
|
|
|
- }],
|
|
|
- disablePieStroke: true,
|
|
|
- width: 160,
|
|
|
- height: 160,
|
|
|
- dataLabel: false,
|
|
|
- legend: false,
|
|
|
- background: '#fff',
|
|
|
- padding: 0
|
|
|
- });
|
|
|
- ringChart.addEventListener('renderComplete', () => {
|
|
|
- console.log('renderComplete');
|
|
|
- });
|
|
|
- setTimeout(() => {
|
|
|
- ringChart.stopAnimation();
|
|
|
- }, 500);
|
|
|
+ if (that.data.totalInfo.total == 0) {
|
|
|
+ ringChart = new wxCharts({
|
|
|
+ animation: true,
|
|
|
+ canvasId: 'ringCanvas',
|
|
|
+ type: 'ring',
|
|
|
+ extra: {
|
|
|
+ ringWidth: 10,
|
|
|
+ pie: {
|
|
|
+ offsetAngle: -40
|
|
|
+ }
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ name: '归勤率',
|
|
|
+ color: '#333',
|
|
|
+ fontSize: 15
|
|
|
+ },
|
|
|
+ subtitle: {
|
|
|
+ name: '100%',
|
|
|
+ color: '#6282f4',
|
|
|
+ fontSize: 18
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ name: '已归宿舍人员',
|
|
|
+ data: 1,
|
|
|
+ stroke: false,
|
|
|
+ color: '#7792f5'
|
|
|
+ }, ],
|
|
|
+ disablePieStroke: true,
|
|
|
+ width: 160,
|
|
|
+ height: 160,
|
|
|
+ dataLabel: false,
|
|
|
+ legend: false,
|
|
|
+ background: '#fff',
|
|
|
+ padding: 0
|
|
|
+ });
|
|
|
+ ringChart.addEventListener('renderComplete', () => {
|
|
|
+ console.log('renderComplete');
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ ringChart.stopAnimation();
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ ringChart = new wxCharts({
|
|
|
+ animation: true,
|
|
|
+ canvasId: 'ringCanvas',
|
|
|
+ type: 'ring',
|
|
|
+ extra: {
|
|
|
+ ringWidth: 10,
|
|
|
+ pie: {
|
|
|
+ offsetAngle: -40
|
|
|
+ }
|
|
|
+ },
|
|
|
+ title: {
|
|
|
+ name: '归勤率',
|
|
|
+ color: '#333',
|
|
|
+ fontSize: 15
|
|
|
+ },
|
|
|
+ subtitle: {
|
|
|
+ name: that.data.totalInfo.attendance * 100 + '%',
|
|
|
+ color: '#6282f4',
|
|
|
+ fontSize: 18
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ name: '无进出记录人员',
|
|
|
+ data: that.data.totalInfo.unAccessCount / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#ed5c68'
|
|
|
+ }, {
|
|
|
+ name: '已出宿舍人员',
|
|
|
+ data: that.data.totalInfo.out / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#f5a786'
|
|
|
+ }, {
|
|
|
+ name: '已归宿舍人员',
|
|
|
+ data: that.data.totalInfo.in / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#7792f5'
|
|
|
+ }, {
|
|
|
+ name: '晚归宿舍人员',
|
|
|
+ data: that.data.totalInfo.laterIn / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#79bef4'
|
|
|
+ }, {
|
|
|
+ name: '未归宿舍人员',
|
|
|
+ data: that.data.totalInfo.unIn / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#5be0c1'
|
|
|
+ }, {
|
|
|
+ name: '未出宿舍人员',
|
|
|
+ data: that.data.totalInfo.unOut / that.data.totalInfo.total,
|
|
|
+ stroke: false,
|
|
|
+ color: '#ac91f7'
|
|
|
+ }],
|
|
|
+ disablePieStroke: true,
|
|
|
+ width: 160,
|
|
|
+ height: 160,
|
|
|
+ dataLabel: false,
|
|
|
+ legend: false,
|
|
|
+ background: '#fff',
|
|
|
+ padding: 0
|
|
|
+ });
|
|
|
+ ringChart.addEventListener('renderComplete', () => {
|
|
|
+ console.log('renderComplete');
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ ringChart.stopAnimation();
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
touchHandler: function(e) {
|