feat(projects): globalSearch add i18n
This commit is contained in:
parent
04aa10b477
commit
0126da4778
@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { $t } from '@/locales';
|
||||
|
||||
defineOptions({ name: 'SearchFooter' });
|
||||
</script>
|
||||
|
||||
@ -6,16 +8,16 @@ defineOptions({ name: 'SearchFooter' });
|
||||
<div class="h-44px flex-y-center px-24px">
|
||||
<span class="mr-14px flex-y-center">
|
||||
<icon-mdi-keyboard-return class="icon mr-6px p-2px text-20px" />
|
||||
<span>确认</span>
|
||||
<span>{{ $t('common.confirm') }}</span>
|
||||
</span>
|
||||
<span class="mr-14px flex-y-center">
|
||||
<icon-mdi-arrow-up-thin class="icon mr-5px p-2px text-20px" />
|
||||
<icon-mdi-arrow-down-thin class="icon mr-6px p-2px text-20px" />
|
||||
<span>切换</span>
|
||||
<span>{{ $t('common.switch') }}</span>
|
||||
</span>
|
||||
<span class="flex-y-center">
|
||||
<icon-mdi-keyboard-esc class="icon mr-6px p-2px text-20px" />
|
||||
<span>关闭</span>
|
||||
<span>{{ $t('common.close') }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -94,16 +94,16 @@ onKeyStroke('ArrowDown', handleDown);
|
||||
@after-leave="handleClose"
|
||||
>
|
||||
<NInputGroup>
|
||||
<NInput v-model:value="keyword" clearable placeholder="请输入关键词搜索" @input="handleSearch">
|
||||
<NInput v-model:value="keyword" clearable :placeholder="$t('common.keywordSearch')" @input="handleSearch">
|
||||
<template #prefix>
|
||||
<icon-uil-search class="text-15px text-#c2c2c2" />
|
||||
</template>
|
||||
</NInput>
|
||||
<NButton v-if="isMobile" type="primary" ghost @click="handleClose">取消</NButton>
|
||||
<NButton v-if="isMobile" type="primary" ghost @click="handleClose">{{ $t('common.cancel') }}</NButton>
|
||||
</NInputGroup>
|
||||
|
||||
<div class="mt-20px">
|
||||
<NEmpty v-if="resultOptions.length === 0" description="暂无搜索结果" />
|
||||
<NEmpty v-if="resultOptions.length === 0" :description="$t('common.noData')" />
|
||||
<SearchResult v-else v-model:path="activePath" :options="resultOptions" @enter="handleEnter" />
|
||||
</div>
|
||||
<template #footer>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { useBoolean } from '@sa/hooks';
|
||||
import { $t } from '@/locales';
|
||||
import SearchModal from './components/search-modal.vue';
|
||||
|
||||
defineOptions({ name: 'GlobalSearch' });
|
||||
@ -11,7 +12,7 @@ function handleSearch() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ButtonIcon tooltip-content="搜索" @click="handleSearch">
|
||||
<ButtonIcon :tooltip-content="$t('common.search')" @click="handleSearch">
|
||||
<icon-uil-search class="text-20px" />
|
||||
</ButtonIcon>
|
||||
<SearchModal v-model:show="show" />
|
||||
|
@ -9,6 +9,7 @@ const local: App.I18n.Schema = {
|
||||
backToHome: 'Back to home',
|
||||
batchDelete: 'Batch Delete',
|
||||
cancel: 'Cancel',
|
||||
close: 'Close',
|
||||
check: 'Check',
|
||||
columnSetting: 'Column Setting',
|
||||
confirm: 'Confirm',
|
||||
@ -17,16 +18,19 @@ const local: App.I18n.Schema = {
|
||||
confirmDelete: 'Are you sure you want to delete?',
|
||||
edit: 'Edit',
|
||||
index: 'Index',
|
||||
keywordSearch: 'Please enter keyword',
|
||||
logout: 'Logout',
|
||||
logoutConfirm: 'Are you sure you want to log out?',
|
||||
lookForward: 'Coming soon',
|
||||
modify: 'Modify',
|
||||
modifySuccess: 'Modify Success',
|
||||
noData: 'No Data',
|
||||
operate: 'Operate',
|
||||
pleaseCheckValue: 'Please check whether the value is valid',
|
||||
refresh: 'Refresh',
|
||||
reset: 'Reset',
|
||||
search: 'Search',
|
||||
switch: 'Switch',
|
||||
tip: 'Tip',
|
||||
update: 'Update',
|
||||
updateSuccess: 'Update Success',
|
||||
|
@ -9,6 +9,7 @@ const local: App.I18n.Schema = {
|
||||
backToHome: '返回首页',
|
||||
batchDelete: '批量删除',
|
||||
cancel: '取消',
|
||||
close: '关闭',
|
||||
check: '勾选',
|
||||
columnSetting: '列设置',
|
||||
confirm: '确认',
|
||||
@ -17,16 +18,19 @@ const local: App.I18n.Schema = {
|
||||
confirmDelete: '确认删除吗?',
|
||||
edit: '编辑',
|
||||
index: '序号',
|
||||
keywordSearch: '请输入关键词搜索',
|
||||
logout: '退出登录',
|
||||
logoutConfirm: '确认退出登录吗?',
|
||||
lookForward: '敬请期待',
|
||||
modify: '修改',
|
||||
modifySuccess: '修改成功',
|
||||
noData: '无数据',
|
||||
operate: '操作',
|
||||
pleaseCheckValue: '请检查输入的值是否合法',
|
||||
refresh: '刷新',
|
||||
reset: '重置',
|
||||
search: '搜索',
|
||||
switch: '切换',
|
||||
tip: '提示',
|
||||
update: '更新',
|
||||
updateSuccess: '更新成功',
|
||||
|
4
src/typings/app.d.ts
vendored
4
src/typings/app.d.ts
vendored
@ -255,6 +255,7 @@ declare namespace App {
|
||||
backToHome: string;
|
||||
batchDelete: string;
|
||||
cancel: string;
|
||||
close: string;
|
||||
check: string;
|
||||
columnSetting: string;
|
||||
confirm: string;
|
||||
@ -263,16 +264,19 @@ declare namespace App {
|
||||
confirmDelete: string;
|
||||
edit: string;
|
||||
index: string;
|
||||
keywordSearch: string;
|
||||
logout: string;
|
||||
logoutConfirm: string;
|
||||
lookForward: string;
|
||||
modify: string;
|
||||
modifySuccess: string;
|
||||
noData: string;
|
||||
operate: string;
|
||||
pleaseCheckValue: string;
|
||||
refresh: string;
|
||||
reset: string;
|
||||
search: string;
|
||||
switch: string;
|
||||
tip: string;
|
||||
update: string;
|
||||
updateSuccess: string;
|
||||
|
Loading…
Reference in New Issue
Block a user