Commit 729663df authored by Davve's avatar Davve

修复异常

parent d6793025
...@@ -57,8 +57,8 @@ class GroupUpdateOrCreate(APIView): ...@@ -57,8 +57,8 @@ class GroupUpdateOrCreate(APIView):
data = { data = {
'name': request.POST.get('name', ''), 'name': request.POST.get('name', ''),
'description': request.POST.get('description', ''), 'description': request.POST.get('description', ''),
'creator_id': request.POST.get('group_leader', ''), 'creator_id': request.POST.get('user_id', ''),
'star_ids': json.loads(request.POST.get('star', '')).split(','), # TODO是否需要加 'star_ids': json.loads(request.POST.get('star', '')),
'is_online': request.POST.get('is_online', ''), 'is_online': request.POST.get('is_online', ''),
'is_recommend': request.POST.get('is_recommend', ''), 'is_recommend': request.POST.get('is_recommend', ''),
'user_ids': json.loads(request.POST.get('user_ids', '')) 'user_ids': json.loads(request.POST.get('user_ids', ''))
......
...@@ -30,6 +30,7 @@ class PushUpdateOrCreateView(APIView): ...@@ -30,6 +30,7 @@ class PushUpdateOrCreateView(APIView):
def post(self, request): def post(self, request):
id = request.POST.get('id', '') id = request.POST.get('id', '')
creator_id = request.POST.get('creator_id')
push_time = analysis_time(request.POST.get('push_time', 0)) push_time = analysis_time(request.POST.get('push_time', 0))
data = { data = {
...@@ -38,7 +39,7 @@ class PushUpdateOrCreateView(APIView): ...@@ -38,7 +39,7 @@ class PushUpdateOrCreateView(APIView):
'icon': request.POST.get('icon', '')[:-2], 'icon': request.POST.get('icon', '')[:-2],
'content': request.POST.get('content', ''), 'content': request.POST.get('content', ''),
'title': request.POST.get('title', ''), 'title': request.POST.get('title', ''),
'creator_id': '' # TODO 运营ID 'creator_id': creator_id
} }
try: try:
self.rpc['venus/sun/push/edit'](id=id, data=data).unwrap() self.rpc['venus/sun/push/edit'](id=id, data=data).unwrap()
......
...@@ -28,7 +28,7 @@ const messages = { ...@@ -28,7 +28,7 @@ const messages = {
const i18n = new VueI18n({ const i18n = new VueI18n({
// set locale // set locale
// options: en | zh | es // options: en | zh | es
locale: Cookies.get('language') || 'en', locale: Cookies.get('language') || 'zh',
// set locale messages // set locale messages
messages messages
}) })
......
...@@ -7,7 +7,7 @@ const app = { ...@@ -7,7 +7,7 @@ const app = {
withoutAnimation: false withoutAnimation: false
}, },
device: 'desktop', device: 'desktop',
language: Cookies.get('language') || 'en', language: 'zh',
size: Cookies.get('size') || 'medium' size: Cookies.get('size') || 'medium'
}, },
mutations: { mutations: {
...@@ -30,7 +30,7 @@ const app = { ...@@ -30,7 +30,7 @@ const app = {
}, },
SET_LANGUAGE: (state, language) => { SET_LANGUAGE: (state, language) => {
state.language = language state.language = language
Cookies.set('language', language) Cookies.set('language', 'zh')
}, },
SET_SIZE: (state, size) => { SET_SIZE: (state, size) => {
state.size = size state.size = size
......
...@@ -79,7 +79,6 @@ export default { ...@@ -79,7 +79,6 @@ export default {
value: '', value: '',
key: '', key: '',
is_online: '', is_online: '',
is_recommend: '',
}, },
}, },
BooleanTypeOptions: [ BooleanTypeOptions: [
...@@ -87,7 +86,7 @@ export default { ...@@ -87,7 +86,7 @@ export default {
{'key': 0, 'display_name': '否'} {'key': 0, 'display_name': '否'}
], ],
SearchTypeOptions:[ SearchTypeOptions:[
{'key': 'username', 'display_name': '用户名'}, {'key': 'user__username', 'display_name': '用户名'},
] ]
} }
}, },
......
...@@ -320,6 +320,7 @@ ...@@ -320,6 +320,7 @@
if (this.isEdit){ if (this.isEdit){
this.postForm.star = Assembledata(this.temp.star_ids, this.postForm.star) this.postForm.star = Assembledata(this.temp.star_ids, this.postForm.star)
} }
this.postForm.star = JSON.stringify(this.postForm.star)
this.postForm.user_ids = JSON.stringify(user_ids); this.postForm.user_ids = JSON.stringify(user_ids);
createGroup(this.postForm).then(response => { createGroup(this.postForm).then(response => {
this.$notify({ this.$notify({
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item style="margin-bottom: 40px;" prop="title"> <el-form-item style="margin-bottom: 40px;" prop="title">
<MDinput v-model="postForm.title" :maxlength="100" name="name" required> <MDinput v-model="postForm.title" :maxlength="100" name="title" required>
推送标题 推送标题
</MDinput> </MDinput>
</el-form-item> </el-form-item>
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<div class="postInfo-container"> <div class="postInfo-container">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="推送ID:" prop="id" v-if="isEdit"> <el-form-item style="margin-bottom: 40px;" label-width="75px" label="推送ID:" v-if="isEdit">
<el-input :rows="1" v-model="postForm.id" type="text" class="article-textarea" <el-input :rows="1" v-model="postForm.id" type="text" class="article-textarea"
style="width: 180px" disabled v-if="isEdit"/> style="width: 180px" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="创建用户:" v-if="isEdit"> <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" <el-input :rows="1" v-model="postForm.creator_name" type="text" class="article-textarea"
style="width: 180px" disabled v-if="isEdit"/> style="width: 180px" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -97,7 +97,7 @@ const defaultForm = { ...@@ -97,7 +97,7 @@ const defaultForm = {
icon: '', icon: '',
push_time: '', push_time: '',
url: '', url: '',
name:'', creator_name: ''
} }
export default { export default {
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
this.$refs.postForm.validate(valid => { this.$refs.postForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true this.loading = true
this.postForm.creator_id = this.$store.getters.id // 创建用户ID
CreatePush(this.postForm).then(response => { CreatePush(this.postForm).then(response => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
......
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
</el-table> </el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
style="margin-left: 250px;" @pagination="getList"/> style="margin-left: 150px;" @pagination="getList"/>
</div> </div>
</el-card> </el-card>
</el-row> </el-row>
......
...@@ -29,6 +29,13 @@ ...@@ -29,6 +29,13 @@
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%" <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%"
ref="multipleTable" @selection-change="handleSelectionChange"> ref="multipleTable" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center"></el-table-column> <el-table-column type="selection" align="center"></el-table-column>
<el-table-column align="center" label="ID">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="用户ID " width="80"> <el-table-column align="center" label="用户ID " width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<router-link :to="'/user/edit/'+scope.row.user_id" class="link-type"> <router-link :to="'/user/edit/'+scope.row.user_id" class="link-type">
...@@ -161,7 +168,8 @@ ...@@ -161,7 +168,8 @@
{'key': 1, 'display_name': '马甲用户'} {'key': 1, 'display_name': '马甲用户'}
], ],
SearchTypeOptions: [ SearchTypeOptions: [
{'key': 'id', 'display_name': '用户ID'}, {'key': 'id', 'display_name': 'ID'},
{'key': 'user_id', 'display_name': '用户ID'},
{'key': 'name', 'display_name': '用户名'}, {'key': 'name', 'display_name': '用户名'},
{'key': 'phone', 'display_name': '联系电话'}, {'key': 'phone', 'display_name': '联系电话'},
] ]
......
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