|
|
@@ -1,98 +1,124 @@
|
|
|
-<!-- -->
|
|
|
<template>
|
|
|
<div class="tab7">
|
|
|
- <div class="top">
|
|
|
- <el-form
|
|
|
- :model="ruleForm"
|
|
|
- ref="ruleForm"
|
|
|
- label-width="100px"
|
|
|
- class="demo-ruleForm"
|
|
|
- >
|
|
|
- <el-form-item label="注册时间:">
|
|
|
- <el-date-picker
|
|
|
- style="width: 300px"
|
|
|
- v-model="time"
|
|
|
- type="daterange"
|
|
|
- range-separator="-"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- <span class="userName">用户账号:</span>
|
|
|
- <el-input
|
|
|
- placeholder="请输入"
|
|
|
- v-model="ruleForm.searchKey"
|
|
|
- style="width: 300px; margin-right: 50px"
|
|
|
- ></el-input>
|
|
|
- <el-button @click="inquire">查 询</el-button>
|
|
|
- <el-button @click="reset">重 置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div class="addUser">
|
|
|
- <el-button type="primary" @click="$router.push('/layout/tab7Edit')"
|
|
|
- >新 增</el-button
|
|
|
+ <div class="insideTop">
|
|
|
+ 留言审核
|
|
|
+ </div>
|
|
|
+ <div class="obstruct"></div>
|
|
|
+ <!-- 主要内容 -->
|
|
|
+ <div class="conten">
|
|
|
+ <div class="classify">全部</div>
|
|
|
+ <div class="search">
|
|
|
+ <span>提交时间:</span>
|
|
|
+ <el-date-picker
|
|
|
+ style="width: 240px"
|
|
|
+ v-model="time"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
>
|
|
|
+ </el-date-picker>
|
|
|
+ <span class="search_k">留言内容:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="formData.searchKey"
|
|
|
+ placeholder="关键字"
|
|
|
+ style="width: 240px"
|
|
|
+ ></el-input>
|
|
|
+ <span class="search_k">状态:</span>
|
|
|
+ <el-select
|
|
|
+ v-model="formData.type"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 240px"
|
|
|
+ >
|
|
|
+ <el-option label="全部" value=""></el-option>
|
|
|
+ <el-option label="待审核" value="1"></el-option>
|
|
|
+ <el-option label="审核通过" value="time"></el-option>
|
|
|
+ <el-option label="审核不通过" value="number"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- 右侧按钮 -->
|
|
|
+ <div class="search_btn">
|
|
|
+ <el-button type="primary">查 询</el-button>
|
|
|
+ <el-button>重 置</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 表格 -->
|
|
|
+ <div class="table">
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table-column label="序号" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{
|
|
|
+ scope.$index + (formData.pageNum - 1) * formData.pageSize + 1
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="留言内容">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <span class="table_name" :title="row.name1">{{ row.name1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name2" label="发布人" width="180"> </el-table-column>
|
|
|
+ <el-table-column prop="name2" label="发布时间" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name2" label="审核状态" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="180">
|
|
|
+ <template #default>
|
|
|
+ <el-button type="text" style="color: #254e91;">通过</el-button>
|
|
|
+ <el-button type="text">不通过</el-button>
|
|
|
+ <el-button type="text">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <!-- 表格 -->
|
|
|
- <div class="table">
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
- <el-table-column label="序号" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.$index + (ruleForm.pageNum - 1) * ruleForm.pageSize + 1 }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userName" label="用户账号"> </el-table-column>
|
|
|
- <el-table-column prop="phone" label="联系电话"> </el-table-column>
|
|
|
- <el-table-column prop="sexTxt" label="性别"> </el-table-column>
|
|
|
- <el-table-column prop="createTime" label="注册时间"> </el-table-column>
|
|
|
- <el-table-column label="启用状态">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-switch :disabled='scope.row.id===1' @change='change($event,scope.row.id)' v-model="tableData[scope.$index].isEnabled" :active-value='1' :inactive-value="0"></el-switch>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" width="230">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button type="text" @click="edit(row)" v-if="row.id!==1">编 辑</el-button>
|
|
|
- <el-button type="text" style="color: #b6242b" @click="delUser(row.id)" v-if="row.id!==1">删 除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
</div>
|
|
|
<!-- 分页 -->
|
|
|
<div class="paging">
|
|
|
- <span class="zong">共 {{ total }} 条</span>
|
|
|
<el-pagination
|
|
|
- layout="sizes,prev,pager,next,jumper"
|
|
|
+ layout="sizes,prev, pager, next,jumper"
|
|
|
:total="total"
|
|
|
- :page-sizes="[15, 30, 45, 60]"
|
|
|
- :current-page="ruleForm.pageNum"
|
|
|
+ :current-page="formData.pageNum"
|
|
|
@current-change="currentChange"
|
|
|
@size-change="sizeChange"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
- </div> </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { userList, userEditStatus, userRemoves } from '@/apis/tab7'
|
|
|
export default {
|
|
|
name: 'tab7',
|
|
|
components: {},
|
|
|
data () {
|
|
|
+ // 这里存放数据
|
|
|
return {
|
|
|
- total: 0,
|
|
|
+ total: 100,
|
|
|
time: '',
|
|
|
- ruleForm: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 15,
|
|
|
+ formData: {
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
- searchKey: ''
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ searchKey: '',
|
|
|
+ type: 'time'
|
|
|
},
|
|
|
- tableData: []
|
|
|
+ tableData: [
|
|
|
+ { name1: '1231231231231231231123123123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
+ { name1: '123', name2: '123', name3: false }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
+ // 监听属性 类似于data概念
|
|
|
computed: {},
|
|
|
// 监控data中的数据变化
|
|
|
watch: {
|
|
|
@@ -100,75 +126,20 @@ export default {
|
|
|
this.handleSelect(val)
|
|
|
}
|
|
|
},
|
|
|
+ // 方法集合
|
|
|
methods: {
|
|
|
- // 点击编辑
|
|
|
- edit (val) {
|
|
|
- this.$router.push({
|
|
|
- path: '/layout/tab7Edit',
|
|
|
- query: val
|
|
|
- })
|
|
|
- },
|
|
|
- // 点击删除
|
|
|
- delUser (id) {
|
|
|
- this.$confirm('确定删除吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- await userRemoves(id)
|
|
|
- this.$message.success('删除成功!')
|
|
|
- this.userList(this.ruleForm)
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message.info('已取消删除')
|
|
|
- })
|
|
|
- },
|
|
|
// 分页器方法
|
|
|
currentChange (val) {
|
|
|
// console.log('当前页改变了', val)
|
|
|
- this.ruleForm.pageNum = val
|
|
|
- this.userList(this.ruleForm)
|
|
|
},
|
|
|
sizeChange (val) {
|
|
|
// console.log('条数改变了', val)
|
|
|
- this.ruleForm.pageNum = 1
|
|
|
- this.ruleForm.pageSize = val
|
|
|
- this.userList(this.ruleForm)
|
|
|
- },
|
|
|
- // 点击查询
|
|
|
- inquire () {
|
|
|
- this.ruleForm.pageNum = 1
|
|
|
- this.userList(this.ruleForm)
|
|
|
- },
|
|
|
- // 点击重置
|
|
|
- reset () {
|
|
|
- this.ruleForm = {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 15,
|
|
|
- searchKey: ''
|
|
|
- }
|
|
|
- this.time = ''
|
|
|
- this.userList(this.ruleForm)
|
|
|
- },
|
|
|
- // 点击启用-停用账户
|
|
|
- async change (val, id) {
|
|
|
- const res = await userEditStatus(id, val)
|
|
|
- if (res.code === 0) {
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.userList(this.ruleForm)
|
|
|
- } else this.$message.warning(res.msg)
|
|
|
- },
|
|
|
- // 封装获取列表方法
|
|
|
- async userList (data) {
|
|
|
- const res = await userList(data)
|
|
|
- this.tableData = res.data.records
|
|
|
- this.total = res.data.total
|
|
|
- this.tableData.forEach((v) => {
|
|
|
- if (v.sex === 0) v.sexTxt = '男'
|
|
|
- else if (v.sex === 1) v.sexTxt = '女'
|
|
|
+ }, // 点击查看
|
|
|
+ lookGood (id) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/layout/tab7Look'
|
|
|
+ // query: { conLeftId: this.conLeft }
|
|
|
})
|
|
|
- // console.log(998, res.data.records)
|
|
|
},
|
|
|
// 时间处理----------------
|
|
|
handleSelect (e) {
|
|
|
@@ -176,11 +147,11 @@ export default {
|
|
|
for (const i in e) {
|
|
|
date.push(this.gettime(e[i]))
|
|
|
}
|
|
|
- this.ruleForm.startTime = date[0]
|
|
|
+ this.formData.startTime = date[0]
|
|
|
if (date[1]) {
|
|
|
- this.ruleForm.endTime = date[1].replace('00:00:00', '23:59:59')
|
|
|
+ this.formData.endTime = date[1].replace('00:00:00', '23:59:59')
|
|
|
}
|
|
|
- if (e === null) this.ruleForm.endTime = ''
|
|
|
+ if (e === null) this.formData.endTime = ''
|
|
|
},
|
|
|
gettime (data) {
|
|
|
const value =
|
|
|
@@ -205,9 +176,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created () {
|
|
|
- this.userList(this.ruleForm)
|
|
|
- },
|
|
|
+ created () {},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted () {},
|
|
|
beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
@@ -221,32 +190,49 @@ export default {
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.tab7 {
|
|
|
- .top {
|
|
|
- position: relative;
|
|
|
- border-bottom: 1px solid black;
|
|
|
- margin-bottom: 20px;
|
|
|
- .userName {
|
|
|
- margin-left: 50px;
|
|
|
+ height: 100%;
|
|
|
+ .insideTop .add{
|
|
|
+ right: 55px;
|
|
|
+ }
|
|
|
+ .conten {
|
|
|
+ padding: 15px 30px 0;
|
|
|
+ height: calc(100% - 32px);
|
|
|
+ .classify {
|
|
|
+ text-align: center;
|
|
|
+ width: 40px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ color: #b9412e;
|
|
|
+ border-bottom: 2px solid #b9412e;
|
|
|
}
|
|
|
- .addUser {
|
|
|
- position: absolute;
|
|
|
- right: 20px;
|
|
|
- top: 0;
|
|
|
+ .search {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ position: relative;
|
|
|
+ margin-top: 12px;
|
|
|
+ height: 40px;
|
|
|
+ .search_k {
|
|
|
+ margin-left: 30px;
|
|
|
+ }
|
|
|
+ .search_btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 200px;
|
|
|
+ position: absolute;
|
|
|
+ right: 22px;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .table {
|
|
|
+ max-width: 1533px;
|
|
|
+ }
|
|
|
+ /deep/.el-table__body-wrapper {
|
|
|
+ max-height: 485px;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
- }
|
|
|
- /deep/.el-table__body-wrapper{
|
|
|
- max-height: 580px;
|
|
|
- overflow-y: auto;
|
|
|
}
|
|
|
.paging {
|
|
|
- width: auto;
|
|
|
- display: flex;
|
|
|
position: absolute;
|
|
|
- bottom: 40px;
|
|
|
+ bottom: 15px;
|
|
|
right: 50px;
|
|
|
- .zong {
|
|
|
- margin-right: 20px;
|
|
|
- margin-top: 4px;
|
|
|
- }
|
|
|
- }}
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|