提交 b8901b2a authored 作者: 龙菲's avatar 龙菲

给按标签分类增加loading和重置按钮

上级 81600833
......@@ -136,6 +136,9 @@
</el-pagination>
</div>
</div>
<div class="card-group" v-else>
<el-empty></el-empty>
</div>
</div>
</div>
<AddOrUpdateNoteDialog
......@@ -217,15 +220,16 @@ export default {
fileName: this.keyword,
};
let res = await getNoteAllFilesList(params);
this.loading = false;
if (res.data) {
this.fileList = res.data;
this.loadNoteList();
}
this.loading = false;
},
//加载笔记列表
async loadNoteList() {
this.loading = true;
const { current, size } = this.noteList;
const params = {
currentPage: current,
......@@ -233,10 +237,10 @@ export default {
fileId: this.currentFileId,
};
let res = await getNoteByFile(params);
this.loading = false;
if (res.data) {
this.noteList = res.data;
}
this.loading = false;
},
// 文件名搜索
......
......@@ -51,7 +51,7 @@
</div>
<div :span="19" class="right">
<div class="note-container">
<div class="card-group">
<div class="card-group" v-if="noteList.records.length > 0">
<el-card
class="card-item"
shadow="hover"
......@@ -64,6 +64,7 @@
style="margin-right: 8px"
type="warning"
v-for="(v, i) in item.tagName.split(',')"
:key="i"
>{{ v }}
</el-tag>
</div>
......@@ -132,6 +133,9 @@
</el-pagination>
</div>
</div>
<div class="card-group" v-else>
<el-empty></el-empty>
</div>
</div>
</div>
<AddOrUpdateNoteDialog
......@@ -212,15 +216,16 @@ export default {
tagName: this.keyword,
};
let res = await getNoteAllTagList(params);
this.loading = false;
if (res.data) {
this.tagList = res.data;
this.loadNoteList();
}
this.loading = false;
},
//加载笔记列表
async loadNoteList() {
this.loading = true;
const { current, size } = this.noteList;
const params = {
currentPage: current,
......@@ -228,6 +233,7 @@ export default {
id: this.currentTagId,
};
let res = await getNoteByTag(params);
this.loading = false;
if (res.data) {
this.noteList = res.data;
}
......@@ -247,8 +253,8 @@ export default {
// 文件名搜索
handleSearch() {
// 重置分页
this.fileList.current = 1;
this.fileList.size = 20;
this.tagList.current = 1;
this.tagList.size = 20;
// 重置当前选中的文件
this.currentTagId = "";
this.loadLeftList();
......@@ -256,12 +262,12 @@ export default {
handleReset() {
// 重置分页
this.fileList.current = 1;
this.fileList.size = 20;
this.tagList.current = 1;
this.tagList.size = 20;
// 重置查询参数
this.currentTagId = "";
this.keyword = "";
this.loadfileList();
this.loadLeftList();
},
// 文件列表size
......
......@@ -28,9 +28,9 @@ export default {
watch: {
activeName(value) {
if (value == "byFile") {
this.$refs.NoteByFile.loadfileList();
this.$refs.NoteByFile.loadLeftList();
} else {
this.$refs.NoteByTag.loadtagList();
this.$refs.NoteByTag.loadLeftList();
}
},
},
......
......@@ -56,6 +56,7 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(dropItem, i) in dropdownList"
:key="i"
@click.native="handleNoteOperation(dropItem.value, item)"
>{{ dropItem.label }}</el-dropdown-item
>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论