浏览代码

feat & fix: fix the pricing available sort, set defaultSortOrder descend

IllTamer 1 年之前
父节点
当前提交
3223c7e181
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      web/src/components/ModelPricing.js

+ 6 - 1
web/src/components/ModelPricing.js

@@ -109,7 +109,12 @@ const ModelPricing = () => {
          // if record.enable_groups contains selectedGroup, then available is true
         return renderAvailable(record.enable_groups.includes(selectedGroup));
       },
-      sorter: (a, b) => a.available - b.available,
+      sorter: (a, b) => {
+        const aAvailable = a.enable_groups.includes(selectedGroup);
+        const bAvailable = b.enable_groups.includes(selectedGroup);
+        return Number(aAvailable) - Number(bAvailable);
+      },
+      defaultSortOrder: 'descend',
     },
     {
       title: t('模型名称'),