🎨 接口数据结构变更

This commit is contained in:
ronger 2022-07-25 06:45:33 +08:00
parent 40e5e85109
commit 23b52a1c2f
33 changed files with 357 additions and 165 deletions

View File

@ -2,7 +2,7 @@
<el-row class="wrapper"> <el-row class="wrapper">
<el-col :xs="24" :sm="24" :xl="24" style="margin: 0 auto;"> <el-col :xs="24" :sm="24" :xl="24" style="margin: 0 auto;">
<el-carousel :interval="5000" height="210px" indicator-position="outside" arrow="always"> <el-carousel :interval="5000" height="210px" indicator-position="outside" arrow="always">
<el-carousel-item v-for="article in announcements.articles" :key="article.idArticle"> <el-carousel-item v-for="article in announcements.list" :key="article.idArticle">
<el-card> <el-card>
<div class="card-body d-flex flex-column"> <div class="card-body d-flex flex-column">
<el-link :href="article.articleLink" style="margin-bottom: .7rem;"> <el-link :href="article.articleLink" style="margin-bottom: .7rem;">

View File

@ -1,7 +1,7 @@
<template> <template>
<el-row class="wrapper"> <el-row class="wrapper">
<el-col :xs="24" :sm="24" :xl="24" style="margin: 0 auto;"> <el-col :xs="24" :sm="24" :xl="24" style="margin: 0 auto;">
<el-col v-for="article in articles.articles" :key="article.idArticle" style="padding-bottom: 1rem;"> <el-col v-for="article in articles.list" :key="article.idArticle" style="padding-bottom: 1rem;">
<el-card> <el-card>
<div class="card-body d-flex flex-column"> <div class="card-body d-flex flex-column">
<el-link :href="article.articleLink" style="margin-bottom: .5rem;"> <el-link :href="article.articleLink" style="margin-bottom: .5rem;">
@ -50,11 +50,11 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="articles.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:page-size="articles.pagination.pageSize" :page-size="articles.pageSize"
:current-page="articles.pagination.currentPage" :current-page="articles.pageNum"
:total="articles.pagination.total" :total="articles.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@current-change="currentChange"> @current-change="currentChange">

View File

@ -19,7 +19,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="records.records" :data="records.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="流水号" label="流水号"
@ -89,11 +89,11 @@
<el-pagination <el-pagination
:hide-on-single-page="true" :hide-on-single-page="true"
@current-change="currentChange" @current-change="currentChange"
:current-page="records.pagination.currentPage" :current-page="records.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="records.pagination.pageSize" :page-size="records.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="records.pagination.total"> :total="records.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -1,6 +1,6 @@
<template> <template>
<el-row> <el-row>
<el-col v-for="article in articles.articles" :key="article.idArticle"> <el-col v-for="article in articles.list" :key="article.idArticle">
<el-col> <el-col>
<el-link rel="nofollow" @click="onRouter(article.articleLink)" :underline="false"> <el-link rel="nofollow" @click="onRouter(article.articleLink)" :underline="false">
<h2 v-html="article.articleTitle"></h2> <h2 v-html="article.articleTitle"></h2>
@ -13,15 +13,15 @@
<el-divider></el-divider> <el-divider></el-divider>
</el-col> </el-col>
</el-col> </el-col>
<el-col v-if="articles.articles.length == 0" class="text-center"> <el-col v-if="articles.list.length == 0" class="text-center">
<span class="text-default">这里什么也没有!</span> <span class="text-default">这里什么也没有!</span>
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="articles.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="articles.pagination.currentPage" :current-page="articles.pageNum"
:total="articles.pagination.total" :total="articles.total"
@current-change="currentChange"> @current-change="currentChange">
</el-pagination> </el-pagination>
</div> </div>

View File

@ -7,7 +7,7 @@
<i class="el-icon-check"></i> 一键标记已读 <i class="el-icon-check"></i> 一键标记已读
</el-link> </el-link>
</el-col> </el-col>
<el-col v-for="notification in notifications.notifications" :key="notification.idNotification"> <el-col v-for="notification in notifications.list" :key="notification.idNotification">
<el-col v-if="notification.dataType == 0"> <el-col v-if="notification.dataType == 0">
<el-col :xs="16" :sm="20" :xl="20"> <el-col :xs="16" :sm="20" :xl="20">
<el-link rel="nofollow" :underline="false" @click="onRouter(notification)" style="font-size: 1.1em;" <el-link rel="nofollow" :underline="false" @click="onRouter(notification)" style="font-size: 1.1em;"
@ -63,11 +63,11 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="notifications.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:page-size="notifications.pagination.pageSize" :page-size="notifications.pageSize"
:current-page="notifications.pagination.currentPage" :current-page="notifications.pageNum"
:total="notifications.pagination.total" :total="notifications.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@current-change="currentChange"> @current-change="currentChange">
@ -89,7 +89,7 @@ export default {
computed: { computed: {
hasUnReadNotification: function () { hasUnReadNotification: function () {
let nums = 0; let nums = 0;
let notifications = this.notifications.notifications; let notifications = this.notifications.list;
for (const index in notifications) { for (const index in notifications) {
if (notifications[index].hasRead === '0') { if (notifications[index].hasRead === '0') {
nums++; nums++;

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<el-row class="row-cards row-deck" :gutter="20"> <el-row class="row-cards row-deck" :gutter="20">
<el-col :xs="24" :sm="12" :md="12" v-for="portfolio in portfolios.portfolios" :key="portfolio.idPortfolio"> <el-col :xs="24" :sm="12" :md="12" v-for="portfolio in portfolios.list" :key="portfolio.idPortfolio">
<el-col v-if="portfolio.headImgUrl" style="margin-bottom: 20px;"> <el-col v-if="portfolio.headImgUrl" style="margin-bottom: 20px;">
<el-card :body-style="{ padding: '20px' }"> <el-card :body-style="{ padding: '20px' }">
<el-col :span="12"> <el-col :span="12">
@ -45,10 +45,10 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center" style="padding-top: 10px;"> <div class="vertical-container text-center" style="padding-top: 10px;">
<el-pagination :hide-on-single-page="true" v-model="portfolios.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="portfolios.pagination.currentPage" :current-page="portfolios.pageNum"
:total="portfolios.pagination.total" :total="portfolios.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@current-change="currentChange"> @current-change="currentChange">

View File

@ -15,7 +15,7 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center" style="padding-top: 10px;"> <div class="vertical-container text-center" style="padding-top: 10px;">
<el-pagination :hide-on-single-page="true" v-model="articles.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="articles.pagination.currentPage" :current-page="articles.pagination.currentPage"
:total="articles.pagination.total" :total="articles.pagination.total"

View File

@ -1,7 +1,7 @@
<template> <template>
<el-row> <el-row>
<el-col> <el-col>
<el-table :data="articles.articles" style="width: 100%"> <el-table :data="articles.list" style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
width="40" width="40"
@ -34,10 +34,10 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center" style="padding-top: 10px;"> <div class="vertical-container text-center" style="padding-top: 10px;">
<el-pagination :hide-on-single-page="true" v-model="articles.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="articles.pagination.currentPage" :current-page="articles.pageNum"
:total="articles.pagination.total" :total="articles.total"
prev-text="上一页" prev-text="上一页"
next-text="下一页" next-text="下一页"
@current-change="currentChange"> @current-change="currentChange">
@ -72,11 +72,6 @@
data() { data() {
return { return {
articles: { articles: {
articles: [],
pagination: {
total: 0,
currentPage: 1
}
} }
} }
}, },
@ -88,7 +83,7 @@
let _ts = this; let _ts = this;
const responseTopData = await this.$axios.$get('/api/console/portfolio/' + _ts.idPortfolio + '/articles?page='+page); const responseTopData = await this.$axios.$get('/api/console/portfolio/' + _ts.idPortfolio + '/articles?page='+page);
if (responseTopData) { if (responseTopData) {
responseTopData.pagination.currentPage = page; responseTopData.pageNum = page;
_ts.$set(_ts, 'articles', responseTopData); _ts.$set(_ts, 'articles', responseTopData);
window.scrollTo(0, 0); window.scrollTo(0, 0);
} }
@ -124,7 +119,7 @@
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
_ts.$message(res.message); _ts.$message(res.message);
_ts.currentChange(_ts.articles.pagination.currentPage); _ts.currentChange(_ts.articles.pageNum);
} }
}) })
}).catch(() => { }).catch(() => {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<el-row class="row-cards row-deck" :gutter="20"> <el-row class="row-cards row-deck" :gutter="20">
<el-col :span="8" v-for="product in products.products" :key="product.idProduct" style="margin-right: 20px;"> <el-col :span="8" v-for="product in products.list" :key="product.idProduct" style="margin-right: 20px;">
<el-card :body-style="{ padding: '20px' }"> <el-card :body-style="{ padding: '20px' }">
<el-col :span="24"> <el-col :span="24">
<el-image :src="product.productImgUrl" <el-image :src="product.productImgUrl"

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8" v-for="user in users.users" :key="user.idUser" style="margin-bottom: 1rem;"> <el-col :span="8" v-for="user in users.list" :key="user.idUser" style="margin-bottom: 1rem;">
<el-card shadow="always" :body-style="{textAlign: 'center', paddingBottom: '20'}"> <el-card shadow="always" :body-style="{textAlign: 'center', paddingBottom: '20'}">
<el-col :span="24"> <el-col :span="24">
<el-link target="_blank" :href="'/user/' + user.account" class="text-default" :underline="false"> <el-link target="_blank" :href="'/user/' + user.account" class="text-default" :underline="false">
@ -30,10 +30,10 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="users.pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="users.pagination.currentPage" :current-page="users.pageNum"
:total="users.pagination.total" :total="users.total"
@current-change="currentChange"> @current-change="currentChange">
</el-pagination> </el-pagination>
</div> </div>

View File

@ -290,8 +290,8 @@ export default {
if (_ts.user) { if (_ts.user) {
_ts.$axios.$get('/api/notification/unread').then(function (res) { _ts.$axios.$get('/api/notification/unread').then(function (res) {
if (res) { if (res) {
_ts.$set(_ts, 'notifications', res.notifications); _ts.$set(_ts, 'notifications', res.list);
_ts.$set(_ts, 'notificationNumbers', res.pagination.total === 0 ? "" : res.pagination.total); _ts.$set(_ts, 'notificationNumbers', res.total === 0 ? "" : res.total);
} }
}) })
} }

View File

@ -117,6 +117,13 @@ export default {
path: '/admin/currency-rules', path: '/admin/currency-rules',
icon: 'el-icon-document', icon: 'el-icon-document',
closable: true closable: true
},
{
title: '产品管理',
name: 'admin-products',
path: '/admin/products',
icon: 'el-icon-box',
closable: true
} }
] ]
} }

View File

@ -11,16 +11,16 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="articles.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="articles.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="articles.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="articles" :data="articles.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -82,11 +82,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="articles.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="articles.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="articles.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
@ -119,8 +119,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
articles: state => state.admin.article.articles, articles: state => state.admin.articles
pagination: state => state.admin.article.pagination
}) })
}, },
data() { data() {

View File

@ -8,7 +8,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="bankAccounts" :data="bankAccounts.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -54,11 +54,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="bankAccounts.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="bankAccounts.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="bankAccounts.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-dialog :title="'卡号:' + bankAccount + ' 的交易记录'" :visible.sync="dialogVisible"> <el-dialog :title="'卡号:' + bankAccount + ' 的交易记录'" :visible.sync="dialogVisible">
@ -85,8 +85,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
bankAccounts: state => state["bank-account"].list.data.bankAccounts, bankAccounts: state => state["bank-account"].list.data,
pagination: state => state["bank-account"].list.data.pagination,
records: state => state["bank-account"].records.data records: state => state["bank-account"].records.data
}) })
}, },
@ -108,7 +107,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank-account/fetchList', { _ts.$store.dispatch('bank-account/fetchList', {
page: _ts.pagination.currentPage, page: _ts.bankAccounts.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -116,7 +115,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank-account/fetchList', { _ts.$store.dispatch('bank-account/fetchList', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.bankAccounts.pageSize
}) })
}, },
transactionRecords(index, bankAccount) { transactionRecords(index, bankAccount) {

View File

@ -8,7 +8,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="banks" :data="banks.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -52,11 +52,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="banks.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="banks.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="banks.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
@ -96,8 +96,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
banks: state => state.bank.list.data.banks, banks: state => state.bank.list.data
pagination: state => state.bank.list.data.pagination
}) })
}, },
data() { data() {
@ -120,7 +119,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank/fetchList', { _ts.$store.dispatch('bank/fetchList', {
page: _ts.pagination.currentPage, page: _ts.banks.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -128,7 +127,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank/fetchList', { _ts.$store.dispatch('bank/fetchList', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.banks.pageSize
}) })
}, },
showTransfer(index, bank) { showTransfer(index, bank) {

View File

@ -11,15 +11,15 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="comments.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="comments.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="comments.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
<el-col v-for="comment in comments" :key="comment.idComment"> <el-col v-for="comment in comments.list" :key="comment.idComment">
<el-card style="margin-top: 1rem;padding-bottom: 10px;" :id="'comment-' + comment.idComment"> <el-card style="margin-top: 1rem;padding-bottom: 10px;" :id="'comment-' + comment.idComment">
<el-col style="margin-bottom: 1rem;"> <el-col style="margin-bottom: 1rem;">
<el-link :href="comment.commentSharpUrl"> <el-link :href="comment.commentSharpUrl">
@ -82,11 +82,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="comments.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="comments.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="comments.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
</el-row> </el-row>
@ -106,8 +106,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
comments: state => state.admin.comment.comments, comments: state => state.admin.comments
pagination: state => state.admin.comment.pagination
}) })
}, },
data() { data() {
@ -137,7 +136,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchComments', { _ts.$store.dispatch('admin/fetchComments', {
page: _ts.pagination.currentPage, page: _ts.comments.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -145,7 +144,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchComments', { _ts.$store.dispatch('admin/fetchComments', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.comments.pageSize
}) })
}, },
toggleStatus() {} toggleStatus() {}

View File

@ -8,7 +8,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="rules" :data="rules.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="规则名称" label="规则名称"
@ -45,11 +45,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="rules.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="rules.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="rules.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
@ -90,8 +90,7 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
rules: state => state["currency-rule"].list.data.rules, rules: state => state["currency-rule"].list.data
pagination: state => state["currency-rule"].list.data.pagination
}) })
}, },
data() { data() {
@ -114,7 +113,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank/fetchList', { _ts.$store.dispatch('bank/fetchList', {
page: _ts.pagination.currentPage, page: _ts.rules.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -122,7 +121,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('bank/fetchList', { _ts.$store.dispatch('bank/fetchList', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.rules.pageSize
}) })
}, },
showTransfer(index, bank) { showTransfer(index, bank) {

View File

@ -43,7 +43,7 @@
<h3>新增文章列表</h3> <h3>新增文章列表</h3>
</el-col> </el-col>
<el-table <el-table
:data="articles.articles" :data="articles.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -98,18 +98,18 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleArticleSizeChange" @size-change="handleArticleSizeChange"
@current-change="handleArticleCurrentChange" @current-change="handleArticleCurrentChange"
:current-page="articles.pagination.currentPage" :current-page="articles.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="articles.pagination.pageSize" :page-size="articles.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="articles.pagination.total"> :total="articles.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-col :span="24" style="text-align: left;"> <el-col :span="24" style="text-align: left;">
<h3>新增用户列表</h3> <h3>新增用户列表</h3>
</el-col> </el-col>
<el-table :data="users.users" <el-table :data="users.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -147,18 +147,18 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleUserSizeChange" @size-change="handleUserSizeChange"
@current-change="handleUserCurrentChange" @current-change="handleUserCurrentChange"
:current-page="users.pagination.currentPage" :current-page="users.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="users.pagination.pageSize" :page-size="users.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="users.pagination.total"> :total="users.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-col :span="24" style="text-align: left;"> <el-col :span="24" style="text-align: left;">
<h3>新增账户列表</h3> <h3>新增账户列表</h3>
</el-col> </el-col>
<el-table :data="bankAccounts.bankAccounts" <el-table :data="bankAccounts.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -192,11 +192,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleBankAccountSizeChange" @size-change="handleBankAccountSizeChange"
@current-change="handleBankAccountCurrentChange" @current-change="handleBankAccountCurrentChange"
:current-page="bankAccounts.pagination.currentPage" :current-page="bankAccounts.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="bankAccounts.pagination.pageSize" :page-size="bankAccounts.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="bankAccounts.pagination.total"> :total="bankAccounts.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
</div> </div>
@ -549,7 +549,7 @@ export default {
handleArticleSizeChange(pageSize) { handleArticleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewArticles', { _ts.$store.dispatch('dashboard/fetchNewArticles', {
page: _ts.pagination.currentPage, page: _ts.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -557,13 +557,13 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewArticles', { _ts.$store.dispatch('dashboard/fetchNewArticles', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.pageSize
}) })
}, },
handleUserSizeChange(pageSize) { handleUserSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewUsers', { _ts.$store.dispatch('dashboard/fetchNewUsers', {
page: _ts.pagination.currentPage, page: _ts.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -571,13 +571,13 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewUsers', { _ts.$store.dispatch('dashboard/fetchNewUsers', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.pageSize
}) })
}, },
handleBankAccountSizeChange(pageSize) { handleBankAccountSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewBankAccounts', { _ts.$store.dispatch('dashboard/fetchNewBankAccounts', {
page: _ts.pagination.currentPage, page: _ts.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -585,7 +585,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('dashboard/fetchNewBankAccounts', { _ts.$store.dispatch('dashboard/fetchNewBankAccounts', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.pageSize
}) })
}, },
}, },

166
pages/admin/products.vue Normal file
View File

@ -0,0 +1,166 @@
<template>
<el-row style="margin-top: 20px;">
<el-col style="margin-bottom: 1rem;">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/admin/dashboard' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>产品管理</el-breadcrumb-item>
</el-breadcrumb>
</el-col>
<el-col>
<el-table
:data="products.list"
style="width: 100%">
<el-table-column
label="#"
width="40"
prop="idProduct">
</el-table-column>
<el-table-column
label="主图"
width="60"
prop="productImgUrl">
<template slot-scope="scope">
<el-avatar size="medium" :src="scope.row.productImgUrl"></el-avatar>
</template>
</el-table-column>
<el-table-column
label="商品名称"
width="140"
prop="productTitle">
<template slot-scope="scope">
<el-link type="primary" :href="'/product/' + scope.row.idProduct" :underline="false">
{{ scope.row.productTitle }}
</el-link>
</template>
</el-table-column>
<el-table-column
label="创建时间"
width="180"
prop="createdTime">
</el-table-column>
<el-table-column
label="状态"
width="180"
prop="status">
<template slot-scope="scope">
<el-tag type="primary" disable-transitions>
{{ scope.row.status === '0' ? '正常' : '禁用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)" plain>编辑</el-button>
<el-button v-if="scope.row.status == 1" size="mini" type="primary"
@click="toggleStatus(scope.$index, scope.row)" plain>上架
</el-button>
<el-button v-else size="mini" type="danger" @click="toggleStatus(scope.$index, scope.row)" plain>下架
</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col>
<el-pagination
:hide-on-single-page="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="products.pageNum"
:page-sizes="[10, 20, 50, 100]"
:page-size="products.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="products.total">
</el-pagination>
</el-col>
</el-row>
</template>
<script>
import {mapState} from 'vuex';
export default {
name: "products",
fetch({store, params, error}) {
return Promise.all([
store
.dispatch('admin/fetchProducts', params)
.catch(err => error({statusCode: 404}))
])
},
computed: {
...mapState({
products: state => state.admin.products
})
},
data() {
return {
order: 'desc'
}
},
methods: {
onRouter(name, data) {
this.$router.push({
path: `/${name}/${data}`
})
},
toggleStatus(index, product) {
let _ts = this;
let title, status;
if (product.status == 0) {
title = '下架';
status = 1;
} else {
title = '上架';
status = 0;
}
_ts.$confirm('确定' + title + '产品 ' + product.productTitle + '?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
_ts.$axios.$patch('/api/admin/product/update-status', {
idProduct: product.idProduct,
status: status
}).then(function (res) {
if (res && res.message) {
_ts.$message.error(res.message);
} else {
_ts.$message({
type: 'success',
message: title + '成功!'
});
_ts.handleCurrentChange(1);
}
});
}).catch(() => {
_ts.$message({
type: 'info',
message: '已取消'
});
});
},
handleSizeChange(pageSize) {
let _ts = this;
_ts.$store.dispatch('admin/fetchProducts', {
page: _ts.products.pageNum,
rows: pageSize
})
},
handleCurrentChange(page) {
let _ts = this;
_ts.$store.dispatch('admin/fetchProducts', {
page: page,
rows: _ts.products.pageSize
})
},
handleEdit(index ,row) {}
},
mounted() {
this.$store.commit("setActiveMenu", "admin-products");
}
}
</script>
<style scoped>
</style>

View File

@ -9,7 +9,7 @@
<el-col> <el-col>
<el-button type="primary" @click="showAddDialog" plain>添加角色</el-button> <el-button type="primary" @click="showAddDialog" plain>添加角色</el-button>
<el-table <el-table
:data="roles" :data="roles.list"
style="width: 100%;margin-top: 1rem;"> style="width: 100%;margin-top: 1rem;">
<el-table-column <el-table-column
label="#" label="#"
@ -57,11 +57,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="roles.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="roles.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="roles.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
@ -100,8 +100,7 @@
}, },
computed: { computed: {
...mapState({ ...mapState({
pagination: state => state.admin.role.pagination, roles: state => state.admin.roles
roles: state => state.admin.role.roles
}) })
}, },
data() { data() {
@ -181,7 +180,7 @@
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchRoles', { _ts.$store.dispatch('admin/fetchRoles', {
page: _ts.pagination.currentPage, page: _ts.roles.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -189,7 +188,7 @@
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchRoles', { _ts.$store.dispatch('admin/fetchRoles', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.roles.pageSize
}) })
} }
} }

View File

@ -10,7 +10,7 @@
<el-button size="small" @click="createTag" plain>创建标签</el-button> <el-button size="small" @click="createTag" plain>创建标签</el-button>
<el-button size="small" @click="cleanUnusedTag" plain>清除未使用标签</el-button> <el-button size="small" @click="cleanUnusedTag" plain>清除未使用标签</el-button>
</el-col> </el-col>
<el-col v-for="tag in tags" :key="tag.idTag"> <el-col v-for="tag in tags.list" :key="tag.idTag">
<el-card style="margin: .5rem;"> <el-card style="margin: .5rem;">
<el-col :span="1"> <el-col :span="1">
<el-avatar shape="square" :src="tag.tagIconPath" fit="scale-down"></el-avatar> <el-avatar shape="square" :src="tag.tagIconPath" fit="scale-down"></el-avatar>
@ -32,10 +32,10 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="pagination.currentPage" :current-page="tags.pageNum"
:total="pagination.total" :total="tags.total"
@current-change="currentChange"> @current-change="currentChange">
</el-pagination> </el-pagination>
</div> </div>
@ -57,8 +57,7 @@
}, },
computed: { computed: {
...mapState({ ...mapState({
tags: state => state.tag.list.data.tags, tags: state => state.tag.list.data
pagination: state => state.tag.list.data.pagination
}) })
}, },
methods: { methods: {
@ -73,7 +72,7 @@
if (res && res.message){ if (res && res.message){
_ts.$message.error(res.message); _ts.$message.error(res.message);
} else { } else {
const p = _ts.pagination.currentPage; const p = _ts.tags.pageNum;
_ts.currentChange(p); _ts.currentChange(p);
_ts.$message({ _ts.$message({
type: 'success', type: 'success',

View File

@ -54,7 +54,7 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="pagination.currentPage" :current-page="pagination.currentPage"
:total="pagination.total" :total="pagination.total"

View File

@ -36,7 +36,7 @@
</el-col> </el-col>
<el-col> <el-col>
<div class="vertical-container text-center"> <div class="vertical-container text-center">
<el-pagination :hide-on-single-page="true" v-model="pagination" <el-pagination :hide-on-single-page="true"
layout="prev, pager, next" layout="prev, pager, next"
:current-page="pagination.currentPage" :current-page="pagination.currentPage"
:total="pagination.total" :total="pagination.total"

View File

@ -9,7 +9,7 @@
<el-col style="margin: .5rem;"> <el-col style="margin: .5rem;">
<el-button size="small" @click="createTopic" plain>创建专题</el-button> <el-button size="small" @click="createTopic" plain>创建专题</el-button>
</el-col> </el-col>
<el-col :span="8" style="margin-bottom: .5rem;" v-for="topic in topics" :key="topic.idTopic"> <el-col :span="8" style="margin-bottom: .5rem;" v-for="topic in topics.list" :key="topic.idTopic">
<el-card> <el-card>
<div class="card-body d-flex flex-column"> <div class="card-body d-flex flex-column">
<el-col :span="4" style="text-align: right;"> <el-col :span="4" style="text-align: right;">
@ -48,8 +48,7 @@
}, },
computed: { computed: {
...mapState({ ...mapState({
topics: state => state.topic.list.data.topics, topics: state => state.topic.list.data
pagination: state => state.topic.list.data.pagination
}) })
}, },
methods: { methods: {

View File

@ -8,7 +8,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-table <el-table
:data="users" :data="users.list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="#" label="#"
@ -89,11 +89,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="pagination.currentPage" :current-page="users.pageNum"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" :page-size="users.pageSize"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total"> :total="users.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
<el-col> <el-col>
@ -129,9 +129,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
users: state => state.admin.user.users, users: state => state.admin.users,
pagination: state => state.admin.user.pagination, roles: state => state.admin.roles.list
roles: state => state.admin.role.roles
}) })
}, },
data() { data() {
@ -196,7 +195,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchUsers', { _ts.$store.dispatch('admin/fetchUsers', {
page: _ts.pagination.currentPage, page: _ts.users.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -204,7 +203,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchUsers', { _ts.$store.dispatch('admin/fetchUsers', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.users.pageSize
}) })
}, },
updateRole() { updateRole() {
@ -221,6 +220,7 @@ export default {
message: '授权成功', message: '授权成功',
type: 'success' type: 'success'
}); });
_ts.$set(_ts, 'dialogVisible', false); _ts.$set(_ts, 'dialogVisible', false);
_ts.$set(_ts, 'idUser', 0); _ts.$set(_ts, 'idUser', 0);
_ts.$set(_ts, 'idRole', 0); _ts.$set(_ts, 'idRole', 0);

View File

@ -306,7 +306,7 @@
_ts.$store.commit('article/clearDetailData') _ts.$store.commit('article/clearDetailData')
_ts.$set(_ts, 'notificationFlag', false); _ts.$set(_ts, 'notificationFlag', false);
_ts.$router.push({ _ts.$router.push({
path: `/article/${res.id}` path: `/article/${res}`
}) })
} }
}) })
@ -343,7 +343,7 @@
_ts.contentEditor.setValue(''); _ts.contentEditor.setValue('');
_ts.$set(_ts, 'notificationFlag', false); _ts.$set(_ts, 'notificationFlag', false);
_ts.$router.push({ _ts.$router.push({
path: `/draft/${res.id}` path: `/draft/${res}`
}) })
} }
}) })

View File

@ -7,13 +7,13 @@
</el-col> </el-col>
<el-col> <el-col>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane :label="'文章 (' + getLength(articles.pagination) + ')'" name="articles"> <el-tab-pane :label="'文章 (' + getLength(articles) + ')'" name="articles">
<article-list :articles="articles" @currentChange="currentChangeArticle"/> <article-list :articles="articles" @currentChange="currentChangeArticle"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'用户 (' + getLength(users.pagination) + ')'" name="users"> <el-tab-pane :label="'用户 (' + getLength(users) + ')'" name="users">
<user-list :users="users" @currentChange="currentChangeUser"/> <user-list :users="users" @currentChange="currentChangeUser"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="'作品集 (' + getLength(portfolios.pagination) + ')'" name="portfolios"> <el-tab-pane :label="'作品集 (' + getLength(portfolios) + ')'" name="portfolios">
<portfolio-list :portfolios="portfolios" @currentChange="currentChangePortfolio"/> <portfolio-list :portfolios="portfolios" @currentChange="currentChangePortfolio"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

View File

@ -28,13 +28,21 @@ const getDefaultCommentsData = () => {
} }
} }
const getDefaultProductsData = () => {
return {
products: [],
pagination: {}
}
}
export const state = () => { export const state = () => {
return { return {
fetching: false, fetching: false,
user: getDefaultUsersData(), users: getDefaultUsersData(),
role: getDefaultRolesData(), roles: getDefaultRolesData(),
article: getDefaultArticlesData(), articles: getDefaultArticlesData(),
comment: getDefaultCommentsData(), comments: getDefaultCommentsData(),
products: getDefaultProductsData(),
tabs: [ tabs: [
{ {
title: 'Dashboard', title: 'Dashboard',
@ -53,25 +61,24 @@ export const mutations = {
state.fetching = action state.fetching = action
}, },
updateUsersData(state, action) { updateUsersData(state, action) {
state.user.users = action.users state.users = action
state.user.pagination = action.pagination
}, },
updateRolesData(state, action) { updateRolesData(state, action) {
state.role.roles = action.roles state.roles = action
state.role.pagination = action.pagination
}, },
updateArticlesData(state, action) { updateArticlesData(state, action) {
state.article.articles = action.articles state.articles = action
state.article.pagination = action.pagination
}, },
updateCommentsData(state, action) { updateCommentsData(state, action) {
state.comment.comments = action.comments state.comments = action
state.comment.pagination = action.pagination },
updateProductsData(state, action) {
state.products = action
}, },
updateArticlePreference(state, action) { updateArticlePreference(state, action) {
let article = state.article.articles[action.index] let articles = state.articles.list[action.index]
if (article.idArticle === action.idArticle) { if (articles.idArticle === action.idArticle) {
article.articlePerfect = action.articlePerfect articles.articlePerfect = action.articlePerfect
} }
}, },
updateTags(state, action) { updateTags(state, action) {
@ -171,7 +178,7 @@ export const actions = {
return true; return true;
} }
// 清空已有数据 // 清空已有数据
commit('updateCommentsData', getDefaultArticlesData()) commit('updateCommentsData', getDefaultCommentsData())
commit('updateFetching', true) commit('updateFetching', true)
let data = { let data = {
@ -191,5 +198,31 @@ export const actions = {
console.log(error); console.log(error);
commit('updateFetching', false); commit('updateFetching', false);
}); });
},
fetchProducts({commit}, params = {}) {
if (params && params.reset === '0') {
return true;
}
// 清空已有数据
commit('updateProductsData', getDefaultProductsData())
commit('updateFetching', true)
let data = {
page: params.page || 1,
rows: params.rows || 10
}
return this.$axios
.$get(`${ADMIN_API_PATH}/products`, {
params: data
})
.then(response => {
commit('updateFetching', false);
commit('updateProductsData', response);
})
.catch(error => {
console.log(error);
commit('updateFetching', false);
});
} }
} }

View File

@ -51,7 +51,7 @@ export const mutations = {
state.detail.fetching = action state.detail.fetching = action
}, },
updateDetailData(state, action) { updateDetailData(state, action) {
state.detail.data = action.article state.detail.data = action
}, },
clearDetailData(state, action) { clearDetailData(state, action) {
state.detail.data = {} state.detail.data = {}
@ -103,7 +103,7 @@ export const actions = {
// 当前页判断 // 当前页判断
let currentData = JSON.parse(JSON.stringify(state)).list.data let currentData = JSON.parse(JSON.stringify(state)).list.data
let topicUri = JSON.parse(JSON.stringify(state)).topicUri let topicUri = JSON.parse(JSON.stringify(state)).topicUri
if (Number(params.page) === currentData.pagination.currentPage) { if (Number(params.page) === currentData.pageNum) {
if (topicUri && topicUri === params.topic_uri) { if (topicUri && topicUri === params.topic_uri) {
commit('updateListFetching', false) commit('updateListFetching', false)
return return

View File

@ -29,7 +29,7 @@ export const mutations = {
}, },
updateListData(state, action) { updateListData(state, action) {
state.data = { state.data = {
data: action.comments, data: action,
pagination: { pagination: {
page: 1 page: 1
} }

View File

@ -26,6 +26,7 @@ export const mutations = {
state.list.fetching = action state.list.fetching = action
}, },
updateListData(state, action) { updateListData(state, action) {
console.log(action)
state.list.data = action state.list.data = action
}, },
// 文章详情 // 文章详情
@ -33,7 +34,7 @@ export const mutations = {
state.detail.fetching = action state.detail.fetching = action
}, },
updateDetailData(state, action) { updateDetailData(state, action) {
state.detail.data = action.article state.detail.data = action
} }
} }

View File

@ -53,12 +53,10 @@ export const mutations = {
state.detail.data = action.portfolio state.detail.data = action.portfolio
}, },
updateArticleList(state, action) { updateArticleList(state, action) {
state.articles.articles = action.articles state.articles = action
state.articles.pagination = action.pagination
}, },
updateUnbindArticleList(state, action) { updateUnbindArticleList(state, action) {
state.unbindArticles.articles = action.articles state.unbindArticles = action
state.unbindArticles.pagination = action.pagination
}, },
// 更新作品集阅读全文状态 // 更新作品集阅读全文状态

View File

@ -61,7 +61,7 @@ export const actions = {
// 清空已有数据 // 清空已有数据
commit('updateListFetching', true) commit('updateListFetching', true)
let currentData = JSON.parse(JSON.stringify(state)).list.data let currentData = JSON.parse(JSON.stringify(state)).list.data
if (Number(params.page) === currentData.pagination.currentPage) { if (Number(params.page) === currentData.pageNum) {
commit('updateListFetching', false) commit('updateListFetching', false)
return return
} }