|
|
@@ -24,6 +24,7 @@ Component({
|
|
|
}
|
|
|
},
|
|
|
data: {
|
|
|
+ dateTypes: ["全部", "本年", "本月"],
|
|
|
"content": {
|
|
|
pageNumber: 1,
|
|
|
pageTotal: 1,
|
|
|
@@ -83,6 +84,7 @@ Component({
|
|
|
"content.pageSize": res.pageSize,
|
|
|
})
|
|
|
this.initChart(res.data[0].ratio, content.dataType == '金额' ? CNY(res.data[0].ratio[0].total / dividend) : res.data[0].ratio[0].total, getMapText);
|
|
|
+ this.selectComponent("#TimeRange").onCancel()
|
|
|
})
|
|
|
},
|
|
|
initChart(data, total, getMapText) {
|
|
|
@@ -91,14 +93,13 @@ Component({
|
|
|
trigger: 'item'
|
|
|
},
|
|
|
legend: {
|
|
|
- top: '5%',
|
|
|
+ bottom: '5%', // Moved legend to the bottom
|
|
|
left: 'center'
|
|
|
},
|
|
|
series: [{
|
|
|
- name: 'Access From',
|
|
|
type: 'pie',
|
|
|
radius: ['40%', '70%'],
|
|
|
- center: ['50%', '70%'],
|
|
|
+ center: ['50%', '42%'], // Adjusted to align with the new legend position
|
|
|
endAngle: 360,
|
|
|
data: data.map(v => {
|
|
|
return {
|
|
|
@@ -112,7 +113,7 @@ Component({
|
|
|
'项目订单': '#F6BD16',
|
|
|
'工具订单': '#6F5EF9',
|
|
|
'工具借用订单': '#6DC8EC'
|
|
|
- }[v.type] || '#CCCCCC' // Default color if type is not matched
|
|
|
+ } [v.type] || '#CCCCCC' // Default color if type is not matched
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
@@ -154,12 +155,10 @@ Component({
|
|
|
}
|
|
|
}]
|
|
|
};
|
|
|
-
|
|
|
- // Add total in the center of the ring
|
|
|
option.graphic = {
|
|
|
type: 'text',
|
|
|
left: 'center',
|
|
|
- top: '63%',
|
|
|
+ top: '35%', // Adjusted to align with the new series position
|
|
|
style: {
|
|
|
text: `${getMapText('总计')}\n\n${total}`,
|
|
|
textAlign: 'center',
|
|
|
@@ -178,6 +177,26 @@ Component({
|
|
|
chart.setOption(option);
|
|
|
return chart;
|
|
|
});
|
|
|
+ },
|
|
|
+ changeDate({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.setData({
|
|
|
+ dateType: detail.dateType,
|
|
|
+ "content.where.begdate": detail.begdate || "",
|
|
|
+ "content.where.enddate": detail.enddate || ""
|
|
|
+ })
|
|
|
+ this.getList(true)
|
|
|
+ },
|
|
|
+ changeType(e) {
|
|
|
+ const {
|
|
|
+ name
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ if (name == this.data.content.dataType) return;
|
|
|
+ this.setData({
|
|
|
+ "content.dataType": name
|
|
|
+ })
|
|
|
+ this.getList(true)
|
|
|
}
|
|
|
}
|
|
|
})
|