centaline-data-driven 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "ccai",
5
5
  "author": "hjc <3226136347@qq.com>",
6
6
  "private": false,
@@ -24,7 +24,7 @@
24
24
  class="cover-list-item-span-delete"
25
25
  v-if="!model.lock"
26
26
  >
27
- <i class="el-icon-delete" @click="handleRemove(index)"></i>
27
+ <i class="el-icon-delete" @click="handleRemove(item,index)"></i>
28
28
  </span>
29
29
  <span class="cover-list-item-span">
30
30
  <span class="el-dropdown-link" v-if="item.mediaLabelName">
@@ -116,9 +116,9 @@ export default {
116
116
  this.model = data;
117
117
  this.photoList = data.fileList;
118
118
  },
119
- handleRemove(index) {
120
- this.model.delete(index);
121
- //this.photoList.splice(index, 1);
119
+ handleRemove(item,index) {
120
+ this.model.delete(item,index);
121
+ this.photoList.splice(index, 1);
122
122
  },
123
123
  handleOpen() {
124
124
  var self = this;
@@ -67,32 +67,24 @@ const PhotoSelect = function (source, fileSourceList, router, optionApi,sourceLi
67
67
  }
68
68
  }
69
69
  }
70
- fileSourceList = newfileList;
71
- pushArr.forEach((n) => {
72
- fileSourceList.push(n);
73
-
74
- })
75
-
70
+ fileSourceList = [...newfileList,...pushArr];
76
71
  },
77
- delete(index) {
72
+ delete(delitem,index) {
78
73
  let newVal = true;
79
- let item =null;
80
- for (let j = 0; j < sourceList.length; j++) {
81
- if (fileSourceList[index].mediaID === sourceList[j].mediaID) {
82
-
83
- fileSourceList[index].flagDefault = false;
84
- fileSourceList[index].flagDeleted = true;
85
- item = fileSourceList[index];
86
- fileSourceList.splice(index, 1);
87
- fileSourceList.push(item);
88
- newVal = false;
89
- break;
90
- }
74
+ let item = null;
75
+
76
+ let sourceIndex = sourceList.findIndex(v => v.mediaID === delitem.mediaID);
77
+ let i = fileSourceList.findIndex(v => v.mediaID === delitem.mediaID);
78
+ if (sourceIndex === -1) {
79
+ fileSourceList.splice(i, 1);
91
80
  }
92
- rtn.fileList.splice(index, 1);
93
- if (newVal) {
81
+ else {
82
+ fileSourceList[index].flagDefault = false;
83
+ fileSourceList[index].flagDeleted = true;
84
+ item = fileSourceList[index];
94
85
  fileSourceList.splice(index, 1);
95
- }
86
+ fileSourceList.push(item);
87
+ }
96
88
  },
97
89
 
98
90
  getFormObj() {