🎨 接口数据结构变更
This commit is contained in:
parent
40e5e85109
commit
23b52a1c2f
@ -2,7 +2,7 @@
|
||||
<el-row class="wrapper">
|
||||
<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-item v-for="article in announcements.articles" :key="article.idArticle">
|
||||
<el-carousel-item v-for="article in announcements.list" :key="article.idArticle">
|
||||
<el-card>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<el-link :href="article.articleLink" style="margin-bottom: .7rem;">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-row class="wrapper">
|
||||
<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>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<el-link :href="article.articleLink" style="margin-bottom: .5rem;">
|
||||
@ -50,11 +50,11 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:page-size="articles.pagination.pageSize"
|
||||
:current-page="articles.pagination.currentPage"
|
||||
:total="articles.pagination.total"
|
||||
:page-size="articles.pageSize"
|
||||
:current-page="articles.pageNum"
|
||||
:total="articles.total"
|
||||
prev-text="上一页"
|
||||
next-text="下一页"
|
||||
@current-change="currentChange">
|
||||
|
@ -19,7 +19,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="records.records"
|
||||
:data="records.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="流水号"
|
||||
@ -89,11 +89,11 @@
|
||||
<el-pagination
|
||||
:hide-on-single-page="true"
|
||||
@current-change="currentChange"
|
||||
:current-page="records.pagination.currentPage"
|
||||
:current-page="records.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="records.pagination.pageSize"
|
||||
:page-size="records.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="records.pagination.total">
|
||||
:total="records.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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-link rel="nofollow" @click="onRouter(article.articleLink)" :underline="false">
|
||||
<h2 v-html="article.articleTitle"></h2>
|
||||
@ -13,15 +13,15 @@
|
||||
<el-divider></el-divider>
|
||||
</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>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="articles.pagination.currentPage"
|
||||
:total="articles.pagination.total"
|
||||
:current-page="articles.pageNum"
|
||||
:total="articles.total"
|
||||
@current-change="currentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<i class="el-icon-check"></i> 一键标记已读
|
||||
</el-link>
|
||||
</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 :xs="16" :sm="20" :xl="20">
|
||||
<el-link rel="nofollow" :underline="false" @click="onRouter(notification)" style="font-size: 1.1em;"
|
||||
@ -63,11 +63,11 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:page-size="notifications.pagination.pageSize"
|
||||
:current-page="notifications.pagination.currentPage"
|
||||
:total="notifications.pagination.total"
|
||||
:page-size="notifications.pageSize"
|
||||
:current-page="notifications.pageNum"
|
||||
:total="notifications.total"
|
||||
prev-text="上一页"
|
||||
next-text="下一页"
|
||||
@current-change="currentChange">
|
||||
@ -89,7 +89,7 @@ export default {
|
||||
computed: {
|
||||
hasUnReadNotification: function () {
|
||||
let nums = 0;
|
||||
let notifications = this.notifications.notifications;
|
||||
let notifications = this.notifications.list;
|
||||
for (const index in notifications) {
|
||||
if (notifications[index].hasRead === '0') {
|
||||
nums++;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<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-card :body-style="{ padding: '20px' }">
|
||||
<el-col :span="12">
|
||||
@ -45,10 +45,10 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="portfolios.pagination.currentPage"
|
||||
:total="portfolios.pagination.total"
|
||||
:current-page="portfolios.pageNum"
|
||||
:total="portfolios.total"
|
||||
prev-text="上一页"
|
||||
next-text="下一页"
|
||||
@current-change="currentChange">
|
||||
|
@ -15,7 +15,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="articles.pagination.currentPage"
|
||||
:total="articles.pagination.total"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-table :data="articles.articles" style="width: 100%">
|
||||
<el-table :data="articles.list" style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
width="40"
|
||||
@ -34,10 +34,10 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="articles.pagination.currentPage"
|
||||
:total="articles.pagination.total"
|
||||
:current-page="articles.pageNum"
|
||||
:total="articles.total"
|
||||
prev-text="上一页"
|
||||
next-text="下一页"
|
||||
@current-change="currentChange">
|
||||
@ -72,11 +72,6 @@
|
||||
data() {
|
||||
return {
|
||||
articles: {
|
||||
articles: [],
|
||||
pagination: {
|
||||
total: 0,
|
||||
currentPage: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -88,7 +83,7 @@
|
||||
let _ts = this;
|
||||
const responseTopData = await this.$axios.$get('/api/console/portfolio/' + _ts.idPortfolio + '/articles?page='+page);
|
||||
if (responseTopData) {
|
||||
responseTopData.pagination.currentPage = page;
|
||||
responseTopData.pageNum = page;
|
||||
_ts.$set(_ts, 'articles', responseTopData);
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
@ -124,7 +119,7 @@
|
||||
}).then(function (res) {
|
||||
if (res) {
|
||||
_ts.$message(res.message);
|
||||
_ts.currentChange(_ts.articles.pagination.currentPage);
|
||||
_ts.currentChange(_ts.articles.pageNum);
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<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-col :span="24">
|
||||
<el-image :src="product.productImgUrl"
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<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-col :span="24">
|
||||
<el-link target="_blank" :href="'/user/' + user.account" class="text-default" :underline="false">
|
||||
@ -30,10 +30,10 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="users.pagination.currentPage"
|
||||
:total="users.pagination.total"
|
||||
:current-page="users.pageNum"
|
||||
:total="users.total"
|
||||
@current-change="currentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
@ -290,8 +290,8 @@ export default {
|
||||
if (_ts.user) {
|
||||
_ts.$axios.$get('/api/notification/unread').then(function (res) {
|
||||
if (res) {
|
||||
_ts.$set(_ts, 'notifications', res.notifications);
|
||||
_ts.$set(_ts, 'notificationNumbers', res.pagination.total === 0 ? "" : res.pagination.total);
|
||||
_ts.$set(_ts, 'notifications', res.list);
|
||||
_ts.$set(_ts, 'notificationNumbers', res.total === 0 ? "" : res.total);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -117,6 +117,13 @@ export default {
|
||||
path: '/admin/currency-rules',
|
||||
icon: 'el-icon-document',
|
||||
closable: true
|
||||
},
|
||||
{
|
||||
title: '产品管理',
|
||||
name: 'admin-products',
|
||||
path: '/admin/products',
|
||||
icon: 'el-icon-box',
|
||||
closable: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -11,16 +11,16 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="articles.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="articles.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="articles.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="articles"
|
||||
:data="articles.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -82,11 +82,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="articles.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="articles.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="articles.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -119,8 +119,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
articles: state => state.admin.article.articles,
|
||||
pagination: state => state.admin.article.pagination
|
||||
articles: state => state.admin.articles
|
||||
})
|
||||
},
|
||||
data() {
|
||||
|
@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="bankAccounts"
|
||||
:data="bankAccounts.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -54,11 +54,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="bankAccounts.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="bankAccounts.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="bankAccounts.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-dialog :title="'卡号:' + bankAccount + ' 的交易记录'" :visible.sync="dialogVisible">
|
||||
@ -85,8 +85,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
bankAccounts: state => state["bank-account"].list.data.bankAccounts,
|
||||
pagination: state => state["bank-account"].list.data.pagination,
|
||||
bankAccounts: state => state["bank-account"].list.data,
|
||||
records: state => state["bank-account"].records.data
|
||||
})
|
||||
},
|
||||
@ -108,7 +107,7 @@ export default {
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank-account/fetchList', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.bankAccounts.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -116,7 +115,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank-account/fetchList', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.bankAccounts.pageSize
|
||||
})
|
||||
},
|
||||
transactionRecords(index, bankAccount) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="banks"
|
||||
:data="banks.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -52,11 +52,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="banks.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="banks.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="banks.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -96,8 +96,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
banks: state => state.bank.list.data.banks,
|
||||
pagination: state => state.bank.list.data.pagination
|
||||
banks: state => state.bank.list.data
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@ -120,7 +119,7 @@ export default {
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank/fetchList', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.banks.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -128,7 +127,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank/fetchList', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.banks.pageSize
|
||||
})
|
||||
},
|
||||
showTransfer(index, bank) {
|
||||
|
@ -11,15 +11,15 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="comments.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="comments.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="comments.total">
|
||||
</el-pagination>
|
||||
</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-col style="margin-bottom: 1rem;">
|
||||
<el-link :href="comment.commentSharpUrl">
|
||||
@ -82,11 +82,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="comments.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="comments.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="comments.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -106,8 +106,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
comments: state => state.admin.comment.comments,
|
||||
pagination: state => state.admin.comment.pagination
|
||||
comments: state => state.admin.comments
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@ -137,7 +136,7 @@ export default {
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchComments', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.comments.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -145,7 +144,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchComments', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.comments.pageSize
|
||||
})
|
||||
},
|
||||
toggleStatus() {}
|
||||
|
@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="rules"
|
||||
:data="rules.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="规则名称"
|
||||
@ -45,11 +45,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="rules.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="rules.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="rules.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -90,8 +90,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
rules: state => state["currency-rule"].list.data.rules,
|
||||
pagination: state => state["currency-rule"].list.data.pagination
|
||||
rules: state => state["currency-rule"].list.data
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@ -114,7 +113,7 @@ export default {
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank/fetchList', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.rules.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -122,7 +121,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('bank/fetchList', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.rules.pageSize
|
||||
})
|
||||
},
|
||||
showTransfer(index, bank) {
|
||||
|
@ -43,7 +43,7 @@
|
||||
<h3>新增文章列表</h3>
|
||||
</el-col>
|
||||
<el-table
|
||||
:data="articles.articles"
|
||||
:data="articles.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -98,18 +98,18 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleArticleSizeChange"
|
||||
@current-change="handleArticleCurrentChange"
|
||||
:current-page="articles.pagination.currentPage"
|
||||
:current-page="articles.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="articles.pagination.pageSize"
|
||||
:page-size="articles.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="articles.pagination.total">
|
||||
:total="articles.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-col :span="24" style="text-align: left;">
|
||||
<h3>新增用户列表</h3>
|
||||
</el-col>
|
||||
<el-table :data="users.users"
|
||||
<el-table :data="users.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -147,18 +147,18 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleUserSizeChange"
|
||||
@current-change="handleUserCurrentChange"
|
||||
:current-page="users.pagination.currentPage"
|
||||
:current-page="users.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="users.pagination.pageSize"
|
||||
:page-size="users.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="users.pagination.total">
|
||||
:total="users.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-col :span="24" style="text-align: left;">
|
||||
<h3>新增账户列表</h3>
|
||||
</el-col>
|
||||
<el-table :data="bankAccounts.bankAccounts"
|
||||
<el-table :data="bankAccounts.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -192,11 +192,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleBankAccountSizeChange"
|
||||
@current-change="handleBankAccountCurrentChange"
|
||||
:current-page="bankAccounts.pagination.currentPage"
|
||||
:current-page="bankAccounts.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="bankAccounts.pagination.pageSize"
|
||||
:page-size="bankAccounts.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="bankAccounts.pagination.total">
|
||||
:total="bankAccounts.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
</div>
|
||||
@ -549,7 +549,7 @@ export default {
|
||||
handleArticleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewArticles', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -557,13 +557,13 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewArticles', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.pageSize
|
||||
})
|
||||
},
|
||||
handleUserSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewUsers', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -571,13 +571,13 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewUsers', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.pageSize
|
||||
})
|
||||
},
|
||||
handleBankAccountSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewBankAccounts', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -585,7 +585,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('dashboard/fetchNewBankAccounts', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.pageSize
|
||||
})
|
||||
},
|
||||
},
|
||||
|
166
pages/admin/products.vue
Normal file
166
pages/admin/products.vue
Normal 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>
|
@ -9,7 +9,7 @@
|
||||
<el-col>
|
||||
<el-button type="primary" @click="showAddDialog" plain>添加角色</el-button>
|
||||
<el-table
|
||||
:data="roles"
|
||||
:data="roles.list"
|
||||
style="width: 100%;margin-top: 1rem;">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -57,11 +57,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="roles.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="roles.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="roles.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -100,8 +100,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
pagination: state => state.admin.role.pagination,
|
||||
roles: state => state.admin.role.roles
|
||||
roles: state => state.admin.roles
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@ -181,7 +180,7 @@
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchRoles', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.roles.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -189,7 +188,7 @@
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchRoles', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.roles.pageSize
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
<el-button size="small" @click="createTag" plain>创建标签</el-button>
|
||||
<el-button size="small" @click="cleanUnusedTag" plain>清除未使用标签</el-button>
|
||||
</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-col :span="1">
|
||||
<el-avatar shape="square" :src="tag.tagIconPath" fit="scale-down"></el-avatar>
|
||||
@ -32,10 +32,10 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="pagination.currentPage"
|
||||
:total="pagination.total"
|
||||
:current-page="tags.pageNum"
|
||||
:total="tags.total"
|
||||
@current-change="currentChange">
|
||||
</el-pagination>
|
||||
</div>
|
||||
@ -57,8 +57,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
tags: state => state.tag.list.data.tags,
|
||||
pagination: state => state.tag.list.data.pagination
|
||||
tags: state => state.tag.list.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@ -73,7 +72,7 @@
|
||||
if (res && res.message){
|
||||
_ts.$message.error(res.message);
|
||||
} else {
|
||||
const p = _ts.pagination.currentPage;
|
||||
const p = _ts.tags.pageNum;
|
||||
_ts.currentChange(p);
|
||||
_ts.$message({
|
||||
type: 'success',
|
||||
|
@ -54,7 +54,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="pagination.currentPage"
|
||||
:total="pagination.total"
|
||||
|
@ -36,7 +36,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"
|
||||
:current-page="pagination.currentPage"
|
||||
:total="pagination.total"
|
||||
|
@ -9,7 +9,7 @@
|
||||
<el-col style="margin: .5rem;">
|
||||
<el-button size="small" @click="createTopic" plain>创建专题</el-button>
|
||||
</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>
|
||||
<div class="card-body d-flex flex-column">
|
||||
<el-col :span="4" style="text-align: right;">
|
||||
@ -48,8 +48,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
topics: state => state.topic.list.data.topics,
|
||||
pagination: state => state.topic.list.data.pagination
|
||||
topics: state => state.topic.list.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-table
|
||||
:data="users"
|
||||
:data="users.list"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="#"
|
||||
@ -89,11 +89,11 @@
|
||||
:hide-on-single-page="true"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pagination.currentPage"
|
||||
:current-page="users.pageNum"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pagination.pageSize"
|
||||
:page-size="users.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pagination.total">
|
||||
:total="users.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -129,9 +129,8 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
users: state => state.admin.user.users,
|
||||
pagination: state => state.admin.user.pagination,
|
||||
roles: state => state.admin.role.roles
|
||||
users: state => state.admin.users,
|
||||
roles: state => state.admin.roles.list
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@ -196,7 +195,7 @@ export default {
|
||||
handleSizeChange(pageSize) {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchUsers', {
|
||||
page: _ts.pagination.currentPage,
|
||||
page: _ts.users.pageNum,
|
||||
rows: pageSize
|
||||
})
|
||||
},
|
||||
@ -204,7 +203,7 @@ export default {
|
||||
let _ts = this;
|
||||
_ts.$store.dispatch('admin/fetchUsers', {
|
||||
page: page,
|
||||
rows: _ts.pagination.pageSize
|
||||
rows: _ts.users.pageSize
|
||||
})
|
||||
},
|
||||
updateRole() {
|
||||
@ -221,6 +220,7 @@ export default {
|
||||
message: '授权成功',
|
||||
type: 'success'
|
||||
});
|
||||
|
||||
_ts.$set(_ts, 'dialogVisible', false);
|
||||
_ts.$set(_ts, 'idUser', 0);
|
||||
_ts.$set(_ts, 'idRole', 0);
|
||||
|
@ -306,7 +306,7 @@
|
||||
_ts.$store.commit('article/clearDetailData')
|
||||
_ts.$set(_ts, 'notificationFlag', false);
|
||||
_ts.$router.push({
|
||||
path: `/article/${res.id}`
|
||||
path: `/article/${res}`
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -343,7 +343,7 @@
|
||||
_ts.contentEditor.setValue('');
|
||||
_ts.$set(_ts, 'notificationFlag', false);
|
||||
_ts.$router.push({
|
||||
path: `/draft/${res.id}`
|
||||
path: `/draft/${res}`
|
||||
})
|
||||
}
|
||||
})
|
||||
|
@ -7,13 +7,13 @@
|
||||
</el-col>
|
||||
<el-col>
|
||||
<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"/>
|
||||
</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"/>
|
||||
</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"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
@ -28,13 +28,21 @@ const getDefaultCommentsData = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const getDefaultProductsData = () => {
|
||||
return {
|
||||
products: [],
|
||||
pagination: {}
|
||||
}
|
||||
}
|
||||
|
||||
export const state = () => {
|
||||
return {
|
||||
fetching: false,
|
||||
user: getDefaultUsersData(),
|
||||
role: getDefaultRolesData(),
|
||||
article: getDefaultArticlesData(),
|
||||
comment: getDefaultCommentsData(),
|
||||
users: getDefaultUsersData(),
|
||||
roles: getDefaultRolesData(),
|
||||
articles: getDefaultArticlesData(),
|
||||
comments: getDefaultCommentsData(),
|
||||
products: getDefaultProductsData(),
|
||||
tabs: [
|
||||
{
|
||||
title: 'Dashboard',
|
||||
@ -53,25 +61,24 @@ export const mutations = {
|
||||
state.fetching = action
|
||||
},
|
||||
updateUsersData(state, action) {
|
||||
state.user.users = action.users
|
||||
state.user.pagination = action.pagination
|
||||
state.users = action
|
||||
},
|
||||
updateRolesData(state, action) {
|
||||
state.role.roles = action.roles
|
||||
state.role.pagination = action.pagination
|
||||
state.roles = action
|
||||
},
|
||||
updateArticlesData(state, action) {
|
||||
state.article.articles = action.articles
|
||||
state.article.pagination = action.pagination
|
||||
state.articles = action
|
||||
},
|
||||
updateCommentsData(state, action) {
|
||||
state.comment.comments = action.comments
|
||||
state.comment.pagination = action.pagination
|
||||
state.comments = action
|
||||
},
|
||||
updateProductsData(state, action) {
|
||||
state.products = action
|
||||
},
|
||||
updateArticlePreference(state, action) {
|
||||
let article = state.article.articles[action.index]
|
||||
if (article.idArticle === action.idArticle) {
|
||||
article.articlePerfect = action.articlePerfect
|
||||
let articles = state.articles.list[action.index]
|
||||
if (articles.idArticle === action.idArticle) {
|
||||
articles.articlePerfect = action.articlePerfect
|
||||
}
|
||||
},
|
||||
updateTags(state, action) {
|
||||
@ -171,7 +178,7 @@ export const actions = {
|
||||
return true;
|
||||
}
|
||||
// 清空已有数据
|
||||
commit('updateCommentsData', getDefaultArticlesData())
|
||||
commit('updateCommentsData', getDefaultCommentsData())
|
||||
commit('updateFetching', true)
|
||||
|
||||
let data = {
|
||||
@ -191,5 +198,31 @@ export const actions = {
|
||||
console.log(error);
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ export const mutations = {
|
||||
state.detail.fetching = action
|
||||
},
|
||||
updateDetailData(state, action) {
|
||||
state.detail.data = action.article
|
||||
state.detail.data = action
|
||||
},
|
||||
clearDetailData(state, action) {
|
||||
state.detail.data = {}
|
||||
@ -103,7 +103,7 @@ export const actions = {
|
||||
// 当前页判断
|
||||
let currentData = JSON.parse(JSON.stringify(state)).list.data
|
||||
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) {
|
||||
commit('updateListFetching', false)
|
||||
return
|
||||
|
@ -29,7 +29,7 @@ export const mutations = {
|
||||
},
|
||||
updateListData(state, action) {
|
||||
state.data = {
|
||||
data: action.comments,
|
||||
data: action,
|
||||
pagination: {
|
||||
page: 1
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ export const mutations = {
|
||||
state.list.fetching = action
|
||||
},
|
||||
updateListData(state, action) {
|
||||
console.log(action)
|
||||
state.list.data = action
|
||||
},
|
||||
// 文章详情
|
||||
@ -33,7 +34,7 @@ export const mutations = {
|
||||
state.detail.fetching = action
|
||||
},
|
||||
updateDetailData(state, action) {
|
||||
state.detail.data = action.article
|
||||
state.detail.data = action
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,12 +53,10 @@ export const mutations = {
|
||||
state.detail.data = action.portfolio
|
||||
},
|
||||
updateArticleList(state, action) {
|
||||
state.articles.articles = action.articles
|
||||
state.articles.pagination = action.pagination
|
||||
state.articles = action
|
||||
},
|
||||
updateUnbindArticleList(state, action) {
|
||||
state.unbindArticles.articles = action.articles
|
||||
state.unbindArticles.pagination = action.pagination
|
||||
state.unbindArticles = action
|
||||
},
|
||||
|
||||
// 更新作品集阅读全文状态
|
||||
|
@ -61,7 +61,7 @@ export const actions = {
|
||||
// 清空已有数据
|
||||
commit('updateListFetching', true)
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user