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

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

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