|
|
@@ -56,24 +56,41 @@
|
|
|
<!-- 下面的内容模块 -->
|
|
|
<div class="conten">
|
|
|
<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 prop="content" label="留言内容">
|
|
|
+ <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 prop="content" label="留言内容"> </el-table-column>
|
|
|
<el-table-column prop="userName" label="提交人" width="180">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="updateTime" label="提交时间" width="280"> </el-table-column>
|
|
|
- <el-table-column prop="status" label="审核状态" width="180"> </el-table-column>
|
|
|
- <el-table-column label="操作" width="230">
|
|
|
- <template #default='{row}'>
|
|
|
- <el-button type="text" @click="pass(row.id,2)" v-if="row.status!=='审核通过'">通过</el-button>
|
|
|
- <el-button type="text" @click="pass(row.id,1)" style="color:#ac3334" v-if="row.status!=='审核不通过'">不通过</el-button>
|
|
|
- <el-button type="text" style="color:#808080" @click="delLiuYan(row.id)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="updateTime" label="提交时间" width="280">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="status" label="审核状态" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="230">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="pass(row.id, 2)"
|
|
|
+ v-if="row.status !== '审核通过'"
|
|
|
+ >通过</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="pass(row.id, 1)"
|
|
|
+ style="color: #ac3334"
|
|
|
+ v-if="row.status !== '审核不通过'"
|
|
|
+ >不通过</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ style="color: #808080"
|
|
|
+ @click="delLiuYan(row.id)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<!-- 分页 -->
|
|
|
<div class="paging">
|
|
|
@@ -127,7 +144,7 @@
|
|
|
<script>
|
|
|
import { encodeStr } from "../utils/pass";
|
|
|
import { Base64 } from "js-base64";
|
|
|
-import { updatePwd,geiList,displayPass,delLiuYan } from "../utils/api";
|
|
|
+import { updatePwd, geiList, displayPass, delLiuYan } from "../utils/api";
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
components: {},
|
|
|
@@ -141,7 +158,7 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
- total:0,
|
|
|
+ total: 0,
|
|
|
userName: "",
|
|
|
cut: false,
|
|
|
isShow: false,
|
|
|
@@ -166,7 +183,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
searchKey: "",
|
|
|
},
|
|
|
- tableData:[]
|
|
|
+ tableData: [],
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -180,50 +197,51 @@ export default {
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
//点击删除
|
|
|
- delLiuYan(id){
|
|
|
- this.$confirm('确定删除吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ delLiuYan(id) {
|
|
|
+ this.$confirm("确定删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- await delLiuYan(id)
|
|
|
- this.$message.success('删除成功!')
|
|
|
- this.getList(this.formData)
|
|
|
+ await delLiuYan(id);
|
|
|
+ this.$message.success("删除成功!");
|
|
|
+ this.getList(this.formData);
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.$message.info('已取消删除')
|
|
|
- }) },
|
|
|
+ this.$message.info("已取消删除");
|
|
|
+ });
|
|
|
+ },
|
|
|
//点击通过和不通过
|
|
|
- async pass(id,display){
|
|
|
- let res = await displayPass(id,display)
|
|
|
- this.$message.success('操作成功!')
|
|
|
- this.getList(this.formData)
|
|
|
+ async pass(id, display) {
|
|
|
+ let res = await displayPass(id, display);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.getList(this.formData);
|
|
|
},
|
|
|
//点击重置
|
|
|
- reset(){
|
|
|
- this.time=''
|
|
|
- this.formData.searchKey=''
|
|
|
- this.formData.status=''
|
|
|
- this.formData.startTime=''
|
|
|
- this.formData.endTime=''
|
|
|
+ reset() {
|
|
|
+ this.time = "";
|
|
|
+ this.formData.searchKey = "";
|
|
|
+ this.formData.status = "";
|
|
|
+ this.formData.startTime = "";
|
|
|
+ this.formData.endTime = "";
|
|
|
},
|
|
|
//点击搜索
|
|
|
- cliSear(){
|
|
|
- this.formData.pageNum = 1
|
|
|
- this.getList(this.formData)
|
|
|
+ cliSear() {
|
|
|
+ this.formData.pageNum = 1;
|
|
|
+ this.getList(this.formData);
|
|
|
},
|
|
|
// 分页器方法
|
|
|
- currentChange (val) {
|
|
|
+ currentChange(val) {
|
|
|
// console.log('当前页改变了', val)
|
|
|
- this.formData.pageNum = val
|
|
|
- this.getList(this.formData)
|
|
|
+ this.formData.pageNum = val;
|
|
|
+ this.getList(this.formData);
|
|
|
},
|
|
|
- sizeChange (val) {
|
|
|
+ sizeChange(val) {
|
|
|
// console.log('条数改变了', val)
|
|
|
- this.formData.pageNum = 1
|
|
|
- this.formData.pageSize = val
|
|
|
- this.getList(this.formData)
|
|
|
+ this.formData.pageNum = 1;
|
|
|
+ this.formData.pageSize = val;
|
|
|
+ this.getList(this.formData);
|
|
|
},
|
|
|
// 修改密码点击取消
|
|
|
btnX() {
|
|
|
@@ -277,8 +295,9 @@ export default {
|
|
|
date.push(this.gettime(e[i]));
|
|
|
}
|
|
|
this.formData.startTime = date[0];
|
|
|
- if (date[1]) this.formData.endTime = date[1].replace("00:00:00", "23:59:59");
|
|
|
- if(e===null) this.formData.endTime=''
|
|
|
+ if (date[1])
|
|
|
+ this.formData.endTime = date[1].replace("00:00:00", "23:59:59");
|
|
|
+ if (e === null) this.formData.endTime = "";
|
|
|
},
|
|
|
gettime(data) {
|
|
|
const value =
|
|
|
@@ -302,24 +321,24 @@ export default {
|
|
|
return i;
|
|
|
},
|
|
|
//封装获取留言列表的方法
|
|
|
- async getList(data){
|
|
|
- let res =await geiList(data)
|
|
|
- this.tableData=res.data.records
|
|
|
- this.total=res.data.total
|
|
|
- this.tableData.forEach(v=>{
|
|
|
- if(v.userName==='') v.userName='匿名'
|
|
|
- if(v.status===0) v.status='待审核'
|
|
|
- else if(v.status===1) v.status='审核不通过'
|
|
|
- else if(v.status===2) v.status='审核通过'
|
|
|
- })
|
|
|
+ async getList(data) {
|
|
|
+ let res = await geiList(data);
|
|
|
+ this.tableData = res.data.records;
|
|
|
+ this.total = res.data.total;
|
|
|
+ this.tableData.forEach((v) => {
|
|
|
+ if (v.userName === "") v.userName = "匿名";
|
|
|
+ if (v.status === 0) v.status = "待审核";
|
|
|
+ else if (v.status === 1) v.status = "审核不通过";
|
|
|
+ else if (v.status === 2) v.status = "审核通过";
|
|
|
+ });
|
|
|
// console.log(999,res);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
// 获取用户信息
|
|
|
this.userName = localStorage.getItem("DSJY_Name");
|
|
|
- this.getList(this.formData)
|
|
|
+ this.getList(this.formData);
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|
|
|
@@ -334,9 +353,9 @@ export default {
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.home {
|
|
|
- /deep/ .el-table .el-table__cell{
|
|
|
- padding: 5px 0;
|
|
|
- }
|
|
|
+ /deep/ .el-table .el-table__cell {
|
|
|
+ padding: 5px 0;
|
|
|
+ }
|
|
|
.top {
|
|
|
padding: 0 50px 0 30px;
|
|
|
display: flex;
|
|
|
@@ -454,12 +473,12 @@ export default {
|
|
|
width: 94%;
|
|
|
height: 700px;
|
|
|
background-color: #fff;
|
|
|
- .paging{
|
|
|
+ .paging {
|
|
|
position: absolute;
|
|
|
right: 30px;
|
|
|
bottom: 30px;
|
|
|
}
|
|
|
- /deep/.el-table__body-wrapper{
|
|
|
+ /deep/.el-table__body-wrapper {
|
|
|
max-height: 561px;
|
|
|
overflow-y: auto;
|
|
|
}
|