Commit 89443bb1 authored by Davve's avatar Davve

完成用户创建接口

parent 932a0316
......@@ -3,32 +3,33 @@
# __author__ = "chenwei"
# Date: 2018/11/15
import json
from utils.base import APIView
class GroupListView(APIView):
def get(self, request):
offset = int(request.GET.get('page', 0))
count = int(request.GET.get('limit', 10))
limit = int(request.GET.get('limit', 10))
filters = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/community/group/list'](filters=filters, offset=offset, count=count).unwrap()
data = self.rpc['venus/sun/group/list'](filters=filters, offset=(offset-1)*limit, limit=limit).unwrap()
except Exception as e:
raise e
return data
def post(self, request):
group_ids = request.POST.get('ids', '').split()
ids = request.POST.get('ids', '').split()
type = request.POST.get('type')
filters = {}
updates = {}
if type == 'offline':
filters['is_online'] = False
elif type == 'recommend':
filters['is_recommend'] = True
updates['is_online'] = False
elif type == 'is_recommend':
updates['is_recommend'] = True
else:
filters['is_online'] = True
updates['is_online'] = True
try:
self.rpc['venus/community/group/batch/update'](filters=filters, group_ids=group_ids).unwrap()
self.rpc['venus/sun/group/batch/update'](updates=updates, ids=ids).unwrap()
except Exception as e:
raise e
return {
......@@ -43,7 +44,46 @@ class GroupUpdateOrCreate(APIView):
data = self.rpc['venus/sun/group/get'](id=id).unwrap()
except Exception as e:
raise e
return [data]
return data
def post(self, request):
pass
\ No newline at end of file
id = request.POST.get('id')
data = {
'name': request.POST.get('name', ''),
'description': request.POST.get('description', ''),
'creator_id': request.POST.get('group_leader', ''),
'star_ids': json.loads(request.POST.get('star', '')).split(','), # TODO是否需要加
'is_online': request.POST.get('is_online', ''),
'is_recommend': request.POST.get('is_recommend', ''),
'user_ids': json.loads(request.POST.get('user_ids', ''))
}
try:
self.rpc['venus/sun/group/edit'](id=id, data=data).unwrap()
except Exception as e:
raise e
return {
'message': '更新成功'
}
class GroupRelatedUser(APIView):
def get(self, request):
id = request.GET.get('id')
offset = int(request.GET.get('page', 0))
count = int(request.GET.get('limit', 10))
filters = {'group_id': id}
try:
data = self.rpc['venus/sun/group/user/list'](filters=filters, offset=offset, limit=count).unwrap()
except Exception as e:
raise e
return data
class GroupRelatedUserGET(APIView):
def get(self, request):
id = request.GET.get('id')
try:
data = self.rpc['venus/sun/group/user/get'](id=id).unwrap()
except Exception as e:
raise e
return [data, ]
......@@ -2,10 +2,9 @@
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/11/15
import datetime
from utils.base import APIView
from utils.time_utils import utc_to_datetime, unix_time_to_datetime, analysis_time
from utils.time_utils import analysis_time
class PushListView(APIView):
......
......@@ -13,7 +13,7 @@ class StarListView(APIView):
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/sun/star/list'](offset=page, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/star/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap()
except Exception as e:
raise e
return data
......@@ -57,7 +57,7 @@ class StarRelatedGroup(APIView):
count = int(request.GET.get('limit', 10))
filters = {'star_id': id}
try:
data = self.rpc['venus/sun/group/list'](filters=filters, offset=offset, limit=count).unwrap()
data = self.rpc['venus/sun/group/list'](filters=filters, offset=(offset-1) * count, limit=count).unwrap()
except Exception as e:
raise e
return data
......@@ -10,11 +10,11 @@ from utils.time_utils import analysis_time
class TopicListView(APIView):
def get(self, request):
page = int(request.GET.get('page', 0))
offset = int(request.GET.get('page', 0))
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/sun/topic/list'](offset=page, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/topic/list'](offset=(offset - 1) * limit, limit=limit, filters=filter).unwrap()
except Exception as e:
raise e
return data
......@@ -24,7 +24,7 @@ class TopicUpdateOrCreateView(APIView):
def get(self, request):
id = request.GET.get('id')
try: # TODO 少返回了is_online
try:
data = self.rpc['venus/sun/topic/get'](id=id).unwrap()
except Exception as e:
raise e
......@@ -38,14 +38,14 @@ class TopicUpdateOrCreateView(APIView):
data = {
'topic_images': topic_images,
'topic_ids': json.loads(request.POST.get('topic_ids', '')),
# 'reply_ids': json.loads(request.POST.get('topic_ids', '')),
'video_url': request.POST.get('video_url', ''),
'posting_time': posting_time,
'content': request.POST.get('content', ''),
'content_level': request.POST.get('content_level', ''),
'group_name': request.POST.get('group_name', ''),
'user_id': request.POST.get('user_id', ''),
'star_name': request.POST.get('star_name', ''),
'group_id': request.POST.get('group_name', ''),
'user_id': request.POST.get('user_name', ''),
'star_id': request.POST.get('star_name', ''),
'tag_ids': json.loads(request.POST.get('tag_ids', [])),
}
try:
......@@ -60,28 +60,15 @@ class TopicUpdateOrCreateView(APIView):
class ReplyUpdateOrCreateView(APIView):
def get(self, request):
id = request.GET.get('id')
page = int(request.GET.get('page', 0))
offset = int(request.GET.get('page', 0))
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
filter.update({'id': id})
filter.update({'topic_id': id})
try:
data = self.rpc['venus/sun/topic/reply/list'](offset=page, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/topic/reply/list'](offset=(offset-1) * limit, limit=limit, filters=filter).unwrap()
except Exception as e:
data = [
{
'id': 1,
'reply_name': '真好',
'be_reply_name': '王二',
'create_time': '2018-09-10 23:23:23',
'reply_type': '贴主的评论',
'content': '内容真好',
},
]
return {
'total': 10,
'data': data
}
raise e
return data
def post(self, request):
reply_ids = json.loads(request.POST.get('reply_ids', []))
......@@ -97,32 +84,14 @@ class ReplyUpdateOrCreateView(APIView):
class ReplyCreate(APIView):
def post(self, request):
data = {
'topic_id': request.POST.get('topic_id'),
'reply_name': request.POST.get('reply_name'),
'be_reply_name': request.POST.get('be_reply_name'),
'user_id': request.POST.get('user_id'),
'replied_id': request.POST.get("replied_id", None),
'topic_id': request.POST.get("topic_id", None),
'content': request.POST.get('content'),
}
try:
data = self.rpc['venus/sun/topic/reply/create'](data=data).unwrap()
"""
data = {
'id': 1,
'reply_type': 1,
'create_time': '2108-09-92 12:12:12',
'reply_name': 'xxxxx',
'be_reply_name': 'xxxxxx',
'content': '测试测试',
}
"""
data = self.rpc['venus/sun/topic/reply/edit'](id=None, data=data).unwrap()
except Exception as e:
# raise e
data = {
'id': 6,
'reply_type': "贴住的评论",
'create_time': '2108-09-92 12:12:12',
'reply_name': 'xxxxx',
'be_reply_name': 'xxxxxx',
'content': '测试测试',
}
raise e
return {'data': data}
......@@ -20,35 +20,41 @@ from .token import *
urlpatterns = [
# 登陆,注销相关
url(r'account/login$', LoginView.as_view()),
url(r'account/logout$', LogoutView.as_view()),
url(r'account/get$', LoginView.as_view()),
url(r'^account/login$', LoginView.as_view()),
url(r'^account/logout$', LogoutView.as_view()),
url(r'^account/get$', LoginView.as_view()),
url(r'account/list$', AccountList.as_view()),
url(r'account/list/update$', AccountList.as_view()),
url(r'account/detail$', AccountUpdateOrCreateView.as_view()),
url(r'account/create$', AccountUpdateOrCreateView.as_view()),
url(r'^account/list$', AccountList.as_view()),
url(r'^account/list/update$', AccountList.as_view()),
url(r'^account/detail$', AccountUpdateOrCreateView.as_view()),
url(r'^account/create$', AccountUpdateOrCreateView.as_view()),
# user相关
url(r'user/list$', UserListView.as_view()),
url(r'^user/list$', UserListView.as_view()),
url(r'^user/get$', UserUpdateOrCreate.as_view()),
url(r'^user/create$', UserUpdateOrCreate.as_view()),
url(r'^user/group/list$', UserGroupView.as_view()),
# group相关
url(r'group/list$', GroupListView.as_view()),
url(r'group/update$', GroupListView.as_view()),
url(r'group/detail', GroupUpdateOrCreate.as_view()),
url(r'^group/list$', GroupListView.as_view()),
url(r'^group/list/update$', GroupListView.as_view()),
url(r'^group/get$', GroupUpdateOrCreate.as_view()),
url(r'group/create$', GroupUpdateOrCreate.as_view()),
url(r'^group/user/list$', GroupRelatedUser.as_view()),
url(r'^group/user/get$', GroupRelatedUserGET.as_view()),
# topic相关
url(r'topic/list$', TopicListView.as_view()),
url(r'topic/detail', TopicUpdateOrCreateView.as_view()),
url(r'topic/creacte', TopicUpdateOrCreateView.as_view()),
url(r'topic/reply/list', ReplyUpdateOrCreateView.as_view()),
url(r'topic/reply/batch_delete', ReplyUpdateOrCreateView.as_view()),
url(r'topic/reply/create', ReplyCreate.as_view()),
url(r'^topic/list$', TopicListView.as_view()),
url(r'^topic/detail$', TopicUpdateOrCreateView.as_view()),
url(r'^topic/create$', TopicUpdateOrCreateView.as_view()),
url(r'^topic/reply/list$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/batch_delete$', ReplyUpdateOrCreateView.as_view()),
url(r'^topic/reply/create$', ReplyCreate.as_view()),
# star相关
url(r'star/list$', StarListView.as_view()),
url(r'star/create', StarUpdateOrCreate.as_view()),
url(r'star/detail', StarUpdateOrCreate.as_view()),
url(r'star/star_related_group_info', StarRelatedGroup.as_view()),
url(r'^star/list$', StarListView.as_view()),
url(r'^star/create$', StarUpdateOrCreate.as_view()),
url(r'^star/detail$', StarUpdateOrCreate.as_view()),
url(r'^star/star_related_group_info', StarRelatedGroup.as_view()),
# push相关
url(r'push/list$', PushListView.as_view()),
......
......@@ -3,7 +3,9 @@
# __author__ = "chenwei"
# Date: 2018/11/15
import json
from utils.base import APIView
from utils.time_utils import analysis_time
class UserListView(APIView):
......@@ -12,20 +14,56 @@ class UserListView(APIView):
limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', ""))
try:
data = self.rpc['venus/community/user/get'](offset=page, limit=limit, filters=filter).unwrap()
data = self.rpc['venus/sun/user/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap()
except Exception as e:
raise e
return data
class UserUpdateOrCreate(APIView):
def get(self, request):
id = request.GET.get('id')
try:
data = self.rpc['venus/sun/user/get'](id=id).unwrap()
except Exception as e:
raise e
return data
def post(self, request):
id = request.POST.get('id', '')
show_time = analysis_time(request.POST.get('show_time', 0))
data = {
'total': 200,
'data': [
{"id": 1, 'username': 'alex', 'phone': '12345678912', 'email': 'http://www.baid.com', 'group_nums': 23,
'topic_num': 12, 'group_identify': '组长,长老', 'user_identify': '普通用户', 'is_recommend': 1},
{"id": 2, 'username': 'ttt', 'phone': '12345678912', 'email': 'http://www.baid.com', 'group_nums': 23,
'topic_num': 12, 'group_identify': '长老', 'user_identify': '马甲用户', 'is_recommend': 0},
{"id": 3, 'username': 'xcc', 'phone': '12345678912', 'email': 'http://www.baid.com', 'group_nums': 23,
'topic_num': 12, 'group_identify': '精英', 'user_identify': '普通用户', 'is_recommend': 1},
{"id": 4, 'username': 'aaa', 'phone': '12345678912', 'email': 'http://www.baid.com', 'group_nums': 23,
'topic_num': 12, 'group_identify': '高级会有', 'user_identify': '马甲用户', 'is_recommend': 0},
]
'is_recommend': request.POST.get('is_recommend'),
'avatar': request.POST.get('avatar'),
'nick_name': request.POST.get('nick_name'),
'tag_ids': request.POST.get('tag_ids'),
'is_puppet': request.POST.get('is_puppet'),
'city': request.POST.get('city'),
'show_time': show_time,
'phone': request.POST.get('phone'),
'email': request.POST.get('email'),
'gender': request.POST.get('gender'),
'group_ids': json.loads(request.POST.get('group_ids')),
}
return data
\ No newline at end of file
try:
self.rpc['venus/sun/user/edit'](id=id, data=data).unwrap()
except Exception as e:
raise e
return {
'message': '更新成功'
}
class UserGroupView(APIView):
def get(self, request):
user_id = request.GET.get('id')
try:
data = self.rpc['venus/sun/user/group/list'](user_id=user_id).unwrap()
except Exception as e:
raise e
return {
'total': 1,
'data': data
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ export function fetchList(query) {
export function OffLineOrOnLine(data) {
return request({
url: '/api/group/update',
url: '/api/group/list/update',
method: 'post',
data
})
......@@ -18,8 +18,33 @@ export function OffLineOrOnLine(data) {
export function GroupDetail(id) {
return request({
url: '/api/group/detail',
url: '/api/group/get',
method: 'get',
params: { id }
})
}
export function createGroup(data) {
return request({
url: '/api/group/create',
method: 'post',
data
})
}
export function fetchGroupRelateduser(query) {
return request({
url: '/api/group/user/list',
method: 'get',
params: query
})
}
export function GroupUserDetail(id) {
return request({
url: '/api/group/user/get',
method: 'get',
params: { id }
})
}
......@@ -56,3 +56,11 @@ export function DelReply(data) {
data
})
}
export function ModifyReply(data) {
return request({
url: '/api/topic/reply/create',
method: 'post',
data
})
}
......@@ -16,3 +16,28 @@ export function OffLineOrOnLine(data) {
data
})
}
export function UserDetail(id) {
return request({
url: '/api/user/get',
method: 'get',
params: { id }
})
}
export function fetchGroupUser(query) {
return request({
url: '/api/user/group/list',
method: 'get',
params: query
})
}
export function userCreate(data) {
return request({
url: '/api/user/create',
method: 'post',
data,
})
}
......@@ -21,7 +21,7 @@ Mock.XHR.prototype.send = function() {
// 登录相关
Mock.mock(/\/login\/login/, 'post', loginAPI.loginByUsername)
Mock.mock(/\/login\/logout/, 'post', loginAPI.logout)
Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo)
// Mock.mock(/\/user\/info\.*/, 'get', loginAPI.getUserInfo)
// 文章相关
Mock.mock(/\/article\/list/, 'get', articleAPI.getList)
......
......@@ -105,7 +105,7 @@ export default {
this.getList()
},
handleFilter() {
this.listQuery.page = 0
this.listQuery.page = 1
this.getList()
},
handleCreate() {
......
......@@ -5,10 +5,17 @@
<el-select v-model="listQuery.filter.key" :placeholder="'搜索字段'" clearable class="filter-item" style="width: 110px">
<el-option v-for="item in SearchTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.is_online" :placeholder="'是否下线'" clearable class="filter-item" style="width: 110px">
<el-option v-for="item in OnlineTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.is_recommend" :placeholder="'是否推荐'" clearable class="filter-item" style="width: 110px">
<el-option v-for="item in recommendTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">创建</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('offline')">下线</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('online')">上线</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('is_recommend')">推荐</el-button>
</div>
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center"></el-table-column>
......@@ -28,7 +35,7 @@
<el-table-column align="center" label="小组简介">
<template slot-scope="scope">
<span>{{ scope.row.desc }}</span>
<span>{{ scope.row.description }}</span>
</template>
</el-table-column>
......@@ -61,13 +68,13 @@
</template>
</el-table-column>
<el-table-column align="center" label="线">
<el-table-column align="center" label="是否在线">
<template slot-scope="scope">
<el-tag :type="scope.row.is_online | isOnlineFilter">{{ scope.row.is_online==1 ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="推荐">
<el-table-column align="center" label="是否推荐">
<template slot-scope="scope">
<el-tag :type="scope.row.is_recommend | isOnlineFilter">{{ scope.row.is_recommend==1 ? '是' : '否' }}</el-tag>
</template>
......@@ -120,12 +127,22 @@ export default {
filter: {
value: '',
key: '',
is_online: '',
is_recommend: '',
},
},
SearchTypeOptions:[
{'key': 'id', 'display_name': '小组ID'},
{'key': 'content', 'display_name': '小组名称'},
]
{'key': 'name', 'display_name': '小组名称'},
],
OnlineTypeOptions: [
{'key': 0, 'display_name': '否'},
{'key': 1, 'display_name': '是'},
],
recommendTypeOptions: [
{'key': 0, 'display_name': '否'},
{'key': 1, 'display_name': '是'},
],
}
},
created() {
......@@ -135,6 +152,7 @@ export default {
getList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
console.log(response.data.data.data)
this.list = response.data.data.data
this.total = response.data.data.total
this.listLoading = false
......@@ -152,11 +170,11 @@ export default {
this.getList()
},
handleFilter() {
this.listQuery.page = 0
this.listQuery.page = 1
this.getList()
},
handleCreate() {
this.$router.push('/push/create')
this.$router.push('/group/create')
},
handleOfflineOrOnline(val){
const length = this.multipleSelection.length;
......@@ -165,14 +183,16 @@ export default {
for (let i = 0; i < length; i++) {
if (val === 'offline'){
this.multipleSelection[i].is_online = 0
}else{
}else if (val == 'is_recommend'){
this.multipleSelection[i].is_recommend = 1
}
else{
this.multipleSelection[i].is_online = 1
}
str += this.multipleSelection[i].id + ' ';
}
OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = [];
response.data.data.message
this.$message.success(response.data.data.message);
})
},
......
......@@ -53,19 +53,19 @@
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="pickid:" prop="id" v-if="isEdit">
<el-input :rows="1" v-model="postForm.id" type="number" class="article-textarea"
style="width: 120px" readonly/>
style="width: 120px" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="pick用户:" prop="user_nums" v-if="isEdit">
<el-input :rows="1" v-model="postForm.user_nums" type="number" class="article-textarea"
style="width: 120px" readonly/>
style="width: 120px" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="85px" label="创建时间:" prop="create_time" v-if="isEdit">
<el-input :rows="1" v-model="postForm.create_time" type="text" class="article-textarea"
style="width: 170px" readonly/>
style="width: 170px" disabled/>
</el-form-item>
</el-col>
</el-row>
......
......@@ -22,20 +22,20 @@
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="推送ID:" prop="id" v-if="isEdit">
<el-input :rows="1" v-model="postForm.id" type="text" class="article-textarea"
style="width: 180px" readonly v-if="isEdit"/>
style="width: 180px" disabled v-if="isEdit"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="创建时间:" prop="create_time" v-if="isEdit">
<el-input :rows="1" v-model="postForm.create_time" type="text" class="article-textarea"
style="width: 199px" readonly v-if="isEdit"/>
style="width: 199px" disabled v-if="isEdit"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="创建用户:" v-if="isEdit">
<el-input :rows="1" v-model="postForm.user.name" type="text" class="article-textarea"
style="width: 180px" readonly v-if="isEdit"/>
style="width: 180px" disabled v-if="isEdit"/>
</el-form-item>
</el-col>
</el-row>
......
......@@ -107,7 +107,7 @@ export default {
this.getList()
},
handleFilter() {
this.listQuery.page = 0
this.listQuery.page = 1
this.getList()
},
handleCreate() {
......
......@@ -24,13 +24,13 @@
<el-row>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="明星ID:" v-if="isEdit">
<el-input v-model="postForm.id" type="text" style="width: 230px;" readonly/>
<el-input v-model="postForm.id" type="text" style="width: 230px;" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="创建时间:" v-if="isEdit">
<el-input v-model="postForm.create_time" type="text" placeholder="请输入内容" style="width: 230px;"
readonly/>
disabled/>
</el-form-item>
</el-col>
</el-row>
......@@ -39,20 +39,20 @@
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="用户数:"
v-if="isEdit">
<el-input v-model="postForm.user_nums" type="number" style="width: 220px;" readonly/>
<el-input v-model="postForm.user_nums" type="number" style="width: 220px;" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="帖子数:"
v-if="isEdit">
<el-input v-model="postForm.topic_nums" type="number" style="width: 220px;" readonly/>
<el-input v-model="postForm.topic_nums" type="number" style="width: 220px;" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item style="margin-bottom: 20px;" label-width="75px" label="小组数:" v-if="isEdit">
<el-input v-model="postForm.group_nums" type="number" style="width: 220px;" readonly/>
<el-input v-model="postForm.group_nums" type="number" style="width: 220px;" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -288,6 +288,7 @@
if (valid) {
this.loading = true
this.postForm.group_ids = JSON.stringify(this.group_ids);
console.log(this.postForm.group_ids)
// 处理未修改标签
if (this.temp_city_name === this.postForm.city){
this.postForm.city = this.temp_city_id;
......@@ -350,7 +351,8 @@
this.temp_group_ids = ''
},
delUser() {
this.postForm.group_ids.push(...this.multipleSelection)
this.del_list.push(...this.multipleSelection)
},
handleSelectionChange(val) {
this.multipleSelection = val;
......
......@@ -60,7 +60,7 @@
</el-table>
<pagination v-show="total>0" :total="total" :page="listQuery.page" :limit="listQuery.limit" style="margin-left: 150px;" @pagination="getList" />
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" style="margin-left: 150px;" @pagination="getList" />
</div>
</template>
......@@ -162,7 +162,7 @@ export default {
})
},
handleFilter() {
this.listQuery.page = 0
this.listQuery.page = 1
this.getList()
},
handleCreate() {
......
......@@ -8,12 +8,12 @@
<el-select v-model="listQuery.filter.is_online" :placeholder="'上线'" clearable class="filter-item" style="width: 100px">
<el-option v-for="item in BooleanTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.is_reported" :placeholder="'举报'" clearable class="filter-item" style="width: 100px">
<el-select v-model="listQuery.filter.complaints__isnull" :placeholder="'举报'" clearable class="filter-item" style="width: 100px">
<el-option v-for="item in ReBooleanTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.is_puppet" :placeholder="'马甲'" clearable class="filter-item" style="width: 100px">
<el-option v-for="item in ReBooleanTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
<el-option v-for="item in BooleanTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.content_level" :placeholder="'帖子星级'" clearable class="filter-item" style="width: 100px">
......@@ -23,7 +23,6 @@
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleCreate">创建</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('offline')">下线</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('online')">上线</el-button>
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('is_reported')">推荐</el-button>
</div>
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center"></el-table-column>
......@@ -80,18 +79,13 @@
<el-table-column align="center" label="下线">
<template slot-scope="scope">
<el-tag :type="scope.row.is_online | isOnlineFilter">{{ scope.row.is_online==1 ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="推荐">
<template slot-scope="scope">
<el-tag :type="scope.row.is_reported | isOnlineFilter">{{ scope.row.is_reported==1 ? '是' : '否' }}</el-tag>
<el-tag :type="scope.row.is_online | isOnlineFilter">{{ scope.row.is_online=== 1 ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page="listQuery.page" :limit="listQuery.limit" style="margin-left: 150px;" @pagination="getList" />
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" style="margin-left: 150px;" @pagination="getList" />
</div>
</template>
......@@ -146,8 +140,8 @@ export default {
{'key': 0, 'display_name': '否'}
],
ReBooleanTypeOptions: [
{'key': 1, 'display_name': '是'},
{'key': 0, 'display_name': '否'}
{'key': 0, 'display_name': '是'},
{'key': 1, 'display_name': '否'}
],
SearchTypeOptions:[
{'key': 'id', 'display_name': '帖子ID'},
......@@ -193,8 +187,6 @@ export default {
for (let i = 0; i < length; i++) {
if (val === 'offline'){
this.multipleSelection[i].is_online = 0
} else if(val === 'is_reported'){
this.multipleSelection[i].is_reported = 0
} else{
this.multipleSelection[i].is_online = 1
}
......@@ -207,11 +199,11 @@ export default {
})
},
handleFilter() {
this.listQuery.page = 0
this.listQuery.page = 1
this.getList()
},
handleCreate() {
this.$router.push('/pick/create')
this.$router.push('/topic/create')
}
}
}
......
This diff is collapsed.
......@@ -8,9 +8,9 @@
<el-select v-model="listQuery.filter.user_type" :placeholder="'用户身份'" clearable class="filter-item" style="width: 110px">
<el-option v-for="item in UserTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-select v-model="listQuery.filter.group_type" :placeholder="'组内身份'" clearable class="filter-item" style="width: 110px">
<el-option v-for="item in IdentifyTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<!--<el-select v-model="listQuery.filter.group_type" :placeholder="'组内身份'" clearable class="filter-item" style="width: 110px">-->
<!--<el-option v-for="item in IdentifyTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>-->
<!--</el-select>-->
<el-select v-model="listQuery.filter.is_recommend" :placeholder="'推荐'" clearable class="filter-item" style="width: 100px">
<el-option v-for="item in ReBooleanTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
......@@ -19,59 +19,59 @@
<el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-edit" @click="handleOfflineOrOnline('recommend')">推荐</el-button>
</div>
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="selection" align="center"></el-table-column>
<el-table-column align="center" label="用户ID " width="80">
<template slot-scope="scope">
<router-link :to="'/pick/edit/'+scope.row.id" class="link-type">
<span>{{ scope.row.id }}</span>
<router-link :to="'/user/edit/'+scope.row.user_id" class="link-type">
<span>{{ scope.row.user_id }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column width="140px" align="center" label="用户名">
<el-table-column align="center" label="用户名">
<template slot-scope="scope">
<span>{{ scope.row.username }}</span>
<span>{{ scope.row.nick_name }}</span>
</template>
</el-table-column>
<el-table-column width="140px" align="center" label="联系电话">
<el-table-column align="center" label="联系电话">
<template slot-scope="scope">
<span>{{ scope.row.phone }}</span>
</template>
</el-table-column>
<el-table-column width="180px" align="center" label="邮箱">
<el-table-column align="center" label="邮箱">
<template slot-scope="scope">
<span>{{ scope.row.email }}</span>
</template>
</el-table-column>
<el-table-column width="70px" align="center" label="关注小组">
<el-table-column align="center" label="关注小组">
<template slot-scope="scope">
<span>{{ scope.row.group_nums }}</span>
</template>
</el-table-column>
<el-table-column width="70px" align="center" label="帖子数">
<el-table-column align="center" label="帖子数">
<template slot-scope="scope">
<span>{{ scope.row.topic_num }}</span>
<span>{{ scope.row.topic_nums }}</span>
</template>
</el-table-column>
<el-table-column width="150px" align="center" label="组内身份">
<template slot-scope="scope">
<span>{{ scope.row.group_identify }}</span>
</template>
</el-table-column>
<!--<el-table-column width="150px" align="center" label="组内身份">-->
<!--<template slot-scope="scope">-->
<!--<span>{{ scope.row.group_identify }}</span>-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column width="100px" align="center" label="用户身份">
<el-table-column align="center" label="用户身份">
<template slot-scope="scope">
<span>{{ scope.row.user_identify }}</span>
</template>
</el-table-column>
<el-table-column width="80px" align="center" label="推荐">
<el-table-column align="center" label="推荐">
<template slot-scope="scope">
<el-tag :type="scope.row.is_recommend | isOnlineFilter">{{ scope.row.is_recommend==1 ? '是' : '否' }}</el-tag>
</template>
......@@ -191,7 +191,6 @@ export default {
}
OffLineOrOnLine({type:val, ids:str}).then(response => {
this.multipleSelection = [];
response.data.data.message
this.$message.success(response.data.data.message);
})
},
......
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