|
@@ -539,63 +539,50 @@ export default {
|
|
|
requestMoreData() {
|
|
|
this.isRequestingMoreData = true
|
|
|
const latestUsedSearchKey = this.searchKey
|
|
|
+
|
|
|
+ let getListFn = null
|
|
|
+ let params = null
|
|
|
if (this.materialType === '3D') {
|
|
|
- getSceneList(
|
|
|
- {
|
|
|
- pageNum: Math.floor(this.list.length / config.PAGE_SIZE) + 1,
|
|
|
- pageSize: config.PAGE_SIZE,
|
|
|
- searchKey: this.searchKey,
|
|
|
- workId: this.workId,
|
|
|
- },
|
|
|
- (data) => {
|
|
|
- const newData = data.data.data.list.map((i) => {
|
|
|
- this.materialItemCustomProcess(i)
|
|
|
- return i;
|
|
|
- });
|
|
|
- this.list = this.list.concat(newData)
|
|
|
- if (this.list.length === data.data.data.total) {
|
|
|
- this.hasMoreData = false
|
|
|
- }
|
|
|
- this.isRequestingMoreData = false
|
|
|
- this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
- },
|
|
|
- () => {
|
|
|
- this.isRequestingMoreData = false
|
|
|
- this.latestUsedSearchKey = latestUsedSearchKey
|
|
|
- }
|
|
|
- )
|
|
|
+ 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 {
|
|
|
- getMaterialList(
|
|
|
- {
|
|
|
- dirId: this.currentFolderId,
|
|
|
- pageNum: Math.floor(this.listRealLength / config.PAGE_SIZE) + 1,
|
|
|
- pageSize: config.PAGE_SIZE,
|
|
|
- searchKey: this.searchKey,
|
|
|
- type: this.materialType,
|
|
|
- },
|
|
|
- (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
|
|
|
+ getListFn = getMaterialList
|
|
|
+ params = {
|
|
|
+ dirId: this.currentFolderId,
|
|
|
+ pageNum: Math.floor(this.listRealLength / config.PAGE_SIZE) + 1,
|
|
|
+ pageSize: config.PAGE_SIZE,
|
|
|
+ searchKey: this.searchKey,
|
|
|
+ type: this.materialType,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getListFn(params, (data) => {
|
|
|
+ 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
|