@opendesign-plus-test/components 0.0.1-rc.59 → 0.0.1-rc.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-OElCookieNotice.cjs.js +1 -1
- package/dist/chunk-OElCookieNotice.es.js +28 -28
- package/dist/components/OBanner.vue.d.ts +11 -0
- package/dist/components/OHeaderSearch.vue.d.ts +22 -22
- package/dist/components/OHeaderUser.vue.d.ts +1 -1
- package/dist/components/OThemeSwitcher.vue.d.ts +1 -1
- package/dist/components/activity/OActivityMyCalendar.vue.d.ts +4 -4
- package/dist/components/activity/index.d.ts +2 -2
- package/dist/components/header/types.d.ts +0 -1
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +2 -2
- package/dist/components/meeting/OMeetingForm.vue.d.ts +2 -0
- package/dist/components/meeting/OMeetingMyCalendar.vue.d.ts +4 -4
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +1 -1
- package/dist/components/meeting/index.d.ts +9 -3
- package/dist/components/meeting/types.d.ts +4 -2
- package/dist/components/search/OSearchInput.vue.d.ts +22 -22
- package/dist/components/search/index.d.ts +11 -11
- package/dist/components/search/internal/SearchImageInput.vue.d.ts +17 -17
- package/dist/components.cjs.js +39 -39
- package/dist/components.css +1 -1
- package/dist/components.es.js +8558 -8725
- package/dist/index.d.ts +2 -3
- package/package.json +3 -3
- package/scripts/generate-components-index.js +1 -1
- package/src/components/OBanner.vue +398 -0
- package/src/components/OHeaderSearch.vue +1 -1
- package/src/components/activity/OActivityMyCalendar.vue +1 -1
- package/src/components/header/types.ts +0 -1
- package/src/components/meeting/OMeetingCalendar.vue +4 -4
- package/src/components/meeting/OMeetingForm.vue +13 -21
- package/src/components/meeting/components/OMeetingCalendarList.vue +2 -6
- package/src/components/meeting/components/OMeetingDetail.vue +3 -17
- package/src/components/meeting/types.ts +4 -2
- package/src/components/search/OSearchInput.vue +2 -2
- package/src/i18n/en.ts +1 -1
- package/src/i18n/zh.ts +1 -1
- package/src/index.ts +3 -4
- package/dist/components/OLanguageSwitcher.vue.d.ts +0 -49
- package/dist/components/banner/OBanner.vue.d.ts +0 -13
- package/dist/components/banner/OBannerContent.vue.d.ts +0 -7
- package/dist/components/banner/index.d.ts +0 -68
- package/dist/components/banner/types.d.ts +0 -31
- package/src/components/OLanguageSwitcher.vue +0 -211
- package/src/components/banner/OBanner.vue +0 -288
- package/src/components/banner/OBannerContent.vue +0 -175
- package/src/components/banner/index.ts +0 -18
- package/src/components/banner/types.ts +0 -39
|
@@ -37,7 +37,7 @@ export interface OptionItemT {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
export type PlatformT = 'welink' | 'tencent' | 'zoom' | 'WELINK' | 'TENCENT' | 'ZOOM'
|
|
40
|
+
export type PlatformT = 'welink' | 'tencent' | 'zoom' | 'WELINK' | 'TENCENT' | 'ZOOM';
|
|
41
41
|
|
|
42
42
|
export enum MeetingGroupType {
|
|
43
43
|
SIG = 'sig',
|
|
@@ -63,7 +63,7 @@ export interface MeetingPostT {
|
|
|
63
63
|
topic: string; // 会议主题 128
|
|
64
64
|
sponsor?: string; // 会议发起人 20
|
|
65
65
|
group_name: string; // 所属SIG 64
|
|
66
|
-
platform: PlatformT
|
|
66
|
+
platform: PlatformT; // 会议平台
|
|
67
67
|
date: string; // 会议日期
|
|
68
68
|
date_range?: string[]; // 日期返回
|
|
69
69
|
time: string; // 会议时间
|
|
@@ -88,6 +88,8 @@ export interface MeetingPostT {
|
|
|
88
88
|
|
|
89
89
|
export interface MeetingFormPropsT {
|
|
90
90
|
data?: MeetingItemT;
|
|
91
|
+
isSub?: boolean;
|
|
92
|
+
isEdit?: boolean;
|
|
91
93
|
subId?: string;
|
|
92
94
|
createMeetingRequest: any,
|
|
93
95
|
editMeetingRequest: any;
|
|
@@ -230,7 +230,7 @@ const handleSuggestClick = (item: OSearchRecommendItem) => {
|
|
|
230
230
|
emit('recommend-click', item);
|
|
231
231
|
suppressNextInput = true;
|
|
232
232
|
innerValue.value = item.key;
|
|
233
|
-
runSearch();
|
|
233
|
+
runSearch(item.key);
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
const handleOnestepClick = (item: OSearchRecommendItem) => {
|
|
@@ -267,7 +267,7 @@ const handleSuggestListClick = (val: string) => {
|
|
|
267
267
|
emit('suggest-list-click', text);
|
|
268
268
|
suppressNextInput = true;
|
|
269
269
|
innerValue.value = text;
|
|
270
|
-
runSearch();
|
|
270
|
+
runSearch(text);
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
const onPreviewChange = (visible: boolean) => {
|
package/src/i18n/en.ts
CHANGED
|
@@ -146,7 +146,7 @@ export default {
|
|
|
146
146
|
'meeting.groups': 'Groups',
|
|
147
147
|
'meeting.activityAddress': 'Address',
|
|
148
148
|
'meeting.livePlatform': 'Live Platform',
|
|
149
|
-
'meeting.meetingTopic': 'Topics',
|
|
149
|
+
'meeting.meetingTopic': 'Topics: ',
|
|
150
150
|
'meeting.meetingDetail': 'Details',
|
|
151
151
|
'meeting.meetingEtherpad': 'Etherpad',
|
|
152
152
|
'meeting.meetingReplay': 'Playback',
|
package/src/i18n/zh.ts
CHANGED
|
@@ -145,7 +145,7 @@ export default {
|
|
|
145
145
|
'meeting.groups': '工作组',
|
|
146
146
|
'meeting.activityAddress': '活动地点',
|
|
147
147
|
'meeting.livePlatform': '直播平台',
|
|
148
|
-
'meeting.meetingTopic': '
|
|
148
|
+
'meeting.meetingTopic': '会议主题:',
|
|
149
149
|
'meeting.meetingDetail': '会议详情',
|
|
150
150
|
'meeting.meetingEtherpad': '会议纪要',
|
|
151
151
|
'meeting.meetingReplay': '智能回放',
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// OpenDesignPlus Components 库入口文件
|
|
2
2
|
// 此文件由 scripts/generate-components-index.js 自动生成
|
|
3
3
|
|
|
4
|
+
import OBanner from './components/OBanner.vue';
|
|
4
5
|
import OCookieNotice from './components/OCookieNotice.vue';
|
|
5
6
|
import OFooter from './components/OFooter.vue';
|
|
6
7
|
import OHeaderSearch from './components/OHeaderSearch.vue';
|
|
7
8
|
import OHeaderUser from './components/OHeaderUser.vue';
|
|
8
|
-
import OLanguageSwitcher from './components/OLanguageSwitcher.vue';
|
|
9
9
|
import OPlusConfigProvider from './components/OPlusConfigProvider.vue';
|
|
10
10
|
import OSection from './components/OSection.vue';
|
|
11
11
|
import OSourceCode from './components/OSourceCode.vue';
|
|
@@ -13,11 +13,11 @@ import OThemeSwitcher from './components/OThemeSwitcher.vue';
|
|
|
13
13
|
|
|
14
14
|
// 导出组件
|
|
15
15
|
const components = {
|
|
16
|
+
OBanner,
|
|
16
17
|
OCookieNotice,
|
|
17
18
|
OFooter,
|
|
18
19
|
OHeaderSearch,
|
|
19
20
|
OHeaderUser,
|
|
20
|
-
OLanguageSwitcher,
|
|
21
21
|
OPlusConfigProvider,
|
|
22
22
|
OSection,
|
|
23
23
|
OSourceCode,
|
|
@@ -25,11 +25,10 @@ const components = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// 导出单个组件
|
|
28
|
-
export { OCookieNotice, OFooter, OHeaderSearch, OHeaderUser,
|
|
28
|
+
export { OBanner, OCookieNotice, OFooter, OHeaderSearch, OHeaderUser, OPlusConfigProvider, OSection, OSourceCode, OThemeSwitcher };
|
|
29
29
|
|
|
30
30
|
// 重新导出子目录中的组件
|
|
31
31
|
export * from './components/activity';
|
|
32
|
-
export * from './components/banner';
|
|
33
32
|
export * from './components/element-plus';
|
|
34
33
|
export * from './components/events';
|
|
35
34
|
export * from './components/header';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export interface LanguageOptionT {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
simple: string;
|
|
5
|
-
}
|
|
6
|
-
declare const _default: import('../../vue/dist/vue.esm-bundler.js').DefineComponent<import('../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
7
|
-
options: {
|
|
8
|
-
type: () => LanguageOptionT[];
|
|
9
|
-
default(): {
|
|
10
|
-
id: string;
|
|
11
|
-
label: string;
|
|
12
|
-
simple: string;
|
|
13
|
-
}[];
|
|
14
|
-
};
|
|
15
|
-
type: {
|
|
16
|
-
type: () => "auto" | "common" | "mobile";
|
|
17
|
-
default: string;
|
|
18
|
-
};
|
|
19
|
-
auto: {
|
|
20
|
-
type: BooleanConstructor;
|
|
21
|
-
default: boolean;
|
|
22
|
-
};
|
|
23
|
-
}>, {}, {}, {}, {}, import('../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
|
|
24
|
-
change: (...args: any[]) => void;
|
|
25
|
-
}, string, import('../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<import('../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
26
|
-
options: {
|
|
27
|
-
type: () => LanguageOptionT[];
|
|
28
|
-
default(): {
|
|
29
|
-
id: string;
|
|
30
|
-
label: string;
|
|
31
|
-
simple: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
34
|
-
type: {
|
|
35
|
-
type: () => "auto" | "common" | "mobile";
|
|
36
|
-
default: string;
|
|
37
|
-
};
|
|
38
|
-
auto: {
|
|
39
|
-
type: BooleanConstructor;
|
|
40
|
-
default: boolean;
|
|
41
|
-
};
|
|
42
|
-
}>> & Readonly<{
|
|
43
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
44
|
-
}>, {
|
|
45
|
-
type: "auto" | "mobile" | "common";
|
|
46
|
-
auto: boolean;
|
|
47
|
-
options: LanguageOptionT[];
|
|
48
|
-
}, {}, {}, {}, string, import('../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, any>;
|
|
49
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BannerItem } from './types';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
options?: BannerItem | BannerItem[];
|
|
4
|
-
size?: 'large' | 'medium' | 'small' | 'tiny';
|
|
5
|
-
contentJustifyCenter?: boolean;
|
|
6
|
-
autoPlay?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: import('../../../vue/dist/vue.esm-bundler.js').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
9
|
-
click: (href: string | undefined) => any;
|
|
10
|
-
}, string, import('../../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
12
|
-
}>, {}, {}, {}, {}, string, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BannerContentProps } from './types';
|
|
2
|
-
declare const _default: import('../../../vue/dist/vue.esm-bundler.js').DefineComponent<BannerContentProps, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
3
|
-
click: (href: string | undefined) => any;
|
|
4
|
-
}, string, import('../../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<BannerContentProps> & Readonly<{
|
|
5
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
6
|
-
}>, {}, {}, {}, {}, string, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, false, {}, any>;
|
|
7
|
-
export default _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { App } from '../../../vue/dist/vue.esm-bundler.js';
|
|
2
|
-
declare const OBanner: {
|
|
3
|
-
new (...args: any[]): import('../../../vue/dist/vue.esm-bundler.js').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
4
|
-
options?: import('./types').BannerItem | import('./types').BannerItem[];
|
|
5
|
-
size?: "large" | "medium" | "small" | "tiny";
|
|
6
|
-
contentJustifyCenter?: boolean;
|
|
7
|
-
autoPlay?: boolean;
|
|
8
|
-
}> & Readonly<{
|
|
9
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
10
|
-
}>, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
11
|
-
click: (href: string | undefined) => any;
|
|
12
|
-
}, import('../../../vue/dist/vue.esm-bundler.js').PublicProps, {}, false, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').GlobalComponents, import('../../../vue/dist/vue.esm-bundler.js').GlobalDirectives, string, {}, HTMLDivElement, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, {
|
|
13
|
-
P: {};
|
|
14
|
-
B: {};
|
|
15
|
-
D: {};
|
|
16
|
-
C: {};
|
|
17
|
-
M: {};
|
|
18
|
-
Defaults: {};
|
|
19
|
-
}, Readonly<{
|
|
20
|
-
options?: import('./types').BannerItem | import('./types').BannerItem[];
|
|
21
|
-
size?: "large" | "medium" | "small" | "tiny";
|
|
22
|
-
contentJustifyCenter?: boolean;
|
|
23
|
-
autoPlay?: boolean;
|
|
24
|
-
}> & Readonly<{
|
|
25
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
26
|
-
}>, {}, {}, {}, {}, {}>;
|
|
27
|
-
__isFragment?: never;
|
|
28
|
-
__isTeleport?: never;
|
|
29
|
-
__isSuspense?: never;
|
|
30
|
-
} & import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsBase<Readonly<{
|
|
31
|
-
options?: import('./types').BannerItem | import('./types').BannerItem[];
|
|
32
|
-
size?: "large" | "medium" | "small" | "tiny";
|
|
33
|
-
contentJustifyCenter?: boolean;
|
|
34
|
-
autoPlay?: boolean;
|
|
35
|
-
}> & Readonly<{
|
|
36
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
37
|
-
}>, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
38
|
-
click: (href: string | undefined) => any;
|
|
39
|
-
}, string, {}, {}, string, {}, import('../../../vue/dist/vue.esm-bundler.js').GlobalComponents, import('../../../vue/dist/vue.esm-bundler.js').GlobalDirectives, string, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions> & import('../../../vue/dist/vue.esm-bundler.js').VNodeProps & import('../../../vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('../../../vue/dist/vue.esm-bundler.js').ComponentCustomProps & {
|
|
40
|
-
install(app: App): void;
|
|
41
|
-
};
|
|
42
|
-
declare const OBannerContent: {
|
|
43
|
-
new (...args: any[]): import('../../../vue/dist/vue.esm-bundler.js').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').BannerContentProps> & Readonly<{
|
|
44
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
45
|
-
}>, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
46
|
-
click: (href: string | undefined) => any;
|
|
47
|
-
}, import('../../../vue/dist/vue.esm-bundler.js').PublicProps, {}, false, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').GlobalComponents, import('../../../vue/dist/vue.esm-bundler.js').GlobalDirectives, string, {}, any, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, {
|
|
48
|
-
P: {};
|
|
49
|
-
B: {};
|
|
50
|
-
D: {};
|
|
51
|
-
C: {};
|
|
52
|
-
M: {};
|
|
53
|
-
Defaults: {};
|
|
54
|
-
}, Readonly<import('./types').BannerContentProps> & Readonly<{
|
|
55
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
56
|
-
}>, {}, {}, {}, {}, {}>;
|
|
57
|
-
__isFragment?: never;
|
|
58
|
-
__isTeleport?: never;
|
|
59
|
-
__isSuspense?: never;
|
|
60
|
-
} & import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsBase<Readonly<import('./types').BannerContentProps> & Readonly<{
|
|
61
|
-
onClick?: ((href: string | undefined) => any) | undefined;
|
|
62
|
-
}>, {}, {}, {}, {}, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {} & {
|
|
63
|
-
click: (href: string | undefined) => any;
|
|
64
|
-
}, string, {}, {}, string, {}, import('../../../vue/dist/vue.esm-bundler.js').GlobalComponents, import('../../../vue/dist/vue.esm-bundler.js').GlobalDirectives, string, import('../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions> & import('../../../vue/dist/vue.esm-bundler.js').VNodeProps & import('../../../vue/dist/vue.esm-bundler.js').AllowedComponentProps & import('../../../vue/dist/vue.esm-bundler.js').ComponentCustomProps & {
|
|
65
|
-
install(app: App): void;
|
|
66
|
-
};
|
|
67
|
-
export { OBanner, OBannerContent };
|
|
68
|
-
export * from './types';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface BannerItem {
|
|
2
|
-
title?: string;
|
|
3
|
-
subtitle?: string;
|
|
4
|
-
bg: string;
|
|
5
|
-
text_theme?: 'light' | 'dark';
|
|
6
|
-
bg_text?: string;
|
|
7
|
-
pc_text_width?: string;
|
|
8
|
-
pc_text_height?: string;
|
|
9
|
-
pad_text_width?: string;
|
|
10
|
-
pad_text_height?: string;
|
|
11
|
-
attach?: string;
|
|
12
|
-
href?: string;
|
|
13
|
-
btn?: string;
|
|
14
|
-
withStickyBg?: boolean;
|
|
15
|
-
pad_offset?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface BannerContentProps {
|
|
18
|
-
info: BannerItem;
|
|
19
|
-
size?: 'large' | 'medium' | 'small' | 'tiny';
|
|
20
|
-
contentJustifyCenter?: boolean;
|
|
21
|
-
isPhone?: boolean;
|
|
22
|
-
isLight?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface HomeBannerEmits {
|
|
25
|
-
(e: 'before-change', index: number): void;
|
|
26
|
-
(e: 'click', href: string | undefined): void;
|
|
27
|
-
}
|
|
28
|
-
export interface BannerContentEmits {
|
|
29
|
-
(e: 'click', href: string | undefined): void;
|
|
30
|
-
}
|
|
31
|
-
export type ComponentSize = 'large' | 'medium' | 'small' | 'tiny';
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { useLocale, useScreen } from '@opendesign-plus/composables';
|
|
4
|
-
import { OIcon, ODropdown, ODropdownItem } from '@opensig/opendesign';
|
|
5
|
-
|
|
6
|
-
import IconLocale from '~icons/components/icon-locale.svg';
|
|
7
|
-
|
|
8
|
-
export interface LanguageOptionT {
|
|
9
|
-
id: string;
|
|
10
|
-
label: string;
|
|
11
|
-
simple: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const props = defineProps({
|
|
15
|
-
options: {
|
|
16
|
-
type: Array as () => LanguageOptionT[],
|
|
17
|
-
default() {
|
|
18
|
-
return [
|
|
19
|
-
{ id: 'zh', label: '简体中文', simple: '中' },
|
|
20
|
-
{ id: 'en', label: 'English', simple: 'EN' },
|
|
21
|
-
];
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
type: {
|
|
25
|
-
type: String as () => 'auto' | 'common' | 'mobile',
|
|
26
|
-
default: 'auto',
|
|
27
|
-
},
|
|
28
|
-
auto: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: true,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const { changeLocale, locale } = useLocale();
|
|
35
|
-
|
|
36
|
-
const { lePadV } = useScreen();
|
|
37
|
-
const lang = computed(() => {
|
|
38
|
-
return locale.value;
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// 选择语言
|
|
43
|
-
const emits = defineEmits(['change']);
|
|
44
|
-
const changeLanguage = (newlang: LanguageOptionT) => {
|
|
45
|
-
if (props.auto) {
|
|
46
|
-
changeLocale();
|
|
47
|
-
}
|
|
48
|
-
emits('change', newlang);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const getLang = (lang: String, simple?: boolean) => {
|
|
52
|
-
const item = props.options.find((el: LanguageOptionT) => el.id === lang);
|
|
53
|
-
if (item) {
|
|
54
|
-
return simple ? item.simple : item.label;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const defaultLang = props.options[0];
|
|
58
|
-
return simple ? defaultLang.simple : defaultLang.label;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const isCommon = computed(() => {
|
|
62
|
-
return props.type === 'common' || (props.type === 'auto' && !lePadV.value);
|
|
63
|
-
});
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<template>
|
|
67
|
-
<div
|
|
68
|
-
v-if="isCommon"
|
|
69
|
-
:class="options.length <= 1 ? 'hide-lang' : 'header-lang'"
|
|
70
|
-
>
|
|
71
|
-
<ODropdown
|
|
72
|
-
trigger="hover"
|
|
73
|
-
optionPosition="bottom"
|
|
74
|
-
option-wrap-class="dropdown"
|
|
75
|
-
>
|
|
76
|
-
<div class="info-wrap">
|
|
77
|
-
<OIcon class="icon">
|
|
78
|
-
<IconLocale />
|
|
79
|
-
<div :class="['locale-tag', { 'is-en': lang === 'en' }]">{{ getLang(lang, true) }}</div>
|
|
80
|
-
</OIcon>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<template #dropdown>
|
|
84
|
-
<ODropdownItem
|
|
85
|
-
v-for="item in options"
|
|
86
|
-
@click="changeLanguage(item)"
|
|
87
|
-
:key="item.id"
|
|
88
|
-
:class="['list', { 'is-active': lang === item.id }]"
|
|
89
|
-
>
|
|
90
|
-
{{ getLang(item.id) }}
|
|
91
|
-
</ODropdownItem>
|
|
92
|
-
</template>
|
|
93
|
-
</ODropdown>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
<div
|
|
97
|
-
v-else
|
|
98
|
-
:class="options.length <= 1 ? 'hide-lang' : 'mobile-change-language'"
|
|
99
|
-
>
|
|
100
|
-
<span
|
|
101
|
-
v-for="item in options"
|
|
102
|
-
:key="item.id"
|
|
103
|
-
:class="{ active: lang === item.id }"
|
|
104
|
-
@click.stop="changeLanguage(item)"
|
|
105
|
-
>{{ getLang(item.id, true) }}</span
|
|
106
|
-
>
|
|
107
|
-
</div>
|
|
108
|
-
</template>
|
|
109
|
-
|
|
110
|
-
<style lang="scss" scoped>
|
|
111
|
-
.hide-lang {
|
|
112
|
-
display: none;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.header-lang {
|
|
116
|
-
height: calc(100% + 10px);
|
|
117
|
-
display: flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
|
|
120
|
-
.info-wrap {
|
|
121
|
-
height: 100%;
|
|
122
|
-
display: flex;
|
|
123
|
-
align-items: center;
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
|
|
126
|
-
.icon {
|
|
127
|
-
font-size: var(--o-icon_size_control-m);
|
|
128
|
-
position: relative;
|
|
129
|
-
color: var(--o-color-info1);
|
|
130
|
-
|
|
131
|
-
&:hover {
|
|
132
|
-
color: var(--o-color-primary1);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
.locale-tag {
|
|
136
|
-
position: absolute;
|
|
137
|
-
font-size: 10px;
|
|
138
|
-
height: 12px;
|
|
139
|
-
width: 12px;
|
|
140
|
-
background-color: var(--o-color-fill2);
|
|
141
|
-
|
|
142
|
-
display: flex;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
align-items: center;
|
|
145
|
-
left: 12px;
|
|
146
|
-
top: 11px;
|
|
147
|
-
|
|
148
|
-
&.is-en {
|
|
149
|
-
width: 16px;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
.list {
|
|
154
|
-
background: var(--o-color-fill2);
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
box-shadow: var(--o-shadow-1);
|
|
157
|
-
border-radius: var(--o-radius_control-xs);
|
|
158
|
-
padding: var(--o-gap-1);
|
|
159
|
-
width: 144px;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.o-dropdown {
|
|
164
|
-
height: 100%;
|
|
165
|
-
}
|
|
166
|
-
.o-dropdown-item {
|
|
167
|
-
background: var(--o-color-fill2);
|
|
168
|
-
cursor: pointer;
|
|
169
|
-
border-radius: var(--o-radius_control-xs);
|
|
170
|
-
padding: var(--o-gap-1);
|
|
171
|
-
min-width: 144px;
|
|
172
|
-
height: 40px;
|
|
173
|
-
color: var(--o-color-info1);
|
|
174
|
-
|
|
175
|
-
@include hover {
|
|
176
|
-
background: var(--o-color-control2-light);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
&.is-active {
|
|
180
|
-
color: var(--o-color-primary1);
|
|
181
|
-
background: var(--o-color-control3-light);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
.dropdown {
|
|
185
|
-
--dropdown-list-radius: var(--o-radius-xs);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.mobile-change-language {
|
|
189
|
-
display: flex;
|
|
190
|
-
align-items: center;
|
|
191
|
-
height: 36px;
|
|
192
|
-
span {
|
|
193
|
-
color: var(--o-color-info1);
|
|
194
|
-
margin-right: var(--o-gap-1);
|
|
195
|
-
text-align: center;
|
|
196
|
-
@include text1;
|
|
197
|
-
cursor: pointer;
|
|
198
|
-
&.active {
|
|
199
|
-
color: var(--o-color-primary1);
|
|
200
|
-
font-weight: 500;
|
|
201
|
-
}
|
|
202
|
-
&:not(:last-child) {
|
|
203
|
-
&:after {
|
|
204
|
-
content: '|';
|
|
205
|
-
margin-left: var(--o-gap-1);
|
|
206
|
-
color: var(--o-color-info1);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
</style>
|