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