diff --git a/html/src/app.js b/html/src/app.js index 43c01795..6c9474c2 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9877,7 +9877,7 @@ speechSynthesis.getVoices(); $app.data.friendsListSearch = ''; $app.data.friendsListSearchFilterVIP = false; - $app.data.friendsListSearchFilters = [ 'User Name', 'Display Name', 'Status', 'Bio', 'Memo' ]; + $app.data.friendsListSearchFilters = [ 'Display Name', 'User Name', 'Rank', 'Status', 'Bio', 'Memo' ]; $app.methods.friendsListSearchChange = function () { var filters = this.friendsListSearchFilters; @@ -9921,6 +9921,11 @@ speechSynthesis.getVoices(); ctx.ref.statusDescription) { match = String(ctx.ref.statusDescription).toUpperCase().includes(query); } + if (!match && + filters.includes('Rank') && + ctx.ref.$friendNum) { + match = String(ctx.ref.$trustLevel).toUpperCase().includes(query); + } if (!match) { continue; } @@ -9994,6 +9999,20 @@ speechSynthesis.getVoices(); return a[field].toLowerCase().localeCompare(b[field].toLowerCase()); }; + $app.methods.sortLanguages = function (a, b) { + var sortedA = []; + var sortedB = []; + a.$languages.forEach((item) => { + sortedA.push(item.value); + }); + b.$languages.forEach((item) => { + sortedB.push(item.value); + }); + sortedA.sort(); + sortedB.sort(); + return JSON.stringify(sortedA).localeCompare(JSON.stringify(sortedB)); + }; + $app.methods.genMd5 = async function (file) { var response = await AppApi.MD5File(file); return response; diff --git a/html/src/index.pug b/html/src/index.pug index ab6c77d7..b44bd14f 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -608,7 +608,7 @@ html el-switch(v-model="friendsListSearchFilterVIP" @change="friendsListSearchChange" active-color="#13ce66") el-input(v-model="friendsListSearch" placeholder="Search" @change="friendsListSearchChange" clearable style="flex:1") el-select(v-model="friendsListSearchFilters" multiple clearable collapse-tags style="flex:none;width:200px;margin:0 10px" @change="friendsListSearchChange" placeholder="Filter") - el-option(v-once v-for="type in ['User Name', 'Display Name', 'Status', 'Bio', 'Memo']" :key="type" :label="type" :value="type") + el-option(v-once v-for="type in ['Display Name', 'User Name', 'Rank', 'Status', 'Bio', 'Memo']" :key="type" :label="type" :value="type") el-tooltip(placement="top") template(#content) span Refresh @@ -633,7 +633,7 @@ html template(v-once #default="scope") span.name(v-text="scope.row.$trustLevel" :class="scope.row.$trustClass") el-table-column(label="Status" min-width="180" prop="statusDescription" sortable :sort-method="(a, b) => sortAlphabetically(a, b, 'statusDescription')") - el-table-column(label="Language" width="100" prop="$languages") + el-table-column(label="Language" width="100" prop="$languages" sortable :sort-method="(a, b) => sortLanguages(a, b)") template(v-once #default="scope") el-tooltip(v-for="item in scope.row.$languages" :key="item.key" placement="top") template(#content)