Skip to content

Commit efbde0d

Browse files
committed
perf(i18n): merge common lang
1 parent fb57cf7 commit efbde0d

File tree

47 files changed

+175
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+175
-102
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"stylelint-order": "^4.1.0",
9797
"ts-node": "^9.1.0",
9898
"typescript": "^4.1.3",
99-
"vite": "^2.0.0-beta.22",
99+
"vite": "^2.0.0-beta.23",
100100
"vite-plugin-html": "^2.0.0-beta.5",
101101
"vite-plugin-mock": "^2.0.0-beta.3",
102102
"vite-plugin-purge-icons": "^0.5.0",

src/components/Application/src/search/AppSearch.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div :class="prefixCls" v-if="getShowSearch" @click.stop="handleSearch">
33
<Tooltip>
4-
<template #title> {{ t('component.app.search') }} </template>
4+
<template #title> {{ t('common.searchText') }} </template>
55
<SearchOutlined />
66
</Tooltip>
77

src/components/Application/src/search/AppSearchFooter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<span :class="`${prefixCls}__item`">
1616
<g-icon icon="mdi:keyboard-esc" />
1717
</span>
18-
<span>{{ t('component.app.toClose') }}</span>
18+
<span>{{ t('common.closeText') }}</span>
1919
</div>
2020
</template>
2121
<script lang="ts">
@@ -47,7 +47,7 @@
4747
font-size: 12px;
4848
color: #666;
4949
background: rgb(255 255 255);
50-
border-radius: 0 0 8px 8px;
50+
border-radius: 0 0 16px 16px;
5151
box-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgba(69, 98, 155, 0.12);
5252
align-items: center;
5353
flex-shrink: 0;

src/components/Application/src/search/AppSearchModal.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div :class="`${prefixCls}-input__wrapper`">
88
<a-input
99
:class="`${prefixCls}-input`"
10-
:placeholder="t('component.app.search')"
10+
:placeholder="t('common.searchText')"
1111
allow-clear
1212
@change="handleSearch"
1313
>
@@ -16,7 +16,7 @@
1616
</template>
1717
</a-input>
1818
<span :class="`${prefixCls}-cancel`" @click="handleClose">{{
19-
t('component.app.cancel')
19+
t('common.cancelText')
2020
}}</span>
2121
</div>
2222

@@ -116,6 +116,7 @@
116116
scrollWrap,
117117
handleMouseenter,
118118
handleClose: () => {
119+
searchResult.value = [];
119120
emit('close');
120121
},
121122
};
@@ -135,7 +136,7 @@
135136
height: 100%;
136137
padding-top: 50px;
137138
// background: #656c85cc;
138-
background: rgba(0, 0, 0, 0.8);
139+
background: rgba(0, 0, 0, 0.25);
139140
justify-content: center;
140141
// backdrop-filter: blur(2px);
141142
@@ -178,12 +179,13 @@
178179
179180
&-content {
180181
position: relative;
181-
width: 532px;
182+
width: 632px;
182183
// padding: 14px;
183184
margin: 0 auto auto auto;
184185
background: #f5f6f7;
185-
border-radius: 6px;
186-
box-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64;
186+
border-radius: 16px;
187+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
188+
// box-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64;
187189
flex-direction: column;
188190
}
189191
@@ -196,9 +198,10 @@
196198
197199
&-input {
198200
width: 100%;
199-
height: 56px;
201+
height: 48px;
200202
font-size: 1.5em;
201203
color: #1c1e21;
204+
border-radius: 6px;
202205
203206
span[role='img'] {
204207
color: #999;

src/components/Application/src/search/useMenuSearch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cloneDeep } from 'lodash-es';
2-
import { ref, onBeforeMount, unref, Ref } from 'vue';
2+
import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue';
33
import { useI18n } from '/@/hooks/web/useI18n';
44
import { getMenus } from '/@/router/menus';
55
import type { Menu } from '/@/router/types';
@@ -130,7 +130,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
130130
start();
131131
}
132132

133-
function handleEnter() {
133+
async function handleEnter() {
134134
if (!searchResult.value.length) return;
135135
const result = unref(searchResult);
136136
const index = unref(activeIndex);
@@ -139,10 +139,12 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
139139
}
140140
const to = result[index];
141141
handleClose();
142+
await nextTick();
142143
go(to.path);
143144
}
144145

145146
function handleClose() {
147+
searchResult.value = [];
146148
emit('close');
147149
}
148150

src/components/Button/src/PopConfirmButton.vue

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
11
<script lang="ts">
2-
import { defineComponent, h, unref } from 'vue';
2+
import { defineComponent, h, unref, computed } from 'vue';
33
44
import { Popconfirm } from 'ant-design-vue';
55
import BasicButton from './BasicButton.vue';
66
import { propTypes } from '/@/utils/propTypes';
77
import { useI18n } from '/@/hooks/web/useI18n';
88
import { extendSlots } from '/@/utils/helper/tsxHelper';
99
import { omit } from 'lodash-es';
10-
const { t } = useI18n();
1110
1211
export default defineComponent({
1312
name: 'PopButton',
1413
inheritAttrs: false,
1514
components: { Popconfirm, BasicButton },
1615
props: {
1716
enable: propTypes.bool.def(true),
18-
okText: propTypes.string.def(t('component.drawer.okText')),
19-
cancelText: propTypes.string.def(t('component.drawer.cancelText')),
17+
okText: propTypes.string,
18+
cancelText: propTypes.string,
2019
},
2120
setup(props, { slots, attrs }) {
22-
return () => {
23-
const popValues = { ...props, ...unref(attrs) };
21+
const { t } = useI18n();
2422
23+
const getBindValues = computed(() => {
24+
const popValues = Object.assign(
25+
{
26+
okText: t('common.okText'),
27+
cancelText: t('common.cancelText'),
28+
},
29+
{ ...props, ...unref(attrs) }
30+
);
31+
return popValues;
32+
});
33+
return () => {
2534
const Button = h(BasicButton, omit(unref(attrs), 'icon'), extendSlots(slots));
2635
if (!props.enable) {
2736
return Button;
2837
}
2938
30-
return h(Popconfirm, omit(popValues, 'icon'), { default: () => Button });
39+
return h(Popconfirm, omit(unref(getBindValues), 'icon'), { default: () => Button });
3140
};
3241
},
3342
});

src/components/Drawer/src/BasicDrawer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<ScrollContainer
1717
:style="getScrollContentStyle"
1818
v-loading="getLoading"
19-
:loading-tip="loadingText || t('component.drawer.loadingText')"
19+
:loading-tip="loadingText || t('common.loadingText')"
2020
>
2121
<slot />
2222
</ScrollContainer>

src/components/Drawer/src/props.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export const footerProps = {
1111
*/
1212
showCancelBtn: propTypes.bool.def(true),
1313
cancelButtonProps: Object as PropType<Recordable>,
14-
cancelText: propTypes.string.def(t('component.drawer.cancelText')),
14+
cancelText: propTypes.string.def(t('common.cancelText')),
1515
/**
1616
* @description: Show confirmation button
1717
*/
1818
showOkBtn: propTypes.bool.def(true),
1919
okButtonProps: Object as PropType<Recordable>,
20-
okText: propTypes.string.def(t('component.drawer.okText')),
20+
okText: propTypes.string.def(t('common.okText')),
2121
okType: propTypes.string.def('primary'),
2222
showFooter: propTypes.bool,
2323
footerHeight: {

src/components/Form/src/components/FormAction.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
(): ButtonOptions => {
102102
return Object.assign(
103103
{
104-
text: t('component.form.resetButton'),
104+
text: t('common.resetText'),
105105
},
106106
props.resetButtonOptions
107107
);
@@ -111,7 +111,7 @@
111111
const getSubmitBtnOptions = computed(() => {
112112
return Object.assign(
113113
{
114-
text: t('component.form.submitButton'),
114+
text: t('common.queryText'),
115115
},
116116
props.submitButtonOptions
117117
);

src/components/Form/src/helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const { t } = useI18n();
1010
*/
1111
export function createPlaceholderMessage(component: ComponentType) {
1212
if (component.includes('Input') || component.includes('Complete')) {
13-
return t('component.form.input');
13+
return t('common.inputText');
1414
}
1515
if (component.includes('Picker')) {
16-
return t('component.form.choose');
16+
return t('common.chooseText');
1717
}
1818
if (
1919
component.includes('Select') ||
@@ -23,7 +23,7 @@ export function createPlaceholderMessage(component: ComponentType) {
2323
component.includes('Switch')
2424
) {
2525
// return `请选择${label}`;
26-
return t('component.form.choose');
26+
return t('common.chooseText');
2727
}
2828
return '';
2929
}

0 commit comments

Comments
 (0)