|
108 | 108 | model_types: [], |
109 | 109 | base_models: [], |
110 | 110 | keyword: '', |
111 | | - sort: 'Recently', |
| 111 | + sort: props.page === 'quickStart' ? 'Auto' : 'Recently', |
112 | 112 | is_user_cleared: false |
113 | 113 | } |
114 | 114 | } |
| 115 | + store[props.page].filterState.sort = props.page === 'quickStart' ? 'Auto' : 'Recently' |
| 116 | + // 如果状态已存在,但 quickStart 页仍是默认的 'Recently',将其调整为 'Auto'(不覆盖用户后续选择) |
| 117 | + // if ( |
| 118 | + // props.page === 'quickStart' && |
| 119 | + // store[props.page].filterState && |
| 120 | + // store[props.page].filterState.sort === 'Recently' |
| 121 | + // ) { |
| 122 | + // store[props.page].filterState.sort = 'Auto' |
| 123 | + // } |
115 | 124 | if (props.page === 'mainContent') { |
116 | 125 | if (store[props.page].filterState.selected_model_types.length === 0) { |
117 | 126 | store[props.page].filterState.model_types = store.modelTypes |
|
137 | 146 |
|
138 | 147 | const getSortLabel = (sort: SortValue) => { |
139 | 148 | switch (sort) { |
| 149 | + case 'Auto': |
| 150 | + return t('community.filter.sort.options.auto') |
140 | 151 | case 'Recently': |
141 | 152 | return t('community.filter.sort.options.recently') |
142 | 153 | case 'Most Forked': |
|
234 | 245 | <Command> |
235 | 246 | <CommandList> |
236 | 247 | <CommandGroup> |
| 248 | + <CommandItem |
| 249 | + v-if="props.page === 'quickStart'" |
| 250 | + value="Auto" |
| 251 | + :class="[ |
| 252 | + 'px-2 py-1.5 text-[#F9FAFB] cursor-pointer', |
| 253 | + '[&:hover]:!bg-[#8B5CF6] [&:hover]:!text-[#F9FAFB]', |
| 254 | + store[props.page].filterState.sort === 'Auto' |
| 255 | + ? '!bg-[#6D28D9] !text-[#F9FAFB]' |
| 256 | + : '' |
| 257 | + ]" |
| 258 | + @click="handleSortChange('Auto')" |
| 259 | + > |
| 260 | + {{ t('community.filter.sort.options.auto') }} |
| 261 | + </CommandItem> |
237 | 262 | <CommandItem |
238 | 263 | value="recently" |
239 | 264 | :class="[ |
|
399 | 424 | ? 'bg-[#6D28D9] hover:!bg-[#8B5CF6]' |
400 | 425 | : 'bg-[#4E4E4E] hover:!bg-[#5D5D5D]' |
401 | 426 | ]" |
402 | | - @click="handleHasDraftChange(true)" |
403 | 427 | variant="secondary" |
| 428 | + @click="handleHasDraftChange(true)" |
404 | 429 | > |
405 | 430 | {{ t('community.modelCard.tooltips.verified') }} |
406 | 431 | </Badge> |
|
411 | 436 | ? 'bg-[#6D28D9] hover:!bg-[#8B5CF6]' |
412 | 437 | : 'bg-[#4E4E4E] hover:!bg-[#5D5D5D]' |
413 | 438 | ]" |
414 | | - @click="handleHasDraftChange(false)" |
415 | 439 | variant="secondary" |
| 440 | + @click="handleHasDraftChange(false)" |
416 | 441 | > |
417 | 442 | {{ t('community.modelCard.tooltips.unverified') }} |
418 | 443 | </Badge> |
|
0 commit comments