Commit 4eda70c0 authored by yuwenwen's avatar yuwenwen

修改BUG

parent b26f2218
......@@ -8,8 +8,8 @@
<el-input placeholder="请输入" v-model="queryParams.userName"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
<el-button type="primary" @click="handleQuery">搜索</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div v-if="selectDataList.length > 0" class="mb20">
......@@ -17,7 +17,8 @@
{{ tag.nickName }}
</el-tag>
</div>
<el-table ref="tableRef" row-key="userName" :data="list" @selection-change="handleCheckboxChange" v-loading="loading">
<el-table ref="tableRef" row-key="userName" :data="list" @selection-change="handleCheckboxChange"
v-loading="loading">
<el-table-column type="selection" width="60"></el-table-column>
<el-table-column label="姓名" prop="nickName" align="center"></el-table-column>
<el-table-column label="用户名" prop="userName" align="center"></el-table-column>
......@@ -42,11 +43,12 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: ''
nickName: '',
userName: ''
},
total: 0,
selectDataList: [],
loading:false
loading: false
}
},
props: {
......@@ -69,6 +71,19 @@ export default {
this.getList(data)
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
handleReset() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nickName: '',
userName: ''
}
this.getList()
},
getList(data) {
this.loading = true;
listData(this.queryParams).then(res => {
......@@ -77,7 +92,7 @@ export default {
if (data) {
this.getDetail(data)
}
}).finally(()=>{
}).finally(() => {
this.loading = false
})
},
......
......@@ -3,7 +3,7 @@
<div class="page-container">
<el-form :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="评论内容">
<el-input v-model="queryParams.content" placeholder="请输入"></el-input>
<el-input v-model="queryParams.momentContent" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input v-model="queryParams.nickName" placeholder="请输入"></el-input>
......
......@@ -7,8 +7,9 @@
<el-input placeholder="请输入" v-model="queryParams.content" style="width: 220px;"></el-input>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker placeholder="请选择" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="queryParams.createTime"></el-date-picker>
<el-date-picker placeholder="请选择" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="dateRange" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" @change="dateChange"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
......@@ -25,7 +26,7 @@
<el-table-column label="帐号" prop="userName" align="center" width="140"></el-table-column>
<el-table-column label="姓名" prop="nickName" align="center" width="120"></el-table-column>
<el-table-column label="点赞数" prop="likeCount" align="center" width="100"></el-table-column>
<el-table-column label="评论数" prop="commentCount" align="center" width="100"></el-table-column>
<el-table-column label="评论数" prop="commentCount" align="center" width="100"></el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center" width="160"></el-table-column>
<el-table-column label="操作" align="center" width="160">
<template #default="{ row }">
......@@ -38,12 +39,12 @@
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
<!-- 动态详情 -->
<detail-dialog ref="detailDialogRef"></detail-dialog>
<detail-dialog ref="detailDialogRef"></detail-dialog>
</div>
</template>
<script>
import { listData , delData} from '@/api/moments';
import { listData, delData } from '@/api/moments';
import DetailDialog from './DetailDialog.vue';
export default {
name: 'Moments',
......@@ -58,7 +59,7 @@ export default {
dateRange: [],
}
},
components:{
components: {
DetailDialog
},
created() {
......@@ -90,6 +91,12 @@ export default {
this.getList()
})
},
dateChange(val){
if(val.length > 0){
this.queryParams['params[startTime]'] = val[0]
this.queryParams['params[endTime]'] = val[1]
}
},
// 查询
handleQuery() {
this.queryParams.pageNum = 1;
......@@ -101,6 +108,7 @@ export default {
pageNum: 1,
pageSize: 10
}
this.dateRange = []
this.getList()
}
}
......
......@@ -4,16 +4,13 @@
<el-form :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="兑换时间">
<el-date-picker v-model="dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
style="width: 220px;" value-format="YYYY-MM-DD" @change="dateChange"></el-date-picker>
style="width: 240px;" value-format="yyyy-MM-dd" @change="dateChange"></el-date-picker>
</el-form-item>
<el-form-item label="兑换人">
<el-input placeholder="请输入" v-model="queryParams.userName" style="width: 220px;"></el-input>
</el-form-item>
<el-form-item label="兑换商品">
<el-select v-model="queryParams.goodsCode" placeholder="请选择" style="width: 220px;">
<el-option v-for="(item, index) in optionList" :label="item.name" :value="item.code"
:key="index"></el-option>
</el-select>
<el-input placeholder="请输入" v-model="queryParams.goodsName" style="width: 220px;"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
......@@ -109,9 +106,9 @@ export default {
},
// 时间段选择
dateChange(val){
if(val){
this.queryParams.startTime = val[0]
this.queryParams.endTime = val[1]
if(val.length > 0){
this.queryParams['params[startTime]'] = val[0]
this.queryParams['params[endTime]'] = val[1]
}
},
// 查询
......
......@@ -78,7 +78,7 @@ export default {
},
// 查详情
getDetail(row) {
detailData(row.id).then(res => {
detailData(row.code).then(res => {
console.log(res)
this.form = { ...res.data }
})
......
<template>
<el-dialog :visible.sync="visible" v-if="visible" title="积分兑换" width="36%" class="dialog" @close="handleClose">
<el-form :model="form" ref="formRef" label-position="top" :rules="rules">
<el-form-item label="兑换人">
<UserSelectInput :value.sync="form.userName" placeholder="请选择兑换人"></UserSelectInput>
<el-form-item label="兑换人" prop="userName">
<UserSelectInput v-model="form.userName" :value.sync="form.userName" placeholder="请选择兑换人"></UserSelectInput>
</el-form-item>
<el-form-item label="会员等级">
<el-input v-model="form.gradeName" :readonly="true" placeholder="请输入"></el-input>
......@@ -33,6 +33,7 @@ export default {
userList: [],
optionList: [],
rules: {
userName:[{required: true, message: '请选择兑换人', trigger:['blur', 'change']}],
goodsCode: [{ required: true, message: '请选择兑换商品', trigger: ['blur', 'change'] }]
},
disabled: false
......@@ -80,14 +81,6 @@ export default {
goodsCode,
currentPoints
}
if (!userName) {
this.$modal.msgError("请选择兑换人");
return;
}
// if (!code) {
// this.$modal.msgError("请选择兑换商品");
// return;
// }
this.$refs.formRef.validate((valid) => {
if (valid) {
exchange(data).then(res => {
......
<template>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".txt" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>导入文件格式:导入txt文件,每个敏感词占一行</span>
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板</el-link> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
data() {
return {
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "批量导入敏感词",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/bbs/moment/sensitive/word/import"
},
}
},
created() {
},
methods: {
openModal(){
this.upload.open = true
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.$emit('handleOk')
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
}
}
}
</script>
\ No newline at end of file
......@@ -35,12 +35,15 @@
<!-- 表单 -->
<form-dialog ref="formDialogRef" @handleOk="handleReset"></form-dialog>
<!-- 批量导入 -->
<batch-import ref="batchImportRef" @handleOk="handleReset"></batch-import>
</div>
</template>
<script>
import { listData, setTop ,delData} from '@/api/sensitives';
import FormDialog from './FormDialog.vue';
import BatchImport from './BatchImport.vue';
export default {
name: 'Sensitives',
data() {
......@@ -54,7 +57,8 @@ export default {
}
},
components: {
FormDialog
FormDialog,
BatchImport
},
created() {
......@@ -104,7 +108,7 @@ export default {
},
// 导入敏感词
handleImport(){
this.$refs.batchImportRef.openModal()
},
}
}
......
......@@ -8,27 +8,32 @@
<view class="publish-box">
<textarea class="textarea" v-model="form.content" placeholder="分享有趣事~"
placeholder-class="placeholder-class" />
<image-upload v-model="form.attachments" :limit="9" :showIcons="true" @componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"></image-upload>
<image-upload v-model="form.attachments" :limit="9" :showIcons="true"
@componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"></image-upload>
</view>
<view class="permission-box">
<view class="item">
<view class="text">允许评论</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableComment')" :checked="form.isEnableComment==1" />
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableComment')"
:checked="form.isEnableComment==1" />
</view>
<view class="item">
<view class="text">开启评论精选</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableFeaturedComment')" :checked="form.isEnableFeaturedComment==1"/>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableFeaturedComment')"
:checked="form.isEnableFeaturedComment==1" />
</view>
<view class="item">
<view class="text">开启PK</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableVote')" :checked="form.isEnableVote==1"/>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableVote')"
:checked="form.isEnableVote==1" />
</view>
</view>
<!-- pk数据编辑 -->
<view class="pk-edit-box" v-if="form.isEnableVote==1">
<view class="textarea-box">
<textarea class="textarea" v-model="form.voteTitle" placeholder="请输入PK标题~(0/12)" placeholder-class="placeholder-class" />
<textarea class="textarea" v-model="form.voteTitle" placeholder="请输入PK标题~(0/12)"
placeholder-class="placeholder-class" />
</view>
<view class="pk-type-box">
<radio-group v-model="form.voteOptionType" @change="radioChange">
......@@ -42,11 +47,13 @@
<view class="choice-box" v-if="form.voteOptionType=='IMAGE'">
<view class="choice-item">
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120" :showIcons="false"></image-upload>
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[0].name" placeholder="请输入选项1(4字以内)" />
</view>
<view class="choice-item">
<image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120" :showIcons="false"></image-upload>
<image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[1].name" placeholder="请输入选项2(4字以内)" />
</view>
</view>
......@@ -134,82 +141,99 @@
voteTitle: '',
voteOptionType: 'TEXT',
voteOptions: [{
name:'',
imageUrl:''
},{
name:'',
imageUrl:''
name: '',
imageUrl: ''
}, {
name: '',
imageUrl: ''
}],
},
voteOptionsAffirmative:[],
voteOptionsOpposing:[]
voteOptionsAffirmative: [],
voteOptionsOpposing: []
}
},
components: {
ImageUpload
},
onLoad(options) {
let {topicId,topicName} = options;
if(topicId){
this.topicList.push({name:topicName,id:topicId})
let {
topicId,
topicName
} = options;
if (topicId) {
this.topicList.push({
name: topicName,
id: topicId,
})
}
},
methods: {
// 允许评论,开启精选等操作
handleChange(e,field){
console.log(e,field)
this.form[field] = e.detail.value?1:0
handleChange(e, field) {
console.log(e, field)
this.form[field] = e.detail.value ? 1 : 0
},
// 图文PK或者文字PK
radioChange(e) {
console.log(e)
this.form.voteOptionType = e.detail.value
},
handleSetComponentsType(type){
if(type && this.form.attachments.length > 0){
handleSetComponentsType(type) {
if (type && this.form.attachments.length > 0) {
this.form.type = type
}else{
} else {
this.form.type = 'TEXT'
}
},
// 发布动态
handleSubmit(){
if(this.topicList.length > 0){
handleSubmit() {
if (this.topicList.length > 0) {
this.form.topicNames = [];
this.form.topicIds = [];
this.topicList.forEach((item)=>{
this.topicList.forEach((item) => {
this.form.topicNames.push(item.name);
this.form.topicIds.push(item.id)
})
}
if(this.form.voteOptionType=='IMAGE'){
if(this.voteOptionsAffirmative.length == 0){
// 开启PK校验
if (this.form.isEnableVote == '1') {
if (this.form.voteOptionType == 'IMAGE') {
if (this.voteOptionsAffirmative.length == 0 || this.voteOptionsOpposing.length == 0) {
uni.showToast({
title: '请上传PK图片',
icon: 'error'
})
return;
}
}
if (this.form.voteOptionType == 'IMAGE') {
this.$set(this.form.voteOptions[0], 'imageUrl', this.voteOptionsAffirmative[0].url);
this.$set(this.form.voteOptions[1], 'imageUrl', this.voteOptionsOpposing[0].url);
}
if(!this.form.voteTitle){
uni.showToast({
title:'请上传PK图片'
title: '请输入PK标题',
icon: 'error'
})
return;
}
if(this.voteOptionsOpposing.length == 0){
if (!this.form.voteOptions[0].name || !this.form.voteOptions[1].name) {
uni.showToast({
title:'请上传PK图片'
title: '请输入PK选项',
icon: 'error'
})
return;
}
}
if(this.form.voteOptionType == 'IMAGE'){
this.$set(this.form.voteOptions[0], 'imageUrl', this.voteOptionsAffirmative[0].url);
this.$set(this.form.voteOptions[1], 'imageUrl', this.voteOptionsOpposing[0].url);
}
console.log(this.form)
crateNewDynamic(this.form).then(res=>{
if(res.code == 200){
crateNewDynamic(this.form).then(res => {
if (res.code == 200) {
uni.showToast({
title:'创建成功',
title: '创建成功',
})
uni.$emit('hanldeDynamicRefresh')
uni.switchTab({
url:'/pages/index/index'
url: '/pages/index/index'
})
}
})
......
......@@ -2,7 +2,7 @@
<view class="page-container topics-page">
<view class="search-box-common">
<image src="/static/images/search-icon.png" class="search-icon"></image>
<input placeholder="搜索" style="width: 100%;" placeholder-class="placeholder-class" />
<input placeholder="搜索" style="width: 100%;" v-model="topicName" @keypress.enter="getList" placeholder-class="placeholder-class" />
</view>
<view class="hot-container">
<view class="hot-tag-box">
......@@ -27,6 +27,7 @@
data() {
return {
hotList:[],
topicName:''
}
},
onShow() {
......@@ -35,7 +36,10 @@
methods: {
// 话题热搜榜
getList(){
hotTopicRanking().then(res=>{
let params = {
name:this.topicName
}
hotTopicRanking(params).then(res=>{
console.log(res)
this.hotList = res.data
})
......
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