后台前端修改

This commit is contained in:
linfeng 2022-12-15 16:10:46 +08:00
parent 7a65ecad0b
commit d99d2fbec1
4 changed files with 90 additions and 542 deletions

View File

@ -1,13 +1,10 @@
<template>
<div class="divBox" style="padding-bottom:0;">
<div class="divBox" style="padding-bottom: 0">
<el-row :gutter="20" class="baseInfo">
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div class="acea-row row-between-wrapper">
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconxiaoshoue"></span>
</div> -->
<span class="main_tit">会员充值</span>
</div>
<el-tag type="primary">今日</el-tag>
@ -24,17 +21,16 @@
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div class="acea-row row-between-wrapper">
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconyonghu"></span>
</div> -->
<span class="main_tit">用户量</span>
</div>
<el-tag type="primary">总量</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.totalUser }}</span>
<span class="content-number spBlock my15">{{
viewData.totalUser
}}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">普通游客</span>
@ -45,42 +41,44 @@
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div class="acea-row row-between-wrapper">
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont icondingdan"></span>
</div> -->
<span class="main_tit">帖子数</span>
</div>
<el-tag type="primary">全部</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.totalPost }}</span>
<span class="content-number spBlock my15">{{
viewData.totalPost
}}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">待审核</span>
<span class="content-time">{{ viewData.totalPostOfReview }}</span>
<span class="content-time"
>{{ viewData.totalPostOfReview }}</span
>
</div>
</div>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div class="acea-row row-between-wrapper">
<div class="acea-row row-between-wrapper">
<div class="acea-row align-center">
<!-- <div class="main_badge">
<span class="iconfont iconxinzengyonghu"></span>
</div> -->
<span class="main_tit">新增用户</span>
</div>
<el-tag type="primary">今日</el-tag>
</div>
<div class="content" v-if="viewData">
<span class="content-number spBlock my15">{{ viewData.newUserNum }}</span>
<span class="content-number spBlock my15">{{
viewData.newUserNum
}}</span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">昨日数据</span>
<span class="content-time">{{ viewData.yesterdayNewUserNum }} </span>
<span class="content-time"
>{{ viewData.yesterdayNewUserNum }} </span
>
</div>
</div>
</el-card>
@ -89,19 +87,14 @@
</div>
</template>
<script>
export default {
data() {
return {
grid: { xl: 6, lg: 6, md: 12, sm: 12, xs: 24},
viewData:{}
}
},
methods: {
// statisticsOrder() {
// viewModelApi().then(async res => {
// this.viewData = res;
// })
// },
export default {
data() {
return {
grid: { xl: 6, lg: 6, md: 12, sm: 12, xs: 24 },
viewData: {},
};
},
methods: {
statisticsOrder() {
this.dataListLoading = true;
this.$http({
@ -110,77 +103,77 @@
}).then(({ data }) => {
if (data && data.code === 0) {
// console.log(data.result)
this.viewData=data.result
this.viewData = data.result;
}
this.dataListLoading = false;
});
}
},
mounted() {
this.statisticsOrder();
}
}
},
mounted() {
this.statisticsOrder();
},
};
</script>
<style scoped lang="scss">
.ivu-mb{
margin-bottom: 20px;
}
.up, .el-icon-caret-top {
color: #F5222D;
font-size: 12px;
opacity: 1 !important;
}
.ivu-mb {
margin-bottom: 20px;
}
.up,
.el-icon-caret-top {
color: #f5222d;
font-size: 12px;
opacity: 1 !important;
}
.down, .el-icon-caret-bottom {
color: #39C15B;
font-size: 12px;
/*opacity: 100% !important;*/
.down,
.el-icon-caret-bottom {
color: #39c15b;
font-size: 12px;
}
.main_tit {
color: #333;
font-size: 14px;
font-weight: 500;
}
.content-time {
font-size: 14px;
color: #333;
font-weight: 500;
}
.main_badge {
width: 30px;
height: 30px;
border-radius: 5px;
margin-right: 10px;
background: #2c90ff;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.my15 {
margin: 15px 0 15px;
}
.align-center {
align-items: center;
}
.baseInfo {
/deep/ .el-card__header {
padding: 15px 20px !important;
}
.main_tit{
}
.content {
&-number {
font-size: 30px;
font-weight: 600;
font-family: PingFangSC-Semibold, PingFang SC;
color: #333;
}
&-time {
font-size: 14px;
font-weight: 500;
}
.content-time{
font-size: 14px;
color:#333;
font-weight: 500;
}
.main_badge{
width: 30px;
height: 30px;
border-radius: 5px;
margin-right: 10px;
background: #2C90FF;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.my15{
margin: 15px 0 15px;
}
.align-center{
align-items: center;
}
.baseInfo {
/deep/ .el-card__header {
padding: 15px 20px !important;
}
}
.content {
&-number {
font-size: 30px;
font-weight: 600;
font-family: PingFangSC-Semibold, PingFang SC;
color: #333;
}
&-time{
font-size:14px;
color: #333333;
font-weight: 400;
}
color: #333333;
font-weight: 400;
}
}
</style>

View File

@ -53,9 +53,6 @@
pid: [
{ required: true, message: '父级id不能为空', trigger: 'blur' }
],
// type: [
// { required: true, message: ':1', trigger: 'blur' }
// ],
uid: [
{ required: true, message: '评论作者ID不能为空', trigger: 'blur' }
],

View File

@ -1,201 +0,0 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户id" prop="uid">
<el-input v-model="dataForm.uid" placeholder="用户id"></el-input>
</el-form-item>
<el-form-item label="圈子id" prop="topicId">
<el-input v-model="dataForm.topicId" placeholder="圈子id"></el-input>
</el-form-item>
<el-form-item label="话题id" prop="discussId">
<el-input v-model="dataForm.discussId" placeholder="话题id"></el-input>
</el-form-item>
<el-form-item label="投票id" prop="voteId">
<el-input v-model="dataForm.voteId" placeholder="投票id"></el-input>
</el-form-item>
<el-form-item label="标题" prop="title">
<el-input v-model="dataForm.title" placeholder="标题"></el-input>
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="dataForm.content" placeholder="内容"></el-input>
</el-form-item>
<el-form-item label="文件" prop="media">
<el-input v-model="dataForm.media" placeholder="文件"></el-input>
</el-form-item>
<el-form-item label="浏览量" prop="readCount">
<el-input v-model="dataForm.readCount" placeholder="浏览量"></el-input>
</el-form-item>
<el-form-item label="置顶" prop="postTop">
<el-input v-model="dataForm.postTop" placeholder="置顶"></el-input>
</el-form-item>
<el-form-item label="帖子类型1 图文 2视频 3文章4投票" prop="type">
<el-input v-model="dataForm.type" placeholder="帖子类型1 图文 2视频 3文章4投票"></el-input>
</el-form-item>
<el-form-item label="地址名称" prop="address">
<el-input v-model="dataForm.address" placeholder="地址名称"></el-input>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="dataForm.longitude" placeholder="经度"></el-input>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="dataForm.latitude" placeholder="纬度"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
uid: '',
topicId: '',
discussId: '',
voteId: '',
title: '',
content: '',
media: '',
readCount: '',
postTop: '',
type: '',
address: '',
longitude: '',
latitude: '',
createTime: ''
},
dataRule: {
uid: [
{ required: true, message: '用户id不能为空', trigger: 'blur' }
],
topicId: [
{ required: true, message: '圈子id不能为空', trigger: 'blur' }
],
discussId: [
{ required: true, message: '话题id不能为空', trigger: 'blur' }
],
voteId: [
{ required: true, message: '投票id不能为空', trigger: 'blur' }
],
title: [
{ required: true, message: '标题不能为空', trigger: 'blur' }
],
content: [
{ required: true, message: '内容不能为空', trigger: 'blur' }
],
media: [
{ required: true, message: '文件不能为空', trigger: 'blur' }
],
readCount: [
{ required: true, message: '浏览量不能为空', trigger: 'blur' }
],
postTop: [
{ required: true, message: '置顶不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '帖子类型1 图文 2视频 3文章4投票不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '地址名称不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '经度不能为空', trigger: 'blur' }
],
latitude: [
{ required: true, message: '纬度不能为空', trigger: 'blur' }
],
createTime: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/admin/post/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.uid = data.post.uid
this.dataForm.topicId = data.post.topicId
this.dataForm.discussId = data.post.discussId
this.dataForm.voteId = data.post.voteId
this.dataForm.title = data.post.title
this.dataForm.content = data.post.content
this.dataForm.media = data.post.media
this.dataForm.readCount = data.post.readCount
this.dataForm.postTop = data.post.postTop
this.dataForm.type = data.post.type
this.dataForm.address = data.post.address
this.dataForm.longitude = data.post.longitude
this.dataForm.latitude = data.post.latitude
this.dataForm.createTime = data.post.createTime
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/admin/post/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'uid': this.dataForm.uid,
'topicId': this.dataForm.topicId,
'discussId': this.dataForm.discussId,
'voteId': this.dataForm.voteId,
'title': this.dataForm.title,
'content': this.dataForm.content,
'media': this.dataForm.media,
'readCount': this.dataForm.readCount,
'postTop': this.dataForm.postTop,
'type': this.dataForm.type,
'address': this.dataForm.address,
'longitude': this.dataForm.longitude,
'latitude': this.dataForm.latitude,
'createTime': this.dataForm.createTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@ -1,241 +0,0 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<!-- <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> -->
<el-form-item>
<!-- <el-button @click="getDataList()">查询</el-button> -->
<el-button v-if="isAuth('admin:post:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('admin:post:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
label="id">
</el-table-column>
<el-table-column
prop="uid"
header-align="center"
align="center"
label="用户id">
</el-table-column>
<el-table-column
prop="topicId"
header-align="center"
align="center"
label="圈子id">
</el-table-column>
<el-table-column
prop="discussId"
header-align="center"
align="center"
label="话题id">
</el-table-column>
<el-table-column
prop="voteId"
header-align="center"
align="center"
label="投票id">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="标题">
</el-table-column>
<el-table-column
prop="content"
header-align="center"
align="center"
label="内容">
</el-table-column>
<el-table-column
prop="media"
header-align="center"
align="center"
label="文件">
</el-table-column>
<el-table-column
prop="readCount"
header-align="center"
align="center"
label="浏览量">
</el-table-column>
<el-table-column
prop="postTop"
header-align="center"
align="center"
label="置顶">
</el-table-column>
<el-table-column
prop="type"
header-align="center"
align="center"
label="帖子类型1 图文 2视频 3文章4投票">
</el-table-column>
<el-table-column
prop="address"
header-align="center"
align="center"
label="地址名称">
</el-table-column>
<el-table-column
prop="longitude"
header-align="center"
align="center"
label="经度">
</el-table-column>
<el-table-column
prop="latitude"
header-align="center"
align="center"
label="纬度">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './post-add-or-update'
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/admin/post/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
selectionChangeHandle (val) {
this.dataListSelections = val
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/admin/post/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>