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

View File

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

View File

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

View File

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

View File

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

View File

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