Browse Source

选择编辑

xiebeibei 4 years ago
parent
commit
0eacb6fc61
1 changed files with 17 additions and 11 deletions
  1. 17 11
      src/components/edit/edit-dialog.vue

+ 17 - 11
src/components/edit/edit-dialog.vue

@@ -483,24 +483,30 @@
                 selectedRows.map(item => {
                     item.type = this.typeEdit;
                 })
+
+                console.log(selectedRows);
                 this.arrList = [...this.arrList, ...selectedRows]
+                console.log(this.arrList);
                 const obj = {}
-                if (this.typeEdit == 'Zone') {
+                // console.log(this.typeEdit);
+                // if (this.typeEdit == 'Zone') {
                     this.arrList = this.arrList.reduce(function (item, next) {
-                        obj[next.location] ? ' ' : obj[next.location] = true && item.push(next)
+                        obj[next.location||next.assetnum] ? ' ' : obj[next.location||next.assetnum] = true && item.push(next)
 
                         return item;
 
                     }, [])
-                } else {
-                    this.arrList = this.arrList.reduce(function (item, next) {
-                        obj[next.assetnum] ? ' ' : obj[next.assetnum] = true && item.push(next)
-
-                        return item;
-
-                    }, [])
-                }
-
+                //     console.log(this.arrList);
+                // } else {
+                //     this.arrList = this.arrList.reduce(function (item, next) {
+                //         obj[next.assetnum] ? ' ' : obj[next.assetnum] = true && item.push(next)
+                //
+                //         return item;
+                //
+                //     }, [])
+                //     console.log(this.arrList);
+                // }
+                console.log(this.arrList);
             },
             //右侧删除
             deleteItem(item, index) {