version9
4
This commit is contained in:
@@ -36,7 +36,12 @@
|
||||
}
|
||||
vc.copyObject(_res.data, $that.indexOwnerRoomInfo);
|
||||
let _dom = document.getElementById('ownerRoomCount');
|
||||
$that._initOwnerEcharts($that.indexOwnerRoomInfo.bindCount, $that.indexOwnerRoomInfo.unbindCount, _dom, vc.i18n('住户信息', 'indexOwnerRoom'), vc.i18n('已注册', 'indexOwnerRoom'), vc.i18n('未注册', 'indexOwnerRoom'), '#4B7AF0', '#E2EDF6');
|
||||
let ownerDataList = [
|
||||
{ value: $that.indexOwnerRoomInfo.bindCount, name: vc.i18n('已注册', 'indexOwnerRoom'), color: '#4B7AF0' },
|
||||
{ value: $that.indexOwnerRoomInfo.unbindRoomCount, name: vc.i18n('未绑定房屋', 'indexOwnerRoom'), color: '#FFD93D' },
|
||||
{ value: $that.indexOwnerRoomInfo.bindRoomCount, name: vc.i18n('已绑定房屋', 'indexOwnerRoom'), color: '#01C36D' }
|
||||
];
|
||||
$that._initOwnerEcharts(ownerDataList, _dom, vc.i18n('住户信息', 'indexOwnerRoom'));
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
@@ -44,7 +49,7 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
_initOwnerEcharts: function(userCount, freeCount, dom, _title, _userCountName, _freeCountName, userColor, freeColor) {
|
||||
_initOwnerEcharts: function(dataList, dom, _title) {
|
||||
let myChart = echarts.init(dom);
|
||||
let option = null;
|
||||
option = {
|
||||
@@ -55,12 +60,12 @@
|
||||
legend: {
|
||||
top: '5%',
|
||||
left: 'right',
|
||||
orient: 'vertical', //垂直显示
|
||||
orient: 'vertical',
|
||||
textStyle: {
|
||||
color: '#9D9D9F' //字体颜色
|
||||
color: '#9D9D9F'
|
||||
},
|
||||
},
|
||||
color: [userColor, freeColor],
|
||||
color: dataList.map(item => item.color),
|
||||
series: [{
|
||||
name: _title,
|
||||
type: 'pie',
|
||||
@@ -80,10 +85,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