|
|
@@ -221,14 +221,39 @@ export default {
|
|
|
ok: () => {
|
|
|
delMaterial(item.id, () => {
|
|
|
this.$msg.success("删除成功");
|
|
|
- const index = this.list.findIndex((eachItem) => {
|
|
|
- return eachItem.id === item.id
|
|
|
- })
|
|
|
- if (index >= 0) {
|
|
|
- this.list.splice(index, 1)
|
|
|
- } else {
|
|
|
- console.error('在素材列表里没找到要删除的那一项!');
|
|
|
- }
|
|
|
+ this.isRequestingMoreData = true
|
|
|
+ getMaterialList(
|
|
|
+ {
|
|
|
+ pageNum: this.list.length + 1,
|
|
|
+ pageSize: 1,
|
|
|
+ searchKey: this.searchKey,
|
|
|
+ type: TYPE,
|
|
|
+ },
|
|
|
+ (data) => {
|
|
|
+ const index = this.list.findIndex((eachItem) => {
|
|
|
+ return eachItem.id === item.id
|
|
|
+ })
|
|
|
+ if (index >= 0) {
|
|
|
+ this.list.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ console.error('在素材列表里没找到要删除的那一项!');
|
|
|
+ }
|
|
|
+
|
|
|
+ const newData = data.data.list.map((i) => {
|
|
|
+ i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+ this.list = this.list.concat(newData)
|
|
|
+ if (this.list.length === data.data.total) {
|
|
|
+ this.hasMoreData = false
|
|
|
+ }
|
|
|
+
|
|
|
+ this.isRequestingMoreData = false
|
|
|
+ },
|
|
|
+ () => {
|
|
|
+ this.isRequestingMoreData = false
|
|
|
+ }
|
|
|
+ )
|
|
|
});
|
|
|
},
|
|
|
});
|