From 6a112b32c234cdf3cb4ff79324c98da638313a76 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 31 Mar 2021 10:49:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/system/dict.vue | 3 +++ server/apps/system/views.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/views/system/dict.vue b/client/src/views/system/dict.vue index 54ba93e..8baeb20 100644 --- a/client/src/views/system/dict.vue +++ b/client/src/views/system/dict.vue @@ -70,6 +70,9 @@ + + + diff --git a/server/apps/system/views.py b/server/apps/system/views.py index 380255a..7539b91 100644 --- a/server/apps/system/views.py +++ b/server/apps/system/views.py @@ -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时则不分页,否则请求分页