fix: 认领结果回写/流水同步 0 条时提示 NaN——unwrapData 判空改 ?? 保留合法数字 0
This commit is contained in:
@@ -202,8 +202,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
unwrapData(response) {
|
||||
const body = response?.data || response || {};
|
||||
return body?.data || body;
|
||||
// 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN
|
||||
const body = response?.data ?? response ?? {};
|
||||
return body?.data ?? body;
|
||||
},
|
||||
queryParams() {
|
||||
const transactionRange = this.query.transactionDateRange || [];
|
||||
|
||||
@@ -295,8 +295,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
unwrapData(response) {
|
||||
const body = response?.data || response || {};
|
||||
return body?.data || body;
|
||||
// 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN
|
||||
const body = response?.data ?? response ?? {};
|
||||
return body?.data ?? body;
|
||||
},
|
||||
async loadTable() {
|
||||
this.loading = true;
|
||||
|
||||
Reference in New Issue
Block a user