|
@@ -281,9 +281,36 @@ export default {
|
|
|
},
|
|
},
|
|
|
() => {
|
|
() => {
|
|
|
this.$msg.success("设置成功");
|
|
this.$msg.success("设置成功");
|
|
|
- this.showCover = false;
|
|
|
|
|
- this.popupItem = "";
|
|
|
|
|
- this.getMaterialList();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ const index = this.list.findIndex((eachItem) => {
|
|
|
|
|
+ return eachItem.id === this.popupItem.id
|
|
|
|
|
+ })
|
|
|
|
|
+ if (index >= 0) {
|
|
|
|
|
+ getMaterialList(
|
|
|
|
|
+ {
|
|
|
|
|
+ pageNum: index + 1,
|
|
|
|
|
+ pageSize: 1,
|
|
|
|
|
+ type: TYPE,
|
|
|
|
|
+ },
|
|
|
|
|
+ (data) => {
|
|
|
|
|
+ const newData = data.data.list.map((i) => {
|
|
|
|
|
+ i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
|
|
+ return i;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.list.splice(index, 1, newData[0])
|
|
|
|
|
+ this.showCover = false;
|
|
|
|
|
+ this.popupItem = "";
|
|
|
|
|
+ },
|
|
|
|
|
+ () => {
|
|
|
|
|
+ this.showCover = false;
|
|
|
|
|
+ this.popupItem = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.error('在素材列表里没找到要设置封面的那一项!');
|
|
|
|
|
+ this.showCover = false;
|
|
|
|
|
+ this.popupItem = "";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|