Skip to content

Commit 99515c5

Browse files
authored
添加摩尔线程标识 (#118)
* fix * fix * fix * auto prettier format code --------- Co-authored-by: linjm8780860 <11494038+linjm8780860@users.noreply.github.com>
1 parent fe048b4 commit 99515c5

7 files changed

Lines changed: 99 additions & 12 deletions

File tree

src/components/community/modules/BaseModelGrid.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,15 @@
302302
}
303303
304304
:deep(.n-scrollbar-rail) {
305-
position: fixed;
305+
/* position: fixed; */
306306
}
307307
308308
:deep(.n-scrollbar > .n-scrollbar-rail.n-scrollbar-rail--vertical--right),
309309
:deep(.n-scrollbar + .n-scrollbar-rail.n-scrollbar-rail--vertical--right) {
310-
right: 20px !important;
311-
top: 120px !important;
312-
bottom: 60px !important;
310+
right: 0px !important;
311+
top: 0px !important;
312+
bottom: 0px !important;
313+
z-index: 1000;
313314
}
314315
315316
/* :deep(.v-vl:not(.v-vl--show-scrollbar)) {

src/components/community/modules/ModelCard.vue

Lines changed: 60 additions & 1 deletion
Large diffs are not rendered by default.

src/components/community/modules/ModelFilterBar.vue

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,19 @@
108108
model_types: [],
109109
base_models: [],
110110
keyword: '',
111-
sort: 'Recently',
111+
sort: props.page === 'quickStart' ? 'Auto' : 'Recently',
112112
is_user_cleared: false
113113
}
114114
}
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+
// }
115124
if (props.page === 'mainContent') {
116125
if (store[props.page].filterState.selected_model_types.length === 0) {
117126
store[props.page].filterState.model_types = store.modelTypes
@@ -137,6 +146,8 @@
137146
138147
const getSortLabel = (sort: SortValue) => {
139148
switch (sort) {
149+
case 'Auto':
150+
return t('community.filter.sort.options.auto')
140151
case 'Recently':
141152
return t('community.filter.sort.options.recently')
142153
case 'Most Forked':
@@ -234,6 +245,20 @@
234245
<Command>
235246
<CommandList>
236247
<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>
237262
<CommandItem
238263
value="recently"
239264
:class="[
@@ -399,8 +424,8 @@
399424
? 'bg-[#6D28D9] hover:!bg-[#8B5CF6]'
400425
: 'bg-[#4E4E4E] hover:!bg-[#5D5D5D]'
401426
]"
402-
@click="handleHasDraftChange(true)"
403427
variant="secondary"
428+
@click="handleHasDraftChange(true)"
404429
>
405430
{{ t('community.modelCard.tooltips.verified') }}
406431
</Badge>
@@ -411,8 +436,8 @@
411436
? 'bg-[#6D28D9] hover:!bg-[#8B5CF6]'
412437
: 'bg-[#4E4E4E] hover:!bg-[#5D5D5D]'
413438
]"
414-
@click="handleHasDraftChange(false)"
415439
variant="secondary"
440+
@click="handleHasDraftChange(false)"
416441
>
417442
{{ t('community.modelCard.tooltips.unverified') }}
418443
</Badge>

src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
"downloads": "Downloads",
166166
"most-used": "Most Used",
167167
"most-liked": "Most Liked",
168-
"most-forked": "Most Forked"
168+
"most-forked": "Most Forked",
169+
"auto": "Recommended"
169170
}
170171
},
171172
"type": {

src/locales/zh.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
"downloads": "最多下载",
166166
"most-used": "最多使用",
167167
"most-liked": "最多点赞",
168-
"most-forked": "最多收藏"
168+
"most-forked": "最多收藏",
169+
"auto": "推荐"
169170
}
170171
},
171172
"type": {

src/types/model.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type ModeType = 'my' | 'my_fork' | 'publicity' | 'official'
99

1010
export type ModeTabType = 'community' | 'posts' | 'forked'
1111

12-
export type SortValue = 'Recently' | 'Most Forked' | 'Most Used' | 'Most Downloaded' | 'Most Liked'
12+
export type SortValue = 'Recently' | 'Most Forked' | 'Most Used' | 'Most Downloaded' | 'Most Liked' | 'Auto'
1313

1414
export interface Model {
1515
id: string

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.49
1+
1.2.50

0 commit comments

Comments
 (0)