字典排序
This commit is contained in:
parent
223182d61b
commit
6a112b32c2
|
@ -70,6 +70,9 @@
|
|||
<el-table-column label="代号/编号">
|
||||
<template slot-scope="scope">{{ scope.row.code }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述">
|
||||
<template slot-scope="scope">{{ scope.row.desc }}</template>
|
||||
</el-table-column>
|
||||
|
|
|
@ -141,8 +141,8 @@ class DictViewSet(ModelViewSet):
|
|||
serializer_class = DictSerializer
|
||||
search_fields = ['name', 'code']
|
||||
filterset_fields = ['type__code', 'type', 'is_used']
|
||||
ordering_fields = ['id']
|
||||
ordering = 'id'
|
||||
ordering_fields = ['sort']
|
||||
ordering = 'sort'
|
||||
def paginate_queryset(self, queryset):
|
||||
"""
|
||||
如果查询参数里没有page但有type或type__code时则不分页,否则请求分页
|
||||
|
|
Loading…
Reference in New Issue