Commit f55b32e0 by 姜雷

修改充值视图标题显示

parent 1cea3ae1
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
<CampusRankChart <CampusRankChart
:data="campusRankList" :data="campusRankList"
:changeCampusHandle="changeCampusHandle" :changeCampusHandle="changeCampusHandle"
:updateCampusName="updateCampusName"
/> />
<div class="SeviceRatio-title">{{areaName}}</div>
</div> </div>
</template> </template>
...@@ -42,15 +44,16 @@ export default { ...@@ -42,15 +44,16 @@ export default {
name: 'CampusRank', name: 'CampusRank',
components: { CampusRankChart }, components: { CampusRankChart },
computed: { computed: {
...mapGetters('Dashboard', ['campusRankList', 'filters']), ...mapGetters('Dashboard', ['campusRankList', 'filters', 'areaName']),
}, },
methods: { methods: {
...mapActions('Dashboard', ['fetchConsumeList', 'updateCampusName']), ...mapActions('Dashboard', ['fetchConsumeList', 'updateCampusName']),
changeCampusHandle(data) { changeCampusHandle(data) {
this.updateCampusName(data.areaName);
this.fetchConsumeList({ this.fetchConsumeList({
areaId: data.areaId, areaId: data.areaId,
updatePercentList: true, updatePercentList: true,
}).then(() => {
this.updateCampusName(data.areaName);
}); });
}, },
}, },
......
...@@ -22,9 +22,8 @@ export default { ...@@ -22,9 +22,8 @@ export default {
name: 'CampusRankChart', name: 'CampusRankChart',
mixins: [chartMixin], mixins: [chartMixin],
props: { props: {
changeCampusHandle: { changeCampusHandle: { type: Function },
type: Function, updateCampusName: { type: Function },
},
}, },
data() { data() {
let total = this.data.reduce((count, item) => count + item.count, 0); let total = this.data.reduce((count, item) => count + item.count, 0);
...@@ -81,7 +80,6 @@ export default { ...@@ -81,7 +80,6 @@ export default {
position: ['50%', '50%'], position: ['50%', '50%'],
html: `<div style="color:#333;font-size: 20px;text-align: center;width: 4em;"> html: `<div style="color:#333;font-size: 20px;text-align: center;width: 4em;">
<span class="CampusRank-percent">0.00</span>%<br> <span class="CampusRank-percent">0.00</span>%<br>
<span class="CampusRank-areaName" style="font-size:16px;"></span>
</div>`, </div>`,
alignX: 'middle', alignX: 'middle',
alignY: 'middle', alignY: 'middle',
...@@ -103,6 +101,7 @@ export default { ...@@ -103,6 +101,7 @@ export default {
this.chartGeom.setSelected(this.data[0]); this.chartGeom.setSelected(this.data[0]);
this.changeSelected(this.data[0]); this.changeSelected(this.data[0]);
this.updateCampusName(this.data[0].areaName);
this.SelectedDataIndex = this.data[0]; this.SelectedDataIndex = this.data[0];
} }
}, },
......
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
label: { label: {
offsetX: -80, offsetX: -80,
htmlTemplate(text, item, index) { htmlTemplate(text, item, index) {
return `<div style="width: 85px">${text}</div>`; return `<div class="CustomerRechargeChart-areaTitle">${text}</div>`;
}, },
}, },
}); });
...@@ -272,5 +272,13 @@ export default { ...@@ -272,5 +272,13 @@ export default {
height: 300px; height: 300px;
transform: translate(100%, -100%); transform: translate(100%, -100%);
} }
.CustomerRechargeChart-areaTitle {
width: 85px;
height: 2em;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
} }
</style> </style>
...@@ -41,5 +41,8 @@ export default { ...@@ -41,5 +41,8 @@ export default {
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
padding-bottom: 12px; padding-bottom: 12px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment