From e34be7f8d9ba6af97eadb69d03b4c78e1efdebaa Mon Sep 17 00:00:00 2001 From: qianming Date: Fri, 14 Jan 2022 09:54:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=8F=98=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/docs/guide/bigScreenCase.md | 4 ++-- report-ui/src/mixins/common.js | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/docs/guide/bigScreenCase.md b/doc/docs/guide/bigScreenCase.md index 8fff804b..e9accfd9 100644 --- a/doc/docs/guide/bigScreenCase.md +++ b/doc/docs/guide/bigScreenCase.md @@ -1,11 +1,11 @@ -## 案例一: +## 案例一 由社区 **[~无痕~@tengzhouboy](https://gitee.com/tengzhouboy)** 提供
[AJ-Report分享链接](https://report.anji-plus.com/index.html#/aj/mtwbjPot)
![img.png](../picture/bigScreenCase/img.png)
-## 案例二: +## 案例二 由社区 **[心瘾丶 @yi_shan_liu](https://gitee.com/yi_shan_liu)** 提供
[AJ-Report分享链接](https://report.anji-plus.com/index.html#/aj/hkBJgLW0)
diff --git a/report-ui/src/mixins/common.js b/report-ui/src/mixins/common.js index cf7d1c41..8ea3bf87 100644 --- a/report-ui/src/mixins/common.js +++ b/report-ui/src/mixins/common.js @@ -80,7 +80,7 @@ export default { ) }, /** - * + * */ resetForm (data) { let formKeys = Object.keys(data) @@ -274,7 +274,7 @@ export default { objToOne (obj) { let tmpData = {} for (let index in obj) { - if (typeof obj[index] == 'object') { + if (typeof obj[index] == 'object' && !this.isArrayFn(obj[index])) { let resObj = this.objToOne(obj[index]) Object.assign(tmpData, resObj) // 这里使用对象合并 } else { @@ -283,6 +283,13 @@ export default { } return tmpData }, + isArrayFn(value) { + if (typeof Array.isArray === "function") { + return Array.isArray(value); + } else { + return Object.prototype.toString.call(value) === "[object Array]"; + } + }, urlEncode (val) { return encodeURIComponent(val) },