Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢林臻
sun
Commits
1f233f9b
Commit
1f233f9b
authored
Nov 18, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成tag
parent
ec7de05e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
110 additions
and
68 deletions
+110
-68
account.py
api/account.py
+2
-2
pick.py
api/pick.py
+3
-3
push.py
api/push.py
+2
-2
star.py
api/star.py
+2
-2
tag.py
api/tag.py
+32
-3
topic.py
api/topic.py
+2
-2
user.py
api/user.py
+2
-2
TagDetail.vue
vu/src/views/tag/components/TagDetail.vue
+29
-11
list.vue
vu/src/views/tag/list.vue
+36
-41
No files found.
api/account.py
View file @
1f233f9b
...
...
@@ -8,8 +8,8 @@ from utils.base import APIView
class
AccountList
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
)
)
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/account/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
...
...
api/pick.py
View file @
1f233f9b
...
...
@@ -8,11 +8,11 @@ from utils.base import APIView
class
PickListView
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
offset
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
)
)
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/pick/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/community/pick/get'
](
offset
=
offset
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
data
...
...
api/push.py
View file @
1f233f9b
...
...
@@ -8,8 +8,8 @@ from utils.base import APIView
class
PushListView
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
)
)
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/push/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
...
...
api/star.py
View file @
1f233f9b
...
...
@@ -8,8 +8,8 @@ from utils.base import APIView
class
StarListView
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
)
)
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/star/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
...
...
api/tag.py
View file @
1f233f9b
...
...
@@ -8,15 +8,44 @@ from utils.base import APIView
class
TagListView
(
APIView
):
def
get
(
self
,
request
):
pass
offset
=
int
(
request
.
GET
.
get
(
'offset'
,
1
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/tag/get'
](
offset
=
offset
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
data
def
post
(
self
,
request
):
pass
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
filters
=
{}
if
type
==
'offline'
:
filters
[
'is_online'
]
=
False
else
:
filters
[
'is_online'
]
=
True
try
:
self
.
rpc
[
'venus/community/tag/batch/update'
](
filters
=
filters
,
tag_ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
"message"
:
"更新成功"
}
class
TagUpdateOrCreateView
(
APIView
):
def
get
(
self
,
request
):
pass
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/community/tag/get'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
raise
e
if
not
data
:
data
=
{}
else
:
data
=
data
[
'data'
][
0
]
return
{
'data'
:
data
}
def
post
(
self
,
request
):
data
=
{
...
...
api/topic.py
View file @
1f233f9b
...
...
@@ -8,8 +8,8 @@ from utils.base import APIView
class
TopicListView
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
)
)
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/topic/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
...
...
api/user.py
View file @
1f233f9b
...
...
@@ -8,8 +8,8 @@ from utils.base import APIView
class
UserListView
(
APIView
):
def
get
(
self
,
request
):
page
=
request
.
GET
.
get
(
'page'
,
1
)
limit
=
request
.
GET
.
get
(
'limit'
,
10
)
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
)
)
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
()
...
...
vu/src/views/tag/components/TagDetail.vue
View file @
1f233f9b
...
...
@@ -39,6 +39,24 @@
</div>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<div
class=
"postInfo-container"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"标签ID:"
prop=
"position"
>
<el-input
:rows=
"1"
v-model=
"postForm.id"
type=
"number"
class=
"article-textarea"
style=
"width: 300px"
readonly
v-if=
"isEdit"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
style=
"margin-bottom: 20px;"
label-width=
"75px"
label=
"创建时间:"
prop=
"position"
>
<el-input
:rows=
"1"
v-model=
"postForm.create_time"
type=
"text"
class=
"article-textarea"
style=
"width: 300px"
readonly
v-if=
"isEdit"
/>
</el-form-item>
</el-col>
</el-row>
</div>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"75px"
label=
"上级标签:"
class=
"postInfo-container-item"
>
...
...
@@ -174,21 +192,21 @@
},
methods
:
{
fetchData
(
id
)
{
fetch
Pick
Detail
(
id
).
then
(
response
=>
{
fetch
Tag
Detail
(
id
).
then
(
response
=>
{
// select 回填数据处理,后期再进行优化
let
rep
=
response
.
data
.
data
.
data
;
let
pick
_temp
=
[]
let
regio
n_temp
=
[]
for
(
let
i
=
0
;
i
<
rep
.
pick_group
.
length
;
i
++
){
pick_temp
.
push
(
rep
.
pick_group
[
i
][
'name'
]);
this
.
temparray
[
'
pick_group'
].
push
(
rep
.
pick_group
[
i
])
let
up
_temp
=
[]
let
dow
n_temp
=
[]
for
(
let
i
=
0
;
i
<
rep
.
up_tag
.
length
;
i
++
){
up_temp
.
push
(
rep
.
up_tag
[
i
][
'name'
]);
this
.
temparray
[
'
up_tag'
].
push
(
rep
.
up_tag
[
i
])
}
for
(
let
i
=
0
;
i
<
rep
.
region
.
length
;
i
++
){
region_temp
.
push
(
rep
.
region
[
i
][
'name'
]);
this
.
temparray
[
'
region'
].
push
(
rep
.
region
[
i
])
for
(
let
i
=
0
;
i
<
rep
.
down_tag
.
length
;
i
++
){
down_temp
.
push
(
rep
.
down_tag
[
i
][
'name'
]);
this
.
temparray
[
'
down_tag'
].
push
(
rep
.
down_tag
[
i
])
}
rep
.
region
=
regio
n_temp
rep
.
pick_group
=
pick
_temp
rep
.
down_tag
=
dow
n_temp
rep
.
up_tag
=
up
_temp
this
.
postForm
=
rep
}).
catch
(
err
=>
{
console
.
log
(
err
)
...
...
vu/src/views/tag/list.vue
View file @
1f233f9b
<
template
>
<div
class=
"app-container"
>
<div
class=
"filter-container"
>
<el-input
:placeholder=
"'搜素'"
v-model=
"listQuery.filter.value"
style=
"width:
20
0px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"handleFilter"
/>
<el-input
:placeholder=
"'搜素'"
v-model=
"listQuery.filter.value"
style=
"width:
15
0px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"handleFilter"
/>
<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.level"
:placeholder=
"'标签等级'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
<el-option
v-for=
"item in TagLevelTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
<el-select
v-model=
"listQuery.filter.type"
:placeholder=
"'标签类型'"
clearable
class=
"filter-item"
style=
"width: 110px"
>
<el-option
v-for=
"item in TagtypeTypeOptions"
: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: 100px"
>
<el-option
v-for=
"item in BooleanTypeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
...
...
@@ -15,57 +21,33 @@
</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
align=
"center"
label=
"
pickID"
width=
"80
"
>
<el-table-column
align=
"center"
label=
"
标签ID"
width=
"148
"
>
<template
slot-scope=
"scope"
>
<router-link
:to=
"'/
pick
/edit/'+scope.row.id"
class=
"link-type"
>
<router-link
:to=
"'/
tag
/edit/'+scope.row.id"
class=
"link-type"
>
<span>
{{
scope
.
row
.
id
}}
</span>
</router-link>
</
template
>
</el-table-column>
<el-table-column
width=
"
180px"
align=
"center"
label=
"pick
名称"
>
<el-table-column
width=
"
280px"
align=
"center"
label=
"标签
名称"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"280px"
align=
"center"
label=
"pick简介"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
desc
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"120px"
align=
"center"
label=
"pick用户"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
user_nums
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"120px"
align=
"center"
label=
"pick小组数"
>
<el-table-column
width=
"280px"
align=
"center"
label=
"标签类型"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
pick_group_nums
}}
</span>
<span>
{{
scope
.
row
.
type
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"
120px"
align=
"center"
label=
"pick属性
"
>
<el-table-column
width=
"
220px"
align=
"center"
label=
"标签等级
"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
pick_type
}}
</span>
<span>
{{
scope
.
row
.
level
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"120px"
align=
"center"
label=
"性别"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.gender | genderFilter"
>
{{
scope
.
row
.
gender
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
width=
"130px"
align=
"center"
label=
"地区"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
region
}}
</span>
</
template
>
</el-table-column>
<el-table-column
width=
"120px"
align=
"center"
label=
"下线"
>
<el-table-column
width=
"220px"
align=
"center"
label=
"下线"
>
<
template
slot-scope=
"scope"
>
<el-tag
:type=
"scope.row.is_online | isOnlineFilter"
>
{{
scope
.
row
.
is_online
==
1
?
'是'
:
'否'
}}
</el-tag>
</
template
>
...
...
@@ -73,13 +55,13 @@
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"listQuery.
page
"
:limit
.
sync=
"listQuery.limit"
style=
"margin-left: 150px;"
@
pagination=
"getList"
/>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"listQuery.
offset
"
:limit
.
sync=
"listQuery.limit"
style=
"margin-left: 150px;"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
fetchList
,
OffLineOrOnLine
}
from
'@/api/
pick
'
import
{
fetchList
,
OffLineOrOnLine
}
from
'@/api/
tag
'
import
Pagination
from
'@/components/Pagination'
// Secondary package based on el-pagination
import
waves
from
'@/directive/waves'
...
...
@@ -112,21 +94,34 @@ export default {
multipleSelection
:
[],
del_list
:
[],
listQuery
:
{
page
:
1
,
offset
:
1
,
limit
:
10
,
filter
:
{
value
:
''
,
key
:
''
,
is_online
:
''
is_online
:
''
,
name
:
''
,
type
:
''
,
},
},
BooleanTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'是'
},
{
'key'
:
0
,
'display_name'
:
'否'
}
],
TagLevelTypeOptions
:
[
{
'key'
:
1
,
'display_name'
:
'一级'
},
{
'key'
:
2
,
'display_name'
:
'二级'
},
{
'key'
:
3
,
'display_name'
:
'三级'
},
{
'key'
:
4
,
'display_name'
:
'四级'
},
{
'key'
:
5
,
'display_name'
:
'五级'
},
],
TagtypeTypeOptions
:
[
{
'key'
:
0
,
'display_name'
:
'用户标签'
},
{
'key'
:
1
,
'display_name'
:
'帖子标签'
}
],
SearchTypeOptions
:[
{
'key'
:
'id'
,
'display_name'
:
'ID'
},
{
'key'
:
'name'
,
'display_name'
:
'
pick
名称'
},
{
'key'
:
'name'
,
'display_name'
:
'
标签
名称'
},
]
}
},
...
...
@@ -150,7 +145,7 @@ export default {
this
.
getList
()
},
handleCurrentChange
(
val
)
{
this
.
listQuery
.
page
=
val
this
.
listQuery
.
offset
=
val
this
.
getList
()
},
handleOfflineOrOnline
(
val
){
...
...
@@ -172,11 +167,11 @@ export default {
})
},
handleFilter
()
{
this
.
listQuery
.
page
=
1
this
.
listQuery
.
offset
=
1
this
.
getList
()
},
handleCreate
()
{
this
.
$router
.
push
(
'/
pick
/create'
)
this
.
$router
.
push
(
'/
tag
/create'
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment