diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 994ae958..2fcddd20 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -257,10 +257,11 @@ const wrapValues = (settings, currentState) => { export const formSearchObject = description => { return description.reduce((acc, setting) => { + const searchArray = _.compact([setting.key, setting.label, setting.description]).map(el => el.toLowerCase()) if (setting.children) { - const updatedAcc = { ...acc, [setting.key]: _.compact([setting.key, setting.label, setting.description]) } + const updatedAcc = { ...acc, [setting.key]: searchArray } return { ...updatedAcc, ...formSearchObject(setting.children) } } - return { ...acc, [setting.key]: _.compact([setting.key, setting.label, setting.description]) } + return { ...acc, [setting.key]: searchArray } }, {}) } diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index 2f88a682..dd8349d2 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -29,7 +29,8 @@ :trigger-on-focus="false" placeholder="Search" prefix-icon="el-icon-search" - class="settings-search-input"/> + class="settings-search-input" + @select="handleSearchSelect"/> @@ -279,10 +280,12 @@ export default { message: i18n.t('settings.restartSuccess') }) }, + handleSearchSelect() { + }, querySearch(queryString, cb) { const results = Object.keys(this.searchData) - .filter(key => this.searchData[key].find(a => a.includes(queryString))) - .map(el => { return { value: el } }) + .filter(key => this.searchData[key].find(el => el.includes(queryString.toLowerCase()))) + .map(key => { return { value: this.searchData[key][1] } }) cb(results) } }