Commit 729663df authored by Davve's avatar Davve

修复异常

parent d6793025
......@@ -57,8 +57,8 @@ class GroupUpdateOrCreate(APIView):
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是否需要加
'creator_id': request.POST.get('user_id', ''),
'star_ids': json.loads(request.POST.get('star', '')),
'is_online': request.POST.get('is_online', ''),
'is_recommend': request.POST.get('is_recommend', ''),
'user_ids': json.loads(request.POST.get('user_ids', ''))
......
......@@ -30,6 +30,7 @@ class PushUpdateOrCreateView(APIView):
def post(self, request):
id = request.POST.get('id', '')
creator_id = request.POST.get('creator_id')
push_time = analysis_time(request.POST.get('push_time', 0))
data = {
......@@ -38,7 +39,7 @@ class PushUpdateOrCreateView(APIView):
'icon': request.POST.get('icon', '')[:-2],
'content': request.POST.get('content', ''),
'title': request.POST.get('title', ''),
'creator_id': '' # TODO 运营ID
'creator_id': creator_id
}
try:
self.rpc['venus/sun/push/edit'](id=id, data=data).unwrap()
......
......@@ -28,7 +28,7 @@ const messages = {
const i18n = new VueI18n({
// set locale
// options: en | zh | es
locale: Cookies.get('language') || 'en',
locale: Cookies.get('language') || 'zh',
// set locale messages
messages
})
......
......@@ -7,7 +7,7 @@ const app = {
withoutAnimation: false
},
device: 'desktop',
language: Cookies.get('language') || 'en',
language: 'zh',
size: Cookies.get('size') || 'medium'
},
mutations: {
......@@ -30,7 +30,7 @@ const app = {
},
SET_LANGUAGE: (state, language) => {
state.language = language
Cookies.set('language', language)
Cookies.set('language', 'zh')
},
SET_SIZE: (state, size) => {
state.size = size
......
......@@ -79,7 +79,6 @@ export default {
value: '',
key: '',
is_online: '',
is_recommend: '',
},
},
BooleanTypeOptions: [
......@@ -87,7 +86,7 @@ export default {
{'key': 0, 'display_name': '否'}
],
SearchTypeOptions:[
{'key': 'username', 'display_name': '用户名'},
{'key': 'user__username', 'display_name': '用户名'},
]
}
},
......
......@@ -320,6 +320,7 @@
if (this.isEdit){
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);
createGroup(this.postForm).then(response => {
this.$notify({
......
......@@ -12,7 +12,7 @@
<el-col :span="24">
<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>
</el-form-item>
......@@ -20,9 +20,9 @@
<div class="postInfo-container">
<el-row>
<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"
style="width: 180px" disabled v-if="isEdit"/>
style="width: 180px" disabled />
</el-form-item>
</el-col>
......@@ -34,8 +34,8 @@
</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" disabled v-if="isEdit"/>
<el-input :rows="1" v-model="postForm.creator_name" type="text" class="article-textarea"
style="width: 180px" disabled/>
</el-form-item>
</el-col>
</el-row>
......@@ -97,7 +97,7 @@ const defaultForm = {
icon: '',
push_time: '',
url: '',
name:'',
creator_name: ''
}
export default {
......@@ -168,6 +168,7 @@ export default {
this.$refs.postForm.validate(valid => {
if (valid) {
this.loading = true
this.postForm.creator_id = this.$store.getters.id // 创建用户ID
CreatePush(this.postForm).then(response => {
this.$notify({
title: '成功',
......
......@@ -233,7 +233,7 @@
</el-table>
<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>
</el-card>
</el-row>
......
......@@ -29,6 +29,13 @@
<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>
<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">
<template slot-scope="scope">
<router-link :to="'/user/edit/'+scope.row.user_id" class="link-type">
......@@ -161,7 +168,8 @@
{'key': 1, 'display_name': '马甲用户'}
],
SearchTypeOptions: [
{'key': 'id', 'display_name': '用户ID'},
{'key': 'id', 'display_name': 'ID'},
{'key': 'user_id', 'display_name': '用户ID'},
{'key': 'name', '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