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