This commit is contained in:
ronger 2022-11-01 08:06:18 +08:00
commit 2efafd12c0
6 changed files with 136 additions and 210 deletions

View File

@ -5,7 +5,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="登录 IP" label="登录 IP"
@ -29,11 +29,11 @@
:hide-on-single-page="true" :hide-on-single-page="true"
@current-change="currentChange" @current-change="currentChange"
@size-change="sizeChange" @size-change="sizeChange"
: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>
@ -61,7 +61,7 @@ export default {
let _ts = this; let _ts = this;
let search = { let search = {
size: size, size: size,
page: _ts.records.pagination.currentPage page: _ts.records.pageNum
} }
_ts.$emit('currentChange', search); _ts.$emit('currentChange', search);
}, },
@ -69,7 +69,7 @@ export default {
let _ts = this; let _ts = this;
let search = { let search = {
page: page, page: page,
size: _ts.records.pagination.pageSize size: _ts.records.pageSize
} }
_ts.$emit('currentChange', search); _ts.$emit('currentChange', search);
} }

View File

@ -139,7 +139,7 @@ export default {
handleSizeChange(pageSize) { handleSizeChange(pageSize) {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchArticles', { _ts.$store.dispatch('admin/fetchArticles', {
page: _ts.pagination.currentPage, page: _ts.articles.pageNum,
rows: pageSize rows: pageSize
}) })
}, },
@ -147,7 +147,7 @@ export default {
let _ts = this; let _ts = this;
_ts.$store.dispatch('admin/fetchArticles', { _ts.$store.dispatch('admin/fetchArticles', {
page: page, page: page,
rows: _ts.pagination.pageSize rows: _ts.articles.pageSize
}) })
}, },
toggleStatus() {}, toggleStatus() {},
@ -158,7 +158,6 @@ export default {
articlePerfect: '1' articlePerfect: '1'
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', { _ts.$store.commit('admin/updateArticlePreference', {
index: index, index: index,
idArticle: idArticle, idArticle: idArticle,
@ -166,8 +165,7 @@ export default {
}) })
_ts.$message.success("设置成功!"); _ts.$message.success("设置成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("设置失败!");
}
} }
}) })
}, },
@ -178,7 +176,6 @@ export default {
articlePerfect: '0' articlePerfect: '0'
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', { _ts.$store.commit('admin/updateArticlePreference', {
index: index, index: index,
idArticle: idArticle, idArticle: idArticle,
@ -186,8 +183,7 @@ export default {
}) })
_ts.$message.success("取消成功!"); _ts.$message.success("取消成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("取消失败!");
}
} }
}) })
}, },

View File

@ -42,143 +42,91 @@
<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 <el-table :data="articles.list" style="width: 100%">
:data="articles.list" <el-table-column label="#" width="60" prop="idArticle">
style="width: 100%">
<el-table-column
label="#"
width="60"
prop="idArticle">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="标题" prop="articleTitle">
label="标题"
prop="articleTitle">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="openLink(scope.row.articlePermalink)">{{ scope.row.articleTitle }}</el-button> <el-button type="text" @click="openLink(scope.row.articlePermalink)">{{ scope.row.articleTitle }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="标签" prop="articleTitle">
label="标签"
prop="articleTitle">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag <el-tag style="margin-left: 0.5rem;" v-for="tag in scope.row.tags" :key="tag.idTag" size="mini"
style="margin-left: 0.5rem;"
v-for="tag in scope.row.tags"
:key="tag.idTag"
size="mini"
effect="plain"> effect="plain">
# {{ tag.tagTitle }} # {{ tag.tagTitle }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="最后更新时间" width="180" prop="updatedTime">
label="最后更新时间"
width="180"
prop="updatedTime">
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.articlePerfect === '1'" size="mini" @click="cancelPreference(scope.$index, scope.row.idArticle)" plain>取消优选</el-button> <el-button v-if="scope.row.articlePerfect === '1'" size="mini"
<el-button v-else size="mini" @click="setPreference(scope.$index, scope.row.idArticle)" plain>设为优选</el-button> @click="cancelPreference(scope.$index, scope.row.idArticle)" plain>取消优选</el-button>
<el-button size="mini" type="primary" <el-button v-else size="mini" @click="setPreference(scope.$index, scope.row.idArticle)" plain>设为优选
@click="updateTags(scope.$index, scope.row)" plain>编辑标签 </el-button>
<el-button size="mini" type="primary" @click="updateTags(scope.$index, scope.row)" plain>编辑标签
</el-button> </el-button>
<el-button v-if="scope.row.articleStatus === '0'" size="mini" type="danger" <el-button v-if="scope.row.articleStatus === '0'" size="mini" type="danger"
@click="toggleStatus(scope.$index, scope.row)" plain>下架 @click="toggleStatus(scope.$index, scope.row)" plain>下架
</el-button> </el-button>
<el-button v-else size="mini" type="success" <el-button v-else size="mini" type="success" @click="toggleStatus(scope.$index, scope.row)" plain>上架
@click="toggleStatus(scope.$index, scope.row)" plain>上架
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col> </el-col>
<el-col> <el-col>
<el-pagination <el-pagination :hide-on-single-page="true" @size-change="handleArticleSizeChange"
:hide-on-single-page="true" @current-change="handleArticleCurrentChange" :current-page="articles.pageNum"
@size-change="handleArticleSizeChange" :page-sizes="[10, 20, 50, 100]" :page-size="articles.pageSize"
@current-change="handleArticleCurrentChange" layout="total, sizes, prev, pager, next, jumper" :total="articles.total">
:current-page="articles.pageNum"
:page-sizes="[10, 20, 50, 100]"
:page-size="articles.pageSize"
layout="total, sizes, prev, pager, next, jumper"
: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.list" <el-table :data="users.list" style="width: 100%">
style="width: 100%"> <el-table-column label="#" width="40" prop="idUser">
<el-table-column
label="#"
width="40"
prop="idUser">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="头像" width="60" prop="avatarUrl">
label="头像"
width="60"
prop="avatarUrl">
<template slot-scope="scope"> <template slot-scope="scope">
<el-avatar v-if="scope.row.avatarUrl" size="medium" :src="scope.row.avatarUrl"></el-avatar> <el-avatar v-if="scope.row.avatarUrl" size="medium" :src="scope.row.avatarUrl"></el-avatar>
<el-avatar v-else size="medium" src="https://rymcu.com/article/1578475481946.png"></el-avatar> <el-avatar v-else size="medium" src="https://rymcu.com/article/1578475481946.png"></el-avatar>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="昵称" width="140" prop="nickname">
label="昵称"
width="140"
prop="nickname">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :href="getUserPath(scope.row.account)" :underline="false"> <el-link type="primary" :href="getUserPath(scope.row.account)" :underline="false">
{{ scope.row.nickname }} {{ scope.row.nickname }}
</el-link> </el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="注册时间" width="180" prop="createdTime">
label="注册时间"
width="180"
prop="createdTime">
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-col> </el-col>
<el-col> <el-col>
<el-pagination <el-pagination :hide-on-single-page="true" @size-change="handleUserSizeChange"
:hide-on-single-page="true" @current-change="handleUserCurrentChange" :current-page="users.pageNum" :page-sizes="[10, 20, 50, 100]"
@size-change="handleUserSizeChange" :page-size="users.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="users.total">
@current-change="handleUserCurrentChange"
:current-page="users.pageNum"
:page-sizes="[10, 20, 50, 100]"
:page-size="users.pageSize"
layout="total, sizes, prev, pager, next, jumper"
: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.list" <el-table :data="bankAccounts.list" style="width: 100%">
style="width: 100%"> <el-table-column label="#" width="40" prop="idBank">
<el-table-column
label="#"
width="40"
prop="idBank">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="银行账户" width="180" prop="bankAccount">
label="银行账户"
width="180"
prop="bankAccount">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="账户所有者" width="180" prop="accountOwnerName">
label="账户所有者"
width="180"
prop="accountOwnerName">
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="账户余额 (巴旦木)" width="180" prop="accountBalance">
label="账户余额 (巴旦木)"
width="180"
prop="accountBalance">
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
@ -188,15 +136,10 @@
</el-table> </el-table>
</el-col> </el-col>
<el-col> <el-col>
<el-pagination <el-pagination :hide-on-single-page="true" @size-change="handleBankAccountSizeChange"
:hide-on-single-page="true" @current-change="handleBankAccountCurrentChange" :current-page="bankAccounts.pageNum"
@size-change="handleBankAccountSizeChange" :page-sizes="[10, 20, 50, 100]" :page-size="bankAccounts.pageSize"
@current-change="handleBankAccountCurrentChange" layout="total, sizes, prev, pager, next, jumper" :total="bankAccounts.total">
:current-page="bankAccounts.pageNum"
:page-sizes="[10, 20, 50, 100]"
:page-size="bankAccounts.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="bankAccounts.total">
</el-pagination> </el-pagination>
</el-col> </el-col>
</div> </div>
@ -229,10 +172,7 @@
</el-col> </el-col>
<el-col> <el-col>
<el-dialog :visible.sync="tagsDialogVisible"> <el-dialog :visible.sync="tagsDialogVisible">
<edit-tags <edit-tags :idArticle="idArticle" :tags="articleTags" @closeDialog="closeTagsDialog">
:idArticle="idArticle"
:tags="articleTags"
@closeDialog="closeTagsDialog">
</edit-tags> </edit-tags>
</el-dialog> </el-dialog>
</el-col> </el-col>
@ -504,7 +444,6 @@ export default {
articlePerfect: '1' articlePerfect: '1'
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', { _ts.$store.commit('admin/updateArticlePreference', {
index: index, index: index,
idArticle: idArticle, idArticle: idArticle,
@ -512,8 +451,7 @@ export default {
}) })
_ts.$message.success("设置成功!"); _ts.$message.success("设置成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("设置失败!");
}
} }
}) })
}, },
@ -524,7 +462,6 @@ export default {
articlePerfect: '0' articlePerfect: '0'
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) {
_ts.$store.commit('admin/updateArticlePreference', { _ts.$store.commit('admin/updateArticlePreference', {
index: index, index: index,
idArticle: idArticle, idArticle: idArticle,
@ -532,8 +469,7 @@ export default {
}) })
_ts.$message.success("取消成功!"); _ts.$message.success("取消成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("取消失败!");
}
} }
}) })
}, },
@ -592,11 +528,11 @@ export default {
}, },
}, },
mounted() { mounted() {
let _ts = this this.$store.commit("setActiveMenu", "admin-dashboard");
Vue.nextTick(() => { setTimeout(() => {
_ts.initLastThirtyDaysCharts(_ts.lastThirtyDays) this.initLastThirtyDaysCharts(this.lastThirtyDays)
_ts.initHistoryCharts(_ts.history) this.initHistoryCharts(this.history)
}) }, 500);
} }
} }
</script> </script>

View File

@ -342,12 +342,10 @@ export default {
articlePerfect: '1', articlePerfect: '1',
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) { _ts.$set(_ts, 'isPerfect', true);
_ts.$set(_ts, 'isPerfect', false);
_ts.$message.success("设置成功!"); _ts.$message.success("设置成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("设置失败!");
}
} }
}) })
}, },
@ -358,12 +356,10 @@ export default {
articlePerfect: '0', articlePerfect: '0',
}).then(function (res) { }).then(function (res) {
if (res) { if (res) {
if (res.success) { _ts.$set(_ts, 'isPerfect', false);
_ts.$set(_ts, 'isPerfect', true);
_ts.$message.success("取消成功!"); _ts.$message.success("取消成功!");
} else { } else {
_ts.$message.error(_ts.message); _ts.$message.error("设置失败!");
}
} }
}) })
}, },

View File

@ -154,24 +154,22 @@ export default {
} }
}, },
mounted() { mounted() {
let _ts = this this.$store.commit("setActiveMenu", "open-data");
_ts.$store.commit("setActiveMenu", "open-data"); setTimeout(() => {
Vue.nextTick(() => { this.initLastThirtyDaysCharts(this.lastThirtyDays)
_ts.initLastThirtyDaysCharts(_ts.lastThirtyDays) }, 500);
})
} }
} }
</script> </script>
<style scoped> <style scoped>
.article__wrapper { .article__wrapper {
max-width: 980px; max-width: 980px;
margin: 20px auto; margin: 20px auto;
display: block; display: block;
padding-left: 1rem; padding-left: 1rem;
padding-right: 1rem; padding-right: 1rem;
box-sizing: border-box;; box-sizing: border-box;
} }
.mt-2rem { .mt-2rem {

View File

@ -158,9 +158,9 @@ export default {
if (res.message) { if (res.message) {
_ts.$message.error(res.message); _ts.$message.error(res.message);
} else { } else {
_ts.$set(_ts, 'user', res.user); _ts.$set(_ts, 'user', res);
_ts.$set(_ts, 'avatarUrl', res.user.avatarUrl); _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
_ts.$refs.cropper.replace(res.user.avatarUrl); _ts.$refs.cropper.replace(res.avatarUrl);
// _ts.webImageToBase64(res.user.avatarUrl); // _ts.webImageToBase64(res.user.avatarUrl);
} }
} }
@ -192,9 +192,9 @@ export default {
if (res.message) { if (res.message) {
_ts.$message.error(res.message); _ts.$message.error(res.message);
} else { } else {
_ts.$set(_ts, 'user', res.user); _ts.$set(_ts, 'user', res);
_ts.$set(_ts, 'avatarUrl', res.user.avatarUrl); _ts.$set(_ts, 'avatarUrl', res.avatarUrl);
_ts.$store.commit('setUserInfo', res.user); _ts.$store.commit('setUserInfo', res);
_ts.$message.success('更新成功 !'); _ts.$message.success('更新成功 !');
} }
} }