Commit 0f5e287b authored by Davve's avatar Davve

增加标签等级

parent d444cb22
...@@ -46,8 +46,9 @@ class UserSearchView(APIView): ...@@ -46,8 +46,9 @@ class UserSearchView(APIView):
class TagSearchView(APIView): class TagSearchView(APIView):
def get(self, request): def get(self, request):
name = request.GET.get('name') name = request.GET.get('name')
platform = request.GET.get('platform')
try: try:
data = self.rpc['venus/sun/tag/search'](name=name).unwrap() data = self.rpc['venus/sun/tag/search'](name=name, platform=platform).unwrap()
except Exception as e: except Exception as e:
raise e raise e
return { return {
......
...@@ -63,7 +63,8 @@ class TagUpdateOrCreateView(APIView): ...@@ -63,7 +63,8 @@ class TagUpdateOrCreateView(APIView):
'down_tags': down_tags, 'down_tags': down_tags,
'up_tags': up_tags, 'up_tags': up_tags,
'tagtypes': tagtypes, 'tagtypes': tagtypes,
'icon_url': request.POST.get('icon_url', '')[:-2] 'icon_url': request.POST.get('icon_url', '')[:-2],
'platform': request.POST.get('platform')
} }
try: try:
data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap() data = self.rpc['venus/sun/tag/edit'](id=id, data=data).unwrap()
......
var api = require('./api') var api = require('./api')
// //
// const target = 'http://doctor.test.env' // const target = 'http://doctor.test.env'
// const target = 'http://172.30.8.231:8000' const target = 'http://172.30.8.131:8000'
const target = 'http://172.30.8.156:10000' // const target = 'http://172.30.8.156:10000'
// const target = 'http://192.168.1.9:8000' // const target = 'http://192.168.1.9:8000'
......
...@@ -24,11 +24,11 @@ export function countrySearch(name) { ...@@ -24,11 +24,11 @@ export function countrySearch(name) {
}) })
} }
export function tagSearch(name) { export function tagSearch(query) {
return request({ return request({
url: '/api/search/tag', url: '/api/search/tag',
method: 'get', method: 'get',
params: { name } params: query
}) })
} }
......
...@@ -150,7 +150,8 @@ export default { ...@@ -150,7 +150,8 @@ export default {
{ 'key': 2, 'display_name': '女' } { 'key': 2, 'display_name': '女' }
], ],
uploadType: -99, uploadType: -99,
isdisabledFn: false isdisabledFn: false,
query: {}
} }
}, },
computed: { computed: {
...@@ -227,7 +228,8 @@ export default { ...@@ -227,7 +228,8 @@ export default {
}) })
}, },
getRemoteTagList(query) { getRemoteTagList(query) {
tagSearch(query).then(response => { this.query['name'] = query
tagSearch(this.query).then(response => {
if (!response.data.data.data) return if (!response.data.data.data) return
this.tagListOptions = response.data.data.data this.tagListOptions = response.data.data.data
}) })
......
...@@ -82,6 +82,18 @@ ...@@ -82,6 +82,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label-width="75px" label="标签等级:" class="postInfo-container-item">
<el-select v-model="postForm.platform" :placeholder="'标签等级:'" clearable
class="postInfo-container-item"
style="width: 70%"
:disabled="this.isEdit"
>
<el-option v-for="item in TagLevelOptions" :key="item.key" :label="item.display_name"
:value="item.key"/>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="标签简介:" prop="desc"> <el-form-item style="margin-bottom: 40px;" label-width="75px" label="标签简介:" prop="desc">
<el-input :rows="1" v-model="postForm.description" type="textarea" class="article-textarea" autosize <el-input :rows="1" v-model="postForm.description" type="textarea" class="article-textarea" autosize
...@@ -90,11 +102,11 @@ ...@@ -90,11 +102,11 @@
</el-form-item> </el-form-item>
<div style="margin-bottom: 20px"> <div style="margin-bottom: 20px">
<el-form-item style="margin-bottom: 40px;" label-width="75px" label="帖子图片:" prop="icon_url"> <el-form-item style="margin-bottom: 40px;" label-width="75px" label="帖子图片:" prop="icon_url">
<span v-model="uploadType"></span> <span v-model="uploadType"></span>
<Upload v-model="postForm.icon_url" :uploadType="uploadType"/> <Upload v-model="postForm.icon_url" :uploadType="uploadType"/>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
</el-form> </el-form>
...@@ -118,6 +130,7 @@ ...@@ -118,6 +130,7 @@
down_tags: [], down_tags: [],
tagtypes: [], tagtypes: [],
icon_url: '', icon_url: '',
platform: 0
} }
export default { export default {
...@@ -155,6 +168,11 @@ ...@@ -155,6 +168,11 @@
name: [{validator: validateRequire, trigger: 'blur'}], name: [{validator: validateRequire, trigger: 'blur'}],
}, },
tempRoute: {}, tempRoute: {},
TagLevelOptions: [
{'key': 0, 'display_name': '系统级'},
{'key': 1, 'display_name': '用户级'},
],
query: {}
} }
}, },
computed: { computed: {
...@@ -183,7 +201,7 @@ ...@@ -183,7 +201,7 @@
for (let i = 0; i < rep.down_tags.length; i++) { for (let i = 0; i < rep.down_tags.length; i++) {
this.down_tags.push(rep.down_tags[i]['id'] + ':' + rep.down_tags[i]['name']) this.down_tags.push(rep.down_tags[i]['id'] + ':' + rep.down_tags[i]['name'])
} }
for (let i = 0;i < rep.tagtypes.length; i++){ for (let i = 0; i < rep.tagtypes.length; i++) {
this.tagtypes.push(rep.tagtypes[i]['id'] + ':' + rep.tagtypes[i]['name']) this.tagtypes.push(rep.tagtypes[i]['id'] + ':' + rep.tagtypes[i]['name'])
} }
this.postForm = rep this.postForm = rep
...@@ -252,7 +270,9 @@ ...@@ -252,7 +270,9 @@
}) })
}, },
getRemoteTagList(query) { getRemoteTagList(query) {
tagSearch(query).then(response => { this.query['name'] = query
this.query['platform'] = this.postForm.platform
tagSearch(this.query).then(response => {
if (!response.data.data.data) return if (!response.data.data.data) return
this.TagListOptions = response.data.data.data this.TagListOptions = response.data.data.data
}) })
......
...@@ -434,6 +434,7 @@ ...@@ -434,6 +434,7 @@
}, },
dialogFormVisible: false, dialogFormVisible: false,
dialogStatus: '', dialogStatus: '',
query: {}
} }
}, },
computed: { computed: {
...@@ -570,7 +571,8 @@ ...@@ -570,7 +571,8 @@
}) })
}, },
getRemoteTagList(query) { getRemoteTagList(query) {
tagSearch(query).then(response => { this.query['name'] = query
tagSearch(this.query).then(response => {
if (!response.data.data.data) return if (!response.data.data.data) return
this.tagListOptions = response.data.data.data this.tagListOptions = response.data.data.data
}) })
......
...@@ -209,7 +209,8 @@ ...@@ -209,7 +209,8 @@
regionListOptions: [], regionListOptions: [],
tagListOptions: [], tagListOptions: [],
uploadType: 99, uploadType: 99,
isdisabledFn: false isdisabledFn: false,
query: {}
} }
}, },
computed: { computed: {
...@@ -300,7 +301,8 @@ ...@@ -300,7 +301,8 @@
}) })
}, },
getRemoteTagList(query) { getRemoteTagList(query) {
tagSearch(query).then(response => { this.query['name'] = query
tagSearch(this.query).then(response => {
if (!response.data.data.data) return if (!response.data.data.data) return
this.tagListOptions = response.data.data.data this.tagListOptions = response.data.data.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