version9
4
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
},
|
||||
_initMethod: function() {
|
||||
|
||||
|
||||
|
||||
},
|
||||
_initEvent: function() {
|
||||
vc.on('indexRepairComplaint','initData',function(){
|
||||
@@ -41,8 +41,14 @@
|
||||
}
|
||||
vc.copyObject(_res.data, $that.indexRepairComplaintInfo);
|
||||
let _dom = document.getElementById('repairCount');
|
||||
$that._initEcharts($that.indexRepairComplaintInfo.finishCount, $that.indexRepairComplaintInfo.allCount - $that.indexRepairComplaintInfo.finishCount, _dom, vc.i18n('报修信息', 'indexRepairComplaint'), vc.i18n('已处理', 'indexRepairComplaint'), vc.i18n('未处理', 'indexRepairComplaint'), '#4B7AF0', '#E2EDF6');
|
||||
},
|
||||
let repairDataList =[
|
||||
{ value: $that.indexRepairComplaintInfo.waitCount, name: vc.i18n('待派单', 'indexRepairComplaint'), color: '#FF6B6B' },
|
||||
{ value: $that.indexRepairComplaintInfo.doingCount, name: vc.i18n('处理中', 'indexRepairComplaint'), color: '#FFD93D' },
|
||||
{ value: $that.indexRepairComplaintInfo.finishCount, name: vc.i18n('已处理', 'indexRepairComplaint'), color: '#4B7AF0' },
|
||||
];
|
||||
$that._initEcharts(repairDataList, _dom, vc.i18n('报修信息', 'indexRepairComplaint'));
|
||||
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
@@ -68,7 +74,11 @@
|
||||
}
|
||||
vc.copyObject(_res.data, $that.indexRepairComplaintInfo);
|
||||
let _complaintCountDom = document.getElementById('complaintCount');
|
||||
$that._initEcharts($that.indexRepairComplaintInfo.finishComplaintCount, $that.indexRepairComplaintInfo.allComplaintCount - $that.indexRepairComplaintInfo.finishComplaintCount, _complaintCountDom, vc.i18n('投诉统计', 'indexRepairComplaint'), vc.i18n('已处理', 'indexRepairComplaint'), vc.i18n('未处理', 'indexRepairComplaint'), '#01C36D', '#E2EDF6');
|
||||
let complaintDataList = [
|
||||
{ value: $that.indexRepairComplaintInfo.waitComplaintCount, name: vc.i18n('处理中', 'indexRepairComplaint'), color: '#FFD93D' },
|
||||
{ value: $that.indexRepairComplaintInfo.finishComplaintCount, name: vc.i18n('已处理', 'indexRepairComplaint'), color: '#01C36D' }
|
||||
];
|
||||
$that._initEcharts(complaintDataList, _complaintCountDom, vc.i18n('投诉统计', 'indexRepairComplaint'));
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
@@ -76,7 +86,7 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
_initEcharts: function(userCount, freeCount, dom, _title, _userCountName, _freeCountName, userColor, freeColor) {
|
||||
_initEcharts: function (dataList, dom, _title){
|
||||
let myChart = echarts.init(dom);
|
||||
let option = null;
|
||||
option = {
|
||||
@@ -92,7 +102,7 @@
|
||||
color: '#9D9D9F' //字体颜色
|
||||
},
|
||||
},
|
||||
color: [userColor, freeColor],
|
||||
color: dataList.map(item => item.color),
|
||||
series: [{
|
||||
name: _title,
|
||||
type: 'pie',
|
||||
@@ -112,10 +122,10 @@
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: userCount, name: _userCountName },
|
||||
{ value: freeCount, name: _freeCountName }
|
||||
],
|
||||
data: dataList.map(item =>({
|
||||
value: item.value,
|
||||
name: item.name
|
||||
}))
|
||||
}]
|
||||
};
|
||||
if (option && typeof option === "object") {
|
||||
|
||||
Reference in New Issue
Block a user