|
@@ -304,6 +304,7 @@
|
|
|
import {
|
|
|
getMaterialList,
|
|
|
getSceneList,
|
|
|
+ searchInAllScenes,
|
|
|
uploadMaterial,
|
|
|
checkUserSize,
|
|
|
} from "@/api";
|
|
@@ -347,10 +348,6 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
},
|
|
|
- workId: {
|
|
|
- type: String,
|
|
|
- default: '',
|
|
|
- },
|
|
|
tableHeaderKeyList: {
|
|
|
type: Array,
|
|
|
default: () => {
|
|
@@ -543,13 +540,20 @@ export default {
|
|
|
let getListFn = null
|
|
|
let params = null
|
|
|
if (this.materialType === '3D') {
|
|
|
- getListFn = getSceneList
|
|
|
- params = {
|
|
|
- pathLevel2Id: this.folderPath[1]?.id,
|
|
|
- folderId: this.currentFolderId,
|
|
|
- pageNum: Math.floor(this.list.length / config.PAGE_SIZE) + 1,
|
|
|
- pageSize: config.PAGE_SIZE,
|
|
|
- searchKey: this.searchKey,
|
|
|
+ if (!this.searchKey) {
|
|
|
+ getListFn = getSceneList
|
|
|
+ params = {
|
|
|
+ pathLevel2Id: this.folderPath[1]?.id,
|
|
|
+ folderId: this.currentFolderId,
|
|
|
+ pageNum: Math.floor(this.list.length / config.PAGE_SIZE) + 1,
|
|
|
+ pageSize: config.PAGE_SIZE,
|
|
|
+ searchKey: this.searchKey,
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ getListFn = searchInAllScenes
|
|
|
+ params = {
|
|
|
+ searchKey: this.searchKey
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
getListFn = getMaterialList
|
|
@@ -562,27 +566,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
getListFn(params, (data) => {
|
|
|
- const newData = data.data.list.map((i) => {
|
|
|
- if (i.fileSize) {
|
|
|
- i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
- } else {
|
|
|
- i.fileSize = ''
|
|
|
- }
|
|
|
- this.materialItemCustomProcess(i)
|
|
|
- return i;
|
|
|
- });
|
|
|
- this.list = this.list.concat(newData)
|
|
|
- if (this.listRealLength === data.data.total) {
|
|
|
- this.hasMoreData = false
|
|
|
+ const newData = data.data.list.map((i) => {
|
|
|
+ if (i.fileSize) {
|
|
|
+ i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
+ } else {
|
|
|
+ i.fileSize = ''
|
|
|
}
|
|
|
- this.isRequestingMoreData = false
|
|
|
- this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
- },
|
|
|
- () => {
|
|
|
- this.isRequestingMoreData = false
|
|
|
- this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
+ this.materialItemCustomProcess(i)
|
|
|
+ return i;
|
|
|
+ });
|
|
|
+ this.list = this.list.concat(newData)
|
|
|
+ if (this.listRealLength === data.data.total) {
|
|
|
+ this.hasMoreData = false
|
|
|
}
|
|
|
- );
|
|
|
+ this.isRequestingMoreData = false
|
|
|
+ this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
+ }, () => {
|
|
|
+ this.isRequestingMoreData = false
|
|
|
+ this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
+ });
|
|
|
},
|
|
|
refreshMaterialList: debounce(function (type) {
|
|
|
this.isRequestingMoreData = false
|