|
@@ -539,9 +539,10 @@ export default {
|
|
if (!name) {
|
|
if (!name) {
|
|
return ''
|
|
return ''
|
|
}
|
|
}
|
|
- const unit = yAxisValue == 0 ? _this.$t('yuan') : _this.$t('time.hour');
|
|
|
|
|
|
+ const unit = yAxisValue == 0 ? _this.$t('yuan') : 'h';
|
|
const totalValue = yAxisValue == 0 ? nameObj[name] && nameObj[name].moneyTol : nameObj[name] && nameObj[name].timeTol;
|
|
const totalValue = yAxisValue == 0 ? nameObj[name] && nameObj[name].moneyTol : nameObj[name] && nameObj[name].timeTol;
|
|
- return seriesName === cerName ? `${totalValue ? totalValue.toFixed(0) : 0} ${unit}` : '';
|
|
|
|
|
|
+ const dayValue = yAxisValue == 0 ? 0 : nameObj[name] && (nameObj[name].timeTol/_this.user.timeType.allday).toFixed(1);
|
|
|
|
+ return seriesName === cerName ? `${totalValue ? totalValue.toFixed(1) : 0} ${unit}${yAxisValue == 0?'':('/'+dayValue+'人天')}` : '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -716,7 +717,6 @@ export default {
|
|
|
|
|
|
let item = {
|
|
let item = {
|
|
"value": yAxisValue == 0 ? (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney : (list[i].cost ? list[i].cost.toFixed(1) : 0),
|
|
"value": yAxisValue == 0 ? (list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney : (list[i].cost ? list[i].cost.toFixed(1) : 0),
|
|
- "dayValue": yAxisValue == 0 ? 0 : (list[i].cost/this.user.timeType.allDay).toFixed(1),//人天单位
|
|
|
|
"id": list[i].id || i,
|
|
"id": list[i].id || i,
|
|
}
|
|
}
|
|
if (countCost) {
|
|
if (countCost) {
|
|
@@ -740,7 +740,7 @@ export default {
|
|
const { countCost, countHours } = this.permissions
|
|
const { countCost, countHours } = this.permissions
|
|
const { userNameNeedTranslate } = this.user
|
|
const { userNameNeedTranslate } = this.user
|
|
chartData.title = {
|
|
chartData.title = {
|
|
- text: `工时成本总计:${countCost ? `成本 ${totalMoneyCost},` : ''} ${countHours ? `时长 ${totalHours} 小时` : ''}`,
|
|
|
|
|
|
+ text: `工时成本总计:${countCost ? `成本 ${totalMoneyCost},` : ''} ${countHours ? `时长 ${totalHours} 小时/${(totalHours/_this.user.timeType.allday).toFixed(1)}人天` : ''}`,
|
|
left: 'left',
|
|
left: 'left',
|
|
}
|
|
}
|
|
|
|
|
|
@@ -795,7 +795,12 @@ export default {
|
|
normal: {
|
|
normal: {
|
|
show: true,
|
|
show: true,
|
|
position: 'top',
|
|
position: 'top',
|
|
- formatter: `{c} ${yAxisValue == 0 ? '元' : '小时'}`,
|
|
|
|
|
|
+ // formatter: ` ${yAxisValue == 0 ? '{c}元' : '{c}小时/{{c}/8}人天'}`,
|
|
|
|
+
|
|
|
|
+ formatter: function(params) {
|
|
|
|
+ var dayValue = yAxisValue == 0?0:(params.value/_this.user.timeType.allday).toFixed(1);
|
|
|
|
+ return ` ${yAxisValue == 0 ? (params.value + '元') : (params.value + 'h/'+dayValue+'人天')}`; // params.value 等价于 {c}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}]
|
|
}]
|