flyzto před 2 týdny
rodič
revize
5585ed05e9

+ 15 - 1
web/apps/web-antd/src/views/match/data-sync/index.vue

@@ -193,6 +193,20 @@ const sortGroupEntries = (entries: Array<[string, SyncClient[]]>) => {
   });
 };
 
+const sortClientsByGroupSequence = (items: SyncClient[]) => {
+  return [...items].sort((a, b) => {
+    const sequenceA = getGroupKey(a.groupSequence);
+    const sequenceB = getGroupKey(b.groupSequence);
+    if (sequenceA === '__empty__') {
+      return 1;
+    }
+    if (sequenceB === '__empty__') {
+      return -1;
+    }
+    return sequenceA.localeCompare(sequenceB, 'zh-CN', { numeric: true });
+  });
+};
+
 const groupedClients = computed<SyncClientRow[]>(() => {
   const marketGroups = groupByField(clients.value, 'marketType');
 
@@ -206,7 +220,7 @@ const groupedClients = computed<SyncClientRow[]>(() => {
           `market:${marketType}:data:${dataType}:platform:${platform}`,
           getGroupTitle('platform', platform === '__empty__' ? undefined : platform),
           platformItems,
-          platformItems.map(createClientRow),
+          sortClientsByGroupSequence(platformItems).map(createClientRow),
         );
       });