diff --git a/src/api/comment.js b/src/api/comment.js index cda400e..a6c825d 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -6,9 +6,9 @@ */ import request from "@/utils/request"; export default { - getList(volid) { + getList(id, page, size) { return request({ - url: `/luoo-comment/comment/findByVolid/${volid}`, + url: `/luoo-comment/comment/${id}/${page}/${size}`, method: "get" }); } diff --git a/src/api/user.js b/src/api/user.js new file mode 100644 index 0000000..e6cf88a --- /dev/null +++ b/src/api/user.js @@ -0,0 +1,29 @@ +/* + * @Description: + * @version: v1 + * @Author: zhangjiabao + * @Date: 2024-01-19 23:38:16 + */ +import request from "@/utils/request"; +export default { + getList(data, page, size) { + return request({ + url: `/user/cms/user/search/${page}/${size}`, + method: "post", + data: data + }); + }, + getDetail(id) { + return request({ + url: `/user/cms/user/${id}`, + method: "get" + }); + }, + updata(id, data) { + return request({ + url: `/user/cms/user/${id}`, + method: "put", + data + }); + } +}; diff --git a/src/views/article/articleDetail.vue b/src/views/article/articleDetail.vue index b24884a..c3fa5a7 100644 --- a/src/views/article/articleDetail.vue +++ b/src/views/article/articleDetail.vue @@ -13,7 +13,7 @@ label-width="100px" > - VOL.{{ data.number }} {{ data.name }} + VOL.{{ data.journalNo }} {{ data.title }} {{ getTagNameById(data.tag) }} @@ -24,8 +24,8 @@ @@ -36,18 +36,17 @@ style="width: calc(50% + 400px); margin: 0 0 auto auto;" stripe class="draggable-table" - row-key="name" border fit element-loading-text="加载中" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }" > - + @@ -56,7 +55,7 @@ @@ -67,29 +66,43 @@ label-suffix=":" > - {{ data.summary }} +
- - {{ c["nickname"] }} + - {{ c["publishtime"] }} - {{ c["thumbup"] }} -
- {{ c["content"] }} -
+ {{ c["nickName"] }} + {{ c["publishTime"] }} + {{ c["thumbupCount"] }} +
+ {{ c["content"] }} +
+ + +
@@ -124,7 +137,13 @@ export default { }, data() { return { - commentList: [] + commentList: [], + commentLoading: true, + commentPage: { + current: 1, + size: 10, + total: 0 + } }; }, filters: {}, @@ -135,45 +154,27 @@ export default { mounted() {}, methods: { fetchComment() { - // this.$message.success(this.data.number) - // commentApi.getList(this.data.number).then(res => { - // console.log(res) - // }) - let res = { - code: 0, - data: [ - { - _id: "1", - articleid: "", - comment: 0, - content: "wowowowowowow", - nickname: "nickname1", - parentid: "", - publishtime: "2023-01-01", - share: 0, - state: "", - thumbup: 333, - userid: "123", - visits: 0 - }, - { - _id: "2", - articleid: "", - comment: 0, - content: "ninininininin", - nickname: "nickname2", - parentid: "", - publishtime: "2023-01-01", - share: 0, - state: "", - thumbup: 12, - userid: "123", - visits: 0 + this.commentLoading = true; + commentApi + .getList(this.data.id, this.commentPage.current, this.commentPage.size) + .then(res => { + if (res.code === 200) { + this.commentList = res.data.rows; + this.commentPage.total = res.data.total; + this.commentLoading = false; + } else { + this.$message(res.message); + this.commentList = []; + this.commentPage.total = 0; + this.commentLoading = false; } - ], - message: "" - }; - this.commentList = res.data; + }); + }, + handlePageSizeChange() { + this.fetchComment(); + }, + handlePageCurrentChange() { + this.fetchComment(); }, // ************************* 数据处理 ************************* getAuthorNameById(userId) { @@ -224,4 +225,8 @@ export default { text-align: left; line-height: 22px; } +.pagination-right { + text-align: right; + margin-top: 10px; +} diff --git a/src/views/article/articleModify.vue b/src/views/article/articleModify.vue index e0fbac5..20fb142 100644 --- a/src/views/article/articleModify.vue +++ b/src/views/article/articleModify.vue @@ -158,7 +158,12 @@ diff --git a/src/views/article/index.vue b/src/views/article/index.vue index 28f563c..8f6a04e 100644 --- a/src/views/article/index.vue +++ b/src/views/article/index.vue @@ -156,7 +156,7 @@