fix(测试跟踪): 测试计划查看报告控制台报错

--bug=1018686 --user=李玉号 【测试跟踪】测试计划-查看报告-打开性能报告-Console报错
https://www.tapd.cn/55049933/s/1291568
This commit is contained in:
shiziyuan9527 2022-11-08 10:55:53 +08:00 committed by lyh
parent 3abdea7bd4
commit 6ab483382f
1 changed files with 5 additions and 2 deletions

View File

@ -91,8 +91,8 @@ export default {
getProjectApplicationConfig('TRACK_SHARE_REPORT_TIME') getProjectApplicationConfig('TRACK_SHARE_REPORT_TIME')
.then(res => { .then(res => {
if (res.data) { if (res.data) {
let quantity = res.data.typeValue.substring(0, res.data.typeValue.length - 1); let quantity = res.data.typeValue ? res.data.typeValue.substring(0, res.data.typeValue.length - 1) : null;
let unit = res.data.typeValue.substring(res.data.typeValue.length - 1); let unit = res.data.typeValue ? res.data.typeValue.substring(res.data.typeValue.length - 1) : null;
if (unit === 'H') { if (unit === 'H') {
res.data.typeValue = quantity + this.$t('commons.date_unit.hour'); res.data.typeValue = quantity + this.$t('commons.date_unit.hour');
} else if (unit === 'D') { } else if (unit === 'D') {
@ -102,6 +102,9 @@ export default {
} else if (unit === 'Y') { } else if (unit === 'Y') {
res.data.typeValue = quantity + this.$t('commons.date_unit.year'); res.data.typeValue = quantity + this.$t('commons.date_unit.year');
} }
if (quantity == null && unit == null) {
res.data.typeValue = '24' + this.$t('commons.date_unit.hour');
}
this.application = res.data; this.application = res.data;
} }
}); });