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

修改我的创作列表显示

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