@@ -16,6 +16,7 @@ const ConfigSection = defineComponent({
1616 section : { type : Object as PropType < Section > , required : true } ,
1717 entryStates : { type : Object as PropType < Record < string , IEntryState > > , required : true } ,
1818 sectionState : { type : Object as PropType < ISectionState > , required : true } ,
19+ isCommunity : Boolean ,
1920 } ,
2021 setup ( props , { emit } ) {
2122 const { t, te } = useI18n ( ) ;
@@ -41,6 +42,13 @@ const ConfigSection = defineComponent({
4142 < NFlex class = "h-34px" align = "center" >
4243 < NSwitch v-model :value = { props . sectionState . enabled } />
4344 { comments . shouldEnableOptions [ props . section . path ! ] && ! props . sectionState . enabled && < ProblemsDisplay problems = { [ t ( 'mod.needEnableOption' ) ] } /> }
45+ { props . isCommunity && < NPopover trigger = "hover" > { {
46+ trigger : ( ) => < div class = "i-ic-baseline-info text-lg c-neutral-5" /> ,
47+ default : ( ) => < div >
48+ < div class = "text-lg mb-2" > { t ( 'mod.community.title' ) } </ div >
49+ < div class = "text-sm whitespace-pre-line lh-1.7em" > { t ( 'mod.community.description' ) } </ div >
50+ </ div >
51+ } } </ NPopover > }
4452 </ NFlex >
4553 { comment . value }
4654 </ NFlex >
@@ -66,6 +74,7 @@ export default defineComponent({
6674 const search = ref ( '' ) ;
6775 const searchRef = ref ( ) ;
6876 const configSort = computed ( ( ) => props . config ?. configSort || configSortStub )
77+ const communityList = computed ( ( ) => configSort . value [ '社区功能' ] || [ ] ) ;
6978 const { t } = useI18n ( ) ;
7079
7180 const { ctrl_f } = useMagicKeys ( {
@@ -93,7 +102,7 @@ export default defineComponent({
93102
94103 const bigSections = computed ( ( ) => {
95104 if ( props . useNewSort ) {
96- return Object . keys ( configSort . value ) . filter ( it => filteredSections . value ! . some ( s => configSort . value [ it ] . includes ( s . path ! ) ) ) ;
105+ return Object . keys ( configSort . value ) . filter ( it => it !== '社区功能' ) . filter ( it => filteredSections . value ! . some ( s => configSort . value [ it ] . includes ( s . path ! ) ) ) ;
97106 }
98107 return _ . uniq ( filteredSections . value ! . filter ( it => ! it . attribute ?. exampleHidden ) . map ( s => s . path ?. split ( '.' ) [ 0 ] ) ) ;
99108 } ) ;
@@ -141,15 +150,17 @@ export default defineComponent({
141150 } ) . map ( ( section ) => {
142151 return < ConfigSection key = { section . path ! } section = { section }
143152 entryStates = { props . config . entryStates ! }
153+ isCommunity = { communityList . value . includes ( section . path ! ) }
144154 sectionState = { props . config . sectionStates ! [ section . path ! ] } /> ;
145155 } ) }
146156 </ div > ) }
147157 { otherSection . value . length > 0 &&
148158 < div id = { t ( 'mod.other' ) } >
149159 < NDivider titlePlacement = "left" class = "mt-2!" > { t ( 'mod.other' ) } </ NDivider >
150160 { otherSection . value . map ( ( section ) =>
151- < ConfigSection key = { t ( 'mod.other' ) } section = { section }
161+ < ConfigSection key = { section . path ! } section = { section }
152162 entryStates = { props . config . entryStates ! }
163+ isCommunity = { communityList . value . includes ( section . path ! ) }
153164 sectionState = { props . config . sectionStates ! [ section . path ! ] } /> ) }
154165 </ div > }
155166 </ NScrollbar >
0 commit comments