|
|
@ -274,7 +274,7 @@ export default {
|
|
|
|
objToOne (obj) {
|
|
|
|
objToOne (obj) {
|
|
|
|
let tmpData = {}
|
|
|
|
let tmpData = {}
|
|
|
|
for (let index in obj) {
|
|
|
|
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])
|
|
|
|
let resObj = this.objToOne(obj[index])
|
|
|
|
Object.assign(tmpData, resObj) // 这里使用对象合并
|
|
|
|
Object.assign(tmpData, resObj) // 这里使用对象合并
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -283,6 +283,13 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return tmpData
|
|
|
|
return tmpData
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
isArrayFn(value) {
|
|
|
|
|
|
|
|
if (typeof Array.isArray === "function") {
|
|
|
|
|
|
|
|
return Array.isArray(value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return Object.prototype.toString.call(value) === "[object Array]";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
urlEncode (val) {
|
|
|
|
urlEncode (val) {
|
|
|
|
return encodeURIComponent(val)
|
|
|
|
return encodeURIComponent(val)
|
|
|
|
},
|
|
|
|
},
|
|
|
|