Commit 24dae774 authored by Davve's avatar Davve

增加pick

parent bd7378a8
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Date: 2018/11/15 # Date: 2018/11/15
from utils.base import APIView from utils.base import APIView
from alpha_types.venus import PICK_TYPE
class PickListView(APIView): class PickListView(APIView):
...@@ -63,4 +64,37 @@ class UpdateOrCreateView(APIView): ...@@ -63,4 +64,37 @@ class UpdateOrCreateView(APIView):
raise e raise e
return { return {
'message': '操作成功' 'message': '操作成功'
}
class PickUserListView(APIView):
def get(self, request):
pick_id = request.GET.get('id', 0)
pick_type = int(request.GET.get('pick_type', 0))
offset = int(request.GET.get('page', 1))
limit = int(request.GET.get('limit', 10))
filters = {
'pick_id': pick_id
}
dispatch_rpc_endpoint = {
PICK_TYPE.CELEBRITY: 'venus/sun/pick/celebrity/list',
PICK_TYPE.TOPIC: 'venus/sun/pick/topic/list'
}
try:
data = self.rpc[dispatch_rpc_endpoint[pick_type]](offset=(offset - 1) * limit, limit=limit, filters=filters).unwrap()
except Exception as e:
raise e
return data
def post(self, request):
celebrity_id = request.POST.get('celebrity_id', '')
fake_pick_nums = request.POST.get('fake_pick_nums', 0)
topic_id = request.POST.get('topic_id', '')
try:
self.rpc['venus/sun/pick/add_fake_pick_nums'](celebrity_id=celebrity_id, topic_id=topic_id, pick_nums=fake_pick_nums).unwrap()
except Exception as e:
raise e
return {
'message': '操作失败'
} }
\ No newline at end of file
...@@ -17,7 +17,7 @@ class GroupSearchView(APIView): ...@@ -17,7 +17,7 @@ class GroupSearchView(APIView):
return {'data': data} return {'data': data}
class RegionSearchView(APIView): class CountrySearchView(APIView):
def get(self, request): def get(self, request):
name = request.GET.get('name') name = request.GET.get('name')
try: try:
......
...@@ -7,23 +7,23 @@ import json ...@@ -7,23 +7,23 @@ import json
from utils.base import APIView from utils.base import APIView
class StarListView(APIView): class CelebrityListView(APIView):
def get(self, request): def get(self, request):
page = int(request.GET.get('page', 0)) page = int(request.GET.get('page', 0))
limit = int(request.GET.get('limit', 10)) limit = int(request.GET.get('limit', 10))
filter = self.handle_filter(request.GET.get('filter', "")) filter = self.handle_filter(request.GET.get('filter', ""))
try: try:
data = self.rpc['venus/sun/star/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap() data = self.rpc['venus/sun/celebrity/list'](offset=(page-1)*limit, limit=limit, filters=filter).unwrap()
except Exception as e: except Exception as e:
raise e raise e
return data return data
class StarUpdateOrCreate(APIView): class CelebrityUpdateOrCreate(APIView):
def get(self, request): def get(self, request):
id = request.GET.get('id') id = request.GET.get('id')
try: try:
data = self.rpc['venus/sun/star/get'](id=id).unwrap() data = self.rpc['venus/sun/celebrity/get'](id=id).unwrap()
except Exception as e: except Exception as e:
raise e raise e
return {'data': data} return {'data': data}
...@@ -41,7 +41,7 @@ class StarUpdateOrCreate(APIView): ...@@ -41,7 +41,7 @@ class StarUpdateOrCreate(APIView):
} }
print(json.loads(request.POST.get('group_ids', []))) print(json.loads(request.POST.get('group_ids', [])))
try: try:
self.rpc['venus/sun/star/edit'](id=id, data=data).unwrap() self.rpc['venus/sun/celebrity/edit'](id=id, data=data).unwrap()
except Exception as e: except Exception as e:
raise e raise e
...@@ -50,7 +50,7 @@ class StarUpdateOrCreate(APIView): ...@@ -50,7 +50,7 @@ class StarUpdateOrCreate(APIView):
} }
class StarRelatedGroup(APIView): class CelebrityRelatedGroup(APIView):
def get(self, request): def get(self, request):
id = request.GET.get('id') id = request.GET.get('id')
offset = int(request.GET.get('page', 0)) offset = int(request.GET.get('page', 0))
......
...@@ -51,33 +51,35 @@ urlpatterns = [ ...@@ -51,33 +51,35 @@ urlpatterns = [
url(r'^topic/reply/create$', ReplyCreate.as_view()), url(r'^topic/reply/create$', ReplyCreate.as_view()),
# star相关 # star相关
url(r'^star/list$', StarListView.as_view()), url(r'^celebrity/list$', CelebrityListView.as_view()),
url(r'^star/create$', StarUpdateOrCreate.as_view()), url(r'^celebrity/create$', CelebrityUpdateOrCreate.as_view()),
url(r'^star/detail$', StarUpdateOrCreate.as_view()), url(r'^celebrity/detail$', CelebrityUpdateOrCreate.as_view()),
url(r'^star/star_related_group_info', StarRelatedGroup.as_view()), url(r'^celebrity/celebrity_related_group_info', CelebrityRelatedGroup.as_view()),
# push相关 # push相关
url(r'push/list$', PushListView.as_view()), url(r'^push/list$', PushListView.as_view()),
url(r'push/create', PushUpdateOrCreateView.as_view()), url(r'^push/create', PushUpdateOrCreateView.as_view()),
url(r'push/detail', PushUpdateOrCreateView.as_view()), url(r'^push/detail', PushUpdateOrCreateView.as_view()),
url(r'push/effect_push', EffectPushTaskView.as_view()), url(r'^push/effect_push', EffectPushTaskView.as_view()),
# pick相关 # pick相关
url(r'pick/list$', PickListView.as_view()), url(r'^pick/list$', PickListView.as_view()),
url(r'pick/list/update$', PickListView.as_view()), url(r'^pick/list/update$', PickListView.as_view()),
url(r'pick/create$', UpdateOrCreateView.as_view()), url(r'^pick/create$', UpdateOrCreateView.as_view()),
url(r'pick/detail/', UpdateOrCreateView.as_view()), url(r'^pick/detail/', UpdateOrCreateView.as_view()),
url(r'^pick/user/list$', PickUserListView.as_view()),
url(r'^pick/add_fake_pick_nums$', PickUserListView.as_view()),
# 标签相关 # 标签相关
url(r'tag/list$', TagListView.as_view()), url(r'^tag/list$', TagListView.as_view()),
url(r'tag/list/update$', TagListView.as_view()), url(r'^tag/list/update$', TagListView.as_view()),
url(r'tag/create', TagUpdateOrCreateView.as_view()), url(r'^tag/create$', TagUpdateOrCreateView.as_view()),
url(r'tag/detail', TagUpdateOrCreateView.as_view()), url(r'^tag/detail$', TagUpdateOrCreateView.as_view()),
] ]
search_urlpatterns = [ search_urlpatterns = [
url(r'search/group$', GroupSearchView.as_view()), url(r'search/group$', GroupSearchView.as_view()),
url(r'search/region', RegionSearchView.as_view()), url(r'search/country', CountrySearchView.as_view()),
url(r'search/user', UserSearchView.as_view()), url(r'search/user', UserSearchView.as_view()),
url(r'search/tag', TagSearchView.as_view()), url(r'search/tag', TagSearchView.as_view()),
url(r'search/star', StarSearchView.as_view()), url(r'search/star', StarSearchView.as_view()),
......
...@@ -35,7 +35,7 @@ class UserUpdateOrCreate(APIView): ...@@ -35,7 +35,7 @@ class UserUpdateOrCreate(APIView):
def post(self, request): def post(self, request):
user_id = request.POST.get('id', '') user_id = request.POST.get('id', '')
show_time = analysis_time(request.POST.get('show_time', 0)) # show_time = analysis_time(request.POST.get('show_time', 0))
tag_ids = list(set(request.POST.get('tag_ids').split(','))) tag_ids = list(set(request.POST.get('tag_ids').split(',')))
if not user_id: if not user_id:
user_id = time.time() user_id = time.time()
...@@ -47,7 +47,7 @@ class UserUpdateOrCreate(APIView): ...@@ -47,7 +47,7 @@ class UserUpdateOrCreate(APIView):
'tag_ids': list(filter(lambda x: x, tag_ids)), 'tag_ids': list(filter(lambda x: x, tag_ids)),
'is_puppet': request.POST.get('is_puppet'), 'is_puppet': request.POST.get('is_puppet'),
'city_id': request.POST.get('city'), 'city_id': request.POST.get('city'),
'show_time': show_time, # 'show_time': show_time,
'phone': request.POST.get('phone'), 'phone': request.POST.get('phone'),
'email': request.POST.get('email'), 'email': request.POST.get('email'),
'gender': request.POST.get('gender'), 'gender': request.POST.get('gender'),
......
...@@ -10,4 +10,5 @@ git+ssh://git@git.wanmeizhensuo.com/backend/gm-protocol.git@master ...@@ -10,4 +10,5 @@ git+ssh://git@git.wanmeizhensuo.com/backend/gm-protocol.git@master
git+ssh://git@git.wanmeizhensuo.com/backend/gm-config.git@v0.1.3 git+ssh://git@git.wanmeizhensuo.com/backend/gm-config.git@v0.1.3
git+ssh://git@git.wanmeizhensuo.com/backend/gm-logging.git@v0.7.8 git+ssh://git@git.wanmeizhensuo.com/backend/gm-logging.git@v0.7.8
git+ssh://git@git.wanmeizhensuo.com/backend/gm-dataquery.git@v0.2.10 git+ssh://git@git.wanmeizhensuo.com/backend/gm-dataquery.git@v0.2.10
git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2 git+ssh://git@git.wanmeizhensuo.com/system/gm-tracer.git@v0.1.2
\ No newline at end of file git+ssh://git@git.wanmeizhensuo.com/alpha/alpha-types.git@dev
\ No newline at end of file
...@@ -32,3 +32,19 @@ export function fetchPickDetail(id) { ...@@ -32,3 +32,19 @@ export function fetchPickDetail(id) {
params: { id } params: { id }
}) })
} }
export function fetchPickUserList(query) {
return request({
url: '/api/pick/user/list',
method: 'get',
params: query
})
}
export function AddFakePickNums(data) {
return request({
url: '/api/pick/add_fake_pick_nums',
method: 'post',
data
})
}
...@@ -16,9 +16,9 @@ export function groupSearch(name) { ...@@ -16,9 +16,9 @@ export function groupSearch(name) {
}) })
} }
export function regionSearch(name) { export function countrySearch(name) {
return request({ return request({
url: '/api/search/region', url: '/api/search/country',
method: 'get', method: 'get',
params: { name } params: { name }
}) })
......
...@@ -2,7 +2,7 @@ import request from '@/utils/request' ...@@ -2,7 +2,7 @@ import request from '@/utils/request'
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/api/star/list', url: '/api/celebrity/list',
method: 'get', method: 'get',
params: query params: query
}) })
...@@ -10,7 +10,7 @@ export function fetchList(query) { ...@@ -10,7 +10,7 @@ export function fetchList(query) {
export function starCreate(data) { export function starCreate(data) {
return request({ return request({
url: '/api/star/create', url: '/api/celebrity/create',
method: 'post', method: 'post',
data data
}) })
...@@ -18,7 +18,7 @@ export function starCreate(data) { ...@@ -18,7 +18,7 @@ export function starCreate(data) {
export function starDetail(id) { export function starDetail(id) {
return request({ return request({
url: '/api/star/detail', url: '/api/celebrity/detail',
method: 'get', method: 'get',
params: { id } params: { id }
}) })
...@@ -26,7 +26,7 @@ export function starDetail(id) { ...@@ -26,7 +26,7 @@ export function starDetail(id) {
export function OffLineOrOnLine(data) { export function OffLineOrOnLine(data) {
return request({ return request({
url: '/api/star/update_or_create', url: '/api/celebrity/update_or_create',
method: 'post', method: 'post',
data data
}) })
...@@ -34,7 +34,7 @@ export function OffLineOrOnLine(data) { ...@@ -34,7 +34,7 @@ export function OffLineOrOnLine(data) {
export function fetchStarRelatedGroup(id) { export function fetchStarRelatedGroup(id) {
return request({ return request({
url: '/api/star/star_related_group_info', url: '/api/celebrity/celebrity_related_group_info',
method: 'get', method: 'get',
params: { id } params: { id }
}) })
......
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span> <span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item> </el-form-item>
</el-card> </el-card>
</el-row> </el-row>
......
...@@ -8,110 +8,254 @@ ...@@ -8,110 +8,254 @@
</sticky> </sticky>
<div class="createPost-main-container"> <div class="createPost-main-container">
<el-row> <el-row :gutter="20">
<el-col :span="24"> <el-card class="box-card">
<el-form-item style="margin-bottom: 40px;" prop="name"> <div slot="header" class="clearfix">
<MDinput v-model="postForm.name" :maxlength="100" name="name" required> <span>pick相关</span>
pick名称
</MDinput>
</el-form-item>
<div class="postInfo-container">
<el-row>
<el-col :span="8">
<el-form-item label-width="45px" label="性别:" class="postInfo-container-item">
<el-select v-model="postForm.gender" :placeholder="'性别:'" clearable class="postInfo-container-item"
style="width: 120px">
<el-option v-for="item in GenderTypeOptions" :key="item.key" :label="item.display_name"
:value="item.key"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="60px" label="属性:" class="postInfo-container-item">
<el-select v-model="postForm.pick_type" :placeholder="'性别:'" clearable
class="postInfo-container-item" style="width:120px">
<el-option v-for="item in PickTypeOptions" :key="item.key" :label="item.display_name"
:value="item.key"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="位置:" prop="position">
<el-input :rows="1" v-model="postForm.position" type="number" class="article-textarea"
style="width: 120px"
placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
</div> </div>
</el-col> <el-row>
<el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="name">
<MDinput v-model="postForm.name" :maxlength="100" name="name" required>
pick名称
</MDinput>
</el-form-item>
<div class="postInfo-container">
<el-row>
<el-col :span="8">
<el-form-item label-width="45px" label="性别:" class="postInfo-container-item">
<el-select v-model="postForm.gender" :placeholder="'性别:'" clearable
class="postInfo-container-item"
style="width: 120px">
<el-option v-for="item in GenderTypeOptions" :key="item.key" :label="item.display_name"
:value="item.key"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="60px" label="属性:" class="postInfo-container-item">
<el-select v-model="postForm.pick_type" :placeholder="'性别:'" clearable
class="postInfo-container-item" style="width:120px">
<el-option v-for="item in PickTypeOptions" :key="item.key" :label="item.display_name"
:value="item.key"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="位置:" prop="position">
<el-input :rows="1" v-model="postForm.position" type="number" class="article-textarea"
style="width: 120px"
placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="postInfo-container">
<el-row>
<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" 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" 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" disabled/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label-width="45px" label="地区:" class="postInfo-container-item">
<el-select v-model="postForm.region" :remote-method="getRemoteCityList" filterable remote multiple
value-key="id"
placeholder="搜索地区" style="width: 100%">
<el-option v-for="(item,index) in regionListOptions" :key="item+index" :label="item.name"
:value="item.id"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="45px" label="小组:" class="postInfo-container-item">
<el-select
v-model="postForm.pick_group"
:remote-method="getRemoteGroupList"
multiple
filterable
remote
reserve-keyword
placeholder="搜索小组"
style="width: 100%"
:loading="loading"
value-key="id"
>
<el-option v-for="(item, index) in groupListOptions" :key="item+index" :label="item.name"
:value="item.id"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="简介:" prop="desc">
<el-input :rows="1" v-model="postForm.desc" type="textarea" class="article-textarea" autosize
placeholder="请输入内容"/>
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="下线:">
<el-radio-group v-model="postForm.is_online">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-card>
</el-row> </el-row>
<el-row>
<el-col :span="24"> <el-row :gutter="20" style="margin-top:50px;" v-if="isEdit">
<div class="postInfo-container"> <el-card class="box-card">
<el-row> <div slot="header" class="clearfix">
<el-col :span="8"> <span v-if="">pick明星相关</span>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="pickid:" prop="id" v-if="isEdit"> </div>
<el-input :rows="1" v-model="postForm.id" type="number" class="article-textarea" <div style="margin-bottom:50px;">
style="width: 120px" disabled/> <div class="filter-container">
</el-form-item>
</el-col> </div>
<el-col :span="8"> <el-table :data="list" border fit highlight-current-row style="width: 100%"
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="pick用户:" prop="user_nums" v-if="isEdit"> ref="multipleTable" @selection-change="handleSelectionChange">
<el-input :rows="1" v-model="postForm.user_nums" type="number" class="article-textarea" <el-table-column type="selection" align="center"></el-table-column>
style="width: 120px" disabled/>
</el-form-item> <el-table-column align="center" label="明星ID">
</el-col> <template slot-scope="scope">
<el-col :span="8"> <span>{{ scope.row.celebrity_id }}</span>
<el-form-item style="margin-bottom: 40px;" label-width="85px" label="创建时间:" prop="create_time" v-if="isEdit"> </template>
<el-input :rows="1" v-model="postForm.create_time" type="text" class="article-textarea" </el-table-column>
style="width: 170px" disabled/> <el-table-column align="center" label="明星名称">
</el-form-item> <template slot-scope="scope">
</el-col> <span>{{ scope.row.celebrity_name }}</span>
</el-row> </template>
</el-table-column>
<el-table-column align="center" label="pick值">
<template slot-scope="scope">
<span>{{ scope.row.pick_nums }}</span>
</template>
</el-table-column>
<el-table-column align="center" min-width="100" label="添加pick值">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.fake_pick_nums" type="number" class="edit-input" size="small"/>
<el-button class="cancel-btn" size="small" icon="el-icon-refresh" type="warning"
@click="cancelEdit(scope.row)">取消
</el-button>
</template>
<span v-else>{{ scope.row.fake_pick_nums }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="120">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" icon="el-icon-circle-check-outline"
@click="confirmEdit(scope.row)">确认
</el-button>
<el-button v-else type="primary" size="small" icon="el-icon-edit"
@click="scope.row.edit=!scope.row.edit">添加
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
style="margin-left: 150px;" @pagination="getList"/>
</div> </div>
</el-col> </el-card>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label-width="45px" label="地区:" class="postInfo-container-item"> <el-row :gutter="20" style="margin-top:50px;" v-if="isEdit">
<el-select v-model="postForm.region" :remote-method="getRemoteCityList" filterable remote multiple value-key="id" <el-card class="box-card">
placeholder="搜索地区" style="width: 100%"> <div slot="header" class="clearfix">
<el-option v-for="(item,index) in regionListOptions" :key="item+index" :label="item.name" :value="item.id"/> <span v-if="">pick帖子相关</span>
</el-select> </div>
</el-form-item> <div style="margin-bottom:50px;">
</el-col> <div class="filter-container">
<el-col :span="12">
</div>
<el-form-item label-width="45px" label="小组:" class="postInfo-container-item"> <el-table :data="list" border fit highlight-current-row style="width: 100%"
<el-select ref="multipleTable" @selection-change="handleSelectionChange">
v-model="postForm.pick_group" <el-table-column type="selection" align="center"></el-table-column>
:remote-method="getRemoteGroupList"
multiple <el-table-column align="center" label="帖子ID">
filterable <template slot-scope="scope">
remote <span>{{ scope.row.topic_id }}</span>
reserve-keyword </template>
placeholder="搜索小组" </el-table-column>
style="width: 100%" <el-table-column align="center" label="帖子名称">
:loading="loading" <template slot-scope="scope">
value-key="id" <span>{{ scope.row.topic_name }}</span>
> </template>
<el-option v-for="(item, index) in groupListOptions" :key="item+index" :label="item.name" :value="item.id"/> </el-table-column>
</el-select> <el-table-column align="center" label="pick值">
</el-form-item> <template slot-scope="scope">
</el-col> <span>{{ scope.row.pick_nums }}</span>
</template>
</el-table-column>
<el-table-column align="center" min-width="100" label="添加pick值">
<template slot-scope="scope">
<template v-if="scope.row.edit">
<el-input v-model="scope.row.fake_pick_nums" type="number" class="edit-input" size="small"/>
<el-button class="cancel-btn" size="small" icon="el-icon-refresh" type="warning"
@click="cancelEdit(scope.row)">取消
</el-button>
</template>
<span v-else>{{ scope.row.fake_pick_nums }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="120">
<template slot-scope="scope">
<el-button v-if="scope.row.edit" type="success" size="small" icon="el-icon-circle-check-outline"
@click="confirmEdit(scope.row)">确认
</el-button>
<el-button v-else type="primary" size="small" icon="el-icon-edit"
@click="scope.row.edit=!scope.row.edit">添加
</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
style="margin-left: 150px;" @pagination="getList"/>
</div>
</el-card>
</el-row> </el-row>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="简介:" prop="desc">
<el-input :rows="1" v-model="postForm.desc" type="textarea" class="article-textarea" autosize
placeholder="请输入内容"/>
<span v-show="contentShortLength" class="word-counter">{{ contentShortLength }}</span>
</el-form-item>
<el-form-item style="margin-bottom: 40px;" label-width="45px" label="下线:">
<el-radio-group v-model="postForm.is_online">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -121,14 +265,15 @@ ...@@ -121,14 +265,15 @@
<script> <script>
import MDinput from '@/components/MDinput' import MDinput from '@/components/MDinput'
import Sticky from '@/components/Sticky' // 粘性header组件 import Sticky from '@/components/Sticky' // 粘性header组件
import {fetchPickDetail, CreatePick} from '@/api/pick' import Pagination from '@/components/Pagination'
import {groupSearch, regionSearch, citySearch} from '@/api/remoteSearch' import {fetchPickDetail, CreatePick, fetchPickUserList, AddFakePickNums} from '@/api/pick'
import { isInArray, removeByvale} from "@/utils"; import {groupSearch, citySearch} from '@/api/remoteSearch'
import {isInArray, removeByvale} from "@/utils";
function Assembledata(target, source) { function Assembledata(target, source) {
var region_data = [] var region_data = []
for (var i=0;i<target.length;i++){ for (var i = 0; i < target.length; i++) {
if (isInArray(source, target[i]['name'])){ if (isInArray(source, target[i]['name'])) {
region_data.push(target[i]['id']) region_data.push(target[i]['id'])
removeByvale(source, target[i]['name']); removeByvale(source, target[i]['name']);
} }
...@@ -151,7 +296,7 @@ ...@@ -151,7 +296,7 @@
export default { export default {
name: 'PickDetail', name: 'PickDetail',
components: {MDinput, Sticky}, components: {MDinput, Sticky, Pagination},
props: { props: {
isEdit: { isEdit: {
type: Boolean, type: Boolean,
...@@ -173,6 +318,7 @@ ...@@ -173,6 +318,7 @@
return { return {
postForm: Object.assign({}, defaultForm), postForm: Object.assign({}, defaultForm),
loading: false, loading: false,
pick_type: '',
regionListOptions: [], regionListOptions: [],
groupListOptions: [], groupListOptions: [],
GenderTypeOptions: [ GenderTypeOptions: [
...@@ -181,8 +327,8 @@ ...@@ -181,8 +327,8 @@
{'key': 1, 'display_name': '女'}, {'key': 1, 'display_name': '女'},
], ],
PickTypeOptions: [ PickTypeOptions: [
{'key': 1, 'display_name': '明星打榜'}, {'key': 1, 'display_name': 'PICK明星'},
{'key': 0, 'display_name': '用戶打榜'}, {'key': 0, 'display_name': 'PICK帖子'},
], ],
rules: { rules: {
name: [{validator: validateRequire, trigger: 'blur'}], name: [{validator: validateRequire, trigger: 'blur'}],
...@@ -190,10 +336,21 @@ ...@@ -190,10 +336,21 @@
position: [{validator: validateRequire, trigger: 'blur'}], position: [{validator: validateRequire, trigger: 'blur'}],
}, },
tempRoute: {}, tempRoute: {},
temparray:{ temparray: {
'region':[], 'region': [],
'pick_group': [], 'pick_group': [],
} },
listQuery: {
id: '',
pick_type: '',
page: 0,
limit: 10,
filter: {
},
},
list: null,
total: 1,
listLoading: true,
} }
}, },
computed: { computed: {
...@@ -205,6 +362,7 @@ ...@@ -205,6 +362,7 @@
if (this.isEdit) { if (this.isEdit) {
const id = this.$route.params && this.$route.params.id const id = this.$route.params && this.$route.params.id
this.fetchData(id) this.fetchData(id)
this.getList()
} else { } else {
this.postForm = Object.assign({}, defaultForm) this.postForm = Object.assign({}, defaultForm)
} }
...@@ -218,17 +376,18 @@ ...@@ -218,17 +376,18 @@
let rep = response.data.data.data; let rep = response.data.data.data;
let pick_temp = [] let pick_temp = []
let region_temp = [] let region_temp = []
for (let i=0;i<rep.pick_group.length;i++){ for (let i = 0; i < rep.pick_group.length; i++) {
pick_temp.push(rep.pick_group[i]['name']); pick_temp.push(rep.pick_group[i]['name']);
this.temparray['pick_group'].push(rep.pick_group[i]) this.temparray['pick_group'].push(rep.pick_group[i])
} }
for (let i=0;i<rep.region.length;i++){ for (let i = 0; i < rep.region.length; i++) {
region_temp.push(rep.region[i]['name']); region_temp.push(rep.region[i]['name']);
this.temparray['region'].push(rep.region[i]) this.temparray['region'].push(rep.region[i])
} }
rep.region = region_temp rep.region = region_temp
rep.pick_group = pick_temp rep.pick_group = pick_temp
this.postForm = rep this.postForm = rep
this.pick_type = rep.pick_type;
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
...@@ -237,10 +396,10 @@ ...@@ -237,10 +396,10 @@
this.$refs.postForm.validate(valid => { this.$refs.postForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
if (this.isEdit){ if (this.isEdit) {
this.postForm.region = Assembledata(this.temparray['region'], this.postForm.region); this.postForm.region = Assembledata(this.temparray['region'], this.postForm.region);
this.postForm.pick_group = Assembledata(this.temparray['pick_group'], this.postForm.pick_group); this.postForm.pick_group = Assembledata(this.temparray['pick_group'], this.postForm.pick_group);
}else{ } else {
this.postForm.region = this.postForm.region.join(',') this.postForm.region = this.postForm.region.join(',')
this.postForm.pick_group = this.postForm.pick_group.join(',') this.postForm.pick_group = this.postForm.pick_group.join(',')
} }
...@@ -285,6 +444,51 @@ ...@@ -285,6 +444,51 @@
this.groupListOptions = response.data.data.data this.groupListOptions = response.data.data.data
}) })
}, },
// 分页相关
handleSelectionChange(val) {
this.multipleSelection = val;
},
reply() {
},
getList() {
this.listLoading = true
this.listQuery.id = this.$route.params && this.$route.params.id
this.listQuery.pick_type = this.pick_type
fetchPickUserList(this.listQuery).then(response => {
const items = response.data.data.data
this.list = items.map(v => {
this.$set(v, 'edit', false)
v.original_fake_pick_nums = v.fake_pick_nums
return v
})
this.total = response.data.data.total
this.listLoading = false;
})
},
cancelEdit(row) {
row.fake_pick_nums = row.original_fake_pick_nums
row.edit = false
this.$message({
message: '取消成功',
type: 'warning'
})
},
confirmEdit(row) {
row.edit = false
row.original_fake_pick_nums = row.fake_pick_nums
this.$message({
message: '添加成功',
type: 'success'
})
AddFakePickNums(row).then(response => {
}).catch(err => {
})
}
} }
} }
</script> </script>
...@@ -323,4 +527,12 @@ ...@@ -323,4 +527,12 @@
top: 0px; top: 0px;
} }
} }
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 10px;
}
</style> </style>
...@@ -128,7 +128,7 @@ export default { ...@@ -128,7 +128,7 @@ export default {
userListOptions: [], userListOptions: [],
expireTimeOption: { expireTimeOption: {
disabledDate(date){ disabledDate(date){
return date.getTime() <= Date.now(); return date.getTime() <= Date.now() ;
} }
}, },
rules: { rules: {
......
...@@ -79,6 +79,7 @@ export default { ...@@ -79,6 +79,7 @@ export default {
}, },
SearchTypeOptions:[ SearchTypeOptions:[
{'key': 'id', 'display_name': '推送ID'}, {'key': 'id', 'display_name': '推送ID'},
{'key': 'title', 'display_name': '推送标题'},
{'key': 'content', 'display_name': '推送内容'}, {'key': 'content', 'display_name': '推送内容'},
] ]
} }
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
id: '', id: '',
gender: '', gender: '',
city: '', city: '',
is_online: undefined, is_online: 0,
description: '', description: '',
avatar: '', avatar: '',
} }
......
...@@ -166,7 +166,7 @@ export default { ...@@ -166,7 +166,7 @@ export default {
this.getList() this.getList()
}, },
handleCreate() { handleCreate() {
this.$router.push('/pick/create') this.$router.push('/star/create')
} }
} }
} }
......
...@@ -301,14 +301,14 @@ ...@@ -301,14 +301,14 @@
posting_time: '', posting_time: '',
content: '', content: '',
topic_ids: [], topic_ids: [],
content_level: '', content_level: 0,
group_name: '', group_name: '',
reported_time: '', reported_time: '',
user_name: '', user_name: '',
star_name: '', star_name: '',
is_puppet: '', is_puppet: '',
tag_ids: [], tag_ids: [],
is_online: '', is_online: 0,
} }
export default { export default {
...@@ -377,6 +377,7 @@ ...@@ -377,6 +377,7 @@
tempRoute: {}, tempRoute: {},
TopicLevelOptions: [ TopicLevelOptions: [
{'key': 0, 'display_name': '未审核'},
{'key': 1, 'display_name': '1星'}, {'key': 1, 'display_name': '1星'},
{'key': 2, 'display_name': '2星'}, {'key': 2, 'display_name': '2星'},
{'key': 3, 'display_name': '3星'}, {'key': 3, 'display_name': '3星'},
...@@ -728,7 +729,7 @@ ...@@ -728,7 +729,7 @@
this.listQuery.limit = val this.listQuery.limit = val
this.getList() this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.listQuery.page = val this.listQuery.page = val
this.getList() this.getList()
}, },
......
...@@ -148,6 +148,7 @@ export default { ...@@ -148,6 +148,7 @@ export default {
{'key': 'content', 'display_name': '帖子内容'}, {'key': 'content', 'display_name': '帖子内容'},
], ],
ContentLevelTypeOptions:[ ContentLevelTypeOptions:[
{'key': 0, 'display_name': '未审核'},
{'key': 1, 'display_name': '星级一'}, {'key': 1, 'display_name': '星级一'},
{'key': 2, 'display_name': '星级二'}, {'key': 2, 'display_name': '星级二'},
{'key': 3, 'display_name': '星级三'}, {'key': 3, 'display_name': '星级三'},
......
...@@ -49,12 +49,12 @@ ...@@ -49,12 +49,12 @@
<el-input v-model="postForm.nick_name" type="text" style="width: 230px"/> <el-input v-model="postForm.nick_name" type="text" style="width: 230px"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <!--<el-col :span="12">-->
<el-form-item label-width="75px" label="展示时间:" class="postInfo-container-item"> <!--<el-form-item label-width="75px" label="展示时间:" class="postInfo-container-item">-->
<el-date-picker v-model="postForm.show_time " type="datetime" format="yyyy-MM-dd HH:mm:ss" <!--<el-date-picker v-model="postForm.show_time " type="datetime" format="yyyy-MM-dd HH:mm:ss"-->
placeholder="选择日期时间" :picker-options="expireTimeOption" style="width: 230px"/> <!--placeholder="选择日期时间" :picker-options="expireTimeOption" style="width: 230px"/>-->
</el-form-item> <!--</el-form-item>-->
</el-col> <!--</el-col>-->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
import {validateURL} from '@/utils/validate' import {validateURL} from '@/utils/validate'
import {UserDetail, fetchGroupUser, userCreate} from '@/api/user' import {UserDetail, fetchGroupUser, userCreate} from '@/api/user'
import { GroupDetail } from '@/api/group' import { GroupDetail } from '@/api/group'
import {regionSearch, tagSearch, groupSearch, citySearch} from '@/api/remoteSearch' import { tagSearch, groupSearch, citySearch} from '@/api/remoteSearch'
import { isInArray, removeByvale} from "@/utils"; import { isInArray, removeByvale} from "@/utils";
function Assembledata(target, source) { function Assembledata(target, source) {
...@@ -280,11 +280,11 @@ ...@@ -280,11 +280,11 @@
content: [{validator: validateRequire}], content: [{validator: validateRequire}],
source_uri: [{validator: validateSourceUri, trigger: 'blur'}] source_uri: [{validator: validateSourceUri, trigger: 'blur'}]
}, },
expireTimeOption: { // expireTimeOption: {
disabledDate(date){ // disabledDate(date){
return date.getTime() <= Date.now(); // return date.getTime() <= Date.now();
} // }
}, // },
tempRoute: {}, tempRoute: {},
listQuery: { listQuery: {
page: 1, page: 1,
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
this.getList() this.getList()
}, },
handleCreate() { handleCreate() {
this.$router.push('/pick/create') this.$router.push('/user/create')
} }
} }
} }
......
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