|
|
@@ -1001,9 +1001,10 @@ export default {
|
|
|
|
|
|
// 新增
|
|
|
if (addedIds.length > 0) {
|
|
|
+ const paramWhere = this.getParams(JSON.parse(JSON.stringify(addedIds)))
|
|
|
const params = {
|
|
|
tableName: 't_fxsbpgb2',
|
|
|
- paramWhere: addedIds
|
|
|
+ paramWhere: paramWhere
|
|
|
}
|
|
|
console.log(params)
|
|
|
await this.$common.request('add', params)
|
|
|
@@ -1055,6 +1056,28 @@ export default {
|
|
|
this.$message.warning(error.message)
|
|
|
throw new Error(error.message)
|
|
|
}
|
|
|
+ },
|
|
|
+ getParams (inputArray) {
|
|
|
+ const allKeys = new Set()
|
|
|
+ inputArray.forEach(obj => {
|
|
|
+ Object.keys(obj).forEach(key => {
|
|
|
+ allKeys.add(key)
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ const standardizedArray = inputArray.map(obj => {
|
|
|
+ const newObj = {}
|
|
|
+ for (const key of allKeys) {
|
|
|
+ if (key in obj) {
|
|
|
+ newObj[key] = obj[key]
|
|
|
+ } else {
|
|
|
+ newObj[key] = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return newObj
|
|
|
+ })
|
|
|
+
|
|
|
+ return standardizedArray
|
|
|
}
|
|
|
}
|
|
|
|