提交 c9002bf2 authored 作者: 李忠利's avatar 李忠利

修改我的创作列表显示

上级 deef6647
......@@ -60,6 +60,9 @@ export default {
4: "全部音乐",
5: "其他",
6: "回收站",
10: "我的创作",
11: "我的收藏",
12: "我的笔记",
},
isShowInput: false, // 是否展示路径输入框
inputFilePath: "", // 路径输入
......
......@@ -303,6 +303,7 @@ export default {
/**
* 当表格的排序条件发生变化的时候会触发该事件
*/
handleSortChange() {
this.sortedFileList = this.$refs.multipleTable.tableData;
},
......
......@@ -48,7 +48,7 @@
@click.native.right="handleClickRight"
></FileTimeLine>
<div class="pagination-wrapper">
<div class="current-page-count">当前页{{ fileList.length }}</div>
<div class="current-page-count">当前页{{ this.fileList.length }}</div>
<!-- 回收站不展示分页组件 -->
<el-pagination
:current-page="pageData.currentPage"
......@@ -115,7 +115,7 @@ export default {
},
// 当前所在路径
filePath() {
return this.$route.query.filePath ? this.$route.query.filePath : "/";
return this.$route.query.filePath ? this.$route.query.filePath : "/我的创作";
},
// 文件查看模式 0列表模式 1网格模式 2 时间线模式
fileModel() {
......@@ -189,6 +189,7 @@ export default {
*/
getTableDataByType() {
this.loading = true;
console.log("type:",this.fileType)
// 分类型
if (Number(this.fileType)) {
switch (Number(this.fileType)) {
......@@ -200,6 +201,18 @@ export default {
this.showMyShareFile(); // 我的分享
break;
}
case 10: {
this.showMyCreateFile(); // 我的创作
break;
}
case 11: {
this.showMyFavoriteFile(); // 我的收藏
break;
}
case 12: {
this.showMyNoteFile(); // 我的笔记
break;
}
default: {
this.showFileList();
break;
......@@ -226,12 +239,12 @@ export default {
params.append(key, data[key]);
}
getFileListByPath(params).then((res) => {
if (res.success) {
this.fileList = res.dataList;
this.pageData.total = Number(res.total);
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = res.data.total;
this.loading = false;
} else {
this.$message.error(res.message);
this.$message.error(res.msg);
}
});
},
......@@ -254,11 +267,83 @@ export default {
*/
showFileRecovery() {
getRecoveryFile().then((res) => {
if (res.success) {
this.fileList = res.dataList;
if (res.code == 200) {
this.fileList = res.data.records;
this.loading = false;
} else {
this.$message.error(res.message);
this.$message.error(res.msg);
}
});
},
/**
* 表格数据获取相关事件 | 获取我的创作文件列表
*/
showMyCreateFile() {
let data = {
fileType: this.fileType,
filePath: this.filePath,
currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount,
};
const params = new URLSearchParams();
for (const key in data) {
params.append(key, data[key]);
}
getFileListByPath(params).then((res) => {
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = res.data.total;
this.loading = false;
} else {
this.$message.error(res.msg);
}
});
},
/**
* 表格数据获取相关事件 | 获取我的收藏文件列表
*/
showMyFavoriteFile() {
let data = {
fileType: this.fileType,
filePath: this.filePath,
currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount,
};
const params = new URLSearchParams();
for (const key in data) {
params.append(key, data[key]);
}
getFileListByPath(params).then((res) => {
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = res.data.total;
this.loading = false;
} else {
this.$message.error(res.msg);
}
});
},
/**
* 表格数据获取相关事件 | 获取我的笔记文件列表
*/
showMyNoteFile() {
let data = {
fileType: this.fileType,
filePath: this.filePath,
currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount,
};
const params = new URLSearchParams();
for (const key in data) {
params.append(key, data[key]);
}
getFileListByPath(params).then((res) => {
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = res.data.total;
this.loading = false;
} else {
this.$message.error(res.msg);
}
});
},
......@@ -273,12 +358,12 @@ export default {
pageCount: this.pageData.pageCount,
};
getMyShareFileList(data).then((res) => {
if (res.success) {
this.fileList = res.dataList;
this.pageData.total = Number(res.total);
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = Number(res.data.total);
this.loading = false;
} else {
this.$message.error(res.message);
this.$message.error(res.msg);
}
});
},
......@@ -293,12 +378,12 @@ export default {
pageCount: this.pageData.pageCount,
};
getFileListByType(data).then((res) => {
if (res.success) {
this.fileList = res.dataList;
this.pageData.total = Number(res.total);
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = Number(res.data.total);
this.loading = false;
} else {
this.$message.error(res.message);
this.$message.error(res.msg);
}
});
},
......@@ -315,16 +400,11 @@ export default {
fileName: fileName,
}).then((res) => {
this.loading = false;
if (res.success) {
this.fileList = res.dataList.map((item) => {
return {
...item,
highlightFields: item.highLight.fileName[0],
};
});
this.pageData.total = res.data.totalHits;
if (res.code==200) {
this.fileList = res.data.records;
this.pageData.total = res.data.total;
} else {
this.$message.error(res.message);
this.$message.error(res.msg);
}
});
},
......
......@@ -6,7 +6,7 @@
>
<el-button-group
class="create-operate-group"
v-if="(!selectedFiles.length || !isBatchOperation) && fileType === 0"
v-if="(!selectedFiles.length || !isBatchOperation) && [0,10,11,12].includes(fileType) "
>
<el-dropdown class="upload-drop" trigger="hover">
<el-button
......@@ -326,6 +326,7 @@ export default {
filePath: this.$route.query.filePath || "/",
})
.then((res) => {
console.log("确认结果:",res)
if (res === "confirm") {
this.$emit("getTableDataByType");
}
......
......@@ -20,8 +20,9 @@ export default {
const currentQueryParams = this.$route.query;
// 修改查询参数,例如,给 "filePath" 参数设置新的值
const newFileType = MY_CREATE;
const newQueryParams = { ...currentQueryParams, fileType: newFilePath };
const newFileType = 10;
const newFilePath = '/我的创作';
const newQueryParams = { ...currentQueryParams, fileType: newFileType ,filePath: newFilePath};
// 使用 this.$router.push() 导航到当前路由,并传递新的查询参数
this.$router.push({ query: newQueryParams });
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论