diff --git a/package.json b/package.json index f8db171e..a2fbd5ae 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,6 @@ "naive-ui": "2.39.0", "nprogress": "0.2.0", "pinia": "2.2.0", - "pinyin-pro": "3.23.1", "print-js": "1.6.0", "swiper": "11.1.5", "tailwind-merge": "2.4.0", @@ -103,6 +102,7 @@ "eslint": "9.8.0", "eslint-plugin-vue": "9.27.0", "lint-staged": "15.2.7", + "pinyin-pro": "3.23.1", "sass": "1.77.8", "simple-git-hooks": "2.11.1", "tsx": "4.16.3", diff --git a/src/layouts/modules/global-search/components/search-history.vue b/src/layouts/modules/global-search/components/search-history.vue new file mode 100644 index 00000000..78f7b252 --- /dev/null +++ b/src/layouts/modules/global-search/components/search-history.vue @@ -0,0 +1,143 @@ + + + + + + + {{ $t('common.search_history') }} + + + + + {{ (item.i18nKey && $t(item.i18nKey)) || item.label }} + + + + + + + + + + + + {{ $t('common.collection_record') }} + + + + + + {{ (item.i18nKey && $t(item.i18nKey)) || item.label }} + + + + + + + + + + + + diff --git a/src/layouts/modules/global-search/components/search-modal.vue b/src/layouts/modules/global-search/components/search-modal.vue index 39f18a84..c639ed05 100644 --- a/src/layouts/modules/global-search/components/search-modal.vue +++ b/src/layouts/modules/global-search/components/search-modal.vue @@ -1,5 +1,6 @@ @@ -102,7 +215,7 @@ registerShortcut(); @after-leave="handleClose" > - + @@ -111,8 +224,9 @@ registerShortcut(); - - + + + diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 9ba2d5a3..6409e5b9 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -47,7 +47,9 @@ const local: App.I18n.Schema = { yesOrNo: { yes: 'Yes', no: 'No' - } + }, + search_history: 'Search History', + collection_record: 'Collection Record' }, request: { logout: 'Logout user after request failed', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 8c2cdffd..58d4cdf6 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -47,7 +47,9 @@ const local: App.I18n.Schema = { yesOrNo: { yes: '是', no: '否' - } + }, + search_history: '搜索历史', + collection_record: '收藏记录' }, request: { logout: '请求失败后登出用户', diff --git a/src/plugins/iconify.ts b/src/plugins/iconify.ts index f58d669b..5c80cd6c 100644 --- a/src/plugins/iconify.ts +++ b/src/plugins/iconify.ts @@ -1,9 +1,18 @@ -import { addAPIProvider, disableCache } from '@iconify/vue'; +import { addAPIProvider, disableCache , addCollection } from '@iconify/vue'; /** Setup the iconify offline */ export function setupIconifyOffline() { const { VITE_ICONIFY_URL } = import.meta.env; - + addCollection({ + prefix: 'soybean', + icons:{ + star:{ + body: '', + width: 20, + height: 20 + } + } + }) if (VITE_ICONIFY_URL) { addAPIProvider('', { resources: [VITE_ICONIFY_URL] }); diff --git a/src/theme/settings.ts b/src/theme/settings.ts index a82fe636..d6d157f0 100644 --- a/src/theme/settings.ts +++ b/src/theme/settings.ts @@ -74,7 +74,8 @@ export const themeSettings: App.Theme.ThemeSetting = { 'base-text': 'rgb(224, 224, 224)' } } - } + }, + menuSearchHistoryMaxValue: 6 }; /** diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index f3a807f6..38a84e4e 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -109,6 +109,8 @@ declare namespace App { [K in keyof ThemeSettingToken]?: Partial; }; }; + /** menu history max value */ + menuSearchHistoryMaxValue: number } interface OtherColor { @@ -200,6 +202,11 @@ declare namespace App { children?: Menu[]; }; + /** The global search history or collect */ + type SearchHistoryOrCollect = Menu & { + type: 'history' | 'collect'; + }; + type Breadcrumb = Omit & { options?: Breadcrumb[]; }; @@ -329,6 +336,8 @@ declare namespace App { yes: string; no: string; }; + search_history: string; + collection_record: string; }; request: { logout: string; diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 09f7cdd1..fae8bcd8 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -29,6 +29,7 @@ declare module 'vue' { IconIcRoundRefresh: typeof import('~icons/ic/round-refresh')['default'] IconIcRoundRemove: typeof import('~icons/ic/round-remove')['default'] IconIcRoundSearch: typeof import('~icons/ic/round-search')['default'] + IconIonClose: typeof import('~icons/ion/close')['default'] IconLocalActivity: typeof import('~icons/local/activity')['default'] IconLocalBanner: typeof import('~icons/local/banner')['default'] IconLocalCast: typeof import('~icons/local/cast')['default'] diff --git a/src/typings/storage.d.ts b/src/typings/storage.d.ts index 0d52f33c..889e7312 100644 --- a/src/typings/storage.d.ts +++ b/src/typings/storage.d.ts @@ -35,5 +35,9 @@ declare namespace StorageType { layout: UnionKey.ThemeLayoutMode; siderCollapse: boolean; }; + /** The search history */ + searchHistory: App.Global.SearchHistoryOrCollect[] + /** The search collect */ + searchCollect: App.Global.SearchHistoryOrCollect[] } }