Commit f7861211 authored by 罗林杰's avatar 罗林杰

修改页面

parent 8e263211
......@@ -66,3 +66,12 @@ export function exportOpmBlackList(query) {
responseType: 'blob'
})
}
// 查询留言表列表
export function listMessageList(query) {
return request({
url: '/memLeaveMessage/messageList',
method: 'get',
params: query
})
}
......@@ -94,6 +94,7 @@
</template>
</el-table-column>
<el-table-column align="center" prop="memCode" label="创建者" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="memWxCode" label="微信号" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="createDate" label="发布时间" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="topic" label="话题名称" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="commentCount" label="评论数" min-width="150" show-overflow-tooltip />
......@@ -157,7 +158,6 @@
<div>
<!-- 当没有图片时 -->
<div v-if="!form.url || form.url.length === 0" style="text-align: center; color: #999;">
没有图片
</div>
<!-- 当图片数量为1时 -->
<div v-else-if="form.url.length === 1" style="text-align: center;">
......@@ -209,7 +209,7 @@
<span>{{ comment.content }}</span>
</template>
</div>
<div style="font-size: 10px;color: #8c8c93">
<div style="font-size: 10px;color: #8c8c93;margin-top: 8px">
<span>{{ comment.createDate }}</span>
</div>
</div>
......@@ -228,7 +228,7 @@
<span>{{ reply.content }}</span>
</template>
</div>
<div style="font-size: 12px;color: #8c8c93;padding-top: 2px">
<div style="font-size: 10px;color: #8c8c93;margin-top: 8px">
<span>{{ reply.createDate }}</span>
</div>
</div>
......@@ -634,10 +634,8 @@ export default {
padding-left: 0;
.commentItem {
margin-bottom: 10px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
.avatar {
width: 32px;
......@@ -652,13 +650,10 @@ export default {
.replies {
list-style-type: none;
padding-left: 20px;
.replyItem {
margin-bottom: 5px;
padding: 5px;
border: 1px solid #eee;
border-radius: 5px;
}
.avatar {
......@@ -699,7 +694,7 @@ export default {
.commentTitle{
display: flex;
justify-content: space-between;
padding:20px 25px;
padding-top: 20px;
font-size: 16px;
color: rgb(132, 132, 132);
.c-title-segment{
......
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="用户" prop="userId">
<el-input
v-model="queryParams.memNickName"
placeholder="请输入用户"
clearable
:maxlength="50"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="被拉黑人" prop="targetId">
<el-input
v-model="queryParams.targetName"
placeholder="请输入被拉黑人"
clearable
:maxlength="50"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item>
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">黑名单表列表</div>
<el-table v-loading="loading" border :data="opmBlackListList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="用户" prop="userId" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.memNickName || '-' }}
</template>
</el-table-column>
<el-table-column label="被拉黑人" prop="memNickName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.targetName || '-' }}
</template>
</el-table-column>
<el-table-column label="拉黑时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.createDate || '-' }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" class-name="small-padding fixed-width" width="200px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- :class="commonField.delClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 添加或修改黑名单表配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="用户id" prop="userId">
<el-input v-model.trim="form.userId" show-word-limit :maxlength="50" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="目标id" prop="targetId">
<el-input v-model.trim="form.targetId" show-word-limit :maxlength="50" placeholder="请输入目标id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOpmBlackList,
getOpmBlackList,
delOpmBlackList,
addOpmBlackList,
updateOpmBlackList,
exportOpmBlackList } from '@/api/contentManagement/opmBlackList'
import commonField from '@/utils/commonField'
export default {
name: 'OpmBlackList',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 黑名单表表格数据
opmBlackListList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
// 查询参数
queryParams: {
page: 1,
rows: 10,
userId: undefined,
targetId: undefined,
flag: ''
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
},
methods: {
/** 查询黑名单表列表 */
getList() {
this.loading = true
listOpmBlackList(this.queryParams).then(
response => {
this.opmBlackListList = response.data
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
userId: undefined,
targetId: undefined,
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
userId: undefined,
targetId: undefined,
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加黑名单表'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOpmBlackList(id).then(response => {
this.form = response.data
this.open = true
this.title = '修改黑名单表'
})
},
// 改变状态
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return updateOpmBlackList(row)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
/** 提交按钮 */
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
updateOpmBlackList(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addOpmBlackList(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOpmBlackList(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOpmBlackList(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '黑名单表信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
})
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
......@@ -43,10 +43,10 @@
style="width: 150px"
/>
</el-form-item>
<el-form-item label="目标id,用户id" prop="targetId">
<el-form-item label="用户" prop="userNickName">
<el-input
v-model="queryParams.targetId"
placeholder="请输入目标id,用户id"
v-model="queryParams.userNickName"
placeholder="请输入用户"
clearable
:maxlength="50"
size="small"
......@@ -98,9 +98,9 @@
{{ scope.row.orderId || '-' }}
</template>
</el-table-column>
<el-table-column label="目标id,用户id" prop="targetId" :show-overflow-tooltip="true">
<el-table-column label="用户" prop="userNickName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.targetId || '-' }}
{{ scope.row.userNickName || '-' }}
</template>
</el-table-column>
<el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">
......@@ -113,16 +113,16 @@
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" class-name="small-padding fixed-width" width="200px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- :class="commonField.delClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
......
......@@ -260,6 +260,11 @@
<el-tag v-else type="green" size="medium ">未推荐</el-tag>
</template>
</el-table-column>
<el-table-column label="金币数" prop="goldCoinsCount" :show-overflow-tooltip="true" min-width="80">
<template slot-scope="scope">
{{ scope.row.goldCoinsCount || '0' }}
</template>
</el-table-column>
<el-table-column label="权重" prop="sort" :show-overflow-tooltip="true" min-width="55">
<template slot-scope="scope">
{{ scope.row.sort || '-' }}
......@@ -287,7 +292,7 @@
:type="commonField.typeParent"
:size="commonField.size"
@click="removeCourse(scope.row)"
>删除</el-button>
>消费记录</el-button>
</template>
</el-table-column>
......
<template>
<!-- 会员管理 -->
<div class="app-container">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search">
<el-form ref="queryForm" style="padding: 30px 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="会员:" prop="memCodeStr">
<el-input
v-model="queryParams.memCodeStr"
placeholder="请输入会员号"
clearable
:maxlength="30"
size="small"
style="width: 170px"
/>
</el-form-item>
<el-form-item label="性别:" prop="memSex">
<el-select v-model="queryParams.memSex" placeholder="请选择性别" style="width: 170px" clearable>
<el-option
v-for="item in sexOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="民族:" prop="memNation">
<el-select v-model="queryParams.memNation" placeholder="请选择民族" style="width: 170px" clearable>
<el-option
v-for="item in nationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="星座:" prop="memConstellation">
<el-select v-model="queryParams.memConstellation" placeholder="请选择星座" style="width: 170px" clearable>
<el-option
v-for="item in constellationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="身高:" prop="memHeight">
<el-select
v-model="queryParams.memHeight"
placeholder="请选择身高"
style="width: 170px"
multiple
collapse-tags
clearable
@change="handleHeight"
>
<el-option
v-for="item in heightOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="体重:" prop="memWeight">
<el-select
v-model="queryParams.memWeight"
placeholder="请选择体重"
style="width: 170px"
multiple
collapse-tags
clearable
@change="handleWeight"
>
<el-option
v-for="item in weightOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="学历:" prop="memMaxEducation">
<el-select
v-model="queryParams.memMaxEducation"
placeholder="请选择学历"
style="width: 170px"
multiple
collapse-tags
clearable
>
<el-option
v-for="item in maxEducationOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="收入:" prop="minYearIncome">
<el-input
v-model="queryParams.minYearIncome"
placeholder="请输入最低收入"
clearable
:maxlength="30"
size="small"
style="width: 170px"
/>
</el-form-item>
<el-form-item label="籍贯:" prop="memNative">
<!-- 省级选择 -->
<el-select
v-model="queryParams.memProvince"
placeholder="请选择省份"
style="width: 170px"
clearable
@change="handleProvinceChange"
>
<el-option
v-for="province in residence"
:key="province.value"
:label="province.label"
:value="province.value"
/>
</el-select>
<!-- 市级选择(仅当选择了省份时显示) -->
</el-form-item>
<el-form-item label="城市:" prop="memCity">
<el-select
v-model="queryParams.memCity"
multiple
placeholder="请选择城市"
style="width: 170px"
collapse-tags
clearable
>
<el-option
v-for="city in selectedProvinceCities"
:key="city.value"
:label="city.label"
:value="city.value"
/>
</el-select>
</el-form-item>
<el-form-item label="婚姻:" prop="memMarriage">
<el-select v-model="queryParams.memMarriage" placeholder="请选择婚姻状况" style="width: 170px" clearable>
<el-option
v-for="item in marriageOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="微信:" prop="memWxCodeStr">
<el-input
v-model="queryParams.memWxCodeStr"
placeholder="请输入微信号"
clearable
:maxlength="30"
size="small"
style="width: 170px"
/>
</el-form-item>
<el-form-item label="实名:" prop="memRealAuthen">
<el-select v-model="queryParams.memRealAuthen" placeholder="请选择实名情况" style="width: 170px" clearable>
<el-option
v-for="item in memRealAuthenOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="等级:" prop="memLevel">
<el-select v-model="queryParams.memLevel" placeholder="请选择会员等级" style="width: 170px" clearable>
<el-option
v-for="item in memLevelOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="状态:" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择账号状态" style="width: 170px" clearable>
<el-option
v-for="item in flagOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<!-- //查询按钮-->
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="loadData"
>{{ commonField.queryName }}</el-button>
<!-- //重置按钮-->
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>{{ commonField.resetName }}</el-button>
</el-form-item>
</el-form>
</div>
<div style="padding:5px 10px">
<div class="tableTitle">会员列表</div>
<el-table v-loading="fullscreenLoading" :data="tableData" border sortable="true" style="text-align: left;">
<span slot="empty">{{ tableDataTips }}</span>
<el-table-column align="center" prop="id" label="序号" min-width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="memCode" label="会员号" min-width="120" show-overflow-tooltip />
<el-table-column align="center" prop="memNickName" label="昵称" min-width="120" show-overflow-tooltip />
<el-table-column align="center" prop="memSex" label="用户性别" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ getMemSexLabel(scope.row.memSex) }}
</template>
</el-table-column>
<el-table-column align="center" prop="memMarriage" label="婚姻状况" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ getMemMarriageLabel(scope.row.memMarriage) }}
</template>
</el-table-column>
<el-table-column align="center" prop="memConstellation" label="星座" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ getMemConstellationLabel(scope.row.memConstellation) }}
</template>
</el-table-column>
<el-table-column align="center" prop="memMaxEducation" label="学历" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ getMemMaxEducationLabel(scope.row.memMaxEducation) }}
</template>
</el-table-column>
<el-table-column align="center" prop="memRealAuthen" min-width="80" label="实名情况" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if="scope.row.memRealAuthen === '1'" type="warning" size="medium ">已实名</el-tag>
<el-tag v-else type="green" size="medium ">未实名</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="memLevel" min-width="80" label="会员等级" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if="scope.row.memLevel === 1" type="danger" size="medium ">会员</el-tag>
<el-tag v-else type="green" size="medium ">普通用户</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="isRecommended" min-width="80" label="推荐" show-overflow-tooltip>
<template slot-scope="scope">
<el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag>
<el-tag v-else type="green" size="medium ">未推荐</el-tag>
</template>
</el-table-column>
<el-table-column label="权重" prop="sort" :show-overflow-tooltip="true" min-width="55">
<template slot-scope="scope">
{{ scope.row.sort || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="memYearIncome" label="年收入(w)" show-overflow-tooltip />
<!-- <el-table-column align="center" label="操作" min-width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- v-has-permi="hasDetailPerm"-->
<!-- :class="commonField.updateClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleView(scope.row)"-->
<!-- >查看</el-button>-->
<!-- <el-button-->
<!-- v-has-permi="hasUpdatePerm"-->
<!-- :class="commonField.updateClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- >编辑</el-button>-->
<!-- <el-button-->
<!-- :class="commonField.resetPasClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="removeCourse(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
v-show="total>0"
:key="pageKey"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="loadData"
/>
<footer />
</div>
</div>
</template>
<script>
import commonField from '@/utils/commonField'
import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { getOptions } from '@/utils/options'
import { delMemInfo, listMemInfo } from '@/api/contentManagement/memInfo'
export default {
name: 'Index',
// components: {
// CurCat
// },
data() {
return {
pageKey: 0,
hasAddPerm: ['mem:info:add'],
hasUpdatePerm: ['mem:info:update'],
hasDetailPerm: ['mem:info:query'],
/* imageSrc: require('@/assets/image/test.png'),*/
// 显示开关
showSwitch: {
courseContent: true,
curCat: false
},
// 新增课程
form: {
id: '',
name: '',
couDire: '',
credit: 0,
totalStuHours: 0
},
formLabelWidth: '90px',
// 表格
tableData: [],
// 弹出层标题
title: '',
// 日期范围
queryParams: {
page: 1,
rows: 10,
flag: ''
},
total: 0,
fullscreenLoading: false,
tableDataTips: '加载中',
sexOptions: getOptions('sex'),
nationOptions: getOptions('nation'),
maxEducationOptions: getOptions('education'),
residence: getOptions('residence'),
marriageOptions: getOptions('marriage'),
constellationOptions: getOptions('constellation'),
heightOptions: [
{
label: '不限',
value: '0'
},
{
label: '150-160',
value: '1',
minHeight: 150,
maxHeight: 160
},
{
label: '160-170',
value: '2',
minHeight: 160,
maxHeight: 170
},
{
label: '170-180',
value: '3',
minHeight: 170,
maxHeight: 180
},
{
label: '180以上',
value: '4',
minHeight: 180
}
],
weightOptions: [
{
label: '不限',
value: '0'
},
{
label: '30-40',
value: '1',
minWeight: 30,
maxWeight: 40
},
{
label: '50-60',
value: '2',
minWeight: 50,
maxWeight: 60
},
{
label: '70-80',
value: '3',
minWeight: 70,
maxWeight: 80
},
{
label: '80以上',
value: '4',
minWeight: 80
}
],
memRealAuthenOptions: [
{
label: '已实名',
value: '1'
},
{
label: '未实名',
value: '0'
}
],
memLevelOptions: [
{
label: '普通用户',
value: 0
},
{
label: '会员',
value: 1
}
],
flagOptions: [
{
label: '启用',
value: '1'
},
{
label: '停用',
value: '0'
}
]
}
},
computed: {
commonField() {
return commonField
},
selectedProvinceCities() {
const province = this.residence.find(
(p) => p.value === this.queryParams.memProvince
)
return province ? province.children : []
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
setDataCache(this.$route.path, this.queryParams)
next()
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (from.path === '/contentManagement/activity/info/detail' ||
from.path === '/contentManagement/activity/info/index' ||
from.path === '/contentManagement/activity/info/update') {
vm.queryParams.page = JSON.parse(getDataCache(vm.$route.path)).page
setTimeout(() => {
vm.loadData()
}, 500)
}
})
},
created() {
},
mounted: function() {
this.loadData()
},
methods: {
numberFormatter(content, bit) {
if (!content) {
return ''
}
return new Intl.NumberFormat('zh-CN', {
minimumFractionDigits: bit,
maximumFractionDigits: bit
}).format(content.toFixed(bit))
},
step(index) {
return 'step' + index
},
// 日期格式转换
replace(time) {
return parseTime(time, '{y}/{m}/{d}/{h}:{i}')
},
handleNative(value) {
this.queryParams.memNative = value[0] + '/' + value[1]
const province = this.residence.find(item => item.label === value[0])
const city = province.children.find(item => item.label === value[1])
this.queryParams.memNativeProvince = province.value
this.queryParams.memNativeCity = city.value
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
page: 1,
rows: 10,
status: '1',
memCity: '',
memMaxEducation: ''
}
this.loadData()
},
/** 查询会员管理列表 */
loadData() {
this.loading = true
const queryParams = { ...this.queryParams }
queryParams.memHeight = []
queryParams.memWeight = []
if (this.queryParams.memCity !== '') {
// 拼成数组
queryParams.memNativeCity = this.queryParams.memCity.join(',')
queryParams.memCity = ''
}
if (this.queryParams.memMaxEducation !== '') {
// 拼成数组
queryParams.educations = this.queryParams.memMaxEducation.join(',')
}
queryParams.memNativeProvince = this.queryParams.memProvince
listMemInfo(queryParams).then(
response => {
this.tableData = response.data
this.total = response.total
this.loading = false
}
)
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: '/operationsManagement/member/info',
query: {
isOperation: '1',
title: '新增会员'
}
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.$router.push({
path: '/operationsManagement/member/info',
query: {
isOperation: '2',
bussinessId: row.businessId,
title: ' 编辑会员 '
}
})
},
/** 删除按钮操作 */
removeCourse(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delMemInfo(id)
}).then(() => {
this.loadData()
this.$message({
message: '删除成功',
type: 'success'
})
})
},
/**
* @description: 查看
* @author: gaoyu
* @param:
* @return:
**/
handleView(row) {
this.$router.push({
path: '/operationsManagement/member/info',
query: {
isOperation: '3',
bussinessId: row.businessId,
title: ' 查看会员 '
}
})
},
getMemSexLabel(value) {
const numValue = Number(value)
const item = this.sexOptions.find(item => item.value === numValue)
return item ? item.label : '-'
},
getMemNationLabel(value) {
const numValue = Number(value)
const item = this.nationOptions.find(item => item.value === numValue)
return item ? item.label : '-'
},
getMemMarriageLabel(value) {
const numValue = Number(value)
const item = this.marriageOptions.find(item => item.value === numValue)
return item ? item.label : '-'
},
getMemConstellationLabel(value) {
const numValue = Number(value)
const item = this.constellationOptions.find(item => item.value === numValue)
return item ? item.label : '-'
},
getMemMaxEducationLabel(value) {
const numValue = Number(value)
const item = this.maxEducationOptions.find(item => item.value === numValue)
return item ? item.label : '-'
},
handleProvinceChange() {
// 当省份改变时,清空已选城市
this.queryParams.memCity = ''
},
handleHeight() {
// 获取所有选中的身高选项值
const selectedValues = this.queryParams.memHeight
// 如果没有选中任何选项,重置最大和最小身高
if (!selectedValues || selectedValues.length === 0 || selectedValues.includes('0')) {
this.queryParams.minHeight = null
this.queryParams.maxHeight = null
return
}
// 初始化最小和最大身高为null
let minHeight = null
let maxHeight = null
// 遍历选中的值并找到对应的minHeight和maxHeight
for (const value of selectedValues) {
const option = this.heightOptions.find(option => option.value === value)
if (option) {
// 特殊处理 '180以上' 的情况
if (value === '4') {
minHeight = option.minHeight
maxHeight = null // 180以上没有最大值
break // 因为180以上是最高的范围,不需要再检查其他选项
} else {
if (minHeight === null || (option.minHeight !== undefined && option.minHeight < minHeight)) {
minHeight = option.minHeight
}
if (maxHeight === null || (option.maxHeight !== undefined && option.maxHeight > maxHeight)) {
maxHeight = option.maxHeight
}
}
}
}
// 更新组件的状态或执行其他操作
this.queryParams.minHeight = minHeight
this.queryParams.maxHeight = maxHeight
},
handleWeight() {
// 获取所有选中的体重选项值
const selectedValues = this.queryParams.memWeight
// 如果没有选中任何选项,重置最大和最小身高
if (!selectedValues || selectedValues.length === 0 || selectedValues.includes('0')) {
this.queryParams.minWeight = null
this.queryParams.maxWeight = null
return
}
// 初始化最小和最大身高为null
let minWeight = null
let maxWeight = null
// 遍历选中的值并找到对应的minHeight和maxHeight
for (const value of selectedValues) {
const option = this.weightOptions.find(option => option.value === value)
if (option) {
// 特殊处理 '180以上' 的情况
if (value === '4') {
minWeight = option.minWeight
maxWeight = null // 180以上没有最大值
break // 因为180以上是最高的范围,不需要再检查其他选项
} else {
if (minWeight === null || (option.minWeight !== undefined && option.minWeight < minWeight)) {
minWeight = option.minWeight
}
if (maxWeight === null || (option.maxWeight !== undefined && option.maxWeight > maxWeight)) {
maxWeight = option.maxWeight
}
}
}
}
// 更新组件的状态或执行其他操作
this.queryParams.minWeight = minWeight
this.queryParams.maxWeight = maxWeight
console.log(this.queryParams.minWeight)
console.log(this.queryParams.maxWeight)
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
::v-deep .el-table td:nth-child(2) .cell {
margin: 10px;
height: 45px;
}
}
app-container1{
font-size: 18px;
padding: 0;
::v-deep .el-table td:nth-child(2) .cell {
margin: 10px;
height: 25px;
}
}
</style>
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="发送人" prop="userId">
<el-form-item label="发送人" prop="createName">
<el-input
v-model="queryParams.userId"
v-model="queryParams.createName"
placeholder="请输入发送人"
clearable
:maxlength="50"
......@@ -11,9 +11,9 @@
style="width: 150px"
/>
</el-form-item>
<el-form-item label="接收人" prop="targetId">
<el-form-item label="接收人" prop="memNickName">
<el-input
v-model="queryParams.targetId"
v-model="queryParams.memNickName"
placeholder="请输入接收人"
clearable
:maxlength="50"
......@@ -39,36 +39,38 @@
</el-form>
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">留言列表</div>
<el-table v-loading="loading" border :data="opmBlackListList">
<el-table v-loading="loading" border :data="messageList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="发送人" prop="userId" :show-overflow-tooltip="true">
<el-table-column label="发送人" prop="createName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.userId || '-' }}
{{ scope.row.createName || '-' }}
</template>
</el-table-column>
<el-table-column label="接收人" prop="targetId" :show-overflow-tooltip="true">
<el-table-column label="接收人" prop="memNickName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.targetId || '-' }}
{{ scope.row.memNickName || '-' }}
</template>
</el-table-column>
<el-table-column label="留言内容" prop="targetId" :show-overflow-tooltip="true">
<span>1111111111</span>
</el-table-column>
<el-table-column label="留言时间" prop="createDate" :show-overflow-tooltip="true">
<el-table-column label="留言内容" prop="content" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.createDate || '-' }}
{{ scope.row.content || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<el-table-column label="留言时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
{{ scope.row.createDate || '-' }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" class-name="small-padding fixed-width" width="200px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- :class="commonField.delClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
......@@ -78,32 +80,11 @@
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<!-- 添加或修改黑名单表配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="用户id" prop="userId">
<el-input v-model.trim="form.userId" show-word-limit :maxlength="50" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="目标id" prop="targetId">
<el-input v-model.trim="form.targetId" show-word-limit :maxlength="50" placeholder="请输入目标id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
<el-button class="submitBtn" type="primary" @click="submitForm">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listOpmBlackList,
getOpmBlackList,
delOpmBlackList,
addOpmBlackList,
updateOpmBlackList,
exportOpmBlackList } from '@/api/contentManagement/opmBlackList'
import { listMessageList } from '@/api/contentManagement/opmBlackList'
import commonField from '@/utils/commonField'
export default {
name: 'OpmBlackList',
......@@ -114,7 +95,7 @@ export default {
// 总条数
total: 0,
// 黑名单表表格数据
opmBlackListList: [],
messageList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
......@@ -157,9 +138,9 @@ export default {
/** 查询黑名单表列表 */
getList() {
this.loading = true
listOpmBlackList(this.queryParams).then(
listMessageList(this.queryParams).then(
response => {
this.opmBlackListList = response.data
this.messageList = response.data
this.total = response.total
this.loading = false
}
......@@ -195,99 +176,6 @@ export default {
flag: ''
}
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加黑名单表'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.businessId
getOpmBlackList(id).then(response => {
this.form = response.data
this.open = true
this.title = '修改黑名单表'
})
},
// 改变状态
handleStatusChange(row) {
const text = row.flag === '1' ? '启用' : '停用'
this.$confirm('确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return updateOpmBlackList(row)
}).then(() => {
this.$message({
message: text + '成功',
type: 'success'
})
}).catch(function() {
row.flag = row.flag === '0' ? '1' : '0'
})
},
/** 提交按钮 */
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.businessId !== undefined) {
updateOpmBlackList(this.form).then(response => {
this.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addOpmBlackList(this.form).then(response => {
this.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delOpmBlackList(id)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams
this.$confirm('是否确认操作?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return exportOpmBlackList(queryParams).then(response => {
const blob = new Blob([response])
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)// 创建下载的链接
downloadElement.href = href
downloadElement.download = '黑名单表信息' + '.xls' // 下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click()// 点击下载
document.body.removeChild(downloadElement)// 下载完成移除元素
window.URL.revokeObjectURL(href)// 释放掉blob对象
})
})
}
}
}
......
......@@ -56,16 +56,16 @@
{{ scope.row.createDate || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="200px">
<template slot-scope="scope">
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="操作" class-name="small-padding fixed-width" width="200px">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- :class="commonField.delClass"-->
<!-- :type="commonField.typeParent"-->
<!-- :size="commonField.size"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
<pagination
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment